|
|
var zN=Object.defineProperty;var zE=t=>{throw TypeError(t)};var $N=(t,e,n)=>e in t?zN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var M=(t,e,n)=>$N(t,typeof e!="symbol"?e+"":e,n),ov=(t,e,n)=>e.has(t)||zE("Cannot "+n);var G=(t,e,n)=>(ov(t,e,"read from private field"),n?n.call(t):e.get(t)),St=(t,e,n)=>e.has(t)?zE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Xe=(t,e,n,r)=>(ov(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Wt=(t,e,n)=>(ov(t,e,"access private method"),n);var Jd=(t,e,n,r)=>({set _(i){Xe(t,e,i,n)},get _(){return G(t,e,r)}});function VN(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function by(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var lv={exports:{}},Du={};/**
|
|
|
* @license React
|
|
|
* react-jsx-runtime.production.js
|
|
|
*
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var $E;function HN(){if($E)return Du;$E=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var u in i)u!=="key"&&(a[u]=i[u])}else a=i;return i=a.ref,{$$typeof:t,type:r,key:l,ref:i!==void 0?i:null,props:a}}return Du.Fragment=e,Du.jsx=n,Du.jsxs=n,Du}var VE;function jN(){return VE||(VE=1,lv.exports=HN()),lv.exports}var Vr=jN(),Uf=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(){}},Uo=typeof window>"u"||"Deno"in globalThis;function xi(){}function WN(t,e){return typeof t=="function"?t(e):t}function v0(t){return typeof t=="number"&&t>=0&&t!==1/0}function zA(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Gl(t,e){return typeof t=="function"?t(e):t}function Yi(t,e){return typeof t=="function"?t(e):t}function HE(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:u}=t;if(l){if(r){if(e.queryHash!==Sy(l,e.options))return!1}else if(!hf(e.queryKey,l))return!1}if(n!=="all"){const f=e.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||i&&i!==e.state.fetchStatus||a&&!a(e))}function jE(t,e){const{exact:n,status:r,predicate:i,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(n){if(df(e.options.mutationKey)!==df(a))return!1}else if(!hf(e.options.mutationKey,a))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function Sy(t,e){return((e==null?void 0:e.queryKeyHashFn)||df)(t)}function df(t){return JSON.stringify(t,(e,n)=>y0(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function hf(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!hf(t[n],e[n])):!1}function $A(t,e){if(t===e)return t;const n=WE(t)&&WE(e);if(n||y0(t)&&y0(e)){const r=n?t:Object.keys(t),i=r.length,a=n?e:Object.keys(e),l=a.length,u=n?[]:{};let f=0;for(let h=0;h<l;h++){const g=n?h:a[h];(!n&&r.includes(g)||n)&&t[g]===void 0&&e[g]===void 0?(u[g]=void 0,f++):(u[g]=$A(t[g],e[g]),u[g]===t[g]&&t[g]!==void 0&&f++)}return i===l&&f===i?t:u}return e}function _0(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function WE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function y0(t){if(!XE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!XE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function XE(t){return Object.prototype.toString.call(t)==="[object Object]"}function XN(t){return new Promise(e=>{setTimeout(e,t)})}function b0(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?$A(t,e):e}function qN(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function YN(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Ey=Symbol();function VA(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Ey?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var wo,Ca,sc,OA,KN=(OA=class extends Uf{constructor(){super();St(this,wo);St(this,Ca);St(this,sc);Xe(this,sc,e=>{if(!Uo&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){G(this,Ca)||this.setEventListener(G(this,sc))}onUnsubscribe(){var e;this.hasListeners()||((e=G(this,Ca))==null||e.call(this),Xe(this,Ca,void 0))}setEventListener(e){var n;Xe(this,sc,e),(n=G(this,Ca))==null||n.call(this),Xe(this,Ca,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){G(this,wo)!==e&&(Xe(this,wo,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof G(this,wo)=="boolean"?G(this,wo):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},wo=new WeakMap,Ca=new WeakMap,sc=new WeakMap,OA),wy=new KN,ac,Aa,oc,PA,ZN=(PA=class extends Uf{constructor(){super();St(this,ac,!0);St(this,Aa);St(this,oc);Xe(this,oc,e=>{if(!Uo&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){G(this,Aa)||this.setEventListener(G(this,oc))}onUnsubscribe(){var e;this.hasListeners()||((e=G(this,Aa))==null||e.call(this),Xe(this,Aa,void 0))}setEventListener(e){var n;Xe(this,oc,e),(n=G(this,Aa))==null||n.call(this),Xe(this,Aa,e(this.setOnline.bind(this)))}setOnline(e){G(this,ac)!==e&&(Xe(this,ac,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return G(this,ac)}},ac=new WeakMap,Aa=new WeakMap,oc=new WeakMap,PA),Lh=new ZN;function S0(){let t,e;const n=new Promise((i,a)=>{t=i,e=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function QN(t){return Math.min(1e3*2**t,3e4)}function HA(t){return(t??"online")==="online"?Lh.isOnline():!0}var jA=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function cv(t){return t instanceof jA}function WA(t){let e=!1,n=0,r=!1,i;const a=S0(),l=E=>{var b;r||(v(new jA(E)),(b=t.abort)==null||b.call(t))},u=()=>{e=!0},f=()=>{e=!1},h=()=>wy.isFocused()&&(t.networkMode==="always"||Lh.isOnline())&&t.canRun(),g=()=>HA(t.networkMode)&&t.canRun(),m=E=>{var b;r||(r=!0,(b=t.onSuccess)==null||b.call(t,E),i==null||i(),a.resolve(E))},v=E=>{var b;r||(r=!0,(b=t.onError)==null||b.call(t,E),i==null||i(),a.reject(E))},S=()=>new Promise(E=>{var b;i=C=>{(r||h())&&E(C)},(b=t.onPause)==null||b.call(t)}).then(()=>{var E;i=void 0,r||(E=t.onContinue)==null||E.call(t)}),w=()=>{if(r)return;let E;const b=n===0?t.initialPromise:void 0;try{E=b??t.fn()}catch(C){E=Promise.reject(C)}Promise.resolve(E).then(m).catch(C=>{var N;if(r)return;const T=t.retry??(Uo?0:3),A=t.retryDelay??QN,O=typeof A=="function"?A(n,C):A,x=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,C);if(e||!x){v(C);return}n++,(N=t.onFail)==null||N.call(t,n,C),XN(O).then(()=>h()?void 0:S()).then(()=>{e?v(C):w()})})};return{promise:a,cancel:l,continue:()=>(i==null||i(),a),cancelRetry:u,continueRetry:f,canStart:g,start:()=>(g()?w():S().then(w),a)}}function GN(){let t=[],e=0,n=u=>{u()},r=u=>{u()},i=u=>setTimeout(u,0);const a=u=>{e?t.push(u):i(()=>{n(u)})},l=()=>{const u=t;t=[],u.length&&i(()=>{r(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;e++;try{f=u()}finally{e--,e||l()}return f},batchCalls:u=>(...f)=>{a(()=>{u(...f)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Rr=GN(),To,NA,XA=(NA=class{constructor(){St(this,To)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),v0(this.gcTime)&&Xe(this,To,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Uo?1/0:5*60*1e3))}clearGcTimeout(){G(this,To)&&(clearTimeout(G(this,To)),Xe(this,To,void 0))}},To=new WeakMap,NA),lc,cc,Ri,Co,Dr,Df,Ao,ji,zs,IA,JN=(IA=class extends XA{constructor(e){super();St(this,ji);St(this,lc);St(this,cc);St(this,Ri);St(this,Co);St(this,Dr);St(this,Df);St(this,Ao);Xe(this,Ao,!1),Xe(this,Df,e.defaultOptions),this.setOptions(e.options),this.observers=[],Xe(this,Co,e.client),Xe(this,Ri,G(this,Co).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Xe(this,lc,eI(this.options)),this.state=e.state??G(this,lc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=G(this,Dr))==null?void 0:e.promise}setOptions(e){this.options={...G(this,Df),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&G(this,Ri).remove(this)}setData(e,n){const r=b0(this.state.data,e,this.options);return Wt(this,ji,zs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Wt(this,ji,zs).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=G(this,Dr))==null?void 0:r.promise;return(i=G(this,Dr))==null||i.cancel(e),n?n.then(xi).catch(xi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(G(this,lc))}isActive(){return this.observers.some(e=>Yi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ey||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!zA(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=G(this,Dr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=G(this,Dr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),G(this,Ri).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(G(this,Dr)&&(G(this,Ao)?G(this,Dr).cancel({revert:!0}):G(this,Dr).cancelRetry()),this.scheduleGc()),G(this,Ri).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Wt(this,ji,zs).call(this,{type:"invalidate"})}fetch(e,n){var f,h,g;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(G(this,Dr))return G(this,Dr).continueRetry(),G(this,Dr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(v=>v.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(Xe(this,Ao,!0),r.signal)})},a=()=>{const m=VA(this.options,n),v={client:G(this,Co),queryKey:this.queryKey,meta:this.meta};return i(v),Xe(this,Ao,!1),this.options.persister?this.options.persister(m,v,this):m(v)},l={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:G(this,Co),state:this.state,fetchFn:a};i(l),(f=this.options.behavior)==null||f.onFetch(l,this),Xe(this,cc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&Wt(this,ji,zs).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const u=m=>{var v,S,w,E;cv(m)&&m.silent||Wt(this,ji,zs).call(this,{type:"error",error:m}),cv(m)||((S=(v=G(this,Ri).config).onError)==null||S.call(v,m,this),(E=(w=G(this,Ri).config).onSettled)==null||E.call(w,this.state.data,m,this)),this.scheduleGc()};return Xe(this,Dr,WA({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var v,S,w,E;if(m===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(b){u(b);return}(S=(v=G(this,Ri).config).onSuccess)==null||S.call(v,m,this),(E=(w=G(this,Ri).config).onSettled)==null||E.call(w,m,this.state.error,this),this.scheduleGc()},onError:u,onFail:(m,v)=>{Wt(this,ji,zs).call(this,{type:"failed",failureCount:m,error:v})},onPause:()=>{Wt(this,ji,zs).call(this,{type:"pause"})},onContinue:()=>{Wt(this,ji,zs).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),G(this,Dr).start()}},lc=new WeakMap,cc=new WeakMap,Ri=new WeakMap,Co=new WeakMap,Dr=new WeakMap,Df=new WeakMap,Ao=new WeakMap,ji=new WeakSet,zs=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...qA(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return cv(i)&&i.revert&&G(this,cc)?{...G(this,cc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Rr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),G(this,Ri).notify({query:this,type:"updated",action:e})})},IA);function qA(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HA(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function eI(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var fs,DA,tI=(DA=class extends Uf{constructor(e={}){super();St(this,fs);this.config=e,Xe(this,fs,new Map)}build(e,n,r){const i=n.queryKey,a=n.queryHash??Sy(i,n);let l=this.get(a);return l||(l=new JN({client:e,queryKey:i,queryHash:a,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){G(this,fs).has(e.queryHash)||(G(this,fs).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=G(this,fs).get(e.queryHash);n&&(e.destroy(),n===e&&G(this,fs).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Rr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return G(this,fs).get(e)}getAll(){return[...G(this,fs).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>HE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>HE(e,r)):n}notify(e){Rr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Rr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fs=new WeakMap,DA),ds,zr,Ro,hs,ba,FA,nI=(FA=class extends XA{constructor(e){super();St(this,hs);St(this,ds);St(this,zr);St(this,Ro);this.mutationId=e.mutationId,Xe(this,zr,e.mutationCache),Xe(this,ds,[]),this.state=e.state||rI(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){G(this,ds).includes(e)||(G(this,ds).push(e),this.clearGcTimeout(),G(this,zr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Xe(this,ds,G(this,ds).filter(n=>n!==e)),this.scheduleGc(),G(this,zr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){G(this,ds).length||(this.state.status==="pending"?this.scheduleGc():G(this,zr).remove(this))}continue(){var e;return((e=G(this,Ro))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,a,l,u,f,h,g,m,v,S,w,E,b,C,T,A,O,x,N,F;Xe(this,Ro,WA({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(L,D)=>{Wt(this,hs,ba).call(this,{type:"failed",failureCount:L,error:D})},onPause:()=>{Wt(this,hs,ba).call(this,{type:"pause"})},onContinue:()=>{Wt(this,hs,ba).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>G(this,zr).canRun(this)}));const n=this.state.status==="pending",r=!G(this,Ro).canStart();try{if(!n){Wt(this,hs,ba).call(this,{type:"pending",variables:e,isPaused:r}),await((a=(i=G(this,zr).config).onMutate)==null?void 0:a.call(i,e,this));const D=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e));D!==this.state.context&&Wt(this,hs,ba).call(this,{type:"pending",context:D,variables:e,isPaused:r})}const L=await G(this,Ro).start();return await((h=(f=G(this,zr).config).onSuccess)==null?void 0:h.call(f,L,e,this.state.context,this)),await((m=(g=this.options).onSuccess)==null?void 0:m.call(g,L,e,this.state.context)),await((S=(v=G(this,zr).config).onSettled)==null?void 0:S.call(v,L,null,this.state.variables,this.state.context,this)),await((E=(w=this.options).onSettled)==null?void 0:E.call(w,L,null,e,this.state.context)),Wt(this,hs,ba).call(this,{type:"success",data:L}),L}catch(L){try{throw await((C=(b=G(this,zr).config).onError)==null?void 0:C.call(b,L,e,this.state.context,this)),await((A=(T=this.options).onError)==null?void 0:A.call(T,L,e,this.state.context)),await((x=(O=G(this,zr).config).onSettled)==null?void 0:x.call(O,void 0,L,this.state.variables,this.state.context,this)),await((F=(N=this.options).onSettled)==null?void 0:F.call(N,void 0,L,e,this.state.context)),L}finally{Wt(this,hs,ba).call(this,{type:"error",error:L})}}finally{G(this,zr).runNext(this)}}},ds=new WeakMap,zr=new WeakMap,Ro=new WeakMap,hs=new WeakSet,ba=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Rr.batch(()=>{G(this,ds).forEach(r=>{r.onMutationUpdate(e)}),G(this,zr).notify({mutation:this,type:"updated",action:e})})},FA);function rI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $s,Wi,Ff,kA,iI=(kA=class extends Uf{constructor(e={}){super();St(this,$s);St(this,Wi);St(this,Ff);this.config=e,Xe(this,$s,new Set),Xe(this,Wi,new Map),Xe(this,Ff,0)}build(e,n,r){const i=new nI({mutationCache:this,mutationId:++Jd(this,Ff)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){G(this,$s).add(e);const n=eh(e);if(typeof n=="string"){const r=G(this,Wi).get(n);r?r.push(e):G(this,Wi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(G(this,$s).delete(e)){const n=eh(e);if(typeof n=="string"){const r=G(this,Wi).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&G(this,Wi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=eh(e);if(typeof n=="string"){const r=G(this,Wi).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=eh(e);if(typeof n=="string"){const i=(r=G(this,Wi).get(n))==null?void 0:r.find(a=>a!==e&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Rr.batch(()=>{G(this,$s).forEach(e=>{this.notify({type:"removed",mutation:e})}),G(this,$s).clear(),G(this,Wi).clear()})}getAll(){return Array.from(G(this,$s))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>jE(n,r))}findAll(e={}){return this.getAll().filter(n=>jE(e,n))}notify(e){Rr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Rr.batch(()=>Promise.all(e.map(n=>n.continue().catch(xi))))}},$s=new WeakMap,Wi=new WeakMap,Ff=new WeakMap,kA);function eh(t){var e;return(e=t.options.scope)==null?void 0:e.id}function qE(t){return{onFetch:(e,n)=>{var g,m,v,S,w;const r=e.options,i=(v=(m=(g=e.fetchOptions)==null?void 0:g.meta)==null?void 0:m.fetchMore)==null?void 0:v.direction,a=((S=e.state.data)==null?void 0:S.pages)||[],l=((w=e.state.data)==null?void 0:w.pageParams)||[];let u={pages:[],pageParams:[]},f=0;const h=async()=>{let E=!1;const b=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(e.signal.aborted?E=!0:e.signal.addEventListener("abort",()=>{E=!0}),e.signal)})},C=VA(e.options,e.fetchOptions),T=async(A,O,x)=>{if(E)return Promise.reject();if(O==null&&A.pages.length)return Promise.resolve(A);const N={client:e.client,queryKey:e.queryKey,pageParam:O,direction:x?"backward":"forward",meta:e.options.meta};b(N);const F=await C(N),{maxPages:L}=e.options,D=x?YN:qN;return{pages:D(A.pages,F,L),pageParams:D(A.pageParams,O,L)}};if(i&&a.length){const A=i==="backward",O=A?sI:YE,x={pages:a,pageParams:l},N=O(r,x);u=await T(x,N,A)}else{const A=t??a.length;do{const O=f===0?l[0]??r.initialPageParam:YE(r,u);if(f>0&&O==null)break;u=await T(u,O),f++}while(f<A)}return u};e.options.persister?e.fetchFn=()=>{var E,b;return(b=(E=e.options).persister)==null?void 0:b.call(E,h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=h}}}function YE(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function sI(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Yn,Ra,xa,uc,fc,Ma,dc,hc,BA,aI=(BA=class{constructor(t={}){St(this,Yn);St(this,Ra);St(this,xa);St(this,uc);St(this,fc);St(this,Ma);St(this,dc);St(this,hc);Xe(this,Yn,t.queryCache||new tI),Xe(this,Ra,t.mutationCache||new iI),Xe(this,xa,t.defaultOptions||{}),Xe(this,uc,new Map),Xe(this,fc,new Map),Xe(this,Ma,0)}mount(){Jd(this,Ma)._++,G(this,Ma)===1&&(Xe(this,dc,wy.subscribe(async t=>{t&&(await this.resumePausedMutations(),G(this,Yn).onFocus())})),Xe(this,hc,Lh.subscribe(async t=>{t&&(await this.resumePausedMutations(),G(this,Yn).onOnline())})))}unmount(){var t,e;Jd(this,Ma)._--,G(this,Ma)===0&&((t=G(this,dc))==null||t.call(this),Xe(this,dc,void 0),(e=G(this,hc))==null||e.call(this),Xe(this,hc,void 0))}isFetching(t){return G(this,Yn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return G(this,Ra).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=G(this,Yn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=G(this,Yn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Gl(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return G(this,Yn).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=G(this,Yn).get(r.queryHash),a=i==null?void 0:i.state.data,l=WN(e,a);if(l!==void 0)return G(this,Yn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(t,e,n){return Rr.batch(()=>G(this,Yn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=G(this,Yn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=G(this,Yn);Rr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=G(this,Yn),r={type:"active",...t};return Rr.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Rr.batch(()=>G(this,Yn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(xi).catch(xi)}invalidateQueries(t,e={}){return Rr.batch(()=>{if(G(this,Yn).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const n={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(n,e)})}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Rr.batch(()=>G(this,Yn).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(xi)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(xi)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=G(this,Yn).build(this,e);return n.isStaleByTime(Gl(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xi).catch(xi)}fetchInfiniteQuery(t){return t.behavior=qE(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xi).catch(xi)}ensureInfiniteQueryData(t){return t.behavior=qE(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Lh.isOnline()?G(this,Ra).resumePausedMutations():Promise.resolve()}getQueryCache(){return G(this,Yn)}getMutationCache(){return G(this,Ra)}getDefaultOptions(){return G(this,xa)}setDefaultOptions(t){Xe(this,xa,t)}setQueryDefaults(t,e){G(this,uc).set(df(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...G(this,uc).values()],n={};return e.forEach(r=>{hf(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){G(this,fc).set(df(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...G(this,fc).values()];let n={};return e.forEach(r=>{hf(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...G(this,xa).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Sy(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Ey&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...G(this,xa).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){G(this,Yn).clear(),G(this,Ra).clear()}},Yn=new WeakMap,Ra=new WeakMap,xa=new WeakMap,uc=new WeakMap,fc=new WeakMap,Ma=new WeakMap,dc=new WeakMap,hc=new WeakMap,BA),Yr,Xt,kf,$r,xo,gc,Oa,gs,Bf,pc,mc,Mo,Oo,Pa,vc,on,Wu,E0,w0,T0,C0,A0,R0,x0,YA,UA,oI=(UA=class extends Uf{constructor(e,n){super();St(this,on);St(this,Yr);St(this,Xt);St(this,kf);St(this,$r);St(this,xo);St(this,gc);St(this,Oa);St(this,gs);St(this,Bf);St(this,pc);St(this,mc);St(this,Mo);St(this,Oo);St(this,Pa);St(this,vc,new Set);this.options=n,Xe(this,Yr,e),Xe(this,gs,null),Xe(this,Oa,S0()),this.options.experimental_prefetchInRender||G(this,Oa).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(G(this,Xt).addObserver(this),KE(G(this,Xt),this.options)?Wt(this,on,Wu).call(this):this.updateResult(),Wt(this,on,C0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return M0(G(this,Xt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return M0(G(this,Xt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Wt(this,on,A0).call(this),Wt(this,on,R0).call(this),G(this,Xt).removeObserver(this)}setOptions(e,n){const r=this.options,i=G(this,Xt);if(this.options=G(this,Yr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Yi(this.options.enabled,G(this,Xt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Wt(this,on,x0).call(this),G(this,Xt).setOptions(this.options),r._defaulted&&!_0(this.options,r)&&G(this,Yr).getQueryCache().notify({type:"observerOptionsUpdated",query:G(this,Xt),observer:this});const a=this.hasListeners();a&&ZE(G(this,Xt),i,this.options,r)&&Wt(this,on,Wu).call(this),this.updateResult(n),a&&(G(this,Xt)!==i||Yi(this.options.enabled,G(this,Xt))!==Yi(r.enabled,G(this,Xt))||Gl(this.options.staleTime,G(this,Xt))!==Gl(r.staleTime,G(this,Xt)))&&Wt(this,on,E0).call(this);const l=Wt(this,on,w0).call(this);a&&(G(this,Xt)!==i||Yi(this.options.enabled,G(this,Xt))!==Yi(r.enabled,G(this,Xt))||l!==G(this,Pa))&&Wt(this,on,T0).call(this,l)}getOptimisticResult(e){const n=G(this,Yr).getQueryCache().build(G(this,Yr),e),r=this.createResult(n,e);return cI(this,r)&&(Xe(this,$r,r),Xe(this,gc,this.options),Xe(this,xo,G(this,Xt).state)),r}getCurrentResult(){return G(this,$r)}trackResult(e,n){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),e[i])})}),r}trackProp(e){G(this,vc).add(e)}getCurrentQuery(){return G(this,Xt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=G(this,Yr).defaultQueryOptions(e),r=G(this,Yr).getQueryCache().build(G(this,Yr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Wt(this,on,Wu).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),G(this,$r)))}createResult(e,n){var L;const r=G(this,Xt),i=this.options,a=G(this,$r),l=G(this,xo),u=G(this,gc),h=e!==r?e.state:G(this,kf),{state:g}=e;let m={...g},v=!1,S;if(n._optimisticResults){const D=this.hasListeners(),V=!D&&KE(e,n),B=D&&ZE(e,r,n,i);(V||B)&&(m={...m,...qA(g.data,e.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:w,errorUpdatedAt:E,status:b}=m;if(n.select&&m.data!==void 0)if(a&&m.data===(l==null?void 0:l.data)&&n.select===G(this,Bf))S=G(this,pc);else try{Xe(this,Bf,n.select),S=n.select(m.data),S=b0(a==null?void 0:a.data,S,n),Xe(this,pc,S),Xe(this,gs,null)}catch(D){Xe(this,gs,D)}else S=m.data;if(n.placeholderData!==void 0&&S===void 0&&b==="pending"){let D;if(a!=null&&a.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData))D=a.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((L=G(this,mc))==null?void 0:L.state.data,G(this,mc)):n.placeholderData,n.select&&D!==void 0)try{D=n.select(D),Xe(this,gs,null)}catch(V){Xe(this,gs,V)}D!==void 0&&(b="success",S=b0(a==null?void 0:a.data,D,n),v=!0)}G(this,gs)&&(w=G(this,gs),S=G(this,pc),E=Date.now(),b="error");const C=m.fetchStatus==="fetching",T=b==="pending",A=b==="error",O=T&&C,x=S!==void 0,F={status:b,fetchStatus:m.fetchStatus,isPending:T,isSuccess:b==="success",isError:A,isInitialLoading:O,isLoading:O,data:S,dataUpdatedAt:m.dataUpdatedAt,error:w,errorUpdatedAt:E,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>h.dataUpdateCount||m.errorUpdateCount>h.errorUpdateCount,isFetching:C,isRefetching:C&&!T,isLoadingError:A&&!x,isPaused:m.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:A&&x,isStale:Ty(e,n),refetch:this.refetch,promise:G(this,Oa)};if(this.options.experimental_prefetchInRender){const D=W=>{F.status==="error"?W.reject(F.error):F.data!==void 0&&W.resolve(F.data)},V=()=>{const W=Xe(this,Oa,F.promise=S0());D(W)},B=G(this,Oa);switch(B.status){case"pending":e.queryHash===r.queryHash&&D(B);break;case"fulfilled":(F.status==="error"||F.data!==B.value)&&V();break;case"rejected":(F.status!=="error"||F.error!==B.reason)&&V();break}}return F}updateResult(e){const n=G(this,$r),r=this.createResult(G(this,Xt),this.options);if(Xe(this,xo,G(this,Xt).state),Xe(this,gc,this.options),G(this,xo).data!==void 0&&Xe(this,mc,G(this,Xt)),_0(r,n))return;Xe(this,$r,r);const i={},a=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,u=typeof l=="function"?l():l;if(u==="all"||!u&&!G(this,vc).size)return!0;const f=new Set(u??G(this,vc));return this.options.throwOnError&&f.add("error"),Object.keys(G(this,$r)).some(h=>{const g=h;return G(this,$r)[g]!==n[g]&&f.has(g)})};(e==null?void 0:e.listeners)!==!1&&a()&&(i.listeners=!0),Wt(this,on,YA).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Wt(this,on,C0).call(this)}},Yr=new WeakMap,Xt=new WeakMap,kf=new WeakMap,$r=new WeakMap,xo=new WeakMap,gc=new WeakMap,Oa=new WeakMap,gs=new WeakMap,Bf=new WeakMap,pc=new WeakMap,mc=new WeakMap,Mo=new WeakMap,Oo=new WeakMap,Pa=new WeakMap,vc=new WeakMap,on=new WeakSet,Wu=function(e){Wt(this,on,x0).call(this);let n=G(this,Xt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(xi)),n},E0=function(){Wt(this,on,A0).call(this);const e=Gl(this.options.staleTime,G(this,Xt));if(Uo||G(this,$r).isStale||!v0(e))return;const r=zA(G(this,$r).dataUpdatedAt,e)+1;Xe(this,Mo,setTimeout(()=>{G(this,$r).isStale||this.updateResult()},r))},w0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(G(this,Xt)):this.options.refetchInterval)??!1},T0=function(e){Wt(this,on,R0).call(this),Xe(this,Pa,e),!(Uo||Yi(this.options.enabled,G(this,Xt))===!1||!v0(G(this,Pa))||G(this,Pa)===0)&&Xe(this,Oo,setInterval(()=>{(this.options.refetchIntervalInBackground||wy.isFocused())&&Wt(this,on,Wu).call(this)},G(this,Pa)))},C0=function(){Wt(this,on,E0).call(this),Wt(this,on,T0).call(this,Wt(this,on,w0).call(this))},A0=function(){G(this,Mo)&&(clearTimeout(G(this,Mo)),Xe(this,Mo,void 0))},R0=function(){G(this,Oo)&&(clearInterval(G(this,Oo)),Xe(this,Oo,void 0))},x0=function(){const e=G(this,Yr).getQueryCache().build(G(this,Yr),this.options);if(e===G(this,Xt))return;const n=G(this,Xt);Xe(this,Xt,e),Xe(this,kf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},YA=function(e){Rr.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(G(this,$r))}),G(this,Yr).getQueryCache().notify({query:G(this,Xt),type:"observerResultsUpdated"})})},UA);function lI(t,e){return Yi(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function KE(t,e){return lI(t,e)||t.state.data!==void 0&&M0(t,e,e.refetchOnMount)}function M0(t,e,n){if(Yi(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&Ty(t,e)}return!1}function ZE(t,e,n,r){return(t!==e||Yi(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Ty(t,n)}function Ty(t,e){return Yi(e.enabled,t)!==!1&&t.isStaleByTime(Gl(e.staleTime,t))}function cI(t,e){return!_0(t.getCurrentResult(),e)}var uv={exports:{}},At={};/**
|
|
|
* @license React
|
|
|
* react.production.js
|
|
|
*
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var QE;function uI(){if(QE)return At;QE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.iterator;function v(P){return P===null||typeof P!="object"?null:(P=m&&P[m]||P["@@iterator"],typeof P=="function"?P:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,E={};function b(P,$,ie){this.props=P,this.context=$,this.refs=E,this.updater=ie||S}b.prototype.isReactComponent={},b.prototype.setState=function(P,$){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,$,"setState")},b.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function C(){}C.prototype=b.prototype;function T(P,$,ie){this.props=P,this.context=$,this.refs=E,this.updater=ie||S}var A=T.prototype=new C;A.constructor=T,w(A,b.prototype),A.isPureReactComponent=!0;var O=Array.isArray,x={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function F(P,$,ie,se,q,ce){return ie=ce.ref,{$$typeof:t,type:P,key:$,ref:ie!==void 0?ie:null,props:ce}}function L(P,$){return F(P.type,$,void 0,void 0,void 0,P.props)}function D(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function V(P){var $={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(ie){return $[ie]})}var B=/\/+/g;function W(P,$){return typeof P=="object"&&P!==null&&P.key!=null?V(""+P.key):$.toString(36)}function X(){}function Y(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(X,X):(P.status="pending",P.then(function($){P.status==="pending"&&(P.status="fulfilled",P.value=$)},function($){P.status==="pending"&&(P.status="rejected",P.reason=$)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function ae(P,$,ie,se,q){var ce=typeof P;(ce==="undefined"||ce==="boolean")&&(P=null);var fe=!1;if(P===null)fe=!0;else switch(ce){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(P.$$typeof){case t:case e:fe=!0;break;case g:return fe=P._init,ae(fe(P._payload),$,ie,se,q)}}if(fe)return q=q(P),fe=se===""?"."+W(P,0):se,O(q)?(ie="",fe!=null&&(ie=fe.replace(B,"$&/")+"/"),ae(q,$,ie,"",function(Ce){return Ce})):q!=null&&(D(q)&&(q=L(q,ie+(q.key==null||P&&P.key===q.key?"":(""+q.key).replace(B,"$&/")+"/")+fe)),$.push(q)),1;fe=0;var ye=se===""?".":se+":";if(O(P))for(var Ee=0;Ee<P.length;Ee++)se=P[Ee],ce=ye+W(se,Ee),fe+=ae(se,$,ie,ce,q);else if(Ee=v(P),typeof Ee=="function")for(P=Ee.call(P),Ee=0;!(se=P.next()).done;)se=se.value,ce=ye+W(se,Ee++),fe+=ae(se,$,ie,ce,q);else if(ce==="object"){if(typeof P.then=="function")return ae(Y(P),$,ie,se,q);throw $=String(P),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return fe}function U(P,$,ie){if(P==null)return P;var se=[],q=0;return ae(P,se,"","",function(ce){return $.call(ie,ce,q++)}),se}function z(P){if(P._status===-1){var $=P._result;$=$(),$.then(function(ie){(P._status===0||P._status===-1)&&(P._status=1,P._result=ie)},function(ie){(P._status===0||P._status===-1)&&(P._status=2,P._result=ie)}),P._status===-1&&(P._status=0,P._result=$)}if(P._status===1)return P._result.default;throw P._result}var j=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)};function Z(){}return At.Children={map:U,forEach:function(P,$,ie){U(P,function(){$.apply(this,arguments)},ie)},count:function(P){var $=0;return U(P,function(){$++}),$},toArray:function(P){return U(P,function($){return $})||[]},only:function(P){if(!D(P))throw Error("React.Children.only expected to receive a single React element child.");return P}},At.Component=b,At.Fragment=n,At.Profiler=i,At.PureComponent=T,At.StrictMode=r,At.Suspense=f,At.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,At.act=function(){throw Error("act(...) is not supported in production builds of React.")},At.cache=function(P){return function(){return P.apply(null,arguments)}},At.cloneElement=function(P,$,ie){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var se=w({},P.props),q=P.key,ce=void 0;if($!=null)for(fe in $.ref!==void 0&&(ce=void 0),$.key!==void 0&&(q=""+$.key),$)!N.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(se[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)se.children=ie;else if(1<fe){for(var ye=Array(fe),Ee=0;Ee<fe;Ee++)ye[Ee]=arguments[Ee+2];se.children=ye}return F(P.type,q,void 0,void 0,ce,se)},At.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:a,_context:P},P},At.createElement=function(P,$,ie){var se,q={},ce=null;if($!=null)for(se in $.key!==void 0&&(ce=""+$.key),$)N.call($,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(q[se]=$[se]);var fe=arguments.length-2;if(fe===1)q.children=ie;else if(1<fe){for(var ye=Array(fe),Ee=0;Ee<fe;Ee++)ye[Ee]=arguments[Ee+2];q.children=ye}if(P&&P.defaultProps)for(se in fe=P.defaultProps,fe)q[se]===void 0&&(q[se]=fe[se]);return F(P,ce,void 0,void 0,null,q)},At.createRef=function(){return{current:null}},At.forwardRef=function(P){return{$$typeof:u,render:P}},At.isValidElement=D,At.lazy=function(P){return{$$typeof:g,_payload:{_status:-1,_result:P},_init:z}},At.memo=function(P,$){return{$$typeof:h,type:P,compare:$===void 0?null:$}},At.startTransition=function(P){var $=x.T,ie={};x.T=ie;try{var se=P(),q=x.S;q!==null&&q(ie,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(Z,j)}catch(ce){j(ce)}finally{x.T=$}},At.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},At.use=function(P){return x.H.use(P)},At.useActionState=function(P,$,ie){return x.H.useActionState(P,$,ie)},At.useCallback=function(P,$){return x.H.useCallback(P,$)},At.useContext=function(P){return x.H.useContext(P)},At.useDebugValue=function(){},At.useDeferredValue=function(P,$){return x.H.useDeferredValue(P,$)},At.useEffect=function(P,$){return x.H.useEffect(P,$)},At.useId=function(){return x.H.useId()},At.useImperativeHandle=function(P,$,ie){return x.H.useImperativeHandle(P,$,ie)},At.useInsertionEffect=function(P,$){return x.H.useInsertionEffect(P,$)},At.useLayoutEffect=function(P,$){return x.H.useLayoutEffect(P,$)},At.useMemo=function(P,$){return x.H.useMemo(P,$)},At.useOptimistic=function(P,$){return x.H.useOptimistic(P,$)},At.useReducer=function(P,$,ie){return x.H.useReducer(P,$,ie)},At.useRef=function(P){return x.H.useRef(P)},At.useState=function(P){return x.H.useState(P)},At.useSyncExternalStore=function(P,$,ie){return x.H.useSyncExternalStore(P,$,ie)},At.useTransition=function(){return x.H.useTransition()},At.version="19.0.0",At}var GE;function Cy(){return GE||(GE=1,uv.exports=uI()),uv.exports}var _=Cy();const Ft=by(_),Xg=VN({__proto__:null,default:Ft},[_]);var KA=_.createContext(void 0),fI=t=>{const e=_.useContext(KA);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},dI=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),Vr.jsx(KA.Provider,{value:t,children:e})),ZA=_.createContext(!1),hI=()=>_.useContext(ZA);ZA.Provider;function gI(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var pI=_.createContext(gI()),mI=()=>_.useContext(pI);function vI(t,e){return typeof t=="function"?t(...e):!!t}function JE(){}var _I=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},yI=t=>{_.useEffect(()=>{t.clearReset()},[t])},bI=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||vI(n,[t.error,r])),SI=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...n)=>Math.max(e(...n),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},EI=(t,e)=>t.isLoading&&t.isFetching&&!e,wI=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,ew=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function TI(t,e,n){var m,v,S,w,E;const r=fI(),i=hI(),a=mI(),l=r.defaultQueryOptions(t);(v=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||v.call(m,l),l._optimisticResults=i?"isRestoring":"optimistic",SI(l),_I(l,a),yI(a);const u=!r.getQueryCache().get(l.queryHash),[f]=_.useState(()=>new e(r,l)),h=f.getOptimisticResult(l),g=!i&&t.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const C=g?f.subscribe(Rr.batchCalls(b)):JE;return f.updateResult(),C},[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),_.useEffect(()=>{f.setOptions(l,{listeners:!1})},[l,f]),wI(l,h))throw ew(l,f,a);if(bI({result:h,errorResetBoundary:a,throwOnError:l.throwOnError,query:r.getQueryCache().get(l.queryHash),suspense:l.suspense}))throw h.error;if((w=(S=r.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||w.call(S,l,h),l.experimental_prefetchInRender&&!Uo&&EI(h,i)){const b=u?ew(l,f,a):(E=r.getQueryCache().get(l.queryHash))==null?void 0:E.promise;b==null||b.catch(JE).finally(()=>{f.updateResult()})}return l.notifyOnChangeProps?h:f.trackResult(h)}function CI(t,e){return TI(t,oI)}const AI="modulepreload",RI=function(t){return"/"+t},tw={},xI=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(n.map(f=>{if(f=RI(f),f in tw)return;tw[f]=!0;const h=f.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":AI,h||(m.as="script"),m.crossOrigin="",m.href=f,u&&m.setAttribute("nonce",u),document.head.appendChild(m),h)return new Promise((v,S)=>{m.addEventListener("load",v),m.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return i.then(l=>{for(const u of l||[])u.status==="rejected"&&a(u.reason);return e().catch(a)})};var MI=function(){return null},fv={exports:{}},Fu={},dv={exports:{}},hv={};/**
|
|
|
* @license React
|
|
|
* scheduler.production.js
|
|
|
*
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var nw;function OI(){return nw||(nw=1,function(t){function e(U,z){var j=U.length;U.push(z);e:for(;0<j;){var Z=j-1>>>1,P=U[Z];if(0<i(P,z))U[Z]=z,U[j]=P,j=Z;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var z=U[0],j=U.pop();if(j!==z){U[0]=j;e:for(var Z=0,P=U.length,$=P>>>1;Z<$;){var ie=2*(Z+1)-1,se=U[ie],q=ie+1,ce=U[q];if(0>i(se,j))q<P&&0>i(ce,se)?(U[Z]=ce,U[q]=j,Z=q):(U[Z]=se,U[ie]=j,Z=ie);else if(q<P&&0>i(ce,j))U[Z]=ce,U[q]=j,Z=q;else break e}}return z}function i(U,z){var j=U.sortIndex-z.sortIndex;return j!==0?j:U.id-z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var f=[],h=[],g=1,m=null,v=3,S=!1,w=!1,E=!1,b=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(U){for(var z=n(h);z!==null;){if(z.callback===null)r(h);else if(z.startTime<=U)r(h),z.sortIndex=z.expirationTime,e(f,z);else break;z=n(h)}}function O(U){if(E=!1,A(U),!w)if(n(f)!==null)w=!0,Y();else{var z=n(h);z!==null&&ae(O,z.startTime-U)}}var x=!1,N=-1,F=5,L=-1;function D(){return!(t.unstable_now()-L<F)}function V(){if(x){var U=t.unstable_now();L=U;var z=!0;try{e:{w=!1,E&&(E=!1,C(N),N=-1),S=!0;var j=v;try{t:{for(A(U),m=n(f);m!==null&&!(m.expirationTime>U&&D());){var Z=m.callback;if(typeof Z=="function"){m.callback=null,v=m.priorityLevel;var P=Z(m.expirationTime<=U);if(U=t.unstable_now(),typeof P=="function"){m.callback=P,A(U),z=!0;break t}m===n(f)&&r(f),A(U)}else r(f);m=n(f)}if(m!==null)z=!0;else{var $=n(h);$!==null&&ae(O,$.startTime-U),z=!1}}break e}finally{m=null,v=j,S=!1}z=void 0}}finally{z?B():x=!1}}}var B;if(typeof T=="function")B=function(){T(V)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,X=W.port2;W.port1.onmessage=V,B=function(){X.postMessage(null)}}else B=function(){b(V,0)};function Y(){x||(x=!0,B())}function ae(U,z){N=b(function(){U(t.unstable_now())},z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(U){U.callback=null},t.unstable_continueExecution=function(){w||S||(w=!0,Y())},t.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return n(f)},t.unstable_next=function(U){switch(v){case 1:case 2:case 3:var z=3;break;default:z=v}var j=v;v=z;try{return U()}finally{v=j}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var j=v;v=U;try{return z()}finally{v=j}},t.unstable_scheduleCallback=function(U,z,j){var Z=t.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?Z+j:Z):j=Z,U){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=j+P,U={id:g++,callback:z,priorityLevel:U,startTime:j,expirationTime:P,sortIndex:-1},j>Z?(U.sortIndex=j,e(h,U),n(f)===null&&U===n(h)&&(E?(C(N),N=-1):E=!0,ae(O,j-Z))):(U.sortIndex=P,e(f,U),w||S||(w=!0,Y())),U},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(U){var z=v;return function(){var j=v;v=z;try{return U.apply(this,arguments)}finally{v=j}}}}(hv)),hv}var rw;function PI(){return rw||(rw=1,dv.exports=OI()),dv.exports}var gv={exports:{}},Nr={};/**
|
|
|
* @license React
|
|
|
* react-dom.production.js
|
|
|
*
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var iw;function NI(){if(iw)return Nr;iw=1;var t=Cy();function e(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(f,h,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:f,containerInfo:h,implementation:g}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Nr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Nr.createPortal=function(f,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return a(f,h,null,g)},Nr.flushSync=function(f){var h=l.T,g=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=h,r.p=g,r.d.f()}},Nr.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Nr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Nr.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,m=u(g,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:v,fetchPriority:S}):g==="script"&&r.d.X(f,{crossOrigin:m,integrity:v,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Nr.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=u(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Nr.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,m=u(g,h.crossOrigin);r.d.L(f,g,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Nr.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=u(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Nr.requestFormReset=function(f){r.d.r(f)},Nr.unstable_batchedUpdates=function(f,h){return f(h)},Nr.useFormState=function(f,h,g){return l.H.useFormState(f,h,g)},Nr.useFormStatus=function(){return l.H.useHostTransitionStatus()},Nr.version="19.0.0",Nr}var sw;function QA(){if(sw)return gv.exports;sw=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),gv.exports=NI(),gv.exports}/**
|
|
|
* @license React
|
|
|
* react-dom-client.production.js
|
|
|
*
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var aw;function II(){if(aw)return Fu;aw=1;var t=PI(),e=Cy(),n=QA();function r(s){var o="https://react.dev/errors/"+s;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+s+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}var a=Symbol.for("react.element"),l=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),v=Symbol.for("react.consumer"),S=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),O=Symbol.for("react.memo_cache_sentinel"),x=Symbol.iterator;function N(s){return s===null||typeof s!="object"?null:(s=x&&s[x]||s["@@iterator"],typeof s=="function"?s:null)}var F=Symbol.for("react.client.reference");function L(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===F?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case f:return"Fragment";case u:return"Portal";case g:return"Profiler";case h:return"StrictMode";case E:return"Suspense";case b:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case S:return(s.displayName||"Context")+".Provider";case v:return(s._context.displayName||"Context")+".Consumer";case w:var o=s.render;return s=s.displayName,s||(s=o.displayName||o.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case C:return o=s.displayName||null,o!==null?o:L(s.type)||"Memo";case T:o=s._payload,s=s._init;try{return L(s(o))}catch{}}return null}var D=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.assign,B,W;function X(s){if(B===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);B=o&&o[1]||"",W=-1<c.stack.indexOf(`
|
|
|
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
|
`+B+s+W}var Y=!1;function ae(s,o){if(!s||Y)return"";Y=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(o){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(he){var ue=he}Reflect.construct(s,[],Se)}else{try{Se.call()}catch(he){ue=he}s.call(Se.prototype)}}else{try{throw Error()}catch(he){ue=he}(Se=s())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(he){if(he&&ue&&typeof he.stack=="string")return[he.stack,ue.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),R=y[0],I=y[1];if(R&&I){var H=R.split(`
|
|
|
`),ee=I.split(`
|
|
|
`);for(p=d=0;d<H.length&&!H[d].includes("DetermineComponentFrameRoot");)d++;for(;p<ee.length&&!ee[p].includes("DetermineComponentFrameRoot");)p++;if(d===H.length||p===ee.length)for(d=H.length-1,p=ee.length-1;1<=d&&0<=p&&H[d]!==ee[p];)p--;for(;1<=d&&0<=p;d--,p--)if(H[d]!==ee[p]){if(d!==1||p!==1)do if(d--,p--,0>p||H[d]!==ee[p]){var pe=`
|
|
|
`+H[d].replace(" at new "," at ");return s.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",s.displayName)),pe}while(1<=d&&0<=p);break}}}finally{Y=!1,Error.prepareStackTrace=c}return(c=s?s.displayName||s.name:"")?X(c):""}function U(s){switch(s.tag){case 26:case 27:case 5:return X(s.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 15:return s=ae(s.type,!1),s;case 11:return s=ae(s.type.render,!1),s;case 1:return s=ae(s.type,!0),s;default:return""}}function z(s){try{var o="";do o+=U(s),s=s.return;while(s);return o}catch(c){return`
|
|
|
Error generating stack: `+c.message+`
|
|
|
`+c.stack}}function j(s){var o=s,c=s;if(s.alternate)for(;o.return;)o=o.return;else{s=o;do o=s,o.flags&4098&&(c=o.return),s=o.return;while(s)}return o.tag===3?c:null}function Z(s){if(s.tag===13){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function P(s){if(j(s)!==s)throw Error(r(188))}function $(s){var o=s.alternate;if(!o){if(o=j(s),o===null)throw Error(r(188));return o!==s?null:s}for(var c=s,d=o;;){var p=c.return;if(p===null)break;var y=p.alternate;if(y===null){if(d=p.return,d!==null){c=d;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===c)return P(p),s;if(y===d)return P(p),o;y=y.sibling}throw Error(r(188))}if(c.return!==d.return)c=p,d=y;else{for(var R=!1,I=p.child;I;){if(I===c){R=!0,c=p,d=y;break}if(I===d){R=!0,d=p,c=y;break}I=I.sibling}if(!R){for(I=y.child;I;){if(I===c){R=!0,c=y,d=p;break}if(I===d){R=!0,d=y,c=p;break}I=I.sibling}if(!R)throw Error(r(189))}}if(c.alternate!==d)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?s:o}function ie(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s;for(s=s.child;s!==null;){if(o=ie(s),o!==null)return o;s=s.sibling}return null}var se=Array.isArray,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},fe=[],ye=-1;function Ee(s){return{current:s}}function Ce(s){0>ye||(s.current=fe[ye],fe[ye]=null,ye--)}function Te(s,o){ye++,fe[ye]=s.current,s.current=o}var ve=Ee(null),ge=Ee(null),_e=Ee(null),Ie=Ee(null);function we(s,o){switch(Te(_e,o),Te(ge,s),Te(ve,null),s=o.nodeType,s){case 9:case 11:o=(o=o.documentElement)&&(o=o.namespaceURI)?pE(o):0;break;default:if(s=s===8?o.parentNode:o,o=s.tagName,s=s.namespaceURI)s=pE(s),o=mE(s,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}Ce(ve),Te(ve,o)}function xe(){Ce(ve),Ce(ge),Ce(_e)}function Ve(s){s.memoizedState!==null&&Te(Ie,s);var o=ve.current,c=mE(o,s.type);o!==c&&(Te(ge,s),Te(ve,c))}function Fe(s){ge.current===s&&(Ce(ve),Ce(ge)),Ie.current===s&&(Ce(Ie),Mu._currentValue=ce)}var Be=Object.prototype.hasOwnProperty,nt=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,Ge=t.unstable_shouldYield,Pe=t.unstable_requestPaint,Me=t.unstable_now,dt=t.unstable_getCurrentPriorityLevel,rt=t.unstable_ImmediatePriority,it=t.unstable_UserBlockingPriority,st=t.unstable_NormalPriority,at=t.unstable_LowPriority,Je=t.unstable_IdlePriority,lt=t.log,ft=t.unstable_setDisableYieldValue,ct=null,mt=null;function xt(s){if(mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(ct,s,void 0,(s.current.flags&128)===128)}catch{}}function Bt(s){if(typeof lt=="function"&&ft(s),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(ct,s)}catch{}}var ht=Math.clz32?Math.clz32:wn,Vt=Math.log,qt=Math.LN2;function wn(s){return s>>>=0,s===0?32:31-(Vt(s)/qt|0)|0}var Mn=128,Ut=4194304;function It(s){var o=s&42;if(o!==0)return o;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Lt(s,o){var c=s.pendingLanes;if(c===0)return 0;var d=0,p=s.suspendedLanes,y=s.pingedLanes,R=s.warmLanes;s=s.finishedLanes!==0;var I=c&134217727;return I!==0?(c=I&~p,c!==0?d=It(c):(y&=I,y!==0?d=It(y):s||(R=I&~R,R!==0&&(d=It(R))))):(I=c&~p,I!==0?d=It(I):y!==0?d=It(y):s||(R=c&~R,R!==0&&(d=It(R)))),d===0?0:o!==0&&o!==d&&!(o&p)&&(p=d&-d,R=o&-o,p>=R||p===32&&(R&4194176)!==0)?o:d}function Jt(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function Mt(s,o){switch(s){case 1:case 2:case 4:case 8:return o+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qe(){var s=Mn;return Mn<<=1,!(Mn&4194176)&&(Mn=128),s}function ke(){var s=Ut;return Ut<<=1,!(Ut&62914560)&&(Ut=4194304),s}function Ne(s){for(var o=[],c=0;31>c;c++)o.push(s);return o}function Et(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function en(s,o,c,d,p,y){var R=s.pendingLanes;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=c,s.entangledLanes&=c,s.errorRecoveryDisabledLanes&=c,s.shellSuspendCounter=0;var I=s.entanglements,H=s.expirationTimes,ee=s.hiddenUpdates;for(c=R&~c;0<c;){var pe=31-ht(c),Se=1<<pe;I[pe]=0,H[pe]=-1;var ue=ee[pe];if(ue!==null)for(ee[pe]=null,pe=0;pe<ue.length;pe++){var he=ue[pe];he!==null&&(he.lane&=-536870913)}c&=~Se}d!==0&&Ue(s,d,0),y!==0&&p===0&&s.tag!==0&&(s.suspendedLanes|=y&~(R&~o))}function Ue(s,o,c){s.pendingLanes|=o,s.suspendedLanes&=~o;var d=31-ht(o);s.entangledLanes|=o,s.entanglements[d]=s.entanglements[d]|1073741824|c&4194218}function Oe(s,o){var c=s.entangledLanes|=o;for(s=s.entanglements;c;){var d=31-ht(c),p=1<<d;p&o|s[d]&o&&(s[d]|=o),c&=~p}}function je(s){return s&=-s,2<s?8<s?s&134217727?32:268435456:8:2}function Ye(){var s=q.p;return s!==0?s:(s=window.event,s===void 0?32:DE(s.type))}function We(s,o){var c=q.p;try{return q.p=s,o()}finally{q.p=c}}var Qe=Math.random().toString(36).slice(2),bt="__reactFiber$"+Qe,_t="__reactProps$"+Qe,Zt="__reactContainer$"+Qe,Yt="__reactEvents$"+Qe,vn="__reactListeners$"+Qe,On="__reactHandles$"+Qe,_n="__reactResources$"+Qe,Zn="__reactMarker$"+Qe;function un(s){delete s[bt],delete s[_t],delete s[Yt],delete s[vn],delete s[On]}function rn(s){var o=s[bt];if(o)return o;for(var c=s.parentNode;c;){if(o=c[Zt]||c[bt]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(s=yE(s);s!==null;){if(c=s[bt])return c;s=yE(s)}return o}s=c,c=s.parentNode}return null}function Ae(s){if(s=s[bt]||s[Zt]){var o=s.tag;if(o===5||o===6||o===13||o===26||o===27||o===3)return s}return null}function Le(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s.stateNode;throw Error(r(33))}function De(s){var o=s[_n];return o||(o=s[_n]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function be(s){s[Zn]=!0}var ut=new Set,zt={};function Ot(s,o){In(s,o),In(s+"Capture",o)}function In(s,o){for(zt[s]=o,s=0;s<o.length;s++)ut.add(o[s])}var tn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vn=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Pn={},Bn={};function Or(s){return Be.call(Bn,s)?!0:Be.call(Pn,s)?!1:Vn.test(s)?Bn[s]=!0:(Pn[s]=!0,!1)}function er(s,o,c){if(Or(o))if(c===null)s.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":s.removeAttribute(o);return;case"boolean":var d=o.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){s.removeAttribute(o);return}}s.setAttribute(o,""+c)}}function Un(s,o,c){if(c===null)s.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(o);return}s.setAttribute(o,""+c)}}function Tn(s,o,c,d){if(d===null)s.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttributeNS(o,c,""+d)}}function Qn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Ii(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function jr(s){var o=Ii(s)?"checked":"value",c=Object.getOwnPropertyDescriptor(s.constructor.prototype,o),d=""+s[o];if(!s.hasOwnProperty(o)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(s,o,{configurable:!0,get:function(){return p.call(this)},set:function(R){d=""+R,y.call(this,R)}}),Object.defineProperty(s,o,{enumerable:c.enumerable}),{getValue:function(){return d},setValue:function(R){d=""+R},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function Di(s){s._valueTracker||(s._valueTracker=jr(s))}function Fi(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var c=o.getValue(),d="";return s&&(d=Ii(s)?s.checked?"true":"false":s.value),s=d,s!==c?(o.setValue(s),!0):!1}function Tt(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var yt=/[\n"\\]/g;function nn(s){return s.replace(yt,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Hn(s,o,c,d,p,y,R,I){s.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?s.type=R:s.removeAttribute("type"),o!=null?R==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+Qn(o)):s.value!==""+Qn(o)&&(s.value=""+Qn(o)):R!=="submit"&&R!=="reset"||s.removeAttribute("value"),o!=null?Nn(s,R,Qn(o)):c!=null?Nn(s,R,Qn(c)):d!=null&&s.removeAttribute("value"),p==null&&y!=null&&(s.defaultChecked=!!y),p!=null&&(s.checked=p&&typeof p!="function"&&typeof p!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?s.name=""+Qn(I):s.removeAttribute("name")}function Cn(s,o,c,d,p,y,R,I){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(s.type=y),o!=null||c!=null){if(!(y!=="submit"&&y!=="reset"||o!=null))return;c=c!=null?""+Qn(c):"",o=o!=null?""+Qn(o):c,I||o===s.value||(s.value=o),s.defaultValue=o}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,s.checked=I?s.checked:!!d,s.defaultChecked=!!d,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(s.name=R)}function Nn(s,o,c){o==="number"&&Tt(s.ownerDocument)===s||s.defaultValue===""+c||(s.defaultValue=""+c)}function tr(s,o,c,d){if(s=s.options,o){o={};for(var p=0;p<c.length;p++)o["$"+c[p]]=!0;for(c=0;c<s.length;c++)p=o.hasOwnProperty("$"+s[c].value),s[c].selected!==p&&(s[c].selected=p),p&&d&&(s[c].defaultSelected=!0)}else{for(c=""+Qn(c),o=null,p=0;p<s.length;p++){if(s[p].value===c){s[p].selected=!0,d&&(s[p].defaultSelected=!0);return}o!==null||s[p].disabled||(o=s[p])}o!==null&&(o.selected=!0)}}function br(s,o,c){if(o!=null&&(o=""+Qn(o),o!==s.value&&(s.value=o),c==null)){s.defaultValue!==o&&(s.defaultValue=o);return}s.defaultValue=c!=null?""+Qn(c):""}function Br(s,o,c,d){if(o==null){if(d!=null){if(c!=null)throw Error(r(92));if(se(d)){if(1<d.length)throw Error(r(93));d=d[0]}c=d}c==null&&(c=""),o=c}c=Qn(o),s.defaultValue=c,d=s.textContent,d===c&&d!==""&&d!==null&&(s.value=d)}function Sr(s,o){if(o){var c=s.firstChild;if(c&&c===s.lastChild&&c.nodeType===3){c.nodeValue=o;return}}s.textContent=o}var Qr=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Gr(s,o,c){var d=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?d?s.setProperty(o,""):o==="float"?s.cssFloat="":s[o]="":d?s.setProperty(o,c):typeof c!="number"||c===0||Qr.has(o)?o==="float"?s.cssFloat=c:s[o]=(""+c).trim():s[o]=c+"px"}function gr(s,o,c){if(o!=null&&typeof o!="object")throw Error(r(62));if(s=s.style,c!=null){for(var d in c)!c.hasOwnProperty(d)||o!=null&&o.hasOwnProperty(d)||(d.indexOf("--")===0?s.setProperty(d,""):d==="float"?s.cssFloat="":s[d]="");for(var p in o)d=o[p],o.hasOwnProperty(p)&&c[p]!==d&&Gr(s,p,d)}else for(var y in o)o.hasOwnProperty(y)&&Gr(s,y,o[y])}function $a(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Wr=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Go=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ki(s){return Go.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}var fi=null;function di(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var hi=null,Bi=null;function Jo(s){var o=Ae(s);if(o&&(s=o.stateNode)){var c=s[_t]||null;e:switch(s=o.stateNode,o.type){case"input":if(Hn(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=s;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+nn(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var d=c[o];if(d!==s&&d.form===s.form){var p=d[_t]||null;if(!p)throw Error(r(90));Hn(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(o=0;o<c.length;o++)d=c[o],d.form===s.form&&Fi(d)}break e;case"textarea":br(s,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&tr(s,!!c.multiple,o,!1)}}}var Va=!1;function el(s,o,c){if(Va)return s(o,c);Va=!0;try{var d=s(o);return d}finally{if(Va=!1,(hi!==null||Bi!==null)&&(Id(),hi&&(o=hi,s=Bi,Bi=hi=null,Jo(o),s)))for(o=0;o<s.length;o++)Jo(s[o])}}function $e(s,o){var c=s.stateNode;if(c===null)return null;var d=c[_t]||null;if(d===null)return null;c=d[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(s=s.type,d=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!d;break e;default:s=!1}if(s)return null;if(c&&typeof c!="function")throw Error(r(231,o,typeof c));return c}var gt=!1;if(tn)try{var sn={};Object.defineProperty(sn,"passive",{get:function(){gt=!0}}),window.addEventListener("test",sn,sn),window.removeEventListener("test",sn,sn)}catch{gt=!1}var fn=null,An=null,ws=null;function tl(){if(ws)return ws;var s,o=An,c=o.length,d,p="value"in fn?fn.value:fn.textContent,y=p.length;for(s=0;s<c&&o[s]===p[s];s++);var R=c-s;for(d=1;d<=R&&o[c-d]===p[y-d];d++);return ws=p.slice(s,1<d?1-d:void 0)}function Ha(s){var o=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&o===13&&(s=13)):s=o,s===10&&(s=13),32<=s||s===13?s:0}function Ts(){return!0}function xb(){return!1}function Xr(s){function o(c,d,p,y,R){this._reactName=c,this._targetInst=p,this.type=d,this.nativeEvent=y,this.target=R,this.currentTarget=null;for(var I in s)s.hasOwnProperty(I)&&(c=s[I],this[I]=c?c(y):y[I]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ts:xb,this.isPropagationStopped=xb,this}return V(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Ts)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Ts)},persist:function(){},isPersistent:Ts}),o}var ja={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ed=Xr(ja),Wc=V({},ja,{view:0,detail:0}),zO=Xr(Wc),hp,gp,Xc,td=V({},Wc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mp,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Xc&&(Xc&&s.type==="mousemove"?(hp=s.screenX-Xc.screenX,gp=s.screenY-Xc.screenY):gp=hp=0,Xc=s),hp)},movementY:function(s){return"movementY"in s?s.movementY:gp}}),Mb=Xr(td),$O=V({},td,{dataTransfer:0}),VO=Xr($O),HO=V({},Wc,{relatedTarget:0}),pp=Xr(HO),jO=V({},ja,{animationName:0,elapsedTime:0,pseudoElement:0}),WO=Xr(jO),XO=V({},ja,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),qO=Xr(XO),YO=V({},ja,{data:0}),Ob=Xr(YO),KO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},QO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function GO(s){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(s):(s=QO[s])?!!o[s]:!1}function mp(){return GO}var JO=V({},Wc,{key:function(s){if(s.key){var o=KO[s.key]||s.key;if(o!=="Unidentified")return o}return s.type==="keypress"?(s=Ha(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?ZO[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mp,charCode:function(s){return s.type==="keypress"?Ha(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Ha(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),eP=Xr(JO),tP=V({},td,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pb=Xr(tP),nP=V({},Wc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mp}),rP=Xr(nP),iP=V({},ja,{propertyName:0,elapsedTime:0,pseudoElement:0}),sP=Xr(iP),aP=V({},td,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),oP=Xr(aP),lP=V({},ja,{newState:0,oldState:0}),cP=Xr(lP),uP=[9,13,27,32],vp=tn&&"CompositionEvent"in window,qc=null;tn&&"documentMode"in document&&(qc=document.documentMode);var fP=tn&&"TextEvent"in window&&!qc,Nb=tn&&(!vp||qc&&8<qc&&11>=qc),Ib=" ",Db=!1;function Fb(s,o){switch(s){case"keyup":return uP.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kb(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var nl=!1;function dP(s,o){switch(s){case"compositionend":return kb(o);case"keypress":return o.which!==32?null:(Db=!0,Ib);case"textInput":return s=o.data,s===Ib&&Db?null:s;default:return null}}function hP(s,o){if(nl)return s==="compositionend"||!vp&&Fb(s,o)?(s=tl(),ws=An=fn=null,nl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Nb&&o.locale!=="ko"?null:o.data;default:return null}}var gP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Bb(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o==="input"?!!gP[s.type]:o==="textarea"}function Ub(s,o,c,d){hi?Bi?Bi.push(d):Bi=[d]:hi=d,o=Ud(o,"onChange"),0<o.length&&(c=new ed("onChange","change",null,c,d),s.push({event:c,listeners:o}))}var Yc=null,Kc=null;function pP(s){uE(s,0)}function nd(s){var o=Le(s);if(Fi(o))return s}function Lb(s,o){if(s==="change")return o}var zb=!1;if(tn){var _p;if(tn){var yp="oninput"in document;if(!yp){var $b=document.createElement("div");$b.setAttribute("oninput","return;"),yp=typeof $b.oninput=="function"}_p=yp}else _p=!1;zb=_p&&(!document.documentMode||9<document.documentMode)}function Vb(){Yc&&(Yc.detachEvent("onpropertychange",Hb),Kc=Yc=null)}function Hb(s){if(s.propertyName==="value"&&nd(Kc)){var o=[];Ub(o,Kc,s,di(s)),el(pP,o)}}function mP(s,o,c){s==="focusin"?(Vb(),Yc=o,Kc=c,Yc.attachEvent("onpropertychange",Hb)):s==="focusout"&&Vb()}function vP(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return nd(Kc)}function _P(s,o){if(s==="click")return nd(o)}function yP(s,o){if(s==="input"||s==="change")return nd(o)}function bP(s,o){return s===o&&(s!==0||1/s===1/o)||s!==s&&o!==o}var Jr=typeof Object.is=="function"?Object.is:bP;function Zc(s,o){if(Jr(s,o))return!0;if(typeof s!="object"||s===null||typeof o!="object"||o===null)return!1;var c=Object.keys(s),d=Object.keys(o);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++){var p=c[d];if(!Be.call(o,p)||!Jr(s[p],o[p]))return!1}return!0}function jb(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Wb(s,o){var c=jb(s);s=0;for(var d;c;){if(c.nodeType===3){if(d=s+c.textContent.length,s<=o&&d>=o)return{node:c,offset:o-s};s=d}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=jb(c)}}function Xb(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?Xb(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function qb(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=Tt(s.document);o instanceof s.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)s=o.contentWindow;else break;o=Tt(s.document)}return o}function bp(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}function SP(s,o){var c=qb(o);o=s.focusedElem;var d=s.selectionRange;if(c!==o&&o&&o.ownerDocument&&Xb(o.ownerDocument.documentElement,o)){if(d!==null&&bp(o)){if(s=d.start,c=d.end,c===void 0&&(c=s),"selectionStart"in o)o.selectionStart=s,o.selectionEnd=Math.min(c,o.value.length);else if(c=(s=o.ownerDocument||document)&&s.defaultView||window,c.getSelection){c=c.getSelection();var p=o.textContent.length,y=Math.min(d.start,p);d=d.end===void 0?y:Math.min(d.end,p),!c.extend&&y>d&&(p=d,d=y,y=p),p=Wb(o,y);var R=Wb(o,d);p&&R&&(c.rangeCount!==1||c.anchorNode!==p.node||c.anchorOffset!==p.offset||c.focusNode!==R.node||c.focusOffset!==R.offset)&&(s=s.createRange(),s.setStart(p.node,p.offset),c.removeAllRanges(),y>d?(c.addRange(s),c.extend(R.node,R.offset)):(s.setEnd(R.node,R.offset),c.addRange(s)))}}for(s=[],c=o;c=c.parentNode;)c.nodeType===1&&s.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<s.length;o++)c=s[o],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var EP=tn&&"documentMode"in document&&11>=document.documentMode,rl=null,Sp=null,Qc=null,Ep=!1;function Yb(s,o,c){var d=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Ep||rl==null||rl!==Tt(d)||(d=rl,"selectionStart"in d&&bp(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Qc&&Zc(Qc,d)||(Qc=d,d=Ud(Sp,"onSelect"),0<d.length&&(o=new ed("onSelect","select",null,o,c),s.push({event:o,listeners:d}),o.target=rl)))}function Wa(s,o){var c={};return c[s.toLowerCase()]=o.toLowerCase(),c["Webkit"+s]="webkit"+o,c["Moz"+s]="moz"+o,c}var il={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionrun:Wa("Transition","TransitionRun"),transitionstart:Wa("Transition","TransitionStart"),transitioncancel:Wa("Transition","TransitionCancel"),transitionend:Wa("Transition","TransitionEnd")},wp={},Kb={};tn&&(Kb=document.createElement("div").style,"AnimationEvent"in window||(delete il.animationend.animation,delete il.animationiteration.animation,delete il.animationstart.animation),"TransitionEvent"in window||delete il.transitionend.transition);function Xa(s){if(wp[s])return wp[s];if(!il[s])return s;var o=il[s],c;for(c in o)if(o.hasOwnProperty(c)&&c in Kb)return wp[s]=o[c];return s}var Zb=Xa("animationend"),Qb=Xa("animationiteration"),Gb=Xa("animationstart"),wP=Xa("transitionrun"),TP=Xa("transitionstart"),CP=Xa("transitioncancel"),Jb=Xa("transitionend"),e1=new Map,t1="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function Ui(s,o){e1.set(s,o),Ot(o,[s])}var gi=[],sl=0,Tp=0;function rd(){for(var s=sl,o=Tp=sl=0;o<s;){var c=gi[o];gi[o++]=null;var d=gi[o];gi[o++]=null;var p=gi[o];gi[o++]=null;var y=gi[o];if(gi[o++]=null,d!==null&&p!==null){var R=d.pending;R===null?p.next=p:(p.next=R.next,R.next=p),d.pending=p}y!==0&&n1(c,p,y)}}function id(s,o,c,d){gi[sl++]=s,gi[sl++]=o,gi[sl++]=c,gi[sl++]=d,Tp|=d,s.lanes|=d,s=s.alternate,s!==null&&(s.lanes|=d)}function Cp(s,o,c,d){return id(s,o,c,d),sd(s)}function Ks(s,o){return id(s,null,null,o),sd(s)}function n1(s,o,c){s.lanes|=c;var d=s.alternate;d!==null&&(d.lanes|=c);for(var p=!1,y=s.return;y!==null;)y.childLanes|=c,d=y.alternate,d!==null&&(d.childLanes|=c),y.tag===22&&(s=y.stateNode,s===null||s._visibility&1||(p=!0)),s=y,y=y.return;p&&o!==null&&s.tag===3&&(y=s.stateNode,p=31-ht(c),y=y.hiddenUpdates,s=y[p],s===null?y[p]=[o]:s.push(o),o.lane=c|536870912)}function sd(s){if(50<Eu)throw Eu=0,Pm=null,Error(r(185));for(var o=s.return;o!==null;)s=o,o=s.return;return s.tag===3?s.stateNode:null}var al={},r1=new WeakMap;function pi(s,o){if(typeof s=="object"&&s!==null){var c=r1.get(s);return c!==void 0?c:(o={value:s,source:o,stack:z(o)},r1.set(s,o),o)}return{value:s,source:o,stack:z(o)}}var ol=[],ll=0,ad=null,od=0,mi=[],vi=0,qa=null,Cs=1,As="";function Ya(s,o){ol[ll++]=od,ol[ll++]=ad,ad=s,od=o}function i1(s,o,c){mi[vi++]=Cs,mi[vi++]=As,mi[vi++]=qa,qa=s;var d=Cs;s=As;var p=32-ht(d)-1;d&=~(1<<p),c+=1;var y=32-ht(o)+p;if(30<y){var R=p-p%5;y=(d&(1<<R)-1).toString(32),d>>=R,p-=R,Cs=1<<32-ht(o)+p|c<<p|d,As=y+s}else Cs=1<<y|c<<p|d,As=s}function Ap(s){s.return!==null&&(Ya(s,1),i1(s,1,0))}function Rp(s){for(;s===ad;)ad=ol[--ll],ol[ll]=null,od=ol[--ll],ol[ll]=null;for(;s===qa;)qa=mi[--vi],mi[vi]=null,As=mi[--vi],mi[vi]=null,Cs=mi[--vi],mi[vi]=null}var Ur=null,Er=null,Qt=!1,Li=null,ns=!1,xp=Error(r(519));function Ka(s){var o=Error(r(418,""));throw eu(pi(o,s)),xp}function s1(s){var o=s.stateNode,c=s.type,d=s.memoizedProps;switch(o[bt]=s,o[_t]=d,c){case"dialog":jt("cancel",o),jt("close",o);break;case"iframe":case"object":case"embed":jt("load",o);break;case"video":case"audio":for(c=0;c<Tu.length;c++)jt(Tu[c],o);break;case"source":jt("error",o);break;case"img":case"image":case"link":jt("error",o),jt("load",o);break;case"details":jt("toggle",o);break;case"input":jt("invalid",o),Cn(o,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0),Di(o);break;case"select":jt("invalid",o);break;case"textarea":jt("invalid",o),Br(o,d.value,d.defaultValue,d.children),Di(o)}c=d.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||d.suppressHydrationWarning===!0||gE(o.textContent,c)?(d.popover!=null&&(jt("beforetoggle",o),jt("toggle",o)),d.onScroll!=null&&jt("scroll",o),d.onScrollEnd!=null&&jt("scrollend",o),d.onClick!=null&&(o.onclick=Ld),o=!0):o=!1,o||Ka(s)}function a1(s){for(Ur=s.return;Ur;)switch(Ur.tag){case 3:case 27:ns=!0;return;case 5:case 13:ns=!1;return;default:Ur=Ur.return}}function Gc(s){if(s!==Ur)return!1;if(!Qt)return a1(s),Qt=!0,!1;var o=!1,c;if((c=s.tag!==3&&s.tag!==27)&&((c=s.tag===5)&&(c=s.type,c=!(c!=="form"&&c!=="button")||Ym(s.type,s.memoizedProps)),c=!c),c&&(o=!0),o&&Er&&Ka(s),a1(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));e:{for(s=s.nextSibling,o=0;s;){if(s.nodeType===8)if(c=s.data,c==="/$"){if(o===0){Er=$i(s.nextSibling);break e}o--}else c!=="$"&&c!=="$!"&&c!=="$?"||o++;s=s.nextSibling}Er=null}}else Er=Ur?$i(s.stateNode.nextSibling):null;return!0}function Jc(){Er=Ur=null,Qt=!1}function eu(s){Li===null?Li=[s]:Li.push(s)}var tu=Error(r(460)),o1=Error(r(474)),Mp={then:function(){}};function l1(s){return s=s.status,s==="fulfilled"||s==="rejected"}function ld(){}function c1(s,o,c){switch(c=s[c],c===void 0?s.push(o):c!==o&&(o.then(ld,ld),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,s===tu?Error(r(483)):s;default:if(typeof o.status=="string")o.then(ld,ld);else{if(s=Rn,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=o,s.status="pending",s.then(function(d){if(o.status==="pending"){var p=o;p.status="fulfilled",p.value=d}},function(d){if(o.status==="pending"){var p=o;p.status="rejected",p.reason=d}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,s===tu?Error(r(483)):s}throw nu=o,tu}}var nu=null;function u1(){if(nu===null)throw Error(r(459));var s=nu;return nu=null,s}var cl=null,ru=0;function cd(s){var o=ru;return ru+=1,cl===null&&(cl=[]),c1(cl,s,o)}function iu(s,o){o=o.props.ref,s.ref=o!==void 0?o:null}function ud(s,o){throw o.$$typeof===a?Error(r(525)):(s=Object.prototype.toString.call(o),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":s)))}function f1(s){var o=s._init;return o(s._payload)}function d1(s){function o(re,Q){if(s){var le=re.deletions;le===null?(re.deletions=[Q],re.flags|=16):le.push(Q)}}function c(re,Q){if(!s)return null;for(;Q!==null;)o(re,Q),Q=Q.sibling;return null}function d(re){for(var Q=new Map;re!==null;)re.key!==null?Q.set(re.key,re):Q.set(re.index,re),re=re.sibling;return Q}function p(re,Q){return re=oa(re,Q),re.index=0,re.sibling=null,re}function y(re,Q,le){return re.index=le,s?(le=re.alternate,le!==null?(le=le.index,le<Q?(re.flags|=33554434,Q):le):(re.flags|=33554434,Q)):(re.flags|=1048576,Q)}function R(re){return s&&re.alternate===null&&(re.flags|=33554434),re}function I(re,Q,le,me){return Q===null||Q.tag!==6?(Q=wm(le,re.mode,me),Q.return=re,Q):(Q=p(Q,le),Q.return=re,Q)}function H(re,Q,le,me){var Ke=le.type;return Ke===f?pe(re,Q,le.props.children,me,le.key):Q!==null&&(Q.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&f1(Ke)===Q.type)?(Q=p(Q,le.props),iu(Q,le),Q.return=re,Q):(Q=xd(le.type,le.key,le.props,null,re.mode,me),iu(Q,le),Q.return=re,Q)}function ee(re,Q,le,me){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==le.containerInfo||Q.stateNode.implementation!==le.implementation?(Q=Tm(le,re.mode,me),Q.return=re,Q):(Q=p(Q,le.children||[]),Q.return=re,Q)}function pe(re,Q,le,me,Ke){return Q===null||Q.tag!==7?(Q=so(le,re.mode,me,Ke),Q.return=re,Q):(Q=p(Q,le),Q.return=re,Q)}function Se(re,Q,le){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=wm(""+Q,re.mode,le),Q.return=re,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case l:return le=xd(Q.type,Q.key,Q.props,null,re.mode,le),iu(le,Q),le.return=re,le;case u:return Q=Tm(Q,re.mode,le),Q.return=re,Q;case T:var me=Q._init;return Q=me(Q._payload),Se(re,Q,le)}if(se(Q)||N(Q))return Q=so(Q,re.mode,le,null),Q.return=re,Q;if(typeof Q.then=="function")return Se(re,cd(Q),le);if(Q.$$typeof===S)return Se(re,Cd(re,Q),le);ud(re,Q)}return null}function ue(re,Q,le,me){var Ke=Q!==null?Q.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Ke!==null?null:I(re,Q,""+le,me);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case l:return le.key===Ke?H(re,Q,le,me):null;case u:return le.key===Ke?ee(re,Q,le,me):null;case T:return Ke=le._init,le=Ke(le._payload),ue(re,Q,le,me)}if(se(le)||N(le))return Ke!==null?null:pe(re,Q,le,me,null);if(typeof le.then=="function")return ue(re,Q,cd(le),me);if(le.$$typeof===S)return ue(re,Q,Cd(re,le),me);ud(re,le)}return null}function he(re,Q,le,me,Ke){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return re=re.get(le)||null,I(Q,re,""+me,Ke);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case l:return re=re.get(me.key===null?le:me.key)||null,H(Q,re,me,Ke);case u:return re=re.get(me.key===null?le:me.key)||null,ee(Q,re,me,Ke);case T:var Dt=me._init;return me=Dt(me._payload),he(re,Q,le,me,Ke)}if(se(me)||N(me))return re=re.get(le)||null,pe(Q,re,me,Ke,null);if(typeof me.then=="function")return he(re,Q,le,cd(me),Ke);if(me.$$typeof===S)return he(re,Q,le,Cd(Q,me),Ke);ud(Q,me)}return null}function tt(re,Q,le,me){for(var Ke=null,Dt=null,ot=Q,vt=Q=0,vr=null;ot!==null&&vt<le.length;vt++){ot.index>vt?(vr=ot,ot=null):vr=ot.sibling;var Gt=ue(re,ot,le[vt],me);if(Gt===null){ot===null&&(ot=vr);break}s&&ot&&Gt.alternate===null&&o(re,ot),Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt,ot=vr}if(vt===le.length)return c(re,ot),Qt&&Ya(re,vt),Ke;if(ot===null){for(;vt<le.length;vt++)ot=Se(re,le[vt],me),ot!==null&&(Q=y(ot,Q,vt),Dt===null?Ke=ot:Dt.sibling=ot,Dt=ot);return Qt&&Ya(re,vt),Ke}for(ot=d(ot);vt<le.length;vt++)vr=he(ot,re,vt,le[vt],me),vr!==null&&(s&&vr.alternate!==null&&ot.delete(vr.key===null?vt:vr.key),Q=y(vr,Q,vt),Dt===null?Ke=vr:Dt.sibling=vr,Dt=vr);return s&&ot.forEach(function(ga){return o(re,ga)}),Qt&&Ya(re,vt),Ke}function wt(re,Q,le,me){if(le==null)throw Error(r(151));for(var Ke=null,Dt=null,ot=Q,vt=Q=0,vr=null,Gt=le.next();ot!==null&&!Gt.done;vt++,Gt=le.next()){ot.index>vt?(vr=ot,ot=null):vr=ot.sibling;var ga=ue(re,ot,Gt.value,me);if(ga===null){ot===null&&(ot=vr);break}s&&ot&&ga.alternate===null&&o(re,ot),Q=y(ga,Q,vt),Dt===null?Ke=ga:Dt.sibling=ga,Dt=ga,ot=vr}if(Gt.done)return c(re,ot),Qt&&Ya(re,vt),Ke;if(ot===null){for(;!Gt.done;vt++,Gt=le.next())Gt=Se(re,Gt.value,me),Gt!==null&&(Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt);return Qt&&Ya(re,vt),Ke}for(ot=d(ot);!Gt.done;vt++,Gt=le.next())Gt=he(ot,re,vt,Gt.value,me),Gt!==null&&(s&&Gt.alternate!==null&&ot.delete(Gt.key===null?vt:Gt.key),Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt);return s&&ot.forEach(function(LN){return o(re,LN)}),Qt&&Ya(re,vt),Ke}function Xn(re,Q,le,me){if(typeof le=="object"&&le!==null&&le.type===f&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case l:e:{for(var Ke=le.key;Q!==null;){if(Q.key===Ke){if(Ke=le.type,Ke===f){if(Q.tag===7){c(re,Q.sibling),me=p(Q,le.props.children),me.return=re,re=me;break e}}else if(Q.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&f1(Ke)===Q.type){c(re,Q.sibling),me=p(Q,le.props),iu(me,le),me.return=re,re=me;break e}c(re,Q);break}else o(re,Q);Q=Q.sibling}le.type===f?(me=so(le.props.children,re.mode,me,le.key),me.return=re,re=me):(me=xd(le.type,le.key,le.props,null,re.mode,me),iu(me,le),me.return=re,re=me)}return R(re);case u:e:{for(Ke=le.key;Q!==null;){if(Q.key===Ke)if(Q.tag===4&&Q.stateNode.containerInfo===le.containerInfo&&Q.stateNode.implementation===le.implementation){c(re,Q.sibling),me=p(Q,le.children||[]),me.return=re,re=me;break e}else{c(re,Q);break}else o(re,Q);Q=Q.sibling}me=Tm(le,re.mode,me),me.return=re,re=me}return R(re);case T:return Ke=le._init,le=Ke(le._payload),Xn(re,Q,le,me)}if(se(le))return tt(re,Q,le,me);if(N(le)){if(Ke=N(le),typeof Ke!="function")throw Error(r(150));return le=Ke.call(le),wt(re,Q,le,me)}if(typeof le.then=="function")return Xn(re,Q,cd(le),me);if(le.$$typeof===S)return Xn(re,Q,Cd(re,le),me);ud(re,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,Q!==null&&Q.tag===6?(c(re,Q.sibling),me=p(Q,le),me.return=re,re=me):(c(re,Q),me=wm(le,re.mode,me),me.return=re,re=me),R(re)):c(re,Q)}return function(re,Q,le,me){try{ru=0;var Ke=Xn(re,Q,le,me);return cl=null,Ke}catch(ot){if(ot===tu)throw ot;var Dt=Si(29,ot,null,re.mode);return Dt.lanes=me,Dt.return=re,Dt}finally{}}}var Za=d1(!0),h1=d1(!1),ul=Ee(null),fd=Ee(0);function g1(s,o){s=Bs,Te(fd,s),Te(ul,o),Bs=s|o.baseLanes}function Op(){Te(fd,Bs),Te(ul,ul.current)}function Pp(){Bs=fd.current,Ce(ul),Ce(fd)}var _i=Ee(null),rs=null;function Zs(s){var o=s.alternate;Te(lr,lr.current&1),Te(_i,s),rs===null&&(o===null||ul.current!==null||o.memoizedState!==null)&&(rs=s)}function p1(s){if(s.tag===22){if(Te(lr,lr.current),Te(_i,s),rs===null){var o=s.alternate;o!==null&&o.memoizedState!==null&&(rs=s)}}else Qs()}function Qs(){Te(lr,lr.current),Te(_i,_i.current)}function Rs(s){Ce(_i),rs===s&&(rs=null),Ce(lr)}var lr=Ee(0);function dd(s){for(var o=s;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if(o.flags&128)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var AP=typeof AbortController<"u"?AbortController:function(){var s=[],o=this.signal={aborted:!1,addEventListener:function(c,d){s.push(d)}};this.abort=function(){o.aborted=!0,s.forEach(function(c){return c()})}},RP=t.unstable_scheduleCallback,xP=t.unstable_NormalPriority,cr={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Np(){return{controller:new AP,data:new Map,refCount:0}}function su(s){s.refCount--,s.refCount===0&&RP(xP,function(){s.controller.abort()})}var au=null,Ip=0,fl=0,dl=null;function MP(s,o){if(au===null){var c=au=[];Ip=0,fl=Lm(),dl={status:"pending",value:void 0,then:function(d){c.push(d)}}}return Ip++,o.then(m1,m1),o}function m1(){if(--Ip===0&&au!==null){dl!==null&&(dl.status="fulfilled");var s=au;au=null,fl=0,dl=null;for(var o=0;o<s.length;o++)(0,s[o])()}}function OP(s,o){var c=[],d={status:"pending",value:null,reason:null,then:function(p){c.push(p)}};return s.then(function(){d.status="fulfilled",d.value=o;for(var p=0;p<c.length;p++)(0,c[p])(o)},function(p){for(d.status="rejected",d.reason=p,p=0;p<c.length;p++)(0,c[p])(void 0)}),d}var v1=D.S;D.S=function(s,o){typeof o=="object"&&o!==null&&typeof o.then=="function"&&MP(s,o),v1!==null&&v1(s,o)};var Qa=Ee(null);function Dp(){var s=Qa.current;return s!==null?s:Rn.pooledCache}function hd(s,o){o===null?Te(Qa,Qa.current):Te(Qa,o.pool)}function _1(){var s=Dp();return s===null?null:{parent:cr._currentValue,pool:s}}var Gs=0,Pt=null,dn=null,nr=null,gd=!1,hl=!1,Ga=!1,pd=0,ou=0,gl=null,PP=0;function Gn(){throw Error(r(321))}function Fp(s,o){if(o===null)return!1;for(var c=0;c<o.length&&c<s.length;c++)if(!Jr(s[c],o[c]))return!1;return!0}function kp(s,o,c,d,p,y){return Gs=y,Pt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,D.H=s===null||s.memoizedState===null?Ja:Js,Ga=!1,y=c(d,p),Ga=!1,hl&&(y=b1(o,c,d,p)),y1(s),y}function y1(s){D.H=is;var o=dn!==null&&dn.next!==null;if(Gs=0,nr=dn=Pt=null,gd=!1,ou=0,gl=null,o)throw Error(r(300));s===null||pr||(s=s.dependencies,s!==null&&Td(s)&&(pr=!0))}function b1(s,o,c,d){Pt=s;var p=0;do{if(hl&&(gl=null),ou=0,hl=!1,25<=p)throw Error(r(301));if(p+=1,nr=dn=null,s.updateQueue!=null){var y=s.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}D.H=eo,y=o(c,d)}while(hl);return y}function NP(){var s=D.H,o=s.useState()[0];return o=typeof o.then=="function"?lu(o):o,s=s.useState()[0],(dn!==null?dn.memoizedState:null)!==s&&(Pt.flags|=1024),o}function Bp(){var s=pd!==0;return pd=0,s}function Up(s,o,c){o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~c}function Lp(s){if(gd){for(s=s.memoizedState;s!==null;){var o=s.queue;o!==null&&(o.pending=null),s=s.next}gd=!1}Gs=0,nr=dn=Pt=null,hl=!1,ou=pd=0,gl=null}function qr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nr===null?Pt.memoizedState=nr=s:nr=nr.next=s,nr}function rr(){if(dn===null){var s=Pt.alternate;s=s!==null?s.memoizedState:null}else s=dn.next;var o=nr===null?Pt.memoizedState:nr.next;if(o!==null)nr=o,dn=s;else{if(s===null)throw Pt.alternate===null?Error(r(467)):Error(r(310));dn=s,s={memoizedState:dn.memoizedState,baseState:dn.baseState,baseQueue:dn.baseQueue,queue:dn.queue,next:null},nr===null?Pt.memoizedState=nr=s:nr=nr.next=s}return nr}var md;md=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function lu(s){var o=ou;return ou+=1,gl===null&&(gl=[]),s=c1(gl,s,o),o=Pt,(nr===null?o.memoizedState:nr.next)===null&&(o=o.alternate,D.H=o===null||o.memoizedState===null?Ja:Js),s}function vd(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return lu(s);if(s.$$typeof===S)return Pr(s)}throw Error(r(438,String(s)))}function zp(s){var o=null,c=Pt.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var d=Pt.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(o={data:d.data.map(function(p){return p.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=md(),Pt.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(s),d=0;d<s;d++)c[d]=O;return o.index++,c}function xs(s,o){return typeof o=="function"?o(s):o}function _d(s){var o=rr();return $p(o,dn,s)}function $p(s,o,c){var d=s.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=c;var p=s.baseQueue,y=d.pending;if(y!==null){if(p!==null){var R=p.next;p.next=y.next,y.next=R}o.baseQueue=p=y,d.pending=null}if(y=s.baseState,p===null)s.memoizedState=y;else{o=p.next;var I=R=null,H=null,ee=o,pe=!1;do{var Se=ee.lane&-536870913;if(Se!==ee.lane?(Kt&Se)===Se:(Gs&Se)===Se){var ue=ee.revertLane;if(ue===0)H!==null&&(H=H.next={lane:0,revertLane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),Se===fl&&(pe=!0);else if((Gs&ue)===ue){ee=ee.next,ue===fl&&(pe=!0);continue}else Se={lane:0,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},H===null?(I=H=Se,R=y):H=H.next=Se,Pt.lanes|=ue,la|=ue;Se=ee.action,Ga&&c(y,Se),y=ee.hasEagerState?ee.eagerState:c(y,Se)}else ue={lane:Se,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},H===null?(I=H=ue,R=y):H=H.next=ue,Pt.lanes|=Se,la|=Se;ee=ee.next}while(ee!==null&&ee!==o);if(H===null?R=y:H.next=I,!Jr(y,s.memoizedState)&&(pr=!0,pe&&(c=dl,c!==null)))throw c;s.memoizedState=y,s.baseState=R,s.baseQueue=H,d.lastRenderedState=y}return p===null&&(d.lanes=0),[s.memoizedState,d.dispatch]}function Vp(s){var o=rr(),c=o.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=s;var d=c.dispatch,p=c.pending,y=o.memoizedState;if(p!==null){c.pending=null;var R=p=p.next;do y=s(y,R.action),R=R.next;while(R!==p);Jr(y,o.memoizedState)||(pr=!0),o.memoizedState=y,o.baseQueue===null&&(o.baseState=y),c.lastRenderedState=y}return[y,d]}function S1(s,o,c){var d=Pt,p=rr(),y=Qt;if(y){if(c===void 0)throw Error(r(407));c=c()}else c=o();var R=!Jr((dn||p).memoizedState,c);if(R&&(p.memoizedState=c,pr=!0),p=p.queue,Wp(T1.bind(null,d,p,s),[s]),p.getSnapshot!==o||R||nr!==null&&nr.memoizedState.tag&1){if(d.flags|=2048,pl(9,w1.bind(null,d,p,c,o),{destroy:void 0},null),Rn===null)throw Error(r(349));y||Gs&60||E1(d,o,c)}return c}function E1(s,o,c){s.flags|=16384,s={getSnapshot:o,value:c},o=Pt.updateQueue,o===null?(o=md(),Pt.updateQueue=o,o.stores=[s]):(c=o.stores,c===null?o.stores=[s]:c.push(s))}function w1(s,o,c,d){o.value=c,o.getSnapshot=d,C1(o)&&A1(s)}function T1(s,o,c){return c(function(){C1(o)&&A1(s)})}function C1(s){var o=s.getSnapshot;s=s.value;try{var c=o();return!Jr(s,c)}catch{return!0}}function A1(s){var o=Ks(s,2);o!==null&&Lr(o,s,2)}function Hp(s){var o=qr();if(typeof s=="function"){var c=s;if(s=c(),Ga){Bt(!0);try{c()}finally{Bt(!1)}}}return o.memoizedState=o.baseState=s,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:s},o}function R1(s,o,c,d){return s.baseState=c,$p(s,dn,typeof d=="function"?d:xs)}function IP(s,o,c,d,p){if(Sd(s))throw Error(r(485));if(s=o.action,s!==null){var y={payload:p,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){y.listeners.push(R)}};D.T!==null?c(!0):y.isTransition=!1,d(y),c=o.pending,c===null?(y.next=o.pending=y,x1(o,y)):(y.next=c.next,o.pending=c.next=y)}}function x1(s,o){var c=o.action,d=o.payload,p=s.state;if(o.isTransition){var y=D.T,R={};D.T=R;try{var I=c(p,d),H=D.S;H!==null&&H(R,I),M1(s,o,I)}catch(ee){jp(s,o,ee)}finally{D.T=y}}else try{y=c(p,d),M1(s,o,y)}catch(ee){jp(s,o,ee)}}function M1(s,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(d){O1(s,o,d)},function(d){return jp(s,o,d)}):O1(s,o,c)}function O1(s,o,c){o.status="fulfilled",o.value=c,P1(o),s.state=c,o=s.pending,o!==null&&(c=o.next,c===o?s.pending=null:(c=c.next,o.next=c,x1(s,c)))}function jp(s,o,c){var d=s.pending;if(s.pending=null,d!==null){d=d.next;do o.status="rejected",o.reason=c,P1(o),o=o.next;while(o!==d)}s.action=null}function P1(s){s=s.listeners;for(var o=0;o<s.length;o++)(0,s[o])()}function N1(s,o){return o}function I1(s,o){if(Qt){var c=Rn.formState;if(c!==null){e:{var d=Pt;if(Qt){if(Er){t:{for(var p=Er,y=ns;p.nodeType!==8;){if(!y){p=null;break t}if(p=$i(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){Er=$i(p.nextSibling),d=p.data==="F!";break e}}Ka(d)}d=!1}d&&(o=c[0])}}return c=qr(),c.memoizedState=c.baseState=o,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:N1,lastRenderedState:o},c.queue=d,c=Q1.bind(null,Pt,d),d.dispatch=c,d=Hp(!1),y=Zp.bind(null,Pt,!1,d.queue),d=qr(),p={state:o,dispatch:null,action:s,pending:null},d.queue=p,c=IP.bind(null,Pt,p,y,c),p.dispatch=c,d.memoizedState=s,[o,c,!1]}function D1(s){var o=rr();return F1(o,dn,s)}function F1(s,o,c){o=$p(s,o,N1)[0],s=_d(xs)[0],o=typeof o=="object"&&o!==null&&typeof o.then=="function"?lu(o):o;var d=rr(),p=d.queue,y=p.dispatch;return c!==d.memoizedState&&(Pt.flags|=2048,pl(9,DP.bind(null,p,c),{destroy:void 0},null)),[o,y,s]}function DP(s,o){s.action=o}function k1(s){var o=rr(),c=dn;if(c!==null)return F1(o,c,s);rr(),o=o.memoizedState,c=rr();var d=c.queue.dispatch;return c.memoizedState=s,[o,d,!1]}function pl(s,o,c,d){return s={tag:s,create:o,inst:c,deps:d,next:null},o=Pt.updateQueue,o===null&&(o=md(),Pt.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=s.next=s:(d=c.next,c.next=s,s.next=d,o.lastEffect=s),s}function B1(){return rr().memoizedState}function yd(s,o,c,d){var p=qr();Pt.flags|=s,p.memoizedState=pl(1|o,c,{destroy:void 0},d===void 0?null:d)}function bd(s,o,c,d){var p=rr();d=d===void 0?null:d;var y=p.memoizedState.inst;dn!==null&&d!==null&&Fp(d,dn.memoizedState.deps)?p.memoizedState=pl(o,c,y,d):(Pt.flags|=s,p.memoizedState=pl(1|o,c,y,d))}function U1(s,o){yd(8390656,8,s,o)}function Wp(s,o){bd(2048,8,s,o)}function L1(s,o){return bd(4,2,s,o)}function z1(s,o){return bd(4,4,s,o)}function $1(s,o){if(typeof o=="function"){s=s();var c=o(s);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return s=s(),o.current=s,function(){o.current=null}}function V1(s,o,c){c=c!=null?c.concat([s]):null,bd(4,4,$1.bind(null,o,s),c)}function Xp(){}function H1(s,o){var c=rr();o=o===void 0?null:o;var d=c.memoizedState;return o!==null&&Fp(o,d[1])?d[0]:(c.memoizedState=[s,o],s)}function j1(s,o){var c=rr();o=o===void 0?null:o;var d=c.memoizedState;if(o!==null&&Fp(o,d[1]))return d[0];if(d=s(),Ga){Bt(!0);try{s()}finally{Bt(!1)}}return c.memoizedState=[d,o],d}function qp(s,o,c){return c===void 0||Gs&1073741824?s.memoizedState=o:(s.memoizedState=c,s=XS(),Pt.lanes|=s,la|=s,c)}function W1(s,o,c,d){return Jr(c,o)?c:ul.current!==null?(s=qp(s,c,d),Jr(s,o)||(pr=!0),s):Gs&42?(s=XS(),Pt.lanes|=s,la|=s,o):(pr=!0,s.memoizedState=c)}function X1(s,o,c,d,p){var y=q.p;q.p=y!==0&&8>y?y:8;var R=D.T,I={};D.T=I,Zp(s,!1,o,c);try{var H=p(),ee=D.S;if(ee!==null&&ee(I,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var pe=OP(H,d);cu(s,o,pe,ri(s))}else cu(s,o,d,ri(s))}catch(Se){cu(s,o,{then:function(){},status:"rejected",reason:Se},ri())}finally{q.p=y,D.T=R}}function FP(){}function Yp(s,o,c,d){if(s.tag!==5)throw Error(r(476));var p=q1(s).queue;X1(s,p,o,ce,c===null?FP:function(){return Y1(s),c(d)})}function q1(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:ce},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:c},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function Y1(s){var o=q1(s).next.queue;cu(s,o,{},ri())}function Kp(){return Pr(Mu)}function K1(){return rr().memoizedState}function Z1(){return rr().memoizedState}function kP(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var c=ri();s=na(c);var d=ra(o,s,c);d!==null&&(Lr(d,o,c),du(d,o,c)),o={cache:Np()},s.payload=o;return}o=o.return}}function BP(s,o,c){var d=ri();c={lane:d,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null},Sd(s)?G1(o,c):(c=Cp(s,o,c,d),c!==null&&(Lr(c,s,d),J1(c,o,d)))}function Q1(s,o,c){var d=ri();cu(s,o,c,d)}function cu(s,o,c,d){var p={lane:d,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null};if(Sd(s))G1(o,p);else{var y=s.alternate;if(s.lanes===0&&(y===null||y.lanes===0)&&(y=o.lastRenderedReducer,y!==null))try{var R=o.lastRenderedState,I=y(R,c);if(p.hasEagerState=!0,p.eagerState=I,Jr(I,R))return id(s,o,p,0),Rn===null&&rd(),!1}catch{}finally{}if(c=Cp(s,o,p,d),c!==null)return Lr(c,s,d),J1(c,o,d),!0}return!1}function Zp(s,o,c,d){if(d={lane:2,revertLane:Lm(),action:d,hasEagerState:!1,eagerState:null,next:null},Sd(s)){if(o)throw Error(r(479))}else o=Cp(s,c,d,2),o!==null&&Lr(o,s,2)}function Sd(s){var o=s.alternate;return s===Pt||o!==null&&o===Pt}function G1(s,o){hl=gd=!0;var c=s.pending;c===null?o.next=o:(o.next=c.next,c.next=o),s.pending=o}function J1(s,o,c){if(c&4194176){var d=o.lanes;d&=s.pendingLanes,c|=d,o.lanes=c,Oe(s,c)}}var is={readContext:Pr,use:vd,useCallback:Gn,useContext:Gn,useEffect:Gn,useImperativeHandle:Gn,useLayoutEffect:Gn,useInsertionEffect:Gn,useMemo:Gn,useReducer:Gn,useRef:Gn,useState:Gn,useDebugValue:Gn,useDeferredValue:Gn,useTransition:Gn,useSyncExternalStore:Gn,useId:Gn};is.useCacheRefresh=Gn,is.useMemoCache=Gn,is.useHostTransitionStatus=Gn,is.useFormState=Gn,is.useActionState=Gn,is.useOptimistic=Gn;var Ja={readContext:Pr,use:vd,useCallback:function(s,o){return qr().memoizedState=[s,o===void 0?null:o],s},useContext:Pr,useEffect:U1,useImperativeHandle:function(s,o,c){c=c!=null?c.concat([s]):null,yd(4194308,4,$1.bind(null,o,s),c)},useLayoutEffect:function(s,o){return yd(4194308,4,s,o)},useInsertionEffect:function(s,o){yd(4,2,s,o)},useMemo:function(s,o){var c=qr();o=o===void 0?null:o;var d=s();if(Ga){Bt(!0);try{s()}finally{Bt(!1)}}return c.memoizedState=[d,o],d},useReducer:function(s,o,c){var d=qr();if(c!==void 0){var p=c(o);if(Ga){Bt(!0);try{c(o)}finally{Bt(!1)}}}else p=o;return d.memoizedState=d.baseState=p,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:p},d.queue=s,s=s.dispatch=BP.bind(null,Pt,s),[d.memoizedState,s]},useRef:function(s){var o=qr();return s={current:s},o.memoizedState=s},useState:function(s){s=Hp(s);var o=s.queue,c=Q1.bind(null,Pt,o);return o.dispatch=c,[s.memoizedState,c]},useDebugValue:Xp,useDeferredValue:function(s,o){var c=qr();return qp(c,s,o)},useTransition:function(){var s=Hp(!1);return s=X1.bind(null,Pt,s.queue,!0,!1),qr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,c){var d=Pt,p=qr();if(Qt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),Rn===null)throw Error(r(349));Kt&60||E1(d,o,c)}p.memoizedState=c;var y={value:c,getSnapshot:o};return p.queue=y,U1(T1.bind(null,d,y,s),[s]),d.flags|=2048,pl(9,w1.bind(null,d,y,c,o),{destroy:void 0},null),c},useId:function(){var s=qr(),o=Rn.identifierPrefix;if(Qt){var c=As,d=Cs;c=(d&~(1<<32-ht(d)-1)).toString(32)+c,o=":"+o+"R"+c,c=pd++,0<c&&(o+="H"+c.toString(32)),o+=":"}else c=PP++,o=":"+o+"r"+c.toString(32)+":";return s.memoizedState=o},useCacheRefresh:function(){return qr().memoizedState=kP.bind(null,Pt)}};Ja.useMemoCache=zp,Ja.useHostTransitionStatus=Kp,Ja.useFormState=I1,Ja.useActionState=I1,Ja.useOptimistic=function(s){var o=qr();o.memoizedState=o.baseState=s;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Zp.bind(null,Pt,!0,c),c.dispatch=o,[s,o]};var Js={readContext:Pr,use:vd,useCallback:H1,useContext:Pr,useEffect:Wp,useImperativeHandle:V1,useInsertionEffect:L1,useLayoutEffect:z1,useMemo:j1,useReducer:_d,useRef:B1,useState:function(){return _d(xs)},useDebugValue:Xp,useDeferredValue:function(s,o){var c=rr();return W1(c,dn.memoizedState,s,o)},useTransition:function(){var s=_d(xs)[0],o=rr().memoizedState;return[typeof s=="boolean"?s:lu(s),o]},useSyncExternalStore:S1,useId:K1};Js.useCacheRefresh=Z1,Js.useMemoCache=zp,Js.useHostTransitionStatus=Kp,Js.useFormState=D1,Js.useActionState=D1,Js.useOptimistic=function(s,o){var c=rr();return R1(c,dn,s,o)};var eo={readContext:Pr,use:vd,useCallback:H1,useContext:Pr,useEffect:Wp,useImperativeHandle:V1,useInsertionEffect:L1,useLayoutEffect:z1,useMemo:j1,useReducer:Vp,useRef:B1,useState:function(){return Vp(xs)},useDebugValue:Xp,useDeferredValue:function(s,o){var c=rr();return dn===null?qp(c,s,o):W1(c,dn.memoizedState,s,o)},useTransition:function(){var s=Vp(xs)[0],o=rr().memoizedState;return[typeof s=="boolean"?s:lu(s),o]},useSyncExternalStore:S1,useId:K1};eo.useCacheRefresh=Z1,eo.useMemoCache=zp,eo.useHostTransitionStatus=Kp,eo.useFormState=k1,eo.useActionState=k1,eo.useOptimistic=function(s,o){var c=rr();return dn!==null?R1(c,dn,s,o):(c.baseState=s,[s,c.queue.dispatch])};function Qp(s,o,c,d){o=s.memoizedState,c=c(d,o),c=c==null?o:V({},o,c),s.memoizedState=c,s.lanes===0&&(s.updateQueue.baseState=c)}var Gp={isMounted:function(s){return(s=s._reactInternals)?j(s)===s:!1},enqueueSetState:function(s,o,c){s=s._reactInternals;var d=ri(),p=na(d);p.payload=o,c!=null&&(p.callback=c),o=ra(s,p,d),o!==null&&(Lr(o,s,d),du(o,s,d))},enqueueReplaceState:function(s,o,c){s=s._reactInternals;var d=ri(),p=na(d);p.tag=1,p.payload=o,c!=null&&(p.callback=c),o=ra(s,p,d),o!==null&&(Lr(o,s,d),du(o,s,d))},enqueueForceUpdate:function(s,o){s=s._reactInternals;var c=ri(),d=na(c);d.tag=2,o!=null&&(d.callback=o),o=ra(s,d,c),o!==null&&(Lr(o,s,c),du(o,s,c))}};function eS(s,o,c,d,p,y,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(d,y,R):o.prototype&&o.prototype.isPureReactComponent?!Zc(c,d)||!Zc(p,y):!0}function tS(s,o,c,d){s=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,d),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,d),o.state!==s&&Gp.enqueueReplaceState(o,o.state,null)}function to(s,o){var c=o;if("ref"in o){c={};for(var d in o)d!=="ref"&&(c[d]=o[d])}if(s=s.defaultProps){c===o&&(c=V({},c));for(var p in s)c[p]===void 0&&(c[p]=s[p])}return c}var Ed=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)};function nS(s){Ed(s)}function rS(s){console.error(s)}function iS(s){Ed(s)}function wd(s,o){try{var c=s.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(d){setTimeout(function(){throw d})}}function sS(s,o,c){try{var d=s.onCaughtError;d(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Jp(s,o,c){return c=na(c),c.tag=3,c.payload={element:null},c.callback=function(){wd(s,o)},c}function aS(s){return s=na(s),s.tag=3,s}function oS(s,o,c,d){var p=c.type.getDerivedStateFromError;if(typeof p=="function"){var y=d.value;s.payload=function(){return p(y)},s.callback=function(){sS(o,c,d)}}var R=c.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(s.callback=function(){sS(o,c,d),typeof p!="function"&&(ca===null?ca=new Set([this]):ca.add(this));var I=d.stack;this.componentDidCatch(d.value,{componentStack:I!==null?I:""})})}function UP(s,o,c,d,p){if(c.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(o=c.alternate,o!==null&&fu(o,c,p,!0),c=_i.current,c!==null){switch(c.tag){case 13:return rs===null?Dm():c.alternate===null&&Wn===0&&(Wn=3),c.flags&=-257,c.flags|=65536,c.lanes=p,d===Mp?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([d]):o.add(d),km(s,d,p)),!1;case 22:return c.flags|=65536,d===Mp?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([d])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([d]):c.add(d)),km(s,d,p)),!1}throw Error(r(435,c.tag))}return km(s,d,p),Dm(),!1}if(Qt)return o=_i.current,o!==null?(!(o.flags&65536)&&(o.flags|=256),o.flags|=65536,o.lanes=p,d!==xp&&(s=Error(r(422),{cause:d}),eu(pi(s,c)))):(d!==xp&&(o=Error(r(423),{cause:d}),eu(pi(o,c))),s=s.current.alternate,s.flags|=65536,p&=-p,s.lanes|=p,d=pi(d,c),p=Jp(s.stateNode,d,p),gm(s,p),Wn!==4&&(Wn=2)),!1;var y=Error(r(520),{cause:d});if(y=pi(y,c),bu===null?bu=[y]:bu.push(y),Wn!==4&&(Wn=2),o===null)return!0;d=pi(d,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,s=p&-p,c.lanes|=s,s=Jp(c.stateNode,d,s),gm(c,s),!1;case 1:if(o=c.type,y=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ca===null||!ca.has(y))))return c.flags|=65536,p&=-p,c.lanes|=p,p=aS(p),oS(p,s,c,d),gm(c,p),!1}c=c.return}while(c!==null);return!1}var lS=Error(r(461)),pr=!1;function wr(s,o,c,d){o.child=s===null?h1(o,null,c,d):Za(o,s.child,c,d)}function cS(s,o,c,d,p){c=c.render;var y=o.ref;if("ref"in d){var R={};for(var I in d)I!=="ref"&&(R[I]=d[I])}else R=d;return ro(o),d=kp(s,o,c,R,y,p),I=Bp(),s!==null&&!pr?(Up(s,o,p),Ms(s,o,p)):(Qt&&I&&Ap(o),o.flags|=1,wr(s,o,d,p),o.child)}function uS(s,o,c,d,p){if(s===null){var y=c.type;return typeof y=="function"&&!Em(y)&&y.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=y,fS(s,o,y,d,p)):(s=xd(c.type,null,d,o,o.mode,p),s.ref=o.ref,s.return=o,o.child=s)}if(y=s.child,!lm(s,p)){var R=y.memoizedProps;if(c=c.compare,c=c!==null?c:Zc,c(R,d)&&s.ref===o.ref)return Ms(s,o,p)}return o.flags|=1,s=oa(y,d),s.ref=o.ref,s.return=o,o.child=s}function fS(s,o,c,d,p){if(s!==null){var y=s.memoizedProps;if(Zc(y,d)&&s.ref===o.ref)if(pr=!1,o.pendingProps=d=y,lm(s,p))s.flags&131072&&(pr=!0);else return o.lanes=s.lanes,Ms(s,o,p)}return em(s,o,c,d,p)}function dS(s,o,c){var d=o.pendingProps,p=d.children,y=(o.stateNode._pendingVisibility&2)!==0,R=s!==null?s.memoizedState:null;if(uu(s,o),d.mode==="hidden"||y){if(o.flags&128){if(d=R!==null?R.baseLanes|c:c,s!==null){for(p=o.child=s.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;o.childLanes=y&~d}else o.childLanes=0,o.child=null;return hS(s,o,d,c)}if(c&536870912)o.memoizedState={baseLanes:0,cachePool:null},s!==null&&hd(o,R!==null?R.cachePool:null),R!==null?g1(o,R):Op(),p1(o);else return o.lanes=o.childLanes=536870912,hS(s,o,R!==null?R.baseLanes|c:c,c)}else R!==null?(hd(o,R.cachePool),g1(o,R),Qs(),o.memoizedState=null):(s!==null&&hd(o,null),Op(),Qs());return wr(s,o,p,c),o.child}function hS(s,o,c,d){var p=Dp();return p=p===null?null:{parent:cr._currentValue,pool:p},o.memoizedState={baseLanes:c,cachePool:p},s!==null&&hd(o,null),Op(),p1(o),s!==null&&fu(s,o,d,!0),null}function uu(s,o){var c=o.ref;if(c===null)s!==null&&s.ref!==null&&(o.flags|=2097664);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(s===null||s.ref!==c)&&(o.flags|=2097664)}}function em(s,o,c,d,p){return ro(o),c=kp(s,o,c,d,void 0,p),d=Bp(),s!==null&&!pr?(Up(s,o,p),Ms(s,o,p)):(Qt&&d&&Ap(o),o.flags|=1,wr(s,o,c,p),o.child)}function gS(s,o,c,d,p,y){return ro(o),o.updateQueue=null,c=b1(o,d,c,p),y1(s),d=Bp(),s!==null&&!pr?(Up(s,o,y),Ms(s,o,y)):(Qt&&d&&Ap(o),o.flags|=1,wr(s,o,c,y),o.child)}function pS(s,o,c,d,p){if(ro(o),o.stateNode===null){var y=al,R=c.contextType;typeof R=="object"&&R!==null&&(y=Pr(R)),y=new c(d,y),o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Gp,o.stateNode=y,y._reactInternals=o,y=o.stateNode,y.props=d,y.state=o.memoizedState,y.refs={},dm(o),R=c.contextType,y.context=typeof R=="object"&&R!==null?Pr(R):al,y.state=o.memoizedState,R=c.getDerivedStateFromProps,typeof R=="function"&&(Qp(o,c,R,d),y.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(R=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),R!==y.state&&Gp.enqueueReplaceState(y,y.state,null),gu(o,d,y,p),hu(),y.state=o.memoizedState),typeof y.componentDidMount=="function"&&(o.flags|=4194308),d=!0}else if(s===null){y=o.stateNode;var I=o.memoizedProps,H=to(c,I);y.props=H;var ee=y.context,pe=c.contextType;R=al,typeof pe=="object"&&pe!==null&&(R=Pr(pe));var Se=c.getDerivedStateFromProps;pe=typeof Se=="function"||typeof y.getSnapshotBeforeUpdate=="function",I=o.pendingProps!==I,pe||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(I||ee!==R)&&tS(o,y,d,R),ta=!1;var ue=o.memoizedState;y.state=ue,gu(o,d,y,p),hu(),ee=o.memoizedState,I||ue!==ee||ta?(typeof Se=="function"&&(Qp(o,c,Se,d),ee=o.memoizedState),(H=ta||eS(o,c,H,d,ue,ee,R))?(pe||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(o.flags|=4194308)):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=d,o.memoizedState=ee),y.props=d,y.state=ee,y.context=R,d=H):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),d=!1)}else{y=o.stateNode,hm(s,o),R=o.memoizedProps,pe=to(c,R),y.props=pe,Se=o.pendingProps,ue=y.context,ee=c.contextType,H=al,typeof ee=="object"&&ee!==null&&(H=Pr(ee)),I=c.getDerivedStateFromProps,(ee=typeof I=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R!==Se||ue!==H)&&tS(o,y,d,H),ta=!1,ue=o.memoizedState,y.state=ue,gu(o,d,y,p),hu();var he=o.memoizedState;R!==Se||ue!==he||ta||s!==null&&s.dependencies!==null&&Td(s.dependencies)?(typeof I=="function"&&(Qp(o,c,I,d),he=o.memoizedState),(pe=ta||eS(o,c,pe,d,ue,he,H)||s!==null&&s.dependencies!==null&&Td(s.dependencies))?(ee||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,he,H),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,he,H)),typeof y.componentDidUpdate=="function"&&(o.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof y.componentDidUpdate!="function"||R===s.memoizedProps&&ue===s.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&ue===s.memoizedState||(o.flags|=1024),o.memoizedProps=d,o.memoizedState=he),y.props=d,y.state=he,y.context=H,d=pe):(typeof y.componentDidUpdate!="function"||R===s.memoizedProps&&ue===s.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&ue===s.memoizedState||(o.flags|=1024),d=!1)}return y=d,uu(s,o),d=(o.flags&128)!==0,y||d?(y=o.stateNode,c=d&&typeof c.getDerivedStateFromError!="function"?null:y.render(),o.flags|=1,s!==null&&d?(o.child=Za(o,s.child,null,p),o.child=Za(o,null,c,p)):wr(s,o,c,p),o.memoizedState=y.state,s=o.child):s=Ms(s,o,p),s}function mS(s,o,c,d){return Jc(),o.flags|=256,wr(s,o,c,d),o.child}var tm={dehydrated:null,treeContext:null,retryLane:0};function nm(s){return{baseLanes:s,cachePool:_1()}}function rm(s,o,c){return s=s!==null?s.childLanes&~c:0,o&&(s|=Ei),s}function vS(s,o,c){var d=o.pendingProps,p=!1,y=(o.flags&128)!==0,R;if((R=y)||(R=s!==null&&s.memoizedState===null?!1:(lr.current&2)!==0),R&&(p=!0,o.flags&=-129),R=(o.flags&32)!==0,o.flags&=-33,s===null){if(Qt){if(p?Zs(o):Qs(),Qt){var I=Er,H;if(H=I){e:{for(H=I,I=ns;H.nodeType!==8;){if(!I){I=null;break e}if(H=$i(H.nextSibling),H===null){I=null;break e}}I=H}I!==null?(o.memoizedState={dehydrated:I,treeContext:qa!==null?{id:Cs,overflow:As}:null,retryLane:536870912},H=Si(18,null,null,0),H.stateNode=I,H.return=o,o.child=H,Ur=o,Er=null,H=!0):H=!1}H||Ka(o)}if(I=o.memoizedState,I!==null&&(I=I.dehydrated,I!==null))return I.data==="$!"?o.lanes=16:o.lanes=536870912,null;Rs(o)}return I=d.children,d=d.fallback,p?(Qs(),p=o.mode,I=sm({mode:"hidden",children:I},p),d=so(d,p,c,null),I.return=o,d.return=o,I.sibling=d,o.child=I,p=o.child,p.memoizedState=nm(c),p.childLanes=rm(s,R,c),o.memoizedState=tm,d):(Zs(o),im(o,I))}if(H=s.memoizedState,H!==null&&(I=H.dehydrated,I!==null)){if(y)o.flags&256?(Zs(o),o.flags&=-257,o=am(s,o,c)):o.memoizedState!==null?(Qs(),o.child=s.child,o.flags|=128,o=null):(Qs(),p=d.fallback,I=o.mode,d=sm({mode:"visible",children:d.children},I),p=so(p,I,c,null),p.flags|=2,d.return=o,p.return=o,d.sibling=p,o.child=d,Za(o,s.child,null,c),d=o.child,d.memoizedState=nm(c),d.childLanes=rm(s,R,c),o.memoizedState=tm,o=p);else if(Zs(o),I.data==="$!"){if(R=I.nextSibling&&I.nextSibling.dataset,R)var ee=R.dgst;R=ee,d=Error(r(419)),d.stack="",d.digest=R,eu({value:d,source:null,stack:null}),o=am(s,o,c)}else if(pr||fu(s,o,c,!1),R=(c&s.childLanes)!==0,pr||R){if(R=Rn,R!==null){if(d=c&-c,d&42)d=1;else switch(d){case 2:d=1;break;case 8:d=4;break;case 32:d=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:d=64;break;case 268435456:d=134217728;break;default:d=0}if(d=d&(R.suspendedLanes|c)?0:d,d!==0&&d!==H.retryLane)throw H.retryLane=d,Ks(s,d),Lr(R,s,d),lS}I.data==="$?"||Dm(),o=am(s,o,c)}else I.data==="$?"?(o.flags|=128,o.child=s.child,o=JP.bind(null,s),I._reactRetry=o,o=null):(s=H.treeContext,Er=$i(I.nextSibling),Ur=o,Qt=!0,Li=null,ns=!1,s!==null&&(mi[vi++]=Cs,mi[vi++]=As,mi[vi++]=qa,Cs=s.id,As=s.overflow,qa=o),o=im(o,d.children),o.flags|=4096);return o}return p?(Qs(),p=d.fallback,I=o.mode,H=s.child,ee=H.sibling,d=oa(H,{mode:"hidden",children:d.children}),d.subtreeFlags=H.subtreeFlags&31457280,ee!==null?p=oa(ee,p):(p=so(p,I,c,null),p.flags|=2),p.return=o,d.return=o,d.sibling=p,o.child=d,d=p,p=o.child,I=s.child.memoizedState,I===null?I=nm(c):(H=I.cachePool,H!==null?(ee=cr._currentValue,H=H.parent!==ee?{parent:ee,pool:ee}:H):H=_1(),I={baseLanes:I.baseLanes|c,cachePool:H}),p.memoizedState=I,p.childLanes=rm(s,R,c),o.memoizedState=tm,d):(Zs(o),c=s.child,s=c.sibling,c=oa(c,{mode:"visible",children:d.children}),c.return=o,c.sibling=null,s!==null&&(R=o.deletions,R===null?(o.deletions=[s],o.flags|=16):R.push(s)),o.child=c,o.memoizedState=null,c)}function im(s,o){return o=sm({mode:"visible",children:o},s.mode),o.return=s,s.child=o}function sm(s,o){return HS(s,o,0,null)}function am(s,o,c){return Za(o,s.child,null,c),s=im(o,o.pendingProps.children),s.flags|=2,o.memoizedState=null,s}function _S(s,o,c){s.lanes|=o;var d=s.alternate;d!==null&&(d.lanes|=o),um(s.return,o,c)}function om(s,o,c,d,p){var y=s.memoizedState;y===null?s.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:p}:(y.isBackwards=o,y.rendering=null,y.renderingStartTime=0,y.last=d,y.tail=c,y.tailMode=p)}function yS(s,o,c){var d=o.pendingProps,p=d.revealOrder,y=d.tail;if(wr(s,o,d.children,c),d=lr.current,d&2)d=d&1|2,o.flags|=128;else{if(s!==null&&s.flags&128)e:for(s=o.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&_S(s,c,o);else if(s.tag===19)_S(s,c,o);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break e;for(;s.sibling===null;){if(s.return===null||s.return===o)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}d&=1}switch(Te(lr,d),p){case"forwards":for(c=o.child,p=null;c!==null;)s=c.alternate,s!==null&&dd(s)===null&&(p=c),c=c.sibling;c=p,c===null?(p=o.child,o.child=null):(p=c.sibling,c.sibling=null),om(o,!1,p,c,y);break;case"backwards":for(c=null,p=o.child,o.child=null;p!==null;){if(s=p.alternate,s!==null&&dd(s)===null){o.child=p;break}s=p.sibling,p.sibling=c,c=p,p=s}om(o,!0,c,null,y);break;case"together":om(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Ms(s,o,c){if(s!==null&&(o.dependencies=s.dependencies),la|=o.lanes,!(c&o.childLanes))if(s!==null){if(fu(s,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(s!==null&&o.child!==s.child)throw Error(r(153));if(o.child!==null){for(s=o.child,c=oa(s,s.pendingProps),o.child=c,c.return=o;s.sibling!==null;)s=s.sibling,c=c.sibling=oa(s,s.pendingProps),c.return=o;c.sibling=null}return o.child}function lm(s,o){return s.lanes&o?!0:(s=s.dependencies,!!(s!==null&&Td(s)))}function LP(s,o,c){switch(o.tag){case 3:we(o,o.stateNode.containerInfo),ea(o,cr,s.memoizedState.cache),Jc();break;case 27:case 5:Ve(o);break;case 4:we(o,o.stateNode.containerInfo);break;case 10:ea(o,o.type,o.memoizedProps.value);break;case 13:var d=o.memoizedState;if(d!==null)return d.dehydrated!==null?(Zs(o),o.flags|=128,null):c&o.child.childLanes?vS(s,o,c):(Zs(o),s=Ms(s,o,c),s!==null?s.sibling:null);Zs(o);break;case 19:var p=(s.flags&128)!==0;if(d=(c&o.childLanes)!==0,d||(fu(s,o,c,!1),d=(c&o.childLanes)!==0),p){if(d)return yS(s,o,c);o.flags|=128}if(p=o.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Te(lr,lr.current),d)break;return null;case 22:case 23:return o.lanes=0,dS(s,o,c);case 24:ea(o,cr,s.memoizedState.cache)}return Ms(s,o,c)}function bS(s,o,c){if(s!==null)if(s.memoizedProps!==o.pendingProps)pr=!0;else{if(!lm(s,c)&&!(o.flags&128))return pr=!1,LP(s,o,c);pr=!!(s.flags&131072)}else pr=!1,Qt&&o.flags&1048576&&i1(o,od,o.index);switch(o.lanes=0,o.tag){case 16:e:{s=o.pendingProps;var d=o.elementType,p=d._init;if(d=p(d._payload),o.type=d,typeof d=="function")Em(d)?(s=to(d,s),o.tag=1,o=pS(null,o,d,s,c)):(o.tag=0,o=em(null,o,d,s,c));else{if(d!=null){if(p=d.$$typeof,p===w){o.tag=11,o=cS(null,o,d,s,c);break e}else if(p===C){o.tag=14,o=uS(null,o,d,s,c);break e}}throw o=L(d)||d,Error(r(306,o,""))}}return o;case 0:return em(s,o,o.type,o.pendingProps,c);case 1:return d=o.type,p=to(d,o.pendingProps),pS(s,o,d,p,c);case 3:e:{if(we(o,o.stateNode.containerInfo),s===null)throw Error(r(387));var y=o.pendingProps;p=o.memoizedState,d=p.element,hm(s,o),gu(o,y,null,c);var R=o.memoizedState;if(y=R.cache,ea(o,cr,y),y!==p.cache&&fm(o,[cr],c,!0),hu(),y=R.element,p.isDehydrated)if(p={element:y,isDehydrated:!1,cache:R.cache},o.updateQueue.baseState=p,o.memoizedState=p,o.flags&256){o=mS(s,o,y,c);break e}else if(y!==d){d=pi(Error(r(424)),o),eu(d),o=mS(s,o,y,c);break e}else for(Er=$i(o.stateNode.containerInfo.firstChild),Ur=o,Qt=!0,Li=null,ns=!0,c=h1(o,null,y,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Jc(),y===d){o=Ms(s,o,c);break e}wr(s,o,y,c)}o=o.child}return o;case 26:return uu(s,o),s===null?(c=wE(o.type,null,o.pendingProps,null))?o.memoizedState=c:Qt||(c=o.type,s=o.pendingProps,d=zd(_e.current).createElement(c),d[bt]=o,d[_t]=s,Tr(d,c,s),be(d),o.stateNode=d):o.memoizedState=wE(o.type,s.memoizedProps,o.pendingProps,s.memoizedState),null;case 27:return Ve(o),s===null&&Qt&&(d=o.stateNode=bE(o.type,o.pendingProps,_e.current),Ur=o,ns=!0,Er=$i(d.firstChild)),d=o.pendingProps.children,s!==null||Qt?wr(s,o,d,c):o.child=Za(o,null,d,c),uu(s,o),o.child;case 5:return s===null&&Qt&&((p=d=Er)&&(d=pN(d,o.type,o.pendingProps,ns),d!==null?(o.stateNode=d,Ur=o,Er=$i(d.firstChild),ns=!1,p=!0):p=!1),p||Ka(o)),Ve(o),p=o.type,y=o.pendingProps,R=s!==null?s.memoizedProps:null,d=y.children,Ym(p,y)?d=null:R!==null&&Ym(p,R)&&(o.flags|=32),o.memoizedState!==null&&(p=kp(s,o,NP,null,null,c),Mu._currentValue=p),uu(s,o),wr(s,o,d,c),o.child;case 6:return s===null&&Qt&&((s=c=Er)&&(c=mN(c,o.pendingProps,ns),c!==null?(o.stateNode=c,Ur=o,Er=null,s=!0):s=!1),s||Ka(o)),null;case 13:return vS(s,o,c);case 4:return we(o,o.stateNode.containerInfo),d=o.pendingProps,s===null?o.child=Za(o,null,d,c):wr(s,o,d,c),o.child;case 11:return cS(s,o,o.type,o.pendingProps,c);case 7:return wr(s,o,o.pendingProps,c),o.child;case 8:return wr(s,o,o.pendingProps.children,c),o.child;case 12:return wr(s,o,o.pendingProps.children,c),o.child;case 10:return d=o.pendingProps,ea(o,o.type,d.value),wr(s,o,d.children,c),o.child;case 9:return p=o.type._context,d=o.pendingProps.children,ro(o),p=Pr(p),d=d(p),o.flags|=1,wr(s,o,d,c),o.child;case 14:return uS(s,o,o.type,o.pendingProps,c);case 15:return fS(s,o,o.type,o.pendingProps,c);case 19:return yS(s,o,c);case 22:return dS(s,o,c);case 24:return ro(o),d=Pr(cr),s===null?(p=Dp(),p===null&&(p=Rn,y=Np(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=c),p=y),o.memoizedState={parent:d,cache:p},dm(o),ea(o,cr,p)):(s.lanes&c&&(hm(s,o),gu(o,null,null,c),hu()),p=s.memoizedState,y=o.memoizedState,p.parent!==d?(p={parent:d,cache:d},o.memoizedState=p,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=p),ea(o,cr,d)):(d=y.cache,ea(o,cr,d),d!==p.cache&&fm(o,[cr],c,!0))),wr(s,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}var cm=Ee(null),no=null,Os=null;function ea(s,o,c){Te(cm,o._currentValue),o._currentValue=c}function Ps(s){s._currentValue=cm.current,Ce(cm)}function um(s,o,c){for(;s!==null;){var d=s.alternate;if((s.childLanes&o)!==o?(s.childLanes|=o,d!==null&&(d.childLanes|=o)):d!==null&&(d.childLanes&o)!==o&&(d.childLanes|=o),s===c)break;s=s.return}}function fm(s,o,c,d){var p=s.child;for(p!==null&&(p.return=s);p!==null;){var y=p.dependencies;if(y!==null){var R=p.child;y=y.firstContext;e:for(;y!==null;){var I=y;y=p;for(var H=0;H<o.length;H++)if(I.context===o[H]){y.lanes|=c,I=y.alternate,I!==null&&(I.lanes|=c),um(y.return,c,s),d||(R=null);break e}y=I.next}}else if(p.tag===18){if(R=p.return,R===null)throw Error(r(341));R.lanes|=c,y=R.alternate,y!==null&&(y.lanes|=c),um(R,c,s),R=null}else R=p.child;if(R!==null)R.return=p;else for(R=p;R!==null;){if(R===s){R=null;break}if(p=R.sibling,p!==null){p.return=R.return,R=p;break}R=R.return}p=R}}function fu(s,o,c,d){s=null;for(var p=o,y=!1;p!==null;){if(!y){if(p.flags&524288)y=!0;else if(p.flags&262144)break}if(p.tag===10){var R=p.alternate;if(R===null)throw Error(r(387));if(R=R.memoizedProps,R!==null){var I=p.type;Jr(p.pendingProps.value,R.value)||(s!==null?s.push(I):s=[I])}}else if(p===Ie.current){if(R=p.alternate,R===null)throw Error(r(387));R.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(s!==null?s.push(Mu):s=[Mu])}p=p.return}s!==null&&fm(o,s,c,d),o.flags|=262144}function Td(s){for(s=s.firstContext;s!==null;){if(!Jr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function ro(s){no=s,Os=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Pr(s){return SS(no,s)}function Cd(s,o){return no===null&&ro(s),SS(s,o)}function SS(s,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},Os===null){if(s===null)throw Error(r(308));Os=o,s.dependencies={lanes:0,firstContext:o},s.flags|=524288}else Os=Os.next=o;return c}var ta=!1;function dm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hm(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function na(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ra(s,o,c){var d=s.updateQueue;if(d===null)return null;if(d=d.shared,zn&2){var p=d.pending;return p===null?o.next=o:(o.next=p.next,p.next=o),d.pending=o,o=sd(s),n1(s,null,c),o}return id(s,d,o,c),sd(s)}function du(s,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194176)!==0)){var d=o.lanes;d&=s.pendingLanes,c|=d,o.lanes=c,Oe(s,c)}}function gm(s,o){var c=s.updateQueue,d=s.alternate;if(d!==null&&(d=d.updateQueue,c===d)){var p=null,y=null;if(c=c.firstBaseUpdate,c!==null){do{var R={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};y===null?p=y=R:y=y.next=R,c=c.next}while(c!==null);y===null?p=y=o:y=y.next=o}else p=y=o;c={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},s.updateQueue=c;return}s=c.lastBaseUpdate,s===null?c.firstBaseUpdate=o:s.next=o,c.lastBaseUpdate=o}var pm=!1;function hu(){if(pm){var s=dl;if(s!==null)throw s}}function gu(s,o,c,d){pm=!1;var p=s.updateQueue;ta=!1;var y=p.firstBaseUpdate,R=p.lastBaseUpdate,I=p.shared.pending;if(I!==null){p.shared.pending=null;var H=I,ee=H.next;H.next=null,R===null?y=ee:R.next=ee,R=H;var pe=s.alternate;pe!==null&&(pe=pe.updateQueue,I=pe.lastBaseUpdate,I!==R&&(I===null?pe.firstBaseUpdate=ee:I.next=ee,pe.lastBaseUpdate=H))}if(y!==null){var Se=p.baseState;R=0,pe=ee=H=null,I=y;do{var ue=I.lane&-536870913,he=ue!==I.lane;if(he?(Kt&ue)===ue:(d&ue)===ue){ue!==0&&ue===fl&&(pm=!0),pe!==null&&(pe=pe.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var tt=s,wt=I;ue=o;var Xn=c;switch(wt.tag){case 1:if(tt=wt.payload,typeof tt=="function"){Se=tt.call(Xn,Se,ue);break e}Se=tt;break e;case 3:tt.flags=tt.flags&-65537|128;case 0:if(tt=wt.payload,ue=typeof tt=="function"?tt.call(Xn,Se,ue):tt,ue==null)break e;Se=V({},Se,ue);break e;case 2:ta=!0}}ue=I.callback,ue!==null&&(s.flags|=64,he&&(s.flags|=8192),he=p.callbacks,he===null?p.callbacks=[ue]:he.push(ue))}else he={lane:ue,tag:I.tag,payload:I.payload,callback:I.callback,next:null},pe===null?(ee=pe=he,H=Se):pe=pe.next=he,R|=ue;if(I=I.next,I===null){if(I=p.shared.pending,I===null)break;he=I,I=he.next,he.next=null,p.lastBaseUpdate=he,p.shared.pending=null}}while(!0);pe===null&&(H=Se),p.baseState=H,p.firstBaseUpdate=ee,p.lastBaseUpdate=pe,y===null&&(p.shared.lanes=0),la|=R,s.lanes=R,s.memoizedState=Se}}function ES(s,o){if(typeof s!="function")throw Error(r(191,s));s.call(o)}function wS(s,o){var c=s.callbacks;if(c!==null)for(s.callbacks=null,s=0;s<c.length;s++)ES(c[s],o)}function pu(s,o){try{var c=o.updateQueue,d=c!==null?c.lastEffect:null;if(d!==null){var p=d.next;c=p;do{if((c.tag&s)===s){d=void 0;var y=c.create,R=c.inst;d=y(),R.destroy=d}c=c.next}while(c!==p)}}catch(I){yn(o,o.return,I)}}function ia(s,o,c){try{var d=o.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var y=p.next;d=y;do{if((d.tag&s)===s){var R=d.inst,I=R.destroy;if(I!==void 0){R.destroy=void 0,p=o;var H=c;try{I()}catch(ee){yn(p,H,ee)}}}d=d.next}while(d!==y)}}catch(ee){yn(o,o.return,ee)}}function TS(s){var o=s.updateQueue;if(o!==null){var c=s.stateNode;try{wS(o,c)}catch(d){yn(s,s.return,d)}}}function CS(s,o,c){c.props=to(s.type,s.memoizedProps),c.state=s.memoizedState;try{c.componentWillUnmount()}catch(d){yn(s,o,d)}}function io(s,o){try{var c=s.ref;if(c!==null){var d=s.stateNode;switch(s.tag){case 26:case 27:case 5:var p=d;break;default:p=d}typeof c=="function"?s.refCleanup=c(p):c.current=p}}catch(y){yn(s,o,y)}}function ei(s,o){var c=s.ref,d=s.refCleanup;if(c!==null)if(typeof d=="function")try{d()}catch(p){yn(s,o,p)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(p){yn(s,o,p)}else c.current=null}function AS(s){var o=s.type,c=s.memoizedProps,d=s.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&d.focus();break e;case"img":c.src?d.src=c.src:c.srcSet&&(d.srcset=c.srcSet)}}catch(p){yn(s,s.return,p)}}function RS(s,o,c){try{var d=s.stateNode;uN(d,s.type,c,o),d[_t]=o}catch(p){yn(s,s.return,p)}}function xS(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27||s.tag===4}function mm(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||xS(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==27&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function vm(s,o,c){var d=s.tag;if(d===5||d===6)s=s.stateNode,o?c.nodeType===8?c.parentNode.insertBefore(s,o):c.insertBefore(s,o):(c.nodeType===8?(o=c.parentNode,o.insertBefore(s,c)):(o=c,o.appendChild(s)),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Ld));else if(d!==4&&d!==27&&(s=s.child,s!==null))for(vm(s,o,c),s=s.sibling;s!==null;)vm(s,o,c),s=s.sibling}function Ad(s,o,c){var d=s.tag;if(d===5||d===6)s=s.stateNode,o?c.insertBefore(s,o):c.appendChild(s);else if(d!==4&&d!==27&&(s=s.child,s!==null))for(Ad(s,o,c),s=s.sibling;s!==null;)Ad(s,o,c),s=s.sibling}var Ns=!1,jn=!1,_m=!1,MS=typeof WeakSet=="function"?WeakSet:Set,mr=null,OS=!1;function zP(s,o){if(s=s.containerInfo,Xm=Xd,s=qb(s),bp(s)){if("selectionStart"in s)var c={start:s.selectionStart,end:s.selectionEnd};else e:{c=(c=s.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&d.rangeCount!==0){c=d.anchorNode;var p=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{c.nodeType,y.nodeType}catch{c=null;break e}var R=0,I=-1,H=-1,ee=0,pe=0,Se=s,ue=null;t:for(;;){for(var he;Se!==c||p!==0&&Se.nodeType!==3||(I=R+p),Se!==y||d!==0&&Se.nodeType!==3||(H=R+d),Se.nodeType===3&&(R+=Se.nodeValue.length),(he=Se.firstChild)!==null;)ue=Se,Se=he;for(;;){if(Se===s)break t;if(ue===c&&++ee===p&&(I=R),ue===y&&++pe===d&&(H=R),(he=Se.nextSibling)!==null)break;Se=ue,ue=Se.parentNode}Se=he}c=I===-1||H===-1?null:{start:I,end:H}}else c=null}c=c||{start:0,end:0}}else c=null;for(qm={focusedElem:s,selectionRange:c},Xd=!1,mr=o;mr!==null;)if(o=mr,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,mr=s;else for(;mr!==null;){switch(o=mr,y=o.alternate,s=o.flags,o.tag){case 0:break;case 11:case 15:break;case 1:if(s&1024&&y!==null){s=void 0,c=o,p=y.memoizedProps,y=y.memoizedState,d=c.stateNode;try{var tt=to(c.type,p,c.elementType===c.type);s=d.getSnapshotBeforeUpdate(tt,y),d.__reactInternalSnapshotBeforeUpdate=s}catch(wt){yn(c,c.return,wt)}}break;case 3:if(s&1024){if(s=o.stateNode.containerInfo,c=s.nodeType,c===9)Qm(s);else if(c===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Qm(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(s&1024)throw Error(r(163))}if(s=o.sibling,s!==null){s.return=o.return,mr=s;break}mr=o.return}return tt=OS,OS=!1,tt}function PS(s,o,c){var d=c.flags;switch(c.tag){case 0:case 11:case 15:Ds(s,c),d&4&&pu(5,c);break;case 1:if(Ds(s,c),d&4)if(s=c.stateNode,o===null)try{s.componentDidMount()}catch(I){yn(c,c.return,I)}else{var p=to(c.type,o.memoizedProps);o=o.memoizedState;try{s.componentDidUpdate(p,o,s.__reactInternalSnapshotBeforeUpdate)}catch(I){yn(c,c.return,I)}}d&64&&TS(c),d&512&&io(c,c.return);break;case 3:if(Ds(s,c),d&64&&(d=c.updateQueue,d!==null)){if(s=null,c.child!==null)switch(c.child.tag){case 27:case 5:s=c.child.stateNode;break;case 1:s=c.child.stateNode}try{wS(d,s)}catch(I){yn(c,c.return,I)}}break;case 26:Ds(s,c),d&512&&io(c,c.return);break;case 27:case 5:Ds(s,c),o===null&&d&4&&AS(c),d&512&&io(c,c.return);break;case 12:Ds(s,c);break;case 13:Ds(s,c),d&4&&DS(s,c);break;case 22:if(p=c.memoizedState!==null||Ns,!p){o=o!==null&&o.memoizedState!==null||jn;var y=Ns,R=jn;Ns=p,(jn=o)&&!R?sa(s,c,(c.subtreeFlags&8772)!==0):Ds(s,c),Ns=y,jn=R}d&512&&(c.memoizedProps.mode==="manual"?io(c,c.return):ei(c,c.return));break;default:Ds(s,c)}}function NS(s){var o=s.alternate;o!==null&&(s.alternate=null,NS(o)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(o=s.stateNode,o!==null&&un(o)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var ir=null,ti=!1;function Is(s,o,c){for(c=c.child;c!==null;)IS(s,o,c),c=c.sibling}function IS(s,o,c){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(ct,c)}catch{}switch(c.tag){case 26:jn||ei(c,o),Is(s,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:jn||ei(c,o);var d=ir,p=ti;for(ir=c.stateNode,Is(s,o,c),c=c.stateNode,o=c.attributes;o.length;)c.removeAttributeNode(o[0]);un(c),ir=d,ti=p;break;case 5:jn||ei(c,o);case 6:p=ir;var y=ti;if(ir=null,Is(s,o,c),ir=p,ti=y,ir!==null)if(ti)try{s=ir,d=c.stateNode,s.nodeType===8?s.parentNode.removeChild(d):s.removeChild(d)}catch(R){yn(c,o,R)}else try{ir.removeChild(c.stateNode)}catch(R){yn(c,o,R)}break;case 18:ir!==null&&(ti?(o=ir,c=c.stateNode,o.nodeType===8?Zm(o.parentNode,c):o.nodeType===1&&Zm(o,c),Iu(o)):Zm(ir,c.stateNode));break;case 4:d=ir,p=ti,ir=c.stateNode.containerInfo,ti=!0,Is(s,o,c),ir=d,ti=p;break;case 0:case 11:case 14:case 15:jn||ia(2,c,o),jn||ia(4,c,o),Is(s,o,c);break;case 1:jn||(ei(c,o),d=c.stateNode,typeof d.componentWillUnmount=="function"&&CS(c,o,d)),Is(s,o,c);break;case 21:Is(s,o,c);break;case 22:jn||ei(c,o),jn=(d=jn)||c.memoizedState!==null,Is(s,o,c),jn=d;break;default:Is(s,o,c)}}function DS(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Iu(s)}catch(c){yn(o,o.return,c)}}function $P(s){switch(s.tag){case 13:case 19:var o=s.stateNode;return o===null&&(o=s.stateNode=new MS),o;case 22:return s=s.stateNode,o=s._retryCache,o===null&&(o=s._retryCache=new MS),o;default:throw Error(r(435,s.tag))}}function ym(s,o){var c=$P(s);o.forEach(function(d){var p=eN.bind(null,s,d);c.has(d)||(c.add(d),d.then(p,p))})}function yi(s,o){var c=o.deletions;if(c!==null)for(var d=0;d<c.length;d++){var p=c[d],y=s,R=o,I=R;e:for(;I!==null;){switch(I.tag){case 27:case 5:ir=I.stateNode,ti=!1;break e;case 3:ir=I.stateNode.containerInfo,ti=!0;break e;case 4:ir=I.stateNode.containerInfo,ti=!0;break e}I=I.return}if(ir===null)throw Error(r(160));IS(y,R,p),ir=null,ti=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(o.subtreeFlags&13878)for(o=o.child;o!==null;)FS(o,s),o=o.sibling}var zi=null;function FS(s,o){var c=s.alternate,d=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:yi(o,s),bi(s),d&4&&(ia(3,s,s.return),pu(3,s),ia(5,s,s.return));break;case 1:yi(o,s),bi(s),d&512&&(jn||c===null||ei(c,c.return)),d&64&&Ns&&(s=s.updateQueue,s!==null&&(d=s.callbacks,d!==null&&(c=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=c===null?d:c.concat(d))));break;case 26:var p=zi;if(yi(o,s),bi(s),d&512&&(jn||c===null||ei(c,c.return)),d&4){var y=c!==null?c.memoizedState:null;if(d=s.memoizedState,c===null)if(d===null)if(s.stateNode===null){e:{d=s.type,c=s.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Zn]||y[bt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(d),p.head.insertBefore(y,p.querySelector("head > title"))),Tr(y,d,c),y[bt]=s,be(y),d=y;break e;case"link":var R=AE("link","href",p).get(d+(c.href||""));if(R){for(var I=0;I<R.length;I++)if(y=R[I],y.getAttribute("href")===(c.href==null?null:c.href)&&y.getAttribute("rel")===(c.rel==null?null:c.rel)&&y.getAttribute("title")===(c.title==null?null:c.title)&&y.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){R.splice(I,1);break t}}y=p.createElement(d),Tr(y,d,c),p.head.appendChild(y);break;case"meta":if(R=AE("meta","content",p).get(d+(c.content||""))){for(I=0;I<R.length;I++)if(y=R[I],y.getAttribute("content")===(c.content==null?null:""+c.content)&&y.getAttribute("name")===(c.name==null?null:c.name)&&y.getAttribute("property")===(c.property==null?null:c.property)&&y.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&y.getAttribute("charset")===(c.charSet==null?null:c.charSet)){R.splice(I,1);break t}}y=p.createElement(d),Tr(y,d,c),p.head.appendChild(y);break;default:throw Error(r(468,d))}y[bt]=s,be(y),d=y}s.stateNode=d}else RE(p,s.type,s.stateNode);else s.stateNode=CE(p,d,s.memoizedProps);else y!==d?(y===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):y.count--,d===null?RE(p,s.type,s.stateNode):CE(p,d,s.memoizedProps)):d===null&&s.stateNode!==null&&RS(s,s.memoizedProps,c.memoizedProps)}break;case 27:if(d&4&&s.alternate===null){p=s.stateNode,y=s.memoizedProps;try{for(var H=p.firstChild;H;){var ee=H.nextSibling,pe=H.nodeName;H[Zn]||pe==="HEAD"||pe==="BODY"||pe==="SCRIPT"||pe==="STYLE"||pe==="LINK"&&H.rel.toLowerCase()==="stylesheet"||p.removeChild(H),H=ee}for(var Se=s.type,ue=p.attributes;ue.length;)p.removeAttributeNode(ue[0]);Tr(p,Se,y),p[bt]=s,p[_t]=y}catch(tt){yn(s,s.return,tt)}}case 5:if(yi(o,s),bi(s),d&512&&(jn||c===null||ei(c,c.return)),s.flags&32){p=s.stateNode;try{Sr(p,"")}catch(tt){yn(s,s.return,tt)}}d&4&&s.stateNode!=null&&(p=s.memoizedProps,RS(s,p,c!==null?c.memoizedProps:p)),d&1024&&(_m=!0);break;case 6:if(yi(o,s),bi(s),d&4){if(s.stateNode===null)throw Error(r(162));d=s.memoizedProps,c=s.stateNode;try{c.nodeValue=d}catch(tt){yn(s,s.return,tt)}}break;case 3:if(Hd=null,p=zi,zi=$d(o.containerInfo),yi(o,s),zi=p,bi(s),d&4&&c!==null&&c.memoizedState.isDehydrated)try{Iu(o.containerInfo)}catch(tt){yn(s,s.return,tt)}_m&&(_m=!1,kS(s));break;case 4:d=zi,zi=$d(s.stateNode.containerInfo),yi(o,s),bi(s),zi=d;break;case 12:yi(o,s),bi(s);break;case 13:yi(o,s),bi(s),s.child.flags&8192&&s.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(xm=Me()),d&4&&(d=s.updateQueue,d!==null&&(s.updateQueue=null,ym(s,d)));break;case 22:if(d&512&&(jn||c===null||ei(c,c.return)),H=s.memoizedState!==null,ee=c!==null&&c.memoizedState!==null,pe=Ns,Se=jn,Ns=pe||H,jn=Se||ee,yi(o,s),jn=Se,Ns=pe,bi(s),o=s.stateNode,o._current=s,o._visibility&=-3,o._visibility|=o._pendingVisibility&2,d&8192&&(o._visibility=H?o._visibility&-2:o._visibility|1,H&&(o=Ns||jn,c===null||ee||o||ml(s)),s.memoizedProps===null||s.memoizedProps.mode!=="manual"))e:for(c=null,o=s;;){if(o.tag===5||o.tag===26||o.tag===27){if(c===null){ee=c=o;try{if(p=ee.stateNode,H)y=p.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{R=ee.stateNode,I=ee.memoizedProps.style;var he=I!=null&&I.hasOwnProperty("display")?I.display:null;R.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(tt){yn(ee,ee.return,tt)}}}else if(o.tag===6){if(c===null){ee=o;try{ee.stateNode.nodeValue=H?"":ee.memoizedProps}catch(tt){yn(ee,ee.return,tt)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===s)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break e;for(;o.sibling===null;){if(o.return===null||o.return===s)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}d&4&&(d=s.updateQueue,d!==null&&(c=d.retryQueue,c!==null&&(d.retryQueue=null,ym(s,c))));break;case 19:yi(o,s),bi(s),d&4&&(d=s.updateQueue,d!==null&&(s.updateQueue=null,ym(s,d)));break;case 21:break;default:yi(o,s),bi(s)}}function bi(s){var o=s.flags;if(o&2){try{if(s.tag!==27){e:{for(var c=s.return;c!==null;){if(xS(c)){var d=c;break e}c=c.return}throw Error(r(160))}switch(d.tag){case 27:var p=d.stateNode,y=mm(s);Ad(s,y,p);break;case 5:var R=d.stateNode;d.flags&32&&(Sr(R,""),d.flags&=-33);var I=mm(s);Ad(s,I,R);break;case 3:case 4:var H=d.stateNode.containerInfo,ee=mm(s);vm(s,ee,H);break;default:throw Error(r(161))}}}catch(pe){yn(s,s.return,pe)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function kS(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var o=s;kS(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),s=s.sibling}}function Ds(s,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)PS(s,o.alternate,o),o=o.sibling}function ml(s){for(s=s.child;s!==null;){var o=s;switch(o.tag){case 0:case 11:case 14:case 15:ia(4,o,o.return),ml(o);break;case 1:ei(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&CS(o,o.return,c),ml(o);break;case 26:case 27:case 5:ei(o,o.return),ml(o);break;case 22:ei(o,o.return),o.memoizedState===null&&ml(o);break;default:ml(o)}s=s.sibling}}function sa(s,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var d=o.alternate,p=s,y=o,R=y.flags;switch(y.tag){case 0:case 11:case 15:sa(p,y,c),pu(4,y);break;case 1:if(sa(p,y,c),d=y,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ee){yn(d,d.return,ee)}if(d=y,p=d.updateQueue,p!==null){var I=d.stateNode;try{var H=p.shared.hiddenCallbacks;if(H!==null)for(p.shared.hiddenCallbacks=null,p=0;p<H.length;p++)ES(H[p],I)}catch(ee){yn(d,d.return,ee)}}c&&R&64&&TS(y),io(y,y.return);break;case 26:case 27:case 5:sa(p,y,c),c&&d===null&&R&4&&AS(y),io(y,y.return);break;case 12:sa(p,y,c);break;case 13:sa(p,y,c),c&&R&4&&DS(p,y);break;case 22:y.memoizedState===null&&sa(p,y,c),io(y,y.return);break;default:sa(p,y,c)}o=o.sibling}}function bm(s,o){var c=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),s=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(s=o.memoizedState.cachePool.pool),s!==c&&(s!=null&&s.refCount++,c!=null&&su(c))}function Sm(s,o){s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&su(s))}function aa(s,o,c,d){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)BS(s,o,c,d),o=o.sibling}function BS(s,o,c,d){var p=o.flags;switch(o.tag){case 0:case 11:case 15:aa(s,o,c,d),p&2048&&pu(9,o);break;case 3:aa(s,o,c,d),p&2048&&(s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&su(s)));break;case 12:if(p&2048){aa(s,o,c,d),s=o.stateNode;try{var y=o.memoizedProps,R=y.id,I=y.onPostCommit;typeof I=="function"&&I(R,o.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(H){yn(o,o.return,H)}}else aa(s,o,c,d);break;case 23:break;case 22:y=o.stateNode,o.memoizedState!==null?y._visibility&4?aa(s,o,c,d):mu(s,o):y._visibility&4?aa(s,o,c,d):(y._visibility|=4,vl(s,o,c,d,(o.subtreeFlags&10256)!==0)),p&2048&&bm(o.alternate,o);break;case 24:aa(s,o,c,d),p&2048&&Sm(o.alternate,o);break;default:aa(s,o,c,d)}}function vl(s,o,c,d,p){for(p=p&&(o.subtreeFlags&10256)!==0,o=o.child;o!==null;){var y=s,R=o,I=c,H=d,ee=R.flags;switch(R.tag){case 0:case 11:case 15:vl(y,R,I,H,p),pu(8,R);break;case 23:break;case 22:var pe=R.stateNode;R.memoizedState!==null?pe._visibility&4?vl(y,R,I,H,p):mu(y,R):(pe._visibility|=4,vl(y,R,I,H,p)),p&&ee&2048&&bm(R.alternate,R);break;case 24:vl(y,R,I,H,p),p&&ee&2048&&Sm(R.alternate,R);break;default:vl(y,R,I,H,p)}o=o.sibling}}function mu(s,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=s,d=o,p=d.flags;switch(d.tag){case 22:mu(c,d),p&2048&&bm(d.alternate,d);break;case 24:mu(c,d),p&2048&&Sm(d.alternate,d);break;default:mu(c,d)}o=o.sibling}}var vu=8192;function _l(s){if(s.subtreeFlags&vu)for(s=s.child;s!==null;)US(s),s=s.sibling}function US(s){switch(s.tag){case 26:_l(s),s.flags&vu&&s.memoizedState!==null&&MN(zi,s.memoizedState,s.memoizedProps);break;case 5:_l(s);break;case 3:case 4:var o=zi;zi=$d(s.stateNode.containerInfo),_l(s),zi=o;break;case 22:s.memoizedState===null&&(o=s.alternate,o!==null&&o.memoizedState!==null?(o=vu,vu=16777216,_l(s),vu=o):_l(s));break;default:_l(s)}}function LS(s){var o=s.alternate;if(o!==null&&(s=o.child,s!==null)){o.child=null;do o=s.sibling,s.sibling=null,s=o;while(s!==null)}}function _u(s){var o=s.deletions;if(s.flags&16){if(o!==null)for(var c=0;c<o.length;c++){var d=o[c];mr=d,$S(d,s)}LS(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)zS(s),s=s.sibling}function zS(s){switch(s.tag){case 0:case 11:case 15:_u(s),s.flags&2048&&ia(9,s,s.return);break;case 3:_u(s);break;case 12:_u(s);break;case 22:var o=s.stateNode;s.memoizedState!==null&&o._visibility&4&&(s.return===null||s.return.tag!==13)?(o._visibility&=-5,Rd(s)):_u(s);break;default:_u(s)}}function Rd(s){var o=s.deletions;if(s.flags&16){if(o!==null)for(var c=0;c<o.length;c++){var d=o[c];mr=d,$S(d,s)}LS(s)}for(s=s.child;s!==null;){switch(o=s,o.tag){case 0:case 11:case 15:ia(8,o,o.return),Rd(o);break;case 22:c=o.stateNode,c._visibility&4&&(c._visibility&=-5,Rd(o));break;default:Rd(o)}s=s.sibling}}function $S(s,o){for(;mr!==null;){var c=mr;switch(c.tag){case 0:case 11:case 15:ia(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var d=c.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:su(c.memoizedState.cache)}if(d=c.child,d!==null)d.return=c,mr=d;else e:for(c=s;mr!==null;){d=mr;var p=d.sibling,y=d.return;if(NS(d),d===c){mr=null;break e}if(p!==null){p.return=y,mr=p;break e}mr=y}}}function VP(s,o,c,d){this.tag=s,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Si(s,o,c,d){return new VP(s,o,c,d)}function Em(s){return s=s.prototype,!(!s||!s.isReactComponent)}function oa(s,o){var c=s.alternate;return c===null?(c=Si(s.tag,o,s.key,s.mode),c.elementType=s.elementType,c.type=s.type,c.stateNode=s.stateNode,c.alternate=s,s.alternate=c):(c.pendingProps=o,c.type=s.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=s.flags&31457280,c.childLanes=s.childLanes,c.lanes=s.lanes,c.child=s.child,c.memoizedProps=s.memoizedProps,c.memoizedState=s.memoizedState,c.updateQueue=s.updateQueue,o=s.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=s.sibling,c.index=s.index,c.ref=s.ref,c.refCleanup=s.refCleanup,c}function VS(s,o){s.flags&=31457282;var c=s.alternate;return c===null?(s.childLanes=0,s.lanes=o,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,o=c.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),s}function xd(s,o,c,d,p,y){var R=0;if(d=s,typeof s=="function")Em(s)&&(R=1);else if(typeof s=="string")R=RN(s,c,ve.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case f:return so(c.children,p,y,o);case h:R=8,p|=24;break;case g:return s=Si(12,c,o,p|2),s.elementType=g,s.lanes=y,s;case E:return s=Si(13,c,o,p),s.elementType=E,s.lanes=y,s;case b:return s=Si(19,c,o,p),s.elementType=b,s.lanes=y,s;case A:return HS(c,p,y,o);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case m:case S:R=10;break e;case v:R=9;break e;case w:R=11;break e;case C:R=14;break e;case T:R=16,d=null;break e}R=29,c=Error(r(130,s===null?"null":typeof s,"")),d=null}return o=Si(R,c,o,p),o.elementType=s,o.type=d,o.lanes=y,o}function so(s,o,c,d){return s=Si(7,s,d,o),s.lanes=c,s}function HS(s,o,c,d){s=Si(22,s,d,o),s.elementType=A,s.lanes=c;var p={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var y=p._current;if(y===null)throw Error(r(456));if(!(p._pendingVisibility&2)){var R=Ks(y,2);R!==null&&(p._pendingVisibility|=2,Lr(R,y,2))}},attach:function(){var y=p._current;if(y===null)throw Error(r(456));if(p._pendingVisibility&2){var R=Ks(y,2);R!==null&&(p._pendingVisibility&=-3,Lr(R,y,2))}}};return s.stateNode=p,s}function wm(s,o,c){return s=Si(6,s,null,o),s.lanes=c,s}function Tm(s,o,c){return o=Si(4,s.children!==null?s.children:[],s.key,o),o.lanes=c,o.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},o}function Fs(s){s.flags|=4}function jS(s,o){if(o.type!=="stylesheet"||o.state.loading&4)s.flags&=-16777217;else if(s.flags|=16777216,!xE(o)){if(o=_i.current,o!==null&&((Kt&4194176)===Kt?rs!==null:(Kt&62914560)!==Kt&&!(Kt&536870912)||o!==rs))throw nu=Mp,o1;s.flags|=8192}}function Md(s,o){o!==null&&(s.flags|=4),s.flags&16384&&(o=s.tag!==22?ke():536870912,s.lanes|=o,bl|=o)}function yu(s,o){if(!Qt)switch(s.tailMode){case"hidden":o=s.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?s.tail=null:c.sibling=null;break;case"collapsed":c=s.tail;for(var d=null;c!==null;)c.alternate!==null&&(d=c),c=c.sibling;d===null?o||s.tail===null?s.tail=null:s.tail.sibling=null:d.sibling=null}}function Ln(s){var o=s.alternate!==null&&s.alternate.child===s.child,c=0,d=0;if(o)for(var p=s.child;p!==null;)c|=p.lanes|p.childLanes,d|=p.subtreeFlags&31457280,d|=p.flags&31457280,p.return=s,p=p.sibling;else for(p=s.child;p!==null;)c|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=s,p=p.sibling;return s.subtreeFlags|=d,s.childLanes=c,o}function HP(s,o,c){var d=o.pendingProps;switch(Rp(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ln(o),null;case 1:return Ln(o),null;case 3:return c=o.stateNode,d=null,s!==null&&(d=s.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),Ps(cr),xe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(s===null||s.child===null)&&(Gc(o)?Fs(o):s===null||s.memoizedState.isDehydrated&&!(o.flags&256)||(o.flags|=1024,Li!==null&&(Nm(Li),Li=null))),Ln(o),null;case 26:return c=o.memoizedState,s===null?(Fs(o),c!==null?(Ln(o),jS(o,c)):(Ln(o),o.flags&=-16777217)):c?c!==s.memoizedState?(Fs(o),Ln(o),jS(o,c)):(Ln(o),o.flags&=-16777217):(s.memoizedProps!==d&&Fs(o),Ln(o),o.flags&=-16777217),null;case 27:Fe(o),c=_e.current;var p=o.type;if(s!==null&&o.stateNode!=null)s.memoizedProps!==d&&Fs(o);else{if(!d){if(o.stateNode===null)throw Error(r(166));return Ln(o),null}s=ve.current,Gc(o)?s1(o):(s=bE(p,d,c),o.stateNode=s,Fs(o))}return Ln(o),null;case 5:if(Fe(o),c=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==d&&Fs(o);else{if(!d){if(o.stateNode===null)throw Error(r(166));return Ln(o),null}if(s=ve.current,Gc(o))s1(o);else{switch(p=zd(_e.current),s){case 1:s=p.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:s=p.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":s=p.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":s=p.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":s=p.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof d.is=="string"?p.createElement("select",{is:d.is}):p.createElement("select"),d.multiple?s.multiple=!0:d.size&&(s.size=d.size);break;default:s=typeof d.is=="string"?p.createElement(c,{is:d.is}):p.createElement(c)}}s[bt]=o,s[_t]=d;e:for(p=o.child;p!==null;){if(p.tag===5||p.tag===6)s.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===o)break e;for(;p.sibling===null;){if(p.return===null||p.return===o)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}o.stateNode=s;e:switch(Tr(s,c,d),c){case"button":case"input":case"select":case"textarea":s=!!d.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Fs(o)}}return Ln(o),o.flags&=-16777217,null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==d&&Fs(o);else{if(typeof d!="string"&&o.stateNode===null)throw Error(r(166));if(s=_e.current,Gc(o)){if(s=o.stateNode,c=o.memoizedProps,d=null,p=Ur,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}s[bt]=o,s=!!(s.nodeValue===c||d!==null&&d.suppressHydrationWarning===!0||gE(s.nodeValue,c)),s||Ka(o)}else s=zd(s).createTextNode(d),s[bt]=o,o.stateNode=s}return Ln(o),null;case 13:if(d=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(p=Gc(o),d!==null&&d.dehydrated!==null){if(s===null){if(!p)throw Error(r(318));if(p=o.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[bt]=o}else Jc(),!(o.flags&128)&&(o.memoizedState=null),o.flags|=4;Ln(o),p=!1}else Li!==null&&(Nm(Li),Li=null),p=!0;if(!p)return o.flags&256?(Rs(o),o):(Rs(o),null)}if(Rs(o),o.flags&128)return o.lanes=c,o;if(c=d!==null,s=s!==null&&s.memoizedState!==null,c){d=o.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool);var y=null;d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==p&&(d.flags|=2048)}return c!==s&&c&&(o.child.flags|=8192),Md(o,o.updateQueue),Ln(o),null;case 4:return xe(),s===null&&Hm(o.stateNode.containerInfo),Ln(o),null;case 10:return Ps(o.type),Ln(o),null;case 19:if(Ce(lr),p=o.memoizedState,p===null)return Ln(o),null;if(d=(o.flags&128)!==0,y=p.rendering,y===null)if(d)yu(p,!1);else{if(Wn!==0||s!==null&&s.flags&128)for(s=o.child;s!==null;){if(y=dd(s),y!==null){for(o.flags|=128,yu(p,!1),s=y.updateQueue,o.updateQueue=s,Md(o,s),o.subtreeFlags=0,s=c,c=o.child;c!==null;)VS(c,s),c=c.sibling;return Te(lr,lr.current&1|2),o.child}s=s.sibling}p.tail!==null&&Me()>Od&&(o.flags|=128,d=!0,yu(p,!1),o.lanes=4194304)}else{if(!d)if(s=dd(y),s!==null){if(o.flags|=128,d=!0,s=s.updateQueue,o.updateQueue=s,Md(o,s),yu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!Qt)return Ln(o),null}else 2*Me()-p.renderingStartTime>Od&&c!==536870912&&(o.flags|=128,d=!0,yu(p,!1),o.lanes=4194304);p.isBackwards?(y.sibling=o.child,o.child=y):(s=p.last,s!==null?s.sibling=y:o.child=y,p.last=y)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=Me(),o.sibling=null,s=lr.current,Te(lr,d?s&1|2:s&1),o):(Ln(o),null);case 22:case 23:return Rs(o),Pp(),d=o.memoizedState!==null,s!==null?s.memoizedState!==null!==d&&(o.flags|=8192):d&&(o.flags|=8192),d?c&536870912&&!(o.flags&128)&&(Ln(o),o.subtreeFlags&6&&(o.flags|=8192)):Ln(o),c=o.updateQueue,c!==null&&Md(o,c.retryQueue),c=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==c&&(o.flags|=2048),s!==null&&Ce(Qa),null;case 24:return c=null,s!==null&&(c=s.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),Ps(cr),Ln(o),null;case 25:return null}throw Error(r(156,o.tag))}function jP(s,o){switch(Rp(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return Ps(cr),xe(),s=o.flags,s&65536&&!(s&128)?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return Fe(o),null;case 13:if(Rs(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Jc()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return Ce(lr),null;case 4:return xe(),null;case 10:return Ps(o.type),null;case 22:case 23:return Rs(o),Pp(),s!==null&&Ce(Qa),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return Ps(cr),null;case 25:return null;default:return null}}function WS(s,o){switch(Rp(o),o.tag){case 3:Ps(cr),xe();break;case 26:case 27:case 5:Fe(o);break;case 4:xe();break;case 13:Rs(o);break;case 19:Ce(lr);break;case 10:Ps(o.type);break;case 22:case 23:Rs(o),Pp(),s!==null&&Ce(Qa);break;case 24:Ps(cr)}}var WP={getCacheForType:function(s){var o=Pr(cr),c=o.data.get(s);return c===void 0&&(c=s(),o.data.set(s,c)),c}},XP=typeof WeakMap=="function"?WeakMap:Map,zn=0,Rn=null,$t=null,Kt=0,xn=0,ni=null,ks=!1,yl=!1,Cm=!1,Bs=0,Wn=0,la=0,ao=0,Am=0,Ei=0,bl=0,bu=null,ss=null,Rm=!1,xm=0,Od=1/0,Pd=null,ca=null,Nd=!1,oo=null,Su=0,Mm=0,Om=null,Eu=0,Pm=null;function ri(){if(zn&2&&Kt!==0)return Kt&-Kt;if(D.T!==null){var s=fl;return s!==0?s:Lm()}return Ye()}function XS(){Ei===0&&(Ei=!(Kt&536870912)||Qt?qe():536870912);var s=_i.current;return s!==null&&(s.flags|=32),Ei}function Lr(s,o,c){(s===Rn&&xn===2||s.cancelPendingCommit!==null)&&(Sl(s,0),Us(s,Kt,Ei,!1)),Et(s,c),(!(zn&2)||s!==Rn)&&(s===Rn&&(!(zn&2)&&(ao|=c),Wn===4&&Us(s,Kt,Ei,!1)),as(s))}function qS(s,o,c){if(zn&6)throw Error(r(327));var d=!c&&(o&60)===0&&(o&s.expiredLanes)===0||Jt(s,o),p=d?KP(s,o):Fm(s,o,!0),y=d;do{if(p===0){yl&&!d&&Us(s,o,0,!1);break}else if(p===6)Us(s,o,0,!ks);else{if(c=s.current.alternate,y&&!qP(c)){p=Fm(s,o,!1),y=!1;continue}if(p===2){if(y=o,s.errorRecoveryDisabledLanes&y)var R=0;else R=s.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){o=R;e:{var I=s;p=bu;var H=I.current.memoizedState.isDehydrated;if(H&&(Sl(I,R).flags|=256),R=Fm(I,R,!1),R!==2){if(Cm&&!H){I.errorRecoveryDisabledLanes|=y,ao|=y,p=4;break e}y=ss,ss=p,y!==null&&Nm(y)}p=R}if(y=!1,p!==2)continue}}if(p===1){Sl(s,0),Us(s,o,0,!0);break}e:{switch(d=s,p){case 0:case 1:throw Error(r(345));case 4:if((o&4194176)===o){Us(d,o,Ei,!ks);break e}break;case 2:ss=null;break;case 3:case 5:break;default:throw Error(r(329))}if(d.finishedWork=c,d.finishedLanes=o,(o&62914560)===o&&(y=xm+300-Me(),10<y)){if(Us(d,o,Ei,!ks),Lt(d,0)!==0)break e;d.timeoutHandle=vE(YS.bind(null,d,c,ss,Pd,Rm,o,Ei,ao,bl,ks,2,-0,0),y);break e}YS(d,c,ss,Pd,Rm,o,Ei,ao,bl,ks,0,-0,0)}}break}while(!0);as(s)}function Nm(s){ss===null?ss=s:ss.push.apply(ss,s)}function YS(s,o,c,d,p,y,R,I,H,ee,pe,Se,ue){var he=o.subtreeFlags;if((he&8192||(he&16785408)===16785408)&&(xu={stylesheets:null,count:0,unsuspend:xN},US(o),o=ON(),o!==null)){s.cancelPendingCommit=o(tE.bind(null,s,c,d,p,R,I,H,1,Se,ue)),Us(s,y,R,!ee);return}tE(s,c,d,p,R,I,H,pe,Se,ue)}function qP(s){for(var o=s;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var d=0;d<c.length;d++){var p=c[d],y=p.getSnapshot;p=p.value;try{if(!Jr(y(),p))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Us(s,o,c,d){o&=~Am,o&=~ao,s.suspendedLanes|=o,s.pingedLanes&=~o,d&&(s.warmLanes|=o),d=s.expirationTimes;for(var p=o;0<p;){var y=31-ht(p),R=1<<y;d[y]=-1,p&=~R}c!==0&&Ue(s,c,o)}function Id(){return zn&6?!0:(wu(0),!1)}function Im(){if($t!==null){if(xn===0)var s=$t.return;else s=$t,Os=no=null,Lp(s),cl=null,ru=0,s=$t;for(;s!==null;)WS(s.alternate,s),s=s.return;$t=null}}function Sl(s,o){s.finishedWork=null,s.finishedLanes=0;var c=s.timeoutHandle;c!==-1&&(s.timeoutHandle=-1,dN(c)),c=s.cancelPendingCommit,c!==null&&(s.cancelPendingCommit=null,c()),Im(),Rn=s,$t=c=oa(s.current,null),Kt=o,xn=0,ni=null,ks=!1,yl=Jt(s,o),Cm=!1,bl=Ei=Am=ao=la=Wn=0,ss=bu=null,Rm=!1,o&8&&(o|=o&32);var d=s.entangledLanes;if(d!==0)for(s=s.entanglements,d&=o;0<d;){var p=31-ht(d),y=1<<p;o|=s[p],d&=~y}return Bs=o,rd(),c}function KS(s,o){Pt=null,D.H=is,o===tu?(o=u1(),xn=3):o===o1?(o=u1(),xn=4):xn=o===lS?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,ni=o,$t===null&&(Wn=1,wd(s,pi(o,s.current)))}function ZS(){var s=D.H;return D.H=is,s===null?is:s}function QS(){var s=D.A;return D.A=WP,s}function Dm(){Wn=4,ks||(Kt&4194176)!==Kt&&_i.current!==null||(yl=!0),!(la&134217727)&&!(ao&134217727)||Rn===null||Us(Rn,Kt,Ei,!1)}function Fm(s,o,c){var d=zn;zn|=2;var p=ZS(),y=QS();(Rn!==s||Kt!==o)&&(Pd=null,Sl(s,o)),o=!1;var R=Wn;e:do try{if(xn!==0&&$t!==null){var I=$t,H=ni;switch(xn){case 8:Im(),R=6;break e;case 3:case 2:case 6:_i.current===null&&(o=!0);var ee=xn;if(xn=0,ni=null,El(s,I,H,ee),c&&yl){R=0;break e}break;default:ee=xn,xn=0,ni=null,El(s,I,H,ee)}}YP(),R=Wn;break}catch(pe){KS(s,pe)}while(!0);return o&&s.shellSuspendCounter++,Os=no=null,zn=d,D.H=p,D.A=y,$t===null&&(Rn=null,Kt=0,rd()),R}function YP(){for(;$t!==null;)GS($t)}function KP(s,o){var c=zn;zn|=2;var d=ZS(),p=QS();Rn!==s||Kt!==o?(Pd=null,Od=Me()+500,Sl(s,o)):yl=Jt(s,o);e:do try{if(xn!==0&&$t!==null){o=$t;var y=ni;t:switch(xn){case 1:xn=0,ni=null,El(s,o,y,1);break;case 2:if(l1(y)){xn=0,ni=null,JS(o);break}o=function(){xn===2&&Rn===s&&(xn=7),as(s)},y.then(o,o);break e;case 3:xn=7;break e;case 4:xn=5;break e;case 7:l1(y)?(xn=0,ni=null,JS(o)):(xn=0,ni=null,El(s,o,y,7));break;case 5:var R=null;switch($t.tag){case 26:R=$t.memoizedState;case 5:case 27:var I=$t;if(!R||xE(R)){xn=0,ni=null;var H=I.sibling;if(H!==null)$t=H;else{var ee=I.return;ee!==null?($t=ee,Dd(ee)):$t=null}break t}}xn=0,ni=null,El(s,o,y,5);break;case 6:xn=0,ni=null,El(s,o,y,6);break;case 8:Im(),Wn=6;break e;default:throw Error(r(462))}}ZP();break}catch(pe){KS(s,pe)}while(!0);return Os=no=null,D.H=d,D.A=p,zn=c,$t!==null?0:(Rn=null,Kt=0,rd(),Wn)}function ZP(){for(;$t!==null&&!Ge();)GS($t)}function GS(s){var o=bS(s.alternate,s,Bs);s.memoizedProps=s.pendingProps,o===null?Dd(s):$t=o}function JS(s){var o=s,c=o.alternate;switch(o.tag){case 15:case 0:o=gS(c,o,o.pendingProps,o.type,void 0,Kt);break;case 11:o=gS(c,o,o.pendingProps,o.type.render,o.ref,Kt);break;case 5:Lp(o);default:WS(c,o),o=$t=VS(o,Bs),o=bS(c,o,Bs)}s.memoizedProps=s.pendingProps,o===null?Dd(s):$t=o}function El(s,o,c,d){Os=no=null,Lp(o),cl=null,ru=0;var p=o.return;try{if(UP(s,p,o,c,Kt)){Wn=1,wd(s,pi(c,s.current)),$t=null;return}}catch(y){if(p!==null)throw $t=p,y;Wn=1,wd(s,pi(c,s.current)),$t=null;return}o.flags&32768?(Qt||d===1?s=!0:yl||Kt&536870912?s=!1:(ks=s=!0,(d===2||d===3||d===6)&&(d=_i.current,d!==null&&d.tag===13&&(d.flags|=16384))),eE(o,s)):Dd(o)}function Dd(s){var o=s;do{if(o.flags&32768){eE(o,ks);return}s=o.return;var c=HP(o.alternate,o,Bs);if(c!==null){$t=c;return}if(o=o.sibling,o!==null){$t=o;return}$t=o=s}while(o!==null);Wn===0&&(Wn=5)}function eE(s,o){do{var c=jP(s.alternate,s);if(c!==null){c.flags&=32767,$t=c;return}if(c=s.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(s=s.sibling,s!==null)){$t=s;return}$t=s=c}while(s!==null);Wn=6,$t=null}function tE(s,o,c,d,p,y,R,I,H,ee){var pe=D.T,Se=q.p;try{q.p=2,D.T=null,QP(s,o,c,d,Se,p,y,R,I,H,ee)}finally{D.T=pe,q.p=Se}}function QP(s,o,c,d,p,y,R,I){do wl();while(oo!==null);if(zn&6)throw Error(r(327));var H=s.finishedWork;if(d=s.finishedLanes,H===null)return null;if(s.finishedWork=null,s.finishedLanes=0,H===s.current)throw Error(r(177));s.callbackNode=null,s.callbackPriority=0,s.cancelPendingCommit=null;var ee=H.lanes|H.childLanes;if(ee|=Tp,en(s,d,ee,y,R,I),s===Rn&&($t=Rn=null,Kt=0),!(H.subtreeFlags&10256)&&!(H.flags&10256)||Nd||(Nd=!0,Mm=ee,Om=c,tN(st,function(){return wl(),null})),c=(H.flags&15990)!==0,H.subtreeFlags&15990||c?(c=D.T,D.T=null,y=q.p,q.p=2,R=zn,zn|=4,zP(s,H),FS(H,s),SP(qm,s.containerInfo),Xd=!!Xm,qm=Xm=null,s.current=H,PS(s,H.alternate,H),Pe(),zn=R,q.p=y,D.T=c):s.current=H,Nd?(Nd=!1,oo=s,Su=d):nE(s,ee),ee=s.pendingLanes,ee===0&&(ca=null),xt(H.stateNode),as(s),o!==null)for(p=s.onRecoverableError,H=0;H<o.length;H++)ee=o[H],p(ee.value,{componentStack:ee.stack});return Su&3&&wl(),ee=s.pendingLanes,d&4194218&&ee&42?s===Pm?Eu++:(Eu=0,Pm=s):Eu=0,wu(0),null}function nE(s,o){(s.pooledCacheLanes&=o)===0&&(o=s.pooledCache,o!=null&&(s.pooledCache=null,su(o)))}function wl(){if(oo!==null){var s=oo,o=Mm;Mm=0;var c=je(Su),d=D.T,p=q.p;try{if(q.p=32>c?32:c,D.T=null,oo===null)var y=!1;else{c=Om,Om=null;var R=oo,I=Su;if(oo=null,Su=0,zn&6)throw Error(r(331));var H=zn;if(zn|=4,zS(R.current),BS(R,R.current,I,c),zn=H,wu(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(ct,R)}catch{}y=!0}return y}finally{q.p=p,D.T=d,nE(s,o)}}return!1}function rE(s,o,c){o=pi(c,o),o=Jp(s.stateNode,o,2),s=ra(s,o,2),s!==null&&(Et(s,2),as(s))}function yn(s,o,c){if(s.tag===3)rE(s,s,c);else for(;o!==null;){if(o.tag===3){rE(o,s,c);break}else if(o.tag===1){var d=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ca===null||!ca.has(d))){s=pi(c,s),c=aS(2),d=ra(o,c,2),d!==null&&(oS(c,d,o,s),Et(d,2),as(d));break}}o=o.return}}function km(s,o,c){var d=s.pingCache;if(d===null){d=s.pingCache=new XP;var p=new Set;d.set(o,p)}else p=d.get(o),p===void 0&&(p=new Set,d.set(o,p));p.has(c)||(Cm=!0,p.add(c),s=GP.bind(null,s,o,c),o.then(s,s))}function GP(s,o,c){var d=s.pingCache;d!==null&&d.delete(o),s.pingedLanes|=s.suspendedLanes&c,s.warmLanes&=~c,Rn===s&&(Kt&c)===c&&(Wn===4||Wn===3&&(Kt&62914560)===Kt&&300>Me()-xm?!(zn&2)&&Sl(s,0):Am|=c,bl===Kt&&(bl=0)),as(s)}function iE(s,o){o===0&&(o=ke()),s=Ks(s,o),s!==null&&(Et(s,o),as(s))}function JP(s){var o=s.memoizedState,c=0;o!==null&&(c=o.retryLane),iE(s,c)}function eN(s,o){var c=0;switch(s.tag){case 13:var d=s.stateNode,p=s.memoizedState;p!==null&&(c=p.retryLane);break;case 19:d=s.stateNode;break;case 22:d=s.stateNode._retryCache;break;default:throw Error(r(314))}d!==null&&d.delete(o),iE(s,c)}function tN(s,o){return nt(s,o)}var Fd=null,Tl=null,Bm=!1,kd=!1,Um=!1,lo=0;function as(s){s!==Tl&&s.next===null&&(Tl===null?Fd=Tl=s:Tl=Tl.next=s),kd=!0,Bm||(Bm=!0,rN(nN))}function wu(s,o){if(!Um&&kd){Um=!0;do for(var c=!1,d=Fd;d!==null;){if(s!==0){var p=d.pendingLanes;if(p===0)var y=0;else{var R=d.suspendedLanes,I=d.pingedLanes;y=(1<<31-ht(42|s)+1)-1,y&=p&~(R&~I),y=y&201326677?y&201326677|1:y?y|2:0}y!==0&&(c=!0,oE(d,y))}else y=Kt,y=Lt(d,d===Rn?y:0),!(y&3)||Jt(d,y)||(c=!0,oE(d,y));d=d.next}while(c);Um=!1}}function nN(){kd=Bm=!1;var s=0;lo!==0&&(fN()&&(s=lo),lo=0);for(var o=Me(),c=null,d=Fd;d!==null;){var p=d.next,y=sE(d,o);y===0?(d.next=null,c===null?Fd=p:c.next=p,p===null&&(Tl=c)):(c=d,(s!==0||y&3)&&(kd=!0)),d=p}wu(s)}function sE(s,o){for(var c=s.suspendedLanes,d=s.pingedLanes,p=s.expirationTimes,y=s.pendingLanes&-62914561;0<y;){var R=31-ht(y),I=1<<R,H=p[R];H===-1?(!(I&c)||I&d)&&(p[R]=Mt(I,o)):H<=o&&(s.expiredLanes|=I),y&=~I}if(o=Rn,c=Kt,c=Lt(s,s===o?c:0),d=s.callbackNode,c===0||s===o&&xn===2||s.cancelPendingCommit!==null)return d!==null&&d!==null&&He(d),s.callbackNode=null,s.callbackPriority=0;if(!(c&3)||Jt(s,c)){if(o=c&-c,o===s.callbackPriority)return o;switch(d!==null&&He(d),je(c)){case 2:case 8:c=it;break;case 32:c=st;break;case 268435456:c=Je;break;default:c=st}return d=aE.bind(null,s),c=nt(c,d),s.callbackPriority=o,s.callbackNode=c,o}return d!==null&&d!==null&&He(d),s.callbackPriority=2,s.callbackNode=null,2}function aE(s,o){var c=s.callbackNode;if(wl()&&s.callbackNode!==c)return null;var d=Kt;return d=Lt(s,s===Rn?d:0),d===0?null:(qS(s,d,o),sE(s,Me()),s.callbackNode!=null&&s.callbackNode===c?aE.bind(null,s):null)}function oE(s,o){if(wl())return null;qS(s,o,!0)}function rN(s){hN(function(){zn&6?nt(rt,s):s()})}function Lm(){return lo===0&&(lo=qe()),lo}function lE(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:ki(""+s)}function cE(s,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,s.id&&c.setAttribute("form",s.id),o.parentNode.insertBefore(c,o),s=new FormData(s),c.parentNode.removeChild(c),s}function iN(s,o,c,d,p){if(o==="submit"&&c&&c.stateNode===p){var y=lE((p[_t]||null).action),R=d.submitter;R&&(o=(o=R[_t]||null)?lE(o.formAction):R.getAttribute("formAction"),o!==null&&(y=o,R=null));var I=new ed("action","action",null,d,p);s.push({event:I,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(lo!==0){var H=R?cE(p,R):new FormData(p);Yp(c,{pending:!0,data:H,method:p.method,action:y},null,H)}}else typeof y=="function"&&(I.preventDefault(),H=R?cE(p,R):new FormData(p),Yp(c,{pending:!0,data:H,method:p.method,action:y},y,H))},currentTarget:p}]})}}for(var zm=0;zm<t1.length;zm++){var $m=t1[zm],sN=$m.toLowerCase(),aN=$m[0].toUpperCase()+$m.slice(1);Ui(sN,"on"+aN)}Ui(Zb,"onAnimationEnd"),Ui(Qb,"onAnimationIteration"),Ui(Gb,"onAnimationStart"),Ui("dblclick","onDoubleClick"),Ui("focusin","onFocus"),Ui("focusout","onBlur"),Ui(wP,"onTransitionRun"),Ui(TP,"onTransitionStart"),Ui(CP,"onTransitionCancel"),Ui(Jb,"onTransitionEnd"),In("onMouseEnter",["mouseout","mouseover"]),In("onMouseLeave",["mouseout","mouseover"]),In("onPointerEnter",["pointerout","pointerover"]),In("onPointerLeave",["pointerout","pointerover"]),Ot("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ot("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ot("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ot("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ot("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ot("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),oN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tu));function uE(s,o){o=(o&4)!==0;for(var c=0;c<s.length;c++){var d=s[c],p=d.event;d=d.listeners;e:{var y=void 0;if(o)for(var R=d.length-1;0<=R;R--){var I=d[R],H=I.instance,ee=I.currentTarget;if(I=I.listener,H!==y&&p.isPropagationStopped())break e;y=I,p.currentTarget=ee;try{y(p)}catch(pe){Ed(pe)}p.currentTarget=null,y=H}else for(R=0;R<d.length;R++){if(I=d[R],H=I.instance,ee=I.currentTarget,I=I.listener,H!==y&&p.isPropagationStopped())break e;y=I,p.currentTarget=ee;try{y(p)}catch(pe){Ed(pe)}p.currentTarget=null,y=H}}}}function jt(s,o){var c=o[Yt];c===void 0&&(c=o[Yt]=new Set);var d=s+"__bubble";c.has(d)||(fE(o,s,2,!1),c.add(d))}function Vm(s,o,c){var d=0;o&&(d|=4),fE(c,s,d,o)}var Bd="_reactListening"+Math.random().toString(36).slice(2);function Hm(s){if(!s[Bd]){s[Bd]=!0,ut.forEach(function(c){c!=="selectionchange"&&(oN.has(c)||Vm(c,!1,s),Vm(c,!0,s))});var o=s.nodeType===9?s:s.ownerDocument;o===null||o[Bd]||(o[Bd]=!0,Vm("selectionchange",!1,o))}}function fE(s,o,c,d){switch(DE(o)){case 2:var p=IN;break;case 8:p=DN;break;default:p=nv}c=p.bind(null,o,c,s),p=void 0,!gt||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(p=!0),d?p!==void 0?s.addEventListener(o,c,{capture:!0,passive:p}):s.addEventListener(o,c,!0):p!==void 0?s.addEventListener(o,c,{passive:p}):s.addEventListener(o,c,!1)}function jm(s,o,c,d,p){var y=d;if(!(o&1)&&!(o&2)&&d!==null)e:for(;;){if(d===null)return;var R=d.tag;if(R===3||R===4){var I=d.stateNode.containerInfo;if(I===p||I.nodeType===8&&I.parentNode===p)break;if(R===4)for(R=d.return;R!==null;){var H=R.tag;if((H===3||H===4)&&(H=R.stateNode.containerInfo,H===p||H.nodeType===8&&H.parentNode===p))return;R=R.return}for(;I!==null;){if(R=rn(I),R===null)return;if(H=R.tag,H===5||H===6||H===26||H===27){d=y=R;continue e}I=I.parentNode}}d=d.return}el(function(){var ee=y,pe=di(c),Se=[];e:{var ue=e1.get(s);if(ue!==void 0){var he=ed,tt=s;switch(s){case"keypress":if(Ha(c)===0)break e;case"keydown":case"keyup":he=eP;break;case"focusin":tt="focus",he=pp;break;case"focusout":tt="blur",he=pp;break;case"beforeblur":case"afterblur":he=pp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=Mb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=VO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=rP;break;case Zb:case Qb:case Gb:he=WO;break;case Jb:he=sP;break;case"scroll":case"scrollend":he=zO;break;case"wheel":he=oP;break;case"copy":case"cut":case"paste":he=qO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Pb;break;case"toggle":case"beforetoggle":he=cP}var wt=(o&4)!==0,Xn=!wt&&(s==="scroll"||s==="scrollend"),re=wt?ue!==null?ue+"Capture":null:ue;wt=[];for(var Q=ee,le;Q!==null;){var me=Q;if(le=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||le===null||re===null||(me=$e(Q,re),me!=null&&wt.push(Cu(Q,me,le))),Xn)break;Q=Q.return}0<wt.length&&(ue=new he(ue,tt,null,c,pe),Se.push({event:ue,listeners:wt}))}}if(!(o&7)){e:{if(ue=s==="mouseover"||s==="pointerover",he=s==="mouseout"||s==="pointerout",ue&&c!==fi&&(tt=c.relatedTarget||c.fromElement)&&(rn(tt)||tt[Zt]))break e;if((he||ue)&&(ue=pe.window===pe?pe:(ue=pe.ownerDocument)?ue.defaultView||ue.parentWindow:window,he?(tt=c.relatedTarget||c.toElement,he=ee,tt=tt?rn(tt):null,tt!==null&&(Xn=j(tt),wt=tt.tag,tt!==Xn||wt!==5&&wt!==27&&wt!==6)&&(tt=null)):(he=null,tt=ee),he!==tt)){if(wt=Mb,me="onMouseLeave",re="onMouseEnter",Q="mouse",(s==="pointerout"||s==="pointerover")&&(wt=Pb,me="onPointerLeave",re="onPointerEnter",Q="pointer"),Xn=he==null?ue:Le(he),le=tt==null?ue:Le(tt),ue=new wt(me,Q+"leave",he,c,pe),ue.target=Xn,ue.relatedTarget=le,me=null,rn(pe)===ee&&(wt=new wt(re,Q+"enter",tt,c,pe),wt.target=le,wt.relatedTarget=Xn,me=wt),Xn=me,he&&tt)t:{for(wt=he,re=tt,Q=0,le=wt;le;le=Cl(le))Q++;for(le=0,me=re;me;me=Cl(me))le++;for(;0<Q-le;)wt=Cl(wt),Q--;for(;0<le-Q;)re=Cl(re),le--;for(;Q--;){if(wt===re||re!==null&&wt===re.alternate)break t;wt=Cl(wt),re=Cl(re)}wt=null}else wt=null;he!==null&&dE(Se,ue,he,wt,!1),tt!==null&&Xn!==null&&dE(Se,Xn,tt,wt,!0)}}e:{if(ue=ee?Le(ee):window,he=ue.nodeName&&ue.nodeName.toLowerCase(),he==="select"||he==="input"&&ue.type==="file")var Ke=Lb;else if(Bb(ue))if(zb)Ke=yP;else{Ke=vP;var Dt=mP}else he=ue.nodeName,!he||he.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ee&&$a(ee.elementType)&&(Ke=Lb):Ke=_P;if(Ke&&(Ke=Ke(s,ee))){Ub(Se,Ke,c,pe);break e}Dt&&Dt(s,ue,ee),s==="focusout"&&ee&&ue.type==="number"&&ee.memoizedProps.value!=null&&Nn(ue,"number",ue.value)}switch(Dt=ee?Le(ee):window,s){case"focusin":(Bb(Dt)||Dt.contentEditable==="true")&&(rl=Dt,Sp=ee,Qc=null);break;case"focusout":Qc=Sp=rl=null;break;case"mousedown":Ep=!0;break;case"contextmenu":case"mouseup":case"dragend":Ep=!1,Yb(Se,c,pe);break;case"selectionchange":if(EP)break;case"keydown":case"keyup":Yb(Se,c,pe)}var ot;if(vp)e:{switch(s){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else nl?Fb(s,c)&&(vt="onCompositionEnd"):s==="keydown"&&c.keyCode===229&&(vt="onCompositionStart");vt&&(Nb&&c.locale!=="ko"&&(nl||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&nl&&(ot=tl()):(fn=pe,An="value"in fn?fn.value:fn.textContent,nl=!0)),Dt=Ud(ee,vt),0<Dt.length&&(vt=new Ob(vt,s,null,c,pe),Se.push({event:vt,listeners:Dt}),ot?vt.data=ot:(ot=kb(c),ot!==null&&(vt.data=ot)))),(ot=fP?dP(s,c):hP(s,c))&&(vt=Ud(ee,"onBeforeInput"),0<vt.length&&(Dt=new Ob("onBeforeInput","beforeinput",null,c,pe),Se.push({event:Dt,listeners:vt}),Dt.data=ot)),iN(Se,s,ee,c,pe)}uE(Se,o)})}function Cu(s,o,c){return{instance:s,listener:o,currentTarget:c}}function Ud(s,o){for(var c=o+"Capture",d=[];s!==null;){var p=s,y=p.stateNode;p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=$e(s,c),p!=null&&d.unshift(Cu(s,p,y)),p=$e(s,o),p!=null&&d.push(Cu(s,p,y))),s=s.return}return d}function Cl(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function dE(s,o,c,d,p){for(var y=o._reactName,R=[];c!==null&&c!==d;){var I=c,H=I.alternate,ee=I.stateNode;if(I=I.tag,H!==null&&H===d)break;I!==5&&I!==26&&I!==27||ee===null||(H=ee,p?(ee=$e(c,y),ee!=null&&R.unshift(Cu(c,ee,H))):p||(ee=$e(c,y),ee!=null&&R.push(Cu(c,ee,H)))),c=c.return}R.length!==0&&s.push({event:o,listeners:R})}var lN=/\r\n?/g,cN=/\u0000|\uFFFD/g;function hE(s){return(typeof s=="string"?s:""+s).replace(lN,`
|
|
|
`).replace(cN,"")}function gE(s,o){return o=hE(o),hE(s)===o}function Ld(){}function hn(s,o,c,d,p,y){switch(c){case"children":typeof d=="string"?o==="body"||o==="textarea"&&d===""||Sr(s,d):(typeof d=="number"||typeof d=="bigint")&&o!=="body"&&Sr(s,""+d);break;case"className":Un(s,"class",d);break;case"tabIndex":Un(s,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Un(s,c,d);break;case"style":gr(s,d,y);break;case"data":if(o!=="object"){Un(s,"data",d);break}case"src":case"href":if(d===""&&(o!=="a"||c!=="href")){s.removeAttribute(c);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){s.removeAttribute(c);break}d=ki(""+d),s.setAttribute(c,d);break;case"action":case"formAction":if(typeof d=="function"){s.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(c==="formAction"?(o!=="input"&&hn(s,o,"name",p.name,p,null),hn(s,o,"formEncType",p.formEncType,p,null),hn(s,o,"formMethod",p.formMethod,p,null),hn(s,o,"formTarget",p.formTarget,p,null)):(hn(s,o,"encType",p.encType,p,null),hn(s,o,"method",p.method,p,null),hn(s,o,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){s.removeAttribute(c);break}d=ki(""+d),s.setAttribute(c,d);break;case"onClick":d!=null&&(s.onclick=Ld);break;case"onScroll":d!=null&&jt("scroll",s);break;case"onScrollEnd":d!=null&&jt("scrollend",s);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(c=d.__html,c!=null){if(p.children!=null)throw Error(r(60));s.innerHTML=c}}break;case"multiple":s.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":s.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){s.removeAttribute("xlink:href");break}c=ki(""+d),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?s.setAttribute(c,""+d):s.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?s.setAttribute(c,""):s.removeAttribute(c);break;case"capture":case"download":d===!0?s.setAttribute(c,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?s.setAttribute(c,d):s.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?s.setAttribute(c,d):s.removeAttribute(c);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?s.removeAttribute(c):s.setAttribute(c,d);break;case"popover":jt("beforetoggle",s),jt("toggle",s),er(s,"popover",d);break;case"xlinkActuate":Tn(s,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Tn(s,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Tn(s,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Tn(s,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Tn(s,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Tn(s,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Tn(s,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Tn(s,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Tn(s,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":er(s,"is",d);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=Wr.get(c)||c,er(s,c,d))}}function Wm(s,o,c,d,p,y){switch(c){case"style":gr(s,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(c=d.__html,c!=null){if(p.children!=null)throw Error(r(60));s.innerHTML=c}}break;case"children":typeof d=="string"?Sr(s,d):(typeof d=="number"||typeof d=="bigint")&&Sr(s,""+d);break;case"onScroll":d!=null&&jt("scroll",s);break;case"onScrollEnd":d!=null&&jt("scrollend",s);break;case"onClick":d!=null&&(s.onclick=Ld);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zt.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(p=c.endsWith("Capture"),o=c.slice(2,p?c.length-7:void 0),y=s[_t]||null,y=y!=null?y[c]:null,typeof y=="function"&&s.removeEventListener(o,y,p),typeof d=="function")){typeof y!="function"&&y!==null&&(c in s?s[c]=null:s.hasAttribute(c)&&s.removeAttribute(c)),s.addEventListener(o,d,p);break e}c in s?s[c]=d:d===!0?s.setAttribute(c,""):er(s,c,d)}}}function Tr(s,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",s),jt("load",s);var d=!1,p=!1,y;for(y in c)if(c.hasOwnProperty(y)){var R=c[y];if(R!=null)switch(y){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:hn(s,o,y,R,c,null)}}p&&hn(s,o,"srcSet",c.srcSet,c,null),d&&hn(s,o,"src",c.src,c,null);return;case"input":jt("invalid",s);var I=y=R=p=null,H=null,ee=null;for(d in c)if(c.hasOwnProperty(d)){var pe=c[d];if(pe!=null)switch(d){case"name":p=pe;break;case"type":R=pe;break;case"checked":H=pe;break;case"defaultChecked":ee=pe;break;case"value":y=pe;break;case"defaultValue":I=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,o));break;default:hn(s,o,d,pe,c,null)}}Cn(s,y,I,H,ee,R,p,!1),Di(s);return;case"select":jt("invalid",s),d=R=y=null;for(p in c)if(c.hasOwnProperty(p)&&(I=c[p],I!=null))switch(p){case"value":y=I;break;case"defaultValue":R=I;break;case"multiple":d=I;default:hn(s,o,p,I,c,null)}o=y,c=R,s.multiple=!!d,o!=null?tr(s,!!d,o,!1):c!=null&&tr(s,!!d,c,!0);return;case"textarea":jt("invalid",s),y=p=d=null;for(R in c)if(c.hasOwnProperty(R)&&(I=c[R],I!=null))switch(R){case"value":d=I;break;case"defaultValue":p=I;break;case"children":y=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(91));break;default:hn(s,o,R,I,c,null)}Br(s,d,p,y),Di(s);return;case"option":for(H in c)if(c.hasOwnProperty(H)&&(d=c[H],d!=null))switch(H){case"selected":s.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:hn(s,o,H,d,c,null)}return;case"dialog":jt("cancel",s),jt("close",s);break;case"iframe":case"object":jt("load",s);break;case"video":case"audio":for(d=0;d<Tu.length;d++)jt(Tu[d],s);break;case"image":jt("error",s),jt("load",s);break;case"details":jt("toggle",s);break;case"embed":case"source":case"link":jt("error",s),jt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in c)if(c.hasOwnProperty(ee)&&(d=c[ee],d!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:hn(s,o,ee,d,c,null)}return;default:if($a(o)){for(pe in c)c.hasOwnProperty(pe)&&(d=c[pe],d!==void 0&&Wm(s,o,pe,d,c,void 0));return}}for(I in c)c.hasOwnProperty(I)&&(d=c[I],d!=null&&hn(s,o,I,d,c,null))}function uN(s,o,c,d){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,R=null,I=null,H=null,ee=null,pe=null;for(he in c){var Se=c[he];if(c.hasOwnProperty(he)&&Se!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":H=Se;default:d.hasOwnProperty(he)||hn(s,o,he,null,d,Se)}}for(var ue in d){var he=d[ue];if(Se=c[ue],d.hasOwnProperty(ue)&&(he!=null||Se!=null))switch(ue){case"type":y=he;break;case"name":p=he;break;case"checked":ee=he;break;case"defaultChecked":pe=he;break;case"value":R=he;break;case"defaultValue":I=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,o));break;default:he!==Se&&hn(s,o,ue,he,d,Se)}}Hn(s,R,I,H,ee,pe,y,p);return;case"select":he=R=I=ue=null;for(y in c)if(H=c[y],c.hasOwnProperty(y)&&H!=null)switch(y){case"value":break;case"multiple":he=H;default:d.hasOwnProperty(y)||hn(s,o,y,null,d,H)}for(p in d)if(y=d[p],H=c[p],d.hasOwnProperty(p)&&(y!=null||H!=null))switch(p){case"value":ue=y;break;case"defaultValue":I=y;break;case"multiple":R=y;default:y!==H&&hn(s,o,p,y,d,H)}o=I,c=R,d=he,ue!=null?tr(s,!!c,ue,!1):!!d!=!!c&&(o!=null?tr(s,!!c,o,!0):tr(s,!!c,c?[]:"",!1));return;case"textarea":he=ue=null;for(I in c)if(p=c[I],c.hasOwnProperty(I)&&p!=null&&!d.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:hn(s,o,I,null,d,p)}for(R in d)if(p=d[R],y=c[R],d.hasOwnProperty(R)&&(p!=null||y!=null))switch(R){case"value":ue=p;break;case"defaultValue":he=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:p!==y&&hn(s,o,R,p,d,y)}br(s,ue,he);return;case"option":for(var tt in c)if(ue=c[tt],c.hasOwnProperty(tt)&&ue!=null&&!d.hasOwnProperty(tt))switch(tt){case"selected":s.selected=!1;break;default:hn(s,o,tt,null,d,ue)}for(H in d)if(ue=d[H],he=c[H],d.hasOwnProperty(H)&&ue!==he&&(ue!=null||he!=null))switch(H){case"selected":s.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:hn(s,o,H,ue,d,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var wt in c)ue=c[wt],c.hasOwnProperty(wt)&&ue!=null&&!d.hasOwnProperty(wt)&&hn(s,o,wt,null,d,ue);for(ee in d)if(ue=d[ee],he=c[ee],d.hasOwnProperty(ee)&&ue!==he&&(ue!=null||he!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,o));break;default:hn(s,o,ee,ue,d,he)}return;default:if($a(o)){for(var Xn in c)ue=c[Xn],c.hasOwnProperty(Xn)&&ue!==void 0&&!d.hasOwnProperty(Xn)&&Wm(s,o,Xn,void 0,d,ue);for(pe in d)ue=d[pe],he=c[pe],!d.hasOwnProperty(pe)||ue===he||ue===void 0&&he===void 0||Wm(s,o,pe,ue,d,he);return}}for(var re in c)ue=c[re],c.hasOwnProperty(re)&&ue!=null&&!d.hasOwnProperty(re)&&hn(s,o,re,null,d,ue);for(Se in d)ue=d[Se],he=c[Se],!d.hasOwnProperty(Se)||ue===he||ue==null&&he==null||hn(s,o,Se,ue,d,he)}var Xm=null,qm=null;function zd(s){return s.nodeType===9?s:s.ownerDocument}function pE(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function mE(s,o){if(s===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&o==="foreignObject"?0:s}function Ym(s,o){return s==="textarea"||s==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Km=null;function fN(){var s=window.event;return s&&s.type==="popstate"?s===Km?!1:(Km=s,!0):(Km=null,!1)}var vE=typeof setTimeout=="function"?setTimeout:void 0,dN=typeof clearTimeout=="function"?clearTimeout:void 0,_E=typeof Promise=="function"?Promise:void 0,hN=typeof queueMicrotask=="function"?queueMicrotask:typeof _E<"u"?function(s){return _E.resolve(null).then(s).catch(gN)}:vE;function gN(s){setTimeout(function(){throw s})}function Zm(s,o){var c=o,d=0;do{var p=c.nextSibling;if(s.removeChild(c),p&&p.nodeType===8)if(c=p.data,c==="/$"){if(d===0){s.removeChild(p),Iu(o);return}d--}else c!=="$"&&c!=="$?"&&c!=="$!"||d++;c=p}while(c);Iu(o)}function Qm(s){var o=s.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Qm(c),un(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}s.removeChild(c)}}function pN(s,o,c,d){for(;s.nodeType===1;){var p=c;if(s.nodeName.toLowerCase()!==o.toLowerCase()){if(!d&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(d){if(!s[Zn])switch(o){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(y=s.getAttribute("rel"),y==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(y!==p.rel||s.getAttribute("href")!==(p.href==null?null:p.href)||s.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||s.getAttribute("title")!==(p.title==null?null:p.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(y=s.getAttribute("src"),(y!==(p.src==null?null:p.src)||s.getAttribute("type")!==(p.type==null?null:p.type)||s.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(o==="input"&&s.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&s.getAttribute("name")===y)return s}else return s;if(s=$i(s.nextSibling),s===null)break}return null}function mN(s,o,c){if(o==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=$i(s.nextSibling),s===null))return null;return s}function $i(s){for(;s!=null;s=s.nextSibling){var o=s.nodeType;if(o===1||o===3)break;if(o===8){if(o=s.data,o==="$"||o==="$!"||o==="$?"||o==="F!"||o==="F")break;if(o==="/$")return null}}return s}function yE(s){s=s.previousSibling;for(var o=0;s;){if(s.nodeType===8){var c=s.data;if(c==="$"||c==="$!"||c==="$?"){if(o===0)return s;o--}else c==="/$"&&o++}s=s.previousSibling}return null}function bE(s,o,c){switch(o=zd(c),s){case"html":if(s=o.documentElement,!s)throw Error(r(452));return s;case"head":if(s=o.head,!s)throw Error(r(453));return s;case"body":if(s=o.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}var wi=new Map,SE=new Set;function $d(s){return typeof s.getRootNode=="function"?s.getRootNode():s.ownerDocument}var Ls=q.d;q.d={f:vN,r:_N,D:yN,C:bN,L:SN,m:EN,X:TN,S:wN,M:CN};function vN(){var s=Ls.f(),o=Id();return s||o}function _N(s){var o=Ae(s);o!==null&&o.tag===5&&o.type==="form"?Y1(o):Ls.r(s)}var Al=typeof document>"u"?null:document;function EE(s,o,c){var d=Al;if(d&&typeof o=="string"&&o){var p=nn(o);p='link[rel="'+s+'"][href="'+p+'"]',typeof c=="string"&&(p+='[crossorigin="'+c+'"]'),SE.has(p)||(SE.add(p),s={rel:s,crossOrigin:c,href:o},d.querySelector(p)===null&&(o=d.createElement("link"),Tr(o,"link",s),be(o),d.head.appendChild(o)))}}function yN(s){Ls.D(s),EE("dns-prefetch",s,null)}function bN(s,o){Ls.C(s,o),EE("preconnect",s,o)}function SN(s,o,c){Ls.L(s,o,c);var d=Al;if(d&&s&&o){var p='link[rel="preload"][as="'+nn(o)+'"]';o==="image"&&c&&c.imageSrcSet?(p+='[imagesrcset="'+nn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(p+='[imagesizes="'+nn(c.imageSizes)+'"]')):p+='[href="'+nn(s)+'"]';var y=p;switch(o){case"style":y=Rl(s);break;case"script":y=xl(s)}wi.has(y)||(s=V({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:s,as:o},c),wi.set(y,s),d.querySelector(p)!==null||o==="style"&&d.querySelector(Au(y))||o==="script"&&d.querySelector(Ru(y))||(o=d.createElement("link"),Tr(o,"link",s),be(o),d.head.appendChild(o)))}}function EN(s,o){Ls.m(s,o);var c=Al;if(c&&s){var d=o&&typeof o.as=="string"?o.as:"script",p='link[rel="modulepreload"][as="'+nn(d)+'"][href="'+nn(s)+'"]',y=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=xl(s)}if(!wi.has(y)&&(s=V({rel:"modulepreload",href:s},o),wi.set(y,s),c.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Ru(y)))return}d=c.createElement("link"),Tr(d,"link",s),be(d),c.head.appendChild(d)}}}function wN(s,o,c){Ls.S(s,o,c);var d=Al;if(d&&s){var p=De(d).hoistableStyles,y=Rl(s);o=o||"default";var R=p.get(y);if(!R){var I={loading:0,preload:null};if(R=d.querySelector(Au(y)))I.loading=5;else{s=V({rel:"stylesheet",href:s,"data-precedence":o},c),(c=wi.get(y))&&Gm(s,c);var H=R=d.createElement("link");be(H),Tr(H,"link",s),H._p=new Promise(function(ee,pe){H.onload=ee,H.onerror=pe}),H.addEventListener("load",function(){I.loading|=1}),H.addEventListener("error",function(){I.loading|=2}),I.loading|=4,Vd(R,o,d)}R={type:"stylesheet",instance:R,count:1,state:I},p.set(y,R)}}}function TN(s,o){Ls.X(s,o);var c=Al;if(c&&s){var d=De(c).hoistableScripts,p=xl(s),y=d.get(p);y||(y=c.querySelector(Ru(p)),y||(s=V({src:s,async:!0},o),(o=wi.get(p))&&Jm(s,o),y=c.createElement("script"),be(y),Tr(y,"link",s),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function CN(s,o){Ls.M(s,o);var c=Al;if(c&&s){var d=De(c).hoistableScripts,p=xl(s),y=d.get(p);y||(y=c.querySelector(Ru(p)),y||(s=V({src:s,async:!0,type:"module"},o),(o=wi.get(p))&&Jm(s,o),y=c.createElement("script"),be(y),Tr(y,"link",s),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function wE(s,o,c,d){var p=(p=_e.current)?$d(p):null;if(!p)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=Rl(c.href),c=De(p).hoistableStyles,d=c.get(o),d||(d={type:"style",instance:null,count:0,state:null},c.set(o,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){s=Rl(c.href);var y=De(p).hoistableStyles,R=y.get(s);if(R||(p=p.ownerDocument||p,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(s,R),(y=p.querySelector(Au(s)))&&!y._p&&(R.instance=y,R.state.loading=5),wi.has(s)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},wi.set(s,c),y||AN(p,s,c,R.state))),o&&d===null)throw Error(r(528,""));return R}if(o&&d!==null)throw Error(r(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=xl(c),c=De(p).hoistableScripts,d=c.get(o),d||(d={type:"script",instance:null,count:0,state:null},c.set(o,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Rl(s){return'href="'+nn(s)+'"'}function Au(s){return'link[rel="stylesheet"]['+s+"]"}function TE(s){return V({},s,{"data-precedence":s.precedence,precedence:null})}function AN(s,o,c,d){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?d.loading=1:(o=s.createElement("link"),d.preload=o,o.addEventListener("load",function(){return d.loading|=1}),o.addEventListener("error",function(){return d.loading|=2}),Tr(o,"link",c),be(o),s.head.appendChild(o))}function xl(s){return'[src="'+nn(s)+'"]'}function Ru(s){return"script[async]"+s}function CE(s,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var d=s.querySelector('style[data-href~="'+nn(c.href)+'"]');if(d)return o.instance=d,be(d),d;var p=V({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return d=(s.ownerDocument||s).createElement("style"),be(d),Tr(d,"style",p),Vd(d,c.precedence,s),o.instance=d;case"stylesheet":p=Rl(c.href);var y=s.querySelector(Au(p));if(y)return o.state.loading|=4,o.instance=y,be(y),y;d=TE(c),(p=wi.get(p))&&Gm(d,p),y=(s.ownerDocument||s).createElement("link"),be(y);var R=y;return R._p=new Promise(function(I,H){R.onload=I,R.onerror=H}),Tr(y,"link",d),o.state.loading|=4,Vd(y,c.precedence,s),o.instance=y;case"script":return y=xl(c.src),(p=s.querySelector(Ru(y)))?(o.instance=p,be(p),p):(d=c,(p=wi.get(y))&&(d=V({},c),Jm(d,p)),s=s.ownerDocument||s,p=s.createElement("script"),be(p),Tr(p,"link",d),s.head.appendChild(p),o.instance=p);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&!(o.state.loading&4)&&(d=o.instance,o.state.loading|=4,Vd(d,c.precedence,s));return o.instance}function Vd(s,o,c){for(var d=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,y=p,R=0;R<d.length;R++){var I=d[R];if(I.dataset.precedence===o)y=I;else if(y!==p)break}y?y.parentNode.insertBefore(s,y.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(s,o.firstChild))}function Gm(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.title==null&&(s.title=o.title)}function Jm(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.integrity==null&&(s.integrity=o.integrity)}var Hd=null;function AE(s,o,c){if(Hd===null){var d=new Map,p=Hd=new Map;p.set(c,d)}else p=Hd,d=p.get(c),d||(d=new Map,p.set(c,d));if(d.has(s))return d;for(d.set(s,null),c=c.getElementsByTagName(s),p=0;p<c.length;p++){var y=c[p];if(!(y[Zn]||y[bt]||s==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var R=y.getAttribute(o)||"";R=s+R;var I=d.get(R);I?I.push(y):d.set(R,[y])}}return d}function RE(s,o,c){s=s.ownerDocument||s,s.head.insertBefore(c,o==="title"?s.querySelector("head > title"):null)}function RN(s,o,c){if(c===1||o.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return s=o.disabled,typeof o.precedence=="string"&&s==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function xE(s){return!(s.type==="stylesheet"&&!(s.state.loading&3))}var xu=null;function xN(){}function MN(s,o,c){if(xu===null)throw Error(r(475));var d=xu;if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&!(o.state.loading&4)){if(o.instance===null){var p=Rl(c.href),y=s.querySelector(Au(p));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(d.count++,d=jd.bind(d),s.then(d,d)),o.state.loading|=4,o.instance=y,be(y);return}y=s.ownerDocument||s,c=TE(c),(p=wi.get(p))&&Gm(c,p),y=y.createElement("link"),be(y);var R=y;R._p=new Promise(function(I,H){R.onload=I,R.onerror=H}),Tr(y,"link",c),o.instance=y}d.stylesheets===null&&(d.stylesheets=new Map),d.stylesheets.set(o,s),(s=o.state.preload)&&!(o.state.loading&3)&&(d.count++,o=jd.bind(d),s.addEventListener("load",o),s.addEventListener("error",o))}}function ON(){if(xu===null)throw Error(r(475));var s=xu;return s.stylesheets&&s.count===0&&ev(s,s.stylesheets),0<s.count?function(o){var c=setTimeout(function(){if(s.stylesheets&&ev(s,s.stylesheets),s.unsuspend){var d=s.unsuspend;s.unsuspend=null,d()}},6e4);return s.unsuspend=o,function(){s.unsuspend=null,clearTimeout(c)}}:null}function jd(){if(this.count--,this.count===0){if(this.stylesheets)ev(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Wd=null;function ev(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Wd=new Map,o.forEach(PN,s),Wd=null,jd.call(s))}function PN(s,o){if(!(o.state.loading&4)){var c=Wd.get(s);if(c)var d=c.get(null);else{c=new Map,Wd.set(s,c);for(var p=s.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var R=p[y];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(c.set(R.dataset.precedence,R),d=R)}d&&c.set(null,d)}p=o.instance,R=p.getAttribute("data-precedence"),y=c.get(R)||d,y===d&&c.set(null,p),c.set(R,p),this.count++,d=jd.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),y?y.parentNode.insertBefore(p,y.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(p,s.firstChild)),o.state.loading|=4}}var Mu={$$typeof:S,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function NN(s,o,c,d,p,y,R,I){this.tag=1,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ne(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ne(0),this.hiddenUpdates=Ne(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function ME(s,o,c,d,p,y,R,I,H,ee,pe,Se){return s=new NN(s,o,c,R,I,H,ee,Se),o=1,y===!0&&(o|=24),y=Si(3,null,null,o),s.current=y,y.stateNode=s,o=Np(),o.refCount++,s.pooledCache=o,o.refCount++,y.memoizedState={element:d,isDehydrated:c,cache:o},dm(y),s}function OE(s){return s?(s=al,s):al}function PE(s,o,c,d,p,y){p=OE(p),d.context===null?d.context=p:d.pendingContext=p,d=na(o),d.payload={element:c},y=y===void 0?null:y,y!==null&&(d.callback=y),c=ra(s,d,o),c!==null&&(Lr(c,s,o),du(c,s,o))}function NE(s,o){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var c=s.retryLane;s.retryLane=c!==0&&c<o?c:o}}function tv(s,o){NE(s,o),(s=s.alternate)&&NE(s,o)}function IE(s){if(s.tag===13){var o=Ks(s,67108864);o!==null&&Lr(o,s,67108864),tv(s,67108864)}}var Xd=!0;function IN(s,o,c,d){var p=D.T;D.T=null;var y=q.p;try{q.p=2,nv(s,o,c,d)}finally{q.p=y,D.T=p}}function DN(s,o,c,d){var p=D.T;D.T=null;var y=q.p;try{q.p=8,nv(s,o,c,d)}finally{q.p=y,D.T=p}}function nv(s,o,c,d){if(Xd){var p=rv(d);if(p===null)jm(s,o,d,qd,c),FE(s,d);else if(kN(p,s,o,c,d))d.stopPropagation();else if(FE(s,d),o&4&&-1<FN.indexOf(s)){for(;p!==null;){var y=Ae(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var R=It(y.pendingLanes);if(R!==0){var I=y;for(I.pendingLanes|=2,I.entangledLanes|=2;R;){var H=1<<31-ht(R);I.entanglements[1]|=H,R&=~H}as(y),!(zn&6)&&(Od=Me()+500,wu(0))}}break;case 13:I=Ks(y,2),I!==null&&Lr(I,y,2),Id(),tv(y,2)}if(y=rv(d),y===null&&jm(s,o,d,qd,c),y===p)break;p=y}p!==null&&d.stopPropagation()}else jm(s,o,d,null,c)}}function rv(s){return s=di(s),iv(s)}var qd=null;function iv(s){if(qd=null,s=rn(s),s!==null){var o=j(s);if(o===null)s=null;else{var c=o.tag;if(c===13){if(s=Z(o),s!==null)return s;s=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;s=null}else o!==s&&(s=null)}}return qd=s,null}function DE(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(dt()){case rt:return 2;case it:return 8;case st:case at:return 32;case Je:return 268435456;default:return 32}default:return 32}}var sv=!1,ua=null,fa=null,da=null,Ou=new Map,Pu=new Map,ha=[],FN="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function FE(s,o){switch(s){case"focusin":case"focusout":ua=null;break;case"dragenter":case"dragleave":fa=null;break;case"mouseover":case"mouseout":da=null;break;case"pointerover":case"pointerout":Ou.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pu.delete(o.pointerId)}}function Nu(s,o,c,d,p,y){return s===null||s.nativeEvent!==y?(s={blockedOn:o,domEventName:c,eventSystemFlags:d,nativeEvent:y,targetContainers:[p]},o!==null&&(o=Ae(o),o!==null&&IE(o)),s):(s.eventSystemFlags|=d,o=s.targetContainers,p!==null&&o.indexOf(p)===-1&&o.push(p),s)}function kN(s,o,c,d,p){switch(o){case"focusin":return ua=Nu(ua,s,o,c,d,p),!0;case"dragenter":return fa=Nu(fa,s,o,c,d,p),!0;case"mouseover":return da=Nu(da,s,o,c,d,p),!0;case"pointerover":var y=p.pointerId;return Ou.set(y,Nu(Ou.get(y)||null,s,o,c,d,p)),!0;case"gotpointercapture":return y=p.pointerId,Pu.set(y,Nu(Pu.get(y)||null,s,o,c,d,p)),!0}return!1}function kE(s){var o=rn(s.target);if(o!==null){var c=j(o);if(c!==null){if(o=c.tag,o===13){if(o=Z(c),o!==null){s.blockedOn=o,We(s.priority,function(){if(c.tag===13){var d=ri(),p=Ks(c,d);p!==null&&Lr(p,c,d),tv(c,d)}});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){s.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Yd(s){if(s.blockedOn!==null)return!1;for(var o=s.targetContainers;0<o.length;){var c=rv(s.nativeEvent);if(c===null){c=s.nativeEvent;var d=new c.constructor(c.type,c);fi=d,c.target.dispatchEvent(d),fi=null}else return o=Ae(c),o!==null&&IE(o),s.blockedOn=c,!1;o.shift()}return!0}function BE(s,o,c){Yd(s)&&c.delete(o)}function BN(){sv=!1,ua!==null&&Yd(ua)&&(ua=null),fa!==null&&Yd(fa)&&(fa=null),da!==null&&Yd(da)&&(da=null),Ou.forEach(BE),Pu.forEach(BE)}function Kd(s,o){s.blockedOn===o&&(s.blockedOn=null,sv||(sv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,BN)))}var Zd=null;function UE(s){Zd!==s&&(Zd=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Zd===s&&(Zd=null);for(var o=0;o<s.length;o+=3){var c=s[o],d=s[o+1],p=s[o+2];if(typeof d!="function"){if(iv(d||c)===null)continue;break}var y=Ae(c);y!==null&&(s.splice(o,3),o-=3,Yp(y,{pending:!0,data:p,method:c.method,action:d},d,p))}}))}function Iu(s){function o(H){return Kd(H,s)}ua!==null&&Kd(ua,s),fa!==null&&Kd(fa,s),da!==null&&Kd(da,s),Ou.forEach(o),Pu.forEach(o);for(var c=0;c<ha.length;c++){var d=ha[c];d.blockedOn===s&&(d.blockedOn=null)}for(;0<ha.length&&(c=ha[0],c.blockedOn===null);)kE(c),c.blockedOn===null&&ha.shift();if(c=(s.ownerDocument||s).$$reactFormReplay,c!=null)for(d=0;d<c.length;d+=3){var p=c[d],y=c[d+1],R=p[_t]||null;if(typeof y=="function")R||UE(c);else if(R){var I=null;if(y&&y.hasAttribute("formAction")){if(p=y,R=y[_t]||null)I=R.formAction;else if(iv(p)!==null)continue}else I=R.action;typeof I=="function"?c[d+1]=I:(c.splice(d,3),d-=3),UE(c)}}}function av(s){this._internalRoot=s}Qd.prototype.render=av.prototype.render=function(s){var o=this._internalRoot;if(o===null)throw Error(r(409));var c=o.current,d=ri();PE(c,d,s,o,null,null)},Qd.prototype.unmount=av.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var o=s.containerInfo;s.tag===0&&wl(),PE(s.current,2,null,s,null,null),Id(),o[Zt]=null}};function Qd(s){this._internalRoot=s}Qd.prototype.unstable_scheduleHydration=function(s){if(s){var o=Ye();s={blockedOn:null,target:s,priority:o};for(var c=0;c<ha.length&&o!==0&&o<ha[c].priority;c++);ha.splice(c,0,s),c===0&&kE(s)}};var LE=e.version;if(LE!=="19.0.0")throw Error(r(527,LE,"19.0.0"));q.findDOMNode=function(s){var o=s._reactInternals;if(o===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=$(o),s=s!==null?ie(s):null,s=s===null?null:s.stateNode,s};var UN={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:D,findFiberByHostInstance:rn,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gd.isDisabled&&Gd.supportsFiber)try{ct=Gd.inject(UN),mt=Gd}catch{}}return Fu.createRoot=function(s,o){if(!i(s))throw Error(r(299));var c=!1,d="",p=nS,y=rS,R=iS,I=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(y=o.onCaughtError),o.onRecoverableError!==void 0&&(R=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(I=o.unstable_transitionCallbacks)),o=ME(s,1,!1,null,null,c,d,p,y,R,I,null),s[Zt]=o.current,Hm(s.nodeType===8?s.parentNode:s),new av(o)},Fu.hydrateRoot=function(s,o,c){if(!i(s))throw Error(r(299));var d=!1,p="",y=nS,R=rS,I=iS,H=null,ee=null;return c!=null&&(c.unstable_strictMode===!0&&(d=!0),c.identifierPrefix!==void 0&&(p=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(R=c.onCaughtError),c.onRecoverableError!==void 0&&(I=c.onRecoverableError),c.unstable_transitionCallbacks!==void 0&&(H=c.unstable_transitionCallbacks),c.formState!==void 0&&(ee=c.formState)),o=ME(s,1,!0,o,c??null,d,p,y,R,I,H,ee),o.context=OE(null),c=o.current,d=ri(),p=na(d),p.callback=null,ra(c,p,d),o.current.lanes=d,Et(o,d),as(o),s[Zt]=o.current,Hm(s),new Qd(o)},Fu.version="19.0.0",Fu}var ow;function DI(){if(ow)return fv.exports;ow=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),fv.exports=II(),fv.exports}var FI=DI();function zh(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const Ay=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),lw=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);lw&&parseFloat(lw[1]);const th=globalThis,Ml=globalThis.process||{},kI=globalThis.navigator||{};function GA(t){var r,i;if(typeof window<"u"&&((r=window.process)==null?void 0:r.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;const n=typeof navigator<"u"&&navigator.userAgent;return!!(n&&n.indexOf("Electron")>=0)}function Ho(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||GA()}function BI(t){return Ho()?GA()?"Electron":(kI.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const JA="4.1.0";function UI(t){try{const e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch{return null}}class LI{constructor(e,n,r="sessionStorage"){this.storage=UI(r),this.id=e,this.config=n,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const n=JSON.stringify(this.config);this.storage.setItem(this.id,n)}}_loadConfiguration(){let e={};if(this.storage){const n=this.storage.getItem(this.id);e=n?JSON.parse(n):{}}return Object.assign(this.config,e),this}}function zI(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function $I(t,e=8){const n=Math.max(e-t.length,0);return`${" ".repeat(n)}${t}`}var $h;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})($h||($h={}));const VI=10;function cw(t){return typeof t!="string"?t:(t=t.toUpperCase(),$h[t]||$h.WHITE)}function HI(t,e,n){return!Ho&&typeof t=="string"&&(e&&(t=`\x1B[${cw(e)}m${t}\x1B[39m`),n&&(t=`\x1B[${cw(n)+VI}m${t}\x1B[49m`)),t}function jI(t,e=["constructor"]){const n=Object.getPrototypeOf(t),r=Object.getOwnPropertyNames(n),i=t;for(const a of r){const l=i[a];typeof l=="function"&&(e.find(u=>a===u)||(i[a]=l.bind(t)))}}function Ry(t,e){if(!t)throw new Error("Assertion failed")}function Ol(){var e,n,r;let t;if(Ho()&&th.performance)t=(n=(e=th==null?void 0:th.performance)==null?void 0:e.now)==null?void 0:n.call(e);else if("hrtime"in Ml){const i=(r=Ml==null?void 0:Ml.hrtime)==null?void 0:r.call(Ml);t=i[0]*1e3+i[1]/1e6}else t=Date.now();return t}const Pl={debug:Ho()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},WI={enabled:!0,level:0};function Nl(){}const uw={},fw={once:!0};class Lf{constructor({id:e}={id:""}){this.VERSION=JA,this._startTs=Ol(),this._deltaTs=Ol(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new LI(`__probe-${this.id}__`,WI),this.timeStamp(`${this.id} started`),jI(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ol()-this._startTs).toPrecision(10))}getDelta(){return Number((Ol()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,n){this._storage.setConfiguration({[e]:n})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,n){if(!e)throw new Error(n||"Assertion failed")}warn(e){return this._getLogFunction(0,e,Pl.warn,arguments,fw)}error(e){return this._getLogFunction(0,e,Pl.error,arguments)}deprecated(e,n){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${n}\` instead`)}removed(e,n){return this.error(`\`${e}\` has been removed. Use \`${n}\` instead`)}probe(e,n){return this._getLogFunction(e,n,Pl.log,arguments,{time:!0,once:!0})}log(e,n){return this._getLogFunction(e,n,Pl.debug,arguments)}info(e,n){return this._getLogFunction(e,n,console.info,arguments)}once(e,n){return this._getLogFunction(e,n,Pl.debug||Pl.info,arguments,fw)}table(e,n,r){return n?this._getLogFunction(e,n,console.table||Nl,r&&[r],{tag:qI(n)}):Nl}time(e,n){return this._getLogFunction(e,n,console.time?console.time:console.info)}timeEnd(e,n){return this._getLogFunction(e,n,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,n){return this._getLogFunction(e,n,console.timeStamp||Nl)}group(e,n,r={collapsed:!1}){const i=dw({logLevel:e,message:n,opts:r}),{collapsed:a}=r;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,n,r={}){return this.group(e,n,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Nl)}withGroup(e,n,r){this.group(e,n)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=eR(e)}_getLogFunction(e,n,r,i,a){if(this._shouldLog(e)){a=dw({logLevel:e,message:n,args:i,opts:a}),r=r||a.method,Ry(r),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Ol();const l=a.tag||a.message;if(a.once&&l)if(!uw[l])uw[l]=Ol();else return Nl;return n=XI(this.id,a.message,a),r.bind(console,n,...a.args)}return Nl}}Lf.VERSION=JA;function eR(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Ry(Number.isFinite(e)&&e>=0),e}function dw(t){const{logLevel:e,message:n}=t;t.logLevel=eR(e);const r=t.args?Array.from(t.args):[];for(;r.length&&r.shift()!==n;);switch(typeof e){case"string":case"function":n!==void 0&&r.unshift(n),t.message=e;break;case"object":Object.assign(t,e);break}typeof t.message=="function"&&(t.message=t.message());const i=typeof t.message;return Ry(i==="string"||i==="object"),Object.assign(t,{args:r},t.opts)}function XI(t,e,n){if(typeof e=="string"){const r=n.time?$I(zI(n.total)):"";e=n.time?`${t}: ${r} ${e}`:`${t}: ${e}`,e=HI(e,n.color,n.background)}return e}function qI(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}const pv="4.3.2",YI=pv[0]>="0"&&pv[0]<="9"?`v${pv}`:"";function KI(){const t=new Lf({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=t,globalThis.loaders.version=YI,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=t,t}const ZI=KI();function QI(t,e){return tR(t||{},e)}function tR(t,e,n=0){if(n>3)return e;const r={...t};for(const[i,a]of Object.entries(e))a&&typeof a=="object"&&!Array.isArray(a)?r[i]=tR(r[i]||{},e[i],n+1):r[i]=e[i];return r}const GI="latest";function JI(){var t;return(t=globalThis._loadersgl_)!=null&&t.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.2"),globalThis._loadersgl_.version}const e6=JI();function La(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const Po=typeof process!="object"||String(process)!=="[object process]"||process.browser,t6=typeof window<"u"&&typeof window.orientation<"u",hw=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);hw&&parseFloat(hw[1]);class n6{constructor(e,n){M(this,"name");M(this,"workerThread");M(this,"isRunning",!0);M(this,"result");M(this,"_resolve",()=>{});M(this,"_reject",()=>{});this.name=e,this.workerThread=n,this.result=new Promise((r,i)=>{this._resolve=r,this._reject=i})}postMessage(e,n){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:n})}done(e){La(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){La(this.isRunning),this.isRunning=!1,this._reject(e)}}class mv{terminate(){}}const vv=new Map;function r6(t){La(t.source&&!t.url||!t.source&&t.url);let e=vv.get(t.source||t.url);return e||(t.url&&(e=i6(t.url),vv.set(t.url,e)),t.source&&(e=nR(t.source),vv.set(t.source,e))),La(e),e}function i6(t){if(!t.startsWith("http"))return t;const e=s6(t);return nR(e)}function nR(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function s6(t){return`try {
|
|
|
importScripts('${t}');
|
|
|
} catch (error) {
|
|
|
console.error(error);
|
|
|
throw error;
|
|
|
}`}function rR(t,e=!0,n){const r=n||new Set;if(t){if(gw(t))r.add(t);else if(gw(t.buffer))r.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(const i in t)rR(t[i],e,r)}}return n===void 0?Array.from(r):[]}function gw(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}const _v=()=>{};class O0{constructor(e){M(this,"name");M(this,"source");M(this,"url");M(this,"terminated",!1);M(this,"worker");M(this,"onMessage");M(this,"onError");M(this,"_loadableURL","");const{name:n,source:r,url:i}=e;La(r||i),this.name=n,this.source=r,this.url=i,this.onMessage=_v,this.onError=a=>console.log(a),this.worker=Po?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&Po||typeof mv<"u"&&!Po}destroy(){this.onMessage=_v,this.onError=_v,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,n){n=n||rR(e),this.worker.postMessage(e,n)}_getErrorFromErrorEvent(e){let n="Failed to load ";return n+=`worker ${this.name} from ${this.url}. `,e.message&&(n+=`${e.message} in `),e.lineno&&(n+=`:${e.lineno}:${e.colno}`),new Error(n)}_createBrowserWorker(){this._loadableURL=r6({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=n=>{n.data?this.onMessage(n.data):this.onError(new Error("No data received"))},e.onerror=n=>{this.onError(this._getErrorFromErrorEvent(n)),this.terminated=!0},e.onmessageerror=n=>console.error(n),e}_createNodeWorker(){let e;if(this.url){const r=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new mv(r,{eval:!1})}else if(this.source)e=new mv(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",n=>{this.onMessage(n)}),e.on("error",n=>{this.onError(n)}),e.on("exit",n=>{}),e}}class a6{constructor(e){M(this,"name","unnamed");M(this,"source");M(this,"url");M(this,"maxConcurrency",1);M(this,"maxMobileConcurrency",1);M(this,"onDebug",()=>{});M(this,"reuseWorkers",!0);M(this,"props",{});M(this,"jobQueue",[]);M(this,"idleQueue",[]);M(this,"count",0);M(this,"isDestroyed",!1);this.source=e.source,this.url=e.url,this.setProps(e)}static isSupported(){return O0.isSupported()}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,n=(i,a,l)=>i.done(l),r=(i,a)=>i.error(a)){const i=new Promise(a=>(this.jobQueue.push({name:e,onMessage:n,onError:r,onStart:a}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const n=this.jobQueue.shift();if(n){this.onDebug({message:"Starting job",name:n.name,workerThread:e,backlog:this.jobQueue.length});const r=new n6(n.name,e);e.onMessage=i=>n.onMessage(r,i.type,i.payload),e.onError=i=>n.onError(r,i),n.onStart(r);try{await r.result}catch(i){console.error(`Worker exception: ${i}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Po||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new O0({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return t6?this.maxMobileConcurrency:this.maxConcurrency}}const o6={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},wa=class wa{constructor(e){M(this,"props");M(this,"workerPools",new Map);this.props={...o6},this.setProps(e),this.workerPools=new Map}static isSupported(){return O0.isSupported()}static getWorkerFarm(e={}){return wa._workerFarm=wa._workerFarm||new wa({}),wa._workerFarm.setProps(e),wa._workerFarm}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const n of this.workerPools.values())n.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:n,source:r,url:i}=e;let a=this.workerPools.get(n);return a||(a=new a6({name:n,source:r,url:i}),a.setProps(this._getWorkerPoolProps()),this.workerPools.set(n,a)),a}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};M(wa,"_workerFarm");let Vh=wa;function l6(t,e={}){const n=e[t.id]||{},r=Po?`${t.id}-worker.js`:`${t.id}-worker-node.js`;let i=n.workerUrl;if(!i&&t.id==="compression"&&(i=e.workerUrl),e._workerType==="test"&&(Po?i=`modules/${t.module}/dist/${r}`:i=`modules/${t.module}/src/workers/${t.id}-worker-node.ts`),!i){let a=t.version;a==="latest"&&(a=GI);const l=a?`@${a}`:"";i=`https://unpkg.com/@loaders.gl/${t.module}${l}/dist/${r}`}return La(i),i}function c6(t,e=e6){La(t,"no worker provided");const n=t.version;return!(!e||!n)}function u6(t,e){return!Vh.isSupported()||!Po&&!(e!=null&&e._nodeWorkers)?!1:t.worker&&(e==null?void 0:e.worker)}async function f6(t,e,n,r,i){const a=t.id,l=l6(t,n),f=Vh.getWorkerFarm(n).getWorkerPool({name:a,url:l});n=JSON.parse(JSON.stringify(n)),r=JSON.parse(JSON.stringify(r||{}));const h=await f.startJob("process-on-worker",d6.bind(null,i));return h.postMessage("process",{input:e,options:n,context:r}),await(await h.result).result}async function d6(t,e,n,r){switch(n){case"done":e.done(r);break;case"error":e.error(new Error(r.error));break;case"process":const{id:i,input:a,options:l}=r;try{const u=await t(a,l);e.postMessage("done",{id:i,result:u})}catch(u){const f=u instanceof Error?u.message:"unknown error";e.postMessage("error",{id:i,error:f})}break;default:console.warn(`parse-with-worker unknown message ${n}`)}}function h6(t,e,n){if(n=n||t.byteLength,t.byteLength<n||e.byteLength<n)return!1;const r=new Uint8Array(t),i=new Uint8Array(e);for(let a=0;a<r.length;++a)if(r[a]!==i[a])return!1;return!0}function g6(...t){return p6(t)}function p6(t){const e=t.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),n=e.reduce((a,l)=>a+l.byteLength,0),r=new Uint8Array(n);let i=0;for(const a of e)r.set(a,i),i+=a.byteLength;return r.buffer}async function m6(t){const e=[];for await(const n of t)e.push(n);return g6(...e)}function pw(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}class mw{constructor(e,n){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=n,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=pw(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(pw()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class qg{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,n="count"){return this._getOrCreate({name:e,type:n})}get size(){return Object.keys(this.stats).length}reset(){for(const e of Object.values(this.stats))e.reset();return this}forEach(e){for(const n of Object.values(this.stats))e(n)}getTable(){const e={};return this.forEach(n=>{e[n.name]={time:n.time||0,count:n.count||0,average:n.getAverageTime()||0,hz:n.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(n=>this._getOrCreate(n))}_getOrCreate(e){const{name:n,type:r}=e;let i=this.stats[n];return i||(e instanceof mw?i=e:i=new mw(n,r),this.stats[n]=i),i}}let v6="";const vw={};function _6(t){for(const e in vw)if(t.startsWith(e)){const n=vw[e];t=t.replace(e,n)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${v6}${t}`),t}function y6(t){return t&&typeof t=="object"&&t.isBuffer}function iR(t){if(y6(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){const e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function sR(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function b6(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}const S6=t=>typeof t=="boolean",Qu=t=>typeof t=="function",zf=t=>t!==null&&typeof t=="object",_w=t=>zf(t)&&t.constructor==={}.constructor,E6=t=>!!t&&typeof t[Symbol.iterator]=="function",w6=t=>t&&typeof t[Symbol.asyncIterator]=="function",jo=t=>typeof Response<"u"&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Wo=t=>typeof Blob<"u"&&t instanceof Blob,T6=t=>t&&typeof t=="object"&&t.isBuffer,C6=t=>typeof ReadableStream<"u"&&t instanceof ReadableStream||zf(t)&&Qu(t.tee)&&Qu(t.cancel)&&Qu(t.getReader),A6=t=>zf(t)&&Qu(t.read)&&Qu(t.pipe)&&S6(t.readable),aR=t=>C6(t)||A6(t);class R6 extends Error{constructor(n,r){super(n);M(this,"reason");M(this,"url");M(this,"response");this.reason=r.reason,this.url=r.url,this.response=r.response}}const x6=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,M6=/^([-\w.]+\/[-\w.+]+)/;function yw(t,e){return t.toLowerCase()===e.toLowerCase()}function O6(t){const e=M6.exec(t);return e?e[1]:t}function bw(t){const e=x6.exec(t);return e?e[1]:""}const oR=/\?.*/;function P6(t){const e=t.match(oR);return e&&e[0]}function xy(t){return t.replace(oR,"")}function N6(t){if(t.length<50)return t;const e=t.slice(t.length-15);return`${t.substr(0,32)}...${e}`}function Yg(t){return jo(t)?t.url:Wo(t)?t.name||"":typeof t=="string"?t:""}function My(t){if(jo(t)){const e=t,n=e.headers.get("content-type")||"",r=xy(e.url);return O6(n)||bw(r)}return Wo(t)?t.type||"":typeof t=="string"?bw(t):""}function I6(t){return jo(t)?t.headers["content-length"]||-1:Wo(t)?t.size:typeof t=="string"?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}async function lR(t){if(jo(t))return t;const e={},n=I6(t);n>=0&&(e["content-length"]=String(n));const r=Yg(t),i=My(t);i&&(e["content-type"]=i);const a=await k6(t);a&&(e["x-first-bytes"]=a),typeof t=="string"&&(t=new TextEncoder().encode(t));const l=new Response(t,{headers:e});return Object.defineProperty(l,"url",{value:r}),l}async function D6(t){if(!t.ok)throw await F6(t)}async function F6(t){const e=N6(t.url);let n=`Failed to fetch resource (${t.status}) ${t.statusText}: ${e}`;n=n.length>100?`${n.slice(0,100)}...`:n;const r={reason:t.statusText,url:t.url,response:t};try{const i=t.headers.get("Content-Type");r.reason=!t.bodyUsed&&(i!=null&&i.includes("application/json"))?await t.json():await t.text()}catch{}return new R6(n,r)}async function k6(t){if(typeof t=="string")return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const n=t.slice(0,5);return await new Promise(r=>{const i=new FileReader;i.onload=a=>{var l;return r((l=a==null?void 0:a.target)==null?void 0:l.result)},i.readAsDataURL(n)})}if(t instanceof ArrayBuffer){const n=t.slice(0,5);return`data:base64,${B6(n)}`}return null}function B6(t){let e="";const n=new Uint8Array(t);for(let r=0;r<n.byteLength;r++)e+=String.fromCharCode(n[r]);return btoa(e)}function U6(t){return!L6(t)&&!z6(t)}function L6(t){return t.startsWith("http:")||t.startsWith("https:")}function z6(t){return t.startsWith("data:")}async function Sw(t,e){var n,r;if(typeof t=="string"){const i=_6(t);return U6(i)&&(n=globalThis.loaders)!=null&&n.fetchNode?(r=globalThis.loaders)==null?void 0:r.fetchNode(i,e):await fetch(i,e)}return await lR(t)}const Ew=new Lf({id:"loaders.gl"});class $6{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class V6{constructor(){M(this,"console");this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}}const cR={fetch:null,mimeType:void 0,nothrow:!1,log:new V6,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Ay,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},H6={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function uR(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state||(t._state={}),t._state}function fR(){const t=uR();return t.globalOptions=t.globalOptions||{...cR},t.globalOptions}function j6(t,e,n,r){return n=n||[],n=Array.isArray(n)?n:[n],W6(t,n),q6(e,t,r)}function W6(t,e){ww(t,null,cR,H6,e);for(const n of e){const r=t&&t[n.id]||{},i=n.options&&n.options[n.id]||{},a=n.deprecatedOptions&&n.deprecatedOptions[n.id]||{};ww(r,n.id,i,a,e)}}function ww(t,e,n,r,i){const a=e||"Top level",l=e?`${e}.`:"";for(const u in t){const f=!e&&zf(t[u]),h=u==="baseUri"&&!e,g=u==="workerUrl"&&e;if(!(u in n)&&!h&&!g){if(u in r)Ew.warn(`${a} loader option '${l}${u}' no longer supported, use '${r[u]}'`)();else if(!f){const m=X6(u,i);Ew.warn(`${a} loader option '${l}${u}' not recognized. ${m}`)()}}}}function X6(t,e){const n=t.toLowerCase();let r="";for(const i of e)for(const a in i.options){if(t===a)return`Did you mean '${i.id}.${a}'?`;const l=a.toLowerCase();(n.startsWith(l)||l.startsWith(n))&&(r=r||`Did you mean '${i.id}.${a}'?`)}return r}function q6(t,e,n){const i={...t.options||{}};return Y6(i,n),i.log===null&&(i.log=new $6),Tw(i,fR()),Tw(i,e),i}function Tw(t,e){for(const n in e)if(n in e){const r=e[n];_w(r)&&_w(t[n])?t[n]={...t[n],...e[n]}:t[n]=e[n]}}function Y6(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}function Oy(t){return t?(Array.isArray(t)&&(t=t[0]),Array.isArray(t==null?void 0:t.extensions)):!1}function Py(t){zh(t,"null loader"),zh(Oy(t),"invalid loader");let e;return Array.isArray(t)&&(e=t[1],t=t[0],t={...t,options:{...t.options,...e}}),(t!=null&&t.parseTextSync||t!=null&&t.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const dR=()=>{const t=uR();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function K6(t){const e=dR();t=Array.isArray(t)?t:[t];for(const n of t){const r=Py(n);e.find(i=>r===i)||e.unshift(r)}}function Z6(){return dR()}const Q6=/\.([^.]+)$/;async function G6(t,e=[],n,r){if(!hR(t))return null;let i=Cw(t,e,{...n,nothrow:!0},r);if(i)return i;if(Wo(t)&&(t=await t.slice(0,10).arrayBuffer(),i=Cw(t,e,n,r)),!i&&!(n!=null&&n.nothrow))throw new Error(gR(t));return i}function Cw(t,e=[],n,r){if(!hR(t))return null;if(e&&!Array.isArray(e))return Py(e);let i=[];e&&(i=i.concat(e)),n!=null&&n.ignoreRegisteredLoaders||i.push(...Z6()),eD(i);const a=J6(t,i,n,r);if(!a&&!(n!=null&&n.nothrow))throw new Error(gR(t));return a}function J6(t,e,n,r){const i=Yg(t),a=My(t),l=xy(i)||(r==null?void 0:r.url);let u=null,f="";return n!=null&&n.mimeType&&(u=yv(e,n==null?void 0:n.mimeType),f=`match forced by supplied MIME type ${n==null?void 0:n.mimeType}`),u=u||tD(e,l),f=f||(u?`matched url ${l}`:""),u=u||yv(e,a),f=f||(u?`matched MIME type ${a}`:""),u=u||rD(e,t),f=f||(u?`matched initial data ${pR(t)}`:""),n!=null&&n.fallbackMimeType&&(u=u||yv(e,n==null?void 0:n.fallbackMimeType),f=f||(u?`matched fallback MIME type ${a}`:"")),f&&ZI.log(1,`selectLoader selected ${u==null?void 0:u.name}: ${f}.`),u}function hR(t){return!(t instanceof Response&&t.status===204)}function gR(t){const e=Yg(t),n=My(t);let r="No valid loader found (";r+=e?`${sR(e)}, `:"no url provided, ",r+=`MIME type: ${n?`"${n}"`:"not provided"}, `;const i=t?pR(t):"";return r+=i?` first bytes: "${i}"`:"first bytes: not available",r+=")",r}function eD(t){for(const e of t)Py(e)}function tD(t,e){const n=e&&Q6.exec(e),r=n&&n[1];return r?nD(t,r):null}function nD(t,e){e=e.toLowerCase();for(const n of t)for(const r of n.extensions)if(r.toLowerCase()===e)return n;return null}function yv(t,e){var n;for(const r of t)if((n=r.mimeTypes)!=null&&n.some(i=>yw(e,i))||yw(e,`application/x.${r.id}`))return r;return null}function rD(t,e){if(!e)return null;for(const n of t)if(typeof e=="string"){if(iD(e,n))return n}else if(ArrayBuffer.isView(e)){if(Aw(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer&&Aw(e,0,n))return n;return null}function iD(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(r=>t.startsWith(r))}function Aw(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(i=>sD(t,e,n,i))}function sD(t,e,n,r){if(r instanceof ArrayBuffer)return h6(r,t,r.byteLength);switch(typeof r){case"function":return r(t);case"string":const i=P0(t,e,r.length);return r===i;default:return!1}}function pR(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?P0(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?P0(t,0,e):""}function P0(t,e,n){if(t.byteLength<e+n)return"";const r=new DataView(t);let i="";for(let a=0;a<n;a++)i+=String.fromCharCode(r.getUint8(e+a));return i}const aD=256*1024;function*oD(t,e){const n=(e==null?void 0:e.chunkSize)||aD;let r=0;const i=new TextEncoder;for(;r<t.length;){const a=Math.min(t.length-r,n),l=t.slice(r,r+a);r+=a,yield i.encode(l)}}const lD=256*1024;function*cD(t,e={}){const{chunkSize:n=lD}=e;let r=0;for(;r<t.byteLength;){const i=Math.min(t.byteLength-r,n),a=new ArrayBuffer(i),l=new Uint8Array(t,r,i);new Uint8Array(a).set(l),r+=i,yield a}}const uD=1024*1024;async function*fD(t,e){const n=(e==null?void 0:e.chunkSize)||uD;let r=0;for(;r<t.size;){const i=r+n,a=await t.slice(r,i).arrayBuffer();r=i,yield a}}function Rw(t,e){return Ay?dD(t,e):hD(t)}async function*dD(t,e){const n=t.getReader();let r;try{for(;;){const i=r||n.read();e!=null&&e._streamReadAhead&&(r=n.read());const{done:a,value:l}=await i;if(a)return;yield iR(l)}}catch{n.releaseLock()}}async function*hD(t,e){for await(const n of t)yield iR(n)}function gD(t,e){if(typeof t=="string")return oD(t,e);if(t instanceof ArrayBuffer)return cD(t,e);if(Wo(t))return fD(t,e);if(aR(t))return Rw(t,e);if(jo(t))return Rw(t.body,e);throw new Error("makeIterator")}const mR="Cannot convert supplied data type";function pD(t,e,n){if(e.text&&typeof t=="string")return t;if(T6(t)&&(t=t.buffer),t instanceof ArrayBuffer){const r=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(r):r}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let r=t.buffer;const i=t.byteLength||t.length;return(t.byteOffset!==0||i!==r.byteLength)&&(r=r.slice(t.byteOffset,t.byteOffset+i)),r}throw new Error(mR)}async function mD(t,e,n){const r=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if(typeof t=="string"||r)return pD(t,e);if(Wo(t)&&(t=await lR(t)),jo(t)){const i=t;return await D6(i),e.binary?await i.arrayBuffer():await i.text()}if(aR(t)&&(t=gD(t,n)),E6(t)||w6(t))return m6(t);throw new Error(mR)}function vR(t,e){const n=fR(),r=t||n;return typeof r.fetch=="function"?r.fetch:zf(r.fetch)?i=>Sw(i,r.fetch):e!=null&&e.fetch?e==null?void 0:e.fetch:Sw}function vD(t,e,n){if(n)return n;const r={fetch:vR(e,t),...t};if(r.url){const i=xy(r.url);r.baseUrl=i,r.queryString=P6(r.url),r.filename=sR(i),r.baseUrl=b6(i)}return Array.isArray(r.loaders)||(r.loaders=null),r}function _D(t,e){if(t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const r=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...r]:r}return n&&n.length?n:void 0}async function Hh(t,e,n,r){e&&!Array.isArray(e)&&!Oy(e)&&(r=void 0,n=e,e=void 0),t=await t,n=n||{};const i=Yg(t),l=_D(e,r),u=await G6(t,l,n);return u?(n=j6(n,u,l,i),r=vD({url:i,_parse:Hh,loaders:l},n,r||null),await yD(u,t,n,r)):null}async function yD(t,e,n,r){if(c6(t),n=QI(t.options,n),jo(e)){const a=e,{ok:l,redirected:u,status:f,statusText:h,type:g,url:m}=a,v=Object.fromEntries(a.headers.entries());r.response={headers:v,ok:l,redirected:u,status:f,statusText:h,type:g,url:m}}e=await mD(e,t,n);const i=t;if(i.parseTextSync&&typeof e=="string")return i.parseTextSync(e,n,r);if(u6(t,n))return await f6(t,e,n,r,Hh);if(i.parseText&&typeof e=="string")return await i.parseText(e,n,r);if(i.parse)return await i.parse(e,n,r);throw La(!i.parseSync),new Error(`${t.id} loader - no parser found and worker is disabled`)}const xw=100;class bD{constructor(e,n){M(this,"schema");M(this,"options");M(this,"shape");M(this,"length",0);M(this,"rows",null);M(this,"cursor",0);M(this,"_headers",[]);if(this.options=n,this.schema=e,!Array.isArray(e)){this._headers=[];for(const r in e)this._headers[e[r].index]=e[r].name}}rowCount(){return this.length}addArrayRow(e,n){Number.isFinite(n)&&(this.cursor=n),this.shape="array-row-table",this.rows=this.rows||new Array(xw),this.rows[this.length]=e,this.length++}addObjectRow(e,n){Number.isFinite(n)&&(this.cursor=n),this.shape="object-row-table",this.rows=this.rows||new Array(xw),this.rows[this.length]=e,this.length++}getBatch(){let e=this.rows;return e?(e=e.slice(0,this.length),this.rows=null,{shape:this.shape||"array-row-table",batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}function _R(t,e){if(!t)throw new Error("null row");const n={};if(e)for(let r=0;r<e.length;r++)n[e[r]]=t[r];else for(let r=0;r<t.length;r++){const i=`column-${r}`;n[i]=t[r]}return n}function yR(t,e){if(!t)throw new Error("null row");if(e){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=t[e[r]];return n}return Object.values(t)}function SD(t){const e=[];for(let n=0;n<t.length;n++){const r=`column-${n}`;e.push(r)}return e}function ED(t){return Object.keys(t)}const Mw=100;class wD{constructor(e,n){M(this,"schema");M(this,"options");M(this,"length",0);M(this,"objectRows",null);M(this,"arrayRows",null);M(this,"cursor",0);M(this,"_headers",null);if(this.options=n,this.schema=e,e){this._headers=[];for(const r in e)this._headers[e[r].index]=e[r].name}}rowCount(){return this.length}addArrayRow(e,n){switch(Number.isFinite(n)&&(this.cursor=n),this._headers||(this._headers=SD(e)),this.options.shape){case"object-row-table":const r=_R(e,this._headers);this.addObjectRow(r,n);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(Mw),this.arrayRows[this.length]=e,this.length++;break}}addObjectRow(e,n){switch(Number.isFinite(n)&&(this.cursor=n),this._headers||(this._headers=ED(e)),this.options.shape){case"array-row-table":const r=yR(e,this._headers);this.addArrayRow(r,n);break;case"object-row-table":this.objectRows=this.objectRows||new Array(Mw),this.objectRows[this.length]=e,this.length++;break}}getBatch(){let e=this.arrayRows||this.objectRows;return e?(e=e.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}const TD=100;class CD{constructor(e,n){M(this,"schema");M(this,"length",0);M(this,"allocated",0);M(this,"columns",{});this.schema=e,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(e){this._reallocateColumns();let n=0;for(const r in this.columns)this.columns[r][this.length]=e[n++];this.length++}addObjectRow(e){this._reallocateColumns();for(const n in e)this.columns[n][this.length]=e[n];this.length++}getBatch(){this._pruneColumns();const e=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(const r in this.schema){const i=this.schema[r];e[i.name]=this.columns[i.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:e,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:TD,this.columns={};for(const e in this.schema){const n=this.schema[e],r=n.type||Float32Array,i=this.columns[n.index];if(i&&ArrayBuffer.isView(i)){const a=new r(this.allocated);a.set(i),this.columns[n.index]=a}else i?(i.length=this.allocated,this.columns[n.index]=i):this.columns[n.index]=new r(this.allocated)}}}_pruneColumns(){for(const[e,n]of Object.entries(this.columns))this.columns[e]=n.slice(0,this.length)}}const AD={shape:void 0,batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},RD="TableBatchBuilder",cf=class cf{constructor(e,n){M(this,"schema");M(this,"options");M(this,"aggregator",null);M(this,"batchCount",0);M(this,"bytesUsed",0);M(this,"isChunkComplete",!1);M(this,"lastBatchEmittedMs",Date.now());M(this,"totalLength",0);M(this,"totalBytes",0);M(this,"rowBytes",0);this.schema=e,this.options={...AD,...n}}limitReached(){var e,n;return!!((e=this.options)!=null&&e.limit&&this.totalLength>=this.options.limit||(n=this.options)!=null&&n._limitMB&&this.totalBytes/1e6>=this.options._limitMB)}addRow(e){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(e),this.totalBytes+=this.rowBytes,Array.isArray(e)?this.addArrayRow(e):this.addObjectRow(e))}addArrayRow(e){if(!this.aggregator){const n=this._getTableBatchType();this.aggregator=new n(this.schema,this.options)}this.aggregator.addArrayRow(e)}addObjectRow(e){if(!this.aggregator){const n=this._getTableBatchType();this.aggregator=new n(this.schema,this.options)}this.aggregator.addObjectRow(e)}chunkComplete(e){e instanceof ArrayBuffer&&(this.bytesUsed+=e.byteLength),typeof e=="string"&&(this.bytesUsed+=e.length),this.isChunkComplete=!0}getFullBatch(e){return this._isFull()?this._getBatch(e):null}getFinalBatch(e){return this._getBatch(e)}_estimateRowMB(e){return Array.isArray(e)?e.length*8:Object.keys(e).length*8}_isFull(){if(!this.aggregator||this.aggregator.rowCount()===0)return!1;if(this.options.batchSize==="auto"){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs?!1:(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(e){if(!this.aggregator)return null;e!=null&&e.bytesUsed&&(this.bytesUsed=e.bytesUsed);const n=this.aggregator.getBatch();return n.count=this.batchCount,n.bytesUsed=this.bytesUsed,Object.assign(n,e),this.batchCount++,this.aggregator=null,n}_getTableBatchType(){switch(this.options.shape){case"array-row-table":case"object-row-table":return wD;case"columnar-table":return CD;case"arrow-table":if(!cf.ArrowBatch)throw new Error(RD);return cf.ArrowBatch;default:return bD}}};M(cf,"ArrowBatch");let N0=cf;class Ow extends Array{enqueue(e){return this.push(e)}dequeue(){return this.shift()}}class xD{constructor(){M(this,"_values");M(this,"_settlers");M(this,"_closed");this._values=new Ow,this._settlers=new Ow,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[Symbol.asyncIterator](){return this}enqueue(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");const n=this._settlers.dequeue();e instanceof Error?n.reject(e):n.resolve({value:e})}else this._values.enqueue(e)}next(){if(this._values.length>0){const e=this._values.dequeue();return e instanceof Error?Promise.reject(e):Promise.resolve({value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((e,n)=>{this._settlers.enqueue({resolve:e,reject:n})})}}async function jh(t,e,n,r){let i,a;!Array.isArray(e)&&!Oy(e)?(i=[],a=e):(i=e,a=n);const l=vR(a);let u=t;return typeof t=="string"&&(u=await l(t)),Wo(t)&&(u=await l(t)),Array.isArray(i)?await Hh(u,i,a):await Hh(u,i,a)}/* @license
|
|
|
Papa Parse
|
|
|
v5.0.0-beta.0
|
|
|
https://github.com/mholt/PapaParse
|
|
|
License: MIT
|
|
|
*/const Pw="\uFEFF";function MD(t,e={},n=PD){e=e||{};var r=e.dynamicTyping||!1;Zi(r)&&(e.dynamicTypingFunction=r,r={}),e.dynamicTyping=r,e.transform=Zi(e.transform)?e.transform:!1;var i=new n(e);return i.stream(t)}function OD(t,e){var n=!1,r=!0,i=",",a=`\r
|
|
|
`,l='"',u=l+l,f=!1,h=null;m();var g=new RegExp(gf(l),"g");if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return v(null,t,f);if(typeof t[0]=="object")return v(h||Object.keys(t[0]),t,f)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:Object.keys(t.data[0])),!Array.isArray(t.data[0])&&typeof t.data[0]!="object"&&(t.data=[t.data])),v(t.fields||[],t.data||[],f);throw new Error("Unable to serialize unrecognized input");function m(){if(typeof e=="object"){if(typeof e.delimiter=="string"&&!Mi.BAD_DELIMITERS.filter(function(E){return e.delimiter.indexOf(E)!==-1}).length&&(i=e.delimiter),(typeof e.quotes=="boolean"||Array.isArray(e.quotes))&&(n=e.quotes),(typeof e.skipEmptyLines=="boolean"||typeof e.skipEmptyLines=="string")&&(f=e.skipEmptyLines),typeof e.newline=="string"&&(a=e.newline),typeof e.quoteChar=="string"&&(l=e.quoteChar),typeof e.header=="boolean"&&(r=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");h=e.columns}e.escapeChar!==void 0&&(u=e.escapeChar+l)}}function v(E,b,C){var T="";typeof E=="string"&&(E=JSON.parse(E)),typeof b=="string"&&(b=JSON.parse(b));var A=Array.isArray(E)&&E.length>0,O=!Array.isArray(b[0]);if(A&&r){for(var x=0;x<E.length;x++)x>0&&(T+=i),T+=S(E[x],x);b.length>0&&(T+=a)}for(var N=0;N<b.length;N++){var F=A?E.length:b[N].length,L=!1,D=A?Object.keys(b[N]).length===0:b[N].length===0;if(C&&!A&&(L=C==="greedy"?b[N].join("").trim()==="":b[N].length===1&&b[N][0].length===0),C==="greedy"&&A){for(var V=[],B=0;B<F;B++){var W=O?E[B]:B;V.push(b[N][W])}L=V.join("").trim()===""}if(!L){for(var X=0;X<F;X++){X>0&&!D&&(T+=i);var Y=A&&O?E[X]:X;T+=S(b[N][Y],X)}N<b.length-1&&(!C||F>0&&!D)&&(T+=a)}}return T}function S(E,b){if(typeof E>"u"||E===null)return"";if(E.constructor===Date)return JSON.stringify(E).slice(1,25);E=E.toString().replace(g,u);var C=typeof n=="boolean"&&n||Array.isArray(n)&&n[b]||w(E,Mi.BAD_DELIMITERS)||E.indexOf(i)>-1||E.charAt(0)===" "||E.charAt(E.length-1)===" ";return C?l+E+l:E}function w(E,b){for(var C=0;C<b.length;C++)if(E.indexOf(b[C])>-1)return!0;return!1}}let bR=class{constructor(e){M(this,"_handle");M(this,"_config");M(this,"_finished",!1);M(this,"_completed",!1);M(this,"_input",null);M(this,"_baseIndex",0);M(this,"_partialLine","");M(this,"_rowCount",0);M(this,"_start",0);M(this,"isFirstChunk",!0);M(this,"_completeResults",{data:[],errors:[],meta:{}});var n={...e};n.chunkSize=parseInt(n.chunkSize),!e.step&&!e.chunk&&(n.chunkSize=null),this._handle=new SR(n),this._handle.streamer=this,this._config=n}parseChunk(e,n){if(this.isFirstChunk&&Zi(this._config.beforeFirstChunk)){var r=this._config.beforeFirstChunk(e);r!==void 0&&(e=r)}this.isFirstChunk=!1;var i=this._partialLine+e;this._partialLine="";var a=this._handle.parse(i,this._baseIndex,!this._finished);if(!(this._handle.paused()||this._handle.aborted())){var l=a.meta.cursor;this._finished||(this._partialLine=i.substring(l-this._baseIndex),this._baseIndex=l),a&&a.data&&(this._rowCount+=a.data.length);var u=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(Zi(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return;a=void 0,this._completeResults=void 0}return!this._config.step&&!this._config.chunk&&(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),!this._completed&&u&&Zi(this._config.complete)&&(!a||!a.meta.aborted)&&(this._config.complete(this._completeResults,this._input),this._completed=!0),a}}_sendError(e){Zi(this._config.error)&&this._config.error(e)}};class PD extends bR{constructor(n={}){super(n);M(this,"remaining")}stream(n){return this.remaining=n,this._nextChunk()}_nextChunk(){if(!this._finished){var n=this._config.chunkSize,r=n?this.remaining.substr(0,n):this.remaining;return this.remaining=n?this.remaining.substr(n):"",this._finished=!this.remaining,this.parseChunk(r)}}}const ND=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,ID=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/;class SR{constructor(e){M(this,"_config");M(this,"_stepCounter",0);M(this,"_rowCounter",0);M(this,"_input");M(this,"_parser");M(this,"_paused",!1);M(this,"_aborted",!1);M(this,"_delimiterError",!1);M(this,"_fields",[]);M(this,"_results",{data:[],errors:[],meta:{}});if(Zi(e.step)){var n=e.step;e.step=r=>{if(this._results=r,this.needsHeaderRow())this.processResults();else{if(this.processResults(),!this._results.data||this._results.data.length===0)return;this._stepCounter+=r.data.length,e.preview&&this._stepCounter>e.preview?this._parser.abort():n(this._results,this)}}}this._config=e}parse(e,n,r){var i=this._config.quoteChar||'"';if(this._config.newline||(this._config.newline=DD(e,i)),this._delimiterError=!1,this._config.delimiter)Zi(this._config.delimiter)&&(this._config.delimiter=this._config.delimiter(e),this._results.meta.delimiter=this._config.delimiter);else{var a=this.guessDelimiter(e,this._config.newline,this._config.skipEmptyLines,this._config.comments,this._config.delimitersToGuess);a.successful?this._config.delimiter=a.bestDelimiter:(this._delimiterError=!0,this._config.delimiter=Mi.DefaultDelimiter),this._results.meta.delimiter=this._config.delimiter}var l=ER(this._config);return this._config.preview&&this._config.header&&l.preview++,this._input=e,this._parser=new I0(l),this._results=this._parser.parse(this._input,n,r),this.processResults(),this._paused?{meta:{paused:!0}}:this._results||{meta:{paused:!1}}}paused(){return this._paused}pause(){this._paused=!0,this._parser.abort(),this._input=this._input.substr(this._parser.getCharIndex())}resume(){this._paused=!1,this.streamer.parseChunk(this._input,!0)}aborted(){return this._aborted}abort(){this._aborted=!0,this._parser.abort(),this._results.meta.aborted=!0,Zi(this._config.complete)&&this._config.complete(this._results),this._input=""}testEmptyLine(e){return this._config.skipEmptyLines==="greedy"?e.join("").trim()==="":e.length===1&&e[0].length===0}processResults(){if(this._results&&this._delimiterError&&(this.addError("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+Mi.DefaultDelimiter+"'"),this._delimiterError=!1),this._config.skipEmptyLines)for(var e=0;e<this._results.data.length;e++)this.testEmptyLine(this._results.data[e])&&this._results.data.splice(e--,1);return this.needsHeaderRow()&&this.fillHeaderFields(),this.applyHeaderAndDynamicTypingAndTransformation()}needsHeaderRow(){return this._config.header&&this._fields.length===0}fillHeaderFields(){if(!this._results)return;const e=r=>{Zi(this._config.transformHeader)&&(r=this._config.transformHeader(r)),this._fields.push(r)};if(Array.isArray(this._results.data[0])){for(var n=0;this.needsHeaderRow()&&n<this._results.data.length;n++)this._results.data[n].forEach(e);this._results.data.splice(0,1)}else this._results.data.forEach(e)}shouldApplyDynamicTyping(e){return this._config.dynamicTypingFunction&&this._config.dynamicTyping[e]===void 0&&(this._config.dynamicTyping[e]=this._config.dynamicTypingFunction(e)),(this._config.dynamicTyping[e]||this._config.dynamicTyping)===!0}parseDynamic(e,n){return this.shouldApplyDynamicTyping(e)?n==="true"||n==="TRUE"?!0:n==="false"||n==="FALSE"?!1:ND.test(n)?parseFloat(n):ID.test(n)?new Date(n):n===""?null:n:n}applyHeaderAndDynamicTypingAndTransformation(){if(!this._results||!this._results.data||!this._config.header&&!this._config.dynamicTyping&&!this._config.transform)return this._results;var e=1;return!this._results.data[0]||Array.isArray(this._results.data[0])?(this._results.data=this._results.data.map(this.processRow.bind(this)),e=this._results.data.length):this._results.data=this.processRow(this._results.data,0),this._config.header&&this._results.meta&&(this._results.meta.fields=this._fields),this._rowCounter+=e,this._results}processRow(e,n){var r=this._config.header?{}:[],i;for(i=0;i<e.length;i++){var a=i,l=e[i];this._config.header&&(a=i>=this._fields.length?"__parsed_extra":this._fields[i]),this._config.transform&&(l=this._config.transform(l,a)),l=this.parseDynamic(a,l),a==="__parsed_extra"?(r[a]=r[a]||[],r[a].push(l)):r[a]=l}return this._config.header&&(i>this._fields.length?this.addError("FieldMismatch","TooManyFields","Too many fields: expected "+this._fields.length+" fields but parsed "+i,this._rowCounter+n):i<this._fields.length&&this.addError("FieldMismatch","TooFewFields","Too few fields: expected "+this._fields.length+" fields but parsed "+i,this._rowCounter+n)),r}guessDelimiter(e,n,r,i,a){var l,u,f;a=a||[","," ","|",";",Mi.RECORD_SEP,Mi.UNIT_SEP];for(var h=0;h<a.length;h++){var g=a[h],m=0,v=0,S=0;f=void 0;for(var w=new I0({comments:i,delimiter:g,newline:n,preview:10}).parse(e),E=0;E<w.data.length;E++){if(r&&this.testEmptyLine(w.data[E])){S++;continue}var b=w.data[E].length;if(v+=b,typeof f>"u"){f=0;continue}else b>1&&(m+=Math.abs(b-f),f=b)}w.data.length>0&&(v/=w.data.length-S),(typeof u>"u"||m>u)&&v>1.99&&(u=m,l=g)}return this._config.delimiter=l,{successful:!!l,bestDelimiter:l}}addError(e,n,r,i){this._results.errors.push({type:e,code:n,message:r,row:i})}}function DD(t,e){t=t.substr(0,1024*1024);var n=new RegExp(gf(e)+"([^]*?)"+gf(e),"gm");t=t.replace(n,"");var r=t.split("\r"),i=t.split(`
|
|
|
`),a=i.length>1&&i[0].length<r[0].length;if(r.length===1||a)return`
|
|
|
`;for(var l=0,u=0;u<r.length;u++)r[u][0]===`
|
|
|
`&&l++;return l>=r.length/2?`\r
|
|
|
`:"\r"}function gf(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function I0(t){t=t||{};var e=t.delimiter,n=t.newline,r=t.comments,i=t.step,a=t.preview,l=t.fastMode,u;t.quoteChar===void 0?u='"':u=t.quoteChar;var f=u;if(t.escapeChar!==void 0&&(f=t.escapeChar),(typeof e!="string"||Mi.BAD_DELIMITERS.indexOf(e)>-1)&&(e=","),r===e)throw new Error("Comment character same as delimiter");r===!0?r="#":(typeof r!="string"||Mi.BAD_DELIMITERS.indexOf(r)>-1)&&(r=!1),n!==`
|
|
|
`&&n!=="\r"&&n!==`\r
|
|
|
`&&(n=`
|
|
|
`);var h=0,g=!1;this.parse=function(m,v,S){if(typeof m!="string")throw new Error("Input must be a string");var w=m.length,E=e.length,b=n.length,C=r.length,T=Zi(i);h=0;var A=[],O=[],x=[],N=0;if(!m)return $();if(l||l!==!1&&m.indexOf(u)===-1){for(var F=m.split(n),L=0;L<F.length;L++){const se=F[L];if(h+=se.length,L!==F.length-1)h+=n.length;else if(S)return $();if(!(r&&se.substr(0,C)===r)){if(T){if(A=[],z(se.split(e)),ie(),g)return $()}else z(se.split(e));if(a&&L>=a)return A=A.slice(0,a),$(!0)}}return $()}for(var D=m.indexOf(e,h),V=m.indexOf(n,h),B=new RegExp(gf(f)+gf(u),"g"),W;;){if(m[h]===u){for(W=h,h++;;){if(W=m.indexOf(u,W+1),W===-1)return S||O.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:A.length,index:h}),Z();if(W===w-1){var X=m.substring(h,W).replace(B,u);return Z(X)}if(u===f&&m[W+1]===f){W++;continue}if(!(u!==f&&W!==0&&m[W-1]===f)){var Y=V===-1?D:Math.min(D,V),ae=j(Y);if(m[W+1+ae]===e){if(x.push(m.substring(h,W).replace(B,u)),h=W+1+ae+E,D=m.indexOf(e,h),V=m.indexOf(n,h),T&&(ie(),g))return $();if(a&&A.length>=a)return $(!0);break}var U=j(V);if(m.substr(W+1+U,b)===n){if(x.push(m.substring(h,W).replace(B,u)),P(W+1+U+b),D=m.indexOf(e,h),T&&(ie(),g))return $();if(a&&A.length>=a)return $(!0);break}O.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:A.length,index:h}),W++}}if(T&&(ie(),g))return $();if(a&&A.length>=a)return $(!0);continue}if(r&&x.length===0&&m.substr(h,C)===r){if(V===-1)return $();h=V+b,V=m.indexOf(n,h),D=m.indexOf(e,h);continue}if(D!==-1&&(D<V||V===-1)){x.push(m.substring(h,D)),h=D+E,D=m.indexOf(e,h);continue}if(V!==-1){if(x.push(m.substring(h,V)),P(V+b),T&&(ie(),g))return $();if(a&&A.length>=a)return $(!0);continue}break}return Z();function z(se){A.push(se),N=h}function j(se){var q=0;if(se!==-1){var ce=m.substring(W+1,se);ce&&ce.trim()===""&&(q=ce.length)}return q}function Z(se){return S||(typeof se>"u"&&(se=m.substr(h)),x.push(se),h=w,z(x),T&&ie()),$()}function P(se){h=se,z(x),x=[],V=m.indexOf(n,h)}function $(se,q){var ce=q||!1;return{data:ce?A[0]:A,errors:O,meta:{delimiter:e,linebreak:n,aborted:g,truncated:!!se,cursor:N+(v||0)}}}function ie(){i($(void 0,!0)),A=[],O=[]}},this.abort=function(){g=!0},this.getCharIndex=function(){return h}}function ER(t){if(typeof t!="object"||t===null)return t;var e=Array.isArray(t)?[]:{};for(var n in t)e[n]=ER(t[n]);return e}function Zi(t){return typeof t=="function"}const Mi={parse:MD,unparse:OD,RECORD_SEP:"",UNIT_SEP:"",BYTE_ORDER_MARK:Pw,BAD_DELIMITERS:["\r",`
|
|
|
`,'"',Pw],WORKERS_SUPPORTED:!1,NODE_STREAM_INPUT:1,LocalChunkSize:1024*1024*10,RemoteChunkSize:1024*1024*5,DefaultDelimiter:",",Parser:I0,ParserHandle:SR,ChunkStreamer:bR},{ChunkStreamer:FD}=Mi;class kD extends FD{constructor(n={}){super(n);M(this,"textDecoder",new TextDecoder(this._config.encoding))}async stream(n){this._input=n;try{for await(const r of n)this.parseChunk(this.getStringChunk(r));this._finished=!0,this.parseChunk("")}catch(r){this._sendError(r)}}_nextChunk(){}getStringChunk(n){return typeof n=="string"?n:this.textDecoder.decode(n,{stream:!0})}}const BD="4.3.2",Ny="object-row-table",Iy={dataType:null,batchType:null,id:"csv",module:"csv",name:"CSV",version:BD,extensions:["csv","tsv","dsv"],mimeTypes:["text/csv","text/tab-separated-values","text/dsv"],category:"table",parse:async(t,e)=>Nw(new TextDecoder().decode(t),e),parseText:(t,e)=>Nw(t,e),parseInBatches:UD,options:{csv:{shape:Ny,optimizeMemoryUsage:!1,header:"auto",columnPrefix:"column",quoteChar:'"',escapeChar:'"',dynamicTyping:!0,comments:!1,skipEmptyLines:!0,delimitersToGuess:[","," ","|",";"]}}};async function Nw(t,e){const n={...Iy.options.csv,...e==null?void 0:e.csv},r=LD(t),a=n.header==="auto"?wR(r):!!n.header,l={...n,header:a,download:!1,transformHeader:a?TR():void 0,error:m=>{throw new Error(m)}},u=Mi.parse(t,l),f=u.data,h=u.meta.fields||CR(n.columnPrefix,r.length),g=n.shape||Ny;switch(g){case"object-row-table":return{shape:"object-row-table",data:f.map(m=>Array.isArray(m)?_R(m,h):m)};case"array-row-table":return{shape:"array-row-table",data:f.map(m=>Array.isArray(m)?m:yR(m,h))};default:throw new Error(g)}}function UD(t,e){e={...e},e.batchSize==="auto"&&(e.batchSize=4e3);const n={...Iy.options.csv,...e==null?void 0:e.csv},r=new xD;let i=!0,a=null,l=null,u=null;const f={...n,header:!1,download:!1,chunkSize:1024*1024*5,skipEmptyLines:!1,step(h){let g=h.data;if(n.skipEmptyLines&&g.flat().join("").trim()==="")return;const m=h.meta.cursor;if(i&&!a&&(n.header==="auto"?wR(g):!!n.header)){a=g.map(TR());return}i&&(i=!1,a||(a=CR(n.columnPrefix,g.length)),u=zD(g,a)),n.optimizeMemoryUsage&&(g=JSON.parse(JSON.stringify(g)));const v=n.shape||Ny;l=l||new N0(u,{shape:v,...e});try{l.addRow(g);const S=l&&l.getFullBatch({bytesUsed:m});S&&r.enqueue(S)}catch(S){r.enqueue(S)}},complete(h){try{const g=h.meta.cursor,m=l&&l.getFinalBatch({bytesUsed:g});m&&r.enqueue(m)}catch(g){r.enqueue(g)}r.close()}};return Mi.parse(t,f,kD),r}function wR(t){return t&&t.every(e=>typeof e=="string")}function LD(t){return Mi.parse(t,{dynamicTyping:!0,preview:1}).data[0]}function TR(){const t=new Set;return e=>{let n=e,r=1;for(;t.has(n);)n=`${e}.${r}`,r++;return t.add(n),n}}function CR(t,e=0){const n=[];for(let r=0;r<e;r++)n.push(`${t}${r+1}`);return n}function zD(t,e){const n=e?{}:[];for(let r=0;r<t.length;r++){const i=e&&e[r]||r;switch(typeof t[r]){case"number":case"boolean":n[i]={name:String(i),index:r,type:Float32Array};break;case"string":default:n[i]={name:String(i),index:r,type:Array}}}return n}var bv={exports:{}};/*!
|
|
|
Copyright (c) 2018 Jed Watson.
|
|
|
Licensed under the MIT License (MIT), see
|
|
|
http://jedwatson.github.io/classnames
|
|
|
*/var Iw;function $D(){return Iw||(Iw=1,function(t){(function(){var e={}.hasOwnProperty;function n(){for(var a="",l=0;l<arguments.length;l++){var u=arguments[l];u&&(a=i(a,r(u)))}return a}function r(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return n.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var l="";for(var u in a)e.call(a,u)&&a[u]&&(l=i(l,u));return l}function i(a,l){return l?a?a+" "+l:a+l:a}t.exports?(n.default=n,t.exports=n):window.classNames=n})()}(bv)),bv.exports}var VD=$D();const Ze=by(VD);function kt(){return kt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},kt.apply(null,arguments)}function pt(t){"@babel/helpers - typeof";return pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pt(t)}var HD=Symbol.for("react.element"),jD=Symbol.for("react.transitional.element"),WD=Symbol.for("react.fragment");function AR(t){return t&&pt(t)==="object"&&(t.$$typeof===HD||t.$$typeof===jD)&&t.type===WD}function Lo(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return Ft.Children.forEach(t,function(r){r==null&&!e.keepEmpty||(Array.isArray(r)?n=n.concat(Lo(r)):AR(r)&&r.props?n=n.concat(Lo(r.props.children,e)):n.push(r))}),n}var D0={},XD=function(e){};function qD(t,e){}function YD(t,e){}function KD(){D0={}}function RR(t,e,n){!e&&!D0[n]&&(t(!1,n),D0[n]=!0)}function kr(t,e){RR(qD,t,e)}function ZD(t,e){RR(YD,t,e)}kr.preMessage=XD;kr.resetWarned=KD;kr.noteOnce=ZD;function QD(t,e){if(pt(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(pt(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xR(t){var e=QD(t,"string");return pt(e)=="symbol"?e:e+""}function K(t,e,n){return(e=xR(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function J(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Dw(Object(n),!0).forEach(function(r){K(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var za=QA();const Fw=by(za);function pf(t){return t instanceof HTMLElement||t instanceof SVGElement}function GD(t){return t&&pt(t)==="object"&&pf(t.nativeElement)?t.nativeElement:pf(t)?t:null}function Gu(t){var e=GD(t);if(e)return e;if(t instanceof Ft.Component){var n;return(n=Fw.findDOMNode)===null||n===void 0?void 0:n.call(Fw,t)}return null}var Sv={exports:{}},an={};/**
|
|
|
* @license React
|
|
|
* react-is.production.min.js
|
|
|
*
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var kw;function JD(){if(kw)return an;kw=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),w;w=Symbol.for("react.module.reference");function E(b){if(typeof b=="object"&&b!==null){var C=b.$$typeof;switch(C){case t:switch(b=b.type,b){case n:case i:case r:case h:case g:return b;default:switch(b=b&&b.$$typeof,b){case u:case l:case f:case v:case m:case a:return b;default:return C}}case e:return C}}}return an.ContextConsumer=l,an.ContextProvider=a,an.Element=t,an.ForwardRef=f,an.Fragment=n,an.Lazy=v,an.Memo=m,an.Portal=e,an.Profiler=i,an.StrictMode=r,an.Suspense=h,an.SuspenseList=g,an.isAsyncMode=function(){return!1},an.isConcurrentMode=function(){return!1},an.isContextConsumer=function(b){return E(b)===l},an.isContextProvider=function(b){return E(b)===a},an.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},an.isForwardRef=function(b){return E(b)===f},an.isFragment=function(b){return E(b)===n},an.isLazy=function(b){return E(b)===v},an.isMemo=function(b){return E(b)===m},an.isPortal=function(b){return E(b)===e},an.isProfiler=function(b){return E(b)===i},an.isStrictMode=function(b){return E(b)===r},an.isSuspense=function(b){return E(b)===h},an.isSuspenseList=function(b){return E(b)===g},an.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===h||b===g||b===S||typeof b=="object"&&b!==null&&(b.$$typeof===v||b.$$typeof===m||b.$$typeof===a||b.$$typeof===l||b.$$typeof===f||b.$$typeof===w||b.getModuleId!==void 0)},an.typeOf=E,an}var Bw;function e4(){return Bw||(Bw=1,Sv.exports=JD()),Sv.exports}var Ev=e4();function Kg(t,e,n){var r=_.useRef({});return(!("value"in r.current)||n(r.current.condition,e))&&(r.current.value=t(),r.current.condition=e),r.current.value}var t4=Number(_.version.split(".")[0]),Dy=function(e,n){typeof e=="function"?e(n):pt(e)==="object"&&e&&"current"in e&&(e.current=n)},Zg=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n.filter(Boolean);return i.length<=1?i[0]:function(a){n.forEach(function(l){Dy(l,a)})}},Qg=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Kg(function(){return Zg.apply(void 0,n)},n,function(i,a){return i.length!==a.length||i.every(function(l,u){return l!==a[u]})})},Gg=function(e){var n,r;if(!e)return!1;if(MR(e)&&t4>=19)return!0;var i=Ev.isMemo(e)?e.type.type:e.type;return!(typeof i=="function"&&!((n=i.prototype)!==null&&n!==void 0&&n.render)&&i.$$typeof!==Ev.ForwardRef||typeof e=="function"&&!((r=e.prototype)!==null&&r!==void 0&&r.render)&&e.$$typeof!==Ev.ForwardRef)};function MR(t){return _.isValidElement(t)&&!AR(t)}var Fy=function(e){if(e&&MR(e)){var n=e;return n.props.propertyIsEnumerable("ref")?n.props.ref:n.ref}return null},F0=_.createContext(null);function n4(t){var e=t.children,n=t.onBatchResize,r=_.useRef(0),i=_.useRef([]),a=_.useContext(F0),l=_.useCallback(function(u,f,h){r.current+=1;var g=r.current;i.current.push({size:u,element:f,data:h}),Promise.resolve().then(function(){g===r.current&&(n==null||n(i.current),i.current=[])}),a==null||a(u,f,h)},[n,a]);return _.createElement(F0.Provider,{value:l},e)}var OR=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(i,a){return i[0]===n?(r=a,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(n,r){var i=t(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,i=t(r,n);~i&&r.splice(i,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,a=this.__entries__;i<a.length;i++){var l=a[i];n.call(r,l[1],l[0])}},e}()}(),k0=typeof window<"u"&&typeof document<"u"&&window.document===document,Wh=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),r4=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Wh):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),i4=2;function s4(t,e){var n=!1,r=!1,i=0;function a(){n&&(n=!1,t()),r&&u()}function l(){r4(a)}function u(){var f=Date.now();if(n){if(f-i<i4)return;r=!0}else n=!0,r=!1,setTimeout(l,e);i=f}return u}var a4=20,o4=["top","right","bottom","left","width","height","size","weight"],l4=typeof MutationObserver<"u",c4=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=s4(this.refresh.bind(this),a4)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!k0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),l4?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!k0||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,i=o4.some(function(a){return!!~r.indexOf(a)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),PR=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},_c=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Wh},NR=Jg(0,0,0,0);function Xh(t){return parseFloat(t)||0}function Uw(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,i){var a=t["border-"+i+"-width"];return r+Xh(a)},0)}function u4(t){for(var e=["top","right","bottom","left"],n={},r=0,i=e;r<i.length;r++){var a=i[r],l=t["padding-"+a];n[a]=Xh(l)}return n}function f4(t){var e=t.getBBox();return Jg(0,0,e.width,e.height)}function d4(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return NR;var r=_c(t).getComputedStyle(t),i=u4(r),a=i.left+i.right,l=i.top+i.bottom,u=Xh(r.width),f=Xh(r.height);if(r.boxSizing==="border-box"&&(Math.round(u+a)!==e&&(u-=Uw(r,"left","right")+a),Math.round(f+l)!==n&&(f-=Uw(r,"top","bottom")+l)),!g4(t)){var h=Math.round(u+a)-e,g=Math.round(f+l)-n;Math.abs(h)!==1&&(u-=h),Math.abs(g)!==1&&(f-=g)}return Jg(i.left,i.top,u,f)}var h4=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof _c(t).SVGGraphicsElement}:function(t){return t instanceof _c(t).SVGElement&&typeof t.getBBox=="function"}}();function g4(t){return t===_c(t).document.documentElement}function p4(t){return k0?h4(t)?f4(t):d4(t):NR}function m4(t){var e=t.x,n=t.y,r=t.width,i=t.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,l=Object.create(a.prototype);return PR(l,{x:e,y:n,width:r,height:i,top:n,right:e+r,bottom:i+n,left:e}),l}function Jg(t,e,n,r){return{x:t,y:e,width:n,height:r}}var v4=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Jg(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=p4(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),_4=function(){function t(e,n){var r=m4(n);PR(this,{target:e,contentRect:r})}return t}(),y4=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new OR,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof _c(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new v4(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof _c(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new _4(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),IR=typeof WeakMap<"u"?new WeakMap:new OR,DR=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=c4.getInstance(),r=new y4(e,n,this);IR.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){DR.prototype[t]=function(){var e;return(e=IR.get(this))[t].apply(e,arguments)}});var b4=function(){return typeof Wh.ResizeObserver<"u"?Wh.ResizeObserver:DR}(),Na=new Map;function S4(t){t.forEach(function(e){var n,r=e.target;(n=Na.get(r))===null||n===void 0||n.forEach(function(i){return i(r)})})}var FR=new b4(S4);function E4(t,e){Na.has(t)||(Na.set(t,new Set),FR.observe(t)),Na.get(t).add(e)}function w4(t,e){Na.has(t)&&(Na.get(t).delete(e),Na.get(t).size||(FR.unobserve(t),Na.delete(t)))}function xr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xR(r.key),r)}}function Mr(t,e,n){return e&&Lw(t.prototype,e),n&&Lw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function mf(t,e){return mf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},mf(t,e)}function Xo(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mf(t,e)}function vf(t){return vf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vf(t)}function ky(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ky=function(){return!!t})()}function Nt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function T4(t,e){if(e&&(pt(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nt(t)}function qo(t){var e=ky();return function(){var n,r=vf(t);if(e){var i=vf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return T4(this,n)}}var C4=function(t){Xo(n,t);var e=qo(n);function n(){return xr(this,n),e.apply(this,arguments)}return Mr(n,[{key:"render",value:function(){return this.props.children}}]),n}(_.Component);function A4(t,e){var n=t.children,r=t.disabled,i=_.useRef(null),a=_.useRef(null),l=_.useContext(F0),u=typeof n=="function",f=u?n(i):n,h=_.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),g=!u&&_.isValidElement(f)&&Gg(f),m=g?Fy(f):null,v=Qg(m,i),S=function(){var C;return Gu(i.current)||(i.current&&pt(i.current)==="object"?Gu((C=i.current)===null||C===void 0?void 0:C.nativeElement):null)||Gu(a.current)};_.useImperativeHandle(e,function(){return S()});var w=_.useRef(t);w.current=t;var E=_.useCallback(function(b){var C=w.current,T=C.onResize,A=C.data,O=b.getBoundingClientRect(),x=O.width,N=O.height,F=b.offsetWidth,L=b.offsetHeight,D=Math.floor(x),V=Math.floor(N);if(h.current.width!==D||h.current.height!==V||h.current.offsetWidth!==F||h.current.offsetHeight!==L){var B={width:D,height:V,offsetWidth:F,offsetHeight:L};h.current=B;var W=F===Math.round(x)?x:F,X=L===Math.round(N)?N:L,Y=J(J({},B),{},{offsetWidth:W,offsetHeight:X});l==null||l(Y,b,A),T&&Promise.resolve().then(function(){T(Y,b)})}},[]);return _.useEffect(function(){var b=S();return b&&!r&&E4(b,E),function(){return w4(b,E)}},[i.current,r]),_.createElement(C4,{ref:a},g?_.cloneElement(f,{ref:v}):f)}var R4=_.forwardRef(A4),x4="rc-observer-key";function M4(t,e){var n=t.children,r=typeof n=="function"?[n]:Lo(n);return r.map(function(i,a){var l=(i==null?void 0:i.key)||"".concat(x4,"-").concat(a);return _.createElement(R4,kt({},t,{key:l,ref:a===0?e:void 0}),i)})}var Yo=_.forwardRef(M4);Yo.Collection=n4;function B0(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function O4(t){if(Array.isArray(t))return B0(t)}function kR(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function By(t,e){if(t){if(typeof t=="string")return B0(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B0(t,e):void 0}}function P4(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ze(t){return O4(t)||kR(t)||By(t)||P4()}var BR=function(e){return+setTimeout(e,16)},UR=function(e){return clearTimeout(e)};typeof window<"u"&&"requestAnimationFrame"in window&&(BR=function(e){return window.requestAnimationFrame(e)},UR=function(e){return window.cancelAnimationFrame(e)});var zw=0,Uy=new Map;function LR(t){Uy.delete(t)}var dr=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;zw+=1;var r=zw;function i(a){if(a===0)LR(r),e();else{var l=BR(function(){i(a-1)});Uy.set(r,l)}}return i(n),r};dr.cancel=function(t){var e=Uy.get(t);return LR(t),UR(e)};function zR(t){if(Array.isArray(t))return t}function N4(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,l,u=[],f=!0,h=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=a.call(n)).done)&&(u.push(r.value),u.length!==e);f=!0);}catch(g){h=!0,i=g}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(h)throw i}}return u}}function $R(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function de(t,e){return zR(t)||N4(t,e)||By(t,e)||$R()}function _f(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Zr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function I4(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}var $w="data-rc-order",Vw="data-rc-priority",D4="rc-util-key",U0=new Map;function VR(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):D4}function ep(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function F4(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function Ly(t){return Array.from((U0.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function HR(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Zr())return null;var n=e.csp,r=e.prepend,i=e.priority,a=i===void 0?0:i,l=F4(r),u=l==="prependQueue",f=document.createElement("style");f.setAttribute($w,l),u&&a&&f.setAttribute(Vw,"".concat(a)),n!=null&&n.nonce&&(f.nonce=n==null?void 0:n.nonce),f.innerHTML=t;var h=ep(e),g=h.firstChild;if(r){if(u){var m=(e.styles||Ly(h)).filter(function(v){if(!["prepend","prependQueue"].includes(v.getAttribute($w)))return!1;var S=Number(v.getAttribute(Vw)||0);return a>=S});if(m.length)return h.insertBefore(f,m[m.length-1].nextSibling),f}h.insertBefore(f,g)}else h.appendChild(f);return f}function jR(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=ep(e);return(e.styles||Ly(n)).find(function(r){return r.getAttribute(VR(e))===t})}function yf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=jR(t,e);if(n){var r=ep(e);r.removeChild(n)}}function k4(t,e){var n=U0.get(t);if(!n||!I4(document,n)){var r=HR("",e),i=r.parentNode;U0.set(t,i),t.removeChild(r)}}function Hs(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=ep(n),i=Ly(r),a=J(J({},n),{},{styles:i});k4(r,a);var l=jR(e,a);if(l){var u,f;if((u=a.csp)!==null&&u!==void 0&&u.nonce&&l.nonce!==((f=a.csp)===null||f===void 0?void 0:f.nonce)){var h;l.nonce=(h=a.csp)===null||h===void 0?void 0:h.nonce}return l.innerHTML!==t&&(l.innerHTML=t),l}var g=HR(t,a);return g.setAttribute(VR(a),e),g}function B4(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Fn(t,e){if(t==null)return{};var n,r,i=B4(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function qh(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(a,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=r.has(a);if(kr(!f,"Warning: There may be circular references"),f)return!1;if(a===l)return!0;if(n&&u>1)return!1;r.add(a);var h=u+1;if(Array.isArray(a)){if(!Array.isArray(l)||a.length!==l.length)return!1;for(var g=0;g<a.length;g++)if(!i(a[g],l[g],h))return!1;return!0}if(a&&l&&pt(a)==="object"&&pt(l)==="object"){var m=Object.keys(a);return m.length!==Object.keys(l).length?!1:m.every(function(v){return i(a[v],l[v],h)})}return!1}return i(t,e)}var U4="%";function L0(t){return t.join(U4)}var L4=function(){function t(e){xr(this,t),K(this,"instanceId",void 0),K(this,"cache",new Map),this.instanceId=e}return Mr(t,[{key:"get",value:function(n){return this.opGet(L0(n))}},{key:"opGet",value:function(n){return this.cache.get(n)||null}},{key:"update",value:function(n,r){return this.opUpdate(L0(n),r)}},{key:"opUpdate",value:function(n,r){var i=this.cache.get(n),a=r(i);a===null?this.cache.delete(n):this.cache.set(n,a)}}]),t}(),yc="data-token-hash",Ji="data-css-hash",Ia="__cssinjs_instance__";function z4(){var t=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var e=document.body.querySelectorAll("style[".concat(Ji,"]"))||[],n=document.head.firstChild;Array.from(e).forEach(function(i){i[Ia]=i[Ia]||t,i[Ia]===t&&document.head.insertBefore(i,n)});var r={};Array.from(document.querySelectorAll("style[".concat(Ji,"]"))).forEach(function(i){var a=i.getAttribute(Ji);if(r[a]){if(i[Ia]===t){var l;(l=i.parentNode)===null||l===void 0||l.removeChild(i)}}else r[a]=!0})}return new L4(t)}var $f=_.createContext({hashPriority:"low",cache:z4(),defaultCache:!0});function $4(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var zy=function(){function t(){xr(this,t),K(this,"cache",void 0),K(this,"keys",void 0),K(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Mr(t,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(n){var r,i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l={map:this.cache};return n.forEach(function(u){if(!l)l=void 0;else{var f;l=(f=l)===null||f===void 0||(f=f.map)===null||f===void 0?void 0:f.get(u)}}),(r=l)!==null&&r!==void 0&&r.value&&a&&(l.value[1]=this.cacheCallTimes++),(i=l)===null||i===void 0?void 0:i.value}},{key:"get",value:function(n){var r;return(r=this.internalGet(n,!0))===null||r===void 0?void 0:r[0]}},{key:"has",value:function(n){return!!this.internalGet(n)}},{key:"set",value:function(n,r){var i=this;if(!this.has(n)){if(this.size()+1>t.MAX_CACHE_SIZE+t.MAX_CACHE_OFFSET){var a=this.keys.reduce(function(h,g){var m=de(h,2),v=m[1];return i.internalGet(g)[1]<v?[g,i.internalGet(g)[1]]:h},[this.keys[0],this.cacheCallTimes]),l=de(a,1),u=l[0];this.delete(u)}this.keys.push(n)}var f=this.cache;n.forEach(function(h,g){if(g===n.length-1)f.set(h,{value:[r,i.cacheCallTimes++]});else{var m=f.get(h);m?m.map||(m.map=new Map):f.set(h,{map:new Map}),f=f.get(h).map}})}},{key:"deleteByPath",value:function(n,r){var i=n.get(r[0]);if(r.length===1){var a;return i.map?n.set(r[0],{map:i.map}):n.delete(r[0]),(a=i.value)===null||a===void 0?void 0:a[0]}var l=this.deleteByPath(i.map,r.slice(1));return(!i.map||i.map.size===0)&&!i.value&&n.delete(r[0]),l}},{key:"delete",value:function(n){if(this.has(n))return this.keys=this.keys.filter(function(r){return!$4(r,n)}),this.deleteByPath(this.cache,n)}}]),t}();K(zy,"MAX_CACHE_SIZE",20);K(zy,"MAX_CACHE_OFFSET",5);var Hw=0,WR=function(){function t(e){xr(this,t),K(this,"derivatives",void 0),K(this,"id",void 0),this.derivatives=Array.isArray(e)?e:[e],this.id=Hw,e.length===0&&(e.length>0,void 0),Hw+=1}return Mr(t,[{key:"getDerivativeToken",value:function(n){return this.derivatives.reduce(function(r,i){return i(n,r)},void 0)}}]),t}(),wv=new zy;function z0(t){var e=Array.isArray(t)?t:[t];return wv.has(e)||wv.set(e,new WR(e)),wv.get(e)}var V4=new WeakMap,Tv={};function H4(t,e){for(var n=V4,r=0;r<e.length;r+=1){var i=e[r];n.has(i)||n.set(i,new WeakMap),n=n.get(i)}return n.has(Tv)||n.set(Tv,t()),n.get(Tv)}var jw=new WeakMap;function Ju(t){var e=jw.get(t)||"";return e||(Object.keys(t).forEach(function(n){var r=t[n];e+=n,r instanceof WR?e+=r.id:r&&pt(r)==="object"?e+=Ju(r):e+=r}),e=_f(e),jw.set(t,e)),e}function Ww(t,e){return _f("".concat(e,"_").concat(Ju(t)))}var $0=Zr();function Rt(t){return typeof t=="number"?"".concat(t,"px"):t}function Yh(t,e,n){var r,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(a)return t;var l=J(J({},i),{},(r={},K(r,yc,e),K(r,Ji,n),r)),u=Object.keys(l).map(function(f){var h=l[f];return h?"".concat(f,'="').concat(h,'"'):null}).filter(function(f){return f}).join(" ");return"<style ".concat(u,">").concat(t,"</style>")}var xh=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(n?"".concat(n,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},j4=function(e,n,r){return Object.keys(e).length?".".concat(n).concat(r!=null&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(e).map(function(i){var a=de(i,2),l=a[0],u=a[1];return"".concat(l,":").concat(u,";")}).join(""),"}"):""},XR=function(e,n,r){var i={},a={};return Object.entries(e).forEach(function(l){var u,f,h=de(l,2),g=h[0],m=h[1];if(r!=null&&(u=r.preserve)!==null&&u!==void 0&&u[g])a[g]=m;else if((typeof m=="string"||typeof m=="number")&&!(r!=null&&(f=r.ignore)!==null&&f!==void 0&&f[g])){var v,S=xh(g,r==null?void 0:r.prefix);i[S]=typeof m=="number"&&!(r!=null&&(v=r.unitless)!==null&&v!==void 0&&v[g])?"".concat(m,"px"):String(m),a[g]="var(".concat(S,")")}}),[a,j4(i,n,{scope:r==null?void 0:r.scope})]},Xw=Zr()?_.useLayoutEffect:_.useEffect,Dn=function(e,n){var r=_.useRef(!0);Xw(function(){return e(r.current)},n),Xw(function(){return r.current=!1,function(){r.current=!0}},[])},qw=function(e,n){Dn(function(r){if(!r)return e()},n)},W4=J({},Xg),Yw=W4.useInsertionEffect,X4=function(e,n,r){_.useMemo(e,r),Dn(function(){return n(!0)},r)},q4=Yw?function(t,e,n){return Yw(function(){return t(),e()},n)}:X4,Y4=J({},Xg),K4=Y4.useInsertionEffect,Z4=function(e){var n=[],r=!1;function i(a){r||n.push(a)}return _.useEffect(function(){return r=!1,function(){r=!0,n.length&&n.forEach(function(a){return a()})}},e),i},Q4=function(){return function(e){e()}},G4=typeof K4<"u"?Z4:Q4;function $y(t,e,n,r,i){var a=_.useContext($f),l=a.cache,u=[t].concat(ze(e)),f=L0(u),h=G4([f]),g=function(w){l.opUpdate(f,function(E){var b=E||[void 0,void 0],C=de(b,2),T=C[0],A=T===void 0?0:T,O=C[1],x=O,N=x||n(),F=[A,N];return w?w(F):F})};_.useMemo(function(){g()},[f]);var m=l.opGet(f),v=m[1];return q4(function(){i==null||i(v)},function(S){return g(function(w){var E=de(w,2),b=E[0],C=E[1];return S&&b===0&&(i==null||i(v)),[b+1,C]}),function(){l.opUpdate(f,function(w){var E=w||[],b=de(E,2),C=b[0],T=C===void 0?0:C,A=b[1],O=T-1;return O===0?(h(function(){(S||!l.opGet(f))&&(r==null||r(A,!1))}),null):[T-1,A]})}},[f]),v}var J4={},e5="css",po=new Map;function t5(t){po.set(t,(po.get(t)||0)+1)}function n5(t,e){if(typeof document<"u"){var n=document.querySelectorAll("style[".concat(yc,'="').concat(t,'"]'));n.forEach(function(r){if(r[Ia]===e){var i;(i=r.parentNode)===null||i===void 0||i.removeChild(r)}})}}var r5=0;function i5(t,e){po.set(t,(po.get(t)||0)-1);var n=Array.from(po.keys()),r=n.filter(function(i){var a=po.get(i)||0;return a<=0});n.length-r.length>r5&&r.forEach(function(i){n5(i,e),po.delete(i)})}var s5=function(e,n,r,i){var a=r.getDerivativeToken(e),l=J(J({},a),n);return i&&(l=i(l)),l},qR="token";function a5(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=_.useContext($f),i=r.cache.instanceId,a=r.container,l=n.salt,u=l===void 0?"":l,f=n.override,h=f===void 0?J4:f,g=n.formatToken,m=n.getComputedToken,v=n.cssVar,S=H4(function(){return Object.assign.apply(Object,[{}].concat(ze(e)))},e),w=Ju(S),E=Ju(h),b=v?Ju(v):"",C=$y(qR,[u,t.id,w,E,b],function(){var T,A=m?m(S,h,t):s5(S,h,t,g),O=J({},A),x="";if(v){var N=XR(A,v.key,{prefix:v.prefix,ignore:v.ignore,unitless:v.unitless,preserve:v.preserve}),F=de(N,2);A=F[0],x=F[1]}var L=Ww(A,u);A._tokenKey=L,O._tokenKey=Ww(O,u);var D=(T=v==null?void 0:v.key)!==null&&T!==void 0?T:L;A._themeKey=D,t5(D);var V="".concat(e5,"-").concat(_f(L));return A._hashId=V,[A,V,O,x,(v==null?void 0:v.key)||""]},function(T){i5(T[0]._themeKey,i)},function(T){var A=de(T,4),O=A[0],x=A[3];if(v&&x){var N=Hs(x,_f("css-variables-".concat(O._themeKey)),{mark:Ji,prepend:"queue",attachTo:a,priority:-999});N[Ia]=i,N.setAttribute(yc,O._themeKey)}});return C}var o5=function(e,n,r){var i=de(e,5),a=i[2],l=i[3],u=i[4],f=r||{},h=f.plain;if(!l)return null;var g=a._tokenKey,m=-999,v={"data-rc-order":"prependQueue","data-rc-priority":"".concat(m)},S=Yh(l,u,g,v,h);return[m,g,S]},l5={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},YR="comm",KR="rule",ZR="decl",c5="@import",u5="@namespace",f5="@keyframes",d5="@layer",QR=Math.abs,Vy=String.fromCharCode;function GR(t){return t.trim()}function Mh(t,e,n){return t.replace(e,n)}function h5(t,e,n){return t.indexOf(e,n)}function Jl(t,e){return t.charCodeAt(e)|0}function bc(t,e,n){return t.slice(e,n)}function us(t){return t.length}function g5(t){return t.length}function nh(t,e){return e.push(t),t}var tp=1,Sc=1,JR=0,Ni=0,ar=0,Bc="";function Hy(t,e,n,r,i,a,l,u){return{value:t,root:e,parent:n,type:r,props:i,children:a,line:tp,column:Sc,length:l,return:"",siblings:u}}function p5(){return ar}function m5(){return ar=Ni>0?Jl(Bc,--Ni):0,Sc--,ar===10&&(Sc=1,tp--),ar}function es(){return ar=Ni<JR?Jl(Bc,Ni++):0,Sc++,ar===10&&(Sc=1,tp++),ar}function Da(){return Jl(Bc,Ni)}function Oh(){return Ni}function np(t,e){return bc(Bc,t,e)}function bf(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function v5(t){return tp=Sc=1,JR=us(Bc=t),Ni=0,[]}function _5(t){return Bc="",t}function Cv(t){return GR(np(Ni-1,V0(t===91?t+2:t===40?t+1:t)))}function y5(t){for(;(ar=Da())&&ar<33;)es();return bf(t)>2||bf(ar)>3?"":" "}function b5(t,e){for(;--e&&es()&&!(ar<48||ar>102||ar>57&&ar<65||ar>70&&ar<97););return np(t,Oh()+(e<6&&Da()==32&&es()==32))}function V0(t){for(;es();)switch(ar){case t:return Ni;case 34:case 39:t!==34&&t!==39&&V0(ar);break;case 40:t===41&&V0(t);break;case 92:es();break}return Ni}function S5(t,e){for(;es()&&t+ar!==57;)if(t+ar===84&&Da()===47)break;return"/*"+np(e,Ni-1)+"*"+Vy(t===47?t:es())}function E5(t){for(;!bf(Da());)es();return np(t,Ni)}function w5(t){return _5(Ph("",null,null,null,[""],t=v5(t),0,[0],t))}function Ph(t,e,n,r,i,a,l,u,f){for(var h=0,g=0,m=l,v=0,S=0,w=0,E=1,b=1,C=1,T=0,A="",O=i,x=a,N=r,F=A;b;)switch(w=T,T=es()){case 40:if(w!=108&&Jl(F,m-1)==58){h5(F+=Mh(Cv(T),"&","&\f"),"&\f",QR(h?u[h-1]:0))!=-1&&(C=-1);break}case 34:case 39:case 91:F+=Cv(T);break;case 9:case 10:case 13:case 32:F+=y5(w);break;case 92:F+=b5(Oh()-1,7);continue;case 47:switch(Da()){case 42:case 47:nh(T5(S5(es(),Oh()),e,n,f),f),(bf(w||1)==5||bf(Da()||1)==5)&&us(F)&&bc(F,-1,void 0)!==" "&&(F+=" ");break;default:F+="/"}break;case 123*E:u[h++]=us(F)*C;case 125*E:case 59:case 0:switch(T){case 0:case 125:b=0;case 59+g:C==-1&&(F=Mh(F,/\f/g,"")),S>0&&(us(F)-m||E===0&&w===47)&&nh(S>32?Zw(F+";",r,n,m-1,f):Zw(Mh(F," ","")+";",r,n,m-2,f),f);break;case 59:F+=";";default:if(nh(N=Kw(F,e,n,h,g,i,u,A,O=[],x=[],m,a),a),T===123)if(g===0)Ph(F,e,N,N,O,a,m,u,x);else{switch(v){case 99:if(Jl(F,3)===110)break;case 108:if(Jl(F,2)===97)break;default:g=0;case 100:case 109:case 115:}g?Ph(t,N,N,r&&nh(Kw(t,N,N,0,0,i,u,A,i,O=[],m,x),x),i,x,m,u,r?O:x):Ph(F,N,N,N,[""],x,0,u,x)}}h=g=S=0,E=C=1,A=F="",m=l;break;case 58:m=1+us(F),S=w;default:if(E<1){if(T==123)--E;else if(T==125&&E++==0&&m5()==125)continue}switch(F+=Vy(T),T*E){case 38:C=g>0?1:(F+="\f",-1);break;case 44:u[h++]=(us(F)-1)*C,C=1;break;case 64:Da()===45&&(F+=Cv(es())),v=Da(),g=m=us(A=F+=E5(Oh())),T++;break;case 45:w===45&&us(F)==2&&(E=0)}}return a}function Kw(t,e,n,r,i,a,l,u,f,h,g,m){for(var v=i-1,S=i===0?a:[""],w=g5(S),E=0,b=0,C=0;E<r;++E)for(var T=0,A=bc(t,v+1,v=QR(b=l[E])),O=t;T<w;++T)(O=GR(b>0?S[T]+" "+A:Mh(A,/&\f/g,S[T])))&&(f[C++]=O);return Hy(t,e,n,i===0?KR:u,f,h,g,m)}function T5(t,e,n,r){return Hy(t,e,n,YR,Vy(p5()),bc(t,2,-2),0,r)}function Zw(t,e,n,r,i){return Hy(t,e,n,ZR,bc(t,0,r),bc(t,r+1,-1),r,i)}function H0(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function C5(t,e,n,r){switch(t.type){case d5:if(t.children.length)break;case c5:case u5:case ZR:return t.return=t.return||t.value;case YR:return"";case f5:return t.return=t.value+"{"+H0(t.children,r)+"}";case KR:if(!us(t.value=t.props.join(",")))return""}return us(n=H0(t.children,r))?t.return=t.value+"{"+n+"}":""}var Qw="data-ant-cssinjs-cache-path",e3="_FILE_STYLE__",No,t3=!0;function A5(){if(!No&&(No={},Zr())){var t=document.createElement("div");t.className=Qw,t.style.position="fixed",t.style.visibility="hidden",t.style.top="-9999px",document.body.appendChild(t);var e=getComputedStyle(t).content||"";e=e.replace(/^"/,"").replace(/"$/,""),e.split(";").forEach(function(i){var a=i.split(":"),l=de(a,2),u=l[0],f=l[1];No[u]=f});var n=document.querySelector("style[".concat(Qw,"]"));if(n){var r;t3=!1,(r=n.parentNode)===null||r===void 0||r.removeChild(n)}document.body.removeChild(t)}}function R5(t){return A5(),!!No[t]}function x5(t){var e=No[t],n=null;if(e&&Zr())if(t3)n=e3;else{var r=document.querySelector("style[".concat(Ji,'="').concat(No[t],'"]'));r?n=r.innerHTML:delete No[t]}return[n,e]}var M5="_skip_check_",n3="_multi_value_";function Nh(t){var e=H0(w5(t),C5);return e.replace(/\{%%%\:[^;];}/g,";")}function O5(t){return pt(t)==="object"&&t&&(M5 in t||n3 in t)}function Gw(t,e,n){if(!e)return t;var r=".".concat(e),i=n==="low"?":where(".concat(r,")"):r,a=t.split(",").map(function(l){var u,f=l.trim().split(/\s+/),h=f[0]||"",g=((u=h.match(/^\w+/))===null||u===void 0?void 0:u[0])||"";return h="".concat(g).concat(i).concat(h.slice(g.length)),[h].concat(ze(f.slice(1))).join(" ")});return a.join(",")}var P5=function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},i=r.root,a=r.injectHash,l=r.parentSelectors,u=n.hashId,f=n.layer;n.path;var h=n.hashPriority,g=n.transformers,m=g===void 0?[]:g;n.linters;var v="",S={};function w(C){var T=C.getName(u);if(!S[T]){var A=t(C.style,n,{root:!1,parentSelectors:l}),O=de(A,1),x=O[0];S[T]="@keyframes ".concat(C.getName(u)).concat(x)}}function E(C){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return C.forEach(function(A){Array.isArray(A)?E(A,T):A&&T.push(A)}),T}var b=E(Array.isArray(e)?e:[e]);return b.forEach(function(C){var T=typeof C=="string"&&!i?{}:C;if(typeof T=="string")v+="".concat(T,`
|
|
|
`);else if(T._keyframe)w(T);else{var A=m.reduce(function(O,x){var N;return(x==null||(N=x.visit)===null||N===void 0?void 0:N.call(x,O))||O},T);Object.keys(A).forEach(function(O){var x=A[O];if(pt(x)==="object"&&x&&(O!=="animationName"||!x._keyframe)&&!O5(x)){var N=!1,F=O.trim(),L=!1;(i||a)&&u?F.startsWith("@")?N=!0:F==="&"?F=Gw("",u,h):F=Gw(O,u,h):i&&!u&&(F==="&"||F==="")&&(F="",L=!0);var D=t(x,n,{root:L,injectHash:N,parentSelectors:[].concat(ze(l),[F])}),V=de(D,2),B=V[0],W=V[1];S=J(J({},S),W),v+="".concat(F).concat(B)}else{let ae=function(U,z){var j=U.replace(/[A-Z]/g,function(P){return"-".concat(P.toLowerCase())}),Z=z;!l5[U]&&typeof Z=="number"&&Z!==0&&(Z="".concat(Z,"px")),U==="animationName"&&z!==null&&z!==void 0&&z._keyframe&&(w(z),Z=z.getName(u)),v+="".concat(j,":").concat(Z,";")};var X,Y=(X=x==null?void 0:x.value)!==null&&X!==void 0?X:x;pt(x)==="object"&&x!==null&&x!==void 0&&x[n3]&&Array.isArray(Y)?Y.forEach(function(U){ae(O,U)}):ae(O,Y)}})}}),i?f&&(v&&(v="@layer ".concat(f.name," {").concat(v,"}")),f.dependencies&&(S["@layer ".concat(f.name)]=f.dependencies.map(function(C){return"@layer ".concat(C,", ").concat(f.name,";")}).join(`
|
|
|
`))):v="{".concat(v,"}"),[v,S]};function r3(t,e){return _f("".concat(t.join("%")).concat(e))}function N5(){return null}var i3="style";function j0(t,e){var n=t.token,r=t.path,i=t.hashId,a=t.layer,l=t.nonce,u=t.clientOnly,f=t.order,h=f===void 0?0:f,g=_.useContext($f),m=g.autoClear;g.mock;var v=g.defaultCache,S=g.hashPriority,w=g.container,E=g.ssrInline,b=g.transformers,C=g.linters,T=g.cache,A=g.layer,O=n._tokenKey,x=[O];A&&x.push("layer"),x.push.apply(x,ze(r));var N=$0,F=$y(i3,x,function(){var W=x.join("|");if(R5(W)){var X=x5(W),Y=de(X,2),ae=Y[0],U=Y[1];if(ae)return[ae,O,U,{},u,h]}var z=e(),j=P5(z,{hashId:i,hashPriority:S,layer:A?a:void 0,path:r.join("-"),transformers:b,linters:C}),Z=de(j,2),P=Z[0],$=Z[1],ie=Nh(P),se=r3(x,ie);return[ie,O,se,$,u,h]},function(W,X){var Y=de(W,3),ae=Y[2];(X||m)&&$0&&yf(ae,{mark:Ji})},function(W){var X=de(W,4),Y=X[0];X[1];var ae=X[2],U=X[3];if(N&&Y!==e3){var z={mark:Ji,prepend:A?!1:"queue",attachTo:w,priority:h},j=typeof l=="function"?l():l;j&&(z.csp={nonce:j});var Z=[],P=[];Object.keys(U).forEach(function(ie){ie.startsWith("@layer")?Z.push(ie):P.push(ie)}),Z.forEach(function(ie){Hs(Nh(U[ie]),"_layer-".concat(ie),J(J({},z),{},{prepend:!0}))});var $=Hs(Y,ae,z);$[Ia]=T.instanceId,$.setAttribute(yc,O),P.forEach(function(ie){Hs(Nh(U[ie]),"_effect-".concat(ie),z)})}}),L=de(F,3),D=L[0],V=L[1],B=L[2];return function(W){var X;if(!E||N||!v)X=_.createElement(N5,null);else{var Y;X=_.createElement("style",kt({},(Y={},K(Y,yc,V),K(Y,Ji,B),Y),{dangerouslySetInnerHTML:{__html:D}}))}return _.createElement(_.Fragment,null,X,W)}}var I5=function(e,n,r){var i=de(e,6),a=i[0],l=i[1],u=i[2],f=i[3],h=i[4],g=i[5],m=r||{},v=m.plain;if(h)return null;var S=a,w={"data-rc-order":"prependQueue","data-rc-priority":"".concat(g)};return S=Yh(a,l,u,w,v),f&&Object.keys(f).forEach(function(E){if(!n[E]){n[E]=!0;var b=Nh(f[E]),C=Yh(b,l,"_effect-".concat(E),w,v);E.startsWith("@layer")?S=C+S:S+=C}}),[g,u,S]},s3="cssVar",D5=function(e,n){var r=e.key,i=e.prefix,a=e.unitless,l=e.ignore,u=e.token,f=e.scope,h=f===void 0?"":f,g=_.useContext($f),m=g.cache.instanceId,v=g.container,S=u._tokenKey,w=[].concat(ze(e.path),[r,h,S]),E=$y(s3,w,function(){var b=n(),C=XR(b,r,{prefix:i,unitless:a,ignore:l,scope:h}),T=de(C,2),A=T[0],O=T[1],x=r3(w,O);return[A,O,x,r]},function(b){var C=de(b,3),T=C[2];$0&&yf(T,{mark:Ji})},function(b){var C=de(b,3),T=C[1],A=C[2];if(T){var O=Hs(T,A,{mark:Ji,prepend:"queue",attachTo:v,priority:-999});O[Ia]=m,O.setAttribute(yc,r)}});return E},F5=function(e,n,r){var i=de(e,4),a=i[1],l=i[2],u=i[3],f=r||{},h=f.plain;if(!a)return null;var g=-999,m={"data-rc-order":"prependQueue","data-rc-priority":"".concat(g)},v=Yh(a,u,l,m,h);return[g,l,v]},ku;ku={},K(ku,i3,I5),K(ku,qR,o5),K(ku,s3,F5);var ln=function(){function t(e,n){xr(this,t),K(this,"name",void 0),K(this,"style",void 0),K(this,"_keyframe",!0),this.name=e,this.style=n}return Mr(t,[{key:"getName",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n?"".concat(n,"-").concat(this.name):this.name}}]),t}();function Il(t){return t.notSplit=!0,t}Il(["borderTop","borderBottom"]),Il(["borderTop"]),Il(["borderBottom"]),Il(["borderLeft","borderRight"]),Il(["borderLeft"]),Il(["borderRight"]);var jy=_.createContext({});function a3(t){return zR(t)||kR(t)||By(t)||$R()}function vs(t,e){for(var n=t,r=0;r<e.length;r+=1){if(n==null)return;n=n[e[r]]}return n}function o3(t,e,n,r){if(!e.length)return n;var i=a3(e),a=i[0],l=i.slice(1),u;return!t&&typeof a=="number"?u=[]:Array.isArray(t)?u=ze(t):u=J({},t),r&&n===void 0&&l.length===1?delete u[a][l[0]]:u[a]=o3(u[a],l,n,r),u}function Xi(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&r&&n===void 0&&!vs(t,e.slice(0,-1))?t:o3(t,e,n,r)}function k5(t){return pt(t)==="object"&&t!==null&&Object.getPrototypeOf(t)===Object.prototype}function Jw(t){return Array.isArray(t)?[]:{}}var B5=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function Hl(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Jw(e[0]);return e.forEach(function(i){function a(l,u){var f=new Set(u),h=vs(i,l),g=Array.isArray(h);if(g||k5(h)){if(!f.has(h)){f.add(h);var m=vs(r,l);g?r=Xi(r,l,[]):(!m||pt(m)!=="object")&&(r=Xi(r,l,Jw(h))),B5(h).forEach(function(v){a([].concat(ze(l),[v]),f)})}}else r=Xi(r,l,h)}a([])}),r}function U5(){}const L5=_.createContext({}),l3=()=>{const t=()=>{};return t.deprecated=U5,t},z5=_.createContext(void 0);var $5={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},V5={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},H5=J(J({},V5),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",week:"Week",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"});const c3={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},eT={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},H5),timePickerLocale:Object.assign({},c3)},ii="${label} is not a valid ${type}",Ec={locale:"en",Pagination:$5,DatePicker:eT,TimePicker:c3,Calendar:eT,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckAll:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:ii,method:ii,array:ii,object:ii,number:ii,date:ii,boolean:ii,integer:ii,float:ii,regexp:ii,email:ii,url:ii,hex:ii},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};Object.assign({},Ec.Modal);let Ih=[];const tT=()=>Ih.reduce((t,e)=>Object.assign(Object.assign({},t),e),Ec.Modal);function j5(t){if(t){const e=Object.assign({},t);return Ih.push(e),tT(),()=>{Ih=Ih.filter(n=>n!==e),tT()}}Object.assign({},Ec.Modal)}const Wy=_.createContext(void 0),Xy=(t,e)=>{const n=_.useContext(Wy),r=_.useMemo(()=>{var a;const l=Ec[t],u=(a=n==null?void 0:n[t])!==null&&a!==void 0?a:{};return Object.assign(Object.assign({},typeof l=="function"?l():l),u||{})},[t,e,n]),i=_.useMemo(()=>{const a=n==null?void 0:n.locale;return n!=null&&n.exist&&!a?Ec.locale:a},[n]);return[r,i]},W5="internalMark",X5=t=>{const{locale:e={},children:n,_ANT_MARK__:r}=t;_.useEffect(()=>j5(e==null?void 0:e.Modal),[e]);const i=_.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return _.createElement(Wy.Provider,{value:i},n)},u3={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},Sf=Object.assign(Object.assign({},u3),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
|
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
|
'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),_r=Math.round;function Av(t,e){const n=t.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(i=>parseFloat(i));for(let i=0;i<3;i+=1)r[i]=e(r[i]||0,n[i]||"",i);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const nT=(t,e,n)=>n===0?t:t/100;function Bu(t,e){const n=e||255;return t>n?n:t<0?0:t}class En{constructor(e){K(this,"isValid",!0),K(this,"r",0),K(this,"g",0),K(this,"b",0),K(this,"a",1),K(this,"_h",void 0),K(this,"_s",void 0),K(this,"_l",void 0),K(this,"_v",void 0),K(this,"_max",void 0),K(this,"_min",void 0),K(this,"_brightness",void 0);function n(r){return r[0]in e&&r[1]in e&&r[2]in e}if(e)if(typeof e=="string"){let i=function(a){return r.startsWith(a)};const r=e.trim();/^#?[A-F\d]{3,8}$/i.test(r)?this.fromHexString(r):i("rgb")?this.fromRgbString(r):i("hsl")?this.fromHslString(r):(i("hsv")||i("hsb"))&&this.fromHsvString(r)}else if(e instanceof En)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(n("rgb"))this.r=Bu(e.r),this.g=Bu(e.g),this.b=Bu(e.b),this.a=typeof e.a=="number"?Bu(e.a,1):1;else if(n("hsl"))this.fromHsl(e);else if(n("hsv"))this.fromHsv(e);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const n=this.toHsv();return n.h=e,this._c(n)}getLuminance(){function e(a){const l=a/255;return l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4)}const n=e(this.r),r=e(this.g),i=e(this.b);return .2126*n+.7152*r+.0722*i}getHue(){if(typeof this._h>"u"){const e=this.getMax()-this.getMin();e===0?this._h=0:this._h=_r(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(typeof this._s>"u"){const e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()-e/100;return i<0&&(i=0),this._c({h:n,s:r,l:i,a:this.a})}lighten(e=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()+e/100;return i>1&&(i=1),this._c({h:n,s:r,l:i,a:this.a})}mix(e,n=50){const r=this._c(e),i=n/100,a=u=>(r[u]-this[u])*i+this[u],l={r:_r(a("r")),g:_r(a("g")),b:_r(a("b")),a:_r(a("a")*100)/100};return this._c(l)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const n=this._c(e),r=this.a+n.a*(1-this.a),i=a=>_r((this[a]*this.a+n[a]*n.a*(1-this.a))/r);return this._c({r:i("r"),g:i("g"),b:i("b"),a:r})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const n=(this.r||0).toString(16);e+=n.length===2?n:"0"+n;const r=(this.g||0).toString(16);e+=r.length===2?r:"0"+r;const i=(this.b||0).toString(16);if(e+=i.length===2?i:"0"+i,typeof this.a=="number"&&this.a>=0&&this.a<1){const a=_r(this.a*255).toString(16);e+=a.length===2?a:"0"+a}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),n=_r(this.getSaturation()*100),r=_r(this.getLightness()*100);return this.a!==1?`hsla(${e},${n}%,${r}%,${this.a})`:`hsl(${e},${n}%,${r}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,n,r){const i=this.clone();return i[e]=Bu(n,r),i}_c(e){return new this.constructor(e)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const n=e.replace("#","");function r(i,a){return parseInt(n[i]+n[a||i],16)}n.length<6?(this.r=r(0),this.g=r(1),this.b=r(2),this.a=n[3]?r(3)/255:1):(this.r=r(0,1),this.g=r(2,3),this.b=r(4,5),this.a=n[6]?r(6,7)/255:1)}fromHsl({h:e,s:n,l:r,a:i}){if(this._h=e%360,this._s=n,this._l=r,this.a=typeof i=="number"?i:1,n<=0){const v=_r(r*255);this.r=v,this.g=v,this.b=v}let a=0,l=0,u=0;const f=e/60,h=(1-Math.abs(2*r-1))*n,g=h*(1-Math.abs(f%2-1));f>=0&&f<1?(a=h,l=g):f>=1&&f<2?(a=g,l=h):f>=2&&f<3?(l=h,u=g):f>=3&&f<4?(l=g,u=h):f>=4&&f<5?(a=g,u=h):f>=5&&f<6&&(a=h,u=g);const m=r-h/2;this.r=_r((a+m)*255),this.g=_r((l+m)*255),this.b=_r((u+m)*255)}fromHsv({h:e,s:n,v:r,a:i}){this._h=e%360,this._s=n,this._v=r,this.a=typeof i=="number"?i:1;const a=_r(r*255);if(this.r=a,this.g=a,this.b=a,n<=0)return;const l=e/60,u=Math.floor(l),f=l-u,h=_r(r*(1-n)*255),g=_r(r*(1-n*f)*255),m=_r(r*(1-n*(1-f))*255);switch(u){case 0:this.g=m,this.b=h;break;case 1:this.r=g,this.b=h;break;case 2:this.r=h,this.b=m;break;case 3:this.r=h,this.g=g;break;case 4:this.r=m,this.g=h;break;case 5:default:this.g=h,this.b=g;break}}fromHsvString(e){const n=Av(e,nT);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(e){const n=Av(e,nT);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(e){const n=Av(e,(r,i)=>i.includes("%")?_r(r/100*255):r);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}var rh=2,rT=.16,q5=.05,Y5=.05,K5=.15,f3=5,d3=4,Z5=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function iT(t,e,n){var r;return Math.round(t.h)>=60&&Math.round(t.h)<=240?r=n?Math.round(t.h)-rh*e:Math.round(t.h)+rh*e:r=n?Math.round(t.h)+rh*e:Math.round(t.h)-rh*e,r<0?r+=360:r>=360&&(r-=360),r}function sT(t,e,n){if(t.h===0&&t.s===0)return t.s;var r;return n?r=t.s-rT*e:e===d3?r=t.s+rT:r=t.s+q5*e,r>1&&(r=1),n&&e===f3&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function aT(t,e,n){var r;return n?r=t.v+Y5*e:r=t.v-K5*e,r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function Ef(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=new En(t),i=r.toHsv(),a=f3;a>0;a-=1){var l=new En({h:iT(i,a,!0),s:sT(i,a,!0),v:aT(i,a,!0)});n.push(l)}n.push(r);for(var u=1;u<=d3;u+=1){var f=new En({h:iT(i,u),s:sT(i,u),v:aT(i,u)});n.push(f)}return e.theme==="dark"?Z5.map(function(h){var g=h.index,m=h.amount;return new En(e.backgroundColor||"#141414").mix(n[g],m).toHexString()}):n.map(function(h){return h.toHexString()})}var Rv={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},W0=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];W0.primary=W0[5];var X0=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];X0.primary=X0[5];var q0=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];q0.primary=q0[5];var Y0=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];Y0.primary=Y0[5];var K0=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];K0.primary=K0[5];var Z0=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];Z0.primary=Z0[5];var Q0=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];Q0.primary=Q0[5];var G0=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];G0.primary=G0[5];var Kh=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];Kh.primary=Kh[5];var J0=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];J0.primary=J0[5];var e_=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];e_.primary=e_[5];var t_=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];t_.primary=t_[5];var n_=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];n_.primary=n_[5];var xv={red:W0,volcano:X0,orange:q0,gold:Y0,yellow:K0,lime:Z0,green:Q0,cyan:G0,blue:Kh,geekblue:J0,purple:e_,magenta:t_,grey:n_};function Q5(t,e){let{generateColorPalettes:n,generateNeutralColorPalettes:r}=e;const{colorSuccess:i,colorWarning:a,colorError:l,colorInfo:u,colorPrimary:f,colorBgBase:h,colorTextBase:g}=t,m=n(f),v=n(i),S=n(a),w=n(l),E=n(u),b=r(h,g),C=t.colorLink||t.colorInfo,T=n(C),A=new En(w[1]).mix(new En(w[3]),50).toHexString();return Object.assign(Object.assign({},b),{colorPrimaryBg:m[1],colorPrimaryBgHover:m[2],colorPrimaryBorder:m[3],colorPrimaryBorderHover:m[4],colorPrimaryHover:m[5],colorPrimary:m[6],colorPrimaryActive:m[7],colorPrimaryTextHover:m[8],colorPrimaryText:m[9],colorPrimaryTextActive:m[10],colorSuccessBg:v[1],colorSuccessBgHover:v[2],colorSuccessBorder:v[3],colorSuccessBorderHover:v[4],colorSuccessHover:v[4],colorSuccess:v[6],colorSuccessActive:v[7],colorSuccessTextHover:v[8],colorSuccessText:v[9],colorSuccessTextActive:v[10],colorErrorBg:w[1],colorErrorBgHover:w[2],colorErrorBgFilledHover:A,colorErrorBgActive:w[3],colorErrorBorder:w[3],colorErrorBorderHover:w[4],colorErrorHover:w[5],colorError:w[6],colorErrorActive:w[7],colorErrorTextHover:w[8],colorErrorText:w[9],colorErrorTextActive:w[10],colorWarningBg:S[1],colorWarningBgHover:S[2],colorWarningBorder:S[3],colorWarningBorderHover:S[4],colorWarningHover:S[4],colorWarning:S[6],colorWarningActive:S[7],colorWarningTextHover:S[8],colorWarningText:S[9],colorWarningTextActive:S[10],colorInfoBg:E[1],colorInfoBgHover:E[2],colorInfoBorder:E[3],colorInfoBorderHover:E[4],colorInfoHover:E[4],colorInfo:E[6],colorInfoActive:E[7],colorInfoTextHover:E[8],colorInfoText:E[9],colorInfoTextActive:E[10],colorLinkHover:T[4],colorLink:T[6],colorLinkActive:T[7],colorBgMask:new En("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}const G5=t=>{let e=t,n=t,r=t,i=t;return t<6&&t>=5?e=t+1:t<16&&t>=6?e=t+2:t>=16&&(e=16),t<7&&t>=5?n=4:t<8&&t>=7?n=5:t<14&&t>=8?n=6:t<16&&t>=14?n=7:t>=16&&(n=8),t<6&&t>=2?r=1:t>=6&&(r=2),t>4&&t<8?i=4:t>=8&&(i=6),{borderRadius:t,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:e,borderRadiusOuter:i}};function J5(t){const{motionUnit:e,motionBase:n,borderRadius:r,lineWidth:i}=t;return Object.assign({motionDurationFast:`${(n+e).toFixed(1)}s`,motionDurationMid:`${(n+e*2).toFixed(1)}s`,motionDurationSlow:`${(n+e*3).toFixed(1)}s`,lineWidthBold:i+1},G5(r))}const eF=t=>{const{controlHeight:e}=t;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};function tF(t){return(t+8)/t}function nF(t){const e=new Array(10).fill(null).map((n,r)=>{const i=r-1,a=t*Math.pow(Math.E,i/5),l=r>1?Math.floor(a):Math.ceil(a);return Math.floor(l/2)*2});return e[1]=t,e.map(n=>({size:n,lineHeight:tF(n)}))}const rF=t=>{const e=nF(t),n=e.map(g=>g.size),r=e.map(g=>g.lineHeight),i=n[1],a=n[0],l=n[2],u=r[1],f=r[0],h=r[2];return{fontSizeSM:a,fontSize:i,fontSizeLG:l,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:u,lineHeightLG:h,lineHeightSM:f,fontHeight:Math.round(u*i),fontHeightLG:Math.round(h*l),fontHeightSM:Math.round(f*a),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function iF(t){const{sizeUnit:e,sizeStep:n}=t;return{sizeXXL:e*(n+8),sizeXL:e*(n+4),sizeLG:e*(n+2),sizeMD:e*(n+1),sizeMS:e*n,size:e*n,sizeSM:e*(n-1),sizeXS:e*(n-2),sizeXXS:e*(n-3)}}const Ti=(t,e)=>new En(t).setA(e).toRgbString(),Uu=(t,e)=>new En(t).darken(e).toHexString(),sF=t=>{const e=Ef(t);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},aF=(t,e)=>{const n=t||"#fff",r=e||"#000";return{colorBgBase:n,colorTextBase:r,colorText:Ti(r,.88),colorTextSecondary:Ti(r,.65),colorTextTertiary:Ti(r,.45),colorTextQuaternary:Ti(r,.25),colorFill:Ti(r,.15),colorFillSecondary:Ti(r,.06),colorFillTertiary:Ti(r,.04),colorFillQuaternary:Ti(r,.02),colorBgSolid:Ti(r,1),colorBgSolidHover:Ti(r,.75),colorBgSolidActive:Ti(r,.95),colorBgLayout:Uu(n,4),colorBgContainer:Uu(n,0),colorBgElevated:Uu(n,0),colorBgSpotlight:Ti(r,.85),colorBgBlur:"transparent",colorBorder:Uu(n,15),colorBorderSecondary:Uu(n,6)}};function oF(t){Rv.pink=Rv.magenta,xv.pink=xv.magenta;const e=Object.keys(u3).map(n=>{const r=t[n]===Rv[n]?xv[n]:Ef(t[n]);return new Array(10).fill(1).reduce((i,a,l)=>(i[`${n}-${l+1}`]=r[l],i[`${n}${l+1}`]=r[l],i),{})}).reduce((n,r)=>(n=Object.assign(Object.assign({},n),r),n),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),e),Q5(t,{generateColorPalettes:sF,generateNeutralColorPalettes:aF})),rF(t.fontSize)),iF(t)),eF(t)),J5(t))}const h3=z0(oF),r_={token:Sf,override:{override:Sf},hashed:!0},g3=Ft.createContext(r_),i_="ant",qy="anticon",lF=["outlined","borderless","filled","underlined"],cF=(t,e)=>e||(t?`${i_}-${t}`:i_),ci=_.createContext({getPrefixCls:cF,iconPrefixCls:qy}),{Consumer:rG}=ci,oT={};function Uc(t){const e=_.useContext(ci),{getPrefixCls:n,direction:r,getPopupContainer:i}=e,a=e[t];return Object.assign(Object.assign({classNames:oT,styles:oT},a),{getPrefixCls:n,direction:r,getPopupContainer:i})}const uF=`-ant-${Date.now()}-${Math.random()}`;function fF(t,e){const n={},r=(l,u)=>{let f=l.clone();return f=(u==null?void 0:u(f))||f,f.toRgbString()},i=(l,u)=>{const f=new En(l),h=Ef(f.toRgbString());n[`${u}-color`]=r(f),n[`${u}-color-disabled`]=h[1],n[`${u}-color-hover`]=h[4],n[`${u}-color-active`]=h[6],n[`${u}-color-outline`]=f.clone().setA(.2).toRgbString(),n[`${u}-color-deprecated-bg`]=h[0],n[`${u}-color-deprecated-border`]=h[2]};if(e.primaryColor){i(e.primaryColor,"primary");const l=new En(e.primaryColor),u=Ef(l.toRgbString());u.forEach((h,g)=>{n[`primary-${g+1}`]=h}),n["primary-color-deprecated-l-35"]=r(l,h=>h.lighten(35)),n["primary-color-deprecated-l-20"]=r(l,h=>h.lighten(20)),n["primary-color-deprecated-t-20"]=r(l,h=>h.tint(20)),n["primary-color-deprecated-t-50"]=r(l,h=>h.tint(50)),n["primary-color-deprecated-f-12"]=r(l,h=>h.setA(h.a*.12));const f=new En(u[0]);n["primary-color-active-deprecated-f-30"]=r(f,h=>h.setA(h.a*.3)),n["primary-color-active-deprecated-d-02"]=r(f,h=>h.darken(2))}return e.successColor&&i(e.successColor,"success"),e.warningColor&&i(e.warningColor,"warning"),e.errorColor&&i(e.errorColor,"error"),e.infoColor&&i(e.infoColor,"info"),`
|
|
|
:root {
|
|
|
${Object.keys(n).map(l=>`--${t}-${l}: ${n[l]};`).join(`
|
|
|
`)}
|
|
|
}
|
|
|
`.trim()}function dF(t,e){const n=fF(t,e);Zr()&&Hs(n,`${uF}-dynamic-theme`)}const wf=_.createContext(!1),hF=t=>{let{children:e,disabled:n}=t;const r=_.useContext(wf);return _.createElement(wf.Provider,{value:n??r},e)},wc=_.createContext(void 0),gF=t=>{let{children:e,size:n}=t;const r=_.useContext(wc);return _.createElement(wc.Provider,{value:n||r},e)};function pF(){const t=_.useContext(wf),e=_.useContext(wc);return{componentDisabled:t,componentSize:e}}var p3=Mr(function t(){xr(this,t)}),m3="CALC_UNIT",mF=new RegExp(m3,"g");function Mv(t){return typeof t=="number"?"".concat(t).concat(m3):t}var vF=function(t){Xo(n,t);var e=qo(n);function n(r,i){var a;xr(this,n),a=e.call(this),K(Nt(a),"result",""),K(Nt(a),"unitlessCssVar",void 0),K(Nt(a),"lowPriority",void 0);var l=pt(r);return a.unitlessCssVar=i,r instanceof n?a.result="(".concat(r.result,")"):l==="number"?a.result=Mv(r):l==="string"&&(a.result=r),a}return Mr(n,[{key:"add",value:function(i){return i instanceof n?this.result="".concat(this.result," + ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," + ").concat(Mv(i))),this.lowPriority=!0,this}},{key:"sub",value:function(i){return i instanceof n?this.result="".concat(this.result," - ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," - ").concat(Mv(i))),this.lowPriority=!0,this}},{key:"mul",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," * ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," * ").concat(i)),this.lowPriority=!1,this}},{key:"div",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," / ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," / ").concat(i)),this.lowPriority=!1,this}},{key:"getResult",value:function(i){return this.lowPriority||i?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(i){var a=this,l=i||{},u=l.unit,f=!0;return typeof u=="boolean"?f=u:Array.from(this.unitlessCssVar).some(function(h){return a.result.includes(h)})&&(f=!1),this.result=this.result.replace(mF,f?"px":""),typeof this.lowPriority<"u"?"calc(".concat(this.result,")"):this.result}}]),n}(p3),_F=function(t){Xo(n,t);var e=qo(n);function n(r){var i;return xr(this,n),i=e.call(this),K(Nt(i),"result",0),r instanceof n?i.result=r.result:typeof r=="number"&&(i.result=r),i}return Mr(n,[{key:"add",value:function(i){return i instanceof n?this.result+=i.result:typeof i=="number"&&(this.result+=i),this}},{key:"sub",value:function(i){return i instanceof n?this.result-=i.result:typeof i=="number"&&(this.result-=i),this}},{key:"mul",value:function(i){return i instanceof n?this.result*=i.result:typeof i=="number"&&(this.result*=i),this}},{key:"div",value:function(i){return i instanceof n?this.result/=i.result:typeof i=="number"&&(this.result/=i),this}},{key:"equal",value:function(){return this.result}}]),n}(p3),yF=function(e,n){var r=e==="css"?vF:_F;return function(i){return new r(i,n)}},lT=function(e,n){return"".concat([n,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function fr(t){var e=_.useRef();e.current=t;var n=_.useCallback(function(){for(var r,i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return(r=e.current)===null||r===void 0?void 0:r.call.apply(r,[e].concat(a))},[]);return n}function Tf(t){var e=_.useRef(!1),n=_.useState(t),r=de(n,2),i=r[0],a=r[1];_.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]);function l(u,f){f&&e.current||a(u)}return[i,l]}function Ov(t){return t!==void 0}function Tc(t,e){var n=e||{},r=n.defaultValue,i=n.value,a=n.onChange,l=n.postState,u=Tf(function(){return Ov(i)?i:Ov(r)?typeof r=="function"?r():r:typeof t=="function"?t():t}),f=de(u,2),h=f[0],g=f[1],m=i!==void 0?i:h,v=l?l(m):m,S=fr(a),w=Tf([m]),E=de(w,2),b=E[0],C=E[1];qw(function(){var A=b[0];h!==A&&S(h,A)},[b]),qw(function(){Ov(i)||g(i)},[i]);var T=fr(function(A,O){g(A,O),C([m],O)});return[v,T]}function cT(t,e,n,r){var i=J({},e[t]);if(r!=null&&r.deprecatedTokens){var a=r.deprecatedTokens;a.forEach(function(u){var f=de(u,2),h=f[0],g=f[1];if(i!=null&&i[h]||i!=null&&i[g]){var m;(m=i[g])!==null&&m!==void 0||(i[g]=i==null?void 0:i[h])}})}var l=J(J({},n),i);return Object.keys(l).forEach(function(u){l[u]===e[u]&&delete l[u]}),l}var v3=typeof CSSINJS_STATISTIC<"u",s_=!0;function ui(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(!v3)return Object.assign.apply(Object,[{}].concat(e));s_=!1;var r={};return e.forEach(function(i){if(pt(i)==="object"){var a=Object.keys(i);a.forEach(function(l){Object.defineProperty(r,l,{configurable:!0,enumerable:!0,get:function(){return i[l]}})})}}),s_=!0,r}var uT={};function bF(){}var SF=function(e){var n,r=e,i=bF;return v3&&typeof Proxy<"u"&&(n=new Set,r=new Proxy(e,{get:function(l,u){if(s_){var f;(f=n)===null||f===void 0||f.add(u)}return l[u]}}),i=function(l,u){var f;uT[l]={global:Array.from(n),component:J(J({},(f=uT[l])===null||f===void 0?void 0:f.component),u)}}),{token:r,keys:n,flush:i}};function fT(t,e,n){if(typeof n=="function"){var r;return n(ui(e,(r=e[t])!==null&&r!==void 0?r:{}))}return n??{}}function EF(t){return t==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return"max(".concat(r.map(function(a){return Rt(a)}).join(","),")")},min:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return"min(".concat(r.map(function(a){return Rt(a)}).join(","),")")}}}var wF=1e3*60*10,TF=function(){function t(){xr(this,t),K(this,"map",new Map),K(this,"objectIDMap",new WeakMap),K(this,"nextID",0),K(this,"lastAccessBeat",new Map),K(this,"accessBeat",0)}return Mr(t,[{key:"set",value:function(n,r){this.clear();var i=this.getCompositeKey(n);this.map.set(i,r),this.lastAccessBeat.set(i,Date.now())}},{key:"get",value:function(n){var r=this.getCompositeKey(n),i=this.map.get(r);return this.lastAccessBeat.set(r,Date.now()),this.accessBeat+=1,i}},{key:"getCompositeKey",value:function(n){var r=this,i=n.map(function(a){return a&&pt(a)==="object"?"obj_".concat(r.getObjectID(a)):"".concat(pt(a),"_").concat(a)});return i.join("|")}},{key:"getObjectID",value:function(n){if(this.objectIDMap.has(n))return this.objectIDMap.get(n);var r=this.nextID;return this.objectIDMap.set(n,r),this.nextID+=1,r}},{key:"clear",value:function(){var n=this;if(this.accessBeat>1e4){var r=Date.now();this.lastAccessBeat.forEach(function(i,a){r-i>wF&&(n.map.delete(a),n.lastAccessBeat.delete(a))}),this.accessBeat=0}}}]),t}(),dT=new TF;function CF(t,e){return Ft.useMemo(function(){var n=dT.get(e);if(n)return n;var r=t();return dT.set(e,r),r},e)}var AF=function(){return{}};function RF(t){var e=t.useCSP,n=e===void 0?AF:e,r=t.useToken,i=t.usePrefix,a=t.getResetStyles,l=t.getCommonStyle,u=t.getCompUnitless;function f(v,S,w,E){var b=Array.isArray(v)?v[0]:v;function C(L){return"".concat(String(b)).concat(L.slice(0,1).toUpperCase()).concat(L.slice(1))}var T=(E==null?void 0:E.unitless)||{},A=typeof u=="function"?u(v):{},O=J(J({},A),{},K({},C("zIndexPopup"),!0));Object.keys(T).forEach(function(L){O[C(L)]=T[L]});var x=J(J({},E),{},{unitless:O,prefixToken:C}),N=g(v,S,w,x),F=h(b,w,x);return function(L){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L,V=N(L,D),B=de(V,2),W=B[1],X=F(D),Y=de(X,2),ae=Y[0],U=Y[1];return[ae,W,U]}}function h(v,S,w){var E=w.unitless,b=w.injectStyle,C=b===void 0?!0:b,T=w.prefixToken,A=w.ignore,O=function(F){var L=F.rootCls,D=F.cssVar,V=D===void 0?{}:D,B=r(),W=B.realToken;return D5({path:[v],prefix:V.prefix,key:V.key,unitless:E,ignore:A,token:W,scope:L},function(){var X=fT(v,W,S),Y=cT(v,W,X,{deprecatedTokens:w==null?void 0:w.deprecatedTokens});return Object.keys(X).forEach(function(ae){Y[T(ae)]=Y[ae],delete Y[ae]}),Y}),null},x=function(F){var L=r(),D=L.cssVar;return[function(V){return C&&D?Ft.createElement(Ft.Fragment,null,Ft.createElement(O,{rootCls:F,cssVar:D,component:v}),V):V},D==null?void 0:D.key]};return x}function g(v,S,w){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},b=Array.isArray(v)?v:[v,v],C=de(b,1),T=C[0],A=b.join("-"),O=t.layer||{name:"antd"};return function(x){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x,F=r(),L=F.theme,D=F.realToken,V=F.hashId,B=F.token,W=F.cssVar,X=i(),Y=X.rootPrefixCls,ae=X.iconPrefixCls,U=n(),z=W?"css":"js",j=CF(function(){var q=new Set;return W&&Object.keys(E.unitless||{}).forEach(function(ce){q.add(xh(ce,W.prefix)),q.add(xh(ce,lT(T,W.prefix)))}),yF(z,q)},[z,T,W==null?void 0:W.prefix]),Z=EF(z),P=Z.max,$=Z.min,ie={theme:L,token:B,hashId:V,nonce:function(){return U.nonce},clientOnly:E.clientOnly,layer:O,order:E.order||-999};typeof a=="function"&&j0(J(J({},ie),{},{clientOnly:!1,path:["Shared",Y]}),function(){return a(B,{prefix:{rootPrefixCls:Y,iconPrefixCls:ae},csp:U})});var se=j0(J(J({},ie),{},{path:[A,x,ae]}),function(){if(E.injectStyle===!1)return[];var q=SF(B),ce=q.token,fe=q.flush,ye=fT(T,D,w),Ee=".".concat(x),Ce=cT(T,D,ye,{deprecatedTokens:E.deprecatedTokens});W&&ye&&pt(ye)==="object"&&Object.keys(ye).forEach(function(_e){ye[_e]="var(".concat(xh(_e,lT(T,W.prefix)),")")});var Te=ui(ce,{componentCls:Ee,prefixCls:x,iconCls:".".concat(ae),antCls:".".concat(Y),calc:j,max:P,min:$},W?ye:Ce),ve=S(Te,{hashId:V,prefixCls:x,rootPrefixCls:Y,iconPrefixCls:ae});fe(T,Ce);var ge=typeof l=="function"?l(Te,x,N,E.resetFont):null;return[E.resetStyle===!1?null:ge,ve]});return[se,V]}}function m(v,S,w){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},b=g(v,S,w,J({resetStyle:!1,order:-998},E)),C=function(A){var O=A.prefixCls,x=A.rootCls,N=x===void 0?O:x;return b(O,N),null};return C}return{genStyleHooks:f,genSubStyleComponent:m,genComponentStyleHook:g}}const Zh=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],xF="5.24.0";function Pv(t){return t>=0&&t<=255}function ih(t,e){const{r:n,g:r,b:i,a}=new En(t).toRgb();if(a<1)return t;const{r:l,g:u,b:f}=new En(e).toRgb();for(let h=.01;h<=1;h+=.01){const g=Math.round((n-l*(1-h))/h),m=Math.round((r-u*(1-h))/h),v=Math.round((i-f*(1-h))/h);if(Pv(g)&&Pv(m)&&Pv(v))return new En({r:g,g:m,b:v,a:Math.round(h*100)/100}).toRgbString()}return new En({r:n,g:r,b:i,a:1}).toRgbString()}var MF=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function _3(t){const{override:e}=t,n=MF(t,["override"]),r=Object.assign({},e);Object.keys(Sf).forEach(v=>{delete r[v]});const i=Object.assign(Object.assign({},n),r),a=480,l=576,u=768,f=992,h=1200,g=1600;if(i.motion===!1){const v="0s";i.motionDurationFast=v,i.motionDurationMid=v,i.motionDurationSlow=v}return Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:ih(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:ih(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:ih(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:i.lineWidth*3,lineWidth:i.lineWidth,controlOutlineWidth:i.lineWidth*2,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:ih(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:`
|
|
|
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
|
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
|
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
|
`,boxShadowSecondary:`
|
|
|
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
|
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
|
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
|
`,boxShadowTertiary:`
|
|
|
0 1px 2px 0 rgba(0, 0, 0, 0.03),
|
|
|
0 1px 6px -1px rgba(0, 0, 0, 0.02),
|
|
|
0 2px 4px 0 rgba(0, 0, 0, 0.02)
|
|
|
`,screenXS:a,screenXSMin:a,screenXSMax:l-1,screenSM:l,screenSMMin:l,screenSMMax:u-1,screenMD:u,screenMDMin:u,screenMDMax:f-1,screenLG:f,screenLGMin:f,screenLGMax:h-1,screenXL:h,screenXLMin:h,screenXLMax:g-1,screenXXL:g,screenXXLMin:g,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:`
|
|
|
0 1px 2px -2px ${new En("rgba(0, 0, 0, 0.16)").toRgbString()},
|
|
|
0 3px 6px 0 ${new En("rgba(0, 0, 0, 0.12)").toRgbString()},
|
|
|
0 5px 12px 4px ${new En("rgba(0, 0, 0, 0.09)").toRgbString()}
|
|
|
`,boxShadowDrawerRight:`
|
|
|
-6px 0 16px 0 rgba(0, 0, 0, 0.08),
|
|
|
-3px 0 6px -4px rgba(0, 0, 0, 0.12),
|
|
|
-9px 0 28px 8px rgba(0, 0, 0, 0.05)
|
|
|
`,boxShadowDrawerLeft:`
|
|
|
6px 0 16px 0 rgba(0, 0, 0, 0.08),
|
|
|
3px 0 6px -4px rgba(0, 0, 0, 0.12),
|
|
|
9px 0 28px 8px rgba(0, 0, 0, 0.05)
|
|
|
`,boxShadowDrawerUp:`
|
|
|
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
|
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
|
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
|
`,boxShadowDrawerDown:`
|
|
|
0 -6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
|
0 -3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
|
0 -9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
|
`,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var hT=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const y3={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},OF={size:!0,sizeSM:!0,sizeLG:!0,sizeMD:!0,sizeXS:!0,sizeXXS:!0,sizeMS:!0,sizeXL:!0,sizeXXL:!0,sizeUnit:!0,sizeStep:!0,motionBase:!0,motionUnit:!0},PF={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},b3=(t,e,n)=>{const r=n.getDerivativeToken(t),{override:i}=e,a=hT(e,["override"]);let l=Object.assign(Object.assign({},r),{override:i});return l=_3(l),a&&Object.entries(a).forEach(u=>{let[f,h]=u;const{theme:g}=h,m=hT(h,["theme"]);let v=m;g&&(v=b3(Object.assign(Object.assign({},l),m),{override:m},g)),l[f]=v}),l};function Ws(){const{token:t,hashed:e,theme:n,override:r,cssVar:i}=Ft.useContext(g3),a=`${xF}-${e||""}`,l=n||h3,[u,f,h]=a5(l,[Sf,t],{salt:a,override:r,getComputedToken:b3,formatToken:_3,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:y3,ignore:OF,preserve:PF}});return[l,h,e?f:"",u,i]}const a_={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Lc=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:t.colorText,fontSize:t.fontSize,lineHeight:t.lineHeight,listStyle:"none",fontFamily:e?"inherit":t.fontFamily}},Yy=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),NF=t=>({a:{color:t.colorLink,textDecoration:t.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${t.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:t.colorLinkHover},"&:active":{color:t.colorLinkActive},"&:active, &:hover":{textDecoration:t.linkHoverDecoration,outline:0},"&:focus":{textDecoration:t.linkFocusDecoration,outline:0},"&[disabled]":{color:t.colorTextDisabled,cursor:"not-allowed"}}}),IF=(t,e,n,r)=>{const i=`[class^="${e}"], [class*=" ${e}"]`,a=n?`.${n}`:i,l={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let u={};return r!==!1&&(u={fontFamily:t.fontFamily,fontSize:t.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},u),l),{[i]:l})}},S3=t=>({[`.${t}`]:Object.assign(Object.assign({},Yy()),{[`.${t} .${t}-icon`]:{display:"block"}})}),{genStyleHooks:zc}=RF({usePrefix:()=>{const{getPrefixCls:t,iconPrefixCls:e}=_.useContext(ci);return{rootPrefixCls:t(),iconPrefixCls:e}},useToken:()=>{const[t,e,n,r,i]=Ws();return{theme:t,realToken:e,hashId:n,token:r,cssVar:i}},useCSP:()=>{const{csp:t}=_.useContext(ci);return t??{}},getResetStyles:(t,e)=>{var n;return[{"&":NF(t)},S3((n=e==null?void 0:e.prefix.iconPrefixCls)!==null&&n!==void 0?n:qy)]},getCommonStyle:IF,getCompUnitless:()=>y3});function DF(t,e){return Zh.reduce((n,r)=>{const i=t[`${r}1`],a=t[`${r}3`],l=t[`${r}6`],u=t[`${r}7`];return Object.assign(Object.assign({},n),e(r,{lightColor:i,lightBorderColor:a,darkColor:l,textColor:u}))},{})}const FF=(t,e)=>{const[n,r]=Ws();return j0({token:r,hashId:"",path:["ant-design-icons",t],nonce:()=>e==null?void 0:e.nonce,layer:{name:"antd"}},()=>[S3(t)])},kF=Object.assign({},Xg),{useId:gT}=kF,BF=()=>"",UF=typeof gT>"u"?BF:gT;function LF(t,e,n){var r;l3();const i=t||{},a=i.inherit===!1||!e?Object.assign(Object.assign({},r_),{hashed:(r=e==null?void 0:e.hashed)!==null&&r!==void 0?r:r_.hashed,cssVar:e==null?void 0:e.cssVar}):e,l=UF();return Kg(()=>{var u,f;if(!t)return e;const h=Object.assign({},a.components);Object.keys(t.components||{}).forEach(v=>{h[v]=Object.assign(Object.assign({},h[v]),t.components[v])});const g=`css-var-${l.replace(/:/g,"")}`,m=((u=i.cssVar)!==null&&u!==void 0?u:a.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof a.cssVar=="object"?a.cssVar:{}),typeof i.cssVar=="object"?i.cssVar:{}),{key:typeof i.cssVar=="object"&&((f=i.cssVar)===null||f===void 0?void 0:f.key)||g});return Object.assign(Object.assign(Object.assign({},a),i),{token:Object.assign(Object.assign({},a.token),i.token),components:h,cssVar:m})},[i,a],(u,f)=>u.some((h,g)=>{const m=f[g];return!qh(h,m,!0)}))}var zF=["children"],E3=_.createContext({});function $F(t){var e=t.children,n=Fn(t,zF);return _.createElement(E3.Provider,{value:n},e)}var VF=function(t){Xo(n,t);var e=qo(n);function n(){return xr(this,n),e.apply(this,arguments)}return Mr(n,[{key:"render",value:function(){return this.props.children}}]),n}(_.Component);function HF(t){var e=_.useReducer(function(u){return u+1},0),n=de(e,2),r=n[1],i=_.useRef(t),a=fr(function(){return i.current}),l=fr(function(u){i.current=typeof u=="function"?u(i.current):u,r()});return[a,l]}var Sa="none",sh="appear",ah="enter",oh="leave",pT="none",qi="prepare",jl="start",Wl="active",Ky="end",w3="prepared";function mT(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit".concat(t)]="webkit".concat(e),n["Moz".concat(t)]="moz".concat(e),n["ms".concat(t)]="MS".concat(e),n["O".concat(t)]="o".concat(e.toLowerCase()),n}function jF(t,e){var n={animationend:mT("Animation","AnimationEnd"),transitionend:mT("Transition","TransitionEnd")};return t&&("AnimationEvent"in e||delete n.animationend.animation,"TransitionEvent"in e||delete n.transitionend.transition),n}var WF=jF(Zr(),typeof window<"u"?window:{}),T3={};if(Zr()){var XF=document.createElement("div");T3=XF.style}var lh={};function C3(t){if(lh[t])return lh[t];var e=WF[t];if(e)for(var n=Object.keys(e),r=n.length,i=0;i<r;i+=1){var a=n[i];if(Object.prototype.hasOwnProperty.call(e,a)&&a in T3)return lh[t]=e[a],lh[t]}return""}var A3=C3("animationend"),R3=C3("transitionend"),x3=!!(A3&&R3),vT=A3||"animationend",_T=R3||"transitionend";function yT(t,e){if(!t)return null;if(pt(t)==="object"){var n=e.replace(/-\w/g,function(r){return r[1].toUpperCase()});return t[n]}return"".concat(t,"-").concat(e)}const qF=function(t){var e=_.useRef();function n(i){i&&(i.removeEventListener(_T,t),i.removeEventListener(vT,t))}function r(i){e.current&&e.current!==i&&n(e.current),i&&i!==e.current&&(i.addEventListener(_T,t),i.addEventListener(vT,t),e.current=i)}return _.useEffect(function(){return function(){n(e.current)}},[]),[r,n]};var M3=Zr()?_.useLayoutEffect:_.useEffect;const YF=function(){var t=_.useRef(null);function e(){dr.cancel(t.current)}function n(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;e();var a=dr(function(){i<=1?r({isCanceled:function(){return a!==t.current}}):n(r,i-1)});t.current=a}return _.useEffect(function(){return function(){e()}},[]),[n,e]};var KF=[qi,jl,Wl,Ky],ZF=[qi,w3],O3=!1,QF=!0;function P3(t){return t===Wl||t===Ky}const GF=function(t,e,n){var r=Tf(pT),i=de(r,2),a=i[0],l=i[1],u=YF(),f=de(u,2),h=f[0],g=f[1];function m(){l(qi,!0)}var v=e?ZF:KF;return M3(function(){if(a!==pT&&a!==Ky){var S=v.indexOf(a),w=v[S+1],E=n(a);E===O3?l(w,!0):w&&h(function(b){function C(){b.isCanceled()||l(w,!0)}E===!0?C():Promise.resolve(E).then(C)})}},[t,a]),_.useEffect(function(){return function(){g()}},[]),[m,a]};function JF(t,e,n,r){var i=r.motionEnter,a=i===void 0?!0:i,l=r.motionAppear,u=l===void 0?!0:l,f=r.motionLeave,h=f===void 0?!0:f,g=r.motionDeadline,m=r.motionLeaveImmediately,v=r.onAppearPrepare,S=r.onEnterPrepare,w=r.onLeavePrepare,E=r.onAppearStart,b=r.onEnterStart,C=r.onLeaveStart,T=r.onAppearActive,A=r.onEnterActive,O=r.onLeaveActive,x=r.onAppearEnd,N=r.onEnterEnd,F=r.onLeaveEnd,L=r.onVisibleChanged,D=Tf(),V=de(D,2),B=V[0],W=V[1],X=HF(Sa),Y=de(X,2),ae=Y[0],U=Y[1],z=Tf(null),j=de(z,2),Z=j[0],P=j[1],$=ae(),ie=_.useRef(!1),se=_.useRef(null);function q(){return n()}var ce=_.useRef(!1);function fe(){U(Sa),P(null,!0)}var ye=fr(function(He){var Ge=ae();if(Ge!==Sa){var Pe=q();if(!(He&&!He.deadline&&He.target!==Pe)){var Me=ce.current,dt;Ge===sh&&Me?dt=x==null?void 0:x(Pe,He):Ge===ah&&Me?dt=N==null?void 0:N(Pe,He):Ge===oh&&Me&&(dt=F==null?void 0:F(Pe,He)),Me&&dt!==!1&&fe()}}}),Ee=qF(ye),Ce=de(Ee,1),Te=Ce[0],ve=function(Ge){switch(Ge){case sh:return K(K(K({},qi,v),jl,E),Wl,T);case ah:return K(K(K({},qi,S),jl,b),Wl,A);case oh:return K(K(K({},qi,w),jl,C),Wl,O);default:return{}}},ge=_.useMemo(function(){return ve($)},[$]),_e=GF($,!t,function(He){if(He===qi){var Ge=ge[qi];return Ge?Ge(q()):O3}if(xe in ge){var Pe;P(((Pe=ge[xe])===null||Pe===void 0?void 0:Pe.call(ge,q(),null))||null)}return xe===Wl&&$!==Sa&&(Te(q()),g>0&&(clearTimeout(se.current),se.current=setTimeout(function(){ye({deadline:!0})},g))),xe===w3&&fe(),QF}),Ie=de(_e,2),we=Ie[0],xe=Ie[1],Ve=P3(xe);ce.current=Ve;var Fe=_.useRef(null);M3(function(){if(!(ie.current&&Fe.current===e)){W(e);var He=ie.current;ie.current=!0;var Ge;!He&&e&&u&&(Ge=sh),He&&e&&a&&(Ge=ah),(He&&!e&&h||!He&&m&&!e&&h)&&(Ge=oh);var Pe=ve(Ge);Ge&&(t||Pe[qi])?(U(Ge),we()):U(Sa),Fe.current=e}},[e]),_.useEffect(function(){($===sh&&!u||$===ah&&!a||$===oh&&!h)&&U(Sa)},[u,a,h]),_.useEffect(function(){return function(){ie.current=!1,clearTimeout(se.current)}},[]);var Be=_.useRef(!1);_.useEffect(function(){B&&(Be.current=!0),B!==void 0&&$===Sa&&((Be.current||B)&&(L==null||L(B)),Be.current=!0)},[B,$]);var nt=Z;return ge[qi]&&xe===jl&&(nt=J({transition:"none"},nt)),[$,xe,nt,B??e]}function ek(t){var e=t;pt(t)==="object"&&(e=t.transitionSupport);function n(i,a){return!!(i.motionName&&e&&a!==!1)}var r=_.forwardRef(function(i,a){var l=i.visible,u=l===void 0?!0:l,f=i.removeOnLeave,h=f===void 0?!0:f,g=i.forceRender,m=i.children,v=i.motionName,S=i.leavedClassName,w=i.eventProps,E=_.useContext(E3),b=E.motion,C=n(i,b),T=_.useRef(),A=_.useRef();function O(){try{return T.current instanceof HTMLElement?T.current:Gu(A.current)}catch{return null}}var x=JF(C,u,O,i),N=de(x,4),F=N[0],L=N[1],D=N[2],V=N[3],B=_.useRef(V);V&&(B.current=!0);var W=_.useCallback(function(j){T.current=j,Dy(a,j)},[a]),X,Y=J(J({},w),{},{visible:u});if(!m)X=null;else if(F===Sa)V?X=m(J({},Y),W):!h&&B.current&&S?X=m(J(J({},Y),{},{className:S}),W):g||!h&&!S?X=m(J(J({},Y),{},{style:{display:"none"}}),W):X=null;else{var ae;L===qi?ae="prepare":P3(L)?ae="active":L===jl&&(ae="start");var U=yT(v,"".concat(F,"-").concat(ae));X=m(J(J({},Y),{},{className:Ze(yT(v,F),K(K({},U,U&&ae),v,typeof v=="string")),style:D}),W)}if(_.isValidElement(X)&&Gg(X)){var z=Fy(X);z||(X=_.cloneElement(X,{ref:W}))}return _.createElement(VF,{ref:A},X)});return r.displayName="CSSMotion",r}const Zy=ek(x3);var o_="add",l_="keep",c_="remove",Nv="removed";function tk(t){var e;return t&&pt(t)==="object"&&"key"in t?e=t:e={key:t},J(J({},e),{},{key:String(e.key)})}function u_(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return t.map(tk)}function nk(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=e.length,a=u_(t),l=u_(e);a.forEach(function(h){for(var g=!1,m=r;m<i;m+=1){var v=l[m];if(v.key===h.key){r<m&&(n=n.concat(l.slice(r,m).map(function(S){return J(J({},S),{},{status:o_})})),r=m),n.push(J(J({},v),{},{status:l_})),r+=1,g=!0;break}}g||n.push(J(J({},h),{},{status:c_}))}),r<i&&(n=n.concat(l.slice(r).map(function(h){return J(J({},h),{},{status:o_})})));var u={};n.forEach(function(h){var g=h.key;u[g]=(u[g]||0)+1});var f=Object.keys(u).filter(function(h){return u[h]>1});return f.forEach(function(h){n=n.filter(function(g){var m=g.key,v=g.status;return m!==h||v!==c_}),n.forEach(function(g){g.key===h&&(g.status=l_)})}),n}var rk=["component","children","onVisibleChanged","onAllRemoved"],ik=["status"],sk=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function ak(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zy,n=function(r){Xo(a,r);var i=qo(a);function a(){var l;xr(this,a);for(var u=arguments.length,f=new Array(u),h=0;h<u;h++)f[h]=arguments[h];return l=i.call.apply(i,[this].concat(f)),K(Nt(l),"state",{keyEntities:[]}),K(Nt(l),"removeKey",function(g){l.setState(function(m){var v=m.keyEntities.map(function(S){return S.key!==g?S:J(J({},S),{},{status:Nv})});return{keyEntities:v}},function(){var m=l.state.keyEntities,v=m.filter(function(S){var w=S.status;return w!==Nv}).length;v===0&&l.props.onAllRemoved&&l.props.onAllRemoved()})}),l}return Mr(a,[{key:"render",value:function(){var u=this,f=this.state.keyEntities,h=this.props,g=h.component,m=h.children,v=h.onVisibleChanged;h.onAllRemoved;var S=Fn(h,rk),w=g||_.Fragment,E={};return sk.forEach(function(b){E[b]=S[b],delete S[b]}),delete S.keys,_.createElement(w,S,f.map(function(b,C){var T=b.status,A=Fn(b,ik),O=T===o_||T===l_;return _.createElement(e,kt({},E,{key:A.key,visible:O,eventProps:A,onVisibleChanged:function(N){v==null||v(N,{key:A.key}),N||u.removeKey(A.key)}}),function(x,N){return m(J(J({},x),{},{index:C}),N)})}))}}],[{key:"getDerivedStateFromProps",value:function(u,f){var h=u.keys,g=f.keyEntities,m=u_(h),v=nk(g,m);return{keyEntities:v.filter(function(S){var w=g.find(function(E){var b=E.key;return S.key===b});return!(w&&w.status===Nv&&S.status===c_)})}}}]),a}(_.Component);return K(n,"defaultProps",{component:"div"}),n}ak(x3);function ok(t){const{children:e}=t,[,n]=Ws(),{motion:r}=n,i=_.useRef(!1);return i.current=i.current||r===!1,i.current?_.createElement($F,{motion:r},e):e}const lk=()=>null;var ck=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const uk=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let N3;function fk(){return N3||i_}function dk(t){return Object.keys(t).some(e=>e.endsWith("Color"))}const hk=t=>{const{prefixCls:e,iconPrefixCls:n,theme:r,holderRender:i}=t;e!==void 0&&(N3=e),r&&dk(r)&&dF(fk(),r)},gk=t=>{const{children:e,csp:n,autoInsertSpaceInButton:r,alert:i,anchor:a,form:l,locale:u,componentSize:f,direction:h,space:g,splitter:m,virtual:v,dropdownMatchSelectWidth:S,popupMatchSelectWidth:w,popupOverflow:E,legacyLocale:b,parentContext:C,iconPrefixCls:T,theme:A,componentDisabled:O,segmented:x,statistic:N,spin:F,calendar:L,carousel:D,cascader:V,collapse:B,typography:W,checkbox:X,descriptions:Y,divider:ae,drawer:U,skeleton:z,steps:j,image:Z,layout:P,list:$,mentions:ie,modal:se,progress:q,result:ce,slider:fe,breadcrumb:ye,menu:Ee,pagination:Ce,input:Te,textArea:ve,empty:ge,badge:_e,radio:Ie,rate:we,switch:xe,transfer:Ve,avatar:Fe,message:Be,tag:nt,table:He,card:Ge,tabs:Pe,timeline:Me,timePicker:dt,upload:rt,notification:it,tree:st,colorPicker:at,datePicker:Je,rangePicker:lt,flex:ft,wave:ct,dropdown:mt,warning:xt,tour:Bt,tooltip:ht,popover:Vt,popconfirm:qt,floatButtonGroup:wn,variant:Mn,inputNumber:Ut,treeSelect:It}=t,Lt=_.useCallback((We,Qe)=>{const{prefixCls:bt}=t;if(Qe)return Qe;const _t=bt||C.getPrefixCls("");return We?`${_t}-${We}`:_t},[C.getPrefixCls,t.prefixCls]),Jt=T||C.iconPrefixCls||qy,Mt=n||C.csp;FF(Jt,Mt);const qe=LF(A,C.theme,{prefixCls:Lt("")}),ke={csp:Mt,autoInsertSpaceInButton:r,alert:i,anchor:a,locale:u||b,direction:h,space:g,splitter:m,virtual:v,popupMatchSelectWidth:w??S,popupOverflow:E,getPrefixCls:Lt,iconPrefixCls:Jt,theme:qe,segmented:x,statistic:N,spin:F,calendar:L,carousel:D,cascader:V,collapse:B,typography:W,checkbox:X,descriptions:Y,divider:ae,drawer:U,skeleton:z,steps:j,image:Z,input:Te,textArea:ve,layout:P,list:$,mentions:ie,modal:se,progress:q,result:ce,slider:fe,breadcrumb:ye,menu:Ee,pagination:Ce,empty:ge,badge:_e,radio:Ie,rate:we,switch:xe,transfer:Ve,avatar:Fe,message:Be,tag:nt,table:He,card:Ge,tabs:Pe,timeline:Me,timePicker:dt,upload:rt,notification:it,tree:st,colorPicker:at,datePicker:Je,rangePicker:lt,flex:ft,wave:ct,dropdown:mt,warning:xt,tour:Bt,tooltip:ht,popover:Vt,popconfirm:qt,floatButtonGroup:wn,variant:Mn,inputNumber:Ut,treeSelect:It},Ne=Object.assign({},C);Object.keys(ke).forEach(We=>{ke[We]!==void 0&&(Ne[We]=ke[We])}),uk.forEach(We=>{const Qe=t[We];Qe&&(Ne[We]=Qe)}),typeof r<"u"&&(Ne.button=Object.assign({autoInsertSpace:r},Ne.button));const Et=Kg(()=>Ne,Ne,(We,Qe)=>{const bt=Object.keys(We),_t=Object.keys(Qe);return bt.length!==_t.length||bt.some(Zt=>We[Zt]!==Qe[Zt])}),{layer:en}=_.useContext($f),Ue=_.useMemo(()=>({prefixCls:Jt,csp:Mt,layer:en?"antd":void 0}),[Jt,Mt,en]);let Oe=_.createElement(_.Fragment,null,_.createElement(lk,{dropdownMatchSelectWidth:S}),e);const je=_.useMemo(()=>{var We,Qe,bt,_t;return Hl(((We=Ec.Form)===null||We===void 0?void 0:We.defaultValidateMessages)||{},((bt=(Qe=Et.locale)===null||Qe===void 0?void 0:Qe.Form)===null||bt===void 0?void 0:bt.defaultValidateMessages)||{},((_t=Et.form)===null||_t===void 0?void 0:_t.validateMessages)||{},(l==null?void 0:l.validateMessages)||{})},[Et,l==null?void 0:l.validateMessages]);Object.keys(je).length>0&&(Oe=_.createElement(z5.Provider,{value:je},Oe)),u&&(Oe=_.createElement(X5,{locale:u,_ANT_MARK__:W5},Oe)),Oe=_.createElement(jy.Provider,{value:Ue},Oe),f&&(Oe=_.createElement(gF,{size:f},Oe)),Oe=_.createElement(ok,null,Oe);const Ye=_.useMemo(()=>{const We=qe||{},{algorithm:Qe,token:bt,components:_t,cssVar:Zt}=We,Yt=ck(We,["algorithm","token","components","cssVar"]),vn=Qe&&(!Array.isArray(Qe)||Qe.length>0)?z0(Qe):h3,On={};Object.entries(_t||{}).forEach(Zn=>{let[un,rn]=Zn;const Ae=Object.assign({},rn);"algorithm"in Ae&&(Ae.algorithm===!0?Ae.theme=vn:(Array.isArray(Ae.algorithm)||typeof Ae.algorithm=="function")&&(Ae.theme=z0(Ae.algorithm)),delete Ae.algorithm),On[un]=Ae});const _n=Object.assign(Object.assign({},Sf),bt);return Object.assign(Object.assign({},Yt),{theme:vn,token:_n,components:On,override:Object.assign({override:_n},On),cssVar:Zt})},[qe]);return A&&(Oe=_.createElement(g3.Provider,{value:Ye},Oe)),Et.warning&&(Oe=_.createElement(L5.Provider,{value:Et.warning},Oe)),O!==void 0&&(Oe=_.createElement(hF,{disabled:O},Oe)),_.createElement(ci.Provider,{value:Et},Oe)},$c=t=>{const e=_.useContext(ci),n=_.useContext(Wy);return _.createElement(gk,Object.assign({parentContext:e,legacyLocale:n},t))};$c.ConfigContext=ci;$c.SizeContext=wc;$c.config=hk;$c.useConfig=pF;Object.defineProperty($c,"SizeContext",{get:()=>wc});function I3(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}function pk(t){return I3(t)instanceof ShadowRoot}function Qh(t){return pk(t)?I3(t):null}function mk(t){return t.replace(/-(.)/g,function(e,n){return n.toUpperCase()})}function vk(t,e){kr(t,"[@ant-design/icons] ".concat(e))}function bT(t){return pt(t)==="object"&&typeof t.name=="string"&&typeof t.theme=="string"&&(pt(t.icon)==="object"||typeof t.icon=="function")}function ST(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(t).reduce(function(e,n){var r=t[n];switch(n){case"class":e.className=r,delete e.class;break;default:delete e[n],e[mk(n)]=r}return e},{})}function f_(t,e,n){return n?Ft.createElement(t.tag,J(J({key:e},ST(t.attrs)),n),(t.children||[]).map(function(r,i){return f_(r,"".concat(e,"-").concat(t.tag,"-").concat(i))})):Ft.createElement(t.tag,J({key:e},ST(t.attrs)),(t.children||[]).map(function(r,i){return f_(r,"".concat(e,"-").concat(t.tag,"-").concat(i))}))}function D3(t){return Ef(t)[0]}function F3(t){return t?Array.isArray(t)?t:[t]:[]}var _k=`
|
|
|
.anticon {
|
|
|
display: inline-flex;
|
|
|
align-items: center;
|
|
|
color: inherit;
|
|
|
font-style: normal;
|
|
|
line-height: 0;
|
|
|
text-align: center;
|
|
|
text-transform: none;
|
|
|
vertical-align: -0.125em;
|
|
|
text-rendering: optimizeLegibility;
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
-moz-osx-font-smoothing: grayscale;
|
|
|
}
|
|
|
|
|
|
.anticon > * {
|
|
|
line-height: 1;
|
|
|
}
|
|
|
|
|
|
.anticon svg {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
|
|
|
.anticon::before {
|
|
|
display: none;
|
|
|
}
|
|
|
|
|
|
.anticon .anticon-icon {
|
|
|
display: block;
|
|
|
}
|
|
|
|
|
|
.anticon[tabindex] {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
.anticon-spin::before,
|
|
|
.anticon-spin {
|
|
|
display: inline-block;
|
|
|
-webkit-animation: loadingCircle 1s infinite linear;
|
|
|
animation: loadingCircle 1s infinite linear;
|
|
|
}
|
|
|
|
|
|
@-webkit-keyframes loadingCircle {
|
|
|
100% {
|
|
|
-webkit-transform: rotate(360deg);
|
|
|
transform: rotate(360deg);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@keyframes loadingCircle {
|
|
|
100% {
|
|
|
-webkit-transform: rotate(360deg);
|
|
|
transform: rotate(360deg);
|
|
|
}
|
|
|
}
|
|
|
`,yk=function(e){var n=_.useContext(jy),r=n.csp,i=n.prefixCls,a=n.layer,l=_k;i&&(l=l.replace(/anticon/g,i)),a&&(l="@layer ".concat(a,` {
|
|
|
`).concat(l,`
|
|
|
}`)),_.useEffect(function(){var u=e.current,f=Qh(u);Hs(l,"@ant-design-icons",{prepend:!a,csp:r,attachTo:f})},[])},bk=["icon","className","onClick","style","primaryColor","secondaryColor"],ef={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function Sk(t){var e=t.primaryColor,n=t.secondaryColor;ef.primaryColor=e,ef.secondaryColor=n||D3(e),ef.calculated=!!n}function Ek(){return J({},ef)}var Vc=function(e){var n=e.icon,r=e.className,i=e.onClick,a=e.style,l=e.primaryColor,u=e.secondaryColor,f=Fn(e,bk),h=_.useRef(),g=ef;if(l&&(g={primaryColor:l,secondaryColor:u||D3(l)}),yk(h),vk(bT(n),"icon should be icon definiton, but got ".concat(n)),!bT(n))return null;var m=n;return m&&typeof m.icon=="function"&&(m=J(J({},m),{},{icon:m.icon(g.primaryColor,g.secondaryColor)})),f_(m.icon,"svg-".concat(m.name),J(J({className:r,onClick:i,style:a,"data-icon":m.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},f),{},{ref:h}))};Vc.displayName="IconReact";Vc.getTwoToneColors=Ek;Vc.setTwoToneColors=Sk;function k3(t){var e=F3(t),n=de(e,2),r=n[0],i=n[1];return Vc.setTwoToneColors({primaryColor:r,secondaryColor:i})}function wk(){var t=Vc.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor}var Tk=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];k3(Kh.primary);var Xs=_.forwardRef(function(t,e){var n=t.className,r=t.icon,i=t.spin,a=t.rotate,l=t.tabIndex,u=t.onClick,f=t.twoToneColor,h=Fn(t,Tk),g=_.useContext(jy),m=g.prefixCls,v=m===void 0?"anticon":m,S=g.rootClassName,w=Ze(S,v,K(K({},"".concat(v,"-").concat(r.name),!!r.name),"".concat(v,"-spin"),!!i||r.name==="loading"),n),E=l;E===void 0&&u&&(E=-1);var b=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,C=F3(f),T=de(C,2),A=T[0],O=T[1];return _.createElement("span",kt({role:"img","aria-label":r.name},h,{ref:e,tabIndex:E,onClick:u,className:w}),_.createElement(Vc,{icon:r,primaryColor:A,secondaryColor:O,style:b}))});Xs.displayName="AntdIcon";Xs.getTwoToneColor=wk;Xs.setTwoToneColor=k3;var Ck={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},Ak=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:Ck}))},Rk=_.forwardRef(Ak),xk={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},Mk=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:xk}))},Ok=_.forwardRef(Mk),Pk=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
|
summary tabIndex target title type useMap value width wmode wrap`,Nk=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Ik="".concat(Pk," ").concat(Nk).split(/[\s\n]+/),Dk="aria-",Fk="data-";function ET(t,e){return t.indexOf(e)===0}function Gh(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;e===!1?n={aria:!0,data:!0,attr:!0}:e===!0?n={aria:!0}:n=J({},e);var r={};return Object.keys(t).forEach(function(i){(n.aria&&(i==="role"||ET(i,Dk))||n.data&&ET(i,Fk)||n.attr&&Ik.includes(i))&&(r[i]=t[i])}),r}function kk(t){return t&&Ft.isValidElement(t)&&t.type===Ft.Fragment}const Bk=(t,e,n)=>Ft.isValidElement(t)?Ft.cloneElement(t,typeof n=="function"?n(t.props||{}):n):e;function B3(t,e){return Bk(t,t,e)}const Uk=t=>{const[,,,,e]=Ws();return e?`${t}-css-var`:""};var et={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,CAPS_LOCK:20,ESC:27,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,N:78,P:80,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,EQUALS:187,WIN_KEY:224},Lk={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},zk=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:Lk}))},$k=_.forwardRef(zk);const U3=Ft.createContext(void 0),co=100,L3={Modal:co,Drawer:co,Popover:co,Popconfirm:co,Tooltip:co,Tour:co,FloatButton:co},Vk={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function Hk(t){return t in L3}const z3=(t,e)=>{const[,n]=Ws(),r=Ft.useContext(U3),i=Hk(t);let a;if(e!==void 0)a=[e,e];else{let l=r??0;i?l+=(r?0:n.zIndexPopupBase)+L3[t]:l+=Vk[t],a=[r===void 0?e:l,l]}return a};function ts(){ts=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(U,z,j){U[z]=j.value},a=typeof Symbol=="function"?Symbol:{},l=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function h(U,z,j){return Object.defineProperty(U,z,{value:j,enumerable:!0,configurable:!0,writable:!0}),U[z]}try{h({},"")}catch{h=function(j,Z,P){return j[Z]=P}}function g(U,z,j,Z){var P=z&&z.prototype instanceof C?z:C,$=Object.create(P.prototype),ie=new Y(Z||[]);return i($,"_invoke",{value:V(U,j,ie)}),$}function m(U,z,j){try{return{type:"normal",arg:U.call(z,j)}}catch(Z){return{type:"throw",arg:Z}}}e.wrap=g;var v="suspendedStart",S="suspendedYield",w="executing",E="completed",b={};function C(){}function T(){}function A(){}var O={};h(O,l,function(){return this});var x=Object.getPrototypeOf,N=x&&x(x(ae([])));N&&N!==n&&r.call(N,l)&&(O=N);var F=A.prototype=C.prototype=Object.create(O);function L(U){["next","throw","return"].forEach(function(z){h(U,z,function(j){return this._invoke(z,j)})})}function D(U,z){function j(P,$,ie,se){var q=m(U[P],U,$);if(q.type!=="throw"){var ce=q.arg,fe=ce.value;return fe&&pt(fe)=="object"&&r.call(fe,"__await")?z.resolve(fe.__await).then(function(ye){j("next",ye,ie,se)},function(ye){j("throw",ye,ie,se)}):z.resolve(fe).then(function(ye){ce.value=ye,ie(ce)},function(ye){return j("throw",ye,ie,se)})}se(q.arg)}var Z;i(this,"_invoke",{value:function($,ie){function se(){return new z(function(q,ce){j($,ie,q,ce)})}return Z=Z?Z.then(se,se):se()}})}function V(U,z,j){var Z=v;return function(P,$){if(Z===w)throw Error("Generator is already running");if(Z===E){if(P==="throw")throw $;return{value:t,done:!0}}for(j.method=P,j.arg=$;;){var ie=j.delegate;if(ie){var se=B(ie,j);if(se){if(se===b)continue;return se}}if(j.method==="next")j.sent=j._sent=j.arg;else if(j.method==="throw"){if(Z===v)throw Z=E,j.arg;j.dispatchException(j.arg)}else j.method==="return"&&j.abrupt("return",j.arg);Z=w;var q=m(U,z,j);if(q.type==="normal"){if(Z=j.done?E:S,q.arg===b)continue;return{value:q.arg,done:j.done}}q.type==="throw"&&(Z=E,j.method="throw",j.arg=q.arg)}}}function B(U,z){var j=z.method,Z=U.iterator[j];if(Z===t)return z.delegate=null,j==="throw"&&U.iterator.return&&(z.method="return",z.arg=t,B(U,z),z.method==="throw")||j!=="return"&&(z.method="throw",z.arg=new TypeError("The iterator does not provide a '"+j+"' method")),b;var P=m(Z,U.iterator,z.arg);if(P.type==="throw")return z.method="throw",z.arg=P.arg,z.delegate=null,b;var $=P.arg;return $?$.done?(z[U.resultName]=$.value,z.next=U.nextLoc,z.method!=="return"&&(z.method="next",z.arg=t),z.delegate=null,b):$:(z.method="throw",z.arg=new TypeError("iterator result is not an object"),z.delegate=null,b)}function W(U){var z={tryLoc:U[0]};1 in U&&(z.catchLoc=U[1]),2 in U&&(z.finallyLoc=U[2],z.afterLoc=U[3]),this.tryEntries.push(z)}function X(U){var z=U.completion||{};z.type="normal",delete z.arg,U.completion=z}function Y(U){this.tryEntries=[{tryLoc:"root"}],U.forEach(W,this),this.reset(!0)}function ae(U){if(U||U===""){var z=U[l];if(z)return z.call(U);if(typeof U.next=="function")return U;if(!isNaN(U.length)){var j=-1,Z=function P(){for(;++j<U.length;)if(r.call(U,j))return P.value=U[j],P.done=!1,P;return P.value=t,P.done=!0,P};return Z.next=Z}}throw new TypeError(pt(U)+" is not iterable")}return T.prototype=A,i(F,"constructor",{value:A,configurable:!0}),i(A,"constructor",{value:T,configurable:!0}),T.displayName=h(A,f,"GeneratorFunction"),e.isGeneratorFunction=function(U){var z=typeof U=="function"&&U.constructor;return!!z&&(z===T||(z.displayName||z.name)==="GeneratorFunction")},e.mark=function(U){return Object.setPrototypeOf?Object.setPrototypeOf(U,A):(U.__proto__=A,h(U,f,"GeneratorFunction")),U.prototype=Object.create(F),U},e.awrap=function(U){return{__await:U}},L(D.prototype),h(D.prototype,u,function(){return this}),e.AsyncIterator=D,e.async=function(U,z,j,Z,P){P===void 0&&(P=Promise);var $=new D(g(U,z,j,Z),P);return e.isGeneratorFunction(z)?$:$.next().then(function(ie){return ie.done?ie.value:$.next()})},L(F),h(F,f,"Generator"),h(F,l,function(){return this}),h(F,"toString",function(){return"[object Generator]"}),e.keys=function(U){var z=Object(U),j=[];for(var Z in z)j.push(Z);return j.reverse(),function P(){for(;j.length;){var $=j.pop();if($ in z)return P.value=$,P.done=!1,P}return P.done=!0,P}},e.values=ae,Y.prototype={constructor:Y,reset:function(z){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(X),!z)for(var j in this)j.charAt(0)==="t"&&r.call(this,j)&&!isNaN(+j.slice(1))&&(this[j]=t)},stop:function(){this.done=!0;var z=this.tryEntries[0].completion;if(z.type==="throw")throw z.arg;return this.rval},dispatchException:function(z){if(this.done)throw z;var j=this;function Z(ce,fe){return ie.type="throw",ie.arg=z,j.next=ce,fe&&(j.method="next",j.arg=t),!!fe}for(var P=this.tryEntries.length-1;P>=0;--P){var $=this.tryEntries[P],ie=$.completion;if($.tryLoc==="root")return Z("end");if($.tryLoc<=this.prev){var se=r.call($,"catchLoc"),q=r.call($,"finallyLoc");if(se&&q){if(this.prev<$.catchLoc)return Z($.catchLoc,!0);if(this.prev<$.finallyLoc)return Z($.finallyLoc)}else if(se){if(this.prev<$.catchLoc)return Z($.catchLoc,!0)}else{if(!q)throw Error("try statement without catch or finally");if(this.prev<$.finallyLoc)return Z($.finallyLoc)}}}},abrupt:function(z,j){for(var Z=this.tryEntries.length-1;Z>=0;--Z){var P=this.tryEntries[Z];if(P.tryLoc<=this.prev&&r.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var $=P;break}}$&&(z==="break"||z==="continue")&&$.tryLoc<=j&&j<=$.finallyLoc&&($=null);var ie=$?$.completion:{};return ie.type=z,ie.arg=j,$?(this.method="next",this.next=$.finallyLoc,b):this.complete(ie)},complete:function(z,j){if(z.type==="throw")throw z.arg;return z.type==="break"||z.type==="continue"?this.next=z.arg:z.type==="return"?(this.rval=this.arg=z.arg,this.method="return",this.next="end"):z.type==="normal"&&j&&(this.next=j),b},finish:function(z){for(var j=this.tryEntries.length-1;j>=0;--j){var Z=this.tryEntries[j];if(Z.finallyLoc===z)return this.complete(Z.completion,Z.afterLoc),X(Z),b}},catch:function(z){for(var j=this.tryEntries.length-1;j>=0;--j){var Z=this.tryEntries[j];if(Z.tryLoc===z){var P=Z.completion;if(P.type==="throw"){var $=P.arg;X(Z)}return $}}throw Error("illegal catch attempt")},delegateYield:function(z,j,Z){return this.delegate={iterator:ae(z),resultName:j,nextLoc:Z},this.method==="next"&&(this.arg=t),b}},e}function wT(t,e,n,r,i,a,l){try{var u=t[a](l),f=u.value}catch(h){return void n(h)}u.done?e(f):Promise.resolve(f).then(r,i)}function Vf(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function l(f){wT(a,r,i,l,u,"next",f)}function u(f){wT(a,r,i,l,u,"throw",f)}l(void 0)})}}const $3=(t,e,n)=>n!==void 0?n:`${t}-${e}`;function V3(t,e){var n=Object.assign({},t);return Array.isArray(e)&&e.forEach(function(r){delete n[r]}),n}const jk=function(t){if(!t)return!1;if(t instanceof Element){if(t.offsetParent)return!0;if(t.getBBox){var e=t.getBBox(),n=e.width,r=e.height;if(n||r)return!0}if(t.getBoundingClientRect){var i=t.getBoundingClientRect(),a=i.width,l=i.height;if(a||l)return!0}}return!1},H3=t=>{const e=Ft.useContext(wc);return Ft.useMemo(()=>t?typeof t=="string"?t??e:t instanceof Function?t(e):e:e,[t,e])},Wk=t=>{const{componentCls:e}=t;return{[e]:{"&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}},Xk=t=>{const{componentCls:e,antCls:n}=t;return{[e]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${e}-item:empty`]:{display:"none"},[`${e}-item > ${n}-badge-not-a-wrapper:only-child`]:{display:"block"}}}},qk=t=>{const{componentCls:e}=t;return{[e]:{"&-gap-row-small":{rowGap:t.spaceGapSmallSize},"&-gap-row-middle":{rowGap:t.spaceGapMiddleSize},"&-gap-row-large":{rowGap:t.spaceGapLargeSize},"&-gap-col-small":{columnGap:t.spaceGapSmallSize},"&-gap-col-middle":{columnGap:t.spaceGapMiddleSize},"&-gap-col-large":{columnGap:t.spaceGapLargeSize}}}},j3=zc("Space",t=>{const e=ui(t,{spaceGapSmallSize:t.paddingXS,spaceGapMiddleSize:t.padding,spaceGapLargeSize:t.paddingLG});return[Xk(e),qk(e),Wk(e)]},()=>({}),{resetStyle:!1});var W3=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const rp=_.createContext(null),Yk=(t,e)=>{const n=_.useContext(rp),r=_.useMemo(()=>{if(!n)return"";const{compactDirection:i,isFirstItem:a,isLastItem:l}=n,u=i==="vertical"?"-vertical-":"-";return Ze(`${t}-compact${u}item`,{[`${t}-compact${u}first-item`]:a,[`${t}-compact${u}last-item`]:l,[`${t}-compact${u}item-rtl`]:e==="rtl"})},[t,e,n]);return{compactSize:n==null?void 0:n.compactSize,compactDirection:n==null?void 0:n.compactDirection,compactItemClassnames:r}},Kk=t=>{const{children:e}=t;return _.createElement(rp.Provider,{value:null},e)},Zk=t=>{const{children:e}=t,n=W3(t,["children"]);return _.createElement(rp.Provider,{value:_.useMemo(()=>n,[n])},e)},Qk=t=>{const{getPrefixCls:e,direction:n}=_.useContext(ci),{size:r,direction:i,block:a,prefixCls:l,className:u,rootClassName:f,children:h}=t,g=W3(t,["size","direction","block","prefixCls","className","rootClassName","children"]),m=H3(A=>r??A),v=e("space-compact",l),[S,w]=j3(v),E=Ze(v,w,{[`${v}-rtl`]:n==="rtl",[`${v}-block`]:a,[`${v}-vertical`]:i==="vertical"},u,f),b=_.useContext(rp),C=Lo(h),T=_.useMemo(()=>C.map((A,O)=>{const x=(A==null?void 0:A.key)||`${v}-item-${O}`;return _.createElement(Zk,{key:x,compactSize:m,compactDirection:i,isFirstItem:O===0&&(!b||(b==null?void 0:b.isFirstItem)),isLastItem:O===C.length-1&&(!b||(b==null?void 0:b.isLastItem))},A)}),[r,C,b]);return C.length===0?null:S(_.createElement("div",Object.assign({className:E},g),T))},Gk=t=>({animationDuration:t,animationFillMode:"both"}),Jk=t=>({animationDuration:t,animationFillMode:"both"}),Qy=function(t,e,n,r){const a=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[`
|
|
|
${a}${t}-enter,
|
|
|
${a}${t}-appear
|
|
|
`]:Object.assign(Object.assign({},Gk(r)),{animationPlayState:"paused"}),[`${a}${t}-leave`]:Object.assign(Object.assign({},Jk(r)),{animationPlayState:"paused"}),[`
|
|
|
${a}${t}-enter${t}-enter-active,
|
|
|
${a}${t}-appear${t}-appear-active
|
|
|
`]:{animationName:e,animationPlayState:"running"},[`${a}${t}-leave${t}-leave-active`]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}},e8=new ln("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),t8=new ln("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),n8=new ln("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),r8=new ln("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),i8=new ln("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),s8=new ln("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),a8=new ln("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),o8=new ln("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),l8={"move-up":{inKeyframes:a8,outKeyframes:o8},"move-down":{inKeyframes:e8,outKeyframes:t8},"move-left":{inKeyframes:n8,outKeyframes:r8},"move-right":{inKeyframes:i8,outKeyframes:s8}},TT=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:a}=l8[e];return[Qy(r,i,a,t.motionDurationMid),{[`
|
|
|
${r}-enter,
|
|
|
${r}-appear
|
|
|
`]:{opacity:0,animationTimingFunction:t.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]},X3=new ln("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),q3=new ln("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),Y3=new ln("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),K3=new ln("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),c8=new ln("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),u8=new ln("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),f8=new ln("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),d8=new ln("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),h8={"slide-up":{inKeyframes:X3,outKeyframes:q3},"slide-down":{inKeyframes:Y3,outKeyframes:K3},"slide-left":{inKeyframes:c8,outKeyframes:u8},"slide-right":{inKeyframes:f8,outKeyframes:d8}},CT=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:a}=h8[e];return[Qy(r,i,a,t.motionDurationMid),{[`
|
|
|
${r}-enter,
|
|
|
${r}-appear
|
|
|
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:t.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInQuint}}]},g8=new ln("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),p8=new ln("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),AT=new ln("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),RT=new ln("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),m8=new ln("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),v8=new ln("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),_8=new ln("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),y8=new ln("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),b8=new ln("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),S8=new ln("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),E8=new ln("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),w8=new ln("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),T8={zoom:{inKeyframes:g8,outKeyframes:p8},"zoom-big":{inKeyframes:AT,outKeyframes:RT},"zoom-big-fast":{inKeyframes:AT,outKeyframes:RT},"zoom-left":{inKeyframes:_8,outKeyframes:y8},"zoom-right":{inKeyframes:b8,outKeyframes:S8},"zoom-up":{inKeyframes:m8,outKeyframes:v8},"zoom-down":{inKeyframes:E8,outKeyframes:w8}},C8=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:a}=T8[e];return[Qy(r,i,a,t.motionDurationFast),{[`
|
|
|
${r}-enter,
|
|
|
${r}-appear
|
|
|
`]:{transform:"scale(0)",opacity:0,animationTimingFunction:t.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]};function A8(t,e,n){const{focusElCls:r,focus:i,borderElCls:a}=n,l=a?"> *":"",u=["hover",i?"focus":null,"active"].filter(Boolean).map(f=>`&:${f} ${l}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:t.calc(t.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[u]:{zIndex:2}},r?{[`&${r}`]:{zIndex:2}}:{}),{[`&[disabled] ${l}`]:{zIndex:0}})}}function R8(t,e,n){const{borderElCls:r}=n,i=r?`> ${r}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${i}, &${t}-sm ${i}, &${t}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${i}, &${t}-sm ${i}, &${t}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function x8(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:n}=t,r=`${n}-compact`;return{[r]:Object.assign(Object.assign({},A8(t,r,e)),R8(n,r,e))}}var Z3=_.createContext(null),xT=[];function M8(t,e){var n=_.useState(function(){if(!Zr())return null;var w=document.createElement("div");return w}),r=de(n,1),i=r[0],a=_.useRef(!1),l=_.useContext(Z3),u=_.useState(xT),f=de(u,2),h=f[0],g=f[1],m=l||(a.current?void 0:function(w){g(function(E){var b=[w].concat(ze(E));return b})});function v(){i.parentElement||document.body.appendChild(i),a.current=!0}function S(){var w;(w=i.parentElement)===null||w===void 0||w.removeChild(i),a.current=!1}return Dn(function(){return t?l?l(v):v():S(),S},[t]),Dn(function(){h.length&&(h.forEach(function(w){return w()}),g(xT))},[h]),[i,m]}function O8(t){var e="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=e;var r=n.style;r.position="absolute",r.left="0",r.top="0",r.width="100px",r.height="100px",r.overflow="scroll";var i,a;if(t){var l=getComputedStyle(t);r.scrollbarColor=l.scrollbarColor,r.scrollbarWidth=l.scrollbarWidth;var u=getComputedStyle(t,"::-webkit-scrollbar"),f=parseInt(u.width,10),h=parseInt(u.height,10);try{var g=f?"width: ".concat(u.width,";"):"",m=h?"height: ".concat(u.height,";"):"";Hs(`
|
|
|
#`.concat(e,`::-webkit-scrollbar {
|
|
|
`).concat(g,`
|
|
|
`).concat(m,`
|
|
|
}`),e)}catch(w){console.error(w),i=f,a=h}}document.body.appendChild(n);var v=t&&i&&!isNaN(i)?i:n.offsetWidth-n.clientWidth,S=t&&a&&!isNaN(a)?a:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),yf(e),{width:v,height:S}}function P8(t){return typeof document>"u"||!t||!(t instanceof Element)?{width:0,height:0}:O8(t)}function N8(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var I8="rc-util-locker-".concat(Date.now()),MT=0;function D8(t){var e=!!t,n=_.useState(function(){return MT+=1,"".concat(I8,"_").concat(MT)}),r=de(n,1),i=r[0];Dn(function(){if(e){var a=P8(document.body).width,l=N8();Hs(`
|
|
|
html body {
|
|
|
overflow-y: hidden;
|
|
|
`.concat(l?"width: calc(100% - ".concat(a,"px);"):"",`
|
|
|
}`),i)}else yf(i);return function(){yf(i)}},[e,i])}var F8=!1;function k8(t){return F8}var OT=function(e){return e===!1?!1:!Zr()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},Q3=_.forwardRef(function(t,e){var n=t.open,r=t.autoLock,i=t.getContainer;t.debug;var a=t.autoDestroy,l=a===void 0?!0:a,u=t.children,f=_.useState(n),h=de(f,2),g=h[0],m=h[1],v=g||n;_.useEffect(function(){(l||n)&&m(n)},[n,l]);var S=_.useState(function(){return OT(i)}),w=de(S,2),E=w[0],b=w[1];_.useEffect(function(){var B=OT(i);b(B??null)});var C=M8(v&&!E),T=de(C,2),A=T[0],O=T[1],x=E??A;D8(r&&n&&Zr()&&(x===A||x===document.body));var N=null;if(u&&Gg(u)&&e){var F=u;N=F.ref}var L=Qg(N,e);if(!v||!Zr()||E===void 0)return null;var D=x===!1||k8(),V=u;return e&&(V=_.cloneElement(u,{ref:L})),_.createElement(Z3.Provider,{value:O},D?V:za.createPortal(V,x))});function B8(){var t=J({},Xg);return t.useId}var PT=0,NT=B8();const G3=NT?function(e){var n=NT();return e||n}:function(e){var n=_.useState("ssr-id"),r=de(n,2),i=r[0],a=r[1];return _.useEffect(function(){var l=PT;PT+=1,a("rc_unique_".concat(l))},[]),e||i};var bo="RC_FORM_INTERNAL_HOOKS",gn=function(){kr(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Cc=_.createContext({getFieldValue:gn,getFieldsValue:gn,getFieldError:gn,getFieldWarning:gn,getFieldsError:gn,isFieldsTouched:gn,isFieldTouched:gn,isFieldValidating:gn,isFieldsValidating:gn,resetFields:gn,setFields:gn,setFieldValue:gn,setFieldsValue:gn,validateFields:gn,submit:gn,getInternalHooks:function(){return gn(),{dispatch:gn,initEntityValue:gn,registerField:gn,useSubscribe:gn,setInitialValues:gn,destroyForm:gn,setCallbacks:gn,registerWatch:gn,getFields:gn,setValidateMessages:gn,setPreserve:gn,getInitialValue:gn}}}),Jh=_.createContext(null);function d_(t){return t==null?[]:Array.isArray(t)?t:[t]}function U8(t){return t&&!!t._init}function h_(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var g_=h_();function L8(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function z8(t,e,n){if(ky())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&mf(i,n.prototype),i}function p_(t){var e=typeof Map=="function"?new Map:void 0;return p_=function(r){if(r===null||!L8(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return z8(r,arguments,vf(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),mf(i,r)},p_(t)}var $8=/%[sdj%]/g,V8=function(){};function m_(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var r=n.field;e[r]=e[r]||[],e[r].push(n)}),e}function li(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=0,a=n.length;if(typeof t=="function")return t.apply(null,n);if(typeof t=="string"){var l=t.replace($8,function(u){if(u==="%%")return"%";if(i>=a)return u;switch(u){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return u}});return l}return t}function H8(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function hr(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||H8(e)&&typeof t=="string"&&!t)}function j8(t,e,n){var r=[],i=0,a=t.length;function l(u){r.push.apply(r,ze(u||[])),i++,i===a&&n(r)}t.forEach(function(u){e(u,l)})}function IT(t,e,n){var r=0,i=t.length;function a(l){if(l&&l.length){n(l);return}var u=r;r=r+1,u<i?e(t[u],a):n([])}a([])}function W8(t){var e=[];return Object.keys(t).forEach(function(n){e.push.apply(e,ze(t[n]||[]))}),e}var DT=function(t){Xo(n,t);var e=qo(n);function n(r,i){var a;return xr(this,n),a=e.call(this,"Async Validation Error"),K(Nt(a),"errors",void 0),K(Nt(a),"fields",void 0),a.errors=r,a.fields=i,a}return Mr(n)}(p_(Error));function X8(t,e,n,r,i){if(e.first){var a=new Promise(function(v,S){var w=function(C){return r(C),C.length?S(new DT(C,m_(C))):v(i)},E=W8(t);IT(E,n,w)});return a.catch(function(v){return v}),a}var l=e.firstFields===!0?Object.keys(t):e.firstFields||[],u=Object.keys(t),f=u.length,h=0,g=[],m=new Promise(function(v,S){var w=function(b){if(g.push.apply(g,b),h++,h===f)return r(g),g.length?S(new DT(g,m_(g))):v(i)};u.length||(r(g),v(i)),u.forEach(function(E){var b=t[E];l.indexOf(E)!==-1?IT(b,n,w):j8(b,n,w)})});return m.catch(function(v){return v}),m}function q8(t){return!!(t&&t.message!==void 0)}function Y8(t,e){for(var n=t,r=0;r<e.length;r++){if(n==null)return n;n=n[e[r]]}return n}function FT(t,e){return function(n){var r;return t.fullFields?r=Y8(e,t.fullFields):r=e[n.field||t.fullField],q8(n)?(n.field=n.field||t.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||t.fullField}}}function kT(t,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];pt(r)==="object"&&pt(t[n])==="object"?t[n]=J(J({},t[n]),r):t[n]=r}}return t}var Dl="enum",K8=function(e,n,r,i,a){e[Dl]=Array.isArray(e[Dl])?e[Dl]:[],e[Dl].indexOf(n)===-1&&i.push(li(a.messages[Dl],e.fullField,e[Dl].join(", ")))},Z8=function(e,n,r,i,a){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(n)||i.push(li(a.messages.pattern.mismatch,e.fullField,n,e.pattern));else if(typeof e.pattern=="string"){var l=new RegExp(e.pattern);l.test(n)||i.push(li(a.messages.pattern.mismatch,e.fullField,n,e.pattern))}}},Q8=function(e,n,r,i,a){var l=typeof e.len=="number",u=typeof e.min=="number",f=typeof e.max=="number",h=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,g=n,m=null,v=typeof n=="number",S=typeof n=="string",w=Array.isArray(n);if(v?m="number":S?m="string":w&&(m="array"),!m)return!1;w&&(g=n.length),S&&(g=n.replace(h,"_").length),l?g!==e.len&&i.push(li(a.messages[m].len,e.fullField,e.len)):u&&!f&&g<e.min?i.push(li(a.messages[m].min,e.fullField,e.min)):f&&!u&&g>e.max?i.push(li(a.messages[m].max,e.fullField,e.max)):u&&f&&(g<e.min||g>e.max)&&i.push(li(a.messages[m].range,e.fullField,e.min,e.max))},J3=function(e,n,r,i,a,l){e.required&&(!r.hasOwnProperty(e.field)||hr(n,l||e.type))&&i.push(li(a.messages.required,e.fullField))},ch;const G8=function(){if(ch)return ch;var t="[a-fA-F\\d:]",e=function(N){return N&&N.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(t,")|(?<=").concat(t,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],a="(?:%[0-9a-zA-Z]{1,})?",l="(?:".concat(i.join("|"),")").concat(a),u=new RegExp("(?:^".concat(n,"$)|(?:^").concat(l,"$)")),f=new RegExp("^".concat(n,"$")),h=new RegExp("^".concat(l,"$")),g=function(N){return N&&N.exact?u:new RegExp("(?:".concat(e(N)).concat(n).concat(e(N),")|(?:").concat(e(N)).concat(l).concat(e(N),")"),"g")};g.v4=function(x){return x&&x.exact?f:new RegExp("".concat(e(x)).concat(n).concat(e(x)),"g")},g.v6=function(x){return x&&x.exact?h:new RegExp("".concat(e(x)).concat(l).concat(e(x)),"g")};var m="(?:(?:[a-z]+:)?//)",v="(?:\\S+(?::\\S*)?@)?",S=g.v4().source,w=g.v6().source,E="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",b="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",C="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",T="(?::\\d{2,5})?",A='(?:[/?#][^\\s"]*)?',O="(?:".concat(m,"|www\\.)").concat(v,"(?:localhost|").concat(S,"|").concat(w,"|").concat(E).concat(b).concat(C,")").concat(T).concat(A);return ch=new RegExp("(?:^".concat(O,"$)"),"i"),ch};var BT={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Xu={integer:function(e){return Xu.number(e)&&parseInt(e,10)===e},float:function(e){return Xu.number(e)&&!Xu.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return pt(e)==="object"&&!Xu.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(BT.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(G8())},hex:function(e){return typeof e=="string"&&!!e.match(BT.hex)}},J8=function(e,n,r,i,a){if(e.required&&n===void 0){J3(e,n,r,i,a);return}var l=["integer","float","array","regexp","object","method","email","number","date","url","hex"],u=e.type;l.indexOf(u)>-1?Xu[u](n)||i.push(li(a.messages.types[u],e.fullField,e.type)):u&&pt(n)!==e.type&&i.push(li(a.messages.types[u],e.fullField,e.type))},eB=function(e,n,r,i,a){(/^\s+$/.test(n)||n==="")&&i.push(li(a.messages.whitespace,e.fullField))};const Ht={required:J3,whitespace:eB,type:J8,range:Q8,enum:K8,pattern:Z8};var tB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a)}r(l)},nB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(n==null&&!e.required)return r();Ht.required(e,n,i,l,a,"array"),n!=null&&(Ht.type(e,n,i,l,a),Ht.range(e,n,i,l,a))}r(l)},rB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&Ht.type(e,n,i,l,a)}r(l)},iB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n,"date")&&!e.required)return r();if(Ht.required(e,n,i,l,a),!hr(n,"date")){var f;n instanceof Date?f=n:f=new Date(n),Ht.type(e,f,i,l,a),f&&Ht.range(e,f.getTime(),i,l,a)}}r(l)},sB="enum",aB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&Ht[sB](e,n,i,l,a)}r(l)},oB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&(Ht.type(e,n,i,l,a),Ht.range(e,n,i,l,a))}r(l)},lB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&(Ht.type(e,n,i,l,a),Ht.range(e,n,i,l,a))}r(l)},cB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&Ht.type(e,n,i,l,a)}r(l)},uB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(n===""&&(n=void 0),hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&(Ht.type(e,n,i,l,a),Ht.range(e,n,i,l,a))}r(l)},fB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&Ht.type(e,n,i,l,a)}r(l)},dB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n,"string")&&!e.required)return r();Ht.required(e,n,i,l,a),hr(n,"string")||Ht.pattern(e,n,i,l,a)}r(l)},hB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),hr(n)||Ht.type(e,n,i,l,a)}r(l)},gB=function(e,n,r,i,a){var l=[],u=Array.isArray(n)?"array":pt(n);Ht.required(e,n,i,l,a,u),r(l)},pB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n,"string")&&!e.required)return r();Ht.required(e,n,i,l,a,"string"),hr(n,"string")||(Ht.type(e,n,i,l,a),Ht.range(e,n,i,l,a),Ht.pattern(e,n,i,l,a),e.whitespace===!0&&Ht.whitespace(e,n,i,l,a))}r(l)},Iv=function(e,n,r,i,a){var l=e.type,u=[],f=e.required||!e.required&&i.hasOwnProperty(e.field);if(f){if(hr(n,l)&&!e.required)return r();Ht.required(e,n,i,u,a,l),hr(n,l)||Ht.type(e,n,i,u,a)}r(u)};const tf={string:pB,method:cB,number:uB,boolean:rB,regexp:hB,integer:lB,float:oB,array:nB,object:fB,enum:aB,pattern:dB,date:iB,url:Iv,hex:Iv,email:Iv,required:gB,any:tB};var Hf=function(){function t(e){xr(this,t),K(this,"rules",null),K(this,"_messages",g_),this.define(e)}return Mr(t,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(pt(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(i){var a=n[i];r.rules[i]=Array.isArray(a)?a:[a]})}},{key:"messages",value:function(n){return n&&(this._messages=kT(h_(),n)),this._messages}},{key:"validate",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},l=n,u=i,f=a;if(typeof u=="function"&&(f=u,u={}),!this.rules||Object.keys(this.rules).length===0)return f&&f(null,l),Promise.resolve(l);function h(w){var E=[],b={};function C(A){if(Array.isArray(A)){var O;E=(O=E).concat.apply(O,ze(A))}else E.push(A)}for(var T=0;T<w.length;T++)C(w[T]);E.length?(b=m_(E),f(E,b)):f(null,l)}if(u.messages){var g=this.messages();g===g_&&(g=h_()),kT(g,u.messages),u.messages=g}else u.messages=this.messages();var m={},v=u.keys||Object.keys(this.rules);v.forEach(function(w){var E=r.rules[w],b=l[w];E.forEach(function(C){var T=C;typeof T.transform=="function"&&(l===n&&(l=J({},l)),b=l[w]=T.transform(b),b!=null&&(T.type=T.type||(Array.isArray(b)?"array":pt(b)))),typeof T=="function"?T={validator:T}:T=J({},T),T.validator=r.getValidationMethod(T),T.validator&&(T.field=w,T.fullField=T.fullField||w,T.type=r.getType(T),m[w]=m[w]||[],m[w].push({rule:T,value:b,source:l,field:w}))})});var S={};return X8(m,u,function(w,E){var b=w.rule,C=(b.type==="object"||b.type==="array")&&(pt(b.fields)==="object"||pt(b.defaultField)==="object");C=C&&(b.required||!b.required&&w.value),b.field=w.field;function T(F,L){return J(J({},L),{},{fullField:"".concat(b.fullField,".").concat(F),fullFields:b.fullFields?[].concat(ze(b.fullFields),[F]):[F]})}function A(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],L=Array.isArray(F)?F:[F];!u.suppressWarning&&L.length&&t.warning("async-validator:",L),L.length&&b.message!==void 0&&(L=[].concat(b.message));var D=L.map(FT(b,l));if(u.first&&D.length)return S[b.field]=1,E(D);if(!C)E(D);else{if(b.required&&!w.value)return b.message!==void 0?D=[].concat(b.message).map(FT(b,l)):u.error&&(D=[u.error(b,li(u.messages.required,b.field))]),E(D);var V={};b.defaultField&&Object.keys(w.value).map(function(X){V[X]=b.defaultField}),V=J(J({},V),w.rule.fields);var B={};Object.keys(V).forEach(function(X){var Y=V[X],ae=Array.isArray(Y)?Y:[Y];B[X]=ae.map(T.bind(null,X))});var W=new t(B);W.messages(u.messages),w.rule.options&&(w.rule.options.messages=u.messages,w.rule.options.error=u.error),W.validate(w.value,w.rule.options||u,function(X){var Y=[];D&&D.length&&Y.push.apply(Y,ze(D)),X&&X.length&&Y.push.apply(Y,ze(X)),E(Y.length?Y:null)})}}var O;if(b.asyncValidator)O=b.asyncValidator(b,w.value,A,w.source,u);else if(b.validator){try{O=b.validator(b,w.value,A,w.source,u)}catch(F){var x,N;(x=(N=console).error)===null||x===void 0||x.call(N,F),u.suppressValidatorError||setTimeout(function(){throw F},0),A(F.message)}O===!0?A():O===!1?A(typeof b.message=="function"?b.message(b.fullField||b.field):b.message||"".concat(b.fullField||b.field," fails")):O instanceof Array?A(O):O instanceof Error&&A(O.message)}O&&O.then&&O.then(function(){return A()},function(F){return A(F)})},function(w){h(w)},l)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!tf.hasOwnProperty(n.type))throw new Error(li("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),i=r.indexOf("message");return i!==-1&&r.splice(i,1),r.length===1&&r[0]==="required"?tf.required:tf[this.getType(n)]||void 0}}]),t}();K(Hf,"register",function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");tf[e]=n});K(Hf,"warning",V8);K(Hf,"messages",g_);K(Hf,"validators",tf);var si="'${name}' is not a valid ${type}",ex={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:si,method:si,array:si,object:si,number:si,date:si,boolean:si,integer:si,float:si,regexp:si,email:si,url:si,hex:si},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},UT=Hf;function mB(t,e){return t.replace(/\\?\$\{\w+\}/g,function(n){if(n.startsWith("\\"))return n.slice(1);var r=n.slice(2,-1);return e[r]})}var LT="CODE_LOGIC_ERROR";function v_(t,e,n,r,i){return __.apply(this,arguments)}function __(){return __=Vf(ts().mark(function t(e,n,r,i,a){var l,u,f,h,g,m,v,S,w;return ts().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return l=J({},r),delete l.ruleIndex,UT.warning=function(){},l.validator&&(u=l.validator,l.validator=function(){try{return u.apply(void 0,arguments)}catch(C){return console.error(C),Promise.reject(LT)}}),f=null,l&&l.type==="array"&&l.defaultField&&(f=l.defaultField,delete l.defaultField),h=new UT(K({},e,[l])),g=Hl(ex,i.validateMessages),h.messages(g),m=[],b.prev=10,b.next=13,Promise.resolve(h.validate(K({},e,n),J({},i)));case 13:b.next=18;break;case 15:b.prev=15,b.t0=b.catch(10),b.t0.errors&&(m=b.t0.errors.map(function(C,T){var A=C.message,O=A===LT?g.default:A;return _.isValidElement(O)?_.cloneElement(O,{key:"error_".concat(T)}):O}));case 18:if(!(!m.length&&f)){b.next=23;break}return b.next=21,Promise.all(n.map(function(C,T){return v_("".concat(e,".").concat(T),C,f,i,a)}));case 21:return v=b.sent,b.abrupt("return",v.reduce(function(C,T){return[].concat(ze(C),ze(T))},[]));case 23:return S=J(J({},r),{},{name:e,enum:(r.enum||[]).join(", ")},a),w=m.map(function(C){return typeof C=="string"?mB(C,S):C}),b.abrupt("return",w);case 26:case"end":return b.stop()}},t,null,[[10,15]])})),__.apply(this,arguments)}function vB(t,e,n,r,i,a){var l=t.join("."),u=n.map(function(g,m){var v=g.validator,S=J(J({},g),{},{ruleIndex:m});return v&&(S.validator=function(w,E,b){var C=!1,T=function(){for(var x=arguments.length,N=new Array(x),F=0;F<x;F++)N[F]=arguments[F];Promise.resolve().then(function(){kr(!C,"Your validator function has already return a promise. `callback` will be ignored."),C||b.apply(void 0,N)})},A=v(w,E,T);C=A&&typeof A.then=="function"&&typeof A.catch=="function",kr(C,"`callback` is deprecated. Please return a promise instead."),C&&A.then(function(){b()}).catch(function(O){b(O||" ")})}),S}).sort(function(g,m){var v=g.warningOnly,S=g.ruleIndex,w=m.warningOnly,E=m.ruleIndex;return!!v==!!w?S-E:v?1:-1}),f;if(i===!0)f=new Promise(function(){var g=Vf(ts().mark(function m(v,S){var w,E,b;return ts().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:w=0;case 1:if(!(w<u.length)){T.next=12;break}return E=u[w],T.next=5,v_(l,e,E,r,a);case 5:if(b=T.sent,!b.length){T.next=9;break}return S([{errors:b,rule:E}]),T.abrupt("return");case 9:w+=1,T.next=1;break;case 12:v([]);case 13:case"end":return T.stop()}},m)}));return function(m,v){return g.apply(this,arguments)}}());else{var h=u.map(function(g){return v_(l,e,g,r,a).then(function(m){return{errors:m,rule:g}})});f=(i?yB(h):_B(h)).then(function(g){return Promise.reject(g)})}return f.catch(function(g){return g}),f}function _B(t){return y_.apply(this,arguments)}function y_(){return y_=Vf(ts().mark(function t(e){return ts().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.all(e).then(function(i){var a,l=(a=[]).concat.apply(a,ze(i));return l}));case 1:case"end":return r.stop()}},t)})),y_.apply(this,arguments)}function yB(t){return b_.apply(this,arguments)}function b_(){return b_=Vf(ts().mark(function t(e){var n;return ts().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return n=0,i.abrupt("return",new Promise(function(a){e.forEach(function(l){l.then(function(u){u.errors.length&&a([u]),n+=1,n===e.length&&a([])})})}));case 2:case"end":return i.stop()}},t)})),b_.apply(this,arguments)}function Jn(t){return d_(t)}function zT(t,e){var n={};return e.forEach(function(r){var i=vs(t,r);n=Xi(n,r,i)}),n}function ec(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return t&&t.some(function(r){return tx(e,r,n)})}function tx(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!t||!e||!n&&t.length!==e.length?!1:e.every(function(r,i){return t[i]===r})}function bB(t,e){if(t===e)return!0;if(!t&&e||t&&!e||!t||!e||pt(t)!=="object"||pt(e)!=="object")return!1;var n=Object.keys(t),r=Object.keys(e),i=new Set([].concat(n,r));return ze(i).every(function(a){var l=t[a],u=e[a];return typeof l=="function"&&typeof u=="function"?!0:l===u})}function SB(t){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&pt(e.target)==="object"&&t in e.target?e.target[t]:e}function $T(t,e,n){var r=t.length;if(e<0||e>=r||n<0||n>=r)return t;var i=t[e],a=e-n;return a>0?[].concat(ze(t.slice(0,n)),[i],ze(t.slice(n,e)),ze(t.slice(e+1,r))):a<0?[].concat(ze(t.slice(0,e)),ze(t.slice(e+1,n+1)),[i],ze(t.slice(n+1,r))):t}var EB=["name"],Ci=[];function Dv(t,e,n,r,i,a){return typeof t=="function"?t(e,n,"source"in a?{source:a.source}:{}):r!==i}var Gy=function(t){Xo(n,t);var e=qo(n);function n(r){var i;if(xr(this,n),i=e.call(this,r),K(Nt(i),"state",{resetCount:0}),K(Nt(i),"cancelRegisterFunc",null),K(Nt(i),"mounted",!1),K(Nt(i),"touched",!1),K(Nt(i),"dirty",!1),K(Nt(i),"validatePromise",void 0),K(Nt(i),"prevValidating",void 0),K(Nt(i),"errors",Ci),K(Nt(i),"warnings",Ci),K(Nt(i),"cancelRegister",function(){var f=i.props,h=f.preserve,g=f.isListField,m=f.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(g,h,Jn(m)),i.cancelRegisterFunc=null}),K(Nt(i),"getNamePath",function(){var f=i.props,h=f.name,g=f.fieldContext,m=g.prefixName,v=m===void 0?[]:m;return h!==void 0?[].concat(ze(v),ze(h)):[]}),K(Nt(i),"getRules",function(){var f=i.props,h=f.rules,g=h===void 0?[]:h,m=f.fieldContext;return g.map(function(v){return typeof v=="function"?v(m):v})}),K(Nt(i),"refresh",function(){i.mounted&&i.setState(function(f){var h=f.resetCount;return{resetCount:h+1}})}),K(Nt(i),"metaCache",null),K(Nt(i),"triggerMetaEvent",function(f){var h=i.props.onMetaChange;if(h){var g=J(J({},i.getMeta()),{},{destroy:f});qh(i.metaCache,g)||h(g),i.metaCache=g}else i.metaCache=null}),K(Nt(i),"onStoreChange",function(f,h,g){var m=i.props,v=m.shouldUpdate,S=m.dependencies,w=S===void 0?[]:S,E=m.onReset,b=g.store,C=i.getNamePath(),T=i.getValue(f),A=i.getValue(b),O=h&&ec(h,C);switch(g.type==="valueUpdate"&&g.source==="external"&&!qh(T,A)&&(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent()),g.type){case"reset":if(!h||O){i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent(),E==null||E(),i.refresh();return}break;case"remove":{if(v&&Dv(v,f,b,T,A,g)){i.reRender();return}break}case"setField":{var x=g.data;if(O){"touched"in x&&(i.touched=x.touched),"validating"in x&&!("originRCField"in x)&&(i.validatePromise=x.validating?Promise.resolve([]):null),"errors"in x&&(i.errors=x.errors||Ci),"warnings"in x&&(i.warnings=x.warnings||Ci),i.dirty=!0,i.triggerMetaEvent(),i.reRender();return}else if("value"in x&&ec(h,C,!0)){i.reRender();return}if(v&&!C.length&&Dv(v,f,b,T,A,g)){i.reRender();return}break}case"dependenciesUpdate":{var N=w.map(Jn);if(N.some(function(F){return ec(g.relatedFields,F)})){i.reRender();return}break}default:if(O||(!w.length||C.length||v)&&Dv(v,f,b,T,A,g)){i.reRender();return}break}v===!0&&i.reRender()}),K(Nt(i),"validateRules",function(f){var h=i.getNamePath(),g=i.getValue(),m=f||{},v=m.triggerName,S=m.validateOnly,w=S===void 0?!1:S,E=Promise.resolve().then(Vf(ts().mark(function b(){var C,T,A,O,x,N,F;return ts().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(i.mounted){D.next=2;break}return D.abrupt("return",[]);case 2:if(C=i.props,T=C.validateFirst,A=T===void 0?!1:T,O=C.messageVariables,x=C.validateDebounce,N=i.getRules(),v&&(N=N.filter(function(V){return V}).filter(function(V){var B=V.validateTrigger;if(!B)return!0;var W=d_(B);return W.includes(v)})),!(x&&v)){D.next=10;break}return D.next=8,new Promise(function(V){setTimeout(V,x)});case 8:if(i.validatePromise===E){D.next=10;break}return D.abrupt("return",[]);case 10:return F=vB(h,g,N,f,A,O),F.catch(function(V){return V}).then(function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ci;if(i.validatePromise===E){var B;i.validatePromise=null;var W=[],X=[];(B=V.forEach)===null||B===void 0||B.call(V,function(Y){var ae=Y.rule.warningOnly,U=Y.errors,z=U===void 0?Ci:U;ae?X.push.apply(X,ze(z)):W.push.apply(W,ze(z))}),i.errors=W,i.warnings=X,i.triggerMetaEvent(),i.reRender()}}),D.abrupt("return",F);case 13:case"end":return D.stop()}},b)})));return w||(i.validatePromise=E,i.dirty=!0,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent(),i.reRender()),E}),K(Nt(i),"isFieldValidating",function(){return!!i.validatePromise}),K(Nt(i),"isFieldTouched",function(){return i.touched}),K(Nt(i),"isFieldDirty",function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var f=i.props.fieldContext,h=f.getInternalHooks(bo),g=h.getInitialValue;return g(i.getNamePath())!==void 0}),K(Nt(i),"getErrors",function(){return i.errors}),K(Nt(i),"getWarnings",function(){return i.warnings}),K(Nt(i),"isListField",function(){return i.props.isListField}),K(Nt(i),"isList",function(){return i.props.isList}),K(Nt(i),"isPreserve",function(){return i.props.preserve}),K(Nt(i),"getMeta",function(){i.prevValidating=i.isFieldValidating();var f={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:i.validatePromise===null};return f}),K(Nt(i),"getOnlyChild",function(f){if(typeof f=="function"){var h=i.getMeta();return J(J({},i.getOnlyChild(f(i.getControlled(),h,i.props.fieldContext))),{},{isFunction:!0})}var g=Lo(f);return g.length!==1||!_.isValidElement(g[0])?{child:g,isFunction:!1}:{child:g[0],isFunction:!1}}),K(Nt(i),"getValue",function(f){var h=i.props.fieldContext.getFieldsValue,g=i.getNamePath();return vs(f||h(!0),g)}),K(Nt(i),"getControlled",function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=i.props,g=h.name,m=h.trigger,v=h.validateTrigger,S=h.getValueFromEvent,w=h.normalize,E=h.valuePropName,b=h.getValueProps,C=h.fieldContext,T=v!==void 0?v:C.validateTrigger,A=i.getNamePath(),O=C.getInternalHooks,x=C.getFieldsValue,N=O(bo),F=N.dispatch,L=i.getValue(),D=b||function(Y){return K({},E,Y)},V=f[m],B=g!==void 0?D(L):{},W=J(J({},f),B);W[m]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var Y,ae=arguments.length,U=new Array(ae),z=0;z<ae;z++)U[z]=arguments[z];S?Y=S.apply(void 0,U):Y=SB.apply(void 0,[E].concat(U)),w&&(Y=w(Y,L,x(!0))),Y!==L&&F({type:"updateValue",namePath:A,value:Y}),V&&V.apply(void 0,U)};var X=d_(T||[]);return X.forEach(function(Y){var ae=W[Y];W[Y]=function(){ae&&ae.apply(void 0,arguments);var U=i.props.rules;U&&U.length&&F({type:"validateField",namePath:A,triggerName:Y})}}),W}),r.fieldContext){var a=r.fieldContext.getInternalHooks,l=a(bo),u=l.initEntityValue;u(Nt(i))}return i}return Mr(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.shouldUpdate,l=i.fieldContext;if(this.mounted=!0,l){var u=l.getInternalHooks,f=u(bo),h=f.registerField;this.cancelRegisterFunc=h(this)}a===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var i=this.state.resetCount,a=this.props.children,l=this.getOnlyChild(a),u=l.child,f=l.isFunction,h;return f?h=u:_.isValidElement(u)?h=_.cloneElement(u,this.getControlled(u.props)):(kr(!u,"`children` of Field is not validate ReactElement."),h=u),_.createElement(_.Fragment,{key:i},h)}}]),n}(_.Component);K(Gy,"contextType",Cc);K(Gy,"defaultProps",{trigger:"onChange",valuePropName:"value"});function nx(t){var e,n=t.name,r=Fn(t,EB),i=_.useContext(Cc),a=_.useContext(Jh),l=n!==void 0?Jn(n):void 0,u=(e=r.isListField)!==null&&e!==void 0?e:!!a,f="keep";return u||(f="_".concat((l||[]).join("_"))),_.createElement(Gy,kt({key:f,name:l,isListField:u},r,{fieldContext:i}))}function wB(t){var e=t.name,n=t.initialValue,r=t.children,i=t.rules,a=t.validateTrigger,l=t.isListField,u=_.useContext(Cc),f=_.useContext(Jh),h=_.useRef({keys:[],id:0}),g=h.current,m=_.useMemo(function(){var E=Jn(u.prefixName)||[];return[].concat(ze(E),ze(Jn(e)))},[u.prefixName,e]),v=_.useMemo(function(){return J(J({},u),{},{prefixName:m})},[u,m]),S=_.useMemo(function(){return{getKey:function(b){var C=m.length,T=b[C];return[g.keys[T],b.slice(C+1)]}}},[m]);if(typeof r!="function")return kr(!1,"Form.List only accepts function as children."),null;var w=function(b,C,T){var A=T.source;return A==="internal"?!1:b!==C};return _.createElement(Jh.Provider,{value:S},_.createElement(Cc.Provider,{value:v},_.createElement(nx,{name:[],shouldUpdate:w,rules:i,validateTrigger:a,initialValue:n,isList:!0,isListField:l??!!f},function(E,b){var C=E.value,T=C===void 0?[]:C,A=E.onChange,O=u.getFieldValue,x=function(){var D=O(m||[]);return D||[]},N={add:function(D,V){var B=x();V>=0&&V<=B.length?(g.keys=[].concat(ze(g.keys.slice(0,V)),[g.id],ze(g.keys.slice(V))),A([].concat(ze(B.slice(0,V)),[D],ze(B.slice(V))))):(g.keys=[].concat(ze(g.keys),[g.id]),A([].concat(ze(B),[D]))),g.id+=1},remove:function(D){var V=x(),B=new Set(Array.isArray(D)?D:[D]);B.size<=0||(g.keys=g.keys.filter(function(W,X){return!B.has(X)}),A(V.filter(function(W,X){return!B.has(X)})))},move:function(D,V){if(D!==V){var B=x();D<0||D>=B.length||V<0||V>=B.length||(g.keys=$T(g.keys,D,V),A($T(B,D,V)))}}},F=T||[];return Array.isArray(F)||(F=[]),r(F.map(function(L,D){var V=g.keys[D];return V===void 0&&(g.keys[D]=g.id,V=g.keys[D],g.id+=1),{name:D,key:V,isListField:!0}}),N,b)})))}function TB(t){var e=!1,n=t.length,r=[];return t.length?new Promise(function(i,a){t.forEach(function(l,u){l.catch(function(f){return e=!0,f}).then(function(f){n-=1,r[u]=f,!(n>0)&&(e&&a(r),i(r))})})}):Promise.resolve([])}var rx="__@field_split__";function Fv(t){return t.map(function(e){return"".concat(pt(e),":").concat(e)}).join(rx)}var Fl=function(){function t(){xr(this,t),K(this,"kvs",new Map)}return Mr(t,[{key:"set",value:function(n,r){this.kvs.set(Fv(n),r)}},{key:"get",value:function(n){return this.kvs.get(Fv(n))}},{key:"update",value:function(n,r){var i=this.get(n),a=r(i);a?this.set(n,a):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(Fv(n))}},{key:"map",value:function(n){return ze(this.kvs.entries()).map(function(r){var i=de(r,2),a=i[0],l=i[1],u=a.split(rx);return n({key:u.map(function(f){var h=f.match(/^([^:]*):(.*)$/),g=de(h,3),m=g[1],v=g[2];return m==="number"?Number(v):v}),value:l})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,a=r.value;return n[i.join(".")]=a,null}),n}}]),t}(),CB=["name"],AB=Mr(function t(e){var n=this;xr(this,t),K(this,"formHooked",!1),K(this,"forceRootUpdate",void 0),K(this,"subscribable",!0),K(this,"store",{}),K(this,"fieldEntities",[]),K(this,"initialValues",{}),K(this,"callbacks",{}),K(this,"validateMessages",null),K(this,"preserve",null),K(this,"lastValidatePromise",null),K(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),K(this,"getInternalHooks",function(r){return r===bo?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(kr(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),K(this,"useSubscribe",function(r){n.subscribable=r}),K(this,"prevWithoutPreserves",null),K(this,"setInitialValues",function(r,i){if(n.initialValues=r||{},i){var a,l=Hl(r,n.store);(a=n.prevWithoutPreserves)===null||a===void 0||a.map(function(u){var f=u.key;l=Xi(l,f,vs(r,f))}),n.prevWithoutPreserves=null,n.updateStore(l)}}),K(this,"destroyForm",function(r){if(r)n.updateStore({});else{var i=new Fl;n.getFieldEntities(!0).forEach(function(a){n.isMergedPreserve(a.isPreserve())||i.set(a.getNamePath(),!0)}),n.prevWithoutPreserves=i}}),K(this,"getInitialValue",function(r){var i=vs(n.initialValues,r);return r.length?Hl(i):i}),K(this,"setCallbacks",function(r){n.callbacks=r}),K(this,"setValidateMessages",function(r){n.validateMessages=r}),K(this,"setPreserve",function(r){n.preserve=r}),K(this,"watchList",[]),K(this,"registerWatch",function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(i){return i!==r})}}),K(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var i=n.getFieldsValue(),a=n.getFieldsValue(!0);n.watchList.forEach(function(l){l(i,a,r)})}}),K(this,"timeoutId",null),K(this,"warningUnhooked",function(){}),K(this,"updateStore",function(r){n.store=r}),K(this,"getFieldEntities",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(i){return i.getNamePath().length}):n.fieldEntities}),K(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new Fl;return n.getFieldEntities(r).forEach(function(a){var l=a.getNamePath();i.set(l,a)}),i}),K(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(a){var l=Jn(a);return i.get(l)||{INVALIDATE_NAME_PATH:Jn(a)}})}),K(this,"getFieldsValue",function(r,i){n.warningUnhooked();var a,l,u;if(r===!0||Array.isArray(r)?(a=r,l=i):r&&pt(r)==="object"&&(u=r.strict,l=r.filter),a===!0&&!l)return n.store;var f=n.getFieldEntitiesForNamePathList(Array.isArray(a)?a:null),h=[];return f.forEach(function(g){var m,v,S="INVALIDATE_NAME_PATH"in g?g.INVALIDATE_NAME_PATH:g.getNamePath();if(u){var w,E;if((w=(E=g).isList)!==null&&w!==void 0&&w.call(E))return}else if(!a&&(m=(v=g).isListField)!==null&&m!==void 0&&m.call(v))return;if(!l)h.push(S);else{var b="getMeta"in g?g.getMeta():null;l(b)&&h.push(S)}}),zT(n.store,h.map(Jn))}),K(this,"getFieldValue",function(r){n.warningUnhooked();var i=Jn(r);return vs(n.store,i)}),K(this,"getFieldsError",function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(a,l){return a&&!("INVALIDATE_NAME_PATH"in a)?{name:a.getNamePath(),errors:a.getErrors(),warnings:a.getWarnings()}:{name:Jn(r[l]),errors:[],warnings:[]}})}),K(this,"getFieldError",function(r){n.warningUnhooked();var i=Jn(r),a=n.getFieldsError([i])[0];return a.errors}),K(this,"getFieldWarning",function(r){n.warningUnhooked();var i=Jn(r),a=n.getFieldsError([i])[0];return a.warnings}),K(this,"isFieldsTouched",function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var l=i[0],u=i[1],f,h=!1;i.length===0?f=null:i.length===1?Array.isArray(l)?(f=l.map(Jn),h=!1):(f=null,h=l):(f=l.map(Jn),h=u);var g=n.getFieldEntities(!0),m=function(b){return b.isFieldTouched()};if(!f)return h?g.every(function(E){return m(E)||E.isList()}):g.some(m);var v=new Fl;f.forEach(function(E){v.set(E,[])}),g.forEach(function(E){var b=E.getNamePath();f.forEach(function(C){C.every(function(T,A){return b[A]===T})&&v.update(C,function(T){return[].concat(ze(T),[E])})})});var S=function(b){return b.some(m)},w=v.map(function(E){var b=E.value;return b});return h?w.every(S):w.some(S)}),K(this,"isFieldTouched",function(r){return n.warningUnhooked(),n.isFieldsTouched([r])}),K(this,"isFieldsValidating",function(r){n.warningUnhooked();var i=n.getFieldEntities();if(!r)return i.some(function(l){return l.isFieldValidating()});var a=r.map(Jn);return i.some(function(l){var u=l.getNamePath();return ec(a,u)&&l.isFieldValidating()})}),K(this,"isFieldValidating",function(r){return n.warningUnhooked(),n.isFieldsValidating([r])}),K(this,"resetWithFieldInitialValue",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new Fl,a=n.getFieldEntities(!0);a.forEach(function(f){var h=f.props.initialValue,g=f.getNamePath();if(h!==void 0){var m=i.get(g)||new Set;m.add({entity:f,value:h}),i.set(g,m)}});var l=function(h){h.forEach(function(g){var m=g.props.initialValue;if(m!==void 0){var v=g.getNamePath(),S=n.getInitialValue(v);if(S!==void 0)kr(!1,"Form already set 'initialValues' with path '".concat(v.join("."),"'. Field can not overwrite it."));else{var w=i.get(v);if(w&&w.size>1)kr(!1,"Multiple Field with path '".concat(v.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(w){var E=n.getFieldValue(v),b=g.isListField();!b&&(!r.skipExist||E===void 0)&&n.updateStore(Xi(n.store,v,ze(w)[0].value))}}}})},u;r.entities?u=r.entities:r.namePathList?(u=[],r.namePathList.forEach(function(f){var h=i.get(f);if(h){var g;(g=u).push.apply(g,ze(ze(h).map(function(m){return m.entity})))}})):u=a,l(u)}),K(this,"resetFields",function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(Hl(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var a=r.map(Jn);a.forEach(function(l){var u=n.getInitialValue(l);n.updateStore(Xi(n.store,l,u))}),n.resetWithFieldInitialValue({namePathList:a}),n.notifyObservers(i,a,{type:"reset"}),n.notifyWatch(a)}),K(this,"setFields",function(r){n.warningUnhooked();var i=n.store,a=[];r.forEach(function(l){var u=l.name,f=Fn(l,CB),h=Jn(u);a.push(h),"value"in f&&n.updateStore(Xi(n.store,h,f.value)),n.notifyObservers(i,[h],{type:"setField",data:l})}),n.notifyWatch(a)}),K(this,"getFields",function(){var r=n.getFieldEntities(!0),i=r.map(function(a){var l=a.getNamePath(),u=a.getMeta(),f=J(J({},u),{},{name:l,value:n.getFieldValue(l)});return Object.defineProperty(f,"originRCField",{value:!0}),f});return i}),K(this,"initEntityValue",function(r){var i=r.props.initialValue;if(i!==void 0){var a=r.getNamePath(),l=vs(n.store,a);l===void 0&&n.updateStore(Xi(n.store,a,i))}}),K(this,"isMergedPreserve",function(r){var i=r!==void 0?r:n.preserve;return i??!0}),K(this,"registerField",function(r){n.fieldEntities.push(r);var i=r.getNamePath();if(n.notifyWatch([i]),r.props.initialValue!==void 0){var a=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(a,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(l,u){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(m){return m!==r}),!n.isMergedPreserve(u)&&(!l||f.length>1)){var h=l?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==h&&n.fieldEntities.every(function(m){return!tx(m.getNamePath(),i)})){var g=n.store;n.updateStore(Xi(g,i,h,!0)),n.notifyObservers(g,[i],{type:"remove"}),n.triggerDependenciesUpdate(g,i)}}n.notifyWatch([i])}}),K(this,"dispatch",function(r){switch(r.type){case"updateValue":{var i=r.namePath,a=r.value;n.updateValue(i,a);break}case"validateField":{var l=r.namePath,u=r.triggerName;n.validateFields([l],{triggerName:u});break}}}),K(this,"notifyObservers",function(r,i,a){if(n.subscribable){var l=J(J({},a),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(u){var f=u.onStoreChange;f(r,i,l)})}else n.forceRootUpdate()}),K(this,"triggerDependenciesUpdate",function(r,i){var a=n.getDependencyChildrenFields(i);return a.length&&n.validateFields(a),n.notifyObservers(r,a,{type:"dependenciesUpdate",relatedFields:[i].concat(ze(a))}),a}),K(this,"updateValue",function(r,i){var a=Jn(r),l=n.store;n.updateStore(Xi(n.store,a,i)),n.notifyObservers(l,[a],{type:"valueUpdate",source:"internal"}),n.notifyWatch([a]);var u=n.triggerDependenciesUpdate(l,a),f=n.callbacks.onValuesChange;if(f){var h=zT(n.store,[a]);f(h,n.getFieldsValue())}n.triggerOnFieldsChange([a].concat(ze(u)))}),K(this,"setFieldsValue",function(r){n.warningUnhooked();var i=n.store;if(r){var a=Hl(n.store,r);n.updateStore(a)}n.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),K(this,"setFieldValue",function(r,i){n.setFields([{name:r,value:i,errors:[],warnings:[]}])}),K(this,"getDependencyChildrenFields",function(r){var i=new Set,a=[],l=new Fl;n.getFieldEntities().forEach(function(f){var h=f.props.dependencies;(h||[]).forEach(function(g){var m=Jn(g);l.update(m,function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return v.add(f),v})})});var u=function f(h){var g=l.get(h)||new Set;g.forEach(function(m){if(!i.has(m)){i.add(m);var v=m.getNamePath();m.isFieldDirty()&&v.length&&(a.push(v),f(v))}})};return u(r),a}),K(this,"triggerOnFieldsChange",function(r,i){var a=n.callbacks.onFieldsChange;if(a){var l=n.getFields();if(i){var u=new Fl;i.forEach(function(h){var g=h.name,m=h.errors;u.set(g,m)}),l.forEach(function(h){h.errors=u.get(h.name)||h.errors})}var f=l.filter(function(h){var g=h.name;return ec(r,g)});f.length&&a(f,l)}}),K(this,"validateFields",function(r,i){n.warningUnhooked();var a,l;Array.isArray(r)||typeof r=="string"||typeof i=="string"?(a=r,l=i):l=r;var u=!!a,f=u?a.map(Jn):[],h=[],g=String(Date.now()),m=new Set,v=l||{},S=v.recursive,w=v.dirty;n.getFieldEntities(!0).forEach(function(T){if(u||f.push(T.getNamePath()),!(!T.props.rules||!T.props.rules.length)&&!(w&&!T.isFieldDirty())){var A=T.getNamePath();if(m.add(A.join(g)),!u||ec(f,A,S)){var O=T.validateRules(J({validateMessages:J(J({},ex),n.validateMessages)},l));h.push(O.then(function(){return{name:A,errors:[],warnings:[]}}).catch(function(x){var N,F=[],L=[];return(N=x.forEach)===null||N===void 0||N.call(x,function(D){var V=D.rule.warningOnly,B=D.errors;V?L.push.apply(L,ze(B)):F.push.apply(F,ze(B))}),F.length?Promise.reject({name:A,errors:F,warnings:L}):{name:A,errors:F,warnings:L}}))}}});var E=TB(h);n.lastValidatePromise=E,E.catch(function(T){return T}).then(function(T){var A=T.map(function(O){var x=O.name;return x});n.notifyObservers(n.store,A,{type:"validateFinish"}),n.triggerOnFieldsChange(A,T)});var b=E.then(function(){return n.lastValidatePromise===E?Promise.resolve(n.getFieldsValue(f)):Promise.reject([])}).catch(function(T){var A=T.filter(function(O){return O&&O.errors.length});return Promise.reject({values:n.getFieldsValue(f),errorFields:A,outOfDate:n.lastValidatePromise!==E})});b.catch(function(T){return T});var C=f.filter(function(T){return m.has(T.join(g))});return n.triggerOnFieldsChange(C),b}),K(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch(a){console.error(a)}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})}),this.forceRootUpdate=e});function ix(t){var e=_.useRef(),n=_.useState({}),r=de(n,2),i=r[1];if(!e.current)if(t)e.current=t;else{var a=function(){i({})},l=new AB(a);e.current=l.getForm()}return[e.current]}var S_=_.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),RB=function(e){var n=e.validateMessages,r=e.onFormChange,i=e.onFormFinish,a=e.children,l=_.useContext(S_),u=_.useRef({});return _.createElement(S_.Provider,{value:J(J({},l),{},{validateMessages:J(J({},l.validateMessages),n),triggerFormChange:function(h,g){r&&r(h,{changedFields:g,forms:u.current}),l.triggerFormChange(h,g)},triggerFormFinish:function(h,g){i&&i(h,{values:g,forms:u.current}),l.triggerFormFinish(h,g)},registerForm:function(h,g){h&&(u.current=J(J({},u.current),{},K({},h,g))),l.registerForm(h,g)},unregisterForm:function(h){var g=J({},u.current);delete g[h],u.current=g,l.unregisterForm(h)}})},a)},xB=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],MB=function(e,n){var r=e.name,i=e.initialValues,a=e.fields,l=e.form,u=e.preserve,f=e.children,h=e.component,g=h===void 0?"form":h,m=e.validateMessages,v=e.validateTrigger,S=v===void 0?"onChange":v,w=e.onValuesChange,E=e.onFieldsChange,b=e.onFinish,C=e.onFinishFailed,T=e.clearOnDestroy,A=Fn(e,xB),O=_.useRef(null),x=_.useContext(S_),N=ix(l),F=de(N,1),L=F[0],D=L.getInternalHooks(bo),V=D.useSubscribe,B=D.setInitialValues,W=D.setCallbacks,X=D.setValidateMessages,Y=D.setPreserve,ae=D.destroyForm;_.useImperativeHandle(n,function(){return J(J({},L),{},{nativeElement:O.current})}),_.useEffect(function(){return x.registerForm(r,L),function(){x.unregisterForm(r)}},[x,L,r]),X(J(J({},x.validateMessages),m)),W({onValuesChange:w,onFieldsChange:function(q){if(x.triggerFormChange(r,q),E){for(var ce=arguments.length,fe=new Array(ce>1?ce-1:0),ye=1;ye<ce;ye++)fe[ye-1]=arguments[ye];E.apply(void 0,[q].concat(fe))}},onFinish:function(q){x.triggerFormFinish(r,q),b&&b(q)},onFinishFailed:C}),Y(u);var U=_.useRef(null);B(i,!U.current),U.current||(U.current=!0),_.useEffect(function(){return function(){return ae(T)}},[]);var z,j=typeof f=="function";if(j){var Z=L.getFieldsValue(!0);z=f(Z,L)}else z=f;V(!j);var P=_.useRef();_.useEffect(function(){bB(P.current||[],a||[])||L.setFields(a||[]),P.current=a},[a,L]);var $=_.useMemo(function(){return J(J({},L),{},{validateTrigger:S})},[L,S]),ie=_.createElement(Jh.Provider,{value:null},_.createElement(Cc.Provider,{value:$},z));return g===!1?ie:_.createElement(g,kt({},A,{ref:O,onSubmit:function(q){q.preventDefault(),q.stopPropagation(),L.submit()},onReset:function(q){var ce;q.preventDefault(),L.resetFields(),(ce=A.onReset)===null||ce===void 0||ce.call(A,q)}}),ie)};function VT(t){try{return JSON.stringify(t)}catch{return Math.random()}}function OB(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0],i=e[1],a=i===void 0?{}:i,l=U8(a)?{form:a}:a,u=l.form,f=_.useState(),h=de(f,2),g=h[0],m=h[1],v=_.useMemo(function(){return VT(g)},[g]),S=_.useRef(v);S.current=v;var w=_.useContext(Cc),E=u||w,b=E&&E._init,C=Jn(r),T=_.useRef(C);return T.current=C,_.useEffect(function(){if(b){var A=E.getFieldsValue,O=E.getInternalHooks,x=O(bo),N=x.registerWatch,F=function(B,W){var X=l.preserve?W:B;return typeof r=="function"?r(X):vs(X,T.current)},L=N(function(V,B){var W=F(V,B),X=VT(W);S.current!==X&&(S.current=X,m(W))}),D=F(A(),A(!0));return g!==D&&m(D),L}},[b]),g}var PB=_.forwardRef(MB),jf=PB;jf.FormProvider=RB;jf.Field=nx;jf.List=wB;jf.useForm=ix;jf.useWatch=OB;const E_=_.createContext({}),NB=t=>{let{children:e,status:n,override:r}=t;const i=_.useContext(E_),a=_.useMemo(()=>{const l=Object.assign({},i);return r&&delete l.isFormItemInput,n&&(delete l.status,delete l.hasFeedback,delete l.feedbackIcon),l},[n,r,i]);return _.createElement(E_.Provider,{value:a},e)},IB=_.createContext(void 0),DB=t=>{const{space:e,form:n,children:r}=t;if(r==null)return null;let i=r;return n&&(i=Ft.createElement(NB,{override:!0,status:!0},i)),e&&(i=Ft.createElement(Kk,null,i)),i};function FB(t){return e=>_.createElement($c,{theme:{token:{motion:!1,zIndexPopupBase:0}}},_.createElement(t,Object.assign({},e)))}const kB=(t,e,n,r,i)=>FB(l=>{const{prefixCls:u,style:f}=l,h=_.useRef(null),[g,m]=_.useState(0),[v,S]=_.useState(0),[w,E]=Tc(!1,{value:l.open}),{getPrefixCls:b}=_.useContext(ci),C=b("select",u);_.useEffect(()=>{if(E(!0),typeof ResizeObserver<"u"){const O=new ResizeObserver(N=>{const F=N[0].target;m(F.offsetHeight+8),S(F.offsetWidth)}),x=setInterval(()=>{var N;const F=`.${C}-dropdown`,L=(N=h.current)===null||N===void 0?void 0:N.querySelector(F);L&&(clearInterval(x),O.observe(L))},10);return()=>{clearInterval(x),O.disconnect()}}},[]);let T=Object.assign(Object.assign({},l),{style:Object.assign(Object.assign({},f),{margin:0}),open:w,visible:w,getPopupContainer:()=>h.current});Object.assign(T,{[e]:{overflow:{adjustX:!1,adjustY:!1}}});const A={paddingBottom:g,position:"relative",minWidth:v};return _.createElement("div",{ref:h,style:A},_.createElement(t,Object.assign({},T)))}),sx=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t==null?void 0:t.substr(0,4))};var ip=function(e){var n=e.className,r=e.customizeIcon,i=e.customizeIconProps,a=e.children,l=e.onMouseDown,u=e.onClick,f=typeof r=="function"?r(i):r;return _.createElement("span",{className:n,onMouseDown:function(g){g.preventDefault(),l==null||l(g)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:u,"aria-hidden":!0},f!==void 0?f:_.createElement("span",{className:Ze(n.split(/\s+/).map(function(h){return"".concat(h,"-icon")}))},a))},BB=function(e,n,r,i,a){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,u=arguments.length>6?arguments[6]:void 0,f=arguments.length>7?arguments[7]:void 0,h=Ft.useMemo(function(){if(pt(i)==="object")return i.clearIcon;if(a)return a},[i,a]),g=Ft.useMemo(function(){return!!(!l&&i&&(r.length||u)&&!(f==="combobox"&&u===""))},[i,l,r.length,u,f]);return{allowClear:g,clearIcon:Ft.createElement(ip,{className:"".concat(e,"-clear"),onMouseDown:n,customizeIcon:h},"×")}},ax=_.createContext(null);function UB(){return _.useContext(ax)}function LB(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=_.useState(!1),n=de(e,2),r=n[0],i=n[1],a=_.useRef(null),l=function(){window.clearTimeout(a.current)};_.useEffect(function(){return l},[]);var u=function(h,g){l(),a.current=window.setTimeout(function(){i(h),g&&g()},t)};return[r,u,l]}function ox(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=_.useRef(null),n=_.useRef(null);_.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function r(i){(i||e.current===null)&&(e.current=i),window.clearTimeout(n.current),n.current=window.setTimeout(function(){e.current=null},t)}return[function(){return e.current},r]}function zB(t,e,n,r){var i=_.useRef(null);i.current={open:e,triggerOpen:n,customizedTrigger:r},_.useEffect(function(){function a(l){var u;if(!((u=i.current)!==null&&u!==void 0&&u.customizedTrigger)){var f=l.target;f.shadowRoot&&l.composed&&(f=l.composedPath()[0]||f),i.current.open&&t().filter(function(h){return h}).every(function(h){return!h.contains(f)&&h!==f})&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",a),function(){return window.removeEventListener("mousedown",a)}},[])}function $B(t){return t&&![et.ESC,et.SHIFT,et.BACKSPACE,et.TAB,et.WIN_KEY,et.ALT,et.META,et.WIN_KEY_RIGHT,et.CTRL,et.SEMICOLON,et.EQUALS,et.CAPS_LOCK,et.CONTEXT_MENU,et.F1,et.F2,et.F3,et.F4,et.F5,et.F6,et.F7,et.F8,et.F9,et.F10,et.F11,et.F12].includes(t)}var VB=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],kl=void 0;function HB(t,e){var n=t.prefixCls,r=t.invalidate,i=t.item,a=t.renderItem,l=t.responsive,u=t.responsiveDisabled,f=t.registerSize,h=t.itemKey,g=t.className,m=t.style,v=t.children,S=t.display,w=t.order,E=t.component,b=E===void 0?"div":E,C=Fn(t,VB),T=l&&!S;function A(L){f(h,L)}_.useEffect(function(){return function(){A(null)}},[]);var O=a&&i!==kl?a(i,{index:w}):v,x;r||(x={opacity:T?0:1,height:T?0:kl,overflowY:T?"hidden":kl,order:l?w:kl,pointerEvents:T?"none":kl,position:T?"absolute":kl});var N={};T&&(N["aria-hidden"]=!0);var F=_.createElement(b,kt({className:Ze(!r&&n,g),style:J(J({},x),m)},N,C,{ref:e}),O);return l&&(F=_.createElement(Yo,{onResize:function(D){var V=D.offsetWidth;A(V)},disabled:u},F)),F}var nf=_.forwardRef(HB);nf.displayName="Item";function jB(t){if(typeof MessageChannel>"u")dr(t);else{var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(void 0)}}function WB(){var t=_.useRef(null),e=function(r){t.current||(t.current=[],jB(function(){za.unstable_batchedUpdates(function(){t.current.forEach(function(i){i()}),t.current=null})})),t.current.push(r)};return e}function Lu(t,e){var n=_.useState(e),r=de(n,2),i=r[0],a=r[1],l=fr(function(u){t(function(){a(u)})});return[i,l]}var eg=Ft.createContext(null),XB=["component"],qB=["className"],YB=["className"],KB=function(e,n){var r=_.useContext(eg);if(!r){var i=e.component,a=i===void 0?"div":i,l=Fn(e,XB);return _.createElement(a,kt({},l,{ref:n}))}var u=r.className,f=Fn(r,qB),h=e.className,g=Fn(e,YB);return _.createElement(eg.Provider,{value:null},_.createElement(nf,kt({ref:n,className:Ze(u,h)},f,g)))},lx=_.forwardRef(KB);lx.displayName="RawItem";var ZB=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],cx="responsive",ux="invalidate";function QB(t){return"+ ".concat(t.length," ...")}function GB(t,e){var n=t.prefixCls,r=n===void 0?"rc-overflow":n,i=t.data,a=i===void 0?[]:i,l=t.renderItem,u=t.renderRawItem,f=t.itemKey,h=t.itemWidth,g=h===void 0?10:h,m=t.ssr,v=t.style,S=t.className,w=t.maxCount,E=t.renderRest,b=t.renderRawRest,C=t.suffix,T=t.component,A=T===void 0?"div":T,O=t.itemComponent,x=t.onVisibleChange,N=Fn(t,ZB),F=m==="full",L=WB(),D=Lu(L,null),V=de(D,2),B=V[0],W=V[1],X=B||0,Y=Lu(L,new Map),ae=de(Y,2),U=ae[0],z=ae[1],j=Lu(L,0),Z=de(j,2),P=Z[0],$=Z[1],ie=Lu(L,0),se=de(ie,2),q=se[0],ce=se[1],fe=Lu(L,0),ye=de(fe,2),Ee=ye[0],Ce=ye[1],Te=_.useState(null),ve=de(Te,2),ge=ve[0],_e=ve[1],Ie=_.useState(null),we=de(Ie,2),xe=we[0],Ve=we[1],Fe=_.useMemo(function(){return xe===null&&F?Number.MAX_SAFE_INTEGER:xe||0},[xe,B]),Be=_.useState(!1),nt=de(Be,2),He=nt[0],Ge=nt[1],Pe="".concat(r,"-item"),Me=Math.max(P,q),dt=w===cx,rt=a.length&&dt,it=w===ux,st=rt||typeof w=="number"&&a.length>w,at=_.useMemo(function(){var qe=a;return rt?B===null&&F?qe=a:qe=a.slice(0,Math.min(a.length,X/g)):typeof w=="number"&&(qe=a.slice(0,w)),qe},[a,g,B,w,rt]),Je=_.useMemo(function(){return rt?a.slice(Fe+1):a.slice(at.length)},[a,at,rt,Fe]),lt=_.useCallback(function(qe,ke){var Ne;return typeof f=="function"?f(qe):(Ne=f&&(qe==null?void 0:qe[f]))!==null&&Ne!==void 0?Ne:ke},[f]),ft=_.useCallback(l||function(qe){return qe},[l]);function ct(qe,ke,Ne){xe===qe&&(ke===void 0||ke===ge)||(Ve(qe),Ne||(Ge(qe<a.length-1),x==null||x(qe)),ke!==void 0&&_e(ke))}function mt(qe,ke){W(ke.clientWidth)}function xt(qe,ke){z(function(Ne){var Et=new Map(Ne);return ke===null?Et.delete(qe):Et.set(qe,ke),Et})}function Bt(qe,ke){ce(ke),$(q)}function ht(qe,ke){Ce(ke)}function Vt(qe){return U.get(lt(at[qe],qe))}Dn(function(){if(X&&typeof Me=="number"&&at){var qe=Ee,ke=at.length,Ne=ke-1;if(!ke){ct(0,null);return}for(var Et=0;Et<ke;Et+=1){var en=Vt(Et);if(F&&(en=en||0),en===void 0){ct(Et-1,void 0,!0);break}if(qe+=en,Ne===0&&qe<=X||Et===Ne-1&&qe+Vt(Ne)<=X){ct(Ne,null);break}else if(qe+Me>X){ct(Et-1,qe-en-Ee+q);break}}C&&Vt(0)+Ee>X&&_e(null)}},[X,U,q,Ee,lt,at]);var qt=He&&!!Je.length,wn={};ge!==null&&rt&&(wn={position:"absolute",left:ge,top:0});var Mn={prefixCls:Pe,responsive:rt,component:O,invalidate:it},Ut=u?function(qe,ke){var Ne=lt(qe,ke);return _.createElement(eg.Provider,{key:Ne,value:J(J({},Mn),{},{order:ke,item:qe,itemKey:Ne,registerSize:xt,display:ke<=Fe})},u(qe,ke))}:function(qe,ke){var Ne=lt(qe,ke);return _.createElement(nf,kt({},Mn,{order:ke,key:Ne,item:qe,renderItem:ft,itemKey:Ne,registerSize:xt,display:ke<=Fe}))},It={order:qt?Fe:Number.MAX_SAFE_INTEGER,className:"".concat(Pe,"-rest"),registerSize:Bt,display:qt},Lt=E||QB,Jt=b?_.createElement(eg.Provider,{value:J(J({},Mn),It)},b(Je)):_.createElement(nf,kt({},Mn,It),typeof Lt=="function"?Lt(Je):Lt),Mt=_.createElement(A,kt({className:Ze(!it&&r,S),style:v,ref:e},N),at.map(Ut),st?Jt:null,C&&_.createElement(nf,kt({},Mn,{responsive:dt,responsiveDisabled:!rt,order:Fe,className:"".concat(Pe,"-suffix"),registerSize:ht,display:!0,style:wn}),C));return dt?_.createElement(Yo,{onResize:mt,disabled:!rt},Mt):Mt}var Wf=_.forwardRef(GB);Wf.displayName="Overflow";Wf.Item=lx;Wf.RESPONSIVE=cx;Wf.INVALIDATE=ux;var JB=function(e,n){var r,i=e.prefixCls,a=e.id,l=e.inputElement,u=e.disabled,f=e.tabIndex,h=e.autoFocus,g=e.autoComplete,m=e.editable,v=e.activeDescendantId,S=e.value,w=e.maxLength,E=e.onKeyDown,b=e.onMouseDown,C=e.onChange,T=e.onPaste,A=e.onCompositionStart,O=e.onCompositionEnd,x=e.onBlur,N=e.open,F=e.attrs,L=l||_.createElement("input",null),D=L,V=D.ref,B=D.props,W=B.onKeyDown,X=B.onChange,Y=B.onMouseDown,ae=B.onCompositionStart,U=B.onCompositionEnd,z=B.onBlur,j=B.style;return"maxLength"in L.props,L=_.cloneElement(L,J(J(J({type:"search"},B),{},{id:a,ref:Zg(n,V),disabled:u,tabIndex:f,autoComplete:g||"off",autoFocus:h,className:Ze("".concat(i,"-selection-search-input"),(r=L)===null||r===void 0||(r=r.props)===null||r===void 0?void 0:r.className),role:"combobox","aria-expanded":N||!1,"aria-haspopup":"listbox","aria-owns":"".concat(a,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(a,"_list"),"aria-activedescendant":N?v:void 0},F),{},{value:m?S:"",maxLength:w,readOnly:!m,unselectable:m?null:"on",style:J(J({},j),{},{opacity:m?null:0}),onKeyDown:function(P){E(P),W&&W(P)},onMouseDown:function(P){b(P),Y&&Y(P)},onChange:function(P){C(P),X&&X(P)},onCompositionStart:function(P){A(P),ae&&ae(P)},onCompositionEnd:function(P){O(P),U&&U(P)},onPaste:T,onBlur:function(P){x(P),z&&z(P)}})),L},fx=_.forwardRef(JB);function dx(t){return Array.isArray(t)?t:t!==void 0?[t]:[]}var eU=typeof window<"u"&&window.document&&window.document.documentElement,tU=eU;function nU(t){return t!=null}function rU(t){return!t&&t!==0}function HT(t){return["string","number"].includes(pt(t))}function hx(t){var e=void 0;return t&&(HT(t.title)?e=t.title.toString():HT(t.label)&&(e=t.label.toString())),e}function iU(t,e){tU?_.useLayoutEffect(t,e):_.useEffect(t,e)}function sU(t){var e;return(e=t.key)!==null&&e!==void 0?e:t.value}var jT=function(e){e.preventDefault(),e.stopPropagation()},aU=function(e){var n=e.id,r=e.prefixCls,i=e.values,a=e.open,l=e.searchValue,u=e.autoClearSearchValue,f=e.inputRef,h=e.placeholder,g=e.disabled,m=e.mode,v=e.showSearch,S=e.autoFocus,w=e.autoComplete,E=e.activeDescendantId,b=e.tabIndex,C=e.removeIcon,T=e.maxTagCount,A=e.maxTagTextLength,O=e.maxTagPlaceholder,x=O===void 0?function(Ie){return"+ ".concat(Ie.length," ...")}:O,N=e.tagRender,F=e.onToggleOpen,L=e.onRemove,D=e.onInputChange,V=e.onInputPaste,B=e.onInputKeyDown,W=e.onInputMouseDown,X=e.onInputCompositionStart,Y=e.onInputCompositionEnd,ae=e.onInputBlur,U=_.useRef(null),z=_.useState(0),j=de(z,2),Z=j[0],P=j[1],$=_.useState(!1),ie=de($,2),se=ie[0],q=ie[1],ce="".concat(r,"-selection"),fe=a||m==="multiple"&&u===!1||m==="tags"?l:"",ye=m==="tags"||m==="multiple"&&u===!1||v&&(a||se);iU(function(){P(U.current.scrollWidth)},[fe]);var Ee=function(we,xe,Ve,Fe,Be){return _.createElement("span",{title:hx(we),className:Ze("".concat(ce,"-item"),K({},"".concat(ce,"-item-disabled"),Ve))},_.createElement("span",{className:"".concat(ce,"-item-content")},xe),Fe&&_.createElement(ip,{className:"".concat(ce,"-item-remove"),onMouseDown:jT,onClick:Be,customizeIcon:C},"×"))},Ce=function(we,xe,Ve,Fe,Be,nt){var He=function(Pe){jT(Pe),F(!a)};return _.createElement("span",{onMouseDown:He},N({label:xe,value:we,disabled:Ve,closable:Fe,onClose:Be,isMaxTag:!!nt}))},Te=function(we){var xe=we.disabled,Ve=we.label,Fe=we.value,Be=!g&&!xe,nt=Ve;if(typeof A=="number"&&(typeof Ve=="string"||typeof Ve=="number")){var He=String(nt);He.length>A&&(nt="".concat(He.slice(0,A),"..."))}var Ge=function(Me){Me&&Me.stopPropagation(),L(we)};return typeof N=="function"?Ce(Fe,nt,xe,Be,Ge):Ee(we,nt,xe,Be,Ge)},ve=function(we){if(!i.length)return null;var xe=typeof x=="function"?x(we):x;return typeof N=="function"?Ce(void 0,xe,!1,!1,void 0,!0):Ee({title:xe},xe,!1)},ge=_.createElement("div",{className:"".concat(ce,"-search"),style:{width:Z},onFocus:function(){q(!0)},onBlur:function(){q(!1)}},_.createElement(fx,{ref:f,open:a,prefixCls:r,id:n,inputElement:null,disabled:g,autoFocus:S,autoComplete:w,editable:ye,activeDescendantId:E,value:fe,onKeyDown:B,onMouseDown:W,onChange:D,onPaste:V,onCompositionStart:X,onCompositionEnd:Y,onBlur:ae,tabIndex:b,attrs:Gh(e,!0)}),_.createElement("span",{ref:U,className:"".concat(ce,"-search-mirror"),"aria-hidden":!0},fe," ")),_e=_.createElement(Wf,{prefixCls:"".concat(ce,"-overflow"),data:i,renderItem:Te,renderRest:ve,suffix:ge,itemKey:sU,maxCount:T});return _.createElement("span",{className:"".concat(ce,"-wrap")},_e,!i.length&&!fe&&_.createElement("span",{className:"".concat(ce,"-placeholder")},h))},oU=function(e){var n=e.inputElement,r=e.prefixCls,i=e.id,a=e.inputRef,l=e.disabled,u=e.autoFocus,f=e.autoComplete,h=e.activeDescendantId,g=e.mode,m=e.open,v=e.values,S=e.placeholder,w=e.tabIndex,E=e.showSearch,b=e.searchValue,C=e.activeValue,T=e.maxLength,A=e.onInputKeyDown,O=e.onInputMouseDown,x=e.onInputChange,N=e.onInputPaste,F=e.onInputCompositionStart,L=e.onInputCompositionEnd,D=e.onInputBlur,V=e.title,B=_.useState(!1),W=de(B,2),X=W[0],Y=W[1],ae=g==="combobox",U=ae||E,z=v[0],j=b||"";ae&&C&&!X&&(j=C),_.useEffect(function(){ae&&Y(!1)},[ae,C]);var Z=g!=="combobox"&&!m&&!E?!1:!!j,P=V===void 0?hx(z):V,$=_.useMemo(function(){return z?null:_.createElement("span",{className:"".concat(r,"-selection-placeholder"),style:Z?{visibility:"hidden"}:void 0},S)},[z,Z,S,r]);return _.createElement("span",{className:"".concat(r,"-selection-wrap")},_.createElement("span",{className:"".concat(r,"-selection-search")},_.createElement(fx,{ref:a,prefixCls:r,id:i,open:m,inputElement:n,disabled:l,autoFocus:u,autoComplete:f,editable:U,activeDescendantId:h,value:j,onKeyDown:A,onMouseDown:O,onChange:function(se){Y(!0),x(se)},onPaste:N,onCompositionStart:F,onCompositionEnd:L,onBlur:D,tabIndex:w,attrs:Gh(e,!0),maxLength:ae?T:void 0})),!ae&&z?_.createElement("span",{className:"".concat(r,"-selection-item"),title:P,style:Z?{visibility:"hidden"}:void 0},z.label):null,$)},lU=function(e,n){var r=_.useRef(null),i=_.useRef(!1),a=e.prefixCls,l=e.open,u=e.mode,f=e.showSearch,h=e.tokenWithEnter,g=e.disabled,m=e.prefix,v=e.autoClearSearchValue,S=e.onSearch,w=e.onSearchSubmit,E=e.onToggleOpen,b=e.onInputKeyDown,C=e.onInputBlur,T=e.domRef;_.useImperativeHandle(n,function(){return{focus:function(P){r.current.focus(P)},blur:function(){r.current.blur()}}});var A=ox(0),O=de(A,2),x=O[0],N=O[1],F=function(P){var $=P.which,ie=r.current instanceof HTMLTextAreaElement;!ie&&l&&($===et.UP||$===et.DOWN)&&P.preventDefault(),b&&b(P),$===et.ENTER&&u==="tags"&&!i.current&&!l&&(w==null||w(P.target.value)),!(ie&&!l&&~[et.UP,et.DOWN,et.LEFT,et.RIGHT].indexOf($))&&$B($)&&E(!0)},L=function(){N(!0)},D=_.useRef(null),V=function(P){S(P,!0,i.current)!==!1&&E(!0)},B=function(){i.current=!0},W=function(P){i.current=!1,u!=="combobox"&&V(P.target.value)},X=function(P){var $=P.target.value;if(h&&D.current&&/[\r\n]/.test(D.current)){var ie=D.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");$=$.replace(ie,D.current)}D.current=null,V($)},Y=function(P){var $=P.clipboardData,ie=$==null?void 0:$.getData("text");D.current=ie||""},ae=function(P){var $=P.target;if($!==r.current){var ie=document.body.style.msTouchAction!==void 0;ie?setTimeout(function(){r.current.focus()}):r.current.focus()}},U=function(P){var $=x();P.target!==r.current&&!$&&!(u==="combobox"&&g)&&P.preventDefault(),(u!=="combobox"&&(!f||!$)||!l)&&(l&&v!==!1&&S("",!0,!1),E())},z={inputRef:r,onInputKeyDown:F,onInputMouseDown:L,onInputChange:X,onInputPaste:Y,onInputCompositionStart:B,onInputCompositionEnd:W,onInputBlur:C},j=u==="multiple"||u==="tags"?_.createElement(aU,kt({},e,z)):_.createElement(oU,kt({},e,z));return _.createElement("div",{ref:T,className:"".concat(a,"-selector"),onClick:ae,onMouseDown:U},m&&_.createElement("div",{className:"".concat(a,"-prefix")},m),j)},cU=_.forwardRef(lU);function uU(t){var e=t.prefixCls,n=t.align,r=t.arrow,i=t.arrowPos,a=r||{},l=a.className,u=a.content,f=i.x,h=f===void 0?0:f,g=i.y,m=g===void 0?0:g,v=_.useRef();if(!n||!n.points)return null;var S={position:"absolute"};if(n.autoArrow!==!1){var w=n.points[0],E=n.points[1],b=w[0],C=w[1],T=E[0],A=E[1];b===T||!["t","b"].includes(b)?S.top=m:b==="t"?S.top=0:S.bottom=0,C===A||!["l","r"].includes(C)?S.left=h:C==="l"?S.left=0:S.right=0}return _.createElement("div",{ref:v,className:Ze("".concat(e,"-arrow"),l),style:S},u)}function fU(t){var e=t.prefixCls,n=t.open,r=t.zIndex,i=t.mask,a=t.motion;return i?_.createElement(Zy,kt({},a,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(l){var u=l.className;return _.createElement("div",{style:{zIndex:r},className:Ze("".concat(e,"-mask"),u)})}):null}var dU=_.memo(function(t){var e=t.children;return e},function(t,e){return e.cache}),hU=_.forwardRef(function(t,e){var n=t.popup,r=t.className,i=t.prefixCls,a=t.style,l=t.target,u=t.onVisibleChanged,f=t.open,h=t.keepDom,g=t.fresh,m=t.onClick,v=t.mask,S=t.arrow,w=t.arrowPos,E=t.align,b=t.motion,C=t.maskMotion,T=t.forceRender,A=t.getPopupContainer,O=t.autoDestroy,x=t.portal,N=t.zIndex,F=t.onMouseEnter,L=t.onMouseLeave,D=t.onPointerEnter,V=t.onPointerDownCapture,B=t.ready,W=t.offsetX,X=t.offsetY,Y=t.offsetR,ae=t.offsetB,U=t.onAlign,z=t.onPrepare,j=t.stretch,Z=t.targetWidth,P=t.targetHeight,$=typeof n=="function"?n():n,ie=f||h,se=(A==null?void 0:A.length)>0,q=_.useState(!A||!se),ce=de(q,2),fe=ce[0],ye=ce[1];if(Dn(function(){!fe&&se&&l&&ye(!0)},[fe,se,l]),!fe)return null;var Ee="auto",Ce={left:"-1000vw",top:"-1000vh",right:Ee,bottom:Ee};if(B||!f){var Te,ve=E.points,ge=E.dynamicInset||((Te=E._experimental)===null||Te===void 0?void 0:Te.dynamicInset),_e=ge&&ve[0][1]==="r",Ie=ge&&ve[0][0]==="b";_e?(Ce.right=Y,Ce.left=Ee):(Ce.left=W,Ce.right=Ee),Ie?(Ce.bottom=ae,Ce.top=Ee):(Ce.top=X,Ce.bottom=Ee)}var we={};return j&&(j.includes("height")&&P?we.height=P:j.includes("minHeight")&&P&&(we.minHeight=P),j.includes("width")&&Z?we.width=Z:j.includes("minWidth")&&Z&&(we.minWidth=Z)),f||(we.pointerEvents="none"),_.createElement(x,{open:T||ie,getContainer:A&&function(){return A(l)},autoDestroy:O},_.createElement(fU,{prefixCls:i,open:f,zIndex:N,mask:v,motion:C}),_.createElement(Yo,{onResize:U,disabled:!f},function(xe){return _.createElement(Zy,kt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:T,leavedClassName:"".concat(i,"-hidden")},b,{onAppearPrepare:z,onEnterPrepare:z,visible:f,onVisibleChanged:function(Fe){var Be;b==null||(Be=b.onVisibleChanged)===null||Be===void 0||Be.call(b,Fe),u(Fe)}}),function(Ve,Fe){var Be=Ve.className,nt=Ve.style,He=Ze(i,Be,r);return _.createElement("div",{ref:Zg(xe,e,Fe),className:He,style:J(J(J(J({"--arrow-x":"".concat(w.x||0,"px"),"--arrow-y":"".concat(w.y||0,"px")},Ce),we),nt),{},{boxSizing:"border-box",zIndex:N},a),onMouseEnter:F,onMouseLeave:L,onPointerEnter:D,onClick:m,onPointerDownCapture:V},S&&_.createElement(uU,{prefixCls:i,arrow:S,arrowPos:w,align:E}),_.createElement(dU,{cache:!f&&!g},$))})}))}),gU=_.forwardRef(function(t,e){var n=t.children,r=t.getTriggerDOMNode,i=Gg(n),a=_.useCallback(function(u){Dy(e,r?r(u):u)},[r]),l=Qg(a,Fy(n));return i?_.cloneElement(n,{ref:l}):n}),WT=_.createContext(null);function XT(t){return t?Array.isArray(t)?t:[t]:[]}function pU(t,e,n,r){return _.useMemo(function(){var i=XT(n??e),a=XT(r??e),l=new Set(i),u=new Set(a);return t&&(l.has("hover")&&(l.delete("hover"),l.add("click")),u.has("hover")&&(u.delete("hover"),u.add("click"))),[l,u]},[t,e,n,r])}function mU(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}function vU(t,e,n,r){for(var i=n.points,a=Object.keys(t),l=0;l<a.length;l+=1){var u,f=a[l];if(mU((u=t[f])===null||u===void 0?void 0:u.points,i,r))return"".concat(e,"-placement-").concat(f)}return""}function qT(t,e,n,r){return e||(n?{motionName:"".concat(t,"-").concat(n)}:r?{motionName:r}:null)}function Xf(t){return t.ownerDocument.defaultView}function w_(t){for(var e=[],n=t==null?void 0:t.parentElement,r=["hidden","scroll","clip","auto"];n;){var i=Xf(n).getComputedStyle(n),a=i.overflowX,l=i.overflowY,u=i.overflow;[a,l,u].some(function(f){return r.includes(f)})&&e.push(n),n=n.parentElement}return e}function Cf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(t)?e:t}function zu(t){return Cf(parseFloat(t),0)}function YT(t,e){var n=J({},t);return(e||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var i=Xf(r).getComputedStyle(r),a=i.overflow,l=i.overflowClipMargin,u=i.borderTopWidth,f=i.borderBottomWidth,h=i.borderLeftWidth,g=i.borderRightWidth,m=r.getBoundingClientRect(),v=r.offsetHeight,S=r.clientHeight,w=r.offsetWidth,E=r.clientWidth,b=zu(u),C=zu(f),T=zu(h),A=zu(g),O=Cf(Math.round(m.width/w*1e3)/1e3),x=Cf(Math.round(m.height/v*1e3)/1e3),N=(w-E-T-A)*O,F=(v-S-b-C)*x,L=b*x,D=C*x,V=T*O,B=A*O,W=0,X=0;if(a==="clip"){var Y=zu(l);W=Y*O,X=Y*x}var ae=m.x+V-W,U=m.y+L-X,z=ae+m.width+2*W-V-B-N,j=U+m.height+2*X-L-D-F;n.left=Math.max(n.left,ae),n.top=Math.max(n.top,U),n.right=Math.min(n.right,z),n.bottom=Math.min(n.bottom,j)}}),n}function KT(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(e),r=n.match(/^(.*)\%$/);return r?t*(parseFloat(r[1])/100):parseFloat(n)}function ZT(t,e){var n=e||[],r=de(n,2),i=r[0],a=r[1];return[KT(t.width,i),KT(t.height,a)]}function QT(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[t[0],t[1]]}function Bl(t,e){var n=e[0],r=e[1],i,a;return n==="t"?a=t.y:n==="b"?a=t.y+t.height:a=t.y+t.height/2,r==="l"?i=t.x:r==="r"?i=t.x+t.width:i=t.x+t.width/2,{x:i,y:a}}function pa(t,e){var n={t:"b",b:"t",l:"r",r:"l"};return t.map(function(r,i){return i===e?n[r]||"c":r}).join("")}function _U(t,e,n,r,i,a,l){var u=_.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:i[r]||{}}),f=de(u,2),h=f[0],g=f[1],m=_.useRef(0),v=_.useMemo(function(){return e?w_(e):[]},[e]),S=_.useRef({}),w=function(){S.current={}};t||w();var E=fr(function(){if(e&&n&&t){let Wr=function(ki,fi){var di=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Me,hi=q.x+ki,Bi=q.y+fi,Jo=hi+_e,Va=Bi+ge,el=Math.max(hi,di.left),$e=Math.max(Bi,di.top),gt=Math.min(Jo,di.right),sn=Math.min(Va,di.bottom);return Math.max(0,(gt-el)*(sn-$e))},Go=function(){vn=q.y+Ne,On=vn+ge,_n=q.x+ke,Zn=_n+_e};var T,A,O,x,N=e,F=N.ownerDocument,L=Xf(N),D=L.getComputedStyle(N),V=D.width,B=D.height,W=D.position,X=N.style.left,Y=N.style.top,ae=N.style.right,U=N.style.bottom,z=N.style.overflow,j=J(J({},i[r]),a),Z=F.createElement("div");(T=N.parentElement)===null||T===void 0||T.appendChild(Z),Z.style.left="".concat(N.offsetLeft,"px"),Z.style.top="".concat(N.offsetTop,"px"),Z.style.position=W,Z.style.height="".concat(N.offsetHeight,"px"),Z.style.width="".concat(N.offsetWidth,"px"),N.style.left="0",N.style.top="0",N.style.right="auto",N.style.bottom="auto",N.style.overflow="hidden";var P;if(Array.isArray(n))P={x:n[0],y:n[1],width:0,height:0};else{var $,ie,se=n.getBoundingClientRect();se.x=($=se.x)!==null&&$!==void 0?$:se.left,se.y=(ie=se.y)!==null&&ie!==void 0?ie:se.top,P={x:se.x,y:se.y,width:se.width,height:se.height}}var q=N.getBoundingClientRect();q.x=(A=q.x)!==null&&A!==void 0?A:q.left,q.y=(O=q.y)!==null&&O!==void 0?O:q.top;var ce=F.documentElement,fe=ce.clientWidth,ye=ce.clientHeight,Ee=ce.scrollWidth,Ce=ce.scrollHeight,Te=ce.scrollTop,ve=ce.scrollLeft,ge=q.height,_e=q.width,Ie=P.height,we=P.width,xe={left:0,top:0,right:fe,bottom:ye},Ve={left:-ve,top:-Te,right:Ee-ve,bottom:Ce-Te},Fe=j.htmlRegion,Be="visible",nt="visibleFirst";Fe!=="scroll"&&Fe!==nt&&(Fe=Be);var He=Fe===nt,Ge=YT(Ve,v),Pe=YT(xe,v),Me=Fe===Be?Pe:Ge,dt=He?Pe:Me;N.style.left="auto",N.style.top="auto",N.style.right="0",N.style.bottom="0";var rt=N.getBoundingClientRect();N.style.left=X,N.style.top=Y,N.style.right=ae,N.style.bottom=U,N.style.overflow=z,(x=N.parentElement)===null||x===void 0||x.removeChild(Z);var it=Cf(Math.round(_e/parseFloat(V)*1e3)/1e3),st=Cf(Math.round(ge/parseFloat(B)*1e3)/1e3);if(it===0||st===0||pf(n)&&!jk(n))return;var at=j.offset,Je=j.targetOffset,lt=ZT(q,at),ft=de(lt,2),ct=ft[0],mt=ft[1],xt=ZT(P,Je),Bt=de(xt,2),ht=Bt[0],Vt=Bt[1];P.x-=ht,P.y-=Vt;var qt=j.points||[],wn=de(qt,2),Mn=wn[0],Ut=wn[1],It=QT(Ut),Lt=QT(Mn),Jt=Bl(P,It),Mt=Bl(q,Lt),qe=J({},j),ke=Jt.x-Mt.x+ct,Ne=Jt.y-Mt.y+mt,Et=Wr(ke,Ne),en=Wr(ke,Ne,Pe),Ue=Bl(P,["t","l"]),Oe=Bl(q,["t","l"]),je=Bl(P,["b","r"]),Ye=Bl(q,["b","r"]),We=j.overflow||{},Qe=We.adjustX,bt=We.adjustY,_t=We.shiftX,Zt=We.shiftY,Yt=function(fi){return typeof fi=="boolean"?fi:fi>=0},vn,On,_n,Zn;Go();var un=Yt(bt),rn=Lt[0]===It[0];if(un&&Lt[0]==="t"&&(On>dt.bottom||S.current.bt)){var Ae=Ne;rn?Ae-=ge-Ie:Ae=Ue.y-Ye.y-mt;var Le=Wr(ke,Ae),De=Wr(ke,Ae,Pe);Le>Et||Le===Et&&(!He||De>=en)?(S.current.bt=!0,Ne=Ae,mt=-mt,qe.points=[pa(Lt,0),pa(It,0)]):S.current.bt=!1}if(un&&Lt[0]==="b"&&(vn<dt.top||S.current.tb)){var be=Ne;rn?be+=ge-Ie:be=je.y-Oe.y-mt;var ut=Wr(ke,be),zt=Wr(ke,be,Pe);ut>Et||ut===Et&&(!He||zt>=en)?(S.current.tb=!0,Ne=be,mt=-mt,qe.points=[pa(Lt,0),pa(It,0)]):S.current.tb=!1}var Ot=Yt(Qe),In=Lt[1]===It[1];if(Ot&&Lt[1]==="l"&&(Zn>dt.right||S.current.rl)){var tn=ke;In?tn-=_e-we:tn=Ue.x-Ye.x-ct;var Vn=Wr(tn,Ne),Pn=Wr(tn,Ne,Pe);Vn>Et||Vn===Et&&(!He||Pn>=en)?(S.current.rl=!0,ke=tn,ct=-ct,qe.points=[pa(Lt,1),pa(It,1)]):S.current.rl=!1}if(Ot&&Lt[1]==="r"&&(_n<dt.left||S.current.lr)){var Bn=ke;In?Bn+=_e-we:Bn=je.x-Oe.x-ct;var Or=Wr(Bn,Ne),er=Wr(Bn,Ne,Pe);Or>Et||Or===Et&&(!He||er>=en)?(S.current.lr=!0,ke=Bn,ct=-ct,qe.points=[pa(Lt,1),pa(It,1)]):S.current.lr=!1}Go();var Un=_t===!0?0:_t;typeof Un=="number"&&(_n<Pe.left&&(ke-=_n-Pe.left-ct,P.x+we<Pe.left+Un&&(ke+=P.x-Pe.left+we-Un)),Zn>Pe.right&&(ke-=Zn-Pe.right-ct,P.x>Pe.right-Un&&(ke+=P.x-Pe.right+Un)));var Tn=Zt===!0?0:Zt;typeof Tn=="number"&&(vn<Pe.top&&(Ne-=vn-Pe.top-mt,P.y+Ie<Pe.top+Tn&&(Ne+=P.y-Pe.top+Ie-Tn)),On>Pe.bottom&&(Ne-=On-Pe.bottom-mt,P.y>Pe.bottom-Tn&&(Ne+=P.y-Pe.bottom+Tn)));var Qn=q.x+ke,Ii=Qn+_e,jr=q.y+Ne,Di=jr+ge,Fi=P.x,Tt=Fi+we,yt=P.y,nn=yt+Ie,Hn=Math.max(Qn,Fi),Cn=Math.min(Ii,Tt),Nn=(Hn+Cn)/2,tr=Nn-Qn,br=Math.max(jr,yt),Br=Math.min(Di,nn),Sr=(br+Br)/2,Qr=Sr-jr;l==null||l(e,qe);var Gr=rt.right-q.x-(ke+q.width),gr=rt.bottom-q.y-(Ne+q.height);it===1&&(ke=Math.round(ke),Gr=Math.round(Gr)),st===1&&(Ne=Math.round(Ne),gr=Math.round(gr));var $a={ready:!0,offsetX:ke/it,offsetY:Ne/st,offsetR:Gr/it,offsetB:gr/st,arrowX:tr/it,arrowY:Qr/st,scaleX:it,scaleY:st,align:qe};g($a)}}),b=function(){m.current+=1;var A=m.current;Promise.resolve().then(function(){m.current===A&&E()})},C=function(){g(function(A){return J(J({},A),{},{ready:!1})})};return Dn(C,[r]),Dn(function(){t||C()},[t]),[h.ready,h.offsetX,h.offsetY,h.offsetR,h.offsetB,h.arrowX,h.arrowY,h.scaleX,h.scaleY,h.align,b]}function yU(t,e,n,r,i){Dn(function(){if(t&&e&&n){let m=function(){r(),i()};var a=e,l=n,u=w_(a),f=w_(l),h=Xf(l),g=new Set([h].concat(ze(u),ze(f)));return g.forEach(function(v){v.addEventListener("scroll",m,{passive:!0})}),h.addEventListener("resize",m,{passive:!0}),r(),function(){g.forEach(function(v){v.removeEventListener("scroll",m),h.removeEventListener("resize",m)})}}},[t,e,n])}function bU(t,e,n,r,i,a,l,u){var f=_.useRef(t);f.current=t;var h=_.useRef(!1);_.useEffect(function(){if(e&&r&&(!i||a)){var m=function(){h.current=!1},v=function(b){var C;f.current&&!l(((C=b.composedPath)===null||C===void 0||(C=C.call(b))===null||C===void 0?void 0:C[0])||b.target)&&!h.current&&u(!1)},S=Xf(r);S.addEventListener("pointerdown",m,!0),S.addEventListener("mousedown",v,!0),S.addEventListener("contextmenu",v,!0);var w=Qh(n);return w&&(w.addEventListener("mousedown",v,!0),w.addEventListener("contextmenu",v,!0)),function(){S.removeEventListener("pointerdown",m,!0),S.removeEventListener("mousedown",v,!0),S.removeEventListener("contextmenu",v,!0),w&&(w.removeEventListener("mousedown",v,!0),w.removeEventListener("contextmenu",v,!0))}}},[e,n,r,i,a]);function g(){h.current=!0}return g}var SU=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function EU(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q3,e=_.forwardRef(function(n,r){var i=n.prefixCls,a=i===void 0?"rc-trigger-popup":i,l=n.children,u=n.action,f=u===void 0?"hover":u,h=n.showAction,g=n.hideAction,m=n.popupVisible,v=n.defaultPopupVisible,S=n.onPopupVisibleChange,w=n.afterPopupVisibleChange,E=n.mouseEnterDelay,b=n.mouseLeaveDelay,C=b===void 0?.1:b,T=n.focusDelay,A=n.blurDelay,O=n.mask,x=n.maskClosable,N=x===void 0?!0:x,F=n.getPopupContainer,L=n.forceRender,D=n.autoDestroy,V=n.destroyPopupOnHide,B=n.popup,W=n.popupClassName,X=n.popupStyle,Y=n.popupPlacement,ae=n.builtinPlacements,U=ae===void 0?{}:ae,z=n.popupAlign,j=n.zIndex,Z=n.stretch,P=n.getPopupClassNameFromAlign,$=n.fresh,ie=n.alignPoint,se=n.onPopupClick,q=n.onPopupAlign,ce=n.arrow,fe=n.popupMotion,ye=n.maskMotion,Ee=n.popupTransitionName,Ce=n.popupAnimation,Te=n.maskTransitionName,ve=n.maskAnimation,ge=n.className,_e=n.getTriggerDOMNode,Ie=Fn(n,SU),we=D||V||!1,xe=_.useState(!1),Ve=de(xe,2),Fe=Ve[0],Be=Ve[1];Dn(function(){Be(sx())},[]);var nt=_.useRef({}),He=_.useContext(WT),Ge=_.useMemo(function(){return{registerSubPopup:function(gt,sn){nt.current[gt]=sn,He==null||He.registerSubPopup(gt,sn)}}},[He]),Pe=G3(),Me=_.useState(null),dt=de(Me,2),rt=dt[0],it=dt[1],st=_.useRef(null),at=fr(function($e){st.current=$e,pf($e)&&rt!==$e&&it($e),He==null||He.registerSubPopup(Pe,$e)}),Je=_.useState(null),lt=de(Je,2),ft=lt[0],ct=lt[1],mt=_.useRef(null),xt=fr(function($e){pf($e)&&ft!==$e&&(ct($e),mt.current=$e)}),Bt=_.Children.only(l),ht=(Bt==null?void 0:Bt.props)||{},Vt={},qt=fr(function($e){var gt,sn,fn=ft;return(fn==null?void 0:fn.contains($e))||((gt=Qh(fn))===null||gt===void 0?void 0:gt.host)===$e||$e===fn||(rt==null?void 0:rt.contains($e))||((sn=Qh(rt))===null||sn===void 0?void 0:sn.host)===$e||$e===rt||Object.values(nt.current).some(function(An){return(An==null?void 0:An.contains($e))||$e===An})}),wn=qT(a,fe,Ce,Ee),Mn=qT(a,ye,ve,Te),Ut=_.useState(v||!1),It=de(Ut,2),Lt=It[0],Jt=It[1],Mt=m??Lt,qe=fr(function($e){m===void 0&&Jt($e)});Dn(function(){Jt(m||!1)},[m]);var ke=_.useRef(Mt);ke.current=Mt;var Ne=_.useRef([]);Ne.current=[];var Et=fr(function($e){var gt;qe($e),((gt=Ne.current[Ne.current.length-1])!==null&>!==void 0?gt:Mt)!==$e&&(Ne.current.push($e),S==null||S($e))}),en=_.useRef(),Ue=function(){clearTimeout(en.current)},Oe=function(gt){var sn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ue(),sn===0?Et(gt):en.current=setTimeout(function(){Et(gt)},sn*1e3)};_.useEffect(function(){return Ue},[]);var je=_.useState(!1),Ye=de(je,2),We=Ye[0],Qe=Ye[1];Dn(function($e){(!$e||Mt)&&Qe(!0)},[Mt]);var bt=_.useState(null),_t=de(bt,2),Zt=_t[0],Yt=_t[1],vn=_.useState(null),On=de(vn,2),_n=On[0],Zn=On[1],un=function(gt){Zn([gt.clientX,gt.clientY])},rn=_U(Mt,rt,ie&&_n!==null?_n:ft,Y,U,z,q),Ae=de(rn,11),Le=Ae[0],De=Ae[1],be=Ae[2],ut=Ae[3],zt=Ae[4],Ot=Ae[5],In=Ae[6],tn=Ae[7],Vn=Ae[8],Pn=Ae[9],Bn=Ae[10],Or=pU(Fe,f,h,g),er=de(Or,2),Un=er[0],Tn=er[1],Qn=Un.has("click"),Ii=Tn.has("click")||Tn.has("contextMenu"),jr=fr(function(){We||Bn()}),Di=function(){ke.current&&ie&&Ii&&Oe(!1)};yU(Mt,ft,rt,jr,Di),Dn(function(){jr()},[_n,Y]),Dn(function(){Mt&&!(U!=null&&U[Y])&&jr()},[JSON.stringify(z)]);var Fi=_.useMemo(function(){var $e=vU(U,a,Pn,ie);return Ze($e,P==null?void 0:P(Pn))},[Pn,P,U,a,ie]);_.useImperativeHandle(r,function(){return{nativeElement:mt.current,popupElement:st.current,forceAlign:jr}});var Tt=_.useState(0),yt=de(Tt,2),nn=yt[0],Hn=yt[1],Cn=_.useState(0),Nn=de(Cn,2),tr=Nn[0],br=Nn[1],Br=function(){if(Z&&ft){var gt=ft.getBoundingClientRect();Hn(gt.width),br(gt.height)}},Sr=function(){Br(),jr()},Qr=function(gt){Qe(!1),Bn(),w==null||w(gt)},Gr=function(){return new Promise(function(gt){Br(),Yt(function(){return gt})})};Dn(function(){Zt&&(Bn(),Zt(),Yt(null))},[Zt]);function gr($e,gt,sn,fn){Vt[$e]=function(An){var ws;fn==null||fn(An),Oe(gt,sn);for(var tl=arguments.length,Ha=new Array(tl>1?tl-1:0),Ts=1;Ts<tl;Ts++)Ha[Ts-1]=arguments[Ts];(ws=ht[$e])===null||ws===void 0||ws.call.apply(ws,[ht,An].concat(Ha))}}(Qn||Ii)&&(Vt.onClick=function($e){var gt;ke.current&&Ii?Oe(!1):!ke.current&&Qn&&(un($e),Oe(!0));for(var sn=arguments.length,fn=new Array(sn>1?sn-1:0),An=1;An<sn;An++)fn[An-1]=arguments[An];(gt=ht.onClick)===null||gt===void 0||gt.call.apply(gt,[ht,$e].concat(fn))});var $a=bU(Mt,Ii,ft,rt,O,N,qt,Oe),Wr=Un.has("hover"),Go=Tn.has("hover"),ki,fi;Wr&&(gr("onMouseEnter",!0,E,function($e){un($e)}),gr("onPointerEnter",!0,E,function($e){un($e)}),ki=function(gt){(Mt||We)&&rt!==null&&rt!==void 0&&rt.contains(gt.target)&&Oe(!0,E)},ie&&(Vt.onMouseMove=function($e){var gt;(gt=ht.onMouseMove)===null||gt===void 0||gt.call(ht,$e)})),Go&&(gr("onMouseLeave",!1,C),gr("onPointerLeave",!1,C),fi=function(){Oe(!1,C)}),Un.has("focus")&&gr("onFocus",!0,T),Tn.has("focus")&&gr("onBlur",!1,A),Un.has("contextMenu")&&(Vt.onContextMenu=function($e){var gt;ke.current&&Tn.has("contextMenu")?Oe(!1):(un($e),Oe(!0)),$e.preventDefault();for(var sn=arguments.length,fn=new Array(sn>1?sn-1:0),An=1;An<sn;An++)fn[An-1]=arguments[An];(gt=ht.onContextMenu)===null||gt===void 0||gt.call.apply(gt,[ht,$e].concat(fn))}),ge&&(Vt.className=Ze(ht.className,ge));var di=J(J({},ht),Vt),hi={},Bi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Bi.forEach(function($e){Ie[$e]&&(hi[$e]=function(){for(var gt,sn=arguments.length,fn=new Array(sn),An=0;An<sn;An++)fn[An]=arguments[An];(gt=di[$e])===null||gt===void 0||gt.call.apply(gt,[di].concat(fn)),Ie[$e].apply(Ie,fn)})});var Jo=_.cloneElement(Bt,J(J({},di),hi)),Va={x:Ot,y:In},el=ce?J({},ce!==!0?ce:{}):null;return _.createElement(_.Fragment,null,_.createElement(Yo,{disabled:!Mt,ref:xt,onResize:Sr},_.createElement(gU,{getTriggerDOMNode:_e},Jo)),_.createElement(WT.Provider,{value:Ge},_.createElement(hU,{portal:t,ref:at,prefixCls:a,popup:B,className:Ze(W,Fi),style:X,target:ft,onMouseEnter:ki,onMouseLeave:fi,onPointerEnter:ki,zIndex:j,open:Mt,keepDom:We,fresh:$,onClick:se,onPointerDownCapture:$a,mask:O,motion:wn,maskMotion:Mn,onVisibleChanged:Qr,onPrepare:Gr,forceRender:L,autoDestroy:we,getPopupContainer:F,align:Pn,arrow:el,arrowPos:Va,ready:Le,offsetX:De,offsetY:be,offsetR:ut,offsetB:zt,onAlign:jr,stretch:Z,targetWidth:nn/tn,targetHeight:tr/Vn})))});return e}const gx=EU(Q3);var wU=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],TU=function(e){var n=e===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"}}},CU=function(e,n){var r=e.prefixCls;e.disabled;var i=e.visible,a=e.children,l=e.popupElement,u=e.animation,f=e.transitionName,h=e.dropdownStyle,g=e.dropdownClassName,m=e.direction,v=m===void 0?"ltr":m,S=e.placement,w=e.builtinPlacements,E=e.dropdownMatchSelectWidth,b=e.dropdownRender,C=e.dropdownAlign,T=e.getPopupContainer,A=e.empty,O=e.getTriggerDOMNode,x=e.onPopupVisibleChange,N=e.onPopupMouseEnter,F=Fn(e,wU),L="".concat(r,"-dropdown"),D=l;b&&(D=b(l));var V=_.useMemo(function(){return w||TU(E)},[w,E]),B=u?"".concat(L,"-").concat(u):f,W=typeof E=="number",X=_.useMemo(function(){return W?null:E===!1?"minWidth":"width"},[E,W]),Y=h;W&&(Y=J(J({},Y),{},{width:E}));var ae=_.useRef(null);return _.useImperativeHandle(n,function(){return{getPopupElement:function(){var z;return(z=ae.current)===null||z===void 0?void 0:z.popupElement}}}),_.createElement(gx,kt({},F,{showAction:x?["click"]:[],hideAction:x?["click"]:[],popupPlacement:S||(v==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:V,prefixCls:L,popupTransitionName:B,popup:_.createElement("div",{onMouseEnter:N},D),ref:ae,stretch:X,popupAlign:C,popupVisible:i,getPopupContainer:T,popupClassName:Ze(g,K({},"".concat(L,"-empty"),A)),popupStyle:Y,getTriggerDOMNode:O,onPopupVisibleChange:x}),a)},AU=_.forwardRef(CU);function GT(t,e){var n=t.key,r;return"value"in t&&(r=t.value),n??(r!==void 0?r:"rc-index-key-".concat(e))}function T_(t){return typeof t<"u"&&!Number.isNaN(t)}function px(t,e){var n=t||{},r=n.label,i=n.value,a=n.options,l=n.groupLabel,u=r||(e?"children":"label");return{label:u,value:i||"value",options:a||"options",groupLabel:l||u}}function RU(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.fieldNames,r=e.childrenAsData,i=[],a=px(n,!1),l=a.label,u=a.value,f=a.options,h=a.groupLabel;function g(m,v){Array.isArray(m)&&m.forEach(function(S){if(v||!(f in S)){var w=S[u];i.push({key:GT(S,i.length),groupOption:v,data:S,label:S[l],value:w})}else{var E=S[h];E===void 0&&r&&(E=S.label),i.push({key:GT(S,i.length),group:!0,data:S,label:E}),g(S[f],!0)}})}return g(t,!1),i}function C_(t){var e=J({},t);return"props"in e||Object.defineProperty(e,"props",{get:function(){return kr(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var xU=function(e,n,r){if(!n||!n.length)return null;var i=!1,a=function u(f,h){var g=a3(h),m=g[0],v=g.slice(1);if(!m)return[f];var S=f.split(m);return i=i||S.length>1,S.reduce(function(w,E){return[].concat(ze(w),ze(u(E,v)))},[]).filter(Boolean)},l=a(e,n);return i?typeof r<"u"?l.slice(0,r):l:null},Jy=_.createContext(null);function MU(t){var e=t.visible,n=t.values;if(!e)return null;var r=50;return _.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,r).map(function(i){var a=i.label,l=i.value;return["number","string"].includes(pt(a))?a:l}).join(", ")),n.length>r?", ...":null)}var OU=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],PU=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],A_=function(e){return e==="tags"||e==="multiple"},NU=_.forwardRef(function(t,e){var n,r=t.id,i=t.prefixCls,a=t.className,l=t.showSearch,u=t.tagRender,f=t.direction,h=t.omitDomProps,g=t.displayValues,m=t.onDisplayValuesChange,v=t.emptyOptions,S=t.notFoundContent,w=S===void 0?"Not Found":S,E=t.onClear,b=t.mode,C=t.disabled,T=t.loading,A=t.getInputElement,O=t.getRawInputElement,x=t.open,N=t.defaultOpen,F=t.onDropdownVisibleChange,L=t.activeValue,D=t.onActiveValueChange,V=t.activeDescendantId,B=t.searchValue,W=t.autoClearSearchValue,X=t.onSearch,Y=t.onSearchSplit,ae=t.tokenSeparators,U=t.allowClear,z=t.prefix,j=t.suffixIcon,Z=t.clearIcon,P=t.OptionList,$=t.animation,ie=t.transitionName,se=t.dropdownStyle,q=t.dropdownClassName,ce=t.dropdownMatchSelectWidth,fe=t.dropdownRender,ye=t.dropdownAlign,Ee=t.placement,Ce=t.builtinPlacements,Te=t.getPopupContainer,ve=t.showAction,ge=ve===void 0?[]:ve,_e=t.onFocus,Ie=t.onBlur,we=t.onKeyUp,xe=t.onKeyDown,Ve=t.onMouseDown,Fe=Fn(t,OU),Be=A_(b),nt=(l!==void 0?l:Be)||b==="combobox",He=J({},Fe);PU.forEach(function(Tt){delete He[Tt]}),h==null||h.forEach(function(Tt){delete He[Tt]});var Ge=_.useState(!1),Pe=de(Ge,2),Me=Pe[0],dt=Pe[1];_.useEffect(function(){dt(sx())},[]);var rt=_.useRef(null),it=_.useRef(null),st=_.useRef(null),at=_.useRef(null),Je=_.useRef(null),lt=_.useRef(!1),ft=LB(),ct=de(ft,3),mt=ct[0],xt=ct[1],Bt=ct[2];_.useImperativeHandle(e,function(){var Tt,yt;return{focus:(Tt=at.current)===null||Tt===void 0?void 0:Tt.focus,blur:(yt=at.current)===null||yt===void 0?void 0:yt.blur,scrollTo:function(Hn){var Cn;return(Cn=Je.current)===null||Cn===void 0?void 0:Cn.scrollTo(Hn)},nativeElement:rt.current||it.current}});var ht=_.useMemo(function(){var Tt;if(b!=="combobox")return B;var yt=(Tt=g[0])===null||Tt===void 0?void 0:Tt.value;return typeof yt=="string"||typeof yt=="number"?String(yt):""},[B,b,g]),Vt=b==="combobox"&&typeof A=="function"&&A()||null,qt=typeof O=="function"&&O(),wn=Qg(it,qt==null||(n=qt.props)===null||n===void 0?void 0:n.ref),Mn=_.useState(!1),Ut=de(Mn,2),It=Ut[0],Lt=Ut[1];Dn(function(){Lt(!0)},[]);var Jt=Tc(!1,{defaultValue:N,value:x}),Mt=de(Jt,2),qe=Mt[0],ke=Mt[1],Ne=It?qe:!1,Et=!w&&v;(C||Et&&Ne&&b==="combobox")&&(Ne=!1);var en=Et?!1:Ne,Ue=_.useCallback(function(Tt){var yt=Tt!==void 0?Tt:!Ne;C||(ke(yt),Ne!==yt&&(F==null||F(yt)))},[C,Ne,ke,F]),Oe=_.useMemo(function(){return(ae||[]).some(function(Tt){return[`
|
|
|
`,`\r
|
|
|
`].includes(Tt)})},[ae]),je=_.useContext(Jy)||{},Ye=je.maxCount,We=je.rawValues,Qe=function(yt,nn,Hn){if(!(Be&&T_(Ye)&&(We==null?void 0:We.size)>=Ye)){var Cn=!0,Nn=yt;D==null||D(null);var tr=xU(yt,ae,T_(Ye)?Ye-We.size:void 0),br=Hn?null:tr;return b!=="combobox"&&br&&(Nn="",Y==null||Y(br),Ue(!1),Cn=!1),X&&ht!==Nn&&X(Nn,{source:nn?"typing":"effect"}),Cn}},bt=function(yt){!yt||!yt.trim()||X(yt,{source:"submit"})};_.useEffect(function(){!Ne&&!Be&&b!=="combobox"&&Qe("",!1,!1)},[Ne]),_.useEffect(function(){qe&&C&&ke(!1),C&&!lt.current&&xt(!1)},[C]);var _t=ox(),Zt=de(_t,2),Yt=Zt[0],vn=Zt[1],On=_.useRef(!1),_n=function(yt){var nn=Yt(),Hn=yt.key,Cn=Hn==="Enter";if(Cn&&(b!=="combobox"&&yt.preventDefault(),Ne||Ue(!0)),vn(!!ht),Hn==="Backspace"&&!nn&&Be&&!ht&&g.length){for(var Nn=ze(g),tr=null,br=Nn.length-1;br>=0;br-=1){var Br=Nn[br];if(!Br.disabled){Nn.splice(br,1),tr=Br;break}}tr&&m(Nn,{type:"remove",values:[tr]})}for(var Sr=arguments.length,Qr=new Array(Sr>1?Sr-1:0),Gr=1;Gr<Sr;Gr++)Qr[Gr-1]=arguments[Gr];if(Ne&&(!Cn||!On.current)){var gr;Cn&&(On.current=!0),(gr=Je.current)===null||gr===void 0||gr.onKeyDown.apply(gr,[yt].concat(Qr))}xe==null||xe.apply(void 0,[yt].concat(Qr))},Zn=function(yt){for(var nn=arguments.length,Hn=new Array(nn>1?nn-1:0),Cn=1;Cn<nn;Cn++)Hn[Cn-1]=arguments[Cn];if(Ne){var Nn;(Nn=Je.current)===null||Nn===void 0||Nn.onKeyUp.apply(Nn,[yt].concat(Hn))}yt.key==="Enter"&&(On.current=!1),we==null||we.apply(void 0,[yt].concat(Hn))},un=function(yt){var nn=g.filter(function(Hn){return Hn!==yt});m(nn,{type:"remove",values:[yt]})},rn=function(){On.current=!1},Ae=_.useRef(!1),Le=function(){xt(!0),C||(_e&&!Ae.current&&_e.apply(void 0,arguments),ge.includes("focus")&&Ue(!0)),Ae.current=!0},De=function(){lt.current=!0,xt(!1,function(){Ae.current=!1,lt.current=!1,Ue(!1)}),!C&&(ht&&(b==="tags"?X(ht,{source:"submit"}):b==="multiple"&&X("",{source:"blur"})),Ie&&Ie.apply(void 0,arguments))},be=[];_.useEffect(function(){return function(){be.forEach(function(Tt){return clearTimeout(Tt)}),be.splice(0,be.length)}},[]);var ut=function(yt){var nn,Hn=yt.target,Cn=(nn=st.current)===null||nn===void 0?void 0:nn.getPopupElement();if(Cn&&Cn.contains(Hn)){var Nn=setTimeout(function(){var Sr=be.indexOf(Nn);if(Sr!==-1&&be.splice(Sr,1),Bt(),!Me&&!Cn.contains(document.activeElement)){var Qr;(Qr=at.current)===null||Qr===void 0||Qr.focus()}});be.push(Nn)}for(var tr=arguments.length,br=new Array(tr>1?tr-1:0),Br=1;Br<tr;Br++)br[Br-1]=arguments[Br];Ve==null||Ve.apply(void 0,[yt].concat(br))},zt=_.useState({}),Ot=de(zt,2),In=Ot[1];function tn(){In({})}var Vn;qt&&(Vn=function(yt){Ue(yt)}),zB(function(){var Tt;return[rt.current,(Tt=st.current)===null||Tt===void 0?void 0:Tt.getPopupElement()]},en,Ue,!!qt);var Pn=_.useMemo(function(){return J(J({},t),{},{notFoundContent:w,open:Ne,triggerOpen:en,id:r,showSearch:nt,multiple:Be,toggleOpen:Ue})},[t,w,en,Ne,r,nt,Be,Ue]),Bn=!!j||T,Or;Bn&&(Or=_.createElement(ip,{className:Ze("".concat(i,"-arrow"),K({},"".concat(i,"-arrow-loading"),T)),customizeIcon:j,customizeIconProps:{loading:T,searchValue:ht,open:Ne,focused:mt,showSearch:nt}}));var er=function(){var yt;E==null||E(),(yt=at.current)===null||yt===void 0||yt.focus(),m([],{type:"clear",values:g}),Qe("",!1,!1)},Un=BB(i,er,g,U,Z,C,ht,b),Tn=Un.allowClear,Qn=Un.clearIcon,Ii=_.createElement(P,{ref:Je}),jr=Ze(i,a,K(K(K(K(K(K(K(K(K(K({},"".concat(i,"-focused"),mt),"".concat(i,"-multiple"),Be),"".concat(i,"-single"),!Be),"".concat(i,"-allow-clear"),U),"".concat(i,"-show-arrow"),Bn),"".concat(i,"-disabled"),C),"".concat(i,"-loading"),T),"".concat(i,"-open"),Ne),"".concat(i,"-customize-input"),Vt),"".concat(i,"-show-search"),nt)),Di=_.createElement(AU,{ref:st,disabled:C,prefixCls:i,visible:en,popupElement:Ii,animation:$,transitionName:ie,dropdownStyle:se,dropdownClassName:q,direction:f,dropdownMatchSelectWidth:ce,dropdownRender:fe,dropdownAlign:ye,placement:Ee,builtinPlacements:Ce,getPopupContainer:Te,empty:v,getTriggerDOMNode:function(yt){return it.current||yt},onPopupVisibleChange:Vn,onPopupMouseEnter:tn},qt?_.cloneElement(qt,{ref:wn}):_.createElement(cU,kt({},t,{domRef:it,prefixCls:i,inputElement:Vt,ref:at,id:r,prefix:z,showSearch:nt,autoClearSearchValue:W,mode:b,activeDescendantId:V,tagRender:u,values:g,open:Ne,onToggleOpen:Ue,activeValue:L,searchValue:ht,onSearch:Qe,onSearchSubmit:bt,onRemove:un,tokenWithEnter:Oe,onInputBlur:rn}))),Fi;return qt?Fi=Di:Fi=_.createElement("div",kt({className:jr},He,{ref:rt,onMouseDown:ut,onKeyDown:_n,onKeyUp:Zn,onFocus:Le,onBlur:De}),_.createElement(MU,{visible:mt&&!Ne,values:g}),Di,Or,Tn&&Qn),_.createElement(ax.Provider,{value:Pn},Fi)}),eb=function(){return null};eb.isSelectOptGroup=!0;var tb=function(){return null};tb.isSelectOption=!0;var mx=_.forwardRef(function(t,e){var n=t.height,r=t.offsetY,i=t.offsetX,a=t.children,l=t.prefixCls,u=t.onInnerResize,f=t.innerProps,h=t.rtl,g=t.extra,m={},v={display:"flex",flexDirection:"column"};return r!==void 0&&(m={height:n,position:"relative",overflow:"hidden"},v=J(J({},v),{},K(K(K(K(K({transform:"translateY(".concat(r,"px)")},h?"marginRight":"marginLeft",-i),"position","absolute"),"left",0),"right",0),"top",0))),_.createElement("div",{style:m},_.createElement(Yo,{onResize:function(w){var E=w.offsetHeight;E&&u&&u()}},_.createElement("div",kt({style:v,className:Ze(K({},"".concat(l,"-holder-inner"),l)),ref:e},f),a,g)))});mx.displayName="Filler";function IU(t){var e=t.children,n=t.setRef,r=_.useCallback(function(i){n(i)},[]);return _.cloneElement(e,{ref:r})}function DU(t,e,n,r,i,a,l,u){var f=u.getKey;return t.slice(e,n+1).map(function(h,g){var m=e+g,v=l(h,m,{style:{width:r},offsetX:i}),S=f(h);return _.createElement(IU,{key:S,setRef:function(E){return a(h,E)}},v)})}function FU(t,e,n){var r=t.length,i=e.length,a,l;if(r===0&&i===0)return null;r<i?(a=t,l=e):(a=e,l=t);var u={__EMPTY_ITEM__:!0};function f(w){return w!==void 0?n(w):u}for(var h=null,g=Math.abs(r-i)!==1,m=0;m<l.length;m+=1){var v=f(a[m]),S=f(l[m]);if(v!==S){h=m,g=g||v!==f(l[m+1]);break}}return h===null?null:{index:h,multiple:g}}function kU(t,e,n){var r=_.useState(t),i=de(r,2),a=i[0],l=i[1],u=_.useState(null),f=de(u,2),h=f[0],g=f[1];return _.useEffect(function(){var m=FU(a||[],t||[],e);(m==null?void 0:m.index)!==void 0&&g(t[m.index]),l(t)},[t]),[h]}var JT=(typeof navigator>"u"?"undefined":pt(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const vx=function(t,e,n,r){var i=_.useRef(!1),a=_.useRef(null);function l(){clearTimeout(a.current),i.current=!0,a.current=setTimeout(function(){i.current=!1},50)}var u=_.useRef({top:t,bottom:e,left:n,right:r});return u.current.top=t,u.current.bottom=e,u.current.left=n,u.current.right=r,function(f,h){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,m=f?h<0&&u.current.left||h>0&&u.current.right:h<0&&u.current.top||h>0&&u.current.bottom;return g&&m?(clearTimeout(a.current),i.current=!1):(!m||i.current)&&l(),!i.current&&m}};function BU(t,e,n,r,i,a,l){var u=_.useRef(0),f=_.useRef(null),h=_.useRef(null),g=_.useRef(!1),m=vx(e,n,r,i);function v(T,A){if(dr.cancel(f.current),!m(!1,A)){var O=T;if(!O._virtualHandled)O._virtualHandled=!0;else return;u.current+=A,h.current=A,JT||O.preventDefault(),f.current=dr(function(){var x=g.current?10:1;l(u.current*x,!1),u.current=0})}}function S(T,A){l(A,!0),JT||T.preventDefault()}var w=_.useRef(null),E=_.useRef(null);function b(T){if(t){dr.cancel(E.current),E.current=dr(function(){w.current=null},2);var A=T.deltaX,O=T.deltaY,x=T.shiftKey,N=A,F=O;(w.current==="sx"||!w.current&&x&&O&&!A)&&(N=O,F=0,w.current="sx");var L=Math.abs(N),D=Math.abs(F);w.current===null&&(w.current=a&&L>D?"x":"y"),w.current==="y"?v(T,F):S(T,N)}}function C(T){t&&(g.current=T.detail===h.current)}return[b,C]}function UU(t,e,n,r){var i=_.useMemo(function(){return[new Map,[]]},[t,n.id,r]),a=de(i,2),l=a[0],u=a[1],f=function(g){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,v=l.get(g),S=l.get(m);if(v===void 0||S===void 0)for(var w=t.length,E=u.length;E<w;E+=1){var b,C=t[E],T=e(C);l.set(T,E);var A=(b=n.get(T))!==null&&b!==void 0?b:r;if(u[E]=(u[E-1]||0)+A,T===g&&(v=E),T===m&&(S=E),v!==void 0&&S!==void 0)break}return{top:u[v-1]||0,bottom:u[S]}};return f}var LU=function(){function t(){xr(this,t),K(this,"maps",void 0),K(this,"id",0),K(this,"diffKeys",new Set),this.maps=Object.create(null)}return Mr(t,[{key:"set",value:function(n,r){this.maps[n]=r,this.id+=1,this.diffKeys.add(n)}},{key:"get",value:function(n){return this.maps[n]}},{key:"resetRecord",value:function(){this.diffKeys.clear()}},{key:"getRecord",value:function(){return this.diffKeys}}]),t}();function eC(t){var e=parseFloat(t);return isNaN(e)?0:e}function zU(t,e,n){var r=_.useState(0),i=de(r,2),a=i[0],l=i[1],u=_.useRef(new Map),f=_.useRef(new LU),h=_.useRef(0);function g(){h.current+=1}function m(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;g();var w=function(){var C=!1;u.current.forEach(function(T,A){if(T&&T.offsetParent){var O=Gu(T),x=O.offsetHeight,N=getComputedStyle(O),F=N.marginTop,L=N.marginBottom,D=eC(F),V=eC(L),B=x+D+V;f.current.get(A)!==B&&(f.current.set(A,B),C=!0)}}),C&&l(function(T){return T+1})};if(S)w();else{h.current+=1;var E=h.current;Promise.resolve().then(function(){E===h.current&&w()})}}function v(S,w){var E=t(S);u.current.get(E),w?(u.current.set(E,w),m()):u.current.delete(E)}return _.useEffect(function(){return g},[]),[v,m,f.current,a]}var tC=14/15;function $U(t,e,n){var r=_.useRef(!1),i=_.useRef(0),a=_.useRef(0),l=_.useRef(null),u=_.useRef(null),f,h=function(S){if(r.current){var w=Math.ceil(S.touches[0].pageX),E=Math.ceil(S.touches[0].pageY),b=i.current-w,C=a.current-E,T=Math.abs(b)>Math.abs(C);T?i.current=w:a.current=E;var A=n(T,T?b:C,!1,S);A&&S.preventDefault(),clearInterval(u.current),A&&(u.current=setInterval(function(){T?b*=tC:C*=tC;var O=Math.floor(T?b:C);(!n(T,O,!0)||Math.abs(O)<=.1)&&clearInterval(u.current)},16))}},g=function(){r.current=!1,f()},m=function(S){f(),S.touches.length===1&&!r.current&&(r.current=!0,i.current=Math.ceil(S.touches[0].pageX),a.current=Math.ceil(S.touches[0].pageY),l.current=S.target,l.current.addEventListener("touchmove",h,{passive:!1}),l.current.addEventListener("touchend",g,{passive:!0}))};f=function(){l.current&&(l.current.removeEventListener("touchmove",h),l.current.removeEventListener("touchend",g))},Dn(function(){return t&&e.current.addEventListener("touchstart",m,{passive:!0}),function(){var v;(v=e.current)===null||v===void 0||v.removeEventListener("touchstart",m),f(),clearInterval(u.current)}},[t])}function nC(t){return Math.floor(Math.pow(t,.5))}function R_(t,e){var n="touches"in t?t.touches[0]:t;return n[e?"pageX":"pageY"]-window[e?"scrollX":"scrollY"]}function VU(t,e,n){_.useEffect(function(){var r=e.current;if(t&&r){var i=!1,a,l,u=function(){dr.cancel(a)},f=function v(){u(),a=dr(function(){n(l),v()})},h=function(S){if(!S.target.draggable){var w=S;w._virtualHandled||(w._virtualHandled=!0,i=!0)}},g=function(){i=!1,u()},m=function(S){if(i){var w=R_(S,!1),E=r.getBoundingClientRect(),b=E.top,C=E.bottom;if(w<=b){var T=b-w;l=-nC(T),f()}else if(w>=C){var A=w-C;l=nC(A),f()}else u()}};return r.addEventListener("mousedown",h),r.ownerDocument.addEventListener("mouseup",g),r.ownerDocument.addEventListener("mousemove",m),function(){r.removeEventListener("mousedown",h),r.ownerDocument.removeEventListener("mouseup",g),r.ownerDocument.removeEventListener("mousemove",m),u()}}},[t])}var HU=10;function jU(t,e,n,r,i,a,l,u){var f=_.useRef(),h=_.useState(null),g=de(h,2),m=g[0],v=g[1];return Dn(function(){if(m&&m.times<HU){if(!t.current){v(function(Z){return J({},Z)});return}a();var S=m.targetAlign,w=m.originAlign,E=m.index,b=m.offset,C=t.current.clientHeight,T=!1,A=S,O=null;if(C){for(var x=S||w,N=0,F=0,L=0,D=Math.min(e.length-1,E),V=0;V<=D;V+=1){var B=i(e[V]);F=N;var W=n.get(B);L=F+(W===void 0?r:W),N=L}for(var X=x==="top"?b:C-b,Y=D;Y>=0;Y-=1){var ae=i(e[Y]),U=n.get(ae);if(U===void 0){T=!0;break}if(X-=U,X<=0)break}switch(x){case"top":O=F-b;break;case"bottom":O=L-C+b;break;default:{var z=t.current.scrollTop,j=z+C;F<z?A="top":L>j&&(A="bottom")}}O!==null&&l(O),O!==m.lastTop&&(T=!0)}T&&v(J(J({},m),{},{times:m.times+1,targetAlign:A,lastTop:O}))}},[m,t.current]),function(S){if(S==null){u();return}if(dr.cancel(f.current),typeof S=="number")l(S);else if(S&&pt(S)==="object"){var w,E=S.align;"index"in S?w=S.index:w=e.findIndex(function(T){return i(T)===S.key});var b=S.offset,C=b===void 0?0:b;v({times:0,index:w,offset:C,originAlign:E})}}}var rC=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.rtl,i=t.scrollOffset,a=t.scrollRange,l=t.onStartMove,u=t.onStopMove,f=t.onScroll,h=t.horizontal,g=t.spinSize,m=t.containerSize,v=t.style,S=t.thumbStyle,w=t.showScrollBar,E=_.useState(!1),b=de(E,2),C=b[0],T=b[1],A=_.useState(null),O=de(A,2),x=O[0],N=O[1],F=_.useState(null),L=de(F,2),D=L[0],V=L[1],B=!r,W=_.useRef(),X=_.useRef(),Y=_.useState(w),ae=de(Y,2),U=ae[0],z=ae[1],j=_.useRef(),Z=function(){w===!0||w===!1||(clearTimeout(j.current),z(!0),j.current=setTimeout(function(){z(!1)},3e3))},P=a-m||0,$=m-g||0,ie=_.useMemo(function(){if(i===0||P===0)return 0;var ve=i/P;return ve*$},[i,P,$]),se=function(ge){ge.stopPropagation(),ge.preventDefault()},q=_.useRef({top:ie,dragging:C,pageY:x,startTop:D});q.current={top:ie,dragging:C,pageY:x,startTop:D};var ce=function(ge){T(!0),N(R_(ge,h)),V(q.current.top),l(),ge.stopPropagation(),ge.preventDefault()};_.useEffect(function(){var ve=function(we){we.preventDefault()},ge=W.current,_e=X.current;return ge.addEventListener("touchstart",ve,{passive:!1}),_e.addEventListener("touchstart",ce,{passive:!1}),function(){ge.removeEventListener("touchstart",ve),_e.removeEventListener("touchstart",ce)}},[]);var fe=_.useRef();fe.current=P;var ye=_.useRef();ye.current=$,_.useEffect(function(){if(C){var ve,ge=function(we){var xe=q.current,Ve=xe.dragging,Fe=xe.pageY,Be=xe.startTop;dr.cancel(ve);var nt=W.current.getBoundingClientRect(),He=m/(h?nt.width:nt.height);if(Ve){var Ge=(R_(we,h)-Fe)*He,Pe=Be;!B&&h?Pe-=Ge:Pe+=Ge;var Me=fe.current,dt=ye.current,rt=dt?Pe/dt:0,it=Math.ceil(rt*Me);it=Math.max(it,0),it=Math.min(it,Me),ve=dr(function(){f(it,h)})}},_e=function(){T(!1),u()};return window.addEventListener("mousemove",ge,{passive:!0}),window.addEventListener("touchmove",ge,{passive:!0}),window.addEventListener("mouseup",_e,{passive:!0}),window.addEventListener("touchend",_e,{passive:!0}),function(){window.removeEventListener("mousemove",ge),window.removeEventListener("touchmove",ge),window.removeEventListener("mouseup",_e),window.removeEventListener("touchend",_e),dr.cancel(ve)}}},[C]),_.useEffect(function(){return Z(),function(){clearTimeout(j.current)}},[i]),_.useImperativeHandle(e,function(){return{delayHidden:Z}});var Ee="".concat(n,"-scrollbar"),Ce={position:"absolute",visibility:U?null:"hidden"},Te={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return h?(Ce.height=8,Ce.left=0,Ce.right=0,Ce.bottom=0,Te.height="100%",Te.width=g,B?Te.left=ie:Te.right=ie):(Ce.width=8,Ce.top=0,Ce.bottom=0,B?Ce.right=0:Ce.left=0,Te.width="100%",Te.height=g,Te.top=ie),_.createElement("div",{ref:W,className:Ze(Ee,K(K(K({},"".concat(Ee,"-horizontal"),h),"".concat(Ee,"-vertical"),!h),"".concat(Ee,"-visible"),U)),style:J(J({},Ce),v),onMouseDown:se,onMouseMove:Z},_.createElement("div",{ref:X,className:Ze("".concat(Ee,"-thumb"),K({},"".concat(Ee,"-thumb-moving"),C)),style:J(J({},Te),S),onMouseDown:ce}))}),WU=20;function iC(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t/e*t;return isNaN(n)&&(n=0),n=Math.max(n,WU),Math.floor(n)}var XU=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],qU=[],YU={overflowY:"auto",overflowAnchor:"none"};function KU(t,e){var n=t.prefixCls,r=n===void 0?"rc-virtual-list":n,i=t.className,a=t.height,l=t.itemHeight,u=t.fullHeight,f=u===void 0?!0:u,h=t.style,g=t.data,m=t.children,v=t.itemKey,S=t.virtual,w=t.direction,E=t.scrollWidth,b=t.component,C=b===void 0?"div":b,T=t.onScroll,A=t.onVirtualScroll,O=t.onVisibleChange,x=t.innerProps,N=t.extraRender,F=t.styles,L=t.showScrollBar,D=L===void 0?"optional":L,V=Fn(t,XU),B=_.useCallback(function(Ae){return typeof v=="function"?v(Ae):Ae==null?void 0:Ae[v]},[v]),W=zU(B),X=de(W,4),Y=X[0],ae=X[1],U=X[2],z=X[3],j=!!(S!==!1&&a&&l),Z=_.useMemo(function(){return Object.values(U.maps).reduce(function(Ae,Le){return Ae+Le},0)},[U.id,U.maps]),P=j&&g&&(Math.max(l*g.length,Z)>a||!!E),$=w==="rtl",ie=Ze(r,K({},"".concat(r,"-rtl"),$),i),se=g||qU,q=_.useRef(),ce=_.useRef(),fe=_.useRef(),ye=_.useState(0),Ee=de(ye,2),Ce=Ee[0],Te=Ee[1],ve=_.useState(0),ge=de(ve,2),_e=ge[0],Ie=ge[1],we=_.useState(!1),xe=de(we,2),Ve=xe[0],Fe=xe[1],Be=function(){Fe(!0)},nt=function(){Fe(!1)},He={getKey:B};function Ge(Ae){Te(function(Le){var De;typeof Ae=="function"?De=Ae(Le):De=Ae;var be=Lt(De);return q.current.scrollTop=be,be})}var Pe=_.useRef({start:0,end:se.length}),Me=_.useRef(),dt=kU(se,B),rt=de(dt,1),it=rt[0];Me.current=it;var st=_.useMemo(function(){if(!j)return{scrollHeight:void 0,start:0,end:se.length-1,offset:void 0};if(!P){var Ae;return{scrollHeight:((Ae=ce.current)===null||Ae===void 0?void 0:Ae.offsetHeight)||0,start:0,end:se.length-1,offset:void 0}}for(var Le=0,De,be,ut,zt=se.length,Ot=0;Ot<zt;Ot+=1){var In=se[Ot],tn=B(In),Vn=U.get(tn),Pn=Le+(Vn===void 0?l:Vn);Pn>=Ce&&De===void 0&&(De=Ot,be=Le),Pn>Ce+a&&ut===void 0&&(ut=Ot),Le=Pn}return De===void 0&&(De=0,be=0,ut=Math.ceil(a/l)),ut===void 0&&(ut=se.length-1),ut=Math.min(ut+1,se.length-1),{scrollHeight:Le,start:De,end:ut,offset:be}},[P,j,Ce,se,z,a]),at=st.scrollHeight,Je=st.start,lt=st.end,ft=st.offset;Pe.current.start=Je,Pe.current.end=lt,_.useLayoutEffect(function(){var Ae=U.getRecord();if(Ae.size===1){var Le=Array.from(Ae)[0],De=B(se[Je]);if(De===Le){var be=U.get(Le),ut=be-l;Ge(function(zt){return zt+ut})}}U.resetRecord()},[at]);var ct=_.useState({width:0,height:a}),mt=de(ct,2),xt=mt[0],Bt=mt[1],ht=function(Le){Bt({width:Le.offsetWidth,height:Le.offsetHeight})},Vt=_.useRef(),qt=_.useRef(),wn=_.useMemo(function(){return iC(xt.width,E)},[xt.width,E]),Mn=_.useMemo(function(){return iC(xt.height,at)},[xt.height,at]),Ut=at-a,It=_.useRef(Ut);It.current=Ut;function Lt(Ae){var Le=Ae;return Number.isNaN(It.current)||(Le=Math.min(Le,It.current)),Le=Math.max(Le,0),Le}var Jt=Ce<=0,Mt=Ce>=Ut,qe=_e<=0,ke=_e>=E,Ne=vx(Jt,Mt,qe,ke),Et=function(){return{x:$?-_e:_e,y:Ce}},en=_.useRef(Et()),Ue=fr(function(Ae){if(A){var Le=J(J({},Et()),Ae);(en.current.x!==Le.x||en.current.y!==Le.y)&&(A(Le),en.current=Le)}});function Oe(Ae,Le){var De=Ae;Le?(za.flushSync(function(){Ie(De)}),Ue()):Ge(De)}function je(Ae){var Le=Ae.currentTarget.scrollTop;Le!==Ce&&Ge(Le),T==null||T(Ae),Ue()}var Ye=function(Le){var De=Le,be=E?E-xt.width:0;return De=Math.max(De,0),De=Math.min(De,be),De},We=fr(function(Ae,Le){Le?(za.flushSync(function(){Ie(function(De){var be=De+($?-Ae:Ae);return Ye(be)})}),Ue()):Ge(function(De){var be=De+Ae;return be})}),Qe=BU(j,Jt,Mt,qe,ke,!!E,We),bt=de(Qe,2),_t=bt[0],Zt=bt[1];$U(j,q,function(Ae,Le,De,be){var ut=be;return Ne(Ae,Le,De)?!1:!ut||!ut._virtualHandled?(ut&&(ut._virtualHandled=!0),_t({preventDefault:function(){},deltaX:Ae?Le:0,deltaY:Ae?0:Le}),!0):!1}),VU(P,q,function(Ae){Ge(function(Le){return Le+Ae})}),Dn(function(){function Ae(De){var be=Jt&&De.detail<0,ut=Mt&&De.detail>0;j&&!be&&!ut&&De.preventDefault()}var Le=q.current;return Le.addEventListener("wheel",_t,{passive:!1}),Le.addEventListener("DOMMouseScroll",Zt,{passive:!0}),Le.addEventListener("MozMousePixelScroll",Ae,{passive:!1}),function(){Le.removeEventListener("wheel",_t),Le.removeEventListener("DOMMouseScroll",Zt),Le.removeEventListener("MozMousePixelScroll",Ae)}},[j,Jt,Mt]),Dn(function(){if(E){var Ae=Ye(_e);Ie(Ae),Ue({x:Ae})}},[xt.width,E]);var Yt=function(){var Le,De;(Le=Vt.current)===null||Le===void 0||Le.delayHidden(),(De=qt.current)===null||De===void 0||De.delayHidden()},vn=jU(q,se,U,l,B,function(){return ae(!0)},Ge,Yt);_.useImperativeHandle(e,function(){return{nativeElement:fe.current,getScrollInfo:Et,scrollTo:function(Le){function De(be){return be&&pt(be)==="object"&&("left"in be||"top"in be)}De(Le)?(Le.left!==void 0&&Ie(Ye(Le.left)),vn(Le.top)):vn(Le)}}}),Dn(function(){if(O){var Ae=se.slice(Je,lt+1);O(Ae,se)}},[Je,lt,se]);var On=UU(se,B,U,l),_n=N==null?void 0:N({start:Je,end:lt,virtual:P,offsetX:_e,offsetY:ft,rtl:$,getSize:On}),Zn=DU(se,Je,lt,E,_e,Y,m,He),un=null;a&&(un=J(K({},f?"height":"maxHeight",a),YU),j&&(un.overflowY="hidden",E&&(un.overflowX="hidden"),Ve&&(un.pointerEvents="none")));var rn={};return $&&(rn.dir="rtl"),_.createElement("div",kt({ref:fe,style:J(J({},h),{},{position:"relative"}),className:ie},rn,V),_.createElement(Yo,{onResize:ht},_.createElement(C,{className:"".concat(r,"-holder"),style:un,ref:q,onScroll:je,onMouseEnter:Yt},_.createElement(mx,{prefixCls:r,height:at,offsetX:_e,offsetY:ft,scrollWidth:E,onInnerResize:ae,ref:ce,innerProps:x,rtl:$,extra:_n},Zn))),P&&at>a&&_.createElement(rC,{ref:Vt,prefixCls:r,scrollOffset:Ce,scrollRange:at,rtl:$,onScroll:Oe,onStartMove:Be,onStopMove:nt,spinSize:Mn,containerSize:xt.height,style:F==null?void 0:F.verticalScrollBar,thumbStyle:F==null?void 0:F.verticalScrollBarThumb,showScrollBar:D}),P&&E>xt.width&&_.createElement(rC,{ref:qt,prefixCls:r,scrollOffset:_e,scrollRange:E,rtl:$,onScroll:Oe,onStartMove:Be,onStopMove:nt,spinSize:wn,containerSize:xt.width,horizontal:!0,style:F==null?void 0:F.horizontalScrollBar,thumbStyle:F==null?void 0:F.horizontalScrollBarThumb,showScrollBar:D}))}var _x=_.forwardRef(KU);_x.displayName="List";function ZU(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var QU=["disabled","title","children","style","className"];function sC(t){return typeof t=="string"||typeof t=="number"}var GU=function(e,n){var r=UB(),i=r.prefixCls,a=r.id,l=r.open,u=r.multiple,f=r.mode,h=r.searchValue,g=r.toggleOpen,m=r.notFoundContent,v=r.onPopupScroll,S=_.useContext(Jy),w=S.maxCount,E=S.flattenOptions,b=S.onActiveValue,C=S.defaultActiveFirstOption,T=S.onSelect,A=S.menuItemSelectedIcon,O=S.rawValues,x=S.fieldNames,N=S.virtual,F=S.direction,L=S.listHeight,D=S.listItemHeight,V=S.optionRender,B="".concat(i,"-item"),W=Kg(function(){return E},[l,E],function(ve,ge){return ge[0]&&ve[1]!==ge[1]}),X=_.useRef(null),Y=_.useMemo(function(){return u&&T_(w)&&(O==null?void 0:O.size)>=w},[u,w,O==null?void 0:O.size]),ae=function(ge){ge.preventDefault()},U=function(ge){var _e;(_e=X.current)===null||_e===void 0||_e.scrollTo(typeof ge=="number"?{index:ge}:ge)},z=_.useCallback(function(ve){return f==="combobox"?!1:O.has(ve)},[f,ze(O).toString(),O.size]),j=function(ge){for(var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ie=W.length,we=0;we<Ie;we+=1){var xe=(ge+we*_e+Ie)%Ie,Ve=W[xe]||{},Fe=Ve.group,Be=Ve.data;if(!Fe&&!(Be!=null&&Be.disabled)&&(z(Be.value)||!Y))return xe}return-1},Z=_.useState(function(){return j(0)}),P=de(Z,2),$=P[0],ie=P[1],se=function(ge){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;ie(ge);var Ie={source:_e?"keyboard":"mouse"},we=W[ge];if(!we){b(null,-1,Ie);return}b(we.value,ge,Ie)};_.useEffect(function(){se(C!==!1?j(0):-1)},[W.length,h]);var q=_.useCallback(function(ve){return f==="combobox"?String(ve).toLowerCase()===h.toLowerCase():O.has(ve)},[f,h,ze(O).toString(),O.size]);_.useEffect(function(){var ve=setTimeout(function(){if(!u&&l&&O.size===1){var _e=Array.from(O)[0],Ie=W.findIndex(function(we){var xe=we.data;return xe.value===_e});Ie!==-1&&(se(Ie),U(Ie))}});if(l){var ge;(ge=X.current)===null||ge===void 0||ge.scrollTo(void 0)}return function(){return clearTimeout(ve)}},[l,h]);var ce=function(ge){ge!==void 0&&T(ge,{selected:!O.has(ge)}),u||g(!1)};if(_.useImperativeHandle(n,function(){return{onKeyDown:function(ge){var _e=ge.which,Ie=ge.ctrlKey;switch(_e){case et.N:case et.P:case et.UP:case et.DOWN:{var we=0;if(_e===et.UP?we=-1:_e===et.DOWN?we=1:ZU()&&Ie&&(_e===et.N?we=1:_e===et.P&&(we=-1)),we!==0){var xe=j($+we,we);U(xe),se(xe,!0)}break}case et.TAB:case et.ENTER:{var Ve,Fe=W[$];Fe&&!(Fe!=null&&(Ve=Fe.data)!==null&&Ve!==void 0&&Ve.disabled)&&!Y?ce(Fe.value):ce(void 0),l&&ge.preventDefault();break}case et.ESC:g(!1),l&&ge.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ge){U(ge)}}}),W.length===0)return _.createElement("div",{role:"listbox",id:"".concat(a,"_list"),className:"".concat(B,"-empty"),onMouseDown:ae},m);var fe=Object.keys(x).map(function(ve){return x[ve]}),ye=function(ge){return ge.label};function Ee(ve,ge){var _e=ve.group;return{role:_e?"presentation":"option",id:"".concat(a,"_list_").concat(ge)}}var Ce=function(ge){var _e=W[ge];if(!_e)return null;var Ie=_e.data||{},we=Ie.value,xe=_e.group,Ve=Gh(Ie,!0),Fe=ye(_e);return _e?_.createElement("div",kt({"aria-label":typeof Fe=="string"&&!xe?Fe:null},Ve,{key:ge},Ee(_e,ge),{"aria-selected":q(we)}),we):null},Te={role:"listbox",id:"".concat(a,"_list")};return _.createElement(_.Fragment,null,N&&_.createElement("div",kt({},Te,{style:{height:0,width:0,overflow:"hidden"}}),Ce($-1),Ce($),Ce($+1)),_.createElement(_x,{itemKey:"key",ref:X,data:W,height:L,itemHeight:D,fullHeight:!1,onMouseDown:ae,onScroll:v,virtual:N,direction:F,innerProps:N?null:Te},function(ve,ge){var _e=ve.group,Ie=ve.groupOption,we=ve.data,xe=ve.label,Ve=ve.value,Fe=we.key;if(_e){var Be,nt=(Be=we.title)!==null&&Be!==void 0?Be:sC(xe)?xe.toString():void 0;return _.createElement("div",{className:Ze(B,"".concat(B,"-group"),we.className),title:nt},xe!==void 0?xe:Fe)}var He=we.disabled,Ge=we.title;we.children;var Pe=we.style,Me=we.className,dt=Fn(we,QU),rt=V3(dt,fe),it=z(Ve),st=He||!it&&Y,at="".concat(B,"-option"),Je=Ze(B,at,Me,K(K(K(K({},"".concat(at,"-grouped"),Ie),"".concat(at,"-active"),$===ge&&!st),"".concat(at,"-disabled"),st),"".concat(at,"-selected"),it)),lt=ye(ve),ft=!A||typeof A=="function"||it,ct=typeof lt=="number"?lt:lt||Ve,mt=sC(ct)?ct.toString():void 0;return Ge!==void 0&&(mt=Ge),_.createElement("div",kt({},Gh(rt),N?{}:Ee(ve,ge),{"aria-selected":q(Ve),className:Je,title:mt,onMouseMove:function(){$===ge||st||se(ge)},onClick:function(){st||ce(Ve)},style:Pe}),_.createElement("div",{className:"".concat(at,"-content")},typeof V=="function"?V(ve,{index:ge}):ct),_.isValidElement(A)||it,ft&&_.createElement(ip,{className:"".concat(B,"-option-state"),customizeIcon:A,customizeIconProps:{value:Ve,disabled:st,isSelected:it}},it?"✓":null))}))},JU=_.forwardRef(GU);const eL=function(t,e){var n=_.useRef({values:new Map,options:new Map}),r=_.useMemo(function(){var a=n.current,l=a.values,u=a.options,f=t.map(function(m){if(m.label===void 0){var v;return J(J({},m),{},{label:(v=l.get(m.value))===null||v===void 0?void 0:v.label})}return m}),h=new Map,g=new Map;return f.forEach(function(m){h.set(m.value,m),g.set(m.value,e.get(m.value)||u.get(m.value))}),n.current.values=h,n.current.options=g,f},[t,e]),i=_.useCallback(function(a){return e.get(a)||n.current.options.get(a)},[e]);return[r,i]};function kv(t,e){return dx(t).join("").toUpperCase().includes(e)}const tL=function(t,e,n,r,i){return _.useMemo(function(){if(!n||r===!1)return t;var a=e.options,l=e.label,u=e.value,f=[],h=typeof r=="function",g=n.toUpperCase(),m=h?r:function(S,w){return i?kv(w[i],g):w[a]?kv(w[l!=="children"?l:"label"],g):kv(w[u],g)},v=h?function(S){return C_(S)}:function(S){return S};return t.forEach(function(S){if(S[a]){var w=m(n,v(S));if(w)f.push(S);else{var E=S[a].filter(function(b){return m(n,v(b))});E.length&&f.push(J(J({},S),{},K({},a,E)))}return}m(n,v(S))&&f.push(S)}),f},[t,r,i,n,e])};var aC=0,nL=Zr();function rL(){var t;return nL?(t=aC,aC+=1):t="TEST_OR_SSR",t}function iL(t){var e=_.useState(),n=de(e,2),r=n[0],i=n[1];return _.useEffect(function(){i("rc_select_".concat(rL()))},[]),t||r}var sL=["children","value"],aL=["children"];function oL(t){var e=t,n=e.key,r=e.props,i=r.children,a=r.value,l=Fn(r,sL);return J({key:n,value:a!==void 0?a:n,children:i},l)}function yx(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Lo(t).map(function(n,r){if(!_.isValidElement(n)||!n.type)return null;var i=n,a=i.type.isSelectOptGroup,l=i.key,u=i.props,f=u.children,h=Fn(u,aL);return e||!a?oL(n):J(J({key:"__RC_SELECT_GRP__".concat(l===null?r:l,"__"),label:l},h),{},{options:yx(f)})}).filter(function(n){return n})}var lL=function(e,n,r,i,a){return _.useMemo(function(){var l=e,u=!e;u&&(l=yx(n));var f=new Map,h=new Map,g=function(S,w,E){E&&typeof E=="string"&&S.set(w[E],w)},m=function v(S){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,E=0;E<S.length;E+=1){var b=S[E];!b[r.options]||w?(f.set(b[r.value],b),g(h,b,r.label),g(h,b,i),g(h,b,a)):v(b[r.options],!0)}};return m(l),{options:l,valueOptions:f,labelOptions:h}},[e,n,r,i,a])};function oC(t){var e=_.useRef();e.current=t;var n=_.useCallback(function(){return e.current.apply(e,arguments)},[]);return n}var cL=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],uL=["inputValue"];function fL(t){return!t||pt(t)!=="object"}var dL=_.forwardRef(function(t,e){var n=t.id,r=t.mode,i=t.prefixCls,a=i===void 0?"rc-select":i,l=t.backfill,u=t.fieldNames,f=t.inputValue,h=t.searchValue,g=t.onSearch,m=t.autoClearSearchValue,v=m===void 0?!0:m,S=t.onSelect,w=t.onDeselect,E=t.dropdownMatchSelectWidth,b=E===void 0?!0:E,C=t.filterOption,T=t.filterSort,A=t.optionFilterProp,O=t.optionLabelProp,x=t.options,N=t.optionRender,F=t.children,L=t.defaultActiveFirstOption,D=t.menuItemSelectedIcon,V=t.virtual,B=t.direction,W=t.listHeight,X=W===void 0?200:W,Y=t.listItemHeight,ae=Y===void 0?20:Y,U=t.labelRender,z=t.value,j=t.defaultValue,Z=t.labelInValue,P=t.onChange,$=t.maxCount,ie=Fn(t,cL),se=iL(n),q=A_(r),ce=!!(!x&&F),fe=_.useMemo(function(){return C===void 0&&r==="combobox"?!1:C},[C,r]),ye=_.useMemo(function(){return px(u,ce)},[JSON.stringify(u),ce]),Ee=Tc("",{value:h!==void 0?h:f,postState:function(Oe){return Oe||""}}),Ce=de(Ee,2),Te=Ce[0],ve=Ce[1],ge=lL(x,F,ye,A,O),_e=ge.valueOptions,Ie=ge.labelOptions,we=ge.options,xe=_.useCallback(function(Ue){var Oe=dx(Ue);return Oe.map(function(je){var Ye,We,Qe,bt,_t;if(fL(je))Ye=je;else{var Zt;Qe=je.key,We=je.label,Ye=(Zt=je.value)!==null&&Zt!==void 0?Zt:Qe}var Yt=_e.get(Ye);if(Yt){var vn;We===void 0&&(We=Yt==null?void 0:Yt[O||ye.label]),Qe===void 0&&(Qe=(vn=Yt==null?void 0:Yt.key)!==null&&vn!==void 0?vn:Ye),bt=Yt==null?void 0:Yt.disabled,_t=Yt==null?void 0:Yt.title}return{label:We,value:Ye,key:Qe,disabled:bt,title:_t}})},[ye,O,_e]),Ve=Tc(j,{value:z}),Fe=de(Ve,2),Be=Fe[0],nt=Fe[1],He=_.useMemo(function(){var Ue,Oe=q&&Be===null?[]:Be,je=xe(Oe);return r==="combobox"&&rU((Ue=je[0])===null||Ue===void 0?void 0:Ue.value)?[]:je},[Be,xe,r,q]),Ge=eL(He,_e),Pe=de(Ge,2),Me=Pe[0],dt=Pe[1],rt=_.useMemo(function(){if(!r&&Me.length===1){var Ue=Me[0];if(Ue.value===null&&(Ue.label===null||Ue.label===void 0))return[]}return Me.map(function(Oe){var je;return J(J({},Oe),{},{label:(je=typeof U=="function"?U(Oe):Oe.label)!==null&&je!==void 0?je:Oe.value})})},[r,Me,U]),it=_.useMemo(function(){return new Set(Me.map(function(Ue){return Ue.value}))},[Me]);_.useEffect(function(){if(r==="combobox"){var Ue,Oe=(Ue=Me[0])===null||Ue===void 0?void 0:Ue.value;ve(nU(Oe)?String(Oe):"")}},[Me]);var st=oC(function(Ue,Oe){var je=Oe??Ue;return K(K({},ye.value,Ue),ye.label,je)}),at=_.useMemo(function(){if(r!=="tags")return we;var Ue=ze(we),Oe=function(Ye){return _e.has(Ye)};return ze(Me).sort(function(je,Ye){return je.value<Ye.value?-1:1}).forEach(function(je){var Ye=je.value;Oe(Ye)||Ue.push(st(Ye,je.label))}),Ue},[st,we,_e,Me,r]),Je=tL(at,ye,Te,fe,A),lt=_.useMemo(function(){return r!=="tags"||!Te||Je.some(function(Ue){return Ue[A||"value"]===Te})||Je.some(function(Ue){return Ue[ye.value]===Te})?Je:[st(Te)].concat(ze(Je))},[st,A,r,Je,Te,ye]),ft=function Ue(Oe){var je=ze(Oe).sort(function(Ye,We){return T(Ye,We,{searchValue:Te})});return je.map(function(Ye){return Array.isArray(Ye.options)?J(J({},Ye),{},{options:Ye.options.length>0?Ue(Ye.options):Ye.options}):Ye})},ct=_.useMemo(function(){return T?ft(lt):lt},[lt,T,Te]),mt=_.useMemo(function(){return RU(ct,{fieldNames:ye,childrenAsData:ce})},[ct,ye,ce]),xt=function(Oe){var je=xe(Oe);if(nt(je),P&&(je.length!==Me.length||je.some(function(Qe,bt){var _t;return((_t=Me[bt])===null||_t===void 0?void 0:_t.value)!==(Qe==null?void 0:Qe.value)}))){var Ye=Z?je:je.map(function(Qe){return Qe.value}),We=je.map(function(Qe){return C_(dt(Qe.value))});P(q?Ye:Ye[0],q?We:We[0])}},Bt=_.useState(null),ht=de(Bt,2),Vt=ht[0],qt=ht[1],wn=_.useState(0),Mn=de(wn,2),Ut=Mn[0],It=Mn[1],Lt=L!==void 0?L:r!=="combobox",Jt=_.useCallback(function(Ue,Oe){var je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ye=je.source,We=Ye===void 0?"keyboard":Ye;It(Oe),l&&r==="combobox"&&Ue!==null&&We==="keyboard"&&qt(String(Ue))},[l,r]),Mt=function(Oe,je,Ye){var We=function(){var un,rn=dt(Oe);return[Z?{label:rn==null?void 0:rn[ye.label],value:Oe,key:(un=rn==null?void 0:rn.key)!==null&&un!==void 0?un:Oe}:Oe,C_(rn)]};if(je&&S){var Qe=We(),bt=de(Qe,2),_t=bt[0],Zt=bt[1];S(_t,Zt)}else if(!je&&w&&Ye!=="clear"){var Yt=We(),vn=de(Yt,2),On=vn[0],_n=vn[1];w(On,_n)}},qe=oC(function(Ue,Oe){var je,Ye=q?Oe.selected:!0;Ye?je=q?[].concat(ze(Me),[Ue]):[Ue]:je=Me.filter(function(We){return We.value!==Ue}),xt(je),Mt(Ue,Ye),r==="combobox"?qt(""):(!A_||v)&&(ve(""),qt(""))}),ke=function(Oe,je){xt(Oe);var Ye=je.type,We=je.values;(Ye==="remove"||Ye==="clear")&&We.forEach(function(Qe){Mt(Qe.value,!1,Ye)})},Ne=function(Oe,je){if(ve(Oe),qt(null),je.source==="submit"){var Ye=(Oe||"").trim();if(Ye){var We=Array.from(new Set([].concat(ze(it),[Ye])));xt(We),Mt(Ye,!0),ve("")}return}je.source!=="blur"&&(r==="combobox"&&xt(Oe),g==null||g(Oe))},Et=function(Oe){var je=Oe;r!=="tags"&&(je=Oe.map(function(We){var Qe=Ie.get(We);return Qe==null?void 0:Qe.value}).filter(function(We){return We!==void 0}));var Ye=Array.from(new Set([].concat(ze(it),ze(je))));xt(Ye),Ye.forEach(function(We){Mt(We,!0)})},en=_.useMemo(function(){var Ue=V!==!1&&b!==!1;return J(J({},ge),{},{flattenOptions:mt,onActiveValue:Jt,defaultActiveFirstOption:Lt,onSelect:qe,menuItemSelectedIcon:D,rawValues:it,fieldNames:ye,virtual:Ue,direction:B,listHeight:X,listItemHeight:ae,childrenAsData:ce,maxCount:$,optionRender:N})},[$,ge,mt,Jt,Lt,qe,D,it,ye,V,b,B,X,ae,ce,N]);return _.createElement(Jy.Provider,{value:en},_.createElement(NU,kt({},ie,{id:se,prefixCls:a,ref:e,omitDomProps:uL,mode:r,displayValues:rt,onDisplayValuesChange:ke,direction:B,searchValue:Te,onSearch:Ne,autoClearSearchValue:v,onSearchSplit:Et,dropdownMatchSelectWidth:b,OptionList:JU,emptyOptions:!mt.length,activeValue:Vt,activeDescendantId:"".concat(se,"_list_").concat(Ut)})))}),nb=dL;nb.Option=tb;nb.OptGroup=eb;function hL(t,e,n){return Ze({[`${t}-status-success`]:e==="success",[`${t}-status-warning`]:e==="warning",[`${t}-status-error`]:e==="error",[`${t}-status-validating`]:e==="validating",[`${t}-has-feedback`]:n})}const gL=(t,e)=>e||t,pL=()=>{const[,t]=Ws(),[e]=Xy("Empty"),r=new En(t.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return _.createElement("svg",{style:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,(e==null?void 0:e.description)||"Empty"),_.createElement("g",{fill:"none",fillRule:"evenodd"},_.createElement("g",{transform:"translate(24 31.67)"},_.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),_.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),_.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),_.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),_.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),_.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),_.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},_.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),_.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},mL=()=>{const[,t]=Ws(),[e]=Xy("Empty"),{colorFill:n,colorFillTertiary:r,colorFillQuaternary:i,colorBgContainer:a}=t,{borderColor:l,shadowColor:u,contentColor:f}=_.useMemo(()=>({borderColor:new En(n).onBackground(a).toHexString(),shadowColor:new En(r).onBackground(a).toHexString(),contentColor:new En(i).onBackground(a).toHexString()}),[n,r,i,a]);return _.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,(e==null?void 0:e.description)||"Empty"),_.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},_.createElement("ellipse",{fill:u,cx:"32",cy:"33",rx:"32",ry:"7"}),_.createElement("g",{fillRule:"nonzero",stroke:l},_.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),_.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:f}))))},vL=t=>{const{componentCls:e,margin:n,marginXS:r,marginXL:i,fontSize:a,lineHeight:l}=t;return{[e]:{marginInline:r,fontSize:a,lineHeight:l,textAlign:"center",[`${e}-image`]:{height:t.emptyImgHeight,marginBottom:r,opacity:t.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:t.colorTextDescription},[`${e}-footer`]:{marginTop:n},"&-normal":{marginBlock:i,color:t.colorTextDescription,[`${e}-description`]:{color:t.colorTextDescription},[`${e}-image`]:{height:t.emptyImgHeightMD}},"&-small":{marginBlock:r,color:t.colorTextDescription,[`${e}-image`]:{height:t.emptyImgHeightSM}}}}},_L=zc("Empty",t=>{const{componentCls:e,controlHeightLG:n,calc:r}=t,i=ui(t,{emptyImgCls:`${e}-img`,emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()});return[vL(i)]});var yL=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const bx=_.createElement(pL,null),Sx=_.createElement(mL,null),mo=t=>{const{className:e,rootClassName:n,prefixCls:r,image:i=bx,description:a,children:l,imageStyle:u,style:f,classNames:h,styles:g}=t,m=yL(t,["className","rootClassName","prefixCls","image","description","children","imageStyle","style","classNames","styles"]),{getPrefixCls:v,direction:S,className:w,style:E,classNames:b,styles:C}=Uc("empty"),T=v("empty",r),[A,O,x]=_L(T),[N]=Xy("Empty"),F=typeof a<"u"?a:N==null?void 0:N.description,L=typeof F=="string"?F:"empty";let D=null;return typeof i=="string"?D=_.createElement("img",{alt:L,src:i}):D=i,A(_.createElement("div",Object.assign({className:Ze(O,x,T,w,{[`${T}-normal`]:i===Sx,[`${T}-rtl`]:S==="rtl"},e,n,b.root,h==null?void 0:h.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},C.root),E),g==null?void 0:g.root),f)},m),_.createElement("div",{className:Ze(`${T}-image`,b.image,h==null?void 0:h.image),style:Object.assign(Object.assign(Object.assign({},u),C.image),g==null?void 0:g.image)},D),F&&_.createElement("div",{className:Ze(`${T}-description`,b.description,h==null?void 0:h.description),style:Object.assign(Object.assign({},C.description),g==null?void 0:g.description)},F),l&&_.createElement("div",{className:Ze(`${T}-footer`,b.footer,h==null?void 0:h.footer),style:Object.assign(Object.assign({},C.footer),g==null?void 0:g.footer)},l)))};mo.PRESENTED_IMAGE_DEFAULT=bx;mo.PRESENTED_IMAGE_SIMPLE=Sx;const bL=t=>{const{componentName:e}=t,{getPrefixCls:n}=_.useContext(ci),r=n("empty");switch(e){case"Table":case"List":return Ft.createElement(mo,{image:mo.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return Ft.createElement(mo,{image:mo.PRESENTED_IMAGE_SIMPLE,className:`${r}-small`});case"Table.filter":return null;default:return Ft.createElement(mo,null)}},SL=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;var r,i;const{variant:a,[t]:l}=_.useContext(ci),u=_.useContext(IB),f=l==null?void 0:l.variant;let h;typeof e<"u"?h=e:n===!1?h="borderless":h=(i=(r=u??f)!==null&&r!==void 0?r:a)!==null&&i!==void 0?i:"outlined";const g=lF.includes(h);return[h,g]},EL=t=>{const n={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:t==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},n),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},n),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},n),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},n),{points:["br","tr"],offset:[0,-4]})}};function wL(t,e){return t||EL(e)}const lC=t=>{const{optionHeight:e,optionFontSize:n,optionLineHeight:r,optionPadding:i}=t;return{position:"relative",display:"block",minHeight:e,padding:i,color:t.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}},TL=t=>{const{antCls:e,componentCls:n}=t,r=`${n}-item`,i=`&${e}-slide-up-enter${e}-slide-up-enter-active`,a=`&${e}-slide-up-appear${e}-slide-up-appear-active`,l=`&${e}-slide-up-leave${e}-slide-up-leave-active`,u=`${n}-dropdown-placement-`,f=`${r}-option-selected`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},Lc(t)),{position:"absolute",top:-9999,zIndex:t.zIndexPopup,boxSizing:"border-box",padding:t.paddingXXS,overflow:"hidden",fontSize:t.fontSize,fontVariant:"initial",backgroundColor:t.colorBgElevated,borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,[`
|
|
|
${i}${u}bottomLeft,
|
|
|
${a}${u}bottomLeft
|
|
|
`]:{animationName:X3},[`
|
|
|
${i}${u}topLeft,
|
|
|
${a}${u}topLeft,
|
|
|
${i}${u}topRight,
|
|
|
${a}${u}topRight
|
|
|
`]:{animationName:Y3},[`${l}${u}bottomLeft`]:{animationName:q3},[`
|
|
|
${l}${u}topLeft,
|
|
|
${l}${u}topRight
|
|
|
`]:{animationName:K3},"&-hidden":{display:"none"},[r]:Object.assign(Object.assign({},lC(t)),{cursor:"pointer",transition:`background ${t.motionDurationSlow} ease`,borderRadius:t.borderRadiusSM,"&-group":{color:t.colorTextDescription,fontSize:t.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},a_),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:t.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:t.optionSelectedColor,fontWeight:t.optionSelectedFontWeight,backgroundColor:t.optionSelectedBg,[`${r}-option-state`]:{color:t.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:t.colorBgContainerDisabled},color:t.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:t.calc(t.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},lC(t)),{color:t.colorTextDisabled})}),[`${f}:has(+ ${f})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${f}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}})},CT(t,"slide-up"),CT(t,"slide-down"),TT(t,"move-up"),TT(t,"move-down")]},CL=t=>{const{multipleSelectItemHeight:e,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:i}=t,a=t.max(t.calc(n).sub(r).equal(),0),l=t.max(t.calc(a).sub(i).equal(),0);return{basePadding:a,containerPadding:l,itemHeight:Rt(e),itemLineHeight:Rt(t.calc(e).sub(t.calc(t.lineWidth).mul(2)).equal())}},AL=t=>{const{multipleSelectItemHeight:e,selectHeight:n,lineWidth:r}=t;return t.calc(n).sub(e).div(2).sub(r).equal()},RL=t=>{const{componentCls:e,iconCls:n,borderRadiusSM:r,motionDurationSlow:i,paddingXS:a,multipleItemColorDisabled:l,multipleItemBorderColorDisabled:u,colorIcon:f,colorIconHover:h,INTERNAL_FIXED_ITEM_MARGIN:g}=t;return{[`${e}-selection-overflow`]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"},[`${e}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:g,borderRadius:r,cursor:"default",transition:`font-size ${i}, line-height ${i}, height ${i}`,marginInlineEnd:t.calc(g).mul(2).equal(),paddingInlineStart:a,paddingInlineEnd:t.calc(a).div(2).equal(),[`${e}-disabled&`]:{color:l,borderColor:u,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:t.calc(a).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},Yy()),{display:"inline-flex",alignItems:"center",color:f,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:h}})}}}},xL=(t,e)=>{const{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=t,i=`${n}-selection-overflow`,a=t.multipleSelectItemHeight,l=AL(t),u=e?`${n}-${e}`:"",f=CL(t);return{[`${n}-multiple${u}`]:Object.assign(Object.assign({},RL(t)),{[`${n}-selector`]:{display:"flex",alignItems:"center",width:"100%",height:"100%",paddingInline:f.basePadding,paddingBlock:f.containerPadding,borderRadius:t.borderRadius,[`${n}-disabled&`]:{background:t.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Rt(r)} 0`,lineHeight:Rt(a),visibility:"hidden",content:'"\\a0"'}},[`${n}-selection-item`]:{height:f.itemHeight,lineHeight:Rt(f.itemLineHeight)},[`${n}-selection-wrap`]:{alignSelf:"flex-start","&:after":{lineHeight:Rt(a),marginBlock:r}},[`${n}-prefix`]:{marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(f.basePadding).equal()},[`${i}-item + ${i}-item,
|
|
|
${n}-prefix + ${n}-selection-wrap
|
|
|
`]:{[`${n}-selection-search`]:{marginInlineStart:0},[`${n}-selection-placeholder`]:{insetInlineStart:0}},[`${i}-item-suffix`]:{minHeight:f.itemHeight,marginBlock:r},[`${n}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(l).equal(),"\n &-input,\n &-mirror\n ":{height:a,fontFamily:t.fontFamily,lineHeight:Rt(a),transition:`all ${t.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${n}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(f.basePadding).equal(),insetInlineEnd:t.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${t.motionDurationSlow}`}})}};function Bv(t,e){const{componentCls:n}=t,r=e?`${n}-${e}`:"",i={[`${n}-multiple${r}`]:{fontSize:t.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:"text"}},[`
|
|
|
&${n}-show-arrow ${n}-selector,
|
|
|
&${n}-allow-clear ${n}-selector
|
|
|
`]:{paddingInlineEnd:t.calc(t.fontSizeIcon).add(t.controlPaddingHorizontal).equal()}}};return[xL(t,e),i]}const ML=t=>{const{componentCls:e}=t,n=ui(t,{selectHeight:t.controlHeightSM,multipleSelectItemHeight:t.multipleItemHeightSM,borderRadius:t.borderRadiusSM,borderRadiusSM:t.borderRadiusXS}),r=ui(t,{fontSize:t.fontSizeLG,selectHeight:t.controlHeightLG,multipleSelectItemHeight:t.multipleItemHeightLG,borderRadius:t.borderRadiusLG,borderRadiusSM:t.borderRadius});return[Bv(t),Bv(n,"sm"),{[`${e}-multiple${e}-sm`]:{[`${e}-selection-placeholder`]:{insetInline:t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal()},[`${e}-selection-search`]:{marginInlineStart:2}}},Bv(r,"lg")]};function Uv(t,e){const{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=t,a=t.calc(t.controlHeight).sub(t.calc(t.lineWidth).mul(2)).equal(),l=e?`${n}-${e}`:"";return{[`${n}-single${l}`]:{fontSize:t.fontSize,height:t.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},Lc(t,!0)),{display:"flex",borderRadius:i,flex:"1 1 auto",[`${n}-selection-search`]:{position:"absolute",inset:0,width:"100%","&-input":{width:"100%",WebkitAppearance:"textfield"}},[`
|
|
|
${n}-selection-item,
|
|
|
${n}-selection-placeholder
|
|
|
`]:{display:"block",padding:0,lineHeight:Rt(a),transition:`all ${t.motionDurationSlow}, visibility 0s`,alignSelf:"center"},[`${n}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${n}-selection-item:empty:after`,`${n}-selection-placeholder:empty:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
|
|
|
&${n}-show-arrow ${n}-selection-item,
|
|
|
&${n}-show-arrow ${n}-selection-search,
|
|
|
&${n}-show-arrow ${n}-selection-placeholder
|
|
|
`]:{paddingInlineEnd:t.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:t.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:"100%",height:"100%",alignItems:"center",padding:`0 ${Rt(r)}`,[`${n}-selection-search-input`]:{height:a},"&:after":{lineHeight:Rt(a)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:"none"},[`${n}-selection-search`]:{position:"static",width:"100%"},[`${n}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Rt(r)}`,"&:after":{display:"none"}}}}}}}function OL(t){const{componentCls:e}=t,n=t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal();return[Uv(t),Uv(ui(t,{controlHeight:t.controlHeightSM,borderRadius:t.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selector`]:{padding:`0 ${Rt(n)}`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:t.calc(n).add(t.calc(t.fontSize).mul(1.5)).equal()},[`
|
|
|
&${e}-show-arrow ${e}-selection-item,
|
|
|
&${e}-show-arrow ${e}-selection-placeholder
|
|
|
`]:{paddingInlineEnd:t.calc(t.fontSize).mul(1.5).equal()}}}},Uv(ui(t,{controlHeight:t.singleItemHeightLG,fontSize:t.fontSizeLG,borderRadius:t.borderRadiusLG}),"lg")]}const PL=t=>{const{fontSize:e,lineHeight:n,lineWidth:r,controlHeight:i,controlHeightSM:a,controlHeightLG:l,paddingXXS:u,controlPaddingHorizontal:f,zIndexPopupBase:h,colorText:g,fontWeightStrong:m,controlItemBgActive:v,controlItemBgHover:S,colorBgContainer:w,colorFillSecondary:E,colorBgContainerDisabled:b,colorTextDisabled:C,colorPrimaryHover:T,colorPrimary:A,controlOutline:O}=t,x=u*2,N=r*2,F=Math.min(i-x,i-N),L=Math.min(a-x,a-N),D=Math.min(l-x,l-N);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(u/2),zIndexPopup:h+50,optionSelectedColor:g,optionSelectedFontWeight:m,optionSelectedBg:v,optionActiveBg:S,optionPadding:`${(i-e*n)/2}px ${f}px`,optionFontSize:e,optionLineHeight:n,optionHeight:i,selectorBg:w,clearBg:w,singleItemHeightLG:l,multipleItemBg:E,multipleItemBorderColor:"transparent",multipleItemHeight:F,multipleItemHeightSM:L,multipleItemHeightLG:D,multipleSelectorBgDisabled:b,multipleItemColorDisabled:C,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(t.fontSize*1.25),hoverBorderColor:T,activeBorderColor:A,activeOutlineColor:O,selectAffixPadding:u}},Ex=(t,e)=>{const{componentCls:n,antCls:r,controlOutlineWidth:i}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Rt(t.lineWidth)} ${t.lineType} ${e.borderColor}`,background:t.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:e.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:e.activeBorderColor,boxShadow:`0 0 0 ${Rt(i)} ${e.activeOutlineColor}`,outline:0},[`${n}-prefix`]:{color:e.color}}}},cC=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},Ex(t,e))}),NL=t=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},Ex(t,{borderColor:t.colorBorder,hoverBorderHover:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeOutlineColor:t.activeOutlineColor,color:t.colorText})),cC(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeOutlineColor:t.colorErrorOutline,color:t.colorError})),cC(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeOutlineColor:t.colorWarningOutline,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),wx=(t,e)=>{const{componentCls:n,antCls:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:e.bg,border:`${Rt(t.lineWidth)} ${t.lineType} transparent`,color:e.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:e.hoverBg},[`${n}-focused& ${n}-selector`]:{background:t.selectorBg,borderColor:e.activeBorderColor,outline:0}}}},uC=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},wx(t,e))}),IL=t=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},wx(t,{bg:t.colorFillTertiary,hoverBg:t.colorFillSecondary,activeBorderColor:t.activeBorderColor,color:t.colorText})),uC(t,{status:"error",bg:t.colorErrorBg,hoverBg:t.colorErrorBgHover,activeBorderColor:t.colorError,color:t.colorError})),uC(t,{status:"warning",bg:t.colorWarningBg,hoverBg:t.colorWarningBgHover,activeBorderColor:t.colorWarning,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{borderColor:t.colorBorder,background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.colorBgContainer,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`}})}),DL=t=>({"&-borderless":{[`${t.componentCls}-selector`]:{background:"transparent",border:`${Rt(t.lineWidth)} ${t.lineType} transparent`},[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`},[`&${t.componentCls}-status-error`]:{[`${t.componentCls}-prefix, ${t.componentCls}-selection-item`]:{color:t.colorError}},[`&${t.componentCls}-status-warning`]:{[`${t.componentCls}-prefix, ${t.componentCls}-selection-item`]:{color:t.colorWarning}}}}),Tx=(t,e)=>{const{componentCls:n,antCls:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{borderWidth:`0 0 ${Rt(t.lineWidth)} 0`,borderStyle:`none none ${t.lineType} none`,borderColor:e.borderColor,background:t.selectorBg,borderRadius:0},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:e.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:e.activeBorderColor,outline:0},[`${n}-prefix`]:{color:e.color}}}},fC=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},Tx(t,e))}),FL=t=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},Tx(t,{borderColor:t.colorBorder,hoverBorderHover:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeOutlineColor:t.activeOutlineColor,color:t.colorText})),fC(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeOutlineColor:t.colorErrorOutline,color:t.colorError})),fC(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeOutlineColor:t.colorWarningOutline,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),kL=t=>({[t.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},NL(t)),IL(t)),DL(t)),FL(t))}),BL=t=>{const{componentCls:e}=t;return{position:"relative",transition:`all ${t.motionDurationMid} ${t.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${e}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},UL=t=>{const{componentCls:e}=t;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},LL=t=>{const{antCls:e,componentCls:n,inputPaddingHorizontalBase:r,iconCls:i}=t;return{[n]:Object.assign(Object.assign({},Lc(t)),{position:"relative",display:"inline-flex",cursor:"pointer",[`&:not(${n}-customize-input) ${n}-selector`]:Object.assign(Object.assign({},BL(t)),UL(t)),[`${n}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},a_),{[`> ${e}-typography`]:{display:"inline"}}),[`${n}-selection-placeholder`]:Object.assign(Object.assign({},a_),{flex:1,color:t.colorTextPlaceholder,pointerEvents:"none"}),[`${n}-arrow`]:Object.assign(Object.assign({},Yy()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${t.motionDurationSlow} ease`,[i]:{verticalAlign:"top",transition:`transform ${t.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${n}-suffix)`]:{pointerEvents:"auto"}},[`${n}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${n}-selection-wrap`]:{display:"flex",width:"100%",position:"relative",minWidth:0,"&:after":{content:'"\\a0"',width:0,overflow:"hidden"}},[`${n}-prefix`]:{flex:"none",marginInlineEnd:t.selectAffixPadding},[`${n}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:t.fontSizeIcon,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${t.motionDurationMid} ease, opacity ${t.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:t.colorTextTertiary}},[`&:hover ${n}-clear`]:{opacity:1,background:t.colorBgBase,borderRadius:"50%"}}),[`${n}-status`]:{"&-error, &-warning, &-success, &-validating":{[`&${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:t.calc(r).add(t.fontSize).add(t.paddingXS).equal()}}}}}},zL=t=>{const{componentCls:e}=t;return[{[e]:{[`&${e}-in-form-item`]:{width:"100%"}}},LL(t),OL(t),ML(t),TL(t),{[`${e}-rtl`]:{direction:"rtl"}},x8(t,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},$L=zc("Select",(t,e)=>{let{rootPrefixCls:n}=e;const r=ui(t,{rootPrefixCls:n,inputPaddingHorizontalBase:t.calc(t.paddingSM).sub(1).equal(),multipleSelectItemHeight:t.multipleItemHeight,selectHeight:t.controlHeight});return[zL(r),kL(r)]},PL,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}});var VL={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},HL=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:VL}))},jL=_.forwardRef(HL),WL={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},XL=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:WL}))},qL=_.forwardRef(XL),YL={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},KL=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:YL}))},ZL=_.forwardRef(KL);function QL(t){let{suffixIcon:e,clearIcon:n,menuItemSelectedIcon:r,removeIcon:i,loading:a,multiple:l,hasFeedback:u,prefixCls:f,showSuffixIcon:h,feedbackIcon:g,showArrow:m,componentName:v}=t;const S=n??_.createElement(Rk,null),w=T=>e===null&&!u&&!m?null:_.createElement(_.Fragment,null,h!==!1&&T,u&&g);let E=null;if(e!==void 0)E=w(e);else if(a)E=w(_.createElement($k,{spin:!0}));else{const T=`${f}-suffix`;E=A=>{let{open:O,showSearch:x}=A;return w(O&&x?_.createElement(ZL,{className:T}):_.createElement(qL,{className:T}))}}let b=null;r!==void 0?b=r:l?b=_.createElement(jL,null):b=null;let C=null;return i!==void 0?C=i:C=_.createElement(Ok,null),{clearIcon:S,suffixIcon:E,itemIcon:b,removeIcon:C}}function GL(t,e){return e!==void 0?e:t!==null}var JL=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Cx="SECRET_COMBOBOX_MODE_DO_NOT_USE",e7=(t,e)=>{var n;const{prefixCls:r,bordered:i,className:a,rootClassName:l,getPopupContainer:u,popupClassName:f,dropdownClassName:h,listHeight:g=256,placement:m,listItemHeight:v,size:S,disabled:w,notFoundContent:E,status:b,builtinPlacements:C,dropdownMatchSelectWidth:T,popupMatchSelectWidth:A,direction:O,style:x,allowClear:N,variant:F,dropdownStyle:L,transitionName:D,tagRender:V,maxCount:B,prefix:W}=t,X=JL(t,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount","prefix"]),{getPopupContainer:Y,getPrefixCls:ae,renderEmpty:U,direction:z,virtual:j,popupMatchSelectWidth:Z,popupOverflow:P}=_.useContext(ci),$=Uc("select"),[,ie]=Ws(),se=v??(ie==null?void 0:ie.controlHeight),q=ae("select",r),ce=ae(),fe=O??z,{compactSize:ye,compactItemClassnames:Ee}=Yk(q,fe),[Ce,Te]=SL("select",F,i),ve=Uk(q),[ge,_e,Ie]=$L(q,ve),we=_.useMemo(()=>{const{mode:Vt}=t;if(Vt!=="combobox")return Vt===Cx?"combobox":Vt},[t.mode]),xe=we==="multiple"||we==="tags",Ve=GL(t.suffixIcon,t.showArrow),Fe=(n=A??T)!==null&&n!==void 0?n:Z,{status:Be,hasFeedback:nt,isFormItemInput:He,feedbackIcon:Ge}=_.useContext(E_),Pe=gL(Be,b);let Me;E!==void 0?Me=E:we==="combobox"?Me=null:Me=(U==null?void 0:U("Select"))||_.createElement(bL,{componentName:"Select"});const{suffixIcon:dt,itemIcon:rt,removeIcon:it,clearIcon:st}=QL(Object.assign(Object.assign({},X),{multiple:xe,hasFeedback:nt,feedbackIcon:Ge,showSuffixIcon:Ve,prefixCls:q,componentName:"Select"})),at=N===!0?{clearIcon:st}:N,Je=V3(X,["suffixIcon","itemIcon"]),lt=Ze(f||h,{[`${q}-dropdown-${fe}`]:fe==="rtl"},l,Ie,ve,_e),ft=H3(Vt=>{var qt;return(qt=S??ye)!==null&&qt!==void 0?qt:Vt}),ct=_.useContext(wf),mt=w??ct,xt=Ze({[`${q}-lg`]:ft==="large",[`${q}-sm`]:ft==="small",[`${q}-rtl`]:fe==="rtl",[`${q}-${Ce}`]:Te,[`${q}-in-form-item`]:He},hL(q,Pe,nt),Ee,$.className,a,l,Ie,ve,_e),Bt=_.useMemo(()=>m!==void 0?m:fe==="rtl"?"bottomRight":"bottomLeft",[m,fe]),[ht]=z3("SelectLike",L==null?void 0:L.zIndex);return ge(_.createElement(nb,Object.assign({ref:e,virtual:j,showSearch:$.showSearch},Je,{style:Object.assign(Object.assign({},$.style),x),dropdownMatchSelectWidth:Fe,transitionName:$3(ce,"slide-up",D),builtinPlacements:wL(C,P),listHeight:g,listItemHeight:se,mode:we,prefixCls:q,placement:Bt,direction:fe,prefix:W,suffixIcon:dt,menuItemSelectedIcon:rt,removeIcon:it,allowClear:at,notFoundContent:Me,className:xt,getPopupContainer:u||Y,dropdownClassName:lt,disabled:mt,dropdownStyle:Object.assign(Object.assign({},L),{zIndex:ht}),maxCount:xe?B:void 0,tagRender:xe?V:void 0})))},Hc=_.forwardRef(e7),t7=kB(Hc,"dropdownAlign");Hc.SECRET_COMBOBOX_MODE_DO_NOT_USE=Cx;Hc.Option=tb;Hc.OptGroup=eb;Hc._InternalPanelDoNotUseOrYouWillBeFired=t7;function Ax(t){var e=t.children,n=t.prefixCls,r=t.id,i=t.overlayInnerStyle,a=t.bodyClassName,l=t.className,u=t.style;return _.createElement("div",{className:Ze("".concat(n,"-content"),l),style:u},_.createElement("div",{className:Ze("".concat(n,"-inner"),a),id:r,role:"tooltip",style:i},typeof e=="function"?e():e))}var Ul={shiftX:64,adjustY:1},Ll={adjustX:1,shiftY:!0},Ai=[0,0],n7={left:{points:["cr","cl"],overflow:Ll,offset:[-4,0],targetOffset:Ai},right:{points:["cl","cr"],overflow:Ll,offset:[4,0],targetOffset:Ai},top:{points:["bc","tc"],overflow:Ul,offset:[0,-4],targetOffset:Ai},bottom:{points:["tc","bc"],overflow:Ul,offset:[0,4],targetOffset:Ai},topLeft:{points:["bl","tl"],overflow:Ul,offset:[0,-4],targetOffset:Ai},leftTop:{points:["tr","tl"],overflow:Ll,offset:[-4,0],targetOffset:Ai},topRight:{points:["br","tr"],overflow:Ul,offset:[0,-4],targetOffset:Ai},rightTop:{points:["tl","tr"],overflow:Ll,offset:[4,0],targetOffset:Ai},bottomRight:{points:["tr","br"],overflow:Ul,offset:[0,4],targetOffset:Ai},rightBottom:{points:["bl","br"],overflow:Ll,offset:[4,0],targetOffset:Ai},bottomLeft:{points:["tl","bl"],overflow:Ul,offset:[0,4],targetOffset:Ai},leftBottom:{points:["br","bl"],overflow:Ll,offset:[-4,0],targetOffset:Ai}},r7=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],i7=function(e,n){var r=e.overlayClassName,i=e.trigger,a=i===void 0?["hover"]:i,l=e.mouseEnterDelay,u=l===void 0?0:l,f=e.mouseLeaveDelay,h=f===void 0?.1:f,g=e.overlayStyle,m=e.prefixCls,v=m===void 0?"rc-tooltip":m,S=e.children,w=e.onVisibleChange,E=e.afterVisibleChange,b=e.transitionName,C=e.animation,T=e.motion,A=e.placement,O=A===void 0?"right":A,x=e.align,N=x===void 0?{}:x,F=e.destroyTooltipOnHide,L=F===void 0?!1:F,D=e.defaultVisible,V=e.getTooltipContainer,B=e.overlayInnerStyle;e.arrowContent;var W=e.overlay,X=e.id,Y=e.showArrow,ae=Y===void 0?!0:Y,U=e.classNames,z=e.styles,j=Fn(e,r7),Z=G3(X),P=_.useRef(null);_.useImperativeHandle(n,function(){return P.current});var $=J({},j);"visible"in e&&($.popupVisible=e.visible);var ie=function(){return _.createElement(Ax,{key:"content",prefixCls:v,id:Z,bodyClassName:U==null?void 0:U.body,overlayInnerStyle:J(J({},B),z==null?void 0:z.body)},W)},se=function(){var ce=_.Children.only(S),fe=(ce==null?void 0:ce.props)||{},ye=J(J({},fe),{},{"aria-describedby":W?Z:null});return _.cloneElement(S,ye)};return _.createElement(gx,kt({popupClassName:Ze(r,U==null?void 0:U.root),prefixCls:v,popup:ie,action:a,builtinPlacements:n7,popupPlacement:O,ref:P,popupAlign:N,getPopupContainer:V,onPopupVisibleChange:w,afterPopupVisibleChange:E,popupTransitionName:b,popupAnimation:C,popupMotion:T,defaultPopupVisible:D,autoDestroy:L,mouseLeaveDelay:h,popupStyle:J(J({},g),z==null?void 0:z.root),mouseEnterDelay:u,arrow:ae},$),se())};const s7=_.forwardRef(i7);function a7(t){const{sizePopupArrow:e,borderRadiusXS:n,borderRadiusOuter:r}=t,i=e/2,a=0,l=i,u=r*1/Math.sqrt(2),f=i-r*(1-1/Math.sqrt(2)),h=i-n*(1/Math.sqrt(2)),g=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),m=2*i-h,v=g,S=2*i-u,w=f,E=2*i-a,b=l,C=i*Math.sqrt(2)+r*(Math.sqrt(2)-2),T=r*(Math.sqrt(2)-1),A=`polygon(${T}px 100%, 50% ${T}px, ${2*i-T}px 100%, ${T}px 100%)`,O=`path('M ${a} ${l} A ${r} ${r} 0 0 0 ${u} ${f} L ${h} ${g} A ${n} ${n} 0 0 1 ${m} ${v} L ${S} ${w} A ${r} ${r} 0 0 0 ${E} ${b} Z')`;return{arrowShadowWidth:C,arrowPath:O,arrowPolygon:A}}const o7=(t,e,n)=>{const{sizePopupArrow:r,arrowPolygon:i,arrowPath:a,arrowShadowWidth:l,borderRadiusXS:u,calc:f}=t;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:f(r).div(2).equal(),background:e,clipPath:{_multi_value_:!0,value:[i,a]},content:'""'},"&::after":{content:'""',position:"absolute",width:l,height:l,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Rt(u)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},Rx=8;function xx(t){const{contentRadius:e,limitVerticalRadius:n}=t,r=e>12?e+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?Rx:r}}function uh(t,e){return t?e:{}}function l7(t,e,n){const{componentCls:r,boxShadowPopoverArrow:i,arrowOffsetVertical:a,arrowOffsetHorizontal:l}=t,{arrowDistance:u=0,arrowPlacement:f={left:!0,right:!0,top:!0,bottom:!0}}={};return{[r]:Object.assign(Object.assign(Object.assign(Object.assign({[`${r}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},o7(t,e,i)),{"&:before":{background:e}})]},uh(!!f.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:u,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":l,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:l}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${Rt(l)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:l}}}})),uh(!!f.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:u,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":l,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:l}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${Rt(l)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:l}}}})),uh(!!f.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:u},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:a},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:a}})),uh(!!f.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:u},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:a},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:a}}))}}function c7(t,e,n,r){if(r===!1)return{adjustX:!1,adjustY:!1};const i=r&&typeof r=="object"?r:{},a={};switch(t){case"top":case"bottom":a.shiftX=e.arrowOffsetHorizontal*2+n,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=e.arrowOffsetVertical*2+n,a.shiftX=!0,a.adjustX=!0;break}const l=Object.assign(Object.assign({},a),i);return l.shiftX||(l.adjustX=!0),l.shiftY||(l.adjustY=!0),l}const dC={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},u7={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},f7=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function d7(t){const{arrowWidth:e,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:a}=t,l=e/2,u={};return Object.keys(dC).forEach(f=>{const h=r&&u7[f]||dC[f],g=Object.assign(Object.assign({},h),{offset:[0,0],dynamicInset:!0});switch(u[f]=g,f7.has(f)&&(g.autoArrow=!1),f){case"top":case"topLeft":case"topRight":g.offset[1]=-l-i;break;case"bottom":case"bottomLeft":case"bottomRight":g.offset[1]=l+i;break;case"left":case"leftTop":case"leftBottom":g.offset[0]=-l-i;break;case"right":case"rightTop":case"rightBottom":g.offset[0]=l+i;break}const m=xx({contentRadius:a,limitVerticalRadius:!0});if(r)switch(f){case"topLeft":case"bottomLeft":g.offset[0]=-m.arrowOffsetHorizontal-l;break;case"topRight":case"bottomRight":g.offset[0]=m.arrowOffsetHorizontal+l;break;case"leftTop":case"rightTop":g.offset[1]=-m.arrowOffsetHorizontal*2+l;break;case"leftBottom":case"rightBottom":g.offset[1]=m.arrowOffsetHorizontal*2-l;break}g.overflow=c7(f,m,e,n),g.htmlRegion="visibleFirst"}),u}const h7=t=>{const{calc:e,componentCls:n,tooltipMaxWidth:r,tooltipColor:i,tooltipBg:a,tooltipBorderRadius:l,zIndexPopup:u,controlHeight:f,boxShadowSecondary:h,paddingSM:g,paddingXS:m,arrowOffsetHorizontal:v,sizePopupArrow:S}=t,w=e(l).add(S).add(v).equal(),E=e(l).mul(2).add(S).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},Lc(t)),{position:"absolute",zIndex:u,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":a,[`${n}-inner`]:{minWidth:E,minHeight:f,padding:`${Rt(t.calc(g).div(2).equal())} ${Rt(m)}`,color:i,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:a,borderRadius:l,boxShadow:h,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:w},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:t.min(l,Rx)}},[`${n}-content`]:{position:"relative"}}),DF(t,(b,C)=>{let{darkColor:T}=C;return{[`&${n}-${b}`]:{[`${n}-inner`]:{backgroundColor:T},[`${n}-arrow`]:{"--antd-arrow-background-color":T}}}})),{"&-rtl":{direction:"rtl"}})},l7(t,"var(--antd-arrow-background-color)"),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:t.sizePopupArrow}}]},g7=t=>Object.assign(Object.assign({zIndexPopup:t.zIndexPopupBase+70},xx({contentRadius:t.borderRadius,limitVerticalRadius:!0})),a7(ui(t,{borderRadiusOuter:Math.min(t.borderRadiusOuter,4)}))),Mx=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return zc("Tooltip",r=>{const{borderRadius:i,colorTextLightSolid:a,colorBgSpotlight:l}=r,u=ui(r,{tooltipMaxWidth:250,tooltipColor:a,tooltipBorderRadius:i,tooltipBg:l});return[h7(u),C8(r,"zoom-big-fast")]},g7,{resetStyle:!1,injectStyle:e})(t)},p7=Zh.map(t=>`${t}-inverse`);function m7(t){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(ze(p7),ze(Zh)).includes(t):Zh.includes(t)}function Ox(t,e){const n=m7(e),r=Ze({[`${t}-${e}`]:e&&n}),i={},a={};return e&&!n&&(i.background=e,a["--antd-arrow-background-color"]=e),{className:r,overlayStyle:i,arrowStyle:a}}const v7=t=>{const{prefixCls:e,className:n,placement:r="top",title:i,color:a,overlayInnerStyle:l}=t,{getPrefixCls:u}=_.useContext(ci),f=u("tooltip",e),[h,g,m]=Mx(f),v=Ox(f,a),S=v.arrowStyle,w=Object.assign(Object.assign({},l),v.overlayStyle),E=Ze(g,m,f,`${f}-pure`,`${f}-placement-${r}`,n,v.className);return h(_.createElement("div",{className:E,style:S},_.createElement("div",{className:`${f}-arrow`}),_.createElement(Ax,Object.assign({},t,{className:g,prefixCls:f,overlayInnerStyle:w}),i)))};var _7=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const y7=_.forwardRef((t,e)=>{var n,r;const{prefixCls:i,openClassName:a,getTooltipContainer:l,color:u,overlayInnerStyle:f,children:h,afterOpenChange:g,afterVisibleChange:m,destroyTooltipOnHide:v,arrow:S=!0,title:w,overlay:E,builtinPlacements:b,arrowPointAtCenter:C=!1,autoAdjustOverflow:T=!0,motion:A,getPopupContainer:O,placement:x="top",mouseEnterDelay:N=.1,mouseLeaveDelay:F=.1,overlayStyle:L,rootClassName:D,overlayClassName:V,styles:B,classNames:W}=t,X=_7(t,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),Y=!!S,[,ae]=Ws(),{getPopupContainer:U,getPrefixCls:z,direction:j,className:Z,style:P,classNames:$,styles:ie}=Uc("tooltip"),se=l3(),q=_.useRef(null),ce=()=>{var Je;(Je=q.current)===null||Je===void 0||Je.forceAlign()};_.useImperativeHandle(e,()=>{var Je,lt;return{forceAlign:ce,forcePopupAlign:()=>{se.deprecated(!1,"forcePopupAlign","forceAlign"),ce()},nativeElement:(Je=q.current)===null||Je===void 0?void 0:Je.nativeElement,popupElement:(lt=q.current)===null||lt===void 0?void 0:lt.popupElement}});const[fe,ye]=Tc(!1,{value:(n=t.open)!==null&&n!==void 0?n:t.visible,defaultValue:(r=t.defaultOpen)!==null&&r!==void 0?r:t.defaultVisible}),Ee=!w&&!E&&w!==0,Ce=Je=>{var lt,ft;ye(Ee?!1:Je),Ee||((lt=t.onOpenChange)===null||lt===void 0||lt.call(t,Je),(ft=t.onVisibleChange)===null||ft===void 0||ft.call(t,Je))},Te=_.useMemo(()=>{var Je,lt;let ft=C;return typeof S=="object"&&(ft=(lt=(Je=S.pointAtCenter)!==null&&Je!==void 0?Je:S.arrowPointAtCenter)!==null&<!==void 0?lt:C),b||d7({arrowPointAtCenter:ft,autoAdjustOverflow:T,arrowWidth:Y?ae.sizePopupArrow:0,borderRadius:ae.borderRadius,offset:ae.marginXXS})},[C,S,b,ae]),ve=_.useMemo(()=>w===0?w:E||w||"",[E,w]),ge=_.createElement(DB,{space:!0},typeof ve=="function"?ve():ve),_e=z("tooltip",i),Ie=z(),we=t["data-popover-inject"];let xe=fe;!("open"in t)&&!("visible"in t)&&Ee&&(xe=!1);const Ve=_.isValidElement(h)&&!kk(h)?h:_.createElement("span",null,h),Fe=Ve.props,Be=!Fe.className||typeof Fe.className=="string"?Ze(Fe.className,a||`${_e}-open`):Fe.className,[nt,He,Ge]=Mx(_e,!we),Pe=Ox(_e,u),Me=Pe.arrowStyle,dt=Ze(V,{[`${_e}-rtl`]:j==="rtl"},Pe.className,D,He,Ge,Z,$.root,W==null?void 0:W.root),rt=Ze($.body,W==null?void 0:W.body),[it,st]=z3("Tooltip",X.zIndex),at=_.createElement(s7,Object.assign({},X,{zIndex:it,showArrow:Y,placement:x,mouseEnterDelay:N,mouseLeaveDelay:F,prefixCls:_e,classNames:{root:dt,body:rt},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Me),ie.root),P),L),B==null?void 0:B.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},ie.body),f),B==null?void 0:B.body),Pe.overlayStyle)},getTooltipContainer:O||l||U,ref:q,builtinPlacements:Te,overlay:ge,visible:xe,onVisibleChange:Ce,afterVisibleChange:g??m,arrowContent:_.createElement("span",{className:`${_e}-arrow-content`}),motion:{motionName:$3(Ie,"zoom-big-fast",t.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!v}),xe?B3(Ve,{className:Be}):Ve);return nt(_.createElement(U3.Provider,{value:st},at))}),Px=y7;Px._InternalPanelDoNotUseOrYouWillBeFired=v7;function b7(t,e,n){var r=n||{},i=r.noTrailing,a=i===void 0?!1:i,l=r.noLeading,u=l===void 0?!1:l,f=r.debounceMode,h=f===void 0?void 0:f,g,m=!1,v=0;function S(){g&&clearTimeout(g)}function w(b){var C=b||{},T=C.upcomingOnly,A=T===void 0?!1:T;S(),m=!A}function E(){for(var b=arguments.length,C=new Array(b),T=0;T<b;T++)C[T]=arguments[T];var A=this,O=Date.now()-v;if(m)return;function x(){v=Date.now(),e.apply(A,C)}function N(){g=void 0}!u&&h&&!g&&x(),S(),h===void 0&&O>t?u?(v=Date.now(),a||(g=setTimeout(h?N:x,t))):x():a!==!0&&(g=setTimeout(h?N:x,h===void 0?t-O:t))}return E.cancel=w,E}function S7(t,e,n){var r={},i=r.atBegin,a=i===void 0?!1:i;return b7(t,e,{debounceMode:a!==!1})}function x_(t,e,n){return(t-e)/(n-e)}function rb(t,e,n,r){var i=x_(e,n,r),a={};switch(t){case"rtl":a.right="".concat(i*100,"%"),a.transform="translateX(50%)";break;case"btt":a.bottom="".concat(i*100,"%"),a.transform="translateY(50%)";break;case"ttb":a.top="".concat(i*100,"%"),a.transform="translateY(-50%)";break;default:a.left="".concat(i*100,"%"),a.transform="translateX(-50%)";break}return a}function vo(t,e){return Array.isArray(t)?t[e]:t}var Ko=_.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),E7=_.createContext({}),w7=["prefixCls","value","valueIndex","onStartMove","onDelete","style","render","dragging","draggingDelete","onOffsetChange","onChangeComplete","onFocus","onMouseEnter"],hC=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.value,i=t.valueIndex,a=t.onStartMove,l=t.onDelete,u=t.style,f=t.render,h=t.dragging,g=t.draggingDelete,m=t.onOffsetChange,v=t.onChangeComplete,S=t.onFocus,w=t.onMouseEnter,E=Fn(t,w7),b=_.useContext(Ko),C=b.min,T=b.max,A=b.direction,O=b.disabled,x=b.keyboard,N=b.range,F=b.tabIndex,L=b.ariaLabelForHandle,D=b.ariaLabelledByForHandle,V=b.ariaRequired,B=b.ariaValueTextFormatterForHandle,W=b.styles,X=b.classNames,Y="".concat(n,"-handle"),ae=function(ce){O||a(ce,i)},U=function(ce){S==null||S(ce,i)},z=function(ce){w(ce,i)},j=function(ce){if(!O&&x){var fe=null;switch(ce.which||ce.keyCode){case et.LEFT:fe=A==="ltr"||A==="btt"?-1:1;break;case et.RIGHT:fe=A==="ltr"||A==="btt"?1:-1;break;case et.UP:fe=A!=="ttb"?1:-1;break;case et.DOWN:fe=A!=="ttb"?-1:1;break;case et.HOME:fe="min";break;case et.END:fe="max";break;case et.PAGE_UP:fe=2;break;case et.PAGE_DOWN:fe=-2;break;case et.BACKSPACE:case et.DELETE:l(i);break}fe!==null&&(ce.preventDefault(),m(fe,i))}},Z=function(ce){switch(ce.which||ce.keyCode){case et.LEFT:case et.RIGHT:case et.UP:case et.DOWN:case et.HOME:case et.END:case et.PAGE_UP:case et.PAGE_DOWN:v==null||v();break}},P=rb(A,r,C,T),$={};if(i!==null){var ie;$={tabIndex:O?null:vo(F,i),role:"slider","aria-valuemin":C,"aria-valuemax":T,"aria-valuenow":r,"aria-disabled":O,"aria-label":vo(L,i),"aria-labelledby":vo(D,i),"aria-required":vo(V,i),"aria-valuetext":(ie=vo(B,i))===null||ie===void 0?void 0:ie(r),"aria-orientation":A==="ltr"||A==="rtl"?"horizontal":"vertical",onMouseDown:ae,onTouchStart:ae,onFocus:U,onMouseEnter:z,onKeyDown:j,onKeyUp:Z}}var se=_.createElement("div",kt({ref:e,className:Ze(Y,K(K(K({},"".concat(Y,"-").concat(i+1),i!==null&&N),"".concat(Y,"-dragging"),h),"".concat(Y,"-dragging-delete"),g),X.handle),style:J(J(J({},P),u),W.handle)},$,E));return f&&(se=f(se,{index:i,prefixCls:n,value:r,dragging:h,draggingDelete:g})),se}),T7=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","activeHandleRender","draggingIndex","draggingDelete","onFocus"],C7=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.style,i=t.onStartMove,a=t.onOffsetChange,l=t.values,u=t.handleRender,f=t.activeHandleRender,h=t.draggingIndex,g=t.draggingDelete,m=t.onFocus,v=Fn(t,T7),S=_.useRef({}),w=_.useState(!1),E=de(w,2),b=E[0],C=E[1],T=_.useState(-1),A=de(T,2),O=A[0],x=A[1],N=function(B){x(B),C(!0)},F=function(B,W){N(W),m==null||m(B)},L=function(B,W){N(W)};_.useImperativeHandle(e,function(){return{focus:function(B){var W;(W=S.current[B])===null||W===void 0||W.focus()},hideHelp:function(){za.flushSync(function(){C(!1)})}}});var D=J({prefixCls:n,onStartMove:i,onOffsetChange:a,render:u,onFocus:F,onMouseEnter:L},v);return _.createElement(_.Fragment,null,l.map(function(V,B){var W=h===B;return _.createElement(hC,kt({ref:function(Y){Y?S.current[B]=Y:delete S.current[B]},dragging:W,draggingDelete:W&&g,style:vo(r,B),key:B,value:V,valueIndex:B},D))}),f&&b&&_.createElement(hC,kt({key:"a11y"},D,{value:l[O],valueIndex:null,dragging:h!==-1,draggingDelete:g,render:f,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),A7=function(e){var n=e.prefixCls,r=e.style,i=e.children,a=e.value,l=e.onClick,u=_.useContext(Ko),f=u.min,h=u.max,g=u.direction,m=u.includedStart,v=u.includedEnd,S=u.included,w="".concat(n,"-text"),E=rb(g,a,f,h);return _.createElement("span",{className:Ze(w,K({},"".concat(w,"-active"),S&&m<=a&&a<=v)),style:J(J({},E),r),onMouseDown:function(C){C.stopPropagation()},onClick:function(){l(a)}},i)},R7=function(e){var n=e.prefixCls,r=e.marks,i=e.onClick,a="".concat(n,"-mark");return r.length?_.createElement("div",{className:a},r.map(function(l){var u=l.value,f=l.style,h=l.label;return _.createElement(A7,{key:u,prefixCls:a,style:f,value:u,onClick:i},h)})):null},x7=function(e){var n=e.prefixCls,r=e.value,i=e.style,a=e.activeStyle,l=_.useContext(Ko),u=l.min,f=l.max,h=l.direction,g=l.included,m=l.includedStart,v=l.includedEnd,S="".concat(n,"-dot"),w=g&&m<=r&&r<=v,E=J(J({},rb(h,r,u,f)),typeof i=="function"?i(r):i);return w&&(E=J(J({},E),typeof a=="function"?a(r):a)),_.createElement("span",{className:Ze(S,K({},"".concat(S,"-active"),w)),style:E})},M7=function(e){var n=e.prefixCls,r=e.marks,i=e.dots,a=e.style,l=e.activeStyle,u=_.useContext(Ko),f=u.min,h=u.max,g=u.step,m=_.useMemo(function(){var v=new Set;if(r.forEach(function(w){v.add(w.value)}),i&&g!==null)for(var S=f;S<=h;)v.add(S),S+=g;return Array.from(v)},[f,h,g,i,r]);return _.createElement("div",{className:"".concat(n,"-step")},m.map(function(v){return _.createElement(x7,{prefixCls:n,key:v,value:v,style:a,activeStyle:l})}))},gC=function(e){var n=e.prefixCls,r=e.style,i=e.start,a=e.end,l=e.index,u=e.onStartMove,f=e.replaceCls,h=_.useContext(Ko),g=h.direction,m=h.min,v=h.max,S=h.disabled,w=h.range,E=h.classNames,b="".concat(n,"-track"),C=x_(i,m,v),T=x_(a,m,v),A=function(F){!S&&u&&u(F,-1)},O={};switch(g){case"rtl":O.right="".concat(C*100,"%"),O.width="".concat(T*100-C*100,"%");break;case"btt":O.bottom="".concat(C*100,"%"),O.height="".concat(T*100-C*100,"%");break;case"ttb":O.top="".concat(C*100,"%"),O.height="".concat(T*100-C*100,"%");break;default:O.left="".concat(C*100,"%"),O.width="".concat(T*100-C*100,"%")}var x=f||Ze(b,K(K({},"".concat(b,"-").concat(l+1),l!==null&&w),"".concat(n,"-track-draggable"),u),E.track);return _.createElement("div",{className:x,style:J(J({},O),r),onMouseDown:A,onTouchStart:A})},O7=function(e){var n=e.prefixCls,r=e.style,i=e.values,a=e.startPoint,l=e.onStartMove,u=_.useContext(Ko),f=u.included,h=u.range,g=u.min,m=u.styles,v=u.classNames,S=_.useMemo(function(){if(!h){if(i.length===0)return[];var E=a??g,b=i[0];return[{start:Math.min(E,b),end:Math.max(E,b)}]}for(var C=[],T=0;T<i.length-1;T+=1)C.push({start:i[T],end:i[T+1]});return C},[i,h,a,g]);if(!f)return null;var w=S!=null&&S.length&&(v.tracks||m.tracks)?_.createElement(gC,{index:null,prefixCls:n,start:S[0].start,end:S[S.length-1].end,replaceCls:Ze(v.tracks,"".concat(n,"-tracks")),style:m.tracks}):null;return _.createElement(_.Fragment,null,w,S.map(function(E,b){var C=E.start,T=E.end;return _.createElement(gC,{index:b,prefixCls:n,style:J(J({},vo(r,b)),m.track),start:C,end:T,key:b,onStartMove:l})}))},P7=130;function pC(t){var e="targetTouches"in t?t.targetTouches[0]:t;return{pageX:e.pageX,pageY:e.pageY}}function N7(t,e,n,r,i,a,l,u,f,h,g){var m=_.useState(null),v=de(m,2),S=v[0],w=v[1],E=_.useState(-1),b=de(E,2),C=b[0],T=b[1],A=_.useState(!1),O=de(A,2),x=O[0],N=O[1],F=_.useState(n),L=de(F,2),D=L[0],V=L[1],B=_.useState(n),W=de(B,2),X=W[0],Y=W[1],ae=_.useRef(null),U=_.useRef(null),z=_.useRef(null),j=_.useContext(E7),Z=j.onDragStart,P=j.onDragChange;Dn(function(){C===-1&&V(n)},[n,C]),_.useEffect(function(){return function(){document.removeEventListener("mousemove",ae.current),document.removeEventListener("mouseup",U.current),z.current&&(z.current.removeEventListener("touchmove",ae.current),z.current.removeEventListener("touchend",U.current))}},[]);var $=function(fe,ye,Ee){ye!==void 0&&w(ye),V(fe);var Ce=fe;Ee&&(Ce=fe.filter(function(Te,ve){return ve!==C})),l(Ce),P&&P({rawValues:fe,deleteIndex:Ee?C:-1,draggingIndex:C,draggingValue:ye})},ie=fr(function(ce,fe,ye){if(ce===-1){var Ee=X[0],Ce=X[X.length-1],Te=r-Ee,ve=i-Ce,ge=fe*(i-r);ge=Math.max(ge,Te),ge=Math.min(ge,ve);var _e=a(Ee+ge);ge=_e-Ee;var Ie=X.map(function(Fe){return Fe+ge});$(Ie)}else{var we=(i-r)*fe,xe=ze(D);xe[ce]=X[ce];var Ve=f(xe,we,ce,"dist");$(Ve.values,Ve.value,ye)}}),se=function(fe,ye,Ee){fe.stopPropagation();var Ce=Ee||n,Te=Ce[ye];T(ye),w(Te),Y(Ce),V(Ce),N(!1);var ve=pC(fe),ge=ve.pageX,_e=ve.pageY,Ie=!1;Z&&Z({rawValues:Ce,draggingIndex:ye,draggingValue:Te});var we=function(Fe){Fe.preventDefault();var Be=pC(Fe),nt=Be.pageX,He=Be.pageY,Ge=nt-ge,Pe=He-_e,Me=t.current.getBoundingClientRect(),dt=Me.width,rt=Me.height,it,st;switch(e){case"btt":it=-Pe/rt,st=Ge;break;case"ttb":it=Pe/rt,st=Ge;break;case"rtl":it=-Ge/dt,st=Pe;break;default:it=Ge/dt,st=Pe}Ie=h?Math.abs(st)>P7&&g<D.length:!1,N(Ie),ie(ye,it,Ie)},xe=function Ve(Fe){Fe.preventDefault(),document.removeEventListener("mouseup",Ve),document.removeEventListener("mousemove",we),z.current&&(z.current.removeEventListener("touchmove",ae.current),z.current.removeEventListener("touchend",U.current)),ae.current=null,U.current=null,z.current=null,u(Ie),T(-1),N(!1)};document.addEventListener("mouseup",xe),document.addEventListener("mousemove",we),fe.currentTarget.addEventListener("touchend",xe),fe.currentTarget.addEventListener("touchmove",we),ae.current=we,U.current=xe,z.current=fe.currentTarget},q=_.useMemo(function(){var ce=ze(n).sort(function(Te,ve){return Te-ve}),fe=ze(D).sort(function(Te,ve){return Te-ve}),ye={};fe.forEach(function(Te){ye[Te]=(ye[Te]||0)+1}),ce.forEach(function(Te){ye[Te]=(ye[Te]||0)-1});var Ee=h?1:0,Ce=Object.values(ye).reduce(function(Te,ve){return Te+Math.abs(ve)},0);return Ce<=Ee?D:n},[n,D,h]);return[C,S,x,q,se]}function I7(t,e,n,r,i,a){var l=_.useCallback(function(S){return Math.max(t,Math.min(e,S))},[t,e]),u=_.useCallback(function(S){if(n!==null){var w=t+Math.round((l(S)-t)/n)*n,E=function(A){return(String(A).split(".")[1]||"").length},b=Math.max(E(n),E(e),E(t)),C=Number(w.toFixed(b));return t<=C&&C<=e?C:null}return null},[n,t,e,l]),f=_.useCallback(function(S){var w=l(S),E=r.map(function(T){return T.value});n!==null&&E.push(u(S)),E.push(t,e);var b=E[0],C=e-t;return E.forEach(function(T){var A=Math.abs(w-T);A<=C&&(b=T,C=A)}),b},[t,e,r,n,l,u]),h=function S(w,E,b){var C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof E=="number"){var T,A=w[b],O=A+E,x=[];r.forEach(function(V){x.push(V.value)}),x.push(t,e),x.push(u(A));var N=E>0?1:-1;C==="unit"?x.push(u(A+N*n)):x.push(u(O)),x=x.filter(function(V){return V!==null}).filter(function(V){return E<0?V<=A:V>=A}),C==="unit"&&(x=x.filter(function(V){return V!==A}));var F=C==="unit"?A:O;T=x[0];var L=Math.abs(T-F);if(x.forEach(function(V){var B=Math.abs(V-F);B<L&&(T=V,L=B)}),T===void 0)return E<0?t:e;if(C==="dist")return T;if(Math.abs(E)>1){var D=ze(w);return D[b]=T,S(D,E-N,b,C)}return T}else{if(E==="min")return t;if(E==="max")return e}},g=function(w,E,b){var C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",T=w[b],A=h(w,E,b,C);return{value:A,changed:A!==T}},m=function(w){return a===null&&w===0||typeof a=="number"&&w<a},v=function(w,E,b){var C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",T=w.map(f),A=T[b],O=h(T,E,b,C);if(T[b]=O,i===!1){var x=a||0;b>0&&T[b-1]!==A&&(T[b]=Math.max(T[b],T[b-1]+x)),b<T.length-1&&T[b+1]!==A&&(T[b]=Math.min(T[b],T[b+1]-x))}else if(typeof a=="number"||a===null){for(var N=b+1;N<T.length;N+=1)for(var F=!0;m(T[N]-T[N-1])&&F;){var L=g(T,1,N);T[N]=L.value,F=L.changed}for(var D=b;D>0;D-=1)for(var V=!0;m(T[D]-T[D-1])&&V;){var B=g(T,-1,D-1);T[D-1]=B.value,V=B.changed}for(var W=T.length-1;W>0;W-=1)for(var X=!0;m(T[W]-T[W-1])&&X;){var Y=g(T,-1,W-1);T[W-1]=Y.value,X=Y.changed}for(var ae=0;ae<T.length-1;ae+=1)for(var U=!0;m(T[ae+1]-T[ae])&&U;){var z=g(T,1,ae+1);T[ae+1]=z.value,U=z.changed}}return{value:T[b],values:T}};return[f,v]}function D7(t){return _.useMemo(function(){if(t===!0||!t)return[!!t,!1,!1,0];var e=t.editable,n=t.draggableTrack,r=t.minCount,i=t.maxCount;return[!0,e,!e&&n,r||0,i]},[t])}var F7=_.forwardRef(function(t,e){var n=t.prefixCls,r=n===void 0?"rc-slider":n,i=t.className,a=t.style,l=t.classNames,u=t.styles,f=t.id,h=t.disabled,g=h===void 0?!1:h,m=t.keyboard,v=m===void 0?!0:m,S=t.autoFocus,w=t.onFocus,E=t.onBlur,b=t.min,C=b===void 0?0:b,T=t.max,A=T===void 0?100:T,O=t.step,x=O===void 0?1:O,N=t.value,F=t.defaultValue,L=t.range,D=t.count,V=t.onChange,B=t.onBeforeChange,W=t.onAfterChange,X=t.onChangeComplete,Y=t.allowCross,ae=Y===void 0?!0:Y,U=t.pushable,z=U===void 0?!1:U,j=t.reverse,Z=t.vertical,P=t.included,$=P===void 0?!0:P,ie=t.startPoint,se=t.trackStyle,q=t.handleStyle,ce=t.railStyle,fe=t.dotStyle,ye=t.activeDotStyle,Ee=t.marks,Ce=t.dots,Te=t.handleRender,ve=t.activeHandleRender,ge=t.track,_e=t.tabIndex,Ie=_e===void 0?0:_e,we=t.ariaLabelForHandle,xe=t.ariaLabelledByForHandle,Ve=t.ariaRequired,Fe=t.ariaValueTextFormatterForHandle,Be=_.useRef(null),nt=_.useRef(null),He=_.useMemo(function(){return Z?j?"ttb":"btt":j?"rtl":"ltr"},[j,Z]),Ge=D7(L),Pe=de(Ge,5),Me=Pe[0],dt=Pe[1],rt=Pe[2],it=Pe[3],st=Pe[4],at=_.useMemo(function(){return isFinite(C)?C:0},[C]),Je=_.useMemo(function(){return isFinite(A)?A:100},[A]),lt=_.useMemo(function(){return x!==null&&x<=0?1:x},[x]),ft=_.useMemo(function(){return typeof z=="boolean"?z?lt:!1:z>=0?z:!1},[z,lt]),ct=_.useMemo(function(){return Object.keys(Ee||{}).map(function(De){var be=Ee[De],ut={value:Number(De)};return be&&pt(be)==="object"&&!_.isValidElement(be)&&("label"in be||"style"in be)?(ut.style=be.style,ut.label=be.label):ut.label=be,ut}).filter(function(De){var be=De.label;return be||typeof be=="number"}).sort(function(De,be){return De.value-be.value})},[Ee]),mt=I7(at,Je,lt,ct,ae,ft),xt=de(mt,2),Bt=xt[0],ht=xt[1],Vt=Tc(F,{value:N}),qt=de(Vt,2),wn=qt[0],Mn=qt[1],Ut=_.useMemo(function(){var De=wn==null?[]:Array.isArray(wn)?wn:[wn],be=de(De,1),ut=be[0],zt=ut===void 0?at:ut,Ot=wn===null?[]:[zt];if(Me){if(Ot=ze(De),D||wn===void 0){var In=D>=0?D+1:2;for(Ot=Ot.slice(0,In);Ot.length<In;){var tn;Ot.push((tn=Ot[Ot.length-1])!==null&&tn!==void 0?tn:at)}}Ot.sort(function(Vn,Pn){return Vn-Pn})}return Ot.forEach(function(Vn,Pn){Ot[Pn]=Bt(Vn)}),Ot},[wn,Me,at,D,Bt]),It=function(be){return Me?be:be[0]},Lt=fr(function(De){var be=ze(De).sort(function(ut,zt){return ut-zt});V&&!qh(be,Ut,!0)&&V(It(be)),Mn(be)}),Jt=fr(function(De){De&&Be.current.hideHelp();var be=It(Ut);W==null||W(be),kr(!W,"[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead."),X==null||X(be)}),Mt=function(be){if(!(g||!dt||Ut.length<=it)){var ut=ze(Ut);ut.splice(be,1),B==null||B(It(ut)),Lt(ut);var zt=Math.max(0,be-1);Be.current.hideHelp(),Be.current.focus(zt)}},qe=N7(nt,He,Ut,at,Je,Bt,Lt,Jt,ht,dt,it),ke=de(qe,5),Ne=ke[0],Et=ke[1],en=ke[2],Ue=ke[3],Oe=ke[4],je=function(be,ut){if(!g){var zt=ze(Ut),Ot=0,In=0,tn=Je-at;Ut.forEach(function(er,Un){var Tn=Math.abs(be-er);Tn<=tn&&(tn=Tn,Ot=Un),er<be&&(In=Un)});var Vn=Ot;dt&&tn!==0&&(!st||Ut.length<st)?(zt.splice(In+1,0,be),Vn=In+1):zt[Ot]=be,Me&&!Ut.length&&D===void 0&&zt.push(be);var Pn=It(zt);if(B==null||B(Pn),Lt(zt),ut){var Bn,Or;(Bn=document.activeElement)===null||Bn===void 0||(Or=Bn.blur)===null||Or===void 0||Or.call(Bn),Be.current.focus(Vn),Oe(ut,Vn,zt)}else W==null||W(Pn),kr(!W,"[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead."),X==null||X(Pn)}},Ye=function(be){be.preventDefault();var ut=nt.current.getBoundingClientRect(),zt=ut.width,Ot=ut.height,In=ut.left,tn=ut.top,Vn=ut.bottom,Pn=ut.right,Bn=be.clientX,Or=be.clientY,er;switch(He){case"btt":er=(Vn-Or)/Ot;break;case"ttb":er=(Or-tn)/Ot;break;case"rtl":er=(Pn-Bn)/zt;break;default:er=(Bn-In)/zt}var Un=at+er*(Je-at);je(Bt(Un),be)},We=_.useState(null),Qe=de(We,2),bt=Qe[0],_t=Qe[1],Zt=function(be,ut){if(!g){var zt=ht(Ut,be,ut);B==null||B(It(Ut)),Lt(zt.values),_t(zt.value)}};_.useEffect(function(){if(bt!==null){var De=Ut.indexOf(bt);De>=0&&Be.current.focus(De)}_t(null)},[bt]);var Yt=_.useMemo(function(){return rt&<===null?!1:rt},[rt,lt]),vn=fr(function(De,be){Oe(De,be),B==null||B(It(Ut))}),On=Ne!==-1;_.useEffect(function(){if(!On){var De=Ut.lastIndexOf(Et);Be.current.focus(De)}},[On]);var _n=_.useMemo(function(){return ze(Ue).sort(function(De,be){return De-be})},[Ue]),Zn=_.useMemo(function(){return Me?[_n[0],_n[_n.length-1]]:[at,_n[0]]},[_n,Me,at]),un=de(Zn,2),rn=un[0],Ae=un[1];_.useImperativeHandle(e,function(){return{focus:function(){Be.current.focus(0)},blur:function(){var be,ut=document,zt=ut.activeElement;(be=nt.current)!==null&&be!==void 0&&be.contains(zt)&&(zt==null||zt.blur())}}}),_.useEffect(function(){S&&Be.current.focus(0)},[]);var Le=_.useMemo(function(){return{min:at,max:Je,direction:He,disabled:g,keyboard:v,step:lt,included:$,includedStart:rn,includedEnd:Ae,range:Me,tabIndex:Ie,ariaLabelForHandle:we,ariaLabelledByForHandle:xe,ariaRequired:Ve,ariaValueTextFormatterForHandle:Fe,styles:u||{},classNames:l||{}}},[at,Je,He,g,v,lt,$,rn,Ae,Me,Ie,we,xe,Ve,Fe,u,l]);return _.createElement(Ko.Provider,{value:Le},_.createElement("div",{ref:nt,className:Ze(r,i,K(K(K(K({},"".concat(r,"-disabled"),g),"".concat(r,"-vertical"),Z),"".concat(r,"-horizontal"),!Z),"".concat(r,"-with-marks"),ct.length)),style:a,onMouseDown:Ye,id:f},_.createElement("div",{className:Ze("".concat(r,"-rail"),l==null?void 0:l.rail),style:J(J({},ce),u==null?void 0:u.rail)}),ge!==!1&&_.createElement(O7,{prefixCls:r,style:se,values:Ut,startPoint:ie,onStartMove:Yt?vn:void 0}),_.createElement(M7,{prefixCls:r,marks:ct,dots:Ce,style:fe,activeStyle:ye}),_.createElement(C7,{ref:Be,prefixCls:r,style:q,values:Ue,draggingIndex:Ne,draggingDelete:en,onStartMove:vn,onOffsetChange:Zt,onFocus:w,onBlur:E,handleRender:Te,activeHandleRender:ve,onChangeComplete:Jt,onDelete:dt?Mt:void 0}),_.createElement(R7,{prefixCls:r,marks:ct,onClick:je})))});const k7=_.createContext({}),mC=_.forwardRef((t,e)=>{const{open:n,draggingDelete:r}=t,i=_.useRef(null),a=n&&!r,l=_.useRef(null);function u(){dr.cancel(l.current),l.current=null}function f(){l.current=dr(()=>{var h;(h=i.current)===null||h===void 0||h.forceAlign(),l.current=null})}return _.useEffect(()=>(a?f():u(),u),[a,t.title]),_.createElement(Px,Object.assign({ref:Zg(i,e)},t,{open:a}))}),B7=t=>{const{componentCls:e,antCls:n,controlSize:r,dotSize:i,marginFull:a,marginPart:l,colorFillContentHover:u,handleColorDisabled:f,calc:h,handleSize:g,handleSizeHover:m,handleActiveColor:v,handleActiveOutlineColor:S,handleLineWidth:w,handleLineWidthHover:E,motionDurationMid:b}=t;return{[e]:Object.assign(Object.assign({},Lc(t)),{position:"relative",height:r,margin:`${Rt(l)} ${Rt(a)}`,padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:`${Rt(a)} ${Rt(l)}`},[`${e}-rail`]:{position:"absolute",backgroundColor:t.railBg,borderRadius:t.borderRadiusXS,transition:`background-color ${b}`},[`${e}-track,${e}-tracks`]:{position:"absolute",transition:`background-color ${b}`},[`${e}-track`]:{backgroundColor:t.trackBg,borderRadius:t.borderRadiusXS},[`${e}-track-draggable`]:{boxSizing:"content-box",backgroundClip:"content-box",border:"solid rgba(0,0,0,0)"},"&:hover":{[`${e}-rail`]:{backgroundColor:t.railHoverBg},[`${e}-track`]:{backgroundColor:t.trackHoverBg},[`${e}-dot`]:{borderColor:u},[`${e}-handle::after`]:{boxShadow:`0 0 0 ${Rt(w)} ${t.colorPrimaryBorderHover}`},[`${e}-dot-active`]:{borderColor:t.dotActiveBorderColor}},[`${e}-handle`]:{position:"absolute",width:g,height:g,outline:"none",userSelect:"none","&-dragging-delete":{opacity:0},"&::before":{content:'""',position:"absolute",insetInlineStart:h(w).mul(-1).equal(),insetBlockStart:h(w).mul(-1).equal(),width:h(g).add(h(w).mul(2)).equal(),height:h(g).add(h(w).mul(2)).equal(),backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:g,height:g,backgroundColor:t.colorBgElevated,boxShadow:`0 0 0 ${Rt(w)} ${t.handleColor}`,outline:"0px solid transparent",borderRadius:"50%",cursor:"pointer",transition:`
|
|
|
inset-inline-start ${b},
|
|
|
inset-block-start ${b},
|
|
|
width ${b},
|
|
|
height ${b},
|
|
|
box-shadow ${b},
|
|
|
outline ${b}
|
|
|
`},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:h(m).sub(g).div(2).add(E).mul(-1).equal(),insetBlockStart:h(m).sub(g).div(2).add(E).mul(-1).equal(),width:h(m).add(h(E).mul(2)).equal(),height:h(m).add(h(E).mul(2)).equal()},"&::after":{boxShadow:`0 0 0 ${Rt(E)} ${v}`,outline:`6px solid ${S}`,width:m,height:m,insetInlineStart:t.calc(g).sub(m).div(2).equal(),insetBlockStart:t.calc(g).sub(m).div(2).equal()}}},[`&-lock ${e}-handle`]:{"&::before, &::after":{transition:"none"}},[`${e}-mark`]:{position:"absolute",fontSize:t.fontSize},[`${e}-mark-text`]:{position:"absolute",display:"inline-block",color:t.colorTextDescription,textAlign:"center",wordBreak:"keep-all",cursor:"pointer",userSelect:"none","&-active":{color:t.colorText}},[`${e}-step`]:{position:"absolute",background:"transparent",pointerEvents:"none"},[`${e}-dot`]:{position:"absolute",width:i,height:i,backgroundColor:t.colorBgElevated,border:`${Rt(w)} solid ${t.dotBorderColor}`,borderRadius:"50%",cursor:"pointer",transition:`border-color ${t.motionDurationSlow}`,pointerEvents:"auto","&-active":{borderColor:t.dotActiveBorderColor}},[`&${e}-disabled`]:{cursor:"not-allowed",[`${e}-rail`]:{backgroundColor:`${t.railBg} !important`},[`${e}-track`]:{backgroundColor:`${t.trackBgDisabled} !important`},[`
|
|
|
${e}-dot
|
|
|
`]:{backgroundColor:t.colorBgElevated,borderColor:t.trackBgDisabled,boxShadow:"none",cursor:"not-allowed"},[`${e}-handle::after`]:{backgroundColor:t.colorBgElevated,cursor:"not-allowed",width:g,height:g,boxShadow:`0 0 0 ${Rt(w)} ${f}`,insetInlineStart:0,insetBlockStart:0},[`
|
|
|
${e}-mark-text,
|
|
|
${e}-dot
|
|
|
`]:{cursor:"not-allowed !important"}},[`&-tooltip ${n}-tooltip-inner`]:{minWidth:"unset"}})}},Nx=(t,e)=>{const{componentCls:n,railSize:r,handleSize:i,dotSize:a,marginFull:l,calc:u}=t,f=e?"paddingBlock":"paddingInline",h=e?"width":"height",g=e?"height":"width",m=e?"insetBlockStart":"insetInlineStart",v=e?"top":"insetInlineStart",S=u(r).mul(3).sub(i).div(2).equal(),w=u(i).sub(r).div(2).equal(),E=e?{borderWidth:`${Rt(w)} 0`,transform:`translateY(${Rt(u(w).mul(-1).equal())})`}:{borderWidth:`0 ${Rt(w)}`,transform:`translateX(${Rt(t.calc(w).mul(-1).equal())})`};return{[f]:r,[g]:u(r).mul(3).equal(),[`${n}-rail`]:{[h]:"100%",[g]:r},[`${n}-track,${n}-tracks`]:{[g]:r},[`${n}-track-draggable`]:Object.assign({},E),[`${n}-handle`]:{[m]:S},[`${n}-mark`]:{insetInlineStart:0,top:0,[v]:u(r).mul(3).add(e?0:l).equal(),[h]:"100%"},[`${n}-step`]:{insetInlineStart:0,top:0,[v]:r,[h]:"100%",[g]:r},[`${n}-dot`]:{position:"absolute",[m]:u(r).sub(a).div(2).equal()}}},U7=t=>{const{componentCls:e,marginPartWithMark:n}=t;return{[`${e}-horizontal`]:Object.assign(Object.assign({},Nx(t,!0)),{[`&${e}-with-marks`]:{marginBottom:n}})}},L7=t=>{const{componentCls:e}=t;return{[`${e}-vertical`]:Object.assign(Object.assign({},Nx(t,!1)),{height:"100%"})}},z7=t=>{const n=t.controlHeightLG/4,r=t.controlHeightSM/2,i=t.lineWidth+1,a=t.lineWidth+1*1.5,l=t.colorPrimary,u=new En(l).setA(.2).toRgbString();return{controlSize:n,railSize:4,handleSize:n,handleSizeHover:r,dotSize:8,handleLineWidth:i,handleLineWidthHover:a,railBg:t.colorFillTertiary,railHoverBg:t.colorFillSecondary,trackBg:t.colorPrimaryBorder,trackHoverBg:t.colorPrimaryBorderHover,handleColor:t.colorPrimaryBorder,handleActiveColor:l,handleActiveOutlineColor:u,handleColorDisabled:new En(t.colorTextDisabled).onBackground(t.colorBgContainer).toHexString(),dotBorderColor:t.colorBorderSecondary,dotActiveBorderColor:t.colorPrimaryBorder,trackBgDisabled:t.colorBgContainerDisabled}},$7=zc("Slider",t=>{const e=ui(t,{marginPart:t.calc(t.controlHeight).sub(t.controlSize).div(2).equal(),marginFull:t.calc(t.controlSize).div(2).equal(),marginPartWithMark:t.calc(t.controlHeightLG).sub(t.controlSize).equal()});return[B7(e),U7(e),L7(e)]},z7);function Lv(){const[t,e]=_.useState(!1),n=_.useRef(null),r=()=>{dr.cancel(n.current)},i=a=>{r(),a?e(a):n.current=dr(()=>{e(a)})};return _.useEffect(()=>r,[]),[t,i]}var V7=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function H7(t,e){return t||t===null?t:e||e===null?e:n=>typeof n=="number"?n.toString():""}const j7=Ft.forwardRef((t,e)=>{const{prefixCls:n,range:r,className:i,rootClassName:a,style:l,disabled:u,tooltipPrefixCls:f,tipFormatter:h,tooltipVisible:g,getTooltipPopupContainer:m,tooltipPlacement:v,tooltip:S={},onChangeComplete:w,classNames:E,styles:b}=t,C=V7(t,["prefixCls","range","className","rootClassName","style","disabled","tooltipPrefixCls","tipFormatter","tooltipVisible","getTooltipPopupContainer","tooltipPlacement","tooltip","onChangeComplete","classNames","styles"]),{vertical:T}=t,{getPrefixCls:A,direction:O,className:x,style:N,classNames:F,styles:L,getPopupContainer:D}=Uc("slider"),V=Ft.useContext(wf),B=u??V,{handleRender:W,direction:X}=Ft.useContext(k7),ae=(X||O)==="rtl",[U,z]=Lv(),[j,Z]=Lv(),P=Object.assign({},S),{open:$,placement:ie,getPopupContainer:se,prefixCls:q,formatter:ce}=P,fe=$??g,ye=(U||j)&&fe!==!1,Ee=H7(ce,h),[Ce,Te]=Lv(),ve=Me=>{w==null||w(Me),Te(!1)},ge=(Me,dt)=>Me||(dt?ae?"left":"right":"top"),_e=A("slider",n),[Ie,we,xe]=$7(_e),Ve=Ze(i,x,F.root,E==null?void 0:E.root,a,{[`${_e}-rtl`]:ae,[`${_e}-lock`]:Ce},we,xe);ae&&!C.vertical&&(C.reverse=!C.reverse),Ft.useEffect(()=>{const Me=()=>{dr(()=>{Z(!1)},1)};return document.addEventListener("mouseup",Me),()=>{document.removeEventListener("mouseup",Me)}},[]);const Fe=r&&!fe,Be=W||((Me,dt)=>{const{index:rt}=dt,it=Me.props;function st(ft,ct,mt){var xt,Bt,ht,Vt;mt&&((Bt=(xt=C)[ft])===null||Bt===void 0||Bt.call(xt,ct)),(Vt=(ht=it)[ft])===null||Vt===void 0||Vt.call(ht,ct)}const at=Object.assign(Object.assign({},it),{onMouseEnter:ft=>{z(!0),st("onMouseEnter",ft)},onMouseLeave:ft=>{z(!1),st("onMouseLeave",ft)},onMouseDown:ft=>{Z(!0),Te(!0),st("onMouseDown",ft)},onFocus:ft=>{var ct;Z(!0),(ct=C.onFocus)===null||ct===void 0||ct.call(C,ft),st("onFocus",ft,!0)},onBlur:ft=>{var ct;Z(!1),(ct=C.onBlur)===null||ct===void 0||ct.call(C,ft),st("onBlur",ft,!0)}}),Je=Ft.cloneElement(Me,at),lt=(!!fe||ye)&&Ee!==null;return Fe?Je:Ft.createElement(mC,Object.assign({},P,{prefixCls:A("tooltip",q??f),title:Ee?Ee(dt.value):"",open:lt,placement:ge(ie??v,T),key:rt,classNames:{root:`${_e}-tooltip`},getPopupContainer:se||m||D}),Je)}),nt=Fe?(Me,dt)=>{const rt=Ft.cloneElement(Me,{style:Object.assign(Object.assign({},Me.props.style),{visibility:"hidden"})});return Ft.createElement(mC,Object.assign({},P,{prefixCls:A("tooltip",q??f),title:Ee?Ee(dt.value):"",open:Ee!==null&&ye,placement:ge(ie??v,T),key:"tooltip",classNames:{root:`${_e}-tooltip`},getPopupContainer:se||m||D,draggingDelete:dt.draggingDelete}),rt)}:void 0,He=Object.assign(Object.assign(Object.assign(Object.assign({},L.root),N),b==null?void 0:b.root),l),Ge=Object.assign(Object.assign({},L.tracks),b==null?void 0:b.tracks),Pe=Ze(F.tracks,E==null?void 0:E.tracks);return Ie(Ft.createElement(F7,Object.assign({},C,{classNames:Object.assign({handle:Ze(F.handle,E==null?void 0:E.handle),rail:Ze(F.rail,E==null?void 0:E.rail),track:Ze(F.track,E==null?void 0:E.track)},Pe?{tracks:Pe}:{}),styles:Object.assign({handle:Object.assign(Object.assign({},L.handle),b==null?void 0:b.handle),rail:Object.assign(Object.assign({},L.rail),b==null?void 0:b.rail),track:Object.assign(Object.assign({},L.track),b==null?void 0:b.track)},Object.keys(Ge).length?{tracks:Ge}:{}),step:C.step,range:r,className:Ve,style:He,disabled:B,ref:e,prefixCls:_e,handleRender:Be,activeHandleRender:nt,onChangeComplete:ve})))});function vC(t){return["small","middle","large"].includes(t)}function _C(t){return t?typeof t=="number"&&!Number.isNaN(t):!1}const Ix=Ft.createContext({latestIndex:0}),W7=Ix.Provider,X7=t=>{let{className:e,index:n,children:r,split:i,style:a}=t;const{latestIndex:l}=_.useContext(Ix);return r==null?null:_.createElement(_.Fragment,null,_.createElement("div",{className:e,style:a},r),n<l&&i&&_.createElement("span",{className:`${e}-split`},i))};var q7=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Y7=_.forwardRef((t,e)=>{var n;const{getPrefixCls:r,direction:i,size:a,className:l,style:u,classNames:f,styles:h}=Uc("space"),{size:g=a??"small",align:m,className:v,rootClassName:S,children:w,direction:E="horizontal",prefixCls:b,split:C,style:T,wrap:A=!1,classNames:O,styles:x}=t,N=q7(t,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[F,L]=Array.isArray(g)?g:[g,g],D=vC(L),V=vC(F),B=_C(L),W=_C(F),X=Lo(w,{keepEmpty:!0}),Y=m===void 0&&E==="horizontal"?"center":m,ae=r("space",b),[U,z,j]=j3(ae),Z=Ze(ae,l,z,`${ae}-${E}`,{[`${ae}-rtl`]:i==="rtl",[`${ae}-align-${Y}`]:Y,[`${ae}-gap-row-${L}`]:D,[`${ae}-gap-col-${F}`]:V},v,S,j),P=Ze(`${ae}-item`,(n=O==null?void 0:O.item)!==null&&n!==void 0?n:f.item);let $=0;const ie=X.map((ce,fe)=>{var ye;ce!=null&&($=fe);const Ee=(ce==null?void 0:ce.key)||`${P}-${fe}`;return _.createElement(X7,{className:P,key:Ee,index:fe,split:C,style:(ye=x==null?void 0:x.item)!==null&&ye!==void 0?ye:h.item},ce)}),se=_.useMemo(()=>({latestIndex:$}),[$]);if(X.length===0)return null;const q={};return A&&(q.flexWrap="wrap"),!V&&W&&(q.columnGap=F),!D&&B&&(q.rowGap=L),U(_.createElement("div",Object.assign({ref:e,className:Z,style:Object.assign(Object.assign(Object.assign({},q),u),T)},N),_.createElement(W7,{value:se},ie)))}),Dx=Y7;Dx.Compact=Qk;const tg=100,Fx=tg/5,kx=tg/2-Fx/2,zv=kx*2*Math.PI,yC=50,bC=t=>{const{dotClassName:e,style:n,hasCircleCls:r}=t;return _.createElement("circle",{className:Ze(`${e}-circle`,{[`${e}-circle-bg`]:r}),r:kx,cx:yC,cy:yC,strokeWidth:Fx,style:n})},K7=t=>{let{percent:e,prefixCls:n}=t;const r=`${n}-dot`,i=`${r}-holder`,a=`${i}-hidden`,[l,u]=_.useState(!1);Dn(()=>{e!==0&&u(!0)},[e!==0]);const f=Math.max(Math.min(e,100),0);if(!l)return null;const h={strokeDashoffset:`${zv/4}`,strokeDasharray:`${zv*f/100} ${zv*(100-f)/100}`};return _.createElement("span",{className:Ze(i,`${r}-progress`,f<=0&&a)},_.createElement("svg",{viewBox:`0 0 ${tg} ${tg}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":f},_.createElement(bC,{dotClassName:r,hasCircleCls:!0}),_.createElement(bC,{dotClassName:r,style:h})))};function Z7(t){const{prefixCls:e,percent:n=0}=t,r=`${e}-dot`,i=`${r}-holder`,a=`${i}-hidden`;return _.createElement(_.Fragment,null,_.createElement("span",{className:Ze(i,n>0&&a)},_.createElement("span",{className:Ze(r,`${e}-dot-spin`)},[1,2,3,4].map(l=>_.createElement("i",{className:`${e}-dot-item`,key:l})))),_.createElement(K7,{prefixCls:e,percent:n}))}function Q7(t){const{prefixCls:e,indicator:n,percent:r}=t,i=`${e}-dot`;return n&&_.isValidElement(n)?B3(n,{className:Ze(n.props.className,i),percent:r}):_.createElement(Z7,{prefixCls:e,percent:r})}const G7=new ln("antSpinMove",{to:{opacity:1}}),J7=new ln("antRotate",{to:{transform:"rotate(405deg)"}}),e9=t=>{const{componentCls:e,calc:n}=t;return{[e]:Object.assign(Object.assign({},Lc(t)),{position:"absolute",display:"none",color:t.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${t.motionDurationSlow} ${t.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${e}-text`]:{fontSize:t.fontSize,paddingTop:n(n(t.dotSize).sub(t.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:t.colorBgMask,zIndex:t.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${t.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[e]:{[`${e}-dot-holder`]:{color:t.colorWhite},[`${e}-text`]:{color:t.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${e}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:t.contentHeight,[`${e}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(t.dotSize).mul(-1).div(2).equal()},[`${e}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${t.colorBgContainer}`},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${e}-dot`]:{margin:n(t.dotSizeSM).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeSM).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${e}-dot`]:{margin:n(t.dotSizeLG).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeLG).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${e}-container`]:{position:"relative",transition:`opacity ${t.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:t.colorBgContainer,opacity:0,transition:`all ${t.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${e}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:t.spinDotDefault},[`${e}-dot-holder`]:{width:"1em",height:"1em",fontSize:t.dotSize,display:"inline-block",transition:`transform ${t.motionDurationSlow} ease, opacity ${t.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:t.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${e}-dot-progress`]:{position:"absolute",inset:0},[`${e}-dot`]:{position:"relative",display:"inline-block",fontSize:t.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),height:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:G7,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:J7,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(r=>`${r} ${t.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:t.colorFillSecondary}},[`&-sm ${e}-dot`]:{"&, &-holder":{fontSize:t.dotSizeSM}},[`&-sm ${e}-dot-holder`]:{i:{width:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal(),height:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal()}},[`&-lg ${e}-dot`]:{"&, &-holder":{fontSize:t.dotSizeLG}},[`&-lg ${e}-dot-holder`]:{i:{width:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal(),height:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal()}},[`&${e}-show-text ${e}-text`]:{display:"block"}})}},t9=t=>{const{controlHeightLG:e,controlHeight:n}=t;return{contentHeight:400,dotSize:e/2,dotSizeSM:e*.35,dotSizeLG:n}},n9=zc("Spin",t=>{const e=ui(t,{spinDotDefault:t.colorTextDescription});return[e9(e)]},t9),r9=200,SC=[[30,.05],[70,.03],[96,.01]];function i9(t,e){const[n,r]=_.useState(0),i=_.useRef(null),a=e==="auto";return _.useEffect(()=>(a&&t&&(r(0),i.current=setInterval(()=>{r(l=>{const u=100-l;for(let f=0;f<SC.length;f+=1){const[h,g]=SC[f];if(l<=h)return l+u*g}return l})},r9)),()=>{clearInterval(i.current)}),[a,t]),a?n:e}var s9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};let Bx;function a9(t,e){return!!t&&!!e&&!Number.isNaN(Number(e))}const Ux=t=>{var e;const{prefixCls:n,spinning:r=!0,delay:i=0,className:a,rootClassName:l,size:u="default",tip:f,wrapperClassName:h,style:g,children:m,fullscreen:v=!1,indicator:S,percent:w}=t,E=s9(t,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:b,direction:C,className:T,style:A,indicator:O}=Uc("spin"),x=b("spin",n),[N,F,L]=n9(x),[D,V]=_.useState(()=>r&&!a9(r,i)),B=i9(D,w);_.useEffect(()=>{if(r){const j=S7(i,()=>{V(!0)});return j(),()=>{var Z;(Z=j==null?void 0:j.cancel)===null||Z===void 0||Z.call(j)}}V(!1)},[i,r]);const W=_.useMemo(()=>typeof m<"u"&&!v,[m,v]),X=Ze(x,T,{[`${x}-sm`]:u==="small",[`${x}-lg`]:u==="large",[`${x}-spinning`]:D,[`${x}-show-text`]:!!f,[`${x}-rtl`]:C==="rtl"},a,!v&&l,F,L),Y=Ze(`${x}-container`,{[`${x}-blur`]:D}),ae=(e=S??O)!==null&&e!==void 0?e:Bx,U=Object.assign(Object.assign({},A),g),z=_.createElement("div",Object.assign({},E,{style:U,className:X,"aria-live":"polite","aria-busy":D}),_.createElement(Q7,{prefixCls:x,indicator:ae,percent:B}),f&&(W||v)?_.createElement("div",{className:`${x}-text`},f):null);return N(W?_.createElement("div",Object.assign({},E,{className:Ze(`${x}-nested-loading`,h,F,L)}),D&&_.createElement("div",{key:"loading"},z),_.createElement("div",{className:Y,key:"container"},m)):v?_.createElement("div",{className:Ze(`${x}-fullscreen`,{[`${x}-fullscreen-show`]:D},l,F,L)},z):z)};Ux.setDefaultIndicator=t=>{Bx=t};function Dh(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function o9(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Lx(t){let e,n,r;t.length!==2?(e=Dh,n=(u,f)=>Dh(t(u),f),r=(u,f)=>t(u)-f):(e=t===Dh||t===o9?t:l9,n=t,r=t);function i(u,f,h=0,g=u.length){if(h<g){if(e(f,f)!==0)return g;do{const m=h+g>>>1;n(u[m],f)<0?h=m+1:g=m}while(h<g)}return h}function a(u,f,h=0,g=u.length){if(h<g){if(e(f,f)!==0)return g;do{const m=h+g>>>1;n(u[m],f)<=0?h=m+1:g=m}while(h<g)}return h}function l(u,f,h=0,g=u.length){const m=i(u,f,h,g-1);return m>h&&r(u[m-1],f)>-r(u[m],f)?m-1:m}return{left:i,center:l,right:a}}function l9(){return 0}function c9(t){return t===null?NaN:+t}const u9=Lx(Dh),f9=u9.right;Lx(c9).center;const d9=Math.sqrt(50),h9=Math.sqrt(10),g9=Math.sqrt(2);function ng(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=d9?10:a>=h9?5:a>=g9?2:1;let u,f,h;return i<0?(h=Math.pow(10,-i)/l,u=Math.round(t*h),f=Math.round(e*h),u/h<t&&++u,f/h>e&&--f,h=-h):(h=Math.pow(10,i)*l,u=Math.round(t/h),f=Math.round(e/h),u*h<t&&++u,f*h>e&&--f),f<u&&.5<=n&&n<2?ng(t,e,n*2):[u,f,h]}function p9(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,l]=r?ng(e,t,n):ng(t,e,n);if(!(a>=i))return[];const u=a-i+1,f=new Array(u);if(r)if(l<0)for(let h=0;h<u;++h)f[h]=(a-h)/-l;else for(let h=0;h<u;++h)f[h]=(a-h)*l;else if(l<0)for(let h=0;h<u;++h)f[h]=(i+h)/-l;else for(let h=0;h<u;++h)f[h]=(i+h)*l;return f}function M_(t,e,n){return e=+e,t=+t,n=+n,ng(t,e,n)[2]}function m9(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?M_(e,t,n):M_(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function v9(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function ib(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function zx(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function qf(){}var Af=.7,rg=1/Af,tc="\\s*([+-]?\\d+)\\s*",Rf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ys="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_9=/^#([0-9a-f]{3,8})$/,y9=new RegExp(`^rgb\\(${tc},${tc},${tc}\\)$`),b9=new RegExp(`^rgb\\(${ys},${ys},${ys}\\)$`),S9=new RegExp(`^rgba\\(${tc},${tc},${tc},${Rf}\\)$`),E9=new RegExp(`^rgba\\(${ys},${ys},${ys},${Rf}\\)$`),w9=new RegExp(`^hsl\\(${Rf},${ys},${ys}\\)$`),T9=new RegExp(`^hsla\\(${Rf},${ys},${ys},${Rf}\\)$`),EC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ib(qf,xf,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:wC,formatHex:wC,formatHex8:C9,formatHsl:A9,formatRgb:TC,toString:TC});function wC(){return this.rgb().formatHex()}function C9(){return this.rgb().formatHex8()}function A9(){return $x(this).formatHsl()}function TC(){return this.rgb().formatRgb()}function xf(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=_9.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?CC(e):n===3?new Kr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?fh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?fh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=y9.exec(t))?new Kr(e[1],e[2],e[3],1):(e=b9.exec(t))?new Kr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=S9.exec(t))?fh(e[1],e[2],e[3],e[4]):(e=E9.exec(t))?fh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=w9.exec(t))?xC(e[1],e[2]/100,e[3]/100,1):(e=T9.exec(t))?xC(e[1],e[2]/100,e[3]/100,e[4]):EC.hasOwnProperty(t)?CC(EC[t]):t==="transparent"?new Kr(NaN,NaN,NaN,0):null}function CC(t){return new Kr(t>>16&255,t>>8&255,t&255,1)}function fh(t,e,n,r){return r<=0&&(t=e=n=NaN),new Kr(t,e,n,r)}function R9(t){return t instanceof qf||(t=xf(t)),t?(t=t.rgb(),new Kr(t.r,t.g,t.b,t.opacity)):new Kr}function O_(t,e,n,r){return arguments.length===1?R9(t):new Kr(t,e,n,r??1)}function Kr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ib(Kr,O_,zx(qf,{brighter(t){return t=t==null?rg:Math.pow(rg,t),new Kr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Af:Math.pow(Af,t),new Kr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Kr(Io(this.r),Io(this.g),Io(this.b),ig(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:AC,formatHex:AC,formatHex8:x9,formatRgb:RC,toString:RC}));function AC(){return`#${So(this.r)}${So(this.g)}${So(this.b)}`}function x9(){return`#${So(this.r)}${So(this.g)}${So(this.b)}${So((isNaN(this.opacity)?1:this.opacity)*255)}`}function RC(){const t=ig(this.opacity);return`${t===1?"rgb(":"rgba("}${Io(this.r)}, ${Io(this.g)}, ${Io(this.b)}${t===1?")":`, ${t})`}`}function ig(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Io(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function So(t){return t=Io(t),(t<16?"0":"")+t.toString(16)}function xC(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ki(t,e,n,r)}function $x(t){if(t instanceof Ki)return new Ki(t.h,t.s,t.l,t.opacity);if(t instanceof qf||(t=xf(t)),!t)return new Ki;if(t instanceof Ki)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),l=NaN,u=a-i,f=(a+i)/2;return u?(e===a?l=(n-r)/u+(n<r)*6:n===a?l=(r-e)/u+2:l=(e-n)/u+4,u/=f<.5?a+i:2-a-i,l*=60):u=f>0&&f<1?0:l,new Ki(l,u,f,t.opacity)}function M9(t,e,n,r){return arguments.length===1?$x(t):new Ki(t,e,n,r??1)}function Ki(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ib(Ki,M9,zx(qf,{brighter(t){return t=t==null?rg:Math.pow(rg,t),new Ki(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Af:Math.pow(Af,t),new Ki(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Kr($v(t>=240?t-240:t+120,i,r),$v(t,i,r),$v(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Ki(MC(this.h),dh(this.s),dh(this.l),ig(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ig(this.opacity);return`${t===1?"hsl(":"hsla("}${MC(this.h)}, ${dh(this.s)*100}%, ${dh(this.l)*100}%${t===1?")":`, ${t})`}`}}));function MC(t){return t=(t||0)%360,t<0?t+360:t}function dh(t){return Math.max(0,Math.min(1,t||0))}function $v(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const sb=t=>()=>t;function O9(t,e){return function(n){return t+n*e}}function P9(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function N9(t){return(t=+t)==1?Vx:function(e,n){return n-e?P9(e,n,t):sb(isNaN(e)?n:e)}}function Vx(t,e){var n=e-t;return n?O9(t,n):sb(isNaN(t)?e:t)}const OC=function t(e){var n=N9(e);function r(i,a){var l=n((i=O_(i)).r,(a=O_(a)).r),u=n(i.g,a.g),f=n(i.b,a.b),h=Vx(i.opacity,a.opacity);return function(g){return i.r=l(g),i.g=u(g),i.b=f(g),i.opacity=h(g),i+""}}return r.gamma=t,r}(1);function I9(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=t[i]*(1-a)+e[i]*a;return r}}function D9(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function F9(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),a=new Array(n),l;for(l=0;l<r;++l)i[l]=ab(t[l],e[l]);for(;l<n;++l)a[l]=e[l];return function(u){for(l=0;l<r;++l)a[l]=i[l](u);return a}}function k9(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function sg(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function B9(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=ab(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var P_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vv=new RegExp(P_.source,"g");function U9(t){return function(){return t}}function L9(t){return function(e){return t(e)+""}}function z9(t,e){var n=P_.lastIndex=Vv.lastIndex=0,r,i,a,l=-1,u=[],f=[];for(t=t+"",e=e+"";(r=P_.exec(t))&&(i=Vv.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),u[l]?u[l]+=a:u[++l]=a),(r=r[0])===(i=i[0])?u[l]?u[l]+=i:u[++l]=i:(u[++l]=null,f.push({i:l,x:sg(r,i)})),n=Vv.lastIndex;return n<e.length&&(a=e.slice(n),u[l]?u[l]+=a:u[++l]=a),u.length<2?f[0]?L9(f[0].x):U9(e):(e=f.length,function(h){for(var g=0,m;g<e;++g)u[(m=f[g]).i]=m.x(h);return u.join("")})}function ab(t,e){var n=typeof e,r;return e==null||n==="boolean"?sb(e):(n==="number"?sg:n==="string"?(r=xf(e))?(e=r,OC):z9:e instanceof xf?OC:e instanceof Date?k9:D9(e)?I9:Array.isArray(e)?F9:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?B9:sg)(t,e)}function $9(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function V9(t){return function(){return t}}function H9(t){return+t}var PC=[0,1];function Xl(t){return t}function N_(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:V9(isNaN(e)?NaN:.5)}function j9(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function W9(t,e,n){var r=t[0],i=t[1],a=e[0],l=e[1];return i<r?(r=N_(i,r),a=n(l,a)):(r=N_(r,i),a=n(a,l)),function(u){return a(r(u))}}function X9(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),l=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++l<r;)i[l]=N_(t[l],t[l+1]),a[l]=n(e[l],e[l+1]);return function(u){var f=f9(t,u,1,r)-1;return a[f](i[f](u))}}function q9(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Y9(){var t=PC,e=PC,n=ab,r,i,a,l=Xl,u,f,h;function g(){var v=Math.min(t.length,e.length);return l!==Xl&&(l=j9(t[0],t[v-1])),u=v>2?X9:W9,f=h=null,m}function m(v){return v==null||isNaN(v=+v)?a:(f||(f=u(t.map(r),e,n)))(r(l(v)))}return m.invert=function(v){return l(i((h||(h=u(e,t.map(r),sg)))(v)))},m.domain=function(v){return arguments.length?(t=Array.from(v,H9),g()):t.slice()},m.range=function(v){return arguments.length?(e=Array.from(v),g()):e.slice()},m.rangeRound=function(v){return e=Array.from(v),n=$9,g()},m.clamp=function(v){return arguments.length?(l=v?!0:Xl,g()):l!==Xl},m.interpolate=function(v){return arguments.length?(n=v,g()):n},m.unknown=function(v){return arguments.length?(a=v,m):a},function(v,S){return r=v,i=S,g()}}function K9(){return Y9()(Xl,Xl)}function Z9(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ag(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Ac(t){return t=ag(Math.abs(t)),t?t[1]:NaN}function Q9(t,e){return function(n,r){for(var i=n.length,a=[],l=0,u=t[0],f=0;i>0&&u>0&&(f+u+1>r&&(u=Math.max(1,r-f)),a.push(n.substring(i-=u,i+u)),!((f+=u+1)>r));)u=t[l=(l+1)%t.length];return a.reverse().join(e)}}function G9(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var J9=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function og(t){if(!(e=J9.exec(t)))throw new Error("invalid format: "+t);var e;return new ob({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}og.prototype=ob.prototype;function ob(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}ob.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ez(t){e:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break e;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Hx;function tz(t,e){var n=ag(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Hx=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+ag(t,Math.max(0,e+a-1))[0]}function NC(t,e){var n=ag(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const IC={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Z9,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>NC(t*100,e),r:NC,s:tz,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function DC(t){return t}var FC=Array.prototype.map,kC=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nz(t){var e=t.grouping===void 0||t.thousands===void 0?DC:Q9(FC.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?DC:G9(FC.call(t.numerals,String)),l=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",f=t.nan===void 0?"NaN":t.nan+"";function h(m){m=og(m);var v=m.fill,S=m.align,w=m.sign,E=m.symbol,b=m.zero,C=m.width,T=m.comma,A=m.precision,O=m.trim,x=m.type;x==="n"?(T=!0,x="g"):IC[x]||(A===void 0&&(A=12),O=!0,x="g"),(b||v==="0"&&S==="=")&&(b=!0,v="0",S="=");var N=E==="$"?n:E==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",F=E==="$"?r:/[%p]/.test(x)?l:"",L=IC[x],D=/[defgprs%]/.test(x);A=A===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function V(B){var W=N,X=F,Y,ae,U;if(x==="c")X=L(B)+X,B="";else{B=+B;var z=B<0||1/B<0;if(B=isNaN(B)?f:L(Math.abs(B),A),O&&(B=ez(B)),z&&+B==0&&w!=="+"&&(z=!1),W=(z?w==="("?w:u:w==="-"||w==="("?"":w)+W,X=(x==="s"?kC[8+Hx/3]:"")+X+(z&&w==="("?")":""),D){for(Y=-1,ae=B.length;++Y<ae;)if(U=B.charCodeAt(Y),48>U||U>57){X=(U===46?i+B.slice(Y+1):B.slice(Y))+X,B=B.slice(0,Y);break}}}T&&!b&&(B=e(B,1/0));var j=W.length+B.length+X.length,Z=j<C?new Array(C-j+1).join(v):"";switch(T&&b&&(B=e(Z+B,Z.length?C-X.length:1/0),Z=""),S){case"<":B=W+B+X+Z;break;case"=":B=W+Z+B+X;break;case"^":B=Z.slice(0,j=Z.length>>1)+W+B+X+Z.slice(j);break;default:B=Z+W+B+X;break}return a(B)}return V.toString=function(){return m+""},V}function g(m,v){var S=h((m=og(m),m.type="f",m)),w=Math.max(-8,Math.min(8,Math.floor(Ac(v)/3)))*3,E=Math.pow(10,-w),b=kC[8+w/3];return function(C){return S(E*C)+b}}return{format:h,formatPrefix:g}}var hh,jx,Wx;rz({thousands:",",grouping:[3],currency:["$",""]});function rz(t){return hh=nz(t),jx=hh.format,Wx=hh.formatPrefix,hh}function iz(t){return Math.max(0,-Ac(Math.abs(t)))}function sz(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ac(e)/3)))*3-Ac(Math.abs(t)))}function az(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ac(e)-Ac(t))+1}function oz(t,e,n,r){var i=m9(t,e,n),a;switch(r=og(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=sz(i,l))&&(r.precision=a),Wx(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=az(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=iz(i))&&(r.precision=a-(r.type==="%")*2);break}}return jx(r)}function lz(t){var e=t.domain;return t.ticks=function(n){var r=e();return p9(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return oz(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,l=r[i],u=r[a],f,h,g=10;for(u<l&&(h=l,l=u,u=h,h=i,i=a,a=h);g-- >0;){if(h=M_(l,u,n),h===f)return r[i]=l,r[a]=u,e(r);if(h>0)l=Math.floor(l/h)*h,u=Math.ceil(u/h)*h;else if(h<0)l=Math.ceil(l*h)/h,u=Math.floor(u*h)/h;else break;f=h}return t},t}function lb(){var t=K9();return t.copy=function(){return q9(t,lb())},v9.apply(t,arguments),lz(t)}function sp(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}function ap(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const BC=ap(sp("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));ap(sp("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));ap(sp("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));ap(sp("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));const cz="4.3.2";var LA;const uz=(LA=globalThis.loaders)==null?void 0:LA.parseImageNode,I_=typeof Image<"u",D_=typeof ImageBitmap<"u",fz=!!uz,F_=Ay?!0:fz;function dz(t){switch(t){case"auto":return D_||I_||F_;case"imagebitmap":return D_;case"image":return I_;case"data":return F_;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function hz(){if(D_)return"imagebitmap";if(I_)return"image";if(F_)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function gz(t){const e=mz(t);if(!e)throw new Error("Not an image");return e}function pz(t){switch(gz(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function mz(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}const vz=/^data:image\/svg\+xml/,_z=/\.svg((\?|#).*)?$/;function cb(t){return t&&(vz.test(t)||_z.test(t))}function yz(t,e){if(cb(e)){let r=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(r=unescape(encodeURIComponent(r)))}catch(a){throw new Error(a.message)}return`data:image/svg+xml;base64,${btoa(r)}`}return Xx(t,e)}function Xx(t,e){if(cb(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function qx(t,e,n){const r=yz(t,n),i=self.URL||self.webkitURL,a=typeof r!="string"&&i.createObjectURL(r);try{return await bz(a||r,e)}finally{a&&i.revokeObjectURL(a)}}async function bz(t,e){const n=new Image;return n.src=t,e.image&&e.image.decode&&n.decode?(await n.decode(),n):await new Promise((r,i)=>{try{n.onload=()=>r(n),n.onerror=a=>{const l=a instanceof Error?a.message:"error";i(new Error(l))}}catch(a){i(a)}})}const Sz={};let UC=!0;async function Ez(t,e,n){let r;cb(n)?r=await qx(t,e,n):r=Xx(t,n);const i=e&&e.imagebitmap;return await wz(r,i)}async function wz(t,e=null){if((Tz(e)||!UC)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(n){console.warn(n),UC=!1}return await createImageBitmap(t)}function Tz(t){for(const e in t||Sz)return!1;return!0}function Cz(t){return!Mz(t,"ftyp",4)||!(t[8]&96)?null:Az(t)}function Az(t){switch(Rz(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Rz(t,e,n){return String.fromCharCode(...t.slice(e,n))}function xz(t){return[...t].map(e=>e.charCodeAt(0))}function Mz(t,e,n=0){const r=xz(e);for(let i=0;i<r.length;++i)if(r[i]!==t[i+n])return!1;return!0}const ms=!1,rf=!0;function Yx(t){const e=Yf(t);return Pz(e)||Dz(e)||Nz(e)||Iz(e)||Oz(e)}function Oz(t){const e=new Uint8Array(t instanceof DataView?t.buffer:t),n=Cz(e);return n?{mimeType:n.mimeType,width:0,height:0}:null}function Pz(t){const e=Yf(t);return e.byteLength>=24&&e.getUint32(0,ms)===2303741511?{mimeType:"image/png",width:e.getUint32(16,ms),height:e.getUint32(20,ms)}:null}function Nz(t){const e=Yf(t);return e.byteLength>=10&&e.getUint32(0,ms)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,rf),height:e.getUint16(8,rf)}:null}function Iz(t){const e=Yf(t);return e.byteLength>=14&&e.getUint16(0,ms)===16973&&e.getUint32(2,rf)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,rf),height:e.getUint32(22,rf)}:null}function Dz(t){const e=Yf(t);if(!(e.byteLength>=3&&e.getUint16(0,ms)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:r,sofMarkers:i}=Fz();let a=2;for(;a+9<e.byteLength;){const l=e.getUint16(a,ms);if(i.has(l))return{mimeType:"image/jpeg",height:e.getUint16(a+5,ms),width:e.getUint16(a+7,ms)};if(!r.has(l))return null;a+=2,a+=e.getUint16(a,ms)}return null}function Fz(){const t=new Set([65499,65476,65484,65501,65534]);for(let n=65504;n<65520;++n)t.add(n);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Yf(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function kz(t,e){var i;const{mimeType:n}=Yx(t)||{},r=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return zh(r),await r(t,n)}async function Bz(t,e,n){e=e||{};const i=(e.image||{}).type||"auto",{url:a}=n||{},l=Uz(i);let u;switch(l){case"imagebitmap":u=await Ez(t,e,a);break;case"image":u=await qx(t,e,a);break;case"data":u=await kz(t);break;default:zh(!1)}return i==="data"&&(u=pz(u)),u}function Uz(t){switch(t){case"auto":case"data":return hz();default:return dz(t),t}}const Lz=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],zz=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],$z={image:{type:"auto",decode:!0}},Vz={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:cz,mimeTypes:zz,extensions:Lz,parse:Bz,tests:[t=>!!Yx(new DataView(t))],options:$z},Sn=new Lf({id:"deck"});let k_={};function Hz(t){k_=t}function Hr(t,e,n,r){Sn.level>0&&k_[t]&&k_[t].call(null,e,n,r)}function jz(t){const e=t[0],n=t[t.length-1];return e==="{"&&n==="}"||e==="["&&n==="]"}const Wz={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:jz,parseTextSync:JSON.parse};function Xz(){const t="9.1.1",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(Sn.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:Sn,_registerLoggers:Hz},K6([Wz,[Vz,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}const qz=Xz();function ub(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const Hv={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function Yz(t){const e={};for(const[n,r]of Object.entries(t))e[n]=Kz(r);return e}function Kz(t){let e=LC(t);if(e!=="object")return{value:t,...Hv[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...Hv[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=LC(t.value),{...t,...Hv[e],type:e}):{type:"object",value:null};throw new Error("props")}function LC(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}const Zz=`#ifdef MODULE_LOGDEPTH
|
|
|
logdepth_adjustPosition(gl_Position);
|
|
|
#endif
|
|
|
`,Qz=`#ifdef MODULE_MATERIAL
|
|
|
fragColor = material_filterColor(fragColor);
|
|
|
#endif
|
|
|
|
|
|
#ifdef MODULE_LIGHTING
|
|
|
fragColor = lighting_filterColor(fragColor);
|
|
|
#endif
|
|
|
|
|
|
#ifdef MODULE_FOG
|
|
|
fragColor = fog_filterColor(fragColor);
|
|
|
#endif
|
|
|
|
|
|
#ifdef MODULE_PICKING
|
|
|
fragColor = picking_filterHighlightColor(fragColor);
|
|
|
fragColor = picking_filterPickingColor(fragColor);
|
|
|
#endif
|
|
|
|
|
|
#ifdef MODULE_LOGDEPTH
|
|
|
logdepth_setFragDepth();
|
|
|
#endif
|
|
|
`,Gz={vertex:Zz,fragment:Qz},zC=/void\s+main\s*\([^)]*\)\s*\{\n?/,$C=/}\n?[^{}]*$/,jv=[],Fh="__LUMA_INJECT_DECLARATIONS__";function Jz(t){const e={vertex:{},fragment:{}};for(const n in t){let r=t[n];const i=e$(n);typeof r=="string"&&(r={order:0,injection:r}),e[i][n]=r}return e}function e$(t){const e=t.slice(0,2);switch(e){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(e)}}function lg(t,e,n,r=!1){const i=e==="vertex";for(const a in n){const l=n[a];l.sort((f,h)=>f.order-h.order),jv.length=l.length;for(let f=0,h=l.length;f<h;++f)jv[f]=l[f].injection;const u=`${jv.join(`
|
|
|
`)}
|
|
|
`;switch(a){case"vs:#decl":i&&(t=t.replace(Fh,u));break;case"vs:#main-start":i&&(t=t.replace(zC,f=>f+u));break;case"vs:#main-end":i&&(t=t.replace($C,f=>u+f));break;case"fs:#decl":i||(t=t.replace(Fh,u));break;case"fs:#main-start":i||(t=t.replace(zC,f=>f+u));break;case"fs:#main-end":i||(t=t.replace($C,f=>u+f));break;default:t=t.replace(a,f=>f+u)}}return t=t.replace(Fh,""),r&&(t=t.replace(/\}\s*$/,a=>a+Gz[e])),t}function cg(t){t.map(e=>t$(e))}function t$(t){if(t.instance)return;cg(t.dependencies||[]);const{propTypes:e={},deprecations:n=[],inject:r={}}=t,i={normalizedInjections:Jz(r),parsedDeprecations:n$(n)};e&&(i.propValidators=Yz(e)),t.instance=i;let a={};e&&(a=Object.entries(e).reduce((l,[u,f])=>{const h=f==null?void 0:f.value;return h&&(l[u]=h),l},{})),t.defaultUniforms={...t.defaultUniforms,...a}}function Kx(t,e,n){var r;(r=t.deprecations)==null||r.forEach(i=>{var a;(a=i.regex)!=null&&a.test(e)&&(i.deprecated?n.deprecated(i.old,i.new)():n.removed(i.old,i.new)())})}function n$(t){return t.forEach(e=>{switch(e.type){case"function":e.regex=new RegExp(`\\b${e.old}\\(`);break;default:e.regex=new RegExp(`${e.type} ${e.old};`)}}),t}function fb(t){cg(t);const e={},n={};Zx({modules:t,level:0,moduleMap:e,moduleDepth:n});const r=Object.keys(n).sort((i,a)=>n[a]-n[i]).map(i=>e[i]);return cg(r),r}function Zx(t){const{modules:e,level:n,moduleMap:r,moduleDepth:i}=t;if(n>=5)throw new Error("Possible loop in shader dependency graph");for(const a of e)r[a.name]=a,(i[a.name]===void 0||i[a.name]<n)&&(i[a.name]=n);for(const a of e)a.dependencies&&Zx({modules:a.dependencies,level:n+1,moduleMap:r,moduleDepth:i})}function r$(t){switch(t==null?void 0:t.gpu.toLowerCase()){case"apple":return`#define APPLE_GPU
|
|
|
// Apple optimizes away the calculation necessary for emulated fp64
|
|
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
|
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
|
|
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
|
`;case"nvidia":return`#define NVIDIA_GPU
|
|
|
// Nvidia optimizes away the calculation necessary for emulated fp64
|
|
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
|
`;case"intel":return`#define INTEL_GPU
|
|
|
// Intel optimizes away the calculation necessary for emulated fp64
|
|
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
|
// Intel's built-in 'tan' function doesn't have acceptable precision
|
|
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
|
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
|
|
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
|
`;case"amd":return`#define AMD_GPU
|
|
|
`;default:return`#define DEFAULT_GPU
|
|
|
// Prevent driver from optimizing away the calculation necessary for emulated fp64
|
|
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
|
// Headless Chrome's software shader 'tan' function doesn't have acceptable precision
|
|
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
|
// If the GPU doesn't have full 32 bits precision, will causes overflow
|
|
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
|
`}}function i$(t,e){var r;if(Number(((r=t.match(/^#version[ \t]+(\d+)/m))==null?void 0:r[1])||100)!==300)throw new Error("luma.gl v9 only supports GLSL 3.00 shader sources");switch(e){case"vertex":return t=VC(t,s$),t;case"fragment":return t=VC(t,a$),t;default:throw new Error(e)}}const Qx=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,`#version 300 es
|
|
|
`],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],s$=[...Qx,[B_("attribute"),"in $1"],[B_("varying"),"out $1"]],a$=[...Qx,[B_("varying"),"in $1"]];function VC(t,e){for(const[n,r]of e)t=t.replace(n,r);return t}function B_(t){return new RegExp(`\\b${t}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}function Gx(t,e){let n="";for(const r in t){const i=t[r];if(n+=`void ${i.signature} {
|
|
|
`,i.header&&(n+=` ${i.header}`),e[r]){const a=e[r];a.sort((l,u)=>l.order-u.order);for(const l of a)n+=` ${l.injection}
|
|
|
`}i.footer&&(n+=` ${i.footer}`),n+=`}
|
|
|
`}return n}function Jx(t){const e={vertex:{},fragment:{}};for(const n of t){let r,i;typeof n!="string"?(r=n,i=r.hook):(r={},i=n),i=i.trim();const[a,l]=i.split(":"),u=i.replace(/\(.+/,""),f=Object.assign(r,{signature:l});switch(a){case"vs":e.vertex[u]=f;break;case"fs":e.fragment[u]=f;break;default:throw new Error(a)}}return e}function o$(t,e){return{name:l$(t,e),language:"glsl",version:c$(t)}}function l$(t,e="unnamed"){const r=/#define[^\S\r\n]*SHADER_NAME[^\S\r\n]*([A-Za-z0-9_-]+)\s*/.exec(t);return r?r[1]:e}function c$(t){let e=100;const n=t.match(/[^\s]+/g);if(n&&n.length>=2&&n[0]==="#version"){const r=parseInt(n[1],10);Number.isFinite(r)&&(e=r)}if(e!==100&&e!==300)throw new Error(`Invalid GLSL version ${e}`);return e}const eM=`
|
|
|
|
|
|
${Fh}
|
|
|
`,u$=`precision highp float;
|
|
|
`;function f$(t){const e=fb(t.modules||[]);return{source:h$(t.platformInfo,{...t,source:t.source,stage:"vertex",modules:e}),getUniforms:tM(e)}}function d$(t){const{vs:e,fs:n}=t,r=fb(t.modules||[]);return{vs:HC(t.platformInfo,{...t,source:e,stage:"vertex",modules:r}),fs:HC(t.platformInfo,{...t,source:n,stage:"fragment",modules:r}),getUniforms:tM(r)}}function h$(t,e){var E;const{source:n,stage:r,modules:i,hookFunctions:a=[],inject:l={},log:u}=e;ub(typeof n=="string","shader source must be a string");const f=n;let h="";const g=Jx(a),m={},v={},S={};for(const b in l){const C=typeof l[b]=="string"?{injection:l[b],order:0}:l[b],T=/^(v|f)s:(#)?([\w-]+)$/.exec(b);if(T){const A=T[2],O=T[3];A?O==="decl"?v[b]=[C]:S[b]=[C]:m[b]=[C]}else S[b]=[C]}const w=i;for(const b of w){u&&Kx(b,f,u);const C=nM(b,"wgsl");h+=C;const T=((E=b.injections)==null?void 0:E[r])||{};for(const A in T){const O=/^(v|f)s:#([\w-]+)$/.exec(A);if(O){const N=O[2]==="decl"?v:S;N[A]=N[A]||[],N[A].push(T[A])}else m[A]=m[A]||[],m[A].push(T[A])}}return h+=eM,h=lg(h,r,v),h+=Gx(g[r],m),h+=f,h=lg(h,r,S),h}function HC(t,e){var F;const{id:n,source:r,stage:i,language:a="glsl",modules:l,defines:u={},hookFunctions:f=[],inject:h={},prologue:g=!0,log:m}=e;ub(typeof r=="string","shader source must be a string");const v=a==="glsl"?o$(r).version:-1,S=t.shaderLanguageVersion,w=v===100?"#version 100":"#version 300 es",b=r.split(`
|
|
|
`).slice(1).join(`
|
|
|
`),C={};l.forEach(L=>{Object.assign(C,L.defines)}),Object.assign(C,u);let T="";switch(a){case"wgsl":break;case"glsl":T=g?`${w}
|
|
|
|
|
|
// ----- PROLOGUE -------------------------
|
|
|
${g$({id:n,source:r,stage:i})}
|
|
|
${`#define SHADER_TYPE_${i.toUpperCase()}`}
|
|
|
|
|
|
${r$(t)}
|
|
|
${i==="fragment"?u$:""}
|
|
|
|
|
|
// ----- APPLICATION DEFINES -------------------------
|
|
|
|
|
|
${p$(C)}
|
|
|
|
|
|
`:`${w}
|
|
|
`;break}const A=Jx(f),O={},x={},N={};for(const L in h){const D=typeof h[L]=="string"?{injection:h[L],order:0}:h[L],V=/^(v|f)s:(#)?([\w-]+)$/.exec(L);if(V){const B=V[2],W=V[3];B?W==="decl"?x[L]=[D]:N[L]=[D]:O[L]=[D]}else N[L]=[D]}for(const L of l){m&&Kx(L,b,m);const D=nM(L,i);T+=D;const V=((F=L.instance)==null?void 0:F.normalizedInjections[i])||{};for(const B in V){const W=/^(v|f)s:#([\w-]+)$/.exec(B);if(W){const Y=W[2]==="decl"?x:N;Y[B]=Y[B]||[],Y[B].push(V[B])}else O[B]=O[B]||[],O[B].push(V[B])}}return T+="// ----- MAIN SHADER SOURCE -------------------------",T+=eM,T=lg(T,i,x),T+=Gx(A[i],O),T+=b,T=lg(T,i,N),a==="glsl"&&v!==S&&(T=i$(T,i)),T.trim()}function tM(t){return function(n){var i;const r={};for(const a of t){const l=(i=a.getUniforms)==null?void 0:i.call(a,n,r);Object.assign(r,l)}return r}}function g$(t){const{id:e,source:n,stage:r}=t;return e&&n.indexOf("SHADER_NAME")===-1?`
|
|
|
#define SHADER_NAME ${e}_${r}`:""}function p$(t={}){let e="";for(const n in t){const r=t[n];(r||Number.isFinite(r))&&(e+=`#define ${n.toUpperCase()} ${t[n]}
|
|
|
`)}return e}function nM(t,e){let n;switch(e){case"vertex":n=t.vs||"";break;case"fragment":n=t.fs||"";break;case"wgsl":n=t.source||"";break;default:ub(!1)}if(!t.name)throw new Error("Shader module must have a name");const r=t.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");let i=`// ----- MODULE ${t.name} ---------------
|
|
|
|
|
|
`;return e!=="wgsl"&&(i+=`#define MODULE_${r}
|
|
|
`),i+=`${n}
|
|
|
`,i}const m$=/^\s*\#\s*ifdef\s*([a-zA-Z_]+)\s*$/,v$=/^\s*\#\s*endif\s*$/;function _$(t,e){var l;const n=t.split(`
|
|
|
`),r=[];let i=!0,a=null;for(const u of n){const f=u.match(m$),h=u.match(v$);f?(a=f[1],i=!!((l=e==null?void 0:e.defines)!=null&&l[a])):h?i=!0:i&&r.push(u)}return r.join(`
|
|
|
`)}const yo=class yo{constructor(){M(this,"_hookFunctions",[]);M(this,"_defaultModules",[])}static getDefaultShaderAssembler(){return yo.defaultShaderAssembler=yo.defaultShaderAssembler||new yo,yo.defaultShaderAssembler}addDefaultModule(e){this._defaultModules.find(n=>n.name===(typeof e=="string"?e:e.name))||this._defaultModules.push(e)}removeDefaultModule(e){const n=typeof e=="string"?e:e.name;this._defaultModules=this._defaultModules.filter(r=>r.name!==n)}addShaderHook(e,n){n&&(e=Object.assign(n,{hook:e})),this._hookFunctions.push(e)}assembleWGSLShader(e){const n=this._getModuleList(e.modules),r=this._hookFunctions,{source:i,getUniforms:a}=f$({...e,source:e.source,modules:n,hookFunctions:r});return{source:e.platformInfo.shaderLanguage==="wgsl"?_$(i):i,getUniforms:a,modules:n}}assembleGLSLShaderPair(e){const n=this._getModuleList(e.modules),r=this._hookFunctions;return{...d$({...e,vs:e.vs,fs:e.fs,modules:n,hookFunctions:r}),modules:n}}_getModuleList(e=[]){const n=new Array(this._defaultModules.length+e.length),r={};let i=0;for(let a=0,l=this._defaultModules.length;a<l;++a){const u=this._defaultModules[a],f=u.name;n[i++]=u,r[f]=!0}for(let a=0,l=e.length;a<l;++a){const u=e[a],f=u.name;r[f]||(n[i++]=u,r[f]=!0)}return n.length=i,cg(n),n}};M(yo,"defaultShaderAssembler");let ug=yo;const y$=`out vec4 transform_output;
|
|
|
void main() {
|
|
|
transform_output = vec4(0);
|
|
|
}`,b$=`#version 300 es
|
|
|
${y$}`;function S$(t){const{input:e,inputChannels:n,output:r}={};if(!e)return b$;if(!n)throw new Error("inputChannels");const i=E$(n),a=w$(e,n);return`#version 300 es
|
|
|
in ${i} ${e};
|
|
|
out vec4 ${r};
|
|
|
void main() {
|
|
|
${r} = ${a};
|
|
|
}`}function E$(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error(`invalid channels: ${t}`)}}function w$(t,e){switch(e){case 1:return`vec4(${t}, 0.0, 0.0, 1.0)`;case 2:return`vec4(${t}, 0.0, 1.0)`;case 3:return`vec4(${t}, 1.0)`;case 4:return t;default:throw new Error(`invalid channels: ${e}`)}}class T${constructor(){M(this,"stats",new Map)}getStats(e){return this.get(e)}get(e){return this.stats.has(e)||this.stats.set(e,new qg({id:e})),this.stats.get(e)}}const rM=new T$,Re=new Lf({id:"luma.gl"}),Wv={};function op(t="id"){Wv[t]=Wv[t]||1;const e=Wv[t]++;return`${t}-${e}`}var m0;let mn=(m0=class{constructor(e,n,r){M(this,"id");M(this,"props");M(this,"userData",{});M(this,"_device");M(this,"destroyed",!1);M(this,"allocatedBytes",0);M(this,"_attachedResources",new Set);if(!e)throw new Error("no device");this._device=e,this.props=C$(n,r);const i=this.props.id!=="undefined"?this.props.id:op(this[Symbol.toStringTag]);this.props.id=i,this.id=i,this.userData=this.props.userData||{},this.addStats()}toString(){return`${this[Symbol.toStringTag]||this.constructor.name}:"${this.id}"`}destroy(){this.destroyResource()}delete(){return this.destroy(),this}getProps(){return this.props}attachResource(e){this._attachedResources.add(e)}detachResource(e){this._attachedResources.delete(e)}destroyAttachedResource(e){this._attachedResources.delete(e)&&e.destroy()}destroyAttachedResources(){for(const e of Object.values(this._attachedResources))e.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){const e=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];e.get(`${n}s Active`).decrementCount()}trackAllocatedMemory(e,n=this[Symbol.toStringTag]){const r=this._device.statsManager.getStats("Resource Counts");r.get("GPU Memory").addCount(e),r.get(`${n} Memory`).addCount(e),this.allocatedBytes=e}trackDeallocatedMemory(e=this[Symbol.toStringTag]){const n=this._device.statsManager.getStats("Resource Counts");n.get("GPU Memory").subtractCount(this.allocatedBytes),n.get(`${e} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){const e=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];e.get("Resources Created").incrementCount(),e.get(`${n}s Created`).incrementCount(),e.get(`${n}s Active`).incrementCount()}},M(m0,"defaultProps",{id:"undefined",handle:void 0,userData:void 0}),m0);function C$(t,e){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}const Cr=class Cr extends mn{constructor(n,r){const i={...r};(r.usage||0)&Cr.INDEX&&!r.indexType&&(r.data instanceof Uint32Array?i.indexType="uint32":r.data instanceof Uint16Array&&(i.indexType="uint16")),delete i.data;super(n,i,Cr.defaultProps);M(this,"usage");M(this,"indexType");M(this,"updateTimestamp");M(this,"debugData",new ArrayBuffer(0));this.usage=i.usage||0,this.indexType=i.indexType,this.updateTimestamp=n.incrementTimestamp()}get[Symbol.toStringTag](){return"Buffer"}clone(n){return this.device.createBuffer({...this.props,...n})}readSyncWebGL(n,r){throw new Error("not implemented")}_setDebugData(n,r,i){const a=ArrayBuffer.isView(n)?n.buffer:n,l=Math.min(n?n.byteLength:i,Cr.DEBUG_DATA_MAX_LENGTH);a===null?this.debugData=new ArrayBuffer(l):r===0&&i===a.byteLength?this.debugData=a.slice(0,l):this.debugData=a.slice(r,r+l)}};M(Cr,"defaultProps",{...mn.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1}),M(Cr,"MAP_READ",1),M(Cr,"MAP_WRITE",2),M(Cr,"COPY_SRC",4),M(Cr,"COPY_DST",8),M(Cr,"INDEX",16),M(Cr,"VERTEX",32),M(Cr,"UNIFORM",64),M(Cr,"STORAGE",128),M(Cr,"INDIRECT",256),M(Cr,"QUERY_RESOLVE",512),M(Cr,"DEBUG_DATA_MAX_LENGTH",32);let $n=Cr;function iM(t){const e=jC[t],n=A$(e),r=t.includes("norm"),i=!r&&!t.startsWith("float"),a=t.startsWith("s");return{dataType:jC[t],byteLength:n,integer:i,signed:a,normalized:r}}function A$(t){return R$[t]}const jC={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},R$={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4},Ir="texture-compression-bc",pn="texture-compression-astc",os="texture-compression-etc2",x$="texture-compression-etc1-webgl",gh="texture-compression-pvrtc-webgl",Xv="texture-compression-atc-webgl",ph="float32-renderable-webgl",qv="float16-renderable-webgl",M$="rgb9e5ufloat-renderable-webgl",Yv="snorm8-renderable-webgl",$u="norm16-renderable-webgl",Kv="snorm16-renderable-webgl",mh="float32-filterable",WC="float16-filterable-webgl";function sM(t){const e=O$[t];if(!e)throw new Error(`Unsupported texture format ${t}`);return e}const O$={r8unorm:{},r8snorm:{render:Yv},r8uint:{},r8sint:{},rg8unorm:{},rg8snorm:{render:Yv},rg8uint:{},rg8sint:{},r16uint:{},r16sint:{},r16float:{render:qv,filter:"float16-filterable-webgl"},"r16unorm-webgl":{f:$u},"r16snorm-webgl":{f:Kv},"rgba4unorm-webgl":{channels:"rgba",bitsPerChannel:[4,4,4,4],packed:!0},"rgb565unorm-webgl":{channels:"rgb",bitsPerChannel:[5,6,5,0],packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bitsPerChannel:[5,5,5,1],packed:!0},"rgb8unorm-webgl":{},"rgb8snorm-webgl":{},rgba8unorm:{},"rgba8unorm-srgb":{},rgba8snorm:{render:Yv},rgba8uint:{},rgba8sint:{},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{},rg16sint:{},rg16float:{render:qv,filter:WC},"rg16unorm-webgl":{render:$u},"rg16snorm-webgl":{render:Kv},r32uint:{},r32sint:{},r32float:{render:ph,filter:mh},rgb9e5ufloat:{channels:"rgb",packed:!0,render:M$},rg11b10ufloat:{channels:"rgb",bitsPerChannel:[11,11,10,0],packed:!0,p:1,render:ph},rgb10a2unorm:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},"rgb10a2uint-webgl":{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1,wgpu:!1},"rgb16unorm-webgl":{f:$u},"rgb16snorm-webgl":{f:$u},rg32uint:{},rg32sint:{},rg32float:{render:!1,filter:mh},rgba16uint:{},rgba16sint:{},rgba16float:{render:qv,filter:WC},"rgba16unorm-webgl":{render:$u},"rgba16snorm-webgl":{render:Kv},"rgb32float-webgl":{render:ph,filter:mh},rgba32uint:{},rgba32sint:{},rgba32float:{render:ph,filter:mh},stencil8:{attachment:"stencil",bitsPerChannel:[8,0,0,0],dataType:"uint8"},depth16unorm:{attachment:"depth",bitsPerChannel:[16,0,0,0],dataType:"uint16"},depth24plus:{attachment:"depth",bitsPerChannel:[24,0,0,0],dataType:"uint32"},depth32float:{attachment:"depth",bitsPerChannel:[32,0,0,0],dataType:"float32"},"depth24plus-stencil8":{attachment:"depth-stencil",bitsPerChannel:[24,8,0,0],packed:!0},"depth32float-stencil8":{attachment:"depth-stencil",bitsPerChannel:[32,8,0,0],packed:!0},"bc1-rgb-unorm-webgl":{f:Ir},"bc1-rgb-unorm-srgb-webgl":{f:Ir},"bc1-rgba-unorm":{f:Ir},"bc1-rgba-unorm-srgb":{f:Ir},"bc2-rgba-unorm":{f:Ir},"bc2-rgba-unorm-srgb":{f:Ir},"bc3-rgba-unorm":{f:Ir},"bc3-rgba-unorm-srgb":{f:Ir},"bc4-r-unorm":{f:Ir},"bc4-r-snorm":{f:Ir},"bc5-rg-unorm":{f:Ir},"bc5-rg-snorm":{f:Ir},"bc6h-rgb-ufloat":{f:Ir},"bc6h-rgb-float":{f:Ir},"bc7-rgba-unorm":{f:Ir},"bc7-rgba-unorm-srgb":{f:Ir},"etc2-rgb8unorm":{f:os},"etc2-rgb8unorm-srgb":{f:os},"etc2-rgb8a1unorm":{f:os},"etc2-rgb8a1unorm-srgb":{f:os},"etc2-rgba8unorm":{f:os},"etc2-rgba8unorm-srgb":{f:os},"eac-r11unorm":{f:os},"eac-r11snorm":{f:os},"eac-rg11unorm":{f:os},"eac-rg11snorm":{f:os},"astc-4x4-unorm":{f:pn},"astc-4x4-unorm-srgb":{f:pn},"astc-5x4-unorm":{f:pn},"astc-5x4-unorm-srgb":{f:pn},"astc-5x5-unorm":{f:pn},"astc-5x5-unorm-srgb":{f:pn},"astc-6x5-unorm":{f:pn},"astc-6x5-unorm-srgb":{f:pn},"astc-6x6-unorm":{f:pn},"astc-6x6-unorm-srgb":{f:pn},"astc-8x5-unorm":{f:pn},"astc-8x5-unorm-srgb":{f:pn},"astc-8x6-unorm":{f:pn},"astc-8x6-unorm-srgb":{f:pn},"astc-8x8-unorm":{f:pn},"astc-8x8-unorm-srgb":{f:pn},"astc-10x5-unorm":{f:pn},"astc-10x5-unorm-srgb":{f:pn},"astc-10x6-unorm":{f:pn},"astc-10x6-unorm-srgb":{f:pn},"astc-10x8-unorm":{f:pn},"astc-10x8-unorm-srgb":{f:pn},"astc-10x10-unorm":{f:pn},"astc-10x10-unorm-srgb":{f:pn},"astc-12x10-unorm":{f:pn},"astc-12x10-unorm-srgb":{f:pn},"astc-12x12-unorm":{f:pn},"astc-12x12-unorm-srgb":{f:pn},"pvrtc-rgb4unorm-webgl":{f:gh},"pvrtc-rgba4unorm-webgl":{f:gh},"pvrtc-rbg2unorm-webgl":{f:gh},"pvrtc-rgba2unorm-webgl":{f:gh},"etc1-rbg-unorm-webgl":{f:x$},"atc-rgb-unorm-webgl":{f:Xv},"atc-rgba-unorm-webgl":{f:Xv},"atc-rgbai-unorm-webgl":{f:Xv}},P$=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],N$=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;function aM(t){return P$.some(e=>t.startsWith(e))}function db(t){let e=I$(t);if(aM(t)){e.channels="rgb",e.components=3,e.bytesPerPixel=1,e.srgb=!1,e.compressed=!0;const r=D$(t);r&&(e.blockWidth=r.blockWidth,e.blockHeight=r.blockHeight)}const n=N$.exec(t);if(n){const[,r,i,a,l,u]=n,f=`${a}${i}`,h=iM(f),g=h.byteLength*8,m=r.length,v=[g,m>=2?g:0,m>=3?g:0,m>=4?g:0];e={format:t,attachment:e.attachment,dataType:h.dataType,components:m,channels:r,integer:h.integer,signed:h.signed,normalized:h.normalized,bitsPerChannel:v,bytesPerPixel:h.byteLength*r.length,packed:e.packed,srgb:e.srgb},u==="-webgl"&&(e.webgl=!0),l==="-srgb"&&(e.srgb=!0)}return t.endsWith("-webgl")&&(e.webgl=!0),t.endsWith("-srgb")&&(e.srgb=!0),e}function I$(t){var a;const e=sM(t),n=e.bytesPerPixel||1,r=e.bitsPerChannel||[8,8,8,8];return delete e.bitsPerChannel,delete e.bytesPerPixel,delete e.f,delete e.render,delete e.filter,delete e.blend,delete e.store,{...e,format:t,attachment:e.attachment||"color",channels:e.channels||"r",components:e.components||((a=e.channels)==null?void 0:a.length)||1,bytesPerPixel:n,bitsPerChannel:r,dataType:e.dataType||"uint8",srgb:e.srgb??!1,packed:e.packed??!1,webgl:e.webgl??!1,integer:e.integer??!1,signed:e.signed??!1,normalized:e.normalized??!1,compressed:e.compressed??!1}}function D$(t){const n=/.*-(\d+)x(\d+)-.*/.exec(t);if(n){const[,r,i]=n;return{blockWidth:Number(r),blockHeight:Number(i)}}return null}function F$(t){const e=sM(t),n={format:t,create:e.f??!0,render:e.render??!0,filter:e.filter??!0,blend:e.blend??!0,store:e.store??!0},r=db(t),i=t.startsWith("depth")||t.startsWith("stencil"),a=r==null?void 0:r.signed,l=r==null?void 0:r.integer,u=r==null?void 0:r.webgl;return n.render&&(n.render=!a),n.filter&&(n.filter=!i&&!a&&!l&&!u),n}class k${}class B${constructor(e=[],n){M(this,"features");M(this,"disabledFeatures");this.features=new Set(e),this.disabledFeatures=n||{}}*[Symbol.iterator](){yield*this.features}has(e){var n;return!((n=this.disabledFeatures)!=null&&n[e])&&this.features.has(e)}}const Pg=class Pg{constructor(e){M(this,"id");M(this,"props");M(this,"userData",{});M(this,"statsManager",rM);M(this,"timestamp",0);M(this,"_reused",!1);M(this,"_lumaData",{});this.props={...Pg.defaultProps,...e},this.id=this.props.id||op(this[Symbol.toStringTag].toLowerCase())}get[Symbol.toStringTag](){return"Device"}getTextureFormatCapabilities(e){const n=F$(e),r=l=>(typeof l=="string"?this.features.has(l):l)??!0,i=r(n.create),a={format:e,create:i,render:i&&r(n.render),filter:i&&r(n.filter),blend:i&&r(n.blend),store:i&&r(n.store)};return this._getDeviceSpecificTextureFormatCapabilities(a)}isTextureFormatSupported(e,n){return this.getTextureFormatCapabilities(e).create}isTextureFormatFilterable(e){return this.getTextureFormatCapabilities(e).filter}isTextureFormatRenderable(e){return this.getTextureFormatCapabilities(e).render}isTextureFormatCompressed(e){return aM(e)}loseDevice(){return!1}reportError(e){this.props.onError(e)}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}createCommandEncoder(e={}){throw new Error("not implemented")}incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(e)}getCanvasContext(){return this.getDefaultCanvasContext()}readPixelsToArrayWebGL(e,n){throw new Error("not implemented")}readPixelsToBufferWebGL(e,n){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,n){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}static _getCanvasContextProps(e){return e.createCanvasContext===!0?{}:e.createCanvasContext}_normalizeBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const n={...e};return(e.usage||0)&$n.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?n.indexType="uint32":e.data instanceof Uint16Array?n.indexType="uint16":Re.warn("indices buffer content must be of integer type")()),n}};M(Pg,"defaultProps",{id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,onError:e=>Re.error(e.message)(),_reuseDevices:!1,_requestMaxLimits:!0,_factoryDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_resourceDefaults:{},webgl:{},debug:Re.get("debug")||void 0,debugShaders:Re.get("debug-shaders")||void 0,debugFramebuffers:!!Re.get("debug-framebuffers"),debugWebGL:!!Re.get("debug-webgl"),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_handle:void 0});let Ua=Pg;const U$=Ho()&&typeof document<"u",L$=()=>U$&&document.readyState==="complete",z$="set luma.log.level=1 (or higher) to trace rendering",XC="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",Ta=class Ta{constructor(){M(this,"stats",rM);M(this,"log",Re);M(this,"VERSION","9.1.2");M(this,"spector");M(this,"preregisteredAdapters",new Map);if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw Re.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),Re.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");Re.error("This version of luma.gl has already been initialized")()}Re.log(1,`${this.VERSION} - ${z$}`)(),globalThis.luma=this}registerAdapters(e){for(const n of e)this.preregisteredAdapters.set(n.type,n)}getSupportedAdapters(e=[]){const n=this.getAdapterMap(e);return Array.from(n).map(([,r])=>r).filter(r=>{var i;return(i=r.isSupported)==null?void 0:i.call(r)}).map(r=>r.type)}getBestAvailableAdapter(e=[]){var r,i,a,l;const n=this.getAdapterMap(e);return(i=(r=n.get("webgpu"))==null?void 0:r.isSupported)!=null&&i.call(r)?"webgpu":(l=(a=n.get("webgl"))==null?void 0:a.isSupported)!=null&&l.call(a)?"webgl":null}setDefaultDeviceProps(e){Object.assign(Ta.defaultProps,e)}async createDevice(e={}){var u;e={...Ta.defaultProps,...e},e.waitForPageLoad&&await Ta.pageLoaded;const n=this.getAdapterMap(e.adapters);let r=e.type||"";r==="best-available"&&(r=this.getBestAvailableAdapter(e.adapters)||r);const a=(this.getAdapterMap(e.adapters)||n).get(r),l=await((u=a==null?void 0:a.create)==null?void 0:u.call(a,e));if(l)return l;throw new Error(XC)}async attachDevice(e){var l;const n=this.getAdapterMap(e.adapters);let r="";e.handle instanceof WebGL2RenderingContext&&(r="webgl"),e.createCanvasContext&&await Ta.pageLoaded,e.handle===null&&(r="unknown");const i=n.get(r),a=await((l=i==null?void 0:i.attach)==null?void 0:l.call(i,null));if(a)return a;throw new Error(XC)}enforceWebGL2(e=!0,n=[]){var a;const i=this.getAdapterMap(n).get("webgl");i||Re.warn("enforceWebGL2: webgl adapter not found")(),(a=i==null?void 0:i.enforceWebGL2)==null||a.call(i,e)}getAdapterMap(e=[]){const n=new Map(this.preregisteredAdapters);for(const r of e)n.set(r.type,r);return n}registerDevices(e){Re.warn("luma.registerDevices() is deprecated, use luma.registerAdapters() instead");for(const n of e){const r=n.adapter;r&&this.preregisteredAdapters.set(r.type,r)}}};M(Ta,"defaultProps",{...Ua.defaultProps,type:"best-available",adapters:void 0,waitForPageLoad:!0}),M(Ta,"pageLoaded",$$().then(()=>{Re.probe(2,"DOM is loaded")()}));let U_=Ta;const L_=new U_;function $$(){return L$()||typeof window>"u"?Promise.resolve():new Promise(t=>{window.addEventListener("load",()=>t())})}class V${}const Ng=class Ng{constructor(e){M(this,"id");M(this,"props");M(this,"canvas");M(this,"htmlCanvas");M(this,"offscreenCanvas");M(this,"type");M(this,"width",1);M(this,"height",1);M(this,"resizeObserver");M(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});if(this.props={...Ng.defaultProps,...e},e=this.props,!Ho()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=j$(e.canvas):this.canvas=e.canvas;else{const n=W$(e),r=H$((e==null?void 0:e.container)||null);r.insertBefore(n,r.firstChild),this.canvas=n,e!=null&&e.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(n=>{for(const r of n)r.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}toString(){return`${this[Symbol.toStringTag]}(${this.id})`}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":const e=this.getDevicePixelRatio(),n=this.canvas;return n.parentElement?[n.clientWidth*e,n.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){const[e,n]=this.getPixelSize();return e/n}cssToDeviceRatio(){var e;try{const[n]=this.getDrawingBufferSize(),r=this._canvasSizeInfo.clientWidth||((e=this.htmlCanvas)==null?void 0:e.clientWidth);return r?n/r:1}catch{return 1}}cssToDevicePixels(e,n=!0){const r=this.cssToDeviceRatio(),[i,a]=this.getDrawingBufferSize();return X$(e,r,i,a,n)}setDevicePixelRatio(e,n={}){if(!this.htmlCanvas)return;let r="width"in n?n.width:this.htmlCanvas.clientWidth,i="height"in n?n.height:this.htmlCanvas.clientHeight;(!r||!i)&&(Re.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,r=this.htmlCanvas.width||1,i=this.htmlCanvas.height||1);const a=this._canvasSizeInfo;if(a.clientWidth!==r||a.clientHeight!==i||a.devicePixelRatio!==e){let l=e;const u=Math.floor(r*l),f=Math.floor(i*l);if(this.htmlCanvas.width=u,this.htmlCanvas.height=f,this.device.gl){const[g,m]=this.getDrawingBufferSize();(g!==u||m!==f)&&(l=Math.min(g/r,m/i),this.htmlCanvas.width=Math.floor(r*l),this.htmlCanvas.height=Math.floor(i*l),Re.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=r,this._canvasSizeInfo.clientHeight=i,this._canvasSizeInfo.devicePixelRatio=e}}}getDrawingBufferSize(){const e=this.device.gl;if(!e)throw new Error("canvas size");return[e.drawingBufferWidth,e.drawingBufferHeight]}_setAutoCreatedCanvasId(e){var n;((n=this.htmlCanvas)==null?void 0:n.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}};M(Ng,"defaultProps",{canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb"});let z_=Ng;function H$(t){if(typeof t=="string"){const e=document.getElementById(t);if(!e)throw new Error(`${t} is not an HTML element`);return e}else if(t)return t;return document.body}function j$(t){const e=document.getElementById(t);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function W$(t){const{width:e,height:n}=t,r=document.createElement("canvas");return r.id=op("lumagl-auto-created-canvas"),r.width=e||1,r.height=n||1,r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(n)?`${n}px`:"100%",r}function X$(t,e,n,r,i){const a=t,l=qC(a[0],e,n);let u=YC(a[1],e,r,i),f=qC(a[0]+1,e,n);const h=f===n-1?f:f-1;f=YC(a[1]+1,e,r,i);let g;return i?(f=f===0?f:f+1,g=u,u=f):g=f===r-1?f:f-1,{x:l,y:u,width:Math.max(h-l+1,1),height:Math.max(g-u+1,1)}}function qC(t,e,n){return Math.min(Math.round(t*e),n-1)}function YC(t,e,n,r){return r?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const Ar=class Ar extends mn{constructor(n,r){r=Ar.normalizeProps(n,r);super(n,r,Ar.defaultProps);M(this,"dimension");M(this,"format");M(this,"width");M(this,"height");M(this,"depth");M(this,"mipLevels");M(this,"updateTimestamp");if(this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.props.width===void 0||this.props.height===void 0){const i=Ar.getTextureDataSize(this.props.data);this.width=(i==null?void 0:i.width)||1,this.height=(i==null?void 0:i.height)||1}this.props.mipmaps&&this.props.mipLevels===void 0&&(this.props.mipLevels="pyramid"),this.mipLevels=this.props.mipLevels==="pyramid"?Ar.getMipLevelCount(this.width,this.height):this.props.mipLevels||1,this.updateTimestamp=n.incrementTimestamp()}get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}clone(n){return this.device.createTexture({...this.props,...n})}static isExternalImage(n){return typeof ImageData<"u"&&n instanceof ImageData||typeof ImageBitmap<"u"&&n instanceof ImageBitmap||typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement||typeof VideoFrame<"u"&&n instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas}static getExternalImageSize(n){if(typeof ImageData<"u"&&n instanceof ImageData||typeof ImageBitmap<"u"&&n instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height};if(typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement)return{width:n.naturalWidth,height:n.naturalHeight};if(typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement)return{width:n.videoWidth,height:n.videoHeight};if(typeof VideoFrame<"u"&&n instanceof VideoFrame)return{width:n.displayWidth,height:n.displayHeight};throw new Error("Unknown image type")}static isTextureLevelData(n){const r=n==null?void 0:n.data;return ArrayBuffer.isView(r)}static getTextureDataSize(n){if(!n||ArrayBuffer.isView(n))return null;if(Array.isArray(n))return Ar.getTextureDataSize(n[0]);if(Ar.isExternalImage(n))return Ar.getExternalImageSize(n);if(n&&typeof n=="object"&&n.constructor===Object){const i=Object.values(n)[0];return{width:i.width,height:i.height}}throw new Error("texture size deduction failed")}static normalizeTextureData(n,r){let i;return ArrayBuffer.isView(n)?i=[{data:n,width:r.width,height:r.height}]:Array.isArray(n)?i=n:i=[n],i}static getMipLevelCount(n,r){return Math.floor(Math.log2(Math.max(n,r)))+1}static getCubeFaceDepth(n){switch(n){case"+X":return 0;case"-X":return 1;case"+Y":return 2;case"-Y":return 3;case"+Z":return 4;case"-Z":return 5;default:throw new Error(n)}}static normalizeProps(n,r){var f,h;const i={...r},a=((h=(f=n==null?void 0:n.props)==null?void 0:f._resourceDefaults)==null?void 0:h.texture)||{};Object.assign(i,a);const{width:l,height:u}=i;return typeof l=="number"&&(i.width=Math.max(1,Math.ceil(l))),typeof u=="number"&&(i.height=Math.max(1,Math.ceil(u))),i}};M(Ar,"COPY_SRC",1),M(Ar,"COPY_DST",2),M(Ar,"TEXTURE",4),M(Ar,"STORAGE",8),M(Ar,"RENDER_ATTACHMENT",16),M(Ar,"CubeFaces",["+X","-X","+Y","-Y","+Z","-Z"]),M(Ar,"defaultProps",{...mn.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!1,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,sampler:{},view:void 0,flipY:void 0}),M(Ar,"defaultCopyExternalImageOptions",{image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1});let Kn=Ar;const Ig=class Ig extends mn{get[Symbol.toStringTag](){return"TextureView"}constructor(e,n){super(e,n,Ig.defaultProps)}};M(Ig,"defaultProps",{...mn.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});let fg=Ig;function q$(t,e,n){let r="";const i=e.split(/\r?\n/),a=t.slice().sort((l,u)=>l.lineNum-u.lineNum);switch((n==null?void 0:n.showSourceCode)||"no"){case"all":let l=0;for(let u=1;u<=i.length;u++)for(r+=oM(i[u-1],u,n);a.length>l&&a[l].lineNum===u;){const f=a[l++];r+=KC(f,i,f.lineNum,{...n,inlineSource:!1})}return r;case"issues":case"no":for(const u of t)r+=KC(u,i,u.lineNum,{inlineSource:(n==null?void 0:n.showSourceCode)!=="no"});return r}}function KC(t,e,n,r){if(r!=null&&r.inlineSource){const a=Y$(e,n),l=t.linePos>0?`${" ".repeat(t.linePos+5)}^^^
|
|
|
`:"";return`
|
|
|
${a}${l}${t.type.toUpperCase()}: ${t.message}
|
|
|
|
|
|
`}const i=t.type==="error"?"red":"#8B4000";return r!=null&&r.html?`<div class='luma-compiler-log-error' style="color:${i};"><b> ${t.type.toUpperCase()}: ${t.message}</b></div>`:`${t.type.toUpperCase()}: ${t.message}`}function Y$(t,e,n){let r="";for(let i=e-2;i<=e;i++){const a=t[i-1];a!==void 0&&(r+=oM(a,e,n))}return r}function oM(t,e,n){const r=n!=null&&n.html?Z$(t):t;return`${K$(String(e),4)}: ${r}${n!=null&&n.html?"<br/>":`
|
|
|
`}`}function K$(t,e){let n="";for(let r=t.length;r<e;++r)n+=" ";return n+t}function Z$(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}const Dg=class Dg extends mn{constructor(n,r){r={...r,debugShaders:r.debugShaders||n.props.debugShaders||"errors"};super(n,{id:Q$(r),...r},Dg.defaultProps);M(this,"stage");M(this,"source");M(this,"compilationStatus","pending");this.stage=this.props.stage,this.source=this.props.source}get[Symbol.toStringTag](){return"Shader"}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(){const n=this.props.debugShaders;switch(n){case"never":return;case"errors":if(this.compilationStatus==="success")return;break}const r=await this.getCompilationInfo();n==="warnings"&&(r==null?void 0:r.length)===0||this._displayShaderLog(r)}_displayShaderLog(n){var h;if(typeof document>"u"||!(document!=null&&document.createElement))return;const r=lM(this.source),i=`${this.stage} ${r}`;let a=q$(n,this.source,{showSourceCode:"all",html:!0});const l=this.getTranslatedSource();l&&(a+=`<br /><br /><h1>Translated Source</h1><br /><br /><code style="user-select:text;"><pre>${l}</pre></code>`);const u=document.createElement("Button");u.innerHTML=`
|
|
|
<h1>Shader Compilation Error in ${i}</h1><br /><br />
|
|
|
<code style="user-select:text;"><pre>
|
|
|
${a}
|
|
|
</pre></code>`,u.style.top="10px",u.style.left="10px",u.style.position="absolute",u.style.zIndex="9999",u.style.width="100%",u.style.textAlign="left",document.body.appendChild(u),(h=document.getElementsByClassName("luma-compiler-log-error")[0])==null||h.scrollIntoView(),u.onclick=()=>{const g=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(g)}}};M(Dg,"defaultProps",{...mn.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let dg=Dg;function Q$(t){return lM(t.source)||t.id||op(`unnamed ${t.stage}-shader`)}function lM(t,e="unnamed"){const r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(t);return r?r[1]:e}const uf=class uf extends mn{get[Symbol.toStringTag](){return"Sampler"}constructor(e,n){n=uf.normalizeProps(e,n),super(e,n,uf.defaultProps)}static normalizeProps(e,n){var a,l;const r=((l=(a=e==null?void 0:e.props)==null?void 0:a._resourceDefaults)==null?void 0:l.sampler)||{};return{...n,...r}}};M(uf,"defaultProps",{...mn.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"none",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});let hg=uf;const Fg=class Fg extends mn{constructor(n,r={}){super(n,r,Fg.defaultProps);M(this,"width");M(this,"height");this.width=this.props.width,this.height=this.props.height}get[Symbol.toStringTag](){return"Framebuffer"}clone(n){const r=this.colorAttachments.map(a=>a.texture.clone(n)),i=this.depthStencilAttachment&&this.depthStencilAttachment.texture.clone(n);return this.device.createFramebuffer({...this.props,colorAttachments:r,depthStencilAttachment:i})}resize(n){let r=!n;if(n){const[i,a]=Array.isArray(n)?n:[n.width,n.height];r=r||a!==this.height||i!==this.width,this.width=i,this.height=a}r&&(Re.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map((r,i)=>{if(typeof r=="string"){const a=this.createColorTexture(r,i);return this.attachResource(a),a.view}return r instanceof Kn?r.view:r});const n=this.props.depthStencilAttachment;if(n)if(typeof n=="string"){const r=this.createDepthStencilTexture(n);this.attachResource(r),this.depthStencilAttachment=r.view}else n instanceof Kn?this.depthStencilAttachment=n.view:this.depthStencilAttachment=n}createColorTexture(n,r){return this.device.createTexture({id:`${this.id}-color-attachment-${r}`,usage:Kn.RENDER_ATTACHMENT,format:n,width:this.width,height:this.height,sampler:{magFilter:"linear",minFilter:"linear"}})}createDepthStencilTexture(n){return this.device.createTexture({id:`${this.id}-depth-stencil-attachment`,usage:Kn.RENDER_ATTACHMENT,format:n,width:this.width,height:this.height,mipmaps:!1})}resizeAttachments(n,r){for(let i=0;i<this.colorAttachments.length;++i)if(this.colorAttachments[i]){const a=this.colorAttachments[i].texture.clone({width:n,height:r});this.destroyAttachedResource(this.colorAttachments[i]),this.colorAttachments[i]=a.view,this.attachResource(a.view)}if(this.depthStencilAttachment){const i=this.depthStencilAttachment.texture.clone({width:n,height:r});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=i.view,this.attachResource(i)}this.updateAttachments()}};M(Fg,"defaultProps",{...mn.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null});let gg=Fg;const kg=class kg extends mn{constructor(n,r){super(n,r,kg.defaultProps);M(this,"shaderLayout");M(this,"bufferLayout");M(this,"linkStatus","pending");M(this,"hash","");this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}get[Symbol.toStringTag](){return"RenderPipeline"}setUniformsWebGL(n){throw new Error("Use uniform blocks")}};M(kg,"defaultProps",{...mn.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},bindings:{},uniforms:{}});let Rc=kg;const Hi=class Hi extends mn{get[Symbol.toStringTag](){return"RenderPass"}constructor(e,n){n=Hi.normalizeProps(e,n),super(e,n,Hi.defaultProps)}static normalizeProps(e,n){var a;return{...(a=e.props._resourceDefaults)==null?void 0:a.renderPass,...n}}};M(Hi,"defaultClearColor",[0,0,0,1]),M(Hi,"defaultClearDepth",1),M(Hi,"defaultClearStencil",0),M(Hi,"defaultProps",{...mn.defaultProps,framebuffer:null,parameters:void 0,clearColor:Hi.defaultClearColor,clearColors:void 0,clearDepth:Hi.defaultClearDepth,clearStencil:Hi.defaultClearStencil,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});let $_=Hi;const Bg=class Bg extends mn{constructor(n,r){super(n,r,Bg.defaultProps);M(this,"hash","");M(this,"shaderLayout");this.shaderLayout=r.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};M(Bg,"defaultProps",{...mn.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let pg=Bg;const Ug=class Ug extends mn{get[Symbol.toStringTag](){return"CommandEncoder"}constructor(e,n){super(e,n,Ug.defaultProps)}};M(Ug,"defaultProps",{...mn.defaultProps,measureExecutionTime:void 0});let V_=Ug;const Lg=class Lg extends mn{get[Symbol.toStringTag](){return"CommandBuffer"}constructor(e,n){super(e,n,Lg.defaultProps)}};M(Lg,"defaultProps",{...mn.defaultProps});let H_=Lg;function G$(t){const[e,n]=eV[t],r=e==="i32"||e==="u32",i=e!=="u32",a=tV[e]*n,l=J$(e,n);return{dataType:e,components:n,defaultVertexFormat:l,byteLength:a,integer:r,signed:i}}function J$(t,e){let n;switch(t){case"f32":n="float32";break;case"i32":n="sint32";break;case"u32":n="uint32";break;case"f16":return e<=2?"float16x2":"float16x4"}return e===1?n:`${n}x${e}`}const eV={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},tV={f32:4,f16:2,i32:4,u32:4};function cM(t){let e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);const[n,r]=t.split("x"),i=n,a=r?parseInt(r):1,l=iM(i),u={type:i,components:a,byteLength:l.byteLength*a,integer:l.integer,signed:l.signed,normalized:l.normalized};return e&&(u.webglOnly=!0),u}function uM(t,e){const n={};for(const r of t.attributes){const i=rV(t,e,r.name);i&&(n[r.name]=i)}return n}function nV(t,e,n=16){const r=uM(t,e),i=new Array(n).fill(null);for(const a of Object.values(r))i[a.location]=a;return i}function rV(t,e,n){const r=iV(t,n),i=sV(e,n);if(!r)return null;const a=G$(r.type),l=(i==null?void 0:i.vertexFormat)||a.defaultVertexFormat,u=cM(l);return{attributeName:(i==null?void 0:i.attributeName)||r.name,bufferName:(i==null?void 0:i.bufferName)||r.name,location:r.location,shaderType:r.type,shaderDataType:a.dataType,shaderComponents:a.components,vertexFormat:l,bufferDataType:u.type,bufferComponents:u.components,normalized:u.normalized,integer:a.integer,stepMode:(i==null?void 0:i.stepMode)||r.stepMode||"vertex",byteOffset:(i==null?void 0:i.byteOffset)||0,byteStride:(i==null?void 0:i.byteStride)||0}}function iV(t,e){const n=t.attributes.find(r=>r.name===e);return n||Re.warn(`shader layout attribute "${e}" not present in shader`),n||null}function sV(t,e){aV(t);let n=oV(t,e);return n||(n=lV(t,e),n)?n:(Re.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function aV(t){for(const e of t)(e.attributes&&e.format||!e.attributes&&!e.format)&&Re.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function oV(t,e){for(const n of t)if(n.format&&n.name===e)return{attributeName:n.name,bufferName:e,stepMode:n.stepMode,vertexFormat:n.format,byteOffset:0,byteStride:n.byteStride||0};return null}function lV(t,e){var n;for(const r of t){let i=r.byteStride;if(typeof r.byteStride!="number")for(const l of r.attributes||[]){const u=cM(l.format);i+=u.byteLength}const a=(n=r.attributes)==null?void 0:n.find(l=>l.attribute===e);if(a)return{attributeName:a.attribute,bufferName:r.name,stepMode:r.stepMode,vertexFormat:a.format,byteOffset:a.byteOffset,byteStride:i}}return null}const zg=class zg extends mn{constructor(n,r){super(n,r,zg.defaultProps);M(this,"maxVertexAttributes");M(this,"attributeInfos");M(this,"indexBuffer",null);M(this,"attributes");this.maxVertexAttributes=n.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null);const{shaderLayout:i,bufferLayout:a}=r.renderPipeline||{};if(!i||!a)throw new Error("VertexArray");this.attributeInfos=nV(i,a,this.maxVertexAttributes)}get[Symbol.toStringTag](){return"VertexArray"}setConstantWebGL(n,r){throw new Error("constant attributes not supported")}};M(zg,"defaultProps",{...mn.defaultProps,renderPipeline:null});let j_=zg;const $g=class $g extends mn{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,n){super(e,n,$g.defaultProps)}};M($g,"defaultProps",{...mn.defaultProps,layout:void 0,buffers:{}});let W_=$g;const Vg=class Vg extends mn{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,n){super(e,n,Vg.defaultProps)}};M(Vg,"defaultProps",{...mn.defaultProps,type:void 0,count:void 0});let X_=Vg;const cV={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function uV(t){return cV[t]}function fV(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}let vh;function fM(t){return(!vh||vh.byteLength<t)&&(vh=new ArrayBuffer(t)),vh}function dV(t,e){const n=fM(t.BYTES_PER_ELEMENT*e);return new t(n,0,e)}function hV(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function mg(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number":hV(t)}const ZC=1024;class gV{constructor(e){M(this,"layout",{});M(this,"byteLength");let n=0;for(const[i,a]of Object.entries(e)){const l=uV(a),{type:u,components:f}=l;n=fV(n,f);const h=n;n+=f,this.layout[i]={type:u,size:f,offset:h}}n+=(4-n%4)%4;const r=n*4;this.byteLength=Math.max(r,ZC)}getData(e){const n=Math.max(this.byteLength,ZC),r=fM(n),i={i32:new Int32Array(r),u32:new Uint32Array(r),f32:new Float32Array(r),f16:new Uint16Array(r)};for(const[a,l]of Object.entries(e)){const u=this.layout[a];if(!u){Re.warn(`Supplied uniform value ${a} not present in uniform block layout`)();continue}const{type:f,size:h,offset:g}=u,m=i[f];if(h===1){if(typeof l!="number"&&typeof l!="boolean"){Re.warn(`Supplied value for single component uniform ${a} is not a number: ${l}`)();continue}m[g]=Number(l)}else{if(!mg(l)){Re.warn(`Supplied value for multi component / array uniform ${a} is not a numeric array: ${l}`)();continue}m.set(l,g)}}return new Uint8Array(r)}has(e){return!!this.layout[e]}get(e){return this.layout[e]}}function pV(t,e,n=16){if(t!==e)return!1;const r=t,i=e;if(!mg(r))return!1;if(mg(i)&&r.length===i.length){for(let a=0;a<r.length;++a)if(i[a]!==r[a])return!1}return!0}function mV(t){return mg(t)?t.slice():t}class vV{constructor(e){M(this,"name");M(this,"uniforms",{});M(this,"modifiedUniforms",{});M(this,"modified",!0);M(this,"bindingLayout",{});M(this,"needsRedraw","initialized");var n;if(this.name=(e==null?void 0:e.name)||"unnamed",e!=null&&e.name&&(e!=null&&e.shaderLayout)){const r=(n=e==null?void 0:e.shaderLayout.bindings)==null?void 0:n.find(a=>a.type==="uniform"&&a.name===(e==null?void 0:e.name));if(!r)throw new Error(e==null?void 0:e.name);const i=r;for(const a of i.uniforms||[])this.bindingLayout[a.name]=a}}setUniforms(e){for(const[n,r]of Object.entries(e))this._setUniform(n,r),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${n}=${r}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,n){pV(this.uniforms[e],n)||(this.uniforms[e]=mV(n),this.modifiedUniforms[e]=!0,this.modified=!0)}}class _V{constructor(e){M(this,"uniformBlocks",new Map);M(this,"uniformBufferLayouts",new Map);M(this,"uniformBuffers",new Map);for(const[n,r]of Object.entries(e)){const i=n,a=new gV(r.uniformTypes||{});this.uniformBufferLayouts.set(i,a);const l=new vV({name:n});l.setUniforms(r.defaultUniforms||{}),this.uniformBlocks.set(i,l)}}destroy(){for(const e of this.uniformBuffers.values())e.destroy()}setUniforms(e){var n;for(const[r,i]of Object.entries(e))(n=this.uniformBlocks.get(r))==null||n.setUniforms(i);this.updateUniformBuffers()}getUniformBufferByteLength(e){var n;return((n=this.uniformBufferLayouts.get(e))==null?void 0:n.byteLength)||0}getUniformBufferData(e){var r,i;const n=((r=this.uniformBlocks.get(e))==null?void 0:r.getAllUniforms())||{};return(i=this.uniformBufferLayouts.get(e))==null?void 0:i.getData(n)}createUniformBuffer(e,n,r){r&&this.setUniforms(r);const i=this.getUniformBufferByteLength(n),a=e.createBuffer({usage:$n.UNIFORM|$n.COPY_DST,byteLength:i}),l=this.getUniformBufferData(n);return a.write(l),a}getManagedUniformBuffer(e,n){if(!this.uniformBuffers.get(n)){const r=this.getUniformBufferByteLength(n),i=e.createBuffer({usage:$n.UNIFORM|$n.COPY_DST,byteLength:r});this.uniformBuffers.set(n,i)}return this.uniformBuffers.get(n)}updateUniformBuffers(){let e=!1;for(const n of this.uniformBlocks.keys()){const r=this.updateUniformBuffer(n);e||(e=r)}return e&&Re.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){var a;const n=this.uniformBlocks.get(e);let r=this.uniformBuffers.get(e),i=!1;if(r&&(n!=null&&n.needsRedraw)){i||(i=n.needsRedraw);const l=this.getUniformBufferData(e);r=this.uniformBuffers.get(e),r==null||r.write(l);const u=(a=this.uniformBlocks.get(e))==null?void 0:a.getAllUniforms();Re.log(4,`Writing to uniform buffer ${String(e)}`,l,u)()}return i}}function dM(t){const e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function hM(t){switch(t){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(t)}}function yV(t,e,n){if(!e||e>4)throw new Error(`size ${e}`);const r=e;let i=dM(t);if(i==="uint8"&&n&&r===1)return"unorm8-webgl";if(i==="uint8"&&n&&r===3)return"unorm8x3-webgl";if(i==="uint8"||i==="sint8"){if(r===1||r===3)throw new Error(`size: ${e}`);return n&&(i=i.replace("int","norm")),`${i}x${r}`}if(i==="uint16"||i==="sint16"){if(r===1||r===3)throw new Error(`size: ${e}`);return n&&(i=i.replace("int","norm")),`${i}x${r}`}return r===1?i:`${i}x${r}`}class Zv{constructor(e){M(this,"bufferLayouts");this.bufferLayouts=e}getBufferLayout(e){return this.bufferLayouts.find(n=>n.name===e)||null}getAttributeNamesForBuffer(e){var n;return e.attributes?(n=e.attributes)==null?void 0:n.map(r=>r.attribute):[e.name]}mergeBufferLayouts(e,n){const r=[...e];for(const i of n){const a=r.findIndex(l=>l.name===i.name);a<0?r.push(i):r[a]=i}return r}}class bV{constructor(){this.constants=new Map,this.aliases=new Map,this.structs=new Map}}class qs{constructor(){}get isAstNode(){return!0}get astNodeType(){return""}evaluate(e){throw new Error("Cannot evaluate node")}evaluateString(e){return this.evaluate(e).toString()}search(e){}searchBlock(e,n){if(e){n(vg.instance);for(const r of e)r instanceof Array?this.searchBlock(r,n):r.search(n);n(_g.instance)}}}class vg extends qs{}vg.instance=new vg;class _g extends qs{}_g.instance=new _g;class kn extends qs{constructor(){super()}}let q_=class extends kn{constructor(e,n,r,i,a,l){super(),this.calls=new Set,this.name=e,this.args=n,this.returnType=r,this.body=i,this.startLine=a,this.endLine=l}get astNodeType(){return"function"}search(e){this.searchBlock(this.body,e)}};class SV extends kn{constructor(e){super(),this.expression=e}get astNodeType(){return"staticAssert"}search(e){this.expression.search(e)}}class EV extends kn{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"while"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class wV extends kn{constructor(e){super(),this.body=e}get astNodeType(){return"continuing"}search(e){this.searchBlock(this.body,e)}}class TV extends kn{constructor(e,n,r,i){super(),this.init=e,this.condition=n,this.increment=r,this.body=i}get astNodeType(){return"for"}search(e){var n,r,i;(n=this.init)===null||n===void 0||n.search(e),(r=this.condition)===null||r===void 0||r.search(e),(i=this.increment)===null||i===void 0||i.search(e),this.searchBlock(this.body,e)}}class _o extends kn{constructor(e,n,r,i,a){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=a}get astNodeType(){return"var"}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}class gM extends kn{constructor(e,n,r){super(),this.name=e,this.type=n,this.value=r}get astNodeType(){return"override"}search(e){var n;(n=this.value)===null||n===void 0||n.search(e)}}class Y_ extends kn{constructor(e,n,r,i,a){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=a}get astNodeType(){return"let"}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}class QC extends kn{constructor(e,n,r,i,a){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=a}get astNodeType(){return"const"}evaluate(e){return this.value.evaluate(e)}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}var xc;(function(t){t.increment="++",t.decrement="--"})(xc||(xc={}));(function(t){function e(n){const r=n;if(r=="parse")throw new Error("Invalid value for IncrementOperator");return t[r]}t.parse=e})(xc||(xc={}));class CV extends kn{constructor(e,n){super(),this.operator=e,this.variable=n}get astNodeType(){return"increment"}search(e){this.variable.search(e)}}var Mf;(function(t){t.assign="=",t.addAssign="+=",t.subtractAssin="-=",t.multiplyAssign="*=",t.divideAssign="/=",t.moduloAssign="%=",t.andAssign="&=",t.orAssign="|=",t.xorAssign="^=",t.shiftLeftAssign="<<=",t.shiftRightAssign=">>="})(Mf||(Mf={}));(function(t){function e(n){const r=n;if(r=="parse")throw new Error("Invalid value for AssignOperator");return r}t.parse=e})(Mf||(Mf={}));class AV extends kn{constructor(e,n,r){super(),this.operator=e,this.variable=n,this.value=r}get astNodeType(){return"assign"}search(e){this.variable.search(e),this.value.search(e)}}class pM extends kn{constructor(e,n){super(),this.name=e,this.args=n}get astNodeType(){return"call"}search(e){for(const n of this.args)n.search(e);e(this)}}class RV extends kn{constructor(e,n){super(),this.body=e,this.continuing=n}get astNodeType(){return"loop"}}class xV extends kn{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"body"}}class MV extends kn{constructor(e,n,r,i){super(),this.condition=e,this.body=n,this.elseif=r,this.else=i}get astNodeType(){return"if"}search(e){this.condition.search(e),this.searchBlock(this.body,e),this.searchBlock(this.elseif,e),this.searchBlock(this.else,e)}}class OV extends kn{constructor(e){super(),this.value=e}get astNodeType(){return"return"}search(e){var n;(n=this.value)===null||n===void 0||n.search(e)}}class PV extends kn{constructor(e){super(),this.name=e}get astNodeType(){return"enable"}}class NV extends kn{constructor(e){super(),this.extensions=e}get astNodeType(){return"requires"}}class IV extends kn{constructor(e,n){super(),this.severity=e,this.rule=n}get astNodeType(){return"diagnostic"}}class mM extends kn{constructor(e,n){super(),this.name=e,this.type=n}get astNodeType(){return"alias"}}class DV extends kn{constructor(){super()}get astNodeType(){return"discard"}}class FV extends kn{constructor(){super()}get astNodeType(){return"break"}}class kV extends kn{constructor(){super()}get astNodeType(){return"continue"}}class Zo extends kn{constructor(e){super(),this.name=e}get astNodeType(){return"type"}get isStruct(){return!1}get isArray(){return!1}}class go extends Zo{constructor(e,n,r,i){super(e),this.members=n,this.startLine=r,this.endLine=i}get astNodeType(){return"struct"}get isStruct(){return!0}getMemberIndex(e){for(let n=0;n<this.members.length;n++)if(this.members[n].name==e)return n;return-1}}class vM extends Zo{constructor(e,n,r){super(e),this.format=n,this.access=r}get astNodeType(){return"template"}}class BV extends Zo{constructor(e,n,r,i){super(e),this.storage=n,this.type=r,this.access=i}get astNodeType(){return"pointer"}}class _M extends Zo{constructor(e,n,r,i){super(e),this.attributes=n,this.format=r,this.count=i}get astNodeType(){return"array"}get isArray(){return!0}}class qu extends Zo{constructor(e,n,r){super(e),this.format=n,this.access=r}get astNodeType(){return"sampler"}}class Es extends qs{constructor(){super()}}class UV extends Es{constructor(e){super(),this.value=e}get astNodeType(){return"stringExpr"}toString(){return this.value}evaluateString(){return this.value}}class ql extends Es{constructor(e,n){super(),this.type=e,this.args=n}get astNodeType(){return"createExpr"}search(e){if(e(this),this.args)for(const n of this.args)n.search(e)}evaluate(e){return this.args[0].evaluate(e)}}class yM extends Es{constructor(e,n){super(),this.name=e,this.args=n}get astNodeType(){return"callExpr"}evaluate(e){switch(this.name){case"abs":return Math.abs(this.args[0].evaluate(e));case"acos":return Math.acos(this.args[0].evaluate(e));case"acosh":return Math.acosh(this.args[0].evaluate(e));case"asin":return Math.asin(this.args[0].evaluate(e));case"asinh":return Math.asinh(this.args[0].evaluate(e));case"atan":return Math.atan(this.args[0].evaluate(e));case"atan2":return Math.atan2(this.args[0].evaluate(e),this.args[1].evaluate(e));case"atanh":return Math.atanh(this.args[0].evaluate(e));case"ceil":return Math.ceil(this.args[0].evaluate(e));case"clamp":return Math.min(Math.max(this.args[0].evaluate(e),this.args[1].evaluate(e)),this.args[2].evaluate(e));case"cos":return Math.cos(this.args[0].evaluate(e));case"degrees":return this.args[0].evaluate(e)*180/Math.PI;case"distance":return Math.sqrt(Math.pow(this.args[0].evaluate(e)-this.args[1].evaluate(e),2));case"dot":case"exp":return Math.exp(this.args[0].evaluate(e));case"exp2":return Math.pow(2,this.args[0].evaluate(e));case"floor":return Math.floor(this.args[0].evaluate(e));case"fma":return this.args[0].evaluate(e)*this.args[1].evaluate(e)+this.args[2].evaluate(e);case"fract":return this.args[0].evaluate(e)-Math.floor(this.args[0].evaluate(e));case"inverseSqrt":return 1/Math.sqrt(this.args[0].evaluate(e));case"log":return Math.log(this.args[0].evaluate(e));case"log2":return Math.log2(this.args[0].evaluate(e));case"max":return Math.max(this.args[0].evaluate(e),this.args[1].evaluate(e));case"min":return Math.min(this.args[0].evaluate(e),this.args[1].evaluate(e));case"mix":return this.args[0].evaluate(e)*(1-this.args[2].evaluate(e))+this.args[1].evaluate(e)*this.args[2].evaluate(e);case"modf":return this.args[0].evaluate(e)-Math.floor(this.args[0].evaluate(e));case"pow":return Math.pow(this.args[0].evaluate(e),this.args[1].evaluate(e));case"radians":return this.args[0].evaluate(e)*Math.PI/180;case"round":return Math.round(this.args[0].evaluate(e));case"sign":return Math.sign(this.args[0].evaluate(e));case"sin":return Math.sin(this.args[0].evaluate(e));case"sinh":return Math.sinh(this.args[0].evaluate(e));case"saturate":return Math.min(Math.max(this.args[0].evaluate(e),0),1);case"smoothstep":return this.args[0].evaluate(e)*this.args[0].evaluate(e)*(3-2*this.args[0].evaluate(e));case"sqrt":return Math.sqrt(this.args[0].evaluate(e));case"step":return this.args[0].evaluate(e)<this.args[1].evaluate(e)?0:1;case"tan":return Math.tan(this.args[0].evaluate(e));case"tanh":return Math.tanh(this.args[0].evaluate(e));case"trunc":return Math.trunc(this.args[0].evaluate(e));default:throw new Error("Non const function: "+this.name)}}search(e){for(const n of this.args)n.search(e);e(this)}}class K_ extends Es{constructor(e){super(),this.name=e}get astNodeType(){return"varExpr"}search(e){e(this),this.postfix&&this.postfix.search(e)}evaluate(e){const n=e.constants.get(this.name);if(!n)throw new Error("Cannot evaluate node");return n.evaluate(e)}}class GC extends Es{constructor(e,n){super(),this.name=e,this.initializer=n}get astNodeType(){return"constExpr"}evaluate(e){var n,r;if(this.initializer instanceof ql){const i=(n=this.postfix)===null||n===void 0?void 0:n.evaluateString(e),a=(r=this.initializer.type)===null||r===void 0?void 0:r.name,l=e.structs.get(a),u=l==null?void 0:l.getMemberIndex(i);return u!==void 0&&u!=-1?this.initializer.args[u].evaluate(e):this.initializer.evaluate(e)}return this.initializer.evaluate(e)}search(e){this.initializer.search(e)}}class JC extends Es{constructor(e){super(),this.value=e}get astNodeType(){return"literalExpr"}evaluate(){return this.value}}class LV extends Es{constructor(e,n){super(),this.type=e,this.value=n}get astNodeType(){return"bitcastExpr"}search(e){this.value.search(e)}}class e2 extends Es{constructor(e){super(),this.contents=e}get astNodeType(){return"groupExpr"}evaluate(e){return this.contents[0].evaluate(e)}search(e){this.searchBlock(this.contents,e)}}class zV extends Es{constructor(e){super(),this.index=e}search(e){this.index.search(e)}}class bM extends Es{constructor(){super()}}class $V extends bM{constructor(e,n){super(),this.operator=e,this.right=n}get astNodeType(){return"unaryOp"}evaluate(e){switch(this.operator){case"+":return this.right.evaluate(e);case"-":return-this.right.evaluate(e);case"!":return this.right.evaluate(e)?0:1;case"~":return~this.right.evaluate(e);default:throw new Error("Unknown unary operator: "+this.operator)}}search(e){this.right.search(e)}}class ls extends bM{constructor(e,n,r){super(),this.operator=e,this.left=n,this.right=r}get astNodeType(){return"binaryOp"}evaluate(e){switch(this.operator){case"+":return this.left.evaluate(e)+this.right.evaluate(e);case"-":return this.left.evaluate(e)-this.right.evaluate(e);case"*":return this.left.evaluate(e)*this.right.evaluate(e);case"/":return this.left.evaluate(e)/this.right.evaluate(e);case"%":return this.left.evaluate(e)%this.right.evaluate(e);case"==":return this.left.evaluate(e)==this.right.evaluate(e)?1:0;case"!=":return this.left.evaluate(e)!=this.right.evaluate(e)?1:0;case"<":return this.left.evaluate(e)<this.right.evaluate(e)?1:0;case">":return this.left.evaluate(e)>this.right.evaluate(e)?1:0;case"<=":return this.left.evaluate(e)<=this.right.evaluate(e)?1:0;case">=":return this.left.evaluate(e)>=this.right.evaluate(e)?1:0;case"&&":return this.left.evaluate(e)&&this.right.evaluate(e)?1:0;case"||":return this.left.evaluate(e)||this.right.evaluate(e)?1:0;default:throw new Error(`Unknown operator ${this.operator}`)}}search(e){this.left.search(e),this.right.search(e)}}class SM extends qs{constructor(){super()}}class VV extends SM{constructor(e,n){super(),this.selector=e,this.body=n}get astNodeType(){return"case"}search(e){this.searchBlock(this.body,e)}}class HV extends SM{constructor(e){super(),this.body=e}get astNodeType(){return"default"}search(e){this.searchBlock(this.body,e)}}class jV extends qs{constructor(e,n,r){super(),this.name=e,this.type=n,this.attributes=r}get astNodeType(){return"argument"}}class WV extends qs{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"elseif"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class XV extends qs{constructor(e,n,r){super(),this.name=e,this.type=n,this.attributes=r}get astNodeType(){return"member"}}let qV=class extends qs{constructor(e,n){super(),this.name=e,this.value=n}get astNodeType(){return"attribute"}};var oe,te;(function(t){t[t.token=0]="token",t[t.keyword=1]="keyword",t[t.reserved=2]="reserved"})(te||(te={}));class ne{constructor(e,n,r){this.name=e,this.type=n,this.rule=r}toString(){return this.name}}class k{}oe=k;k.none=new ne("",te.reserved,"");k.eof=new ne("EOF",te.token,"");k.reserved={asm:new ne("asm",te.reserved,"asm"),bf16:new ne("bf16",te.reserved,"bf16"),do:new ne("do",te.reserved,"do"),enum:new ne("enum",te.reserved,"enum"),f16:new ne("f16",te.reserved,"f16"),f64:new ne("f64",te.reserved,"f64"),handle:new ne("handle",te.reserved,"handle"),i8:new ne("i8",te.reserved,"i8"),i16:new ne("i16",te.reserved,"i16"),i64:new ne("i64",te.reserved,"i64"),mat:new ne("mat",te.reserved,"mat"),premerge:new ne("premerge",te.reserved,"premerge"),regardless:new ne("regardless",te.reserved,"regardless"),typedef:new ne("typedef",te.reserved,"typedef"),u8:new ne("u8",te.reserved,"u8"),u16:new ne("u16",te.reserved,"u16"),u64:new ne("u64",te.reserved,"u64"),unless:new ne("unless",te.reserved,"unless"),using:new ne("using",te.reserved,"using"),vec:new ne("vec",te.reserved,"vec"),void:new ne("void",te.reserved,"void")};k.keywords={array:new ne("array",te.keyword,"array"),atomic:new ne("atomic",te.keyword,"atomic"),bool:new ne("bool",te.keyword,"bool"),f32:new ne("f32",te.keyword,"f32"),i32:new ne("i32",te.keyword,"i32"),mat2x2:new ne("mat2x2",te.keyword,"mat2x2"),mat2x3:new ne("mat2x3",te.keyword,"mat2x3"),mat2x4:new ne("mat2x4",te.keyword,"mat2x4"),mat3x2:new ne("mat3x2",te.keyword,"mat3x2"),mat3x3:new ne("mat3x3",te.keyword,"mat3x3"),mat3x4:new ne("mat3x4",te.keyword,"mat3x4"),mat4x2:new ne("mat4x2",te.keyword,"mat4x2"),mat4x3:new ne("mat4x3",te.keyword,"mat4x3"),mat4x4:new ne("mat4x4",te.keyword,"mat4x4"),ptr:new ne("ptr",te.keyword,"ptr"),sampler:new ne("sampler",te.keyword,"sampler"),sampler_comparison:new ne("sampler_comparison",te.keyword,"sampler_comparison"),struct:new ne("struct",te.keyword,"struct"),texture_1d:new ne("texture_1d",te.keyword,"texture_1d"),texture_2d:new ne("texture_2d",te.keyword,"texture_2d"),texture_2d_array:new ne("texture_2d_array",te.keyword,"texture_2d_array"),texture_3d:new ne("texture_3d",te.keyword,"texture_3d"),texture_cube:new ne("texture_cube",te.keyword,"texture_cube"),texture_cube_array:new ne("texture_cube_array",te.keyword,"texture_cube_array"),texture_multisampled_2d:new ne("texture_multisampled_2d",te.keyword,"texture_multisampled_2d"),texture_storage_1d:new ne("texture_storage_1d",te.keyword,"texture_storage_1d"),texture_storage_2d:new ne("texture_storage_2d",te.keyword,"texture_storage_2d"),texture_storage_2d_array:new ne("texture_storage_2d_array",te.keyword,"texture_storage_2d_array"),texture_storage_3d:new ne("texture_storage_3d",te.keyword,"texture_storage_3d"),texture_depth_2d:new ne("texture_depth_2d",te.keyword,"texture_depth_2d"),texture_depth_2d_array:new ne("texture_depth_2d_array",te.keyword,"texture_depth_2d_array"),texture_depth_cube:new ne("texture_depth_cube",te.keyword,"texture_depth_cube"),texture_depth_cube_array:new ne("texture_depth_cube_array",te.keyword,"texture_depth_cube_array"),texture_depth_multisampled_2d:new ne("texture_depth_multisampled_2d",te.keyword,"texture_depth_multisampled_2d"),texture_external:new ne("texture_external",te.keyword,"texture_external"),u32:new ne("u32",te.keyword,"u32"),vec2:new ne("vec2",te.keyword,"vec2"),vec3:new ne("vec3",te.keyword,"vec3"),vec4:new ne("vec4",te.keyword,"vec4"),bitcast:new ne("bitcast",te.keyword,"bitcast"),block:new ne("block",te.keyword,"block"),break:new ne("break",te.keyword,"break"),case:new ne("case",te.keyword,"case"),continue:new ne("continue",te.keyword,"continue"),continuing:new ne("continuing",te.keyword,"continuing"),default:new ne("default",te.keyword,"default"),diagnostic:new ne("diagnostic",te.keyword,"diagnostic"),discard:new ne("discard",te.keyword,"discard"),else:new ne("else",te.keyword,"else"),enable:new ne("enable",te.keyword,"enable"),fallthrough:new ne("fallthrough",te.keyword,"fallthrough"),false:new ne("false",te.keyword,"false"),fn:new ne("fn",te.keyword,"fn"),for:new ne("for",te.keyword,"for"),function:new ne("function",te.keyword,"function"),if:new ne("if",te.keyword,"if"),let:new ne("let",te.keyword,"let"),const:new ne("const",te.keyword,"const"),loop:new ne("loop",te.keyword,"loop"),while:new ne("while",te.keyword,"while"),private:new ne("private",te.keyword,"private"),read:new ne("read",te.keyword,"read"),read_write:new ne("read_write",te.keyword,"read_write"),return:new ne("return",te.keyword,"return"),requires:new ne("requires",te.keyword,"requires"),storage:new ne("storage",te.keyword,"storage"),switch:new ne("switch",te.keyword,"switch"),true:new ne("true",te.keyword,"true"),alias:new ne("alias",te.keyword,"alias"),type:new ne("type",te.keyword,"type"),uniform:new ne("uniform",te.keyword,"uniform"),var:new ne("var",te.keyword,"var"),override:new ne("override",te.keyword,"override"),workgroup:new ne("workgroup",te.keyword,"workgroup"),write:new ne("write",te.keyword,"write"),r8unorm:new ne("r8unorm",te.keyword,"r8unorm"),r8snorm:new ne("r8snorm",te.keyword,"r8snorm"),r8uint:new ne("r8uint",te.keyword,"r8uint"),r8sint:new ne("r8sint",te.keyword,"r8sint"),r16uint:new ne("r16uint",te.keyword,"r16uint"),r16sint:new ne("r16sint",te.keyword,"r16sint"),r16float:new ne("r16float",te.keyword,"r16float"),rg8unorm:new ne("rg8unorm",te.keyword,"rg8unorm"),rg8snorm:new ne("rg8snorm",te.keyword,"rg8snorm"),rg8uint:new ne("rg8uint",te.keyword,"rg8uint"),rg8sint:new ne("rg8sint",te.keyword,"rg8sint"),r32uint:new ne("r32uint",te.keyword,"r32uint"),r32sint:new ne("r32sint",te.keyword,"r32sint"),r32float:new ne("r32float",te.keyword,"r32float"),rg16uint:new ne("rg16uint",te.keyword,"rg16uint"),rg16sint:new ne("rg16sint",te.keyword,"rg16sint"),rg16float:new ne("rg16float",te.keyword,"rg16float"),rgba8unorm:new ne("rgba8unorm",te.keyword,"rgba8unorm"),rgba8unorm_srgb:new ne("rgba8unorm_srgb",te.keyword,"rgba8unorm_srgb"),rgba8snorm:new ne("rgba8snorm",te.keyword,"rgba8snorm"),rgba8uint:new ne("rgba8uint",te.keyword,"rgba8uint"),rgba8sint:new ne("rgba8sint",te.keyword,"rgba8sint"),bgra8unorm:new ne("bgra8unorm",te.keyword,"bgra8unorm"),bgra8unorm_srgb:new ne("bgra8unorm_srgb",te.keyword,"bgra8unorm_srgb"),rgb10a2unorm:new ne("rgb10a2unorm",te.keyword,"rgb10a2unorm"),rg11b10float:new ne("rg11b10float",te.keyword,"rg11b10float"),rg32uint:new ne("rg32uint",te.keyword,"rg32uint"),rg32sint:new ne("rg32sint",te.keyword,"rg32sint"),rg32float:new ne("rg32float",te.keyword,"rg32float"),rgba16uint:new ne("rgba16uint",te.keyword,"rgba16uint"),rgba16sint:new ne("rgba16sint",te.keyword,"rgba16sint"),rgba16float:new ne("rgba16float",te.keyword,"rgba16float"),rgba32uint:new ne("rgba32uint",te.keyword,"rgba32uint"),rgba32sint:new ne("rgba32sint",te.keyword,"rgba32sint"),rgba32float:new ne("rgba32float",te.keyword,"rgba32float"),static_assert:new ne("static_assert",te.keyword,"static_assert")};k.tokens={decimal_float_literal:new ne("decimal_float_literal",te.token,/((-?[0-9]*\.[0-9]+|-?[0-9]+\.[0-9]*)((e|E)(\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\+|-)?[0-9]+f?)|(-?[0-9]+f)/),hex_float_literal:new ne("hex_float_literal",te.token,/-?0x((([0-9a-fA-F]*\.[0-9a-fA-F]+|[0-9a-fA-F]+\.[0-9a-fA-F]*)((p|P)(\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\+|-)?[0-9]+f?))/),int_literal:new ne("int_literal",te.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new ne("uint_literal",te.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),ident:new ne("ident",te.token,/[_a-zA-Z][0-9a-zA-Z_]*/),and:new ne("and",te.token,"&"),and_and:new ne("and_and",te.token,"&&"),arrow:new ne("arrow ",te.token,"->"),attr:new ne("attr",te.token,"@"),forward_slash:new ne("forward_slash",te.token,"/"),bang:new ne("bang",te.token,"!"),bracket_left:new ne("bracket_left",te.token,"["),bracket_right:new ne("bracket_right",te.token,"]"),brace_left:new ne("brace_left",te.token,"{"),brace_right:new ne("brace_right",te.token,"}"),colon:new ne("colon",te.token,":"),comma:new ne("comma",te.token,","),equal:new ne("equal",te.token,"="),equal_equal:new ne("equal_equal",te.token,"=="),not_equal:new ne("not_equal",te.token,"!="),greater_than:new ne("greater_than",te.token,">"),greater_than_equal:new ne("greater_than_equal",te.token,">="),shift_right:new ne("shift_right",te.token,">>"),less_than:new ne("less_than",te.token,"<"),less_than_equal:new ne("less_than_equal",te.token,"<="),shift_left:new ne("shift_left",te.token,"<<"),modulo:new ne("modulo",te.token,"%"),minus:new ne("minus",te.token,"-"),minus_minus:new ne("minus_minus",te.token,"--"),period:new ne("period",te.token,"."),plus:new ne("plus",te.token,"+"),plus_plus:new ne("plus_plus",te.token,"++"),or:new ne("or",te.token,"|"),or_or:new ne("or_or",te.token,"||"),paren_left:new ne("paren_left",te.token,"("),paren_right:new ne("paren_right",te.token,")"),semicolon:new ne("semicolon",te.token,";"),star:new ne("star",te.token,"*"),tilde:new ne("tilde",te.token,"~"),underscore:new ne("underscore",te.token,"_"),xor:new ne("xor",te.token,"^"),plus_equal:new ne("plus_equal",te.token,"+="),minus_equal:new ne("minus_equal",te.token,"-="),times_equal:new ne("times_equal",te.token,"*="),division_equal:new ne("division_equal",te.token,"/="),modulo_equal:new ne("modulo_equal",te.token,"%="),and_equal:new ne("and_equal",te.token,"&="),or_equal:new ne("or_equal",te.token,"|="),xor_equal:new ne("xor_equal",te.token,"^="),shift_right_equal:new ne("shift_right_equal",te.token,">>="),shift_left_equal:new ne("shift_left_equal",te.token,"<<=")};k.simpleTokens={"@":oe.tokens.attr,"{":oe.tokens.brace_left,"}":oe.tokens.brace_right,":":oe.tokens.colon,",":oe.tokens.comma,"(":oe.tokens.paren_left,")":oe.tokens.paren_right,";":oe.tokens.semicolon};k.literalTokens={"&":oe.tokens.and,"&&":oe.tokens.and_and,"->":oe.tokens.arrow,"/":oe.tokens.forward_slash,"!":oe.tokens.bang,"[":oe.tokens.bracket_left,"]":oe.tokens.bracket_right,"=":oe.tokens.equal,"==":oe.tokens.equal_equal,"!=":oe.tokens.not_equal,">":oe.tokens.greater_than,">=":oe.tokens.greater_than_equal,">>":oe.tokens.shift_right,"<":oe.tokens.less_than,"<=":oe.tokens.less_than_equal,"<<":oe.tokens.shift_left,"%":oe.tokens.modulo,"-":oe.tokens.minus,"--":oe.tokens.minus_minus,".":oe.tokens.period,"+":oe.tokens.plus,"++":oe.tokens.plus_plus,"|":oe.tokens.or,"||":oe.tokens.or_or,"*":oe.tokens.star,"~":oe.tokens.tilde,_:oe.tokens.underscore,"^":oe.tokens.xor,"+=":oe.tokens.plus_equal,"-=":oe.tokens.minus_equal,"*=":oe.tokens.times_equal,"/=":oe.tokens.division_equal,"%=":oe.tokens.modulo_equal,"&=":oe.tokens.and_equal,"|=":oe.tokens.or_equal,"^=":oe.tokens.xor_equal,">>=":oe.tokens.shift_right_equal,"<<=":oe.tokens.shift_left_equal};k.regexTokens={decimal_float_literal:oe.tokens.decimal_float_literal,hex_float_literal:oe.tokens.hex_float_literal,int_literal:oe.tokens.int_literal,uint_literal:oe.tokens.uint_literal,ident:oe.tokens.ident};k.storage_class=[oe.keywords.function,oe.keywords.private,oe.keywords.workgroup,oe.keywords.uniform,oe.keywords.storage];k.access_mode=[oe.keywords.read,oe.keywords.write,oe.keywords.read_write];k.sampler_type=[oe.keywords.sampler,oe.keywords.sampler_comparison];k.sampled_texture_type=[oe.keywords.texture_1d,oe.keywords.texture_2d,oe.keywords.texture_2d_array,oe.keywords.texture_3d,oe.keywords.texture_cube,oe.keywords.texture_cube_array];k.multisampled_texture_type=[oe.keywords.texture_multisampled_2d];k.storage_texture_type=[oe.keywords.texture_storage_1d,oe.keywords.texture_storage_2d,oe.keywords.texture_storage_2d_array,oe.keywords.texture_storage_3d];k.depth_texture_type=[oe.keywords.texture_depth_2d,oe.keywords.texture_depth_2d_array,oe.keywords.texture_depth_cube,oe.keywords.texture_depth_cube_array,oe.keywords.texture_depth_multisampled_2d];k.texture_external_type=[oe.keywords.texture_external];k.any_texture_type=[...oe.sampled_texture_type,...oe.multisampled_texture_type,...oe.storage_texture_type,...oe.depth_texture_type,...oe.texture_external_type];k.texel_format=[oe.keywords.r8unorm,oe.keywords.r8snorm,oe.keywords.r8uint,oe.keywords.r8sint,oe.keywords.r16uint,oe.keywords.r16sint,oe.keywords.r16float,oe.keywords.rg8unorm,oe.keywords.rg8snorm,oe.keywords.rg8uint,oe.keywords.rg8sint,oe.keywords.r32uint,oe.keywords.r32sint,oe.keywords.r32float,oe.keywords.rg16uint,oe.keywords.rg16sint,oe.keywords.rg16float,oe.keywords.rgba8unorm,oe.keywords.rgba8unorm_srgb,oe.keywords.rgba8snorm,oe.keywords.rgba8uint,oe.keywords.rgba8sint,oe.keywords.bgra8unorm,oe.keywords.bgra8unorm_srgb,oe.keywords.rgb10a2unorm,oe.keywords.rg11b10float,oe.keywords.rg32uint,oe.keywords.rg32sint,oe.keywords.rg32float,oe.keywords.rgba16uint,oe.keywords.rgba16sint,oe.keywords.rgba16float,oe.keywords.rgba32uint,oe.keywords.rgba32sint,oe.keywords.rgba32float];k.const_literal=[oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.decimal_float_literal,oe.tokens.hex_float_literal,oe.keywords.true,oe.keywords.false];k.literal_or_ident=[oe.tokens.ident,oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.decimal_float_literal,oe.tokens.hex_float_literal];k.element_count_expression=[oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.ident];k.template_types=[oe.keywords.vec2,oe.keywords.vec3,oe.keywords.vec4,oe.keywords.mat2x2,oe.keywords.mat2x3,oe.keywords.mat2x4,oe.keywords.mat3x2,oe.keywords.mat3x3,oe.keywords.mat3x4,oe.keywords.mat4x2,oe.keywords.mat4x3,oe.keywords.mat4x4,oe.keywords.atomic,oe.keywords.bitcast,...oe.any_texture_type];k.attribute_name=[oe.tokens.ident,oe.keywords.block,oe.keywords.diagnostic];k.assignment_operators=[oe.tokens.equal,oe.tokens.plus_equal,oe.tokens.minus_equal,oe.tokens.times_equal,oe.tokens.division_equal,oe.tokens.modulo_equal,oe.tokens.and_equal,oe.tokens.or_equal,oe.tokens.xor_equal,oe.tokens.shift_right_equal,oe.tokens.shift_left_equal];k.increment_operators=[oe.tokens.plus_plus,oe.tokens.minus_minus];class t2{constructor(e,n,r){this.type=e,this.lexeme=n,this.line=r}toString(){return this.lexeme}isTemplateType(){return k.template_types.indexOf(this.type)!=-1}isArrayType(){return this.type==k.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}}class YV{constructor(e){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=e??""}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new t2(k.eof,"",this._line)),this._tokens}scanToken(){let e=this._advance();if(e==`
|
|
|
`)return this._line++,!0;if(this._isWhitespace(e))return!0;if(e=="/"){if(this._peekAhead()=="/"){for(;e!=`
|
|
|
`;){if(this._isAtEnd())return!0;e=this._advance()}return this._line++,!0}else if(this._peekAhead()=="*"){this._advance();let l=1;for(;l>0;){if(this._isAtEnd())return!0;if(e=this._advance(),e==`
|
|
|
`)this._line++;else if(e=="*"){if(this._peekAhead()=="/"&&(this._advance(),l--,l==0))return!0}else e=="/"&&this._peekAhead()=="*"&&(this._advance(),l++)}return!0}}const n=k.simpleTokens[e];if(n)return this._addToken(n),!0;let r=k.none;const i=this._isAlpha(e),a=e==="_";if(this._isAlphaNumeric(e)){let l=this._peekAhead();for(;this._isAlphaNumeric(l);)e+=this._advance(),l=this._peekAhead()}if(i){const l=k.keywords[e];if(l)return this._addToken(l),!0}if(i||a)return this._addToken(k.tokens.ident),!0;for(;;){let l=this._findType(e);const u=this._peekAhead();if(e=="-"&&this._tokens.length>0){if(u=="=")return this._current++,e+=u,this._addToken(k.tokens.minus_equal),!0;if(u=="-")return this._current++,e+=u,this._addToken(k.tokens.minus_minus),!0;const f=this._tokens.length-1;if((k.literal_or_ident.indexOf(this._tokens[f].type)!=-1||this._tokens[f].type==k.tokens.paren_right)&&u!=">")return this._addToken(l),!0}if(e==">"&&(u==">"||u=="=")){let f=!1,h=this._tokens.length-1;for(let g=0;g<5&&h>=0&&k.assignment_operators.indexOf(this._tokens[h].type)===-1;++g,--h)if(this._tokens[h].type===k.tokens.less_than){h>0&&this._tokens[h-1].isArrayOrTemplateType()&&(f=!0);break}if(f)return this._addToken(l),!0}if(l===k.none){let f=e,h=0;const g=2;for(let m=0;m<g;++m)if(f+=this._peekAhead(m),l=this._findType(f),l!==k.none){h=m;break}if(l===k.none)return r===k.none?!1:(this._current--,this._addToken(r),!0);e=f,this._current+=h+1}if(r=l,this._isAtEnd())break;e+=this._advance()}return r===k.none?!1:(this._addToken(r),!0)}_findType(e){for(const r in k.regexTokens){const i=k.regexTokens[r];if(this._match(e,i.rule))return i}const n=k.literalTokens[e];return n||k.none}_match(e,n){const r=n.exec(e);return r&&r.index==0&&r[0]==e}_isAtEnd(){return this._current>=this._source.length}_isAlpha(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}_isAlphaNumeric(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e=="_"||e>="0"&&e<="9"}_isWhitespace(e){return e==" "||e==" "||e=="\r"}_advance(e=0){let n=this._source[this._current];return e=e||0,e++,this._current+=e,n}_peekAhead(e=0){return e=e||0,this._current+e>=this._source.length?"\0":this._source[this._current+e]}_addToken(e){const n=this._source.substring(this._start,this._current);this._tokens.push(new t2(e,n,this._line))}}class KV{constructor(){this._tokens=[],this._current=0,this._currentLine=0,this._context=new bV,this._deferArrayCountEval=[]}parse(e){this._initialize(e),this._deferArrayCountEval.length=0;const n=[];for(;!this._isAtEnd();){const r=this._global_decl_or_directive();if(!r)break;n.push(r)}if(this._deferArrayCountEval.length>0){for(const r of this._deferArrayCountEval){const i=r.arrayType,a=r.countNode;if(a instanceof K_){const u=a.name,f=this._context.constants.get(u);if(f)try{const h=f.evaluate(this._context);i.count=h}catch{}}}this._deferArrayCountEval.length=0}return n}_initialize(e){if(e)if(typeof e=="string"){const n=new YV(e);this._tokens=n.scanTokens()}else this._tokens=e;else this._tokens=[];this._current=0}_error(e,n){return{token:e,message:n,toString:function(){return`${n}`}}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==k.eof}_match(e){if(e instanceof ne)return this._check(e)?(this._advance(),!0):!1;for(let n=0,r=e.length;n<r;++n){const i=e[n];if(this._check(i))return this._advance(),!0}return!1}_consume(e,n){if(this._check(e))return this._advance();throw this._error(this._peek(),n)}_check(e){if(this._isAtEnd())return!1;const n=this._peek();if(e instanceof Array){const r=n.type;return e.indexOf(r)!=-1}return n.type==e}_advance(){var e,n;return this._currentLine=(n=(e=this._peek())===null||e===void 0?void 0:e.line)!==null&&n!==void 0?n:-1,this._isAtEnd()||this._current++,this._previous()}_peek(){return this._tokens[this._current]}_previous(){return this._tokens[this._current-1]}_global_decl_or_directive(){for(;this._match(k.tokens.semicolon)&&!this._isAtEnd(););if(this._match(k.keywords.alias)){const n=this._type_alias();return this._consume(k.tokens.semicolon,"Expected ';'"),n}if(this._match(k.keywords.diagnostic)){const n=this._diagnostic();return this._consume(k.tokens.semicolon,"Expected ';'"),n}if(this._match(k.keywords.requires)){const n=this._requires_directive();return this._consume(k.tokens.semicolon,"Expected ';'"),n}if(this._match(k.keywords.enable)){const n=this._enable_directive();return this._consume(k.tokens.semicolon,"Expected ';'"),n}const e=this._attribute();if(this._check(k.keywords.var)){const n=this._global_variable_decl();return n!=null&&(n.attributes=e),this._consume(k.tokens.semicolon,"Expected ';'."),n}if(this._check(k.keywords.override)){const n=this._override_variable_decl();return n!=null&&(n.attributes=e),this._consume(k.tokens.semicolon,"Expected ';'."),n}if(this._check(k.keywords.let)){const n=this._global_let_decl();return n!=null&&(n.attributes=e),this._consume(k.tokens.semicolon,"Expected ';'."),n}if(this._check(k.keywords.const)){const n=this._global_const_decl();return n!=null&&(n.attributes=e),this._consume(k.tokens.semicolon,"Expected ';'."),n}if(this._check(k.keywords.struct)){const n=this._struct_decl();return n!=null&&(n.attributes=e),n}if(this._check(k.keywords.fn)){const n=this._function_decl();return n!=null&&(n.attributes=e),n}return null}_function_decl(){if(!this._match(k.keywords.fn))return null;const e=this._currentLine,n=this._consume(k.tokens.ident,"Expected function name.").toString();this._consume(k.tokens.paren_left,"Expected '(' for function arguments.");const r=[];if(!this._check(k.tokens.paren_right))do{if(this._check(k.tokens.paren_right))break;const u=this._attribute(),f=this._consume(k.tokens.ident,"Expected argument name.").toString();this._consume(k.tokens.colon,"Expected ':' for argument type.");const h=this._attribute(),g=this._type_decl();g!=null&&(g.attributes=h,r.push(new jV(f,g,u)))}while(this._match(k.tokens.comma));this._consume(k.tokens.paren_right,"Expected ')' after function arguments.");let i=null;if(this._match(k.tokens.arrow)){const u=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=u)}const a=this._compound_statement(),l=this._currentLine;return new q_(n,r,i,a,e,l)}_compound_statement(){const e=[];for(this._consume(k.tokens.brace_left,"Expected '{' for block.");!this._check(k.tokens.brace_right);){const n=this._statement();n!==null&&e.push(n)}return this._consume(k.tokens.brace_right,"Expected '}' for block."),e}_statement(){for(;this._match(k.tokens.semicolon)&&!this._isAtEnd(););if(this._check(k.tokens.attr)&&this._attribute(),this._check(k.keywords.if))return this._if_statement();if(this._check(k.keywords.switch))return this._switch_statement();if(this._check(k.keywords.loop))return this._loop_statement();if(this._check(k.keywords.for))return this._for_statement();if(this._check(k.keywords.while))return this._while_statement();if(this._check(k.keywords.continuing))return this._continuing_statement();if(this._check(k.keywords.static_assert))return this._static_assert_statement();if(this._check(k.tokens.brace_left))return this._compound_statement();let e=null;return this._check(k.keywords.return)?e=this._return_statement():this._check([k.keywords.var,k.keywords.let,k.keywords.const])?e=this._variable_statement():this._match(k.keywords.discard)?e=new DV:this._match(k.keywords.break)?e=new FV:this._match(k.keywords.continue)?e=new kV:e=this._increment_decrement_statement()||this._func_call_statement()||this._assignment_statement(),e!=null&&this._consume(k.tokens.semicolon,"Expected ';' after statement."),e}_static_assert_statement(){if(!this._match(k.keywords.static_assert))return null;const e=this._optional_paren_expression();return new SV(e)}_while_statement(){if(!this._match(k.keywords.while))return null;const e=this._optional_paren_expression();this._check(k.tokens.attr)&&this._attribute();const n=this._compound_statement();return new EV(e,n)}_continuing_statement(){if(!this._match(k.keywords.continuing))return null;const e=this._compound_statement();return new wV(e)}_for_statement(){if(!this._match(k.keywords.for))return null;this._consume(k.tokens.paren_left,"Expected '('.");const e=this._check(k.tokens.semicolon)?null:this._for_init();this._consume(k.tokens.semicolon,"Expected ';'.");const n=this._check(k.tokens.semicolon)?null:this._short_circuit_or_expression();this._consume(k.tokens.semicolon,"Expected ';'.");const r=this._check(k.tokens.paren_right)?null:this._for_increment();this._consume(k.tokens.paren_right,"Expected ')'."),this._check(k.tokens.attr)&&this._attribute();const i=this._compound_statement();return new TV(e,n,r,i)}_for_init(){return this._variable_statement()||this._func_call_statement()||this._assignment_statement()}_for_increment(){return this._func_call_statement()||this._increment_decrement_statement()||this._assignment_statement()}_variable_statement(){if(this._check(k.keywords.var)){const e=this._variable_decl();if(e===null)throw this._error(this._peek(),"Variable declaration expected.");let n=null;return this._match(k.tokens.equal)&&(n=this._short_circuit_or_expression()),new _o(e.name,e.type,e.storage,e.access,n)}if(this._match(k.keywords.let)){const e=this._consume(k.tokens.ident,"Expected name for let.").toString();let n=null;if(this._match(k.tokens.colon)){const i=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=i)}this._consume(k.tokens.equal,"Expected '=' for let.");const r=this._short_circuit_or_expression();return new Y_(e,n,null,null,r)}if(this._match(k.keywords.const)){const e=this._consume(k.tokens.ident,"Expected name for const.").toString();let n=null;if(this._match(k.tokens.colon)){const i=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=i)}this._consume(k.tokens.equal,"Expected '=' for const.");const r=this._short_circuit_or_expression();return new QC(e,n,null,null,r)}return null}_increment_decrement_statement(){const e=this._current,n=this._unary_expression();if(n==null)return null;if(!this._check(k.increment_operators))return this._current=e,null;const r=this._consume(k.increment_operators,"Expected increment operator");return new CV(r.type===k.tokens.plus_plus?xc.increment:xc.decrement,n)}_assignment_statement(){let e=null;if(this._check(k.tokens.brace_right))return null;let n=this._match(k.tokens.underscore);if(n||(e=this._unary_expression()),!n&&e==null)return null;const r=this._consume(k.assignment_operators,"Expected assignment operator."),i=this._short_circuit_or_expression();return new AV(Mf.parse(r.lexeme),e,i)}_func_call_statement(){if(!this._check(k.tokens.ident))return null;const e=this._current,n=this._consume(k.tokens.ident,"Expected function name."),r=this._argument_expression_list();return r===null?(this._current=e,null):new pM(n.lexeme,r)}_loop_statement(){if(!this._match(k.keywords.loop))return null;this._check(k.tokens.attr)&&this._attribute(),this._consume(k.tokens.brace_left,"Expected '{' for loop.");const e=[];let n=this._statement();for(;n!==null;){if(Array.isArray(n))for(let i of n)e.push(i);else e.push(n);n=this._statement()}let r=null;return this._match(k.keywords.continuing)&&(r=this._compound_statement()),this._consume(k.tokens.brace_right,"Expected '}' for loop."),new RV(e,r)}_switch_statement(){if(!this._match(k.keywords.switch))return null;const e=this._optional_paren_expression();this._check(k.tokens.attr)&&this._attribute(),this._consume(k.tokens.brace_left,"Expected '{' for switch.");const n=this._switch_body();if(n==null||n.length==0)throw this._error(this._previous(),"Expected 'case' or 'default'.");return this._consume(k.tokens.brace_right,"Expected '}' for switch."),new xV(e,n)}_switch_body(){const e=[];if(this._match(k.keywords.case)){const n=this._case_selectors();this._match(k.tokens.colon),this._check(k.tokens.attr)&&this._attribute(),this._consume(k.tokens.brace_left,"Exected '{' for switch case.");const r=this._case_body();this._consume(k.tokens.brace_right,"Exected '}' for switch case."),e.push(new VV(n,r))}if(this._match(k.keywords.default)){this._match(k.tokens.colon),this._check(k.tokens.attr)&&this._attribute(),this._consume(k.tokens.brace_left,"Exected '{' for switch default.");const n=this._case_body();this._consume(k.tokens.brace_right,"Exected '}' for switch default."),e.push(new HV(n))}if(this._check([k.keywords.default,k.keywords.case])){const n=this._switch_body();e.push(n[0])}return e}_case_selectors(){const e=[this._shift_expression()];for(;this._match(k.tokens.comma);)e.push(this._shift_expression());return e}_case_body(){if(this._match(k.keywords.fallthrough))return this._consume(k.tokens.semicolon,"Expected ';'"),[];let e=this._statement();if(e==null)return[];e instanceof Array||(e=[e]);const n=this._case_body();return n.length==0?e:[...e,n[0]]}_if_statement(){if(!this._match(k.keywords.if))return null;const e=this._optional_paren_expression();this._check(k.tokens.attr)&&this._attribute();const n=this._compound_statement();let r=[];this._match_elseif()&&(this._check(k.tokens.attr)&&this._attribute(),r=this._elseif_statement(r));let i=null;return this._match(k.keywords.else)&&(this._check(k.tokens.attr)&&this._attribute(),i=this._compound_statement()),new MV(e,n,r,i)}_match_elseif(){return this._tokens[this._current].type===k.keywords.else&&this._tokens[this._current+1].type===k.keywords.if?(this._advance(),this._advance(),!0):!1}_elseif_statement(e=[]){const n=this._optional_paren_expression(),r=this._compound_statement();return e.push(new WV(n,r)),this._match_elseif()&&(this._check(k.tokens.attr)&&this._attribute(),this._elseif_statement(e)),e}_return_statement(){if(!this._match(k.keywords.return))return null;const e=this._short_circuit_or_expression();return new OV(e)}_short_circuit_or_expression(){let e=this._short_circuit_and_expr();for(;this._match(k.tokens.or_or);)e=new ls(this._previous().toString(),e,this._short_circuit_and_expr());return e}_short_circuit_and_expr(){let e=this._inclusive_or_expression();for(;this._match(k.tokens.and_and);)e=new ls(this._previous().toString(),e,this._inclusive_or_expression());return e}_inclusive_or_expression(){let e=this._exclusive_or_expression();for(;this._match(k.tokens.or);)e=new ls(this._previous().toString(),e,this._exclusive_or_expression());return e}_exclusive_or_expression(){let e=this._and_expression();for(;this._match(k.tokens.xor);)e=new ls(this._previous().toString(),e,this._and_expression());return e}_and_expression(){let e=this._equality_expression();for(;this._match(k.tokens.and);)e=new ls(this._previous().toString(),e,this._equality_expression());return e}_equality_expression(){const e=this._relational_expression();return this._match([k.tokens.equal_equal,k.tokens.not_equal])?new ls(this._previous().toString(),e,this._relational_expression()):e}_relational_expression(){let e=this._shift_expression();for(;this._match([k.tokens.less_than,k.tokens.greater_than,k.tokens.less_than_equal,k.tokens.greater_than_equal]);)e=new ls(this._previous().toString(),e,this._shift_expression());return e}_shift_expression(){let e=this._additive_expression();for(;this._match([k.tokens.shift_left,k.tokens.shift_right]);)e=new ls(this._previous().toString(),e,this._additive_expression());return e}_additive_expression(){let e=this._multiplicative_expression();for(;this._match([k.tokens.plus,k.tokens.minus]);)e=new ls(this._previous().toString(),e,this._multiplicative_expression());return e}_multiplicative_expression(){let e=this._unary_expression();for(;this._match([k.tokens.star,k.tokens.forward_slash,k.tokens.modulo]);)e=new ls(this._previous().toString(),e,this._unary_expression());return e}_unary_expression(){return this._match([k.tokens.minus,k.tokens.bang,k.tokens.tilde,k.tokens.star,k.tokens.and])?new $V(this._previous().toString(),this._unary_expression()):this._singular_expression()}_singular_expression(){const e=this._primary_expression(),n=this._postfix_expression();return n&&(e.postfix=n),e}_postfix_expression(){if(this._match(k.tokens.bracket_left)){const e=this._short_circuit_or_expression();this._consume(k.tokens.bracket_right,"Expected ']'.");const n=new zV(e),r=this._postfix_expression();return r&&(n.postfix=r),n}if(this._match(k.tokens.period)){const e=this._consume(k.tokens.ident,"Expected member name."),n=this._postfix_expression(),r=new UV(e.lexeme);return n&&(r.postfix=n),r}return null}_getStruct(e){return this._context.aliases.has(e)?this._context.aliases.get(e).type:this._context.structs.has(e)?this._context.structs.get(e):null}_primary_expression(){if(this._match(k.tokens.ident)){const r=this._previous().toString();if(this._check(k.tokens.paren_left)){const i=this._argument_expression_list(),a=this._getStruct(r);return a!=null?new ql(a,i):new yM(r,i)}if(this._context.constants.has(r)){const i=this._context.constants.get(r);return new GC(r,i.value)}return new K_(r)}if(this._match(k.const_literal))return new JC(parseFloat(this._previous().toString()));if(this._check(k.tokens.paren_left))return this._paren_expression();if(this._match(k.keywords.bitcast)){this._consume(k.tokens.less_than,"Expected '<'.");const r=this._type_decl();this._consume(k.tokens.greater_than,"Expected '>'.");const i=this._paren_expression();return new LV(r,i)}const e=this._type_decl(),n=this._argument_expression_list();return new ql(e,n)}_argument_expression_list(){if(!this._match(k.tokens.paren_left))return null;const e=[];do{if(this._check(k.tokens.paren_right))break;const n=this._short_circuit_or_expression();e.push(n)}while(this._match(k.tokens.comma));return this._consume(k.tokens.paren_right,"Expected ')' for agument list"),e}_optional_paren_expression(){this._match(k.tokens.paren_left);const e=this._short_circuit_or_expression();return this._match(k.tokens.paren_right),new e2([e])}_paren_expression(){this._consume(k.tokens.paren_left,"Expected '('.");const e=this._short_circuit_or_expression();return this._consume(k.tokens.paren_right,"Expected ')'."),new e2([e])}_struct_decl(){if(!this._match(k.keywords.struct))return null;const e=this._currentLine,n=this._consume(k.tokens.ident,"Expected name for struct.").toString();this._consume(k.tokens.brace_left,"Expected '{' for struct body.");const r=[];for(;!this._check(k.tokens.brace_right);){const l=this._attribute(),u=this._consume(k.tokens.ident,"Expected variable name.").toString();this._consume(k.tokens.colon,"Expected ':' for struct member type.");const f=this._attribute(),h=this._type_decl();h!=null&&(h.attributes=f),this._check(k.tokens.brace_right)?this._match(k.tokens.comma):this._consume(k.tokens.comma,"Expected ',' for struct member."),r.push(new XV(u,h,l))}this._consume(k.tokens.brace_right,"Expected '}' after struct body.");const i=this._currentLine,a=new go(n,r,e,i);return this._context.structs.set(n,a),a}_global_variable_decl(){const e=this._variable_decl();return e&&this._match(k.tokens.equal)&&(e.value=this._const_expression()),e}_override_variable_decl(){const e=this._override_decl();return e&&this._match(k.tokens.equal)&&(e.value=this._const_expression()),e}_global_const_decl(){if(!this._match(k.keywords.const))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const a=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=a)}let r=null;if(this._match(k.tokens.equal)){const a=this._short_circuit_or_expression();if(a instanceof ql)r=a;else if(a instanceof GC&&a.initializer instanceof ql)r=a.initializer;else try{const l=a.evaluate(this._context);r=new JC(l)}catch{r=a}}const i=new QC(e.toString(),n,"","",r);return this._context.constants.set(i.name,i),i}_global_let_decl(){if(!this._match(k.keywords.let))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const i=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=i)}let r=null;return this._match(k.tokens.equal)&&(r=this._const_expression()),new Y_(e.toString(),n,"","",r)}_const_expression(){return this._short_circuit_or_expression()}_variable_decl(){if(!this._match(k.keywords.var))return null;let e="",n="";this._match(k.tokens.less_than)&&(e=this._consume(k.storage_class,"Expected storage_class.").toString(),this._match(k.tokens.comma)&&(n=this._consume(k.access_mode,"Expected access_mode.").toString()),this._consume(k.tokens.greater_than,"Expected '>'."));const r=this._consume(k.tokens.ident,"Expected variable name");let i=null;if(this._match(k.tokens.colon)){const a=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=a)}return new _o(r.toString(),i,e,n,null)}_override_decl(){if(!this._match(k.keywords.override))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const r=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=r)}return new gM(e.toString(),n,null)}_diagnostic(){this._consume(k.tokens.paren_left,"Expected '('");const e=this._consume(k.tokens.ident,"Expected severity control name.");this._consume(k.tokens.comma,"Expected ','");const n=this._consume(k.tokens.ident,"Expected diagnostic rule name.");return this._consume(k.tokens.paren_right,"Expected ')'"),new IV(e.toString(),n.toString())}_enable_directive(){const e=this._consume(k.tokens.ident,"identity expected.");return new PV(e.toString())}_requires_directive(){const e=[this._consume(k.tokens.ident,"identity expected.").toString()];for(;this._match(k.tokens.comma);){const n=this._consume(k.tokens.ident,"identity expected.");e.push(n.toString())}return new NV(e)}_type_alias(){const e=this._consume(k.tokens.ident,"identity expected.");this._consume(k.tokens.equal,"Expected '=' for type alias.");let n=this._type_decl();if(n===null)throw this._error(this._peek(),"Expected Type for Alias.");this._context.aliases.has(n.name)&&(n=this._context.aliases.get(n.name).type);const r=new mM(e.toString(),n);return this._context.aliases.set(r.name,r),r}_type_decl(){if(this._check([k.tokens.ident,...k.texel_format,k.keywords.bool,k.keywords.f32,k.keywords.i32,k.keywords.u32])){const r=this._advance(),i=r.toString();return this._context.structs.has(i)?this._context.structs.get(i):this._context.aliases.has(i)?this._context.aliases.get(i).type:new Zo(r.toString())}let e=this._texture_sampler_types();if(e)return e;if(this._check(k.template_types)){let r=this._advance().toString(),i=null,a=null;return this._match(k.tokens.less_than)&&(i=this._type_decl(),a=null,this._match(k.tokens.comma)&&(a=this._consume(k.access_mode,"Expected access_mode for pointer").toString()),this._consume(k.tokens.greater_than,"Expected '>' for type.")),new vM(r,i,a)}if(this._match(k.keywords.ptr)){let r=this._previous().toString();this._consume(k.tokens.less_than,"Expected '<' for pointer.");const i=this._consume(k.storage_class,"Expected storage_class for pointer");this._consume(k.tokens.comma,"Expected ',' for pointer.");const a=this._type_decl();let l=null;return this._match(k.tokens.comma)&&(l=this._consume(k.access_mode,"Expected access_mode for pointer").toString()),this._consume(k.tokens.greater_than,"Expected '>' for pointer."),new BV(r,i.toString(),a,l)}const n=this._attribute();if(this._match(k.keywords.array)){let r=null,i=-1;const a=this._previous();let l=null;if(this._match(k.tokens.less_than)){r=this._type_decl(),this._context.aliases.has(r.name)&&(r=this._context.aliases.get(r.name).type);let f="";if(this._match(k.tokens.comma)){l=this._shift_expression();try{f=l.evaluate(this._context).toString(),l=null}catch{f="1"}}this._consume(k.tokens.greater_than,"Expected '>' for array."),i=f?parseInt(f):0}const u=new _M(a.toString(),n,r,i);return l&&this._deferArrayCountEval.push({arrayType:u,countNode:l}),u}return null}_texture_sampler_types(){if(this._match(k.sampler_type))return new qu(this._previous().toString(),null,null);if(this._match(k.depth_texture_type))return new qu(this._previous().toString(),null,null);if(this._match(k.sampled_texture_type)||this._match(k.multisampled_texture_type)){const e=this._previous();this._consume(k.tokens.less_than,"Expected '<' for sampler type.");const n=this._type_decl();return this._consume(k.tokens.greater_than,"Expected '>' for sampler type."),new qu(e.toString(),n,null)}if(this._match(k.storage_texture_type)){const e=this._previous();this._consume(k.tokens.less_than,"Expected '<' for sampler type.");const n=this._consume(k.texel_format,"Invalid texel format.").toString();this._consume(k.tokens.comma,"Expected ',' after texel format.");const r=this._consume(k.access_mode,"Expected access mode for storage texture type.").toString();return this._consume(k.tokens.greater_than,"Expected '>' for sampler type."),new qu(e.toString(),n,r)}return null}_attribute(){let e=[];for(;this._match(k.tokens.attr);){const n=this._consume(k.attribute_name,"Expected attribute name"),r=new qV(n.toString(),null);if(this._match(k.tokens.paren_left)){if(r.value=this._consume(k.literal_or_ident,"Expected attribute value").toString(),this._check(k.tokens.comma)){this._advance();do{const i=this._consume(k.literal_or_ident,"Expected attribute value").toString();r.value instanceof Array||(r.value=[r.value]),r.value.push(i)}while(this._match(k.tokens.comma))}this._consume(k.tokens.paren_right,"Expected ')'")}e.push(r)}return e.length==0?null:e}}class nc{constructor(e,n){this.name=e,this.attributes=n,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}}class n2{constructor(e,n,r){this.name=e,this.type=n,this.attributes=r,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class _h extends nc{constructor(e,n){super(e,n),this.members=[],this.align=0,this.startLine=-1,this.endLine=-1,this.inUse=!1}get isStruct(){return!0}}class Qv extends nc{constructor(e,n){super(e,n),this.count=0,this.stride=0}get isArray(){return!0}}class r2 extends nc{constructor(e,n,r,i){super(e,r),this.format=n,this.access=i}get isTemplate(){return!0}}var Ea;(function(t){t[t.Uniform=0]="Uniform",t[t.Storage=1]="Storage",t[t.Texture=2]="Texture",t[t.Sampler=3]="Sampler",t[t.StorageTexture=4]="StorageTexture"})(Ea||(Ea={}));class yh{constructor(e,n,r,i,a,l,u){this.name=e,this.type=n,this.group=r,this.binding=i,this.attributes=a,this.resourceType=l,this.access=u}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class ZV{constructor(e,n){this.name=e,this.type=n}}class bh{constructor(e,n){this.align=e,this.size=n}}class QV{constructor(e,n,r,i){this.name=e,this.type=n,this.locationType=r,this.location=i,this.interpolation=null}}class i2{constructor(e,n,r,i){this.name=e,this.type=n,this.locationType=r,this.location=i}}class GV{constructor(e,n,r,i){this.name=e,this.type=n,this.attributes=r,this.id=i}}class JV{constructor(e,n){this.name=e,this.type=n}}class eH{constructor(e,n=null){this.stage=null,this.inputs=[],this.outputs=[],this.arguments=[],this.returnType=null,this.resources=[],this.overrides=[],this.startLine=-1,this.endLine=-1,this.inUse=!1,this.calls=new Set,this.name=e,this.stage=n}}class tH{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}}class nH{constructor(e){this.resources=null,this.inUse=!1,this.info=null,this.node=e}}class Vs{constructor(e){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new tH,this.functions=[],this._types=new Map,this._functions=new Map,e&&this.update(e)}_isStorageTexture(e){return e.name=="texture_storage_1d"||e.name=="texture_storage_2d"||e.name=="texture_storage_2d_array"||e.name=="texture_storage_3d"}update(e){const r=new KV().parse(e);for(const i of r)i instanceof q_&&this._functions.set(i.name,new nH(i));for(const i of r)if(i instanceof go){const a=this._getTypeInfo(i,null);a instanceof _h&&this.structs.push(a)}for(const i of r){if(i instanceof mM){this.aliases.push(this._getAliasInfo(i));continue}if(i instanceof gM){const a=i,l=this._getAttributeNum(a.attributes,"id",0),u=a.type!=null?this._getTypeInfo(a.type,a.attributes):null;this.overrides.push(new GV(a.name,u,a.attributes,l));continue}if(this._isUniformVar(i)){const a=i,l=this._getAttributeNum(a.attributes,"group",0),u=this._getAttributeNum(a.attributes,"binding",0),f=this._getTypeInfo(a.type,a.attributes),h=new yh(a.name,f,l,u,a.attributes,Ea.Uniform,a.access);this.uniforms.push(h);continue}if(this._isStorageVar(i)){const a=i,l=this._getAttributeNum(a.attributes,"group",0),u=this._getAttributeNum(a.attributes,"binding",0),f=this._getTypeInfo(a.type,a.attributes),h=this._isStorageTexture(f),g=new yh(a.name,f,l,u,a.attributes,h?Ea.StorageTexture:Ea.Storage,a.access);this.storage.push(g);continue}if(this._isTextureVar(i)){const a=i,l=this._getAttributeNum(a.attributes,"group",0),u=this._getAttributeNum(a.attributes,"binding",0),f=this._getTypeInfo(a.type,a.attributes),h=this._isStorageTexture(f),g=new yh(a.name,f,l,u,a.attributes,h?Ea.StorageTexture:Ea.Texture,a.access);h?this.storage.push(g):this.textures.push(g);continue}if(this._isSamplerVar(i)){const a=i,l=this._getAttributeNum(a.attributes,"group",0),u=this._getAttributeNum(a.attributes,"binding",0),f=this._getTypeInfo(a.type,a.attributes),h=new yh(a.name,f,l,u,a.attributes,Ea.Sampler,a.access);this.samplers.push(h);continue}if(i instanceof q_){const a=this._getAttribute(i,"vertex"),l=this._getAttribute(i,"fragment"),u=this._getAttribute(i,"compute"),f=a||l||u,h=new eH(i.name,f==null?void 0:f.name);h.startLine=i.startLine,h.endLine=i.endLine,this.functions.push(h),this._functions.get(i.name).info=h,f&&(this._functions.get(i.name).inUse=!0,h.inUse=!0,h.resources=this._findResources(i,!!f),h.inputs=this._getInputs(i.args),h.outputs=this._getOutputs(i.returnType),this.entry[f.name].push(h)),h.arguments=i.args.map(g=>new JV(g.name,this._getTypeInfo(g.type,g.attributes))),h.returnType=i.returnType?this._getTypeInfo(i.returnType,i.attributes):null;continue}}for(const i of this._functions.values())i.info&&(i.info.inUse=i.inUse,this._addCalls(i.node,i.info.calls));for(const i of this._functions.values())i.node.search(a=>{var l;if(a.astNodeType==="varExpr"){const u=a;for(const f of this.overrides)u.name==f.name&&((l=i.info)===null||l===void 0||l.overrides.push(f))}});for(const i of this.uniforms)this._markStructsInUse(i.type);for(const i of this.storage)this._markStructsInUse(i.type)}_markStructsInUse(e){if(e)if(e.isStruct){if(e.inUse=!0,e.members)for(const n of e.members)this._markStructsInUse(n.type)}else if(e.isArray)this._markStructsInUse(e.format);else if(e.isTemplate)e.format&&this._markStructsInUse(e.format);else{const n=this._getAlias(e.name);n&&this._markStructsInUse(n)}}_addCalls(e,n){var r;for(const i of e.calls){const a=(r=this._functions.get(i.name))===null||r===void 0?void 0:r.info;a&&n.add(a)}}findResource(e,n){for(const r of this.uniforms)if(r.group==e&&r.binding==n)return r;for(const r of this.storage)if(r.group==e&&r.binding==n)return r;for(const r of this.textures)if(r.group==e&&r.binding==n)return r;for(const r of this.samplers)if(r.group==e&&r.binding==n)return r;return null}_findResource(e){for(const n of this.uniforms)if(n.name==e)return n;for(const n of this.storage)if(n.name==e)return n;for(const n of this.textures)if(n.name==e)return n;for(const n of this.samplers)if(n.name==e)return n;return null}_markStructsFromAST(e){const n=this._getTypeInfo(e,null);this._markStructsInUse(n)}_findResources(e,n){const r=[],i=this,a=[];return e.search(l=>{if(l instanceof vg)a.push({});else if(l instanceof _g)a.pop();else if(l instanceof _o){const u=l;n&&u.type!==null&&this._markStructsFromAST(u.type),a.length>0&&(a[a.length-1][u.name]=u)}else if(l instanceof ql){const u=l;n&&u.type!==null&&this._markStructsFromAST(u.type)}else if(l instanceof Y_){const u=l;n&&u.type!==null&&this._markStructsFromAST(u.type),a.length>0&&(a[a.length-1][u.name]=u)}else if(l instanceof K_){const u=l;if(a.length>0&&a[a.length-1][u.name])return;const f=i._findResource(u.name);f&&r.push(f)}else if(l instanceof yM){const u=l,f=i._functions.get(u.name);f&&(n&&(f.inUse=!0),e.calls.add(f.node),f.resources===null&&(f.resources=i._findResources(f.node,n)),r.push(...f.resources))}else if(l instanceof pM){const u=l,f=i._functions.get(u.name);f&&(n&&(f.inUse=!0),e.calls.add(f.node),f.resources===null&&(f.resources=i._findResources(f.node,n)),r.push(...f.resources))}}),[...new Map(r.map(l=>[l.name,l])).values()]}getBindGroups(){const e=[];function n(r,i){r>=e.length&&(e.length=r+1),e[r]===void 0&&(e[r]=[]),i>=e[r].length&&(e[r].length=i+1)}for(const r of this.uniforms){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.storage){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.textures){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.samplers){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}return e}_getOutputs(e,n=void 0){if(n===void 0&&(n=[]),e instanceof go)this._getStructOutputs(e,n);else{const r=this._getOutputInfo(e);r!==null&&n.push(r)}return n}_getStructOutputs(e,n){for(const r of e.members)if(r.type instanceof go)this._getStructOutputs(r.type,n);else{const i=this._getAttribute(r,"location")||this._getAttribute(r,"builtin");if(i!==null){const a=this._getTypeInfo(r.type,r.type.attributes),l=this._parseInt(i.value),u=new i2(r.name,a,i.name,l);n.push(u)}}}_getOutputInfo(e){const n=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(n!==null){const r=this._getTypeInfo(e,e.attributes),i=this._parseInt(n.value);return new i2("",r,n.name,i)}return null}_getInputs(e,n=void 0){n===void 0&&(n=[]);for(const r of e)if(r.type instanceof go)this._getStructInputs(r.type,n);else{const i=this._getInputInfo(r);i!==null&&n.push(i)}return n}_getStructInputs(e,n){for(const r of e.members)if(r.type instanceof go)this._getStructInputs(r.type,n);else{const i=this._getInputInfo(r);i!==null&&n.push(i)}}_getInputInfo(e){const n=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(n!==null){const r=this._getAttribute(e,"interpolation"),i=this._getTypeInfo(e.type,e.attributes),a=this._parseInt(n.value),l=new QV(e.name,i,n.name,a);return r!==null&&(l.interpolation=this._parseString(r.value)),l}return null}_parseString(e){return e instanceof Array&&(e=e[0]),e}_parseInt(e){e instanceof Array&&(e=e[0]);const n=parseInt(e);return isNaN(n)?e:n}_getAlias(e){for(const n of this.aliases)if(n.name==e)return n.type;return null}_getAliasInfo(e){return new ZV(e.name,this._getTypeInfo(e.type,null))}_getTypeInfo(e,n){if(this._types.has(e))return this._types.get(e);if(e instanceof _M){const i=e,a=i.format?this._getTypeInfo(i.format,i.attributes):null,l=new Qv(i.name,n);return l.format=a,l.count=i.count,this._types.set(e,l),this._updateTypeInfo(l),l}if(e instanceof go){const i=e,a=new _h(i.name,n);a.startLine=i.startLine,a.endLine=i.endLine;for(const l of i.members){const u=this._getTypeInfo(l.type,l.attributes);a.members.push(new n2(l.name,u,l.attributes))}return this._types.set(e,a),this._updateTypeInfo(a),a}if(e instanceof qu){const i=e,a=i.format instanceof Zo,l=i.format?a?this._getTypeInfo(i.format,null):new nc(i.format,null):null,u=new r2(i.name,l,n,i.access);return this._types.set(e,u),this._updateTypeInfo(u),u}if(e instanceof vM){const i=e,a=i.format?this._getTypeInfo(i.format,null):null,l=new r2(i.name,a,n,i.access);return this._types.set(e,l),this._updateTypeInfo(l),l}const r=new nc(e.name,n);return this._types.set(e,r),this._updateTypeInfo(r),r}_updateTypeInfo(e){var n,r;const i=this._getTypeSize(e);if(e.size=(n=i==null?void 0:i.size)!==null&&n!==void 0?n:0,e instanceof Qv&&e.format){const a=this._getTypeSize(e.format);e.stride=(r=a==null?void 0:a.size)!==null&&r!==void 0?r:0,this._updateTypeInfo(e.format)}e instanceof _h&&this._updateStructInfo(e)}_updateStructInfo(e){var n;let r=0,i=0,a=0,l=0;for(let u=0,f=e.members.length;u<f;++u){const h=e.members[u],g=this._getTypeSize(h);if(!g)continue;(n=this._getAlias(h.type.name))!==null&&n!==void 0||h.type;const m=g.align,v=g.size;r=this._roundUp(m,r+i),i=v,a=r,l=Math.max(l,m),h.offset=r,h.size=v,this._updateTypeInfo(h.type)}e.size=this._roundUp(l,a+i),e.align=l}_getTypeSize(e){var n,r;if(e==null)return null;const i=this._getAttributeNum(e.attributes,"size",0),a=this._getAttributeNum(e.attributes,"align",0);if(e instanceof n2&&(e=e.type),e instanceof nc){const l=this._getAlias(e.name);l!==null&&(e=l)}{const l=Vs._typeInfo[e.name];if(l!==void 0){const u=((n=e.format)===null||n===void 0?void 0:n.name)==="f16"?2:1;return new bh(Math.max(a,l.align/u),Math.max(i,l.size/u))}}{const l=Vs._typeInfo[e.name.substring(0,e.name.length-1)];if(l){const u=e.name[e.name.length-1]==="h"?2:1;return new bh(Math.max(a,l.align/u),Math.max(i,l.size/u))}}if(e instanceof Qv){let l=e,u=8,f=8;const h=this._getTypeSize(l.format);h!==null&&(f=h.size,u=h.align);const g=l.count,m=this._getAttributeNum((r=e==null?void 0:e.attributes)!==null&&r!==void 0?r:null,"stride",this._roundUp(u,f));return f=g*m,i&&(f=i),new bh(Math.max(a,u),Math.max(i,f))}if(e instanceof _h){let l=0,u=0,f=0,h=0,g=0;for(const m of e.members){const v=this._getTypeSize(m.type);v!==null&&(l=Math.max(v.align,l),f=this._roundUp(v.align,f+h),h=v.size,g=f)}return u=this._roundUp(l,g+h),new bh(Math.max(a,l),Math.max(i,u))}return null}_isUniformVar(e){return e instanceof _o&&e.storage=="uniform"}_isStorageVar(e){return e instanceof _o&&e.storage=="storage"}_isTextureVar(e){return e instanceof _o&&e.type!==null&&Vs._textureTypes.indexOf(e.type.name)!=-1}_isSamplerVar(e){return e instanceof _o&&e.type!==null&&Vs._samplerTypes.indexOf(e.type.name)!=-1}_getAttribute(e,n){const r=e;if(!r||!r.attributes)return null;const i=r.attributes;for(let a of i)if(a.name==n)return a;return null}_getAttributeNum(e,n,r){if(e===null)return r;for(let i of e)if(i.name==n){let a=i!==null&&i.value!==null?i.value:r;return a instanceof Array&&(a=a[0]),typeof a=="number"?a:typeof a=="string"?parseInt(a):r}return r}_roundUp(e,n){return Math.ceil(n/e)*e}}Vs._typeInfo={f16:{align:2,size:2},i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},atomic:{align:4,size:4},vec2:{align:8,size:8},vec3:{align:16,size:12},vec4:{align:16,size:16},mat2x2:{align:8,size:16},mat3x2:{align:8,size:24},mat4x2:{align:8,size:32},mat2x3:{align:16,size:32},mat3x3:{align:16,size:48},mat4x3:{align:16,size:64},mat2x4:{align:16,size:32},mat3x4:{align:16,size:48},mat4x4:{align:16,size:64}};Vs._textureTypes=k.any_texture_type.map(t=>t.name);Vs._samplerTypes=k.sampler_type.map(t=>t.name);function rH(t){var a;const e={attributes:[],bindings:[]};let n;try{n=iH(t)}catch(l){return Re.error(l.message)(),e}for(const l of n.uniforms){const u=[];for(const f of((a=l.type)==null?void 0:a.members)||[])u.push({name:f.name,type:s2(f.type)});e.bindings.push({type:"uniform",name:l.name,group:l.group,location:l.binding,members:u})}for(const l of n.textures)e.bindings.push({type:"texture",name:l.name,group:l.group,location:l.binding});for(const l of n.samplers)e.bindings.push({type:"sampler",name:l.name,group:l.group,location:l.binding});const r=n.entry.vertex[0],i=(r==null?void 0:r.inputs.length)||0;for(let l=0;l<i;l++){const u=r.inputs[l];if(u.locationType==="location"){const f=s2(u.type);e.attributes.push({name:u.name,location:Number(u.location),type:f})}}return e}function s2(t){return t.format?`${t.name}<${t.format.name}>`:t.name}function iH(t){try{return new Vs(t)}catch(e){if(e instanceof Error)throw e;let n="WGSL parse error";throw typeof e=="object"&&(e!=null&&e.message)&&(n+=`: ${e.message} `),typeof e=="object"&&(e!=null&&e.token)&&(n+=e.token.line||""),new Error(n,{cause:e})}}const sH={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...sH}};const Oi=globalThis.mathgl.config;function aH(t,{precision:e=Oi.precision}={}){return t=oH(t),`${parseFloat(t.toPrecision(e))}`}function Mc(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Fa(t,e,n){return cH(t,r=>Math.max(e,Math.min(n,r)))}function yg(t,e,n){return Mc(t)?t.map((r,i)=>yg(r,e[i],n)):n*e+(1-n)*t}function Of(t,e,n){const r=Oi.EPSILON;try{if(t===e)return!0;if(Mc(t)&&Mc(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!Of(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=Oi.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{Oi.EPSILON=r}}function oH(t){return Math.round(t/Oi.EPSILON)*Oi.EPSILON}function lH(t){return t.clone?t.clone():new Array(t.length)}function cH(t,e,n){if(Mc(t)){const r=t;n=n||lH(r);for(let i=0;i<n.length&&i<r.length;++i){const a=typeof t=="number"?t:t[i];n[i]=e(a,i,n)}return n}return e(t)}class EM extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,n=0){for(let r=0;r<this.ELEMENTS;++r)this[r]=e[r+n];return this.check()}toArray(e=[],n=0){for(let r=0;r<this.ELEMENTS;++r)e[n+r]=this[r];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:Mc(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Oi)}formatString(e){let n="";for(let r=0;r<this.ELEMENTS;++r)n+=(r>0?", ":"")+aH(this[r],e);return`${e.printTypes?this.constructor.name:""}[${n}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let n=0;n<this.ELEMENTS;++n)if(!Of(this[n],e[n]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let n=0;n<this.ELEMENTS;++n)if(this[n]!==e[n])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,n,r){if(r===void 0)return this.lerp(this,e,n);for(let i=0;i<this.ELEMENTS;++i){const a=e[i],l=typeof n=="number"?n:n[i];this[i]=a+r*(l-a)}return this.check()}min(e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(e[n],this[n]);return this.check()}max(e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.max(e[n],this[n]);return this.check()}clamp(e,n){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e[r]),n[r]);return this.check()}add(...e){for(const n of e)for(let r=0;r<this.ELEMENTS;++r)this[r]+=n[r];return this.check()}subtract(...e){for(const n of e)for(let r=0;r<this.ELEMENTS;++r)this[r]-=n[r];return this.check()}scale(e){if(typeof e=="number")for(let n=0;n<this.ELEMENTS;++n)this[n]*=e;else for(let n=0;n<this.ELEMENTS&&n<e.length;++n)this[n]*=e[n];return this.check()}multiplyByScalar(e){for(let n=0;n<this.ELEMENTS;++n)this[n]*=e;return this.check()}check(){if(Oi.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let n=0;n<this.ELEMENTS;++n)e=e&&Number.isFinite(this[n]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let n=0;n<this.ELEMENTS;++n)this[n]=e;return this.check()}addScalar(e){for(let n=0;n<this.ELEMENTS;++n)this[n]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let n=0;n<this.ELEMENTS;++n)this[n]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,n){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e),n);return this.check()}get elements(){return this}}function uH(t,e){if(t.length!==e)return!1;for(let n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}function oi(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function Gv(t,e,n=""){if(Oi.debug&&!uH(t,e))throw new Error(`math.gl: ${n} some fields set to invalid numbers'`);return t}function a2(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}class fH extends EM{get x(){return this[0]}set x(e){this[0]=oi(e)}get y(){return this[1]}set y(e){this[1]=oi(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let n=0;n<this.ELEMENTS;++n)e+=this[n]*this[n];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let n=0;for(let r=0;r<this.ELEMENTS;++r){const i=this[r]-e[r];n+=i*i}return oi(n)}dot(e){let n=0;for(let r=0;r<this.ELEMENTS;++r)n+=this[r]*e[r];return oi(n)}normalize(){const e=this.magnitude();if(e!==0)for(let n=0;n<this.ELEMENTS;++n)this[n]/=e;return this.check()}multiply(...e){for(const n of e)for(let r=0;r<this.ELEMENTS;++r)this[r]*=n[r];return this.check()}divide(...e){for(const n of e)for(let r=0;r<this.ELEMENTS;++r)this[r]/=n[r];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return a2(e>=0&&e<this.ELEMENTS,"index is out of range"),oi(this[e])}setComponent(e,n){return a2(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=n,this.check()}addVectors(e,n){return this.copy(e).add(n)}subVectors(e,n){return this.copy(e).subtract(n)}multiplyVectors(e,n){return this.copy(e).multiply(n)}addScaledVector(e,n){return this.add(new this.constructor(e).multiplyScalar(n))}}const kh=1e-6;let Oc=typeof Float32Array<"u"?Float32Array:Array;function dH(){const t=new Oc(2);return Oc!=Float32Array&&(t[0]=0,t[1]=0),t}function o2(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function hH(t,e){return t[0]=-e[0],t[1]=-e[1],t}function wM(t,e,n,r){const i=e[0],a=e[1];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t}function gH(t,e,n){const r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}(function(){const t=dH();return function(e,n,r,i,a,l){let u,f;for(n||(n=2),r||(r=0),i?f=Math.min(i*n+r,e.length):f=e.length,u=r;u<f;u+=n)t[0]=e[u],t[1]=e[u+1],a(t,t,l),e[u]=t[0],e[u+1]=t[1];return e}})();function pH(t,e,n){const r=e[0],i=e[1],a=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/a,t[1]=(n[1]*r+n[5]*i)/a,t}function TM(t,e,n){const r=e[0],i=e[1],a=e[2],l=n[3]*r+n[7]*i+n[11]*a||1;return t[0]=(n[0]*r+n[4]*i+n[8]*a)/l,t[1]=(n[1]*r+n[5]*i+n[9]*a)/l,t[2]=(n[2]*r+n[6]*i+n[10]*a)/l,t}function mH(t,e,n){const r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2],t}function vH(){const t=new Oc(3);return Oc!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function _H(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function yH(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function bH(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function SH(t,e,n){const r=e[0],i=e[1],a=e[2],l=n[0],u=n[1],f=n[2];return t[0]=i*f-a*u,t[1]=a*l-r*f,t[2]=r*u-i*l,t}function CM(t,e,n){const r=e[0],i=e[1],a=e[2];let l=n[3]*r+n[7]*i+n[11]*a+n[15];return l=l||1,t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/l,t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/l,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/l,t}function EH(t,e,n){const r=e[0],i=e[1],a=e[2];return t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8],t}function wH(t,e,n){const r=n[0],i=n[1],a=n[2],l=n[3],u=e[0],f=e[1],h=e[2];let g=i*h-a*f,m=a*u-r*h,v=r*f-i*u,S=i*v-a*m,w=a*g-r*v,E=r*m-i*g;const b=l*2;return g*=b,m*=b,v*=b,S*=2,w*=2,E*=2,t[0]=u+g+S,t[1]=f+m+w,t[2]=h+v+E,t}function TH(t,e,n,r){const i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function CH(t,e,n,r){const i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function AH(t,e,n,r){const i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function RH(t,e){const n=t[0],r=t[1],i=t[2],a=e[0],l=e[1],u=e[2],f=Math.sqrt((n*n+r*r+i*i)*(a*a+l*l+u*u)),h=f&&bH(t,e)/f;return Math.acos(Math.min(Math.max(h,-1),1))}const xH=_H;(function(){const t=vH();return function(e,n,r,i,a,l){let u,f;for(n||(n=3),r||(r=0),i?f=Math.min(i*n+r,e.length):f=e.length,u=r;u<f;u+=n)t[0]=e[u],t[1]=e[u+1],t[2]=e[u+2],a(t,t,l),e[u]=t[0],e[u+1]=t[1],e[u+2]=t[2];return e}})();const Jv=[0,0,0];let Sh;class bs extends fH{static get ZERO(){return Sh||(Sh=new bs(0,0,0),Object.freeze(Sh)),Sh}constructor(e=0,n=0,r=0){super(-0,-0,-0),arguments.length===1&&Mc(e)?this.copy(e):(Oi.debug&&(oi(e),oi(n),oi(r)),this[0]=e,this[1]=n,this[2]=r)}set(e,n,r){return this[0]=e,this[1]=n,this[2]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return Oi.debug&&(oi(e.x),oi(e.y),oi(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=oi(e)}angle(e){return RH(this,e)}cross(e){return SH(this,this,e),this.check()}rotateX({radians:e,origin:n=Jv}){return TH(this,this,n,e),this.check()}rotateY({radians:e,origin:n=Jv}){return CH(this,this,n,e),this.check()}rotateZ({radians:e,origin:n=Jv}){return AH(this,this,n,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return CM(this,this,e),this.check()}transformAsVector(e){return TM(this,this,e),this.check()}transformByMatrix3(e){return EH(this,this,e),this.check()}transformByMatrix2(e){return mH(this,this,e),this.check()}transformByQuaternion(e){return wH(this,this,e),this.check()}}class MH extends EM{toString(){let e="[";if(Oi.printRowMajor){e+="row-major:";for(let n=0;n<this.RANK;++n)for(let r=0;r<this.RANK;++r)e+=` ${this[r*this.RANK+n]}`}else{e+="column-major:";for(let n=0;n<this.ELEMENTS;++n)e+=` ${this[n]}`}return e+="]",e}getElementIndex(e,n){return n*this.RANK+e}getElement(e,n){return this[n*this.RANK+e]}setElement(e,n,r){return this[n*this.RANK+e]=oi(r),this}getColumn(e,n=new Array(this.RANK).fill(-0)){const r=e*this.RANK;for(let i=0;i<this.RANK;++i)n[i]=this[r+i];return n}setColumn(e,n){const r=e*this.RANK;for(let i=0;i<this.RANK;++i)this[r+i]=n[i];return this}}function OH(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function PH(t,e){if(t===e){const n=e[1],r=e[2],i=e[3],a=e[6],l=e[7],u=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=l,t[14]=u}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Z_(t,e){const n=e[0],r=e[1],i=e[2],a=e[3],l=e[4],u=e[5],f=e[6],h=e[7],g=e[8],m=e[9],v=e[10],S=e[11],w=e[12],E=e[13],b=e[14],C=e[15],T=n*u-r*l,A=n*f-i*l,O=n*h-a*l,x=r*f-i*u,N=r*h-a*u,F=i*h-a*f,L=g*E-m*w,D=g*b-v*w,V=g*C-S*w,B=m*b-v*E,W=m*C-S*E,X=v*C-S*b;let Y=T*X-A*W+O*B+x*V-N*D+F*L;return Y?(Y=1/Y,t[0]=(u*X-f*W+h*B)*Y,t[1]=(i*W-r*X-a*B)*Y,t[2]=(E*F-b*N+C*x)*Y,t[3]=(v*N-m*F-S*x)*Y,t[4]=(f*V-l*X-h*D)*Y,t[5]=(n*X-i*V+a*D)*Y,t[6]=(b*O-w*F-C*A)*Y,t[7]=(g*F-v*O+S*A)*Y,t[8]=(l*W-u*V+h*L)*Y,t[9]=(r*V-n*W-a*L)*Y,t[10]=(w*N-E*O+C*T)*Y,t[11]=(m*O-g*N-S*T)*Y,t[12]=(u*D-l*B-f*L)*Y,t[13]=(n*B-r*D+i*L)*Y,t[14]=(E*A-w*x-b*T)*Y,t[15]=(g*x-m*A+v*T)*Y,t):null}function NH(t){const e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],l=t[5],u=t[6],f=t[7],h=t[8],g=t[9],m=t[10],v=t[11],S=t[12],w=t[13],E=t[14],b=t[15],C=e*l-n*a,T=e*u-r*a,A=n*u-r*l,O=h*w-g*S,x=h*E-m*S,N=g*E-m*w,F=e*N-n*x+r*O,L=a*N-l*x+u*O,D=h*A-g*T+m*C,V=S*A-w*T+E*C;return f*F-i*L+b*D-v*V}function Do(t,e,n){const r=e[0],i=e[1],a=e[2],l=e[3],u=e[4],f=e[5],h=e[6],g=e[7],m=e[8],v=e[9],S=e[10],w=e[11],E=e[12],b=e[13],C=e[14],T=e[15];let A=n[0],O=n[1],x=n[2],N=n[3];return t[0]=A*r+O*u+x*m+N*E,t[1]=A*i+O*f+x*v+N*b,t[2]=A*a+O*h+x*S+N*C,t[3]=A*l+O*g+x*w+N*T,A=n[4],O=n[5],x=n[6],N=n[7],t[4]=A*r+O*u+x*m+N*E,t[5]=A*i+O*f+x*v+N*b,t[6]=A*a+O*h+x*S+N*C,t[7]=A*l+O*g+x*w+N*T,A=n[8],O=n[9],x=n[10],N=n[11],t[8]=A*r+O*u+x*m+N*E,t[9]=A*i+O*f+x*v+N*b,t[10]=A*a+O*h+x*S+N*C,t[11]=A*l+O*g+x*w+N*T,A=n[12],O=n[13],x=n[14],N=n[15],t[12]=A*r+O*u+x*m+N*E,t[13]=A*i+O*f+x*v+N*b,t[14]=A*a+O*h+x*S+N*C,t[15]=A*l+O*g+x*w+N*T,t}function bg(t,e,n){const r=n[0],i=n[1],a=n[2];let l,u,f,h,g,m,v,S,w,E,b,C;return e===t?(t[12]=e[0]*r+e[4]*i+e[8]*a+e[12],t[13]=e[1]*r+e[5]*i+e[9]*a+e[13],t[14]=e[2]*r+e[6]*i+e[10]*a+e[14],t[15]=e[3]*r+e[7]*i+e[11]*a+e[15]):(l=e[0],u=e[1],f=e[2],h=e[3],g=e[4],m=e[5],v=e[6],S=e[7],w=e[8],E=e[9],b=e[10],C=e[11],t[0]=l,t[1]=u,t[2]=f,t[3]=h,t[4]=g,t[5]=m,t[6]=v,t[7]=S,t[8]=w,t[9]=E,t[10]=b,t[11]=C,t[12]=l*r+g*i+w*a+e[12],t[13]=u*r+m*i+E*a+e[13],t[14]=f*r+v*i+b*a+e[14],t[15]=h*r+S*i+C*a+e[15]),t}function hb(t,e,n){const r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function IH(t,e,n,r){let i=r[0],a=r[1],l=r[2],u=Math.sqrt(i*i+a*a+l*l),f,h,g,m,v,S,w,E,b,C,T,A,O,x,N,F,L,D,V,B,W,X,Y,ae;return u<kh?null:(u=1/u,i*=u,a*=u,l*=u,h=Math.sin(n),f=Math.cos(n),g=1-f,m=e[0],v=e[1],S=e[2],w=e[3],E=e[4],b=e[5],C=e[6],T=e[7],A=e[8],O=e[9],x=e[10],N=e[11],F=i*i*g+f,L=a*i*g+l*h,D=l*i*g-a*h,V=i*a*g-l*h,B=a*a*g+f,W=l*a*g+i*h,X=i*l*g+a*h,Y=a*l*g-i*h,ae=l*l*g+f,t[0]=m*F+E*L+A*D,t[1]=v*F+b*L+O*D,t[2]=S*F+C*L+x*D,t[3]=w*F+T*L+N*D,t[4]=m*V+E*B+A*W,t[5]=v*V+b*B+O*W,t[6]=S*V+C*B+x*W,t[7]=w*V+T*B+N*W,t[8]=m*X+E*Y+A*ae,t[9]=v*X+b*Y+O*ae,t[10]=S*X+C*Y+x*ae,t[11]=w*X+T*Y+N*ae,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function AM(t,e,n){const r=Math.sin(n),i=Math.cos(n),a=e[4],l=e[5],u=e[6],f=e[7],h=e[8],g=e[9],m=e[10],v=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+h*r,t[5]=l*i+g*r,t[6]=u*i+m*r,t[7]=f*i+v*r,t[8]=h*i-a*r,t[9]=g*i-l*r,t[10]=m*i-u*r,t[11]=v*i-f*r,t}function DH(t,e,n){const r=Math.sin(n),i=Math.cos(n),a=e[0],l=e[1],u=e[2],f=e[3],h=e[8],g=e[9],m=e[10],v=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-h*r,t[1]=l*i-g*r,t[2]=u*i-m*r,t[3]=f*i-v*r,t[8]=a*r+h*i,t[9]=l*r+g*i,t[10]=u*r+m*i,t[11]=f*r+v*i,t}function RM(t,e,n){const r=Math.sin(n),i=Math.cos(n),a=e[0],l=e[1],u=e[2],f=e[3],h=e[4],g=e[5],m=e[6],v=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+h*r,t[1]=l*i+g*r,t[2]=u*i+m*r,t[3]=f*i+v*r,t[4]=h*i-a*r,t[5]=g*i-l*r,t[6]=m*i-u*r,t[7]=v*i-f*r,t}function FH(t,e){const n=e[0],r=e[1],i=e[2],a=e[3],l=n+n,u=r+r,f=i+i,h=n*l,g=r*l,m=r*u,v=i*l,S=i*u,w=i*f,E=a*l,b=a*u,C=a*f;return t[0]=1-m-w,t[1]=g+C,t[2]=v-b,t[3]=0,t[4]=g-C,t[5]=1-h-w,t[6]=S+E,t[7]=0,t[8]=v+b,t[9]=S-E,t[10]=1-h-m,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function kH(t,e,n,r,i,a,l){const u=1/(n-e),f=1/(i-r),h=1/(a-l);return t[0]=a*2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a*2*f,t[6]=0,t[7]=0,t[8]=(n+e)*u,t[9]=(i+r)*f,t[10]=(l+a)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=l*a*2*h,t[15]=0,t}function BH(t,e,n,r,i){const a=1/Math.tan(e/2);if(t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){const l=1/(r-i);t[10]=(i+r)*l,t[14]=2*i*r*l}else t[10]=-1,t[14]=-2*r;return t}const UH=BH;function LH(t,e,n,r,i,a,l){const u=1/(e-n),f=1/(r-i),h=1/(a-l);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+n)*u,t[13]=(i+r)*f,t[14]=(l+a)*h,t[15]=1,t}const zH=LH;function $H(t,e,n,r){let i,a,l,u,f,h,g,m,v,S;const w=e[0],E=e[1],b=e[2],C=r[0],T=r[1],A=r[2],O=n[0],x=n[1],N=n[2];return Math.abs(w-O)<kh&&Math.abs(E-x)<kh&&Math.abs(b-N)<kh?OH(t):(m=w-O,v=E-x,S=b-N,i=1/Math.sqrt(m*m+v*v+S*S),m*=i,v*=i,S*=i,a=T*S-A*v,l=A*m-C*S,u=C*v-T*m,i=Math.sqrt(a*a+l*l+u*u),i?(i=1/i,a*=i,l*=i,u*=i):(a=0,l=0,u=0),f=v*u-S*l,h=S*a-m*u,g=m*l-v*a,i=Math.sqrt(f*f+h*h+g*g),i?(i=1/i,f*=i,h*=i,g*=i):(f=0,h=0,g=0),t[0]=a,t[1]=f,t[2]=m,t[3]=0,t[4]=l,t[5]=h,t[6]=v,t[7]=0,t[8]=u,t[9]=g,t[10]=S,t[11]=0,t[12]=-(a*w+l*E+u*b),t[13]=-(f*w+h*E+g*b),t[14]=-(m*w+v*E+S*b),t[15]=1,t)}function VH(){const t=new Oc(4);return Oc!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function HH(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function Kf(t,e,n){const r=e[0],i=e[1],a=e[2],l=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*l,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*l,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*l,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*l,t}(function(){const t=VH();return function(e,n,r,i,a,l){let u,f;for(n||(n=4),r||(r=0),i?f=Math.min(i*n+r,e.length):f=e.length,u=r;u<f;u+=n)t[0]=e[u],t[1]=e[u+1],t[2]=e[u+2],t[3]=e[u+3],a(t,t,l),e[u]=t[0],e[u+1]=t[1],e[u+2]=t[2],e[u+3]=t[3];return e}})();var Q_;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(Q_||(Q_={}));const jH=45*Math.PI/180,WH=1,e0=.1,t0=500,XH=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class Ss extends MH{static get IDENTITY(){return YH()}static get ZERO(){return qH()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Q_}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,n,r,i,a,l,u,f,h,g,m,v,S,w,E,b){return this[0]=e,this[1]=n,this[2]=r,this[3]=i,this[4]=a,this[5]=l,this[6]=u,this[7]=f,this[8]=h,this[9]=g,this[10]=m,this[11]=v,this[12]=S,this[13]=w,this[14]=E,this[15]=b,this.check()}setRowMajor(e,n,r,i,a,l,u,f,h,g,m,v,S,w,E,b){return this[0]=e,this[1]=a,this[2]=h,this[3]=S,this[4]=n,this[5]=l,this[6]=g,this[7]=w,this[8]=r,this[9]=u,this[10]=m,this[11]=E,this[12]=i,this[13]=f,this[14]=v,this[15]=b,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(XH)}fromObject(e){return this.check()}fromQuaternion(e){return FH(this,e),this.check()}frustum(e){const{left:n,right:r,bottom:i,top:a,near:l=e0,far:u=t0}=e;return u===1/0?KH(this,n,r,i,a,l):kH(this,n,r,i,a,l,u),this.check()}lookAt(e){const{eye:n,center:r=[0,0,0],up:i=[0,1,0]}=e;return $H(this,n,r,i),this.check()}ortho(e){const{left:n,right:r,bottom:i,top:a,near:l=e0,far:u=t0}=e;return zH(this,n,r,i,a,l,u),this.check()}orthographic(e){const{fovy:n=jH,aspect:r=WH,focalDistance:i=1,near:a=e0,far:l=t0}=e;l2(n);const u=n/2,f=i*Math.tan(u),h=f*r;return this.ortho({left:-h,right:h,bottom:-f,top:f,near:a,far:l})}perspective(e){const{fovy:n=45*Math.PI/180,aspect:r=1,near:i=.1,far:a=500}=e;return l2(n),UH(this,n,r,i,a),this.check()}determinant(){return NH(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,n){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],n=n||[-0,-0,-0];const r=this.getScale(n),i=1/r[0],a=1/r[1],l=1/r[2];return e[0]=this[0]*i,e[1]=this[1]*a,e[2]=this[2]*l,e[3]=0,e[4]=this[4]*i,e[5]=this[5]*a,e[6]=this[6]*l,e[7]=0,e[8]=this[8]*i,e[9]=this[9]*a,e[10]=this[10]*l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,n){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],n=n||[-0,-0,-0];const r=this.getScale(n),i=1/r[0],a=1/r[1],l=1/r[2];return e[0]=this[0]*i,e[1]=this[1]*a,e[2]=this[2]*l,e[3]=this[4]*i,e[4]=this[5]*a,e[5]=this[6]*l,e[6]=this[8]*i,e[7]=this[9]*a,e[8]=this[10]*l,e}transpose(){return PH(this,this),this.check()}invert(){return Z_(this,this),this.check()}multiplyLeft(e){return Do(this,e,this),this.check()}multiplyRight(e){return Do(this,this,e),this.check()}rotateX(e){return AM(this,this,e),this.check()}rotateY(e){return DH(this,this,e),this.check()}rotateZ(e){return RM(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,n){return IH(this,this,e,n),this.check()}scale(e){return hb(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return bg(this,this,e),this.check()}transform(e,n){return e.length===4?(n=Kf(n||[-0,-0,-0,-0],e,this),Gv(n,4),n):this.transformAsPoint(e,n)}transformAsPoint(e,n){const{length:r}=e;let i;switch(r){case 2:i=gH(n||[-0,-0],e,this);break;case 3:i=CM(n||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Gv(i,e.length),i}transformAsVector(e,n){let r;switch(e.length){case 2:r=pH(n||[-0,-0],e,this);break;case 3:r=TM(n||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Gv(r,e.length),r}transformPoint(e,n){return this.transformAsPoint(e,n)}transformVector(e,n){return this.transformAsPoint(e,n)}transformDirection(e,n){return this.transformAsVector(e,n)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,n,r){return this.identity().translate([e,n,r])}}let Eh,wh;function qH(){return Eh||(Eh=new Ss([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Eh)),Eh}function YH(){return wh||(wh=new Ss,Object.freeze(wh)),wh}function l2(t){if(t>Math.PI*2)throw Error("expected radians")}function KH(t,e,n,r,i,a){const l=2*a/(n-e),u=2*a/(i-r),f=(n+e)/(n-e),h=(i+r)/(i-r),g=-1,m=-1,v=-2*a;return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=f,t[9]=h,t[10]=g,t[11]=m,t[12]=0,t[13]=0,t[14]=v,t[15]=0,t}function xM(t,e=[],n=0){const r=Math.fround(t),i=t-r;return e[n]=r,e[n+1]=i,e}function ZH(t){return t-Math.fround(t)}function QH(t){const e=new Float32Array(32);for(let n=0;n<4;++n)for(let r=0;r<4;++r){const i=n*4+r;xM(t[r*4+n],e,i*2)}return e}const GH=`#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND
|
|
|
|
|
|
// All these functions are for substituting tan() function from Intel GPU only
|
|
|
const float TWO_PI = 6.2831854820251465;
|
|
|
const float PI_2 = 1.5707963705062866;
|
|
|
const float PI_16 = 0.1963495463132858;
|
|
|
|
|
|
const float SIN_TABLE_0 = 0.19509032368659973;
|
|
|
const float SIN_TABLE_1 = 0.3826834261417389;
|
|
|
const float SIN_TABLE_2 = 0.5555702447891235;
|
|
|
const float SIN_TABLE_3 = 0.7071067690849304;
|
|
|
|
|
|
const float COS_TABLE_0 = 0.9807852506637573;
|
|
|
const float COS_TABLE_1 = 0.9238795042037964;
|
|
|
const float COS_TABLE_2 = 0.8314695954322815;
|
|
|
const float COS_TABLE_3 = 0.7071067690849304;
|
|
|
|
|
|
const float INVERSE_FACTORIAL_3 = 1.666666716337204e-01; // 1/3!
|
|
|
const float INVERSE_FACTORIAL_5 = 8.333333767950535e-03; // 1/5!
|
|
|
const float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04; // 1/7!
|
|
|
const float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06; // 1/9!
|
|
|
|
|
|
float sin_taylor_fp32(float a) {
|
|
|
float r, s, t, x;
|
|
|
|
|
|
if (a == 0.0) {
|
|
|
return 0.0;
|
|
|
}
|
|
|
|
|
|
x = -a * a;
|
|
|
s = a;
|
|
|
r = a;
|
|
|
|
|
|
r = r * x;
|
|
|
t = r * INVERSE_FACTORIAL_3;
|
|
|
s = s + t;
|
|
|
|
|
|
r = r * x;
|
|
|
t = r * INVERSE_FACTORIAL_5;
|
|
|
s = s + t;
|
|
|
|
|
|
r = r * x;
|
|
|
t = r * INVERSE_FACTORIAL_7;
|
|
|
s = s + t;
|
|
|
|
|
|
r = r * x;
|
|
|
t = r * INVERSE_FACTORIAL_9;
|
|
|
s = s + t;
|
|
|
|
|
|
return s;
|
|
|
}
|
|
|
|
|
|
void sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {
|
|
|
if (a == 0.0) {
|
|
|
sin_t = 0.0;
|
|
|
cos_t = 1.0;
|
|
|
}
|
|
|
sin_t = sin_taylor_fp32(a);
|
|
|
cos_t = sqrt(1.0 - sin_t * sin_t);
|
|
|
}
|
|
|
|
|
|
float tan_taylor_fp32(float a) {
|
|
|
float sin_a;
|
|
|
float cos_a;
|
|
|
|
|
|
if (a == 0.0) {
|
|
|
return 0.0;
|
|
|
}
|
|
|
|
|
|
// 2pi range reduction
|
|
|
float z = floor(a / TWO_PI);
|
|
|
float r = a - TWO_PI * z;
|
|
|
|
|
|
float t;
|
|
|
float q = floor(r / PI_2 + 0.5);
|
|
|
int j = int(q);
|
|
|
|
|
|
if (j < -2 || j > 2) {
|
|
|
return 1.0 / 0.0;
|
|
|
}
|
|
|
|
|
|
t = r - PI_2 * q;
|
|
|
|
|
|
q = floor(t / PI_16 + 0.5);
|
|
|
int k = int(q);
|
|
|
int abs_k = int(abs(float(k)));
|
|
|
|
|
|
if (abs_k > 4) {
|
|
|
return 1.0 / 0.0;
|
|
|
} else {
|
|
|
t = t - PI_16 * q;
|
|
|
}
|
|
|
|
|
|
float u = 0.0;
|
|
|
float v = 0.0;
|
|
|
|
|
|
float sin_t, cos_t;
|
|
|
float s, c;
|
|
|
sincos_taylor_fp32(t, sin_t, cos_t);
|
|
|
|
|
|
if (k == 0) {
|
|
|
s = sin_t;
|
|
|
c = cos_t;
|
|
|
} else {
|
|
|
if (abs(float(abs_k) - 1.0) < 0.5) {
|
|
|
u = COS_TABLE_0;
|
|
|
v = SIN_TABLE_0;
|
|
|
} else if (abs(float(abs_k) - 2.0) < 0.5) {
|
|
|
u = COS_TABLE_1;
|
|
|
v = SIN_TABLE_1;
|
|
|
} else if (abs(float(abs_k) - 3.0) < 0.5) {
|
|
|
u = COS_TABLE_2;
|
|
|
v = SIN_TABLE_2;
|
|
|
} else if (abs(float(abs_k) - 4.0) < 0.5) {
|
|
|
u = COS_TABLE_3;
|
|
|
v = SIN_TABLE_3;
|
|
|
}
|
|
|
if (k > 0) {
|
|
|
s = u * sin_t + v * cos_t;
|
|
|
c = u * cos_t - v * sin_t;
|
|
|
} else {
|
|
|
s = u * sin_t - v * cos_t;
|
|
|
c = u * cos_t + v * sin_t;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (j == 0) {
|
|
|
sin_a = s;
|
|
|
cos_a = c;
|
|
|
} else if (j == 1) {
|
|
|
sin_a = c;
|
|
|
cos_a = -s;
|
|
|
} else if (j == -1) {
|
|
|
sin_a = -c;
|
|
|
cos_a = s;
|
|
|
} else {
|
|
|
sin_a = -s;
|
|
|
cos_a = -c;
|
|
|
}
|
|
|
return sin_a / cos_a;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
float tan_fp32(float a) {
|
|
|
#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND
|
|
|
return tan_taylor_fp32(a);
|
|
|
#else
|
|
|
return tan(a);
|
|
|
#endif
|
|
|
}
|
|
|
`,JH={name:"fp32",vs:GH},ej=`
|
|
|
uniform fp64arithmeticUniforms {
|
|
|
uniform float ONE;
|
|
|
} fp64;
|
|
|
|
|
|
/*
|
|
|
About LUMA_FP64_CODE_ELIMINATION_WORKAROUND
|
|
|
|
|
|
The purpose of this workaround is to prevent shader compilers from
|
|
|
optimizing away necessary arithmetic operations by swapping their sequences
|
|
|
or transform the equation to some 'equivalent' form.
|
|
|
|
|
|
The method is to multiply an artifical variable, ONE, which will be known to
|
|
|
the compiler to be 1 only at runtime. The whole expression is then represented
|
|
|
as a polynomial with respective to ONE. In the coefficients of all terms, only one a
|
|
|
and one b should appear
|
|
|
|
|
|
err = (a + b) * ONE^6 - a * ONE^5 - (a + b) * ONE^4 + a * ONE^3 - b - (a + b) * ONE^2 + a * ONE
|
|
|
*/
|
|
|
|
|
|
// Divide float number to high and low floats to extend fraction bits
|
|
|
vec2 split(float a) {
|
|
|
const float SPLIT = 4097.0;
|
|
|
float t = a * SPLIT;
|
|
|
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
|
float a_hi = t * fp64.ONE - (t - a);
|
|
|
float a_lo = a * fp64.ONE - a_hi;
|
|
|
#else
|
|
|
float a_hi = t - (t - a);
|
|
|
float a_lo = a - a_hi;
|
|
|
#endif
|
|
|
return vec2(a_hi, a_lo);
|
|
|
}
|
|
|
|
|
|
// Divide float number again when high float uses too many fraction bits
|
|
|
vec2 split2(vec2 a) {
|
|
|
vec2 b = split(a.x);
|
|
|
b.y += a.y;
|
|
|
return b;
|
|
|
}
|
|
|
|
|
|
// Special sum operation when a > b
|
|
|
vec2 quickTwoSum(float a, float b) {
|
|
|
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
|
float sum = (a + b) * fp64.ONE;
|
|
|
float err = b - (sum - a) * fp64.ONE;
|
|
|
#else
|
|
|
float sum = a + b;
|
|
|
float err = b - (sum - a);
|
|
|
#endif
|
|
|
return vec2(sum, err);
|
|
|
}
|
|
|
|
|
|
// General sum operation
|
|
|
vec2 twoSum(float a, float b) {
|
|
|
float s = (a + b);
|
|
|
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
|
float v = (s * fp64.ONE - a) * fp64.ONE;
|
|
|
float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE + (b - v);
|
|
|
#else
|
|
|
float v = s - a;
|
|
|
float err = (a - (s - v)) + (b - v);
|
|
|
#endif
|
|
|
return vec2(s, err);
|
|
|
}
|
|
|
|
|
|
vec2 twoSub(float a, float b) {
|
|
|
float s = (a - b);
|
|
|
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
|
float v = (s * fp64.ONE - a) * fp64.ONE;
|
|
|
float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE - (b + v);
|
|
|
#else
|
|
|
float v = s - a;
|
|
|
float err = (a - (s - v)) - (b + v);
|
|
|
#endif
|
|
|
return vec2(s, err);
|
|
|
}
|
|
|
|
|
|
vec2 twoSqr(float a) {
|
|
|
float prod = a * a;
|
|
|
vec2 a_fp64 = split(a);
|
|
|
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
|
float err = ((a_fp64.x * a_fp64.x - prod) * fp64.ONE + 2.0 * a_fp64.x *
|
|
|
a_fp64.y * fp64.ONE * fp64.ONE) + a_fp64.y * a_fp64.y * fp64.ONE * fp64.ONE * fp64.ONE;
|
|
|
#else
|
|
|
float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;
|
|
|
#endif
|
|
|
return vec2(prod, err);
|
|
|
}
|
|
|
|
|
|
vec2 twoProd(float a, float b) {
|
|
|
float prod = a * b;
|
|
|
vec2 a_fp64 = split(a);
|
|
|
vec2 b_fp64 = split(b);
|
|
|
float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +
|
|
|
a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;
|
|
|
return vec2(prod, err);
|
|
|
}
|
|
|
|
|
|
vec2 sum_fp64(vec2 a, vec2 b) {
|
|
|
vec2 s, t;
|
|
|
s = twoSum(a.x, b.x);
|
|
|
t = twoSum(a.y, b.y);
|
|
|
s.y += t.x;
|
|
|
s = quickTwoSum(s.x, s.y);
|
|
|
s.y += t.y;
|
|
|
s = quickTwoSum(s.x, s.y);
|
|
|
return s;
|
|
|
}
|
|
|
|
|
|
vec2 sub_fp64(vec2 a, vec2 b) {
|
|
|
vec2 s, t;
|
|
|
s = twoSub(a.x, b.x);
|
|
|
t = twoSub(a.y, b.y);
|
|
|
s.y += t.x;
|
|
|
s = quickTwoSum(s.x, s.y);
|
|
|
s.y += t.y;
|
|
|
s = quickTwoSum(s.x, s.y);
|
|
|
return s;
|
|
|
}
|
|
|
|
|
|
vec2 mul_fp64(vec2 a, vec2 b) {
|
|
|
vec2 prod = twoProd(a.x, b.x);
|
|
|
// y component is for the error
|
|
|
prod.y += a.x * b.y;
|
|
|
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
|
|
|
prod = split2(prod);
|
|
|
#endif
|
|
|
prod = quickTwoSum(prod.x, prod.y);
|
|
|
prod.y += a.y * b.x;
|
|
|
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
|
|
|
prod = split2(prod);
|
|
|
#endif
|
|
|
prod = quickTwoSum(prod.x, prod.y);
|
|
|
return prod;
|
|
|
}
|
|
|
|
|
|
vec2 div_fp64(vec2 a, vec2 b) {
|
|
|
float xn = 1.0 / b.x;
|
|
|
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
|
|
|
vec2 yn = mul_fp64(a, vec2(xn, 0));
|
|
|
#else
|
|
|
vec2 yn = a * xn;
|
|
|
#endif
|
|
|
float diff = (sub_fp64(a, mul_fp64(b, yn))).x;
|
|
|
vec2 prod = twoProd(xn, diff);
|
|
|
return sum_fp64(yn, prod);
|
|
|
}
|
|
|
|
|
|
vec2 sqrt_fp64(vec2 a) {
|
|
|
if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);
|
|
|
if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);
|
|
|
|
|
|
float x = 1.0 / sqrt(a.x);
|
|
|
float yn = a.x * x;
|
|
|
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
|
vec2 yn_sqr = twoSqr(yn) * fp64.ONE;
|
|
|
#else
|
|
|
vec2 yn_sqr = twoSqr(yn);
|
|
|
#endif
|
|
|
float diff = sub_fp64(a, yn_sqr).x;
|
|
|
vec2 prod = twoProd(x * 0.5, diff);
|
|
|
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
|
|
|
return sum_fp64(split(yn), prod);
|
|
|
#else
|
|
|
return sum_fp64(vec2(yn, 0.0), prod);
|
|
|
#endif
|
|
|
}
|
|
|
`,tj={ONE:1},nj={name:"fp64arithmetic",vs:ej,defaultUniforms:tj,uniformTypes:{ONE:"f32"},fp64ify:xM,fp64LowPart:ZH,fp64ifyMatrix4:QH},rj=[0,1,1,1],ij=`uniform pickingUniforms {
|
|
|
float isActive;
|
|
|
float isAttribute;
|
|
|
float isHighlightActive;
|
|
|
float useFloatColors;
|
|
|
vec3 highlightedObjectColor;
|
|
|
vec4 highlightColor;
|
|
|
} picking;
|
|
|
|
|
|
out vec4 picking_vRGBcolor_Avalid;
|
|
|
|
|
|
// Normalize unsigned byte color to 0-1 range
|
|
|
vec3 picking_normalizeColor(vec3 color) {
|
|
|
return picking.useFloatColors > 0.5 ? color : color / 255.0;
|
|
|
}
|
|
|
|
|
|
// Normalize unsigned byte color to 0-1 range
|
|
|
vec4 picking_normalizeColor(vec4 color) {
|
|
|
return picking.useFloatColors > 0.5 ? color : color / 255.0;
|
|
|
}
|
|
|
|
|
|
bool picking_isColorZero(vec3 color) {
|
|
|
return dot(color, vec3(1.0)) < 0.00001;
|
|
|
}
|
|
|
|
|
|
bool picking_isColorValid(vec3 color) {
|
|
|
return dot(color, vec3(1.0)) > 0.00001;
|
|
|
}
|
|
|
|
|
|
// Check if this vertex is highlighted
|
|
|
bool isVertexHighlighted(vec3 vertexColor) {
|
|
|
vec3 highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor);
|
|
|
return
|
|
|
bool(picking.isHighlightActive) && picking_isColorZero(abs(vertexColor - highlightedObjectColor));
|
|
|
}
|
|
|
|
|
|
// Set the current picking color
|
|
|
void picking_setPickingColor(vec3 pickingColor) {
|
|
|
pickingColor = picking_normalizeColor(pickingColor);
|
|
|
|
|
|
if (bool(picking.isActive)) {
|
|
|
// Use alpha as the validity flag. If pickingColor is [0, 0, 0] fragment is non-pickable
|
|
|
picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));
|
|
|
|
|
|
if (!bool(picking.isAttribute)) {
|
|
|
// Stores the picking color so that the fragment shader can render it during picking
|
|
|
picking_vRGBcolor_Avalid.rgb = pickingColor;
|
|
|
}
|
|
|
} else {
|
|
|
// Do the comparison with selected item color in vertex shader as it should mean fewer compares
|
|
|
picking_vRGBcolor_Avalid.a = float(isVertexHighlighted(pickingColor));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void picking_setPickingAttribute(float value) {
|
|
|
if (bool(picking.isAttribute)) {
|
|
|
picking_vRGBcolor_Avalid.r = value;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void picking_setPickingAttribute(vec2 value) {
|
|
|
if (bool(picking.isAttribute)) {
|
|
|
picking_vRGBcolor_Avalid.rg = value;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void picking_setPickingAttribute(vec3 value) {
|
|
|
if (bool(picking.isAttribute)) {
|
|
|
picking_vRGBcolor_Avalid.rgb = value;
|
|
|
}
|
|
|
}
|
|
|
`,sj=`uniform pickingUniforms {
|
|
|
float isActive;
|
|
|
float isAttribute;
|
|
|
float isHighlightActive;
|
|
|
float useFloatColors;
|
|
|
vec3 highlightedObjectColor;
|
|
|
vec4 highlightColor;
|
|
|
} picking;
|
|
|
|
|
|
in vec4 picking_vRGBcolor_Avalid;
|
|
|
|
|
|
/*
|
|
|
* Returns highlight color if this item is selected.
|
|
|
*/
|
|
|
vec4 picking_filterHighlightColor(vec4 color) {
|
|
|
// If we are still picking, we don't highlight
|
|
|
if (picking.isActive > 0.5) {
|
|
|
return color;
|
|
|
}
|
|
|
|
|
|
bool selected = bool(picking_vRGBcolor_Avalid.a);
|
|
|
|
|
|
if (selected) {
|
|
|
// Blend in highlight color based on its alpha value
|
|
|
float highLightAlpha = picking.highlightColor.a;
|
|
|
float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);
|
|
|
float highLightRatio = highLightAlpha / blendedAlpha;
|
|
|
|
|
|
vec3 blendedRGB = mix(color.rgb, picking.highlightColor.rgb, highLightRatio);
|
|
|
return vec4(blendedRGB, blendedAlpha);
|
|
|
} else {
|
|
|
return color;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* Returns picking color if picking enabled else unmodified argument.
|
|
|
*/
|
|
|
vec4 picking_filterPickingColor(vec4 color) {
|
|
|
if (bool(picking.isActive)) {
|
|
|
if (picking_vRGBcolor_Avalid.a == 0.0) {
|
|
|
discard;
|
|
|
}
|
|
|
return picking_vRGBcolor_Avalid;
|
|
|
}
|
|
|
return color;
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* Returns picking color if picking is enabled if not
|
|
|
* highlight color if this item is selected, otherwise unmodified argument.
|
|
|
*/
|
|
|
vec4 picking_filterColor(vec4 color) {
|
|
|
vec4 highlightColor = picking_filterHighlightColor(color);
|
|
|
return picking_filterPickingColor(highlightColor);
|
|
|
}
|
|
|
`,c2={props:{},uniforms:{},name:"picking",uniformTypes:{isActive:"f32",isAttribute:"f32",isHighlightActive:"f32",useFloatColors:"f32",highlightedObjectColor:"vec3<f32>",highlightColor:"vec4<f32>"},defaultUniforms:{isActive:!1,isAttribute:!1,isHighlightActive:!1,useFloatColors:!0,highlightedObjectColor:[0,0,0],highlightColor:rj},vs:ij,fs:sj,getUniforms:aj};function aj(t={},e){const n={};if(t.highlightedObjectColor!==void 0)if(t.highlightedObjectColor===null)n.isHighlightActive=!1;else{n.isHighlightActive=!0;const r=t.highlightedObjectColor.slice(0,3);n.highlightedObjectColor=r}if(t.highlightColor){const r=Array.from(t.highlightColor,i=>i/255);Number.isFinite(r[3])||(r[3]=1),n.highlightColor=r}return t.isActive!==void 0&&(n.isActive=!!t.isActive,n.isAttribute=!!t.isAttribute),t.useFloatColors!==void 0&&(n.useFloatColors=!!t.useFloatColors),n}const u2=`precision highp int;
|
|
|
|
|
|
// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))
|
|
|
struct AmbientLight {
|
|
|
vec3 color;
|
|
|
};
|
|
|
|
|
|
struct PointLight {
|
|
|
vec3 color;
|
|
|
vec3 position;
|
|
|
vec3 attenuation; // 2nd order x:Constant-y:Linear-z:Exponential
|
|
|
};
|
|
|
|
|
|
struct DirectionalLight {
|
|
|
vec3 color;
|
|
|
vec3 direction;
|
|
|
};
|
|
|
|
|
|
uniform lightingUniforms {
|
|
|
int enabled;
|
|
|
int lightType;
|
|
|
|
|
|
int directionalLightCount;
|
|
|
int pointLightCount;
|
|
|
|
|
|
vec3 ambientColor;
|
|
|
|
|
|
vec3 lightColor0;
|
|
|
vec3 lightPosition0;
|
|
|
vec3 lightDirection0;
|
|
|
vec3 lightAttenuation0;
|
|
|
|
|
|
vec3 lightColor1;
|
|
|
vec3 lightPosition1;
|
|
|
vec3 lightDirection1;
|
|
|
vec3 lightAttenuation1;
|
|
|
|
|
|
vec3 lightColor2;
|
|
|
vec3 lightPosition2;
|
|
|
vec3 lightDirection2;
|
|
|
vec3 lightAttenuation2;
|
|
|
} lighting;
|
|
|
|
|
|
PointLight lighting_getPointLight(int index) {
|
|
|
switch (index) {
|
|
|
case 0:
|
|
|
return PointLight(lighting.lightColor0, lighting.lightPosition0, lighting.lightAttenuation0);
|
|
|
case 1:
|
|
|
return PointLight(lighting.lightColor1, lighting.lightPosition1, lighting.lightAttenuation1);
|
|
|
case 2:
|
|
|
default:
|
|
|
return PointLight(lighting.lightColor2, lighting.lightPosition2, lighting.lightAttenuation2);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
DirectionalLight lighting_getDirectionalLight(int index) {
|
|
|
switch (index) {
|
|
|
case 0:
|
|
|
return DirectionalLight(lighting.lightColor0, lighting.lightDirection0);
|
|
|
case 1:
|
|
|
return DirectionalLight(lighting.lightColor1, lighting.lightDirection1);
|
|
|
case 2:
|
|
|
default:
|
|
|
return DirectionalLight(lighting.lightColor2, lighting.lightDirection2);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
float getPointLightAttenuation(PointLight pointLight, float distance) {
|
|
|
return pointLight.attenuation.x
|
|
|
+ pointLight.attenuation.y * distance
|
|
|
+ pointLight.attenuation.z * distance * distance;
|
|
|
}
|
|
|
|
|
|
// #endif
|
|
|
`,oj=`// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))
|
|
|
struct AmbientLight {
|
|
|
color: vec3<f32>,
|
|
|
};
|
|
|
|
|
|
struct PointLight {
|
|
|
color: vec3<f32>,
|
|
|
position: vec3<f32>,
|
|
|
attenuation: vec3<f32>, // 2nd order x:Constant-y:Linear-z:Exponential
|
|
|
};
|
|
|
|
|
|
struct DirectionalLight {
|
|
|
color: vec3<f32>,
|
|
|
direction: vec3<f32>,
|
|
|
};
|
|
|
|
|
|
struct lightingUniforms {
|
|
|
enabled: i32,
|
|
|
poightCount: i32,
|
|
|
directionalLightCount: i32,
|
|
|
|
|
|
ambientColor: vec3<f32>,
|
|
|
|
|
|
// TODO - support multiple lights by uncommenting arrays below
|
|
|
lightType: i32,
|
|
|
lightColor: vec3<f32>,
|
|
|
lightDirection: vec3<f32>,
|
|
|
lightPosition: vec3<f32>,
|
|
|
lightAttenuation: vec3<f32>,
|
|
|
|
|
|
// AmbientLight ambientLight;
|
|
|
// PointLight pointLight[MAX_LIGHTS];
|
|
|
// DirectionalLight directionalLight[MAX_LIGHTS];
|
|
|
};
|
|
|
|
|
|
// Binding 0:1 is reserved for lighting (Note: could go into separate bind group as it is stable across draw calls)
|
|
|
@binding(1) @group(0) var<uniform> lighting : lightingUniforms;
|
|
|
|
|
|
fn lighting_getPointLight(index: i32) -> PointLight {
|
|
|
return PointLight(lighting.lightColor, lighting.lightPosition, lighting.lightAttenuation);
|
|
|
}
|
|
|
|
|
|
fn lighting_getDirectionalLight(index: i32) -> DirectionalLight {
|
|
|
return DirectionalLight(lighting.lightColor, lighting.lightDirection);
|
|
|
}
|
|
|
|
|
|
fn getPointLightAttenuation(pointLight: PointLight, distance: f32) -> f32 {
|
|
|
return pointLight.attenuation.x
|
|
|
+ pointLight.attenuation.y * distance
|
|
|
+ pointLight.attenuation.z * distance * distance;
|
|
|
}
|
|
|
`,MM=3,lj=255;var Pf;(function(t){t[t.POINT=0]="POINT",t[t.DIRECTIONAL=1]="DIRECTIONAL"})(Pf||(Pf={}));const sf={props:{},uniforms:{},name:"lighting",defines:{MAX_LIGHTS:MM},uniformTypes:{enabled:"i32",lightType:"i32",directionalLightCount:"i32",pointLightCount:"i32",ambientLightColor:"vec3<f32>",lightColor0:"vec3<f32>",lightPosition0:"vec3<f32>",lightDirection0:"vec3<f32>",lightAttenuation0:"vec3<f32>",lightColor1:"vec3<f32>",lightPosition1:"vec3<f32>",lightDirection1:"vec3<f32>",lightAttenuation1:"vec3<f32>",lightColor2:"vec3<f32>",lightPosition2:"vec3<f32>",lightDirection2:"vec3<f32>",lightAttenuation2:"vec3<f32>"},defaultUniforms:{enabled:1,lightType:Pf.POINT,directionalLightCount:0,pointLightCount:0,ambientLightColor:[.1,.1,.1],lightColor0:[1,1,1],lightPosition0:[1,1,2],lightDirection0:[1,1,1],lightAttenuation0:[1,0,0],lightColor1:[1,1,1],lightPosition1:[1,1,2],lightDirection1:[1,1,1],lightAttenuation1:[1,0,0],lightColor2:[1,1,1],lightPosition2:[1,1,2],lightDirection2:[1,1,1],lightAttenuation2:[1,0,0]},source:oj,vs:u2,fs:u2,getUniforms:cj};function cj(t,e={}){if(t=t&&{...t},!t)return{...sf.defaultUniforms};t.lights&&(t={...t,...fj(t.lights),lights:void 0});const{ambientLight:n,pointLights:r,directionalLights:i}=t||{};if(!(n||r&&r.length>0||i&&i.length>0))return{...sf.defaultUniforms,enabled:0};const l={...sf.defaultUniforms,...e,...uj({ambientLight:n,pointLights:r,directionalLights:i})};return t.enabled!==void 0&&(l.enabled=t.enabled?1:0),l}function uj({ambientLight:t,pointLights:e=[],directionalLights:n=[]}){const r={};r.ambientLightColor=n0(t);let i=0;for(const a of e){r.lightType=Pf.POINT;const l=i;r[`lightColor${l}`]=n0(a),r[`lightPosition${l}`]=a.position,r[`lightAttenuation${l}`]=a.attenuation||[1,0,0],i++}for(const a of n){r.lightType=Pf.DIRECTIONAL;const l=i;r[`lightColor${l}`]=n0(a),r[`lightDirection${l}`]=a.direction,i++}return i>MM&&Re.warn("MAX_LIGHTS exceeded")(),r.directionalLightCount=n.length,r.pointLightCount=e.length,r}function fj(t){var n,r;const e={pointLights:[],directionalLights:[]};for(const i of t||[])switch(i.type){case"ambient":e.ambientLight=i;break;case"directional":(n=e.directionalLights)==null||n.push(i);break;case"point":(r=e.pointLights)==null||r.push(i);break}return e}function n0(t={}){const{color:e=[0,0,0],intensity:n=1}=t;return e.map(r=>r*n/lj)}const OM=`uniform phongMaterialUniforms {
|
|
|
uniform float ambient;
|
|
|
uniform float diffuse;
|
|
|
uniform float shininess;
|
|
|
uniform vec3 specularColor;
|
|
|
} material;
|
|
|
`,PM=`uniform phongMaterialUniforms {
|
|
|
uniform float ambient;
|
|
|
uniform float diffuse;
|
|
|
uniform float shininess;
|
|
|
uniform vec3 specularColor;
|
|
|
} material;
|
|
|
|
|
|
vec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {
|
|
|
vec3 halfway_direction = normalize(light_direction + view_direction);
|
|
|
float lambertian = dot(light_direction, normal_worldspace);
|
|
|
float specular = 0.0;
|
|
|
if (lambertian > 0.0) {
|
|
|
float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);
|
|
|
specular = pow(specular_angle, material.shininess);
|
|
|
}
|
|
|
lambertian = max(lambertian, 0.0);
|
|
|
return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color;
|
|
|
}
|
|
|
|
|
|
vec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {
|
|
|
vec3 lightColor = surfaceColor;
|
|
|
|
|
|
if (lighting.enabled == 0) {
|
|
|
return lightColor;
|
|
|
}
|
|
|
|
|
|
vec3 view_direction = normalize(cameraPosition - position_worldspace);
|
|
|
lightColor = material.ambient * surfaceColor * lighting.ambientColor;
|
|
|
|
|
|
for (int i = 0; i < lighting.pointLightCount; i++) {
|
|
|
PointLight pointLight = lighting_getPointLight(i);
|
|
|
vec3 light_position_worldspace = pointLight.position;
|
|
|
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
|
|
|
float light_attenuation = getPointLightAttenuation(pointLight, distance(light_position_worldspace, position_worldspace));
|
|
|
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation);
|
|
|
}
|
|
|
|
|
|
int totalLights = min(MAX_LIGHTS, lighting.pointLightCount + lighting.directionalLightCount);
|
|
|
for (int i = lighting.pointLightCount; i < totalLights; i++) {
|
|
|
DirectionalLight directionalLight = lighting_getDirectionalLight(i);
|
|
|
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
|
}
|
|
|
|
|
|
return lightColor;
|
|
|
}
|
|
|
`,NM={props:{},name:"gouraudMaterial",vs:PM.replace("phongMaterial","gouraudMaterial"),fs:OM.replace("phongMaterial","gouraudMaterial"),defines:{LIGHTING_VERTEX:1},dependencies:[sf],uniformTypes:{ambient:"f32",diffuse:"f32",shininess:"f32",specularColor:"vec3<f32>"},defaultUniforms:{ambient:.35,diffuse:.6,shininess:32,specularColor:[.15,.15,.15]},getUniforms(t){const e={...t};return e.specularColor&&(e.specularColor=e.specularColor.map(n=>n/255)),{...NM.defaultUniforms,...e}}},dj=`struct phongMaterialUniforms {
|
|
|
ambient: f32,
|
|
|
diffuse: f32,
|
|
|
shininess: f32,
|
|
|
specularColor: vec3<f32>,
|
|
|
};
|
|
|
|
|
|
@binding(2) @group(0) var<uniform> material : phongMaterialUniforms;
|
|
|
|
|
|
fn lighting_getLightColor(surfaceColor: vec3<f32>, light_direction: vec3<f32>, view_direction: vec3<f32>, normal_worldspace: vec3<f32>, color: vec3<f32>) -> vec3<f32> {
|
|
|
let halfway_direction: vec3<f32> = normalize(light_direction + view_direction);
|
|
|
var lambertian: f32 = dot(light_direction, normal_worldspace);
|
|
|
var specular: f32 = 0.0;
|
|
|
if (lambertian > 0.0) {
|
|
|
let specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);
|
|
|
specular = pow(specular_angle, material.shininess);
|
|
|
}
|
|
|
lambertian = max(lambertian, 0.0);
|
|
|
return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color;
|
|
|
}
|
|
|
|
|
|
fn lighting_getLightColor2(surfaceColor: vec3<f32>, cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32> {
|
|
|
var lightColor: vec3<f32> = surfaceColor;
|
|
|
|
|
|
if (lighting.enabled == 0) {
|
|
|
return lightColor;
|
|
|
}
|
|
|
|
|
|
let view_direction: vec3<f32> = normalize(cameraPosition - position_worldspace);
|
|
|
lightColor = material.ambient * surfaceColor * lighting.ambientColor;
|
|
|
|
|
|
if (lighting.lightType == 0) {
|
|
|
let pointLight: PointLight = lighting_getPointLight(0);
|
|
|
let light_position_worldspace: vec3<f32> = pointLight.position;
|
|
|
let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);
|
|
|
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
|
|
|
} else if (lighting.lightType == 1) {
|
|
|
var directionalLight: DirectionalLight = lighting_getDirectionalLight(0);
|
|
|
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
|
}
|
|
|
|
|
|
return lightColor;
|
|
|
/*
|
|
|
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
|
if (i >= lighting.pointLightCount) {
|
|
|
break;
|
|
|
}
|
|
|
PointLight pointLight = lighting.pointLight[i];
|
|
|
vec3 light_position_worldspace = pointLight.position;
|
|
|
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
|
|
|
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
|
|
|
}
|
|
|
|
|
|
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
|
if (i >= lighting.directionalLightCount) {
|
|
|
break;
|
|
|
}
|
|
|
DirectionalLight directionalLight = lighting.directionalLight[i];
|
|
|
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
|
}
|
|
|
*/
|
|
|
}
|
|
|
|
|
|
fn lighting_getSpecularLightColor(cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32>{
|
|
|
var lightColor = vec3<f32>(0, 0, 0);
|
|
|
let surfaceColor = vec3<f32>(0, 0, 0);
|
|
|
|
|
|
if (lighting.enabled == 0) {
|
|
|
let view_direction = normalize(cameraPosition - position_worldspace);
|
|
|
|
|
|
switch (lighting.lightType) {
|
|
|
case 0, default: {
|
|
|
let pointLight: PointLight = lighting_getPointLight(0);
|
|
|
let light_position_worldspace: vec3<f32> = pointLight.position;
|
|
|
let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);
|
|
|
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
|
|
|
}
|
|
|
case 1: {
|
|
|
let directionalLight: DirectionalLight = lighting_getDirectionalLight(0);
|
|
|
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return lightColor;
|
|
|
}
|
|
|
`,IM={name:"phongMaterial",dependencies:[sf],source:dj,vs:OM,fs:PM,defines:{LIGHTING_FRAGMENT:1},uniformTypes:{ambient:"f32",diffuse:"f32",shininess:"f32",specularColor:"vec3<f32>"},defaultUniforms:{ambient:.35,diffuse:.6,shininess:32,specularColor:[.15,.15,.15]},getUniforms(t){const e={...t};return e.specularColor&&(e.specularColor=e.specularColor.map(n=>n/255)),{...IM.defaultUniforms,...e}}},f2=`uniform layerUniforms {
|
|
|
uniform float opacity;
|
|
|
} layer;
|
|
|
`,hj={name:"layer",vs:f2,fs:f2,getUniforms:t=>({opacity:Math.pow(t.opacity,1/2.2)}),uniformTypes:{opacity:"f32"}},DM="#define SMOOTH_EDGE_RADIUS 0.5",gj=`
|
|
|
${DM}
|
|
|
|
|
|
struct VertexGeometry {
|
|
|
vec4 position;
|
|
|
vec3 worldPosition;
|
|
|
vec3 worldPositionAlt;
|
|
|
vec3 normal;
|
|
|
vec2 uv;
|
|
|
vec3 pickingColor;
|
|
|
} geometry = VertexGeometry(
|
|
|
vec4(0.0, 0.0, 1.0, 0.0),
|
|
|
vec3(0.0),
|
|
|
vec3(0.0),
|
|
|
vec3(0.0),
|
|
|
vec2(0.0),
|
|
|
vec3(0.0)
|
|
|
);
|
|
|
`,pj=`
|
|
|
${DM}
|
|
|
|
|
|
struct FragmentGeometry {
|
|
|
vec2 uv;
|
|
|
} geometry;
|
|
|
|
|
|
float smoothedge(float edge, float x) {
|
|
|
return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);
|
|
|
}
|
|
|
`,FM={name:"geometry",vs:gj,fs:pj},mj=25;var or;(function(t){t[t.Start=1]="Start",t[t.Move=2]="Move",t[t.End=4]="End",t[t.Cancel=8]="Cancel"})(or||(or={}));var ur;(function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Up=4]="Up",t[t.Down=8]="Down",t[t.Horizontal=3]="Horizontal",t[t.Vertical=12]="Vertical",t[t.All=15]="All"})(ur||(ur={}));var Ct;(function(t){t[t.Possible=1]="Possible",t[t.Began=2]="Began",t[t.Changed=4]="Changed",t[t.Ended=8]="Ended",t[t.Recognized=8]="Recognized",t[t.Cancelled=16]="Cancelled",t[t.Failed=32]="Failed"})(Ct||(Ct={}));const vj="compute",_j="auto",G_="manipulation",Bh="none",J_="pan-x",ey="pan-y";function yj(t){if(t.includes(Bh))return Bh;const e=t.includes(J_),n=t.includes(ey);return e&&n?Bh:e||n?e?J_:ey:t.includes(G_)?G_:_j}class bj{constructor(e,n){this.actions="",this.manager=e,this.set(n)}set(e){e===vj&&(e=this.compute()),this.manager.element&&(this.manager.element.style.touchAction=e,this.actions=e)}update(){this.set(this.manager.options.touchAction)}compute(){let e=[];for(const n of this.manager.recognizers)n.options.enable&&(e=e.concat(n.getTouchAction()));return yj(e.join(" "))}}function Sg(t){return t.trim().split(/\s+/g)}function r0(t,e,n){if(t)for(const r of Sg(e))t.addEventListener(r,n,!1)}function i0(t,e,n){if(t)for(const r of Sg(e))t.removeEventListener(r,n,!1)}function d2(t){return(t.ownerDocument||t).defaultView}function Sj(t,e){let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function kM(t){const e=t.length;if(e===1)return{x:Math.round(t[0].clientX),y:Math.round(t[0].clientY)};let n=0,r=0,i=0;for(;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:Math.round(n/e),y:Math.round(r/e)}}function h2(t){const e=[];let n=0;for(;n<t.pointers.length;)e[n]={clientX:Math.round(t.pointers[n].clientX),clientY:Math.round(t.pointers[n].clientY)},n++;return{timeStamp:Date.now(),pointers:e,center:kM(e),deltaX:t.deltaX,deltaY:t.deltaY}}function BM(t,e){const n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function g2(t,e){const n=e.clientX-t.clientX,r=e.clientY-t.clientY;return Math.sqrt(n*n+r*r)}function Ej(t,e){const n=e.x-t.x,r=e.y-t.y;return Math.atan2(r,n)*180/Math.PI}function p2(t,e){const n=e.clientX-t.clientX,r=e.clientY-t.clientY;return Math.atan2(r,n)*180/Math.PI}function UM(t,e){return t===e?ur.None:Math.abs(t)>=Math.abs(e)?t<0?ur.Left:ur.Right:e<0?ur.Up:ur.Down}function wj(t,e){const n=e.center;let r=t.offsetDelta,i=t.prevDelta;const a=t.prevInput;return(e.eventType===or.Start||(a==null?void 0:a.eventType)===or.End)&&(i=t.prevDelta={x:(a==null?void 0:a.deltaX)||0,y:(a==null?void 0:a.deltaY)||0},r=t.offsetDelta={x:n.x,y:n.y}),{deltaX:i.x+(n.x-r.x),deltaY:i.y+(n.y-r.y)}}function LM(t,e,n){return{x:e/t||0,y:n/t||0}}function Tj(t,e){return g2(e[0],e[1])/g2(t[0],t[1])}function Cj(t,e){return p2(e[1],e[0])-p2(t[1],t[0])}function Aj(t,e){const n=t.lastInterval||e,r=e.timeStamp-n.timeStamp;let i,a,l,u;if(e.eventType!==or.Cancel&&(r>mj||n.velocity===void 0)){const f=e.deltaX-n.deltaX,h=e.deltaY-n.deltaY,g=LM(r,f,h);a=g.x,l=g.y,i=Math.abs(g.x)>Math.abs(g.y)?g.x:g.y,u=UM(f,h),t.lastInterval=e}else i=n.velocity,a=n.velocityX,l=n.velocityY,u=n.direction;e.velocity=i,e.velocityX=a,e.velocityY=l,e.direction=u}function Rj(t,e){const{session:n}=t,{pointers:r}=e,{length:i}=r;n.firstInput||(n.firstInput=h2(e)),i>1&&!n.firstMultiple?n.firstMultiple=h2(e):i===1&&(n.firstMultiple=!1);const{firstInput:a,firstMultiple:l}=n,u=l?l.center:a.center,f=e.center=kM(r);e.timeStamp=Date.now(),e.deltaTime=e.timeStamp-a.timeStamp,e.angle=Ej(u,f),e.distance=BM(u,f);const{deltaX:h,deltaY:g}=wj(n,e);e.deltaX=h,e.deltaY=g,e.offsetDirection=UM(e.deltaX,e.deltaY);const m=LM(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=m.x,e.overallVelocityY=m.y,e.overallVelocity=Math.abs(m.x)>Math.abs(m.y)?m.x:m.y,e.scale=l?Tj(l.pointers,r):1,e.rotation=l?Cj(l.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length;let v=t.element;return Sj(e.srcEvent.target,v)&&(v=e.srcEvent.target),e.target=v,Aj(n,e),e}function xj(t,e,n){const r=n.pointers.length,i=n.changedPointers.length,a=e&or.Start&&r-i===0,l=e&(or.End|or.Cancel)&&r-i===0;n.isFirst=!!a,n.isFinal=!!l,a&&(t.session={}),n.eventType=e;const u=Rj(t,n);t.emit("hammer.input",u),t.recognize(u),t.session.prevInput=u}let Mj=class{constructor(e){this.evEl="",this.evWin="",this.evTarget="",this.domHandler=n=>{this.manager.options.enable&&this.handler(n)},this.manager=e,this.element=e.element,this.target=e.options.inputTarget||e.element}callback(e,n){xj(this.manager,e,n)}init(){r0(this.element,this.evEl,this.domHandler),r0(this.target,this.evTarget,this.domHandler),r0(d2(this.element),this.evWin,this.domHandler)}destroy(){i0(this.element,this.evEl,this.domHandler),i0(this.target,this.evTarget,this.domHandler),i0(d2(this.element),this.evWin,this.domHandler)}};const Oj={pointerdown:or.Start,pointermove:or.Move,pointerup:or.End,pointercancel:or.Cancel,pointerout:or.Cancel},Pj="pointerdown",Nj="pointermove pointerup pointercancel";class Ij extends Mj{constructor(e){super(e),this.evEl=Pj,this.evWin=Nj,this.store=this.manager.session.pointerEvents=[],this.init()}handler(e){const{store:n}=this;let r=!1;const i=Oj[e.type],a=e.pointerType,l=a==="touch";let u=n.findIndex(f=>f.pointerId===e.pointerId);i&or.Start&&(e.buttons||l)?u<0&&(n.push(e),u=n.length-1):i&(or.End|or.Cancel)&&(r=!0),!(u<0)&&(n[u]=e,this.callback(i,{pointers:n,changedPointers:[e],eventType:i,pointerType:a,srcEvent:e}),r&&n.splice(u,1))}}const Dj=["","webkit","Moz","MS","ms","o"];function Fj(t,e){const n=e[0].toUpperCase()+e.slice(1);for(const r of Dj){const i=r?r+n:e;if(i in t)return i}}const kj=1,m2=2,v2={touchAction:"compute",enable:!0,inputTarget:null,cssProps:{userSelect:"none",userDrag:"none",touchCallout:"none",tapHighlightColor:"rgba(0,0,0,0)"}};class Bj{constructor(e,n){this.options={...v2,...n,cssProps:{...v2.cssProps,...n.cssProps},inputTarget:n.inputTarget||e},this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new Ij(this),this.touchAction=new bj(this,this.options.touchAction),this.toggleCssProps(!0)}set(e){return Object.assign(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this}stop(e){this.session.stopped=e?m2:kj}recognize(e){const{session:n}=this;if(n.stopped)return;this.session.prevented&&e.srcEvent.preventDefault();let r;const{recognizers:i}=this;let{curRecognizer:a}=n;(!a||a&&a.state&Ct.Recognized)&&(a=n.curRecognizer=null);let l=0;for(;l<i.length;)r=i[l],n.stopped!==m2&&(!a||r===a||r.canRecognizeWith(a))?r.recognize(e):r.reset(),!a&&r.state&(Ct.Began|Ct.Changed|Ct.Ended)&&(a=n.curRecognizer=r),l++}get(e){const{recognizers:n}=this;for(let r=0;r<n.length;r++)if(n[r].options.event===e)return n[r];return null}add(e){if(Array.isArray(e)){for(const r of e)this.add(r);return this}const n=this.get(e.options.event);return n&&this.remove(n),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e}remove(e){if(Array.isArray(e)){for(const r of e)this.remove(r);return this}const n=typeof e=="string"?this.get(e):e;if(n){const{recognizers:r}=this,i=r.indexOf(n);i!==-1&&(r.splice(i,1),this.touchAction.update())}return this}on(e,n){if(!e||!n)return;const{handlers:r}=this;for(const i of Sg(e))r[i]=r[i]||[],r[i].push(n)}off(e,n){if(!e)return;const{handlers:r}=this;for(const i of Sg(e))n?r[i]&&r[i].splice(r[i].indexOf(n),1):delete r[i]}emit(e,n){const r=this.handlers[e]&&this.handlers[e].slice();if(!r||!r.length)return;const i=n;i.type=e,i.preventDefault=function(){n.srcEvent.preventDefault()};let a=0;for(;a<r.length;)r[a](i),a++}destroy(){this.toggleCssProps(!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}toggleCssProps(e){const{element:n}=this;if(n){for(const[r,i]of Object.entries(this.options.cssProps)){const a=Fj(n.style,r);e?(this.oldCssProps[a]=n.style[a],n.style[a]=i):n.style[a]=this.oldCssProps[a]||""}e||(this.oldCssProps={})}}}let Uj=1;function Lj(){return Uj++}function _2(t){return t&Ct.Cancelled?"cancel":t&Ct.Ended?"end":t&Ct.Changed?"move":t&Ct.Began?"start":""}class zM{constructor(e){this.options=e,this.id=Lj(),this.state=Ct.Possible,this.simultaneous={},this.requireFail=[]}set(e){return Object.assign(this.options,e),this.manager.touchAction.update(),this}recognizeWith(e){if(Array.isArray(e)){for(const i of e)this.recognizeWith(i);return this}let n;if(typeof e=="string"){if(n=this.manager.get(e),!n)throw new Error(`Cannot find recognizer ${e}`)}else n=e;const{simultaneous:r}=this;return r[n.id]||(r[n.id]=n,n.recognizeWith(this)),this}dropRecognizeWith(e){if(Array.isArray(e)){for(const r of e)this.dropRecognizeWith(r);return this}let n;return typeof e=="string"?n=this.manager.get(e):n=e,n&&delete this.simultaneous[n.id],this}requireFailure(e){if(Array.isArray(e)){for(const i of e)this.requireFailure(i);return this}let n;if(typeof e=="string"){if(n=this.manager.get(e),!n)throw new Error(`Cannot find recognizer ${e}`)}else n=e;const{requireFail:r}=this;return r.indexOf(n)===-1&&(r.push(n),n.requireFailure(this)),this}dropRequireFailure(e){if(Array.isArray(e)){for(const r of e)this.dropRequireFailure(r);return this}let n;if(typeof e=="string"?n=this.manager.get(e):n=e,n){const r=this.requireFail.indexOf(n);r>-1&&this.requireFail.splice(r,1)}return this}hasRequireFailures(){return!!this.requireFail.find(e=>e.options.enable)}canRecognizeWith(e){return!!this.simultaneous[e.id]}emit(e){if(!e)return;const{state:n}=this;n<Ct.Ended&&this.manager.emit(this.options.event+_2(n),e),this.manager.emit(this.options.event,e),e.additionalEvent&&this.manager.emit(e.additionalEvent,e),n>=Ct.Ended&&this.manager.emit(this.options.event+_2(n),e)}tryEmit(e){this.canEmit()?this.emit(e):this.state=Ct.Failed}canEmit(){let e=0;for(;e<this.requireFail.length;){if(!(this.requireFail[e].state&(Ct.Failed|Ct.Possible)))return!1;e++}return!0}recognize(e){const n={...e};if(!this.options.enable){this.reset(),this.state=Ct.Failed;return}this.state&(Ct.Recognized|Ct.Cancelled|Ct.Failed)&&(this.state=Ct.Possible),this.state=this.process(n),this.state&(Ct.Began|Ct.Changed|Ct.Ended|Ct.Cancelled)&&this.tryEmit(n)}getEventNames(){return[this.options.event]}reset(){}}class $M extends zM{attrTest(e){const n=this.options.pointers;return n===0||e.pointers.length===n}process(e){const{state:n}=this,{eventType:r}=e,i=n&(Ct.Began|Ct.Changed),a=this.attrTest(e);return i&&(r&or.Cancel||!a)?n|Ct.Cancelled:i||a?r&or.End?n|Ct.Ended:n&Ct.Began?n|Ct.Changed:Ct.Began:Ct.Failed}}class y2 extends zM{constructor(e={}){super({enable:!0,event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10,...e}),this.pTime=null,this.pCenter=null,this._timer=null,this._input=null,this.count=0}getTouchAction(){return[G_]}process(e){const{options:n}=this,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&or.Start&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==or.End)return this.failTimeout();const l=this.pTime?e.timeStamp-this.pTime<n.interval:!0,u=!this.pCenter||BM(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!u||!l?this.count=1:this.count+=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(()=>{this.state=Ct.Recognized,this.tryEmit(this._input)},n.interval),Ct.Began):Ct.Recognized}return Ct.Failed}failTimeout(){return this._timer=setTimeout(()=>{this.state=Ct.Failed},this.options.interval),Ct.Failed}reset(){clearTimeout(this._timer)}emit(e){this.state===Ct.Recognized&&(e.tapCount=this.count,this.manager.emit(this.options.event,e))}}const zj=["","start","move","end","cancel","up","down","left","right"];class b2 extends $M{constructor(e={}){super({enable:!0,pointers:1,event:"pan",threshold:10,direction:ur.All,...e}),this.pX=null,this.pY=null}getTouchAction(){const{options:{direction:e}}=this,n=[];return e&ur.Horizontal&&n.push(ey),e&ur.Vertical&&n.push(J_),n}getEventNames(){return zj.map(e=>this.options.event+e)}directionTest(e){const{options:n}=this;let r=!0,{distance:i}=e,{direction:a}=e;const l=e.deltaX,u=e.deltaY;return a&n.direction||(n.direction&ur.Horizontal?(a=l===0?ur.None:l<0?ur.Left:ur.Right,r=l!==this.pX,i=Math.abs(e.deltaX)):(a=u===0?ur.None:u<0?ur.Up:ur.Down,r=u!==this.pY,i=Math.abs(e.deltaY))),e.direction=a,r&&i>n.threshold&&!!(a&n.direction)}attrTest(e){return super.attrTest(e)&&(!!(this.state&Ct.Began)||!(this.state&Ct.Began)&&this.directionTest(e))}emit(e){this.pX=e.deltaX,this.pY=e.deltaY;const n=ur[e.direction].toLowerCase();n&&(e.additionalEvent=this.options.event+n),super.emit(e)}}const $j=["","start","move","end","cancel","in","out"];class Vj extends $M{constructor(e={}){super({enable:!0,event:"pinch",threshold:0,pointers:2,...e})}getTouchAction(){return[Bh]}getEventNames(){return $j.map(e=>this.options.event+e)}attrTest(e){return super.attrTest(e)&&(Math.abs(e.scale-1)>this.options.threshold||!!(this.state&Ct.Began))}emit(e){if(e.scale!==1){const n=e.scale<1?"in":"out";e.additionalEvent=this.options.event+n}super.emit(e)}}class lp{constructor(e,n,r){this.element=e,this.callback=n,this.options=r}}const Hj=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",jj=Hj.indexOf("firefox")!==-1,S2=4.000244140625,Wj=40,Xj=.25;class qj extends lp{constructor(e,n,r){super(e,n,{enable:!0,...r}),this.handleEvent=i=>{if(!this.options.enable)return;let a=i.deltaY;globalThis.WheelEvent&&(jj&&i.deltaMode===globalThis.WheelEvent.DOM_DELTA_PIXEL&&(a/=globalThis.devicePixelRatio),i.deltaMode===globalThis.WheelEvent.DOM_DELTA_LINE&&(a*=Wj)),a!==0&&a%S2===0&&(a=Math.floor(a/S2)),i.shiftKey&&a&&(a=a*Xj),this.callback({type:"wheel",center:{x:i.clientX,y:i.clientY},delta:-a,srcEvent:i,pointerType:"mouse",target:i.target})},e.addEventListener("wheel",this.handleEvent,{passive:!1})}destroy(){this.element.removeEventListener("wheel",this.handleEvent)}enableEventType(e,n){e==="wheel"&&(this.options.enable=n)}}const E2=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"];class Yj extends lp{constructor(e,n,r){super(e,n,{enable:!0,...r}),this.handleEvent=a=>{this.handleOverEvent(a),this.handleOutEvent(a),this.handleEnterEvent(a),this.handleLeaveEvent(a),this.handleMoveEvent(a)},this.pressed=!1;const{enable:i}=this.options;this.enableMoveEvent=i,this.enableLeaveEvent=i,this.enableEnterEvent=i,this.enableOutEvent=i,this.enableOverEvent=i,E2.forEach(a=>e.addEventListener(a,this.handleEvent))}destroy(){E2.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,n){switch(e){case"pointermove":this.enableMoveEvent=n;break;case"pointerover":this.enableOverEvent=n;break;case"pointerout":this.enableOutEvent=n;break;case"pointerenter":this.enableEnterEvent=n;break;case"pointerleave":this.enableLeaveEvent=n;break}}handleOverEvent(e){this.enableOverEvent&&e.type==="mouseover"&&this._emit("pointerover",e)}handleOutEvent(e){this.enableOutEvent&&e.type==="mouseout"&&this._emit("pointerout",e)}handleEnterEvent(e){this.enableEnterEvent&&e.type==="mouseenter"&&this._emit("pointerenter",e)}handleLeaveEvent(e){this.enableLeaveEvent&&e.type==="mouseleave"&&this._emit("pointerleave",e)}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":e.buttons===0&&(this.pressed=!1),this.pressed||this._emit("pointermove",e);break;case"mouseup":this.pressed=!1;break}}_emit(e,n){this.callback({type:e,center:{x:n.clientX,y:n.clientY},srcEvent:n,pointerType:"mouse",target:n.target})}}const w2=["keydown","keyup"];class Kj extends lp{constructor(e,n,r){super(e,n,{enable:!0,tabIndex:0,...r}),this.handleEvent=i=>{const a=i.target||i.srcElement;a.tagName==="INPUT"&&a.type==="text"||a.tagName==="TEXTAREA"||(this.enableDownEvent&&i.type==="keydown"&&this.callback({type:"keydown",srcEvent:i,key:i.key,target:i.target}),this.enableUpEvent&&i.type==="keyup"&&this.callback({type:"keyup",srcEvent:i,key:i.key,target:i.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,e.tabIndex=this.options.tabIndex,e.style.outline="none",w2.forEach(i=>e.addEventListener(i,this.handleEvent))}destroy(){w2.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,n){e==="keydown"&&(this.enableDownEvent=n),e==="keyup"&&(this.enableUpEvent=n)}}class Zj extends lp{constructor(e,n,r){super(e,n,r),this.handleEvent=i=>{this.options.enable&&this.callback({type:"contextmenu",center:{x:i.clientX,y:i.clientY},srcEvent:i,pointerType:"mouse",target:i.target})},e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,n){e==="contextmenu"&&(this.options.enable=n)}}const T2=1,ty=2,C2=4,Qj={pointerdown:T2,pointermove:ty,pointerup:C2,mousedown:T2,mousemove:ty,mouseup:C2},Gj=0,Jj=1,eW=2,tW=1,nW=2,rW=4;function iW(t){const e=Qj[t.srcEvent.type];if(!e)return null;const{buttons:n,button:r}=t.srcEvent;let i=!1,a=!1,l=!1;return e===ty?(i=!!(n&tW),a=!!(n&rW),l=!!(n&nW)):(i=r===Gj,a=r===Jj,l=r===eW),{leftButton:i,middleButton:a,rightButton:l}}function sW(t,e){const n=t.center;if(!n)return null;const r=e.getBoundingClientRect(),i=r.width/e.offsetWidth||1,a=r.height/e.offsetHeight||1,l={x:(n.x-r.left-e.clientLeft)/i,y:(n.y-r.top-e.clientTop)/a};return{center:n,offsetCenter:l}}const aW={srcElement:"root",priority:0};class oW{constructor(e,n){this.handleEvent=r=>{if(this.isEmpty())return;const i=this._normalizeEvent(r);let a=r.srcEvent.target;for(;a&&a!==i.rootElement;){if(this._emit(i,a),i.handled)return;a=a.parentNode}this._emit(i,"root")},this.eventManager=e,this.recognizerName=n,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(e,n,r,i=!1,a=!1){const{handlers:l,handlersByElement:u}=this,f={...aW,...r};let h=u.get(f.srcElement);h||(h=[],u.set(f.srcElement,h));const g={type:e,handler:n,srcElement:f.srcElement,priority:f.priority};i&&(g.once=!0),a&&(g.passive=!0),l.push(g),this._active=this._active||!g.passive;let m=h.length-1;for(;m>=0&&!(h[m].priority>=g.priority);)m--;h.splice(m+1,0,g)}remove(e,n){const{handlers:r,handlersByElement:i}=this;for(let a=r.length-1;a>=0;a--){const l=r[a];if(l.type===e&&l.handler===n){r.splice(a,1);const u=i.get(l.srcElement);u.splice(u.indexOf(l),1),u.length===0&&i.delete(l.srcElement)}}this._active=r.some(a=>!a.passive)}_emit(e,n){const r=this.handlersByElement.get(n);if(r){let i=!1;const a=()=>{e.handled=!0},l=()=>{e.handled=!0,i=!0},u=[];for(let f=0;f<r.length;f++){const{type:h,handler:g,once:m}=r[f];if(g({...e,type:h,stopPropagation:a,stopImmediatePropagation:l}),m&&u.push(r[f]),i)break}for(let f=0;f<u.length;f++){const{type:h,handler:g}=u[f];this.remove(h,g)}}}_normalizeEvent(e){const n=this.eventManager.getElement();return{...e,...iW(e),...sW(e,n),preventDefault:()=>{e.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:n}}}function lW(t){if("recognizer"in t)return t;let e;const n=Array.isArray(t)?[...t]:[t];if(typeof n[0]=="function"){const r=n.shift(),i=n.shift()||{};e=new r(i)}else e=n.shift();return{recognizer:e,recognizeWith:typeof n[0]=="string"?[n[0]]:n[0],requireFailure:typeof n[1]=="string"?[n[1]]:n[1]}}class cW{constructor(e=null,n={}){if(this._onBasicInput=r=>{this.manager.emit(r.srcEvent.type,r)},this._onOtherEvent=r=>{this.manager.emit(r.type,r)},this.options={recognizers:[],events:{},touchAction:"compute",tabIndex:0,cssProps:{},...n},this.events=new Map,this.element=e,!!e){this.manager=new Bj(e,this.options);for(const r of this.options.recognizers){const{recognizer:i,recognizeWith:a,requireFailure:l}=lW(r);this.manager.add(i),a&&i.recognizeWith(a),l&&i.requireFailure(l)}this.manager.on("hammer.input",this._onBasicInput),this.wheelInput=new qj(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Yj(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Kj(e,this._onOtherEvent,{enable:!1,tabIndex:n.tabIndex}),this.contextmenuInput=new Zj(e,this._onOtherEvent,{enable:!1}),this.on(this.options.events)}}getElement(){return this.element}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy())}on(e,n,r){this._addEventHandler(e,n,r,!1)}once(e,n,r){this._addEventHandler(e,n,r,!0)}watch(e,n,r){this._addEventHandler(e,n,r,!1,!0)}off(e,n){this._removeEventHandler(e,n)}_toggleRecognizer(e,n){var a,l,u,f;const{manager:r}=this;if(!r)return;const i=r.get(e);i&&(i.set({enable:n}),r.touchAction.update()),(a=this.wheelInput)==null||a.enableEventType(e,n),(l=this.moveInput)==null||l.enableEventType(e,n),(u=this.keyInput)==null||u.enableEventType(e,n),(f=this.contextmenuInput)==null||f.enableEventType(e,n)}_addEventHandler(e,n,r,i,a){if(typeof e!="string"){r=n;for(const[h,g]of Object.entries(e))this._addEventHandler(h,g,r,i,a);return}const{manager:l,events:u}=this;if(!l)return;let f=u.get(e);if(!f){const h=this._getRecognizerName(e)||e;f=new oW(this,h),u.set(e,f),l&&l.on(e,f.handleEvent)}f.add(e,n,r,i,a),f.isEmpty()||this._toggleRecognizer(f.recognizerName,!0)}_removeEventHandler(e,n){if(typeof e!="string"){for(const[a,l]of Object.entries(e))this._removeEventHandler(a,l);return}const{events:r}=this,i=r.get(e);if(i&&(i.remove(e,n),i.isEmpty())){const{recognizerName:a}=i;let l=!1;for(const u of r.values())if(u.recognizerName===a&&!u.isEmpty()){l=!0;break}l||this._toggleRecognizer(a,!1)}}_getRecognizerName(e){var n;return(n=this.manager.recognizers.find(r=>r.getEventNames().includes(e)))==null?void 0:n.options.event}}const cn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(cn,"IDENTITY",{get:()=>(Sn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const _s={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},zo={common:0,meters:1,pixels:2},ny={click:"onClick",panstart:"onDragStart",panmove:"onDrag",panend:"onDragEnd"},A2={multipan:[b2,{threshold:10,direction:ur.Vertical,pointers:2}],pinch:[Vj,{},null,["multipan"]],pan:[b2,{threshold:1},["pinch"],["multipan"]],dblclick:[y2,{event:"dblclick",taps:2}],click:[y2,{event:"click"},null,["dblclick"]]},uW=Object.keys(cn).map(t=>`const int COORDINATE_SYSTEM_${t} = ${cn[t]};`).join(""),fW=Object.keys(_s).map(t=>`const int PROJECTION_MODE_${t} = ${_s[t]};`).join(""),dW=Object.keys(zo).map(t=>`const int UNIT_${t.toUpperCase()} = ${zo[t]};`).join(""),hW=`${uW}
|
|
|
${fW}
|
|
|
${dW}
|
|
|
uniform projectUniforms {
|
|
|
bool wrapLongitude;
|
|
|
int coordinateSystem;
|
|
|
vec3 commonUnitsPerMeter;
|
|
|
int projectionMode;
|
|
|
float scale;
|
|
|
vec3 commonUnitsPerWorldUnit;
|
|
|
vec3 commonUnitsPerWorldUnit2;
|
|
|
vec4 center;
|
|
|
mat4 modelMatrix;
|
|
|
mat4 viewProjectionMatrix;
|
|
|
vec2 viewportSize;
|
|
|
float devicePixelRatio;
|
|
|
float focalDistance;
|
|
|
vec3 cameraPosition;
|
|
|
vec3 coordinateOrigin;
|
|
|
vec3 commonOrigin;
|
|
|
bool pseudoMeters;
|
|
|
} project;
|
|
|
const float TILE_SIZE = 512.0;
|
|
|
const float PI = 3.1415926536;
|
|
|
const float WORLD_SCALE = TILE_SIZE / (PI * 2.0);
|
|
|
const vec3 ZERO_64_LOW = vec3(0.0);
|
|
|
const float EARTH_RADIUS = 6370972.0;
|
|
|
const float GLOBE_RADIUS = 256.0;
|
|
|
float project_size_at_latitude(float lat) {
|
|
|
float y = clamp(lat, -89.9, 89.9);
|
|
|
return 1.0 / cos(radians(y));
|
|
|
}
|
|
|
float project_size() {
|
|
|
if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR &&
|
|
|
project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT &&
|
|
|
project.pseudoMeters == false) {
|
|
|
if (geometry.position.w == 0.0) {
|
|
|
return project_size_at_latitude(geometry.worldPosition.y);
|
|
|
}
|
|
|
float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;
|
|
|
float y2 = y * y;
|
|
|
float y4 = y2 * y2;
|
|
|
float y6 = y4 * y2;
|
|
|
return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;
|
|
|
}
|
|
|
return 1.0;
|
|
|
}
|
|
|
float project_size_at_latitude(float meters, float lat) {
|
|
|
return meters * project.commonUnitsPerMeter.z * project_size_at_latitude(lat);
|
|
|
}
|
|
|
float project_size(float meters) {
|
|
|
return meters * project.commonUnitsPerMeter.z * project_size();
|
|
|
}
|
|
|
vec2 project_size(vec2 meters) {
|
|
|
return meters * project.commonUnitsPerMeter.xy * project_size();
|
|
|
}
|
|
|
vec3 project_size(vec3 meters) {
|
|
|
return meters * project.commonUnitsPerMeter * project_size();
|
|
|
}
|
|
|
vec4 project_size(vec4 meters) {
|
|
|
return vec4(meters.xyz * project.commonUnitsPerMeter, meters.w);
|
|
|
}
|
|
|
mat3 project_get_orientation_matrix(vec3 up) {
|
|
|
vec3 uz = normalize(up);
|
|
|
vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));
|
|
|
vec3 uy = cross(uz, ux);
|
|
|
return mat3(ux, uy, uz);
|
|
|
}
|
|
|
bool project_needs_rotation(vec3 commonPosition, out mat3 transform) {
|
|
|
if (project.projectionMode == PROJECTION_MODE_GLOBE) {
|
|
|
transform = project_get_orientation_matrix(commonPosition);
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
vec3 project_normal(vec3 vector) {
|
|
|
vec4 normal_modelspace = project.modelMatrix * vec4(vector, 0.0);
|
|
|
vec3 n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter);
|
|
|
mat3 rotation;
|
|
|
if (project_needs_rotation(geometry.position.xyz, rotation)) {
|
|
|
n = rotation * n;
|
|
|
}
|
|
|
return n;
|
|
|
}
|
|
|
vec4 project_offset_(vec4 offset) {
|
|
|
float dy = offset.y;
|
|
|
vec3 commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy;
|
|
|
return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);
|
|
|
}
|
|
|
vec2 project_mercator_(vec2 lnglat) {
|
|
|
float x = lnglat.x;
|
|
|
if (project.wrapLongitude) {
|
|
|
x = mod(x + 180., 360.0) - 180.;
|
|
|
}
|
|
|
float y = clamp(lnglat.y, -89.9, 89.9);
|
|
|
return vec2(
|
|
|
radians(x) + PI,
|
|
|
PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))
|
|
|
) * WORLD_SCALE;
|
|
|
}
|
|
|
vec3 project_globe_(vec3 lnglatz) {
|
|
|
float lambda = radians(lnglatz.x);
|
|
|
float phi = radians(lnglatz.y);
|
|
|
float cosPhi = cos(phi);
|
|
|
float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;
|
|
|
return vec3(
|
|
|
sin(lambda) * cosPhi,
|
|
|
-cos(lambda) * cosPhi,
|
|
|
sin(phi)
|
|
|
) * D;
|
|
|
}
|
|
|
vec4 project_position(vec4 position, vec3 position64Low) {
|
|
|
vec4 position_world = project.modelMatrix * position;
|
|
|
if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) {
|
|
|
if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
|
|
|
return vec4(
|
|
|
project_mercator_(position_world.xy),
|
|
|
project_size_at_latitude(position_world.z, position_world.y),
|
|
|
position_world.w
|
|
|
);
|
|
|
}
|
|
|
if (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {
|
|
|
position_world.xyz += project.coordinateOrigin;
|
|
|
}
|
|
|
}
|
|
|
if (project.projectionMode == PROJECTION_MODE_GLOBE) {
|
|
|
if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
|
|
|
return vec4(
|
|
|
project_globe_(position_world.xyz),
|
|
|
position_world.w
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {
|
|
|
if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
|
|
|
if (abs(position_world.y - project.coordinateOrigin.y) > 0.25) {
|
|
|
return vec4(
|
|
|
project_mercator_(position_world.xy) - project.commonOrigin.xy,
|
|
|
project_size(position_world.z),
|
|
|
position_world.w
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (project.projectionMode == PROJECTION_MODE_IDENTITY ||
|
|
|
(project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&
|
|
|
(project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT ||
|
|
|
project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {
|
|
|
position_world.xyz -= project.coordinateOrigin;
|
|
|
}
|
|
|
return project_offset_(position_world) + project_offset_(project.modelMatrix * vec4(position64Low, 0.0));
|
|
|
}
|
|
|
vec4 project_position(vec4 position) {
|
|
|
return project_position(position, ZERO_64_LOW);
|
|
|
}
|
|
|
vec3 project_position(vec3 position, vec3 position64Low) {
|
|
|
vec4 projected_position = project_position(vec4(position, 1.0), position64Low);
|
|
|
return projected_position.xyz;
|
|
|
}
|
|
|
vec3 project_position(vec3 position) {
|
|
|
vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);
|
|
|
return projected_position.xyz;
|
|
|
}
|
|
|
vec2 project_position(vec2 position) {
|
|
|
vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);
|
|
|
return projected_position.xy;
|
|
|
}
|
|
|
vec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {
|
|
|
return viewProjectionMatrix * position + center;
|
|
|
}
|
|
|
vec4 project_common_position_to_clipspace(vec4 position) {
|
|
|
return project_common_position_to_clipspace(position, project.viewProjectionMatrix, project.center);
|
|
|
}
|
|
|
vec2 project_pixel_size_to_clipspace(vec2 pixels) {
|
|
|
vec2 offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0;
|
|
|
return offset * project.focalDistance;
|
|
|
}
|
|
|
float project_size_to_pixel(float meters) {
|
|
|
return project_size(meters) * project.scale;
|
|
|
}
|
|
|
float project_size_to_pixel(float size, int unit) {
|
|
|
if (unit == UNIT_METERS) return project_size_to_pixel(size);
|
|
|
if (unit == UNIT_COMMON) return size * project.scale;
|
|
|
return size;
|
|
|
}
|
|
|
float project_pixel_size(float pixels) {
|
|
|
return pixels / project.scale;
|
|
|
}
|
|
|
vec2 project_pixel_size(vec2 pixels) {
|
|
|
return pixels / project.scale;
|
|
|
}
|
|
|
`;function gW(t,e){if(t===e)return!0;if(Array.isArray(t)){const n=t.length;if(!e||e.length!==n)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}return!1}function Zf(t){let e={},n;return r=>{for(const i in r)if(!gW(r[i],e[i])){n=t(r),e=r;break}return n}}const R2=[0,0,0,0],pW=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],VM=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],mW=[0,0,0],HM=[0,0,0],vW=Zf(bW);function jM(t,e,n=HM){n.length<3&&(n=[n[0],n[1],0]);let r=n,i,a=!0;switch(e===cn.LNGLAT_OFFSETS||e===cn.METER_OFFSETS?i=n:i=t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case _s.WEB_MERCATOR:(e===cn.LNGLAT||e===cn.CARTESIAN)&&(i=[0,0,0],a=!1);break;case _s.WEB_MERCATOR_AUTO_OFFSET:e===cn.LNGLAT?r=i:e===cn.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case _s.IDENTITY:r=t.position.map(Math.fround),r[2]=r[2]||0;break;case _s.GLOBE:a=!1,i=null;break;default:a=!1}return{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:a}}function _W(t,e,n){const{viewMatrixUncentered:r,projectionMatrix:i}=t;let{viewMatrix:a,viewProjectionMatrix:l}=t,u=R2,f=R2,h=t.cameraPosition;const{geospatialOrigin:g,shaderCoordinateOrigin:m,offsetMode:v}=jM(t,e,n);return v&&(f=t.projectPosition(g||m),h=[h[0]-f[0],h[1]-f[1],h[2]-f[2]],f[3]=1,u=Kf([],f,l),a=r||a,l=Do([],i,a),l=Do([],l,pW)),{viewMatrix:a,viewProjectionMatrix:l,projectionCenter:u,originCommon:f,cameraPosCommon:h,shaderCoordinateOrigin:m,geospatialOrigin:g}}function yW({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:r=cn.DEFAULT,coordinateOrigin:i=HM,autoWrapLongitude:a=!1}){r===cn.DEFAULT&&(r=t.isGeospatial?cn.LNGLAT:cn.CARTESIAN);const l=vW({viewport:t,devicePixelRatio:e,coordinateSystem:r,coordinateOrigin:i});return l.wrapLongitude=a,l.modelMatrix=n||VM,l}function bW({viewport:t,devicePixelRatio:e,coordinateSystem:n,coordinateOrigin:r}){const{projectionCenter:i,viewProjectionMatrix:a,originCommon:l,cameraPosCommon:u,shaderCoordinateOrigin:f,geospatialOrigin:h}=_W(t,n,r),g=t.getDistanceScales(),m=[t.width*e,t.height*e],v=Kf([],[0,0,-t.focalDistance,1],t.projectionMatrix)[3]||1,S={coordinateSystem:n,projectionMode:t.projectionMode,coordinateOrigin:f,commonOrigin:l.slice(0,3),center:i,pseudoMeters:!!t._pseudoMeters,viewportSize:m,devicePixelRatio:e,focalDistance:v,commonUnitsPerMeter:g.unitsPerMeter,commonUnitsPerWorldUnit:g.unitsPerMeter,commonUnitsPerWorldUnit2:mW,scale:t.scale,wrapLongitude:!1,viewProjectionMatrix:a,modelMatrix:VM,cameraPosition:u};if(h){const w=t.getDistanceScales(h);switch(n){case cn.METER_OFFSETS:S.commonUnitsPerWorldUnit=w.unitsPerMeter,S.commonUnitsPerWorldUnit2=w.unitsPerMeter2;break;case cn.LNGLAT:case cn.LNGLAT_OFFSETS:t._pseudoMeters||(S.commonUnitsPerMeter=w.unitsPerMeter),S.commonUnitsPerWorldUnit=w.unitsPerDegree,S.commonUnitsPerWorldUnit2=w.unitsPerDegree2;break;case cn.CARTESIAN:S.commonUnitsPerWorldUnit=[1,1,w.unitsPerMeter[2]],S.commonUnitsPerWorldUnit2=[0,0,w.unitsPerMeter2[2]];break}}return S}const SW={};function EW(t=SW){return"viewport"in t?yW(t):{}}const gb={name:"project",dependencies:[JH,FM],vs:hW,getUniforms:EW,uniformTypes:{wrapLongitude:"f32",coordinateSystem:"i32",commonUnitsPerMeter:"vec3<f32>",projectionMode:"i32",scale:"f32",commonUnitsPerWorldUnit:"vec3<f32>",commonUnitsPerWorldUnit2:"vec3<f32>",center:"vec4<f32>",modelMatrix:"mat4x4<f32>",viewProjectionMatrix:"mat4x4<f32>",viewportSize:"vec2<f32>",devicePixelRatio:"f32",focalDistance:"f32",cameraPosition:"vec3<f32>",coordinateOrigin:"vec3<f32>",commonOrigin:"vec3<f32>",pseudoMeters:"f32"}},wW=`
|
|
|
vec4 project_position_to_clipspace(
|
|
|
vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition
|
|
|
) {
|
|
|
vec3 projectedPosition = project_position(position, position64Low);
|
|
|
mat3 rotation;
|
|
|
if (project_needs_rotation(projectedPosition, rotation)) {
|
|
|
// offset is specified as ENU
|
|
|
// when in globe projection, rotate offset so that the ground alighs with the surface of the globe
|
|
|
offset = rotation * offset;
|
|
|
}
|
|
|
commonPosition = vec4(projectedPosition + offset, 1.0);
|
|
|
return project_common_position_to_clipspace(commonPosition);
|
|
|
}
|
|
|
|
|
|
vec4 project_position_to_clipspace(
|
|
|
vec3 position, vec3 position64Low, vec3 offset
|
|
|
) {
|
|
|
vec4 commonPosition;
|
|
|
return project_position_to_clipspace(position, position64Low, offset, commonPosition);
|
|
|
}
|
|
|
`,WM={name:"project32",dependencies:[gb],vs:wW};function TW(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function rc(t,e){const n=Kf([],e,t);return HH(n,n,1/n[3]),n}function x2(t,e){const n=t%e;return n<0?e+n:n}function ry(t,e,n){return t<e?e:t>n?n:t}function CW(t){return Math.log(t)*Math.LOG2E}const pb=Math.log2||CW;function js(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const Qi=Math.PI,XM=Qi/4,Pi=Qi/180,iy=180/Qi,Pc=512,Eg=4003e4,M2=85.051129,AW=1.5;function RW(t){return pb(t)}function wg(t){const[e,n]=t;js(Number.isFinite(e)),js(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");const r=e*Pi,i=n*Pi,a=Pc*(r+Qi)/(2*Qi),l=Pc*(Qi+Math.log(Math.tan(XM+i*.5)))/(2*Qi);return[a,l]}function Nc(t){const[e,n]=t,r=e/Pc*(2*Qi)-Qi,i=2*(Math.atan(Math.exp(n/Pc*(2*Qi)-Qi))-XM);return[r*iy,i*iy]}function xW(t){const{latitude:e}=t;js(Number.isFinite(e));const n=Math.cos(e*Pi);return RW(Eg*n)-9}function s0(t){const e=Math.cos(t*Pi);return Pc/Eg/e}function sy(t){const{latitude:e,longitude:n,highPrecision:r=!1}=t;js(Number.isFinite(e)&&Number.isFinite(n));const i=Pc,a=Math.cos(e*Pi),l=i/360,u=l/a,f=i/Eg/a,h={unitsPerMeter:[f,f,f],metersPerUnit:[1/f,1/f,1/f],unitsPerDegree:[l,u,f],degreesPerUnit:[1/l,1/u,1/f]};if(r){const g=Pi*Math.tan(e*Pi)/a,m=l*g/2,v=i/Eg*g,S=v/u*f;h.unitsPerDegree2=[0,m,v],h.unitsPerMeter2=[S,0,S]}return h}function qM(t,e){const[n,r,i]=t,[a,l,u]=e,{unitsPerMeter:f,unitsPerMeter2:h}=sy({longitude:n,latitude:r,highPrecision:!0}),g=wg(t);g[0]+=a*(f[0]+h[0]*l),g[1]+=l*(f[1]+h[1]*l);const m=Nc(g),v=(i||0)+(u||0);return Number.isFinite(i)||Number.isFinite(u)?[m[0],m[1],v]:m}function MW(t){const{height:e,pitch:n,bearing:r,altitude:i,scale:a,center:l}=t,u=TW();bg(u,u,[0,0,-i]),AM(u,u,-n*Pi),RM(u,u,r*Pi);const f=a/e;return hb(u,u,[f,f,f]),l&&bg(u,u,yH([],l)),u}function OW(t){const{width:e,height:n,altitude:r,pitch:i=0,offset:a,center:l,scale:u,nearZMultiplier:f=1,farZMultiplier:h=1}=t;let{fovy:g=Tg(AW)}=t;r!==void 0&&(g=Tg(r));const m=g*Pi,v=i*Pi,S=YM(g);let w=S;l&&(w+=l[2]*u/Math.cos(v)/n);const E=m*(.5+(a?a[1]:0)/n),b=Math.sin(E)*w/Math.sin(ry(Math.PI/2-v-E,.01,Math.PI-.01)),C=Math.sin(v)*b+w,T=w*10,A=Math.min(C*h,T);return{fov:m,aspect:e/n,focalDistance:S,near:f,far:A}}function Tg(t){return 2*Math.atan(.5/t)*iy}function YM(t){return .5/Math.tan(.5*t*Pi)}function KM(t,e){const[n,r,i=0]=t;return js(Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(i)),rc(e,[n,r,i,1])}function mb(t,e,n=0){const[r,i,a]=t;if(js(Number.isFinite(r)&&Number.isFinite(i),"invalid pixel coordinate"),Number.isFinite(a))return rc(e,[r,i,a,1]);const l=rc(e,[r,i,0,1]),u=rc(e,[r,i,1,1]),f=l[2],h=u[2],g=f===h?0:((n||0)-f)/(h-f);return wM([],l,u,g)}function PW(t){const{width:e,height:n,bounds:r,minExtent:i=0,maxZoom:a=24,offset:l=[0,0]}=t,[[u,f],[h,g]]=r,m=NW(t.padding),v=wg([u,ry(g,-85.051129,M2)]),S=wg([h,ry(f,-85.051129,M2)]),w=[Math.max(Math.abs(S[0]-v[0]),i),Math.max(Math.abs(S[1]-v[1]),i)],E=[e-m.left-m.right-Math.abs(l[0])*2,n-m.top-m.bottom-Math.abs(l[1])*2];js(E[0]>0&&E[1]>0);const b=E[0]/w[0],C=E[1]/w[1],T=(m.right-m.left)/2/b,A=(m.top-m.bottom)/2/C,O=[(S[0]+v[0])/2+T,(S[1]+v[1])/2+A],x=Nc(O),N=Math.min(a,pb(Math.abs(Math.min(b,C))));return js(Number.isFinite(N)),{longitude:x[0],latitude:x[1],zoom:N}}function NW(t=0){return typeof t=="number"?{top:t,bottom:t,left:t,right:t}:(js(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t)}const O2=Math.PI/180;function IW(t,e=0){const{width:n,height:r,unproject:i}=t,a={targetZ:e},l=i([0,r],a),u=i([n,r],a);let f,h;const g=t.fovy?.5*t.fovy*O2:Math.atan(.5/t.altitude),m=(90-t.pitch)*O2;return g>m-.01?(f=P2(t,0,e),h=P2(t,n,e)):(f=i([0,0],a),h=i([n,0],a)),[l,u,h,f]}function P2(t,e,n){const{pixelUnprojectionMatrix:r}=t,i=rc(r,[e,0,1,1]),a=rc(r,[e,t.height,1,1]),u=(n*t.distanceScales.unitsPerMeter[2]-i[2])/(a[2]-i[2]),f=wM([],i,a,u),h=Nc(f);return h.push(n),h}const N2=512;function DW(t){const{width:e,height:n,pitch:r=0}=t;let{longitude:i,latitude:a,zoom:l,bearing:u=0}=t;(i<-180||i>180)&&(i=x2(i+180,360)-180),(u<-180||u>180)&&(u=x2(u+180,360)-180);const f=pb(n/N2);if(l<=f)l=f,a=0;else{const h=n/2/Math.pow(2,l),g=Nc([0,h])[1];if(a<g)a=g;else{const m=Nc([0,N2-h])[1];a>m&&(a=m)}}return{width:e,height:n,longitude:i,latitude:a,zoom:l,pitch:r,bearing:u}}const ZM=`
|
|
|
uniform shadowUniforms {
|
|
|
bool drawShadowMap;
|
|
|
bool useShadowMap;
|
|
|
vec4 color;
|
|
|
highp int lightId;
|
|
|
float lightCount;
|
|
|
mat4 viewProjectionMatrix0;
|
|
|
mat4 viewProjectionMatrix1;
|
|
|
vec4 projectCenter0;
|
|
|
vec4 projectCenter1;
|
|
|
} shadow;
|
|
|
`,FW=`
|
|
|
const int max_lights = 2;
|
|
|
|
|
|
out vec3 shadow_vPosition[max_lights];
|
|
|
|
|
|
vec4 shadow_setVertexPosition(vec4 position_commonspace) {
|
|
|
mat4 viewProjectionMatrices[max_lights];
|
|
|
viewProjectionMatrices[0] = shadow.viewProjectionMatrix0;
|
|
|
viewProjectionMatrices[1] = shadow.viewProjectionMatrix1;
|
|
|
vec4 projectCenters[max_lights];
|
|
|
projectCenters[0] = shadow.projectCenter0;
|
|
|
projectCenters[1] = shadow.projectCenter1;
|
|
|
|
|
|
if (shadow.drawShadowMap) {
|
|
|
return project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[shadow.lightId], projectCenters[shadow.lightId]);
|
|
|
}
|
|
|
if (shadow.useShadowMap) {
|
|
|
for (int i = 0; i < max_lights; i++) {
|
|
|
if(i < int(shadow.lightCount)) {
|
|
|
vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[i], projectCenters[i]);
|
|
|
shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return gl_Position;
|
|
|
}
|
|
|
`,kW=`
|
|
|
${ZM}
|
|
|
${FW}
|
|
|
`,BW=`
|
|
|
const int max_lights = 2;
|
|
|
uniform sampler2D shadow_uShadowMap0;
|
|
|
uniform sampler2D shadow_uShadowMap1;
|
|
|
|
|
|
in vec3 shadow_vPosition[max_lights];
|
|
|
|
|
|
const vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);
|
|
|
const vec4 bitUnpackShift = 1.0 / bitPackShift;
|
|
|
const vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
|
|
|
|
|
|
float shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {
|
|
|
vec4 rgbaDepth = texture(shadowMap, position.xy);
|
|
|
|
|
|
float z = dot(rgbaDepth, bitUnpackShift);
|
|
|
return smoothstep(0.001, 0.01, position.z - z);
|
|
|
}
|
|
|
|
|
|
vec4 shadow_filterShadowColor(vec4 color) {
|
|
|
if (shadow.drawShadowMap) {
|
|
|
vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);
|
|
|
rgbaDepth -= rgbaDepth.gbaa * bitMask;
|
|
|
return rgbaDepth;
|
|
|
}
|
|
|
if (shadow.useShadowMap) {
|
|
|
float shadowAlpha = 0.0;
|
|
|
shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);
|
|
|
if(shadow.lightCount > 1.0) {
|
|
|
shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);
|
|
|
}
|
|
|
shadowAlpha *= shadow.color.a / shadow.lightCount;
|
|
|
float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);
|
|
|
|
|
|
return vec4(
|
|
|
mix(color.rgb, shadow.color.rgb, shadowAlpha / blendedAlpha),
|
|
|
blendedAlpha
|
|
|
);
|
|
|
}
|
|
|
return color;
|
|
|
}
|
|
|
`,UW=`
|
|
|
${ZM}
|
|
|
${BW}
|
|
|
`,LW=Zf(jW),zW=Zf(WW),$W=[0,0,0,1],VW=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];function HW(t,e){const[n,r,i]=t,a=mb([n,r,i],e);return Number.isFinite(i)?a:[a[0],a[1],0]}function jW({viewport:t,center:e}){return new Ss(t.viewProjectionMatrix).invert().transform(e)}function WW({viewport:t,shadowMatrices:e}){const n=[],r=t.pixelUnprojectionMatrix,i=t.isGeospatial?void 0:1,a=[[0,0,i],[t.width,0,i],[0,t.height,i],[t.width,t.height,i],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(l=>HW(l,r));for(const l of e){const u=l.clone().translate(new bs(t.center).negate()),f=a.map(g=>u.transform(g)),h=new Ss().ortho({left:Math.min(...f.map(g=>g[0])),right:Math.max(...f.map(g=>g[0])),bottom:Math.min(...f.map(g=>g[1])),top:Math.max(...f.map(g=>g[1])),near:Math.min(...f.map(g=>-g[2])),far:Math.max(...f.map(g=>-g[2]))});n.push(h.multiplyRight(l))}return n}function XW(t){const{shadowEnabled:e=!0,project:n}=t;if(!e||!n||!t.shadowMatrices||!t.shadowMatrices.length)return{drawShadowMap:!1,useShadowMap:!1,shadow_uShadowMap0:t.dummyShadowMap,shadow_uShadowMap1:t.dummyShadowMap};const r=gb.getUniforms(n),i=LW({viewport:n.viewport,center:r.center}),a=[],l=zW({shadowMatrices:t.shadowMatrices,viewport:n.viewport}).slice();for(let f=0;f<t.shadowMatrices.length;f++){const h=l[f],g=h.clone().translate(new bs(n.viewport.center).negate());r.coordinateSystem===cn.LNGLAT&&r.projectionMode===_s.WEB_MERCATOR?(l[f]=g,a[f]=i):(l[f]=h.clone().multiplyRight(VW),a[f]=g.transform(i))}const u={drawShadowMap:!!t.drawToShadowMap,useShadowMap:t.shadowMaps?t.shadowMaps.length>0:!1,color:t.shadowColor||$W,lightId:t.shadowLightId||0,lightCount:t.shadowMatrices.length,shadow_uShadowMap0:t.dummyShadowMap,shadow_uShadowMap1:t.dummyShadowMap};for(let f=0;f<l.length;f++)u[`viewProjectionMatrix${f}`]=l[f],u[`projectCenter${f}`]=a[f];for(let f=0;f<2;f++)u[`shadow_uShadowMap${f}`]=t.shadowMaps&&t.shadowMaps[f]||t.dummyShadowMap;return u}const I2={name:"shadow",dependencies:[gb],vs:kW,fs:UW,inject:{"vs:DECKGL_FILTER_GL_POSITION":`
|
|
|
position = shadow_setVertexPosition(geometry.position);
|
|
|
`,"fs:DECKGL_FILTER_COLOR":`
|
|
|
color = shadow_filterShadowColor(color);
|
|
|
`},getUniforms:XW,uniformTypes:{drawShadowMap:"f32",useShadowMap:"f32",color:"vec4<f32>",lightId:"i32",lightCount:"f32",viewProjectionMatrix0:"mat4x4<f32>",viewProjectionMatrix1:"mat4x4<f32>",projectCenter0:"vec4<f32>",projectCenter1:"vec4<f32>"}},QM={...c2,defaultUniforms:{...c2.defaultUniforms,useFloatColors:!1},inject:{"vs:DECKGL_FILTER_GL_POSITION":`
|
|
|
// for picking depth values
|
|
|
picking_setPickingAttribute(position.z / position.w);
|
|
|
`,"vs:DECKGL_FILTER_COLOR":`
|
|
|
picking_setPickingColor(geometry.pickingColor);
|
|
|
`,"fs:DECKGL_FILTER_COLOR":{order:99,injection:`
|
|
|
// use highlight color if this fragment belongs to the selected object.
|
|
|
color = picking_filterHighlightColor(color);
|
|
|
|
|
|
// use picking color if rendering to picking FBO.
|
|
|
color = picking_filterPickingColor(color);
|
|
|
`}}},qW=[FM],YW=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function KW(){const t=ug.getDefaultShaderAssembler();for(const e of qW)t.addDefaultModule(e);for(const e of YW)t.addShaderHook(e);return t}const ZW=[255,255,255],QW=1;let GW=0;class JW{constructor(e={}){this.type="ambient";const{color:n=ZW}=e,{intensity:r=QW}=e;this.id=e.id||`ambient-${GW++}`,this.color=n,this.intensity=r}}const eX=[255,255,255],tX=1,nX=[0,0,-1];let rX=0;class D2{constructor(e={}){this.type="directional";const{color:n=eX}=e,{intensity:r=tX}=e,{direction:i=nX}=e,{_shadow:a=!1}=e;this.id=e.id||`directional-${rX++}`,this.color=n,this.intensity=r,this.type="directional",this.direction=new bs(i).normalize().toArray(),this.shadow=a}getProjectedLight(e){return this}}class iX{constructor(e,n={id:"pass"}){const{id:r}=n;this.id=r,this.device=e,this.props={...n}}setProps(e){Object.assign(this.props,e)}render(e){}cleanup(){}}class vb extends iX{constructor(){super(...arguments),this._lastRenderIndex=-1}render(e){const[n,r]=this.device.canvasContext.getDrawingBufferSize(),i=e.clearCanvas??!0,a=e.clearColor??(i?[0,0,0,0]:!1),l=i?1:!1,u=i?0:!1,f=e.colorMask??15,h={viewport:[0,0,n,r]};e.colorMask&&(h.colorMask=f),e.scissorRect&&(h.scissorRect=e.scissorRect);const g=this.device.beginRenderPass({framebuffer:e.target,parameters:h,clearColor:a,clearDepth:l,clearStencil:u});try{return this._drawLayers(g,e)}finally{g.end()}}_drawLayers(e,n){const{target:r,shaderModuleProps:i,viewports:a,views:l,onViewportActive:u,clearStack:f=!0}=n;n.pass=n.pass||"unknown",f&&(this._lastRenderIndex=-1);const h=[];for(const g of a){const m=l&&l[g.id];u==null||u(g);const v=this._getDrawLayerParams(g,n),S=g.subViewports||[g];for(const w of S){const E=this._drawLayersInViewport(e,{target:r,shaderModuleProps:i,viewport:w,view:m,pass:n.pass,layers:n.layers},v);h.push(E)}}return h}_getDrawLayerParams(e,{layers:n,pass:r,isPicking:i=!1,layerFilter:a,cullRect:l,effects:u,shaderModuleProps:f},h=!1){var w;const g=[],m=GM(this._lastRenderIndex+1),v={layer:n[0],viewport:e,isPicking:i,renderPass:r,cullRect:l},S={};for(let E=0;E<n.length;E++){const b=n[E],C=this._shouldDrawLayer(b,v,a,S),T={shouldDrawLayer:C};C&&!h&&(T.shouldDrawLayer=!0,T.layerRenderIndex=m(b,C),T.shaderModuleProps=this._getShaderModuleProps(b,u,r,f),T.layerParameters={...(w=b.context.deck)==null?void 0:w.props.parameters,...this.getLayerParameters(b,E,e)}),g[E]=T}return g}_drawLayersInViewport(e,{layers:n,shaderModuleProps:r,pass:i,target:a,viewport:l,view:u},f){const h=sX(this.device,{shaderModuleProps:r,target:a,viewport:l});if(u&&u.props.clear){const m=u.props.clear===!0?{color:!0,depth:!0}:u.props.clear;this.device.beginRenderPass({framebuffer:a,parameters:{viewport:h,scissorRect:h},clearColor:m.color?[0,0,0,0]:!1,clearDepth:m.depth?1:!1}).end()}const g={totalCount:n.length,visibleCount:0,compositeCount:0,pickableCount:0};e.setParameters({viewport:h});for(let m=0;m<n.length;m++){const v=n[m],S=f[m],{shouldDrawLayer:w}=S;if(w&&v.props.pickable&&g.pickableCount++,v.isComposite&&g.compositeCount++,v.isDrawable&&S.shouldDrawLayer){const{layerRenderIndex:E,shaderModuleProps:b,layerParameters:C}=S;g.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,E),b.project&&(b.project.viewport=l),v.context.renderPass=e;try{v._drawLayer({renderPass:e,shaderModuleProps:b,uniforms:{layerIndex:E},parameters:C})}catch(T){v.raiseError(T,`drawing ${v} to ${i}`)}}}return g}shouldDrawLayer(e){return!0}getShaderModuleProps(e,n,r){return null}getLayerParameters(e,n,r){return e.props.parameters}_shouldDrawLayer(e,n,r,i){if(!(e.props.visible&&this.shouldDrawLayer(e)))return!1;n.layer=e;let l=e.parent;for(;l;){if(!l.props.visible||!l.filterSubLayer(n))return!1;n.layer=l,l=l.parent}if(r){const u=n.layer.id;if(u in i||(i[u]=r(n)),!i[u])return!1}return e.activateViewport(n.viewport),!0}_getShaderModuleProps(e,n,r,i){var f,h;const a=this.device.canvasContext.cssToDeviceRatio(),l=((f=e.internalState)==null?void 0:f.propsInTransition)||e.props,u={layer:l,picking:{isActive:!1},project:{viewport:e.context.viewport,devicePixelRatio:a,modelMatrix:l.modelMatrix,coordinateSystem:l.coordinateSystem,coordinateOrigin:l.coordinateOrigin,autoWrapLongitude:e.wrapLongitude}};if(n)for(const g of n)F2(u,(h=g.getShaderModuleProps)==null?void 0:h.call(g,e,u));return F2(u,this.getShaderModuleProps(e,n,u),i)}}function GM(t=0,e={}){const n={},r=(i,a)=>{const l=i.props._offset,u=i.id,f=i.parent&&i.parent.id;let h;if(f&&!(f in e)&&r(i.parent,!1),f in n){const g=n[f]=n[f]||GM(e[f],e);h=g(i,a),n[u]=g}else Number.isFinite(l)?(h=l+(e[f]||0),n[u]=null):h=t;return a&&h>=t&&(t=h+1),e[u]=h,h};return r}function sX(t,{shaderModuleProps:e,target:n,viewport:r}){var f;const i=((f=e==null?void 0:e.project)==null?void 0:f.devicePixelRatio)??t.canvasContext.cssToDeviceRatio(),[,a]=t.canvasContext.getDrawingBufferSize(),l=n?n.height:a,u=r;return[u.x*i,l-(u.y+u.height)*i,u.width*i,u.height*i]}function F2(t,...e){for(const n of e)if(n)for(const r in n)t[r]?Object.assign(t[r],n[r]):t[r]=n[r];return t}class aX extends vb{constructor(e,n){super(e,n);const r=e.createTexture({format:"rgba8unorm",width:1,height:1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},mipmaps:!0}),i=e.createTexture({format:"depth16unorm",width:1,height:1,mipmaps:!1});this.fbo=e.createFramebuffer({id:"shadowmap",width:1,height:1,colorAttachments:[r],depthStencilAttachment:i})}delete(){this.fbo&&(this.fbo.destroy(),this.fbo=null)}getShadowMap(){return this.fbo.colorAttachments[0].texture}render(e){const n=this.fbo,r=this.device.canvasContext.cssToDeviceRatio(),i=e.viewports[0],a=i.width*r,l=i.height*r,u=[1,1,1,1];(a!==n.width||l!==n.height)&&n.resize({width:a,height:l}),super.render({...e,clearColor:u,target:n,pass:"shadow"})}getLayerParameters(e,n,r){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:"less-equal"}}shouldDrawLayer(e){return e.props.shadowEnabled!==!1}getShaderModuleProps(e,n,r){return{shadow:{project:r.project,drawToShadowMap:!0}}}}const oX={color:[255,255,255],intensity:1},k2=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],lX=[0,0,0,200/255];class JM{constructor(e={}){this.id="lighting-effect",this.shadowColor=lX,this.shadow=!1,this.directionalLights=[],this.pointLights=[],this.shadowPasses=[],this.dummyShadowMap=null,this.setProps(e)}setup(e){this.context=e;const{device:n,deck:r}=e;this.shadow&&!this.dummyShadowMap&&(this._createShadowPasses(n),r._addDefaultShaderModule(I2),this.dummyShadowMap=n.createTexture({width:1,height:1}))}setProps(e){this.ambientLight=void 0,this.directionalLights=[],this.pointLights=[];for(const n in e){const r=e[n];switch(r.type){case"ambient":this.ambientLight=r;break;case"directional":this.directionalLights.push(r);break;case"point":this.pointLights.push(r);break}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(n=>n.shadow),this.context&&this.setup(this.context),this.props=e}preRender({layers:e,layerFilter:n,viewports:r,onViewportActive:i,views:a}){if(this.shadow){this.shadowMatrices=this._calculateMatrices();for(let l=0;l<this.shadowPasses.length;l++)this.shadowPasses[l].render({layers:e,layerFilter:n,viewports:r,onViewportActive:i,views:a,shaderModuleProps:{shadow:{shadowLightId:l,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}}})}}getShaderModuleProps(e,n){const r=this.shadow?{project:n.project,shadowMaps:this.shadowPasses.map(l=>l.getShadowMap()),dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{},i={enabled:!0,ambientLight:this.ambientLight,directionalLights:this.directionalLights.map(l=>l.getProjectedLight({layer:e})),pointLights:this.pointLights.map(l=>l.getProjectedLight({layer:e}))},a=e.props.material;return{shadow:r,lighting:i,phongMaterial:a,gouraudMaterial:a}}cleanup(e){for(const n of this.shadowPasses)n.delete();this.shadowPasses.length=0,this.dummyShadowMap&&(this.dummyShadowMap.destroy(),this.dummyShadowMap=null,e.deck._removeDefaultShaderModule(I2))}_calculateMatrices(){const e=[];for(const n of this.directionalLights){const r=new Ss().lookAt({eye:new bs(n.direction).negate()});e.push(r)}return e}_createShadowPasses(e){for(let n=0;n<this.directionalLights.length;n++){const r=new aX(e);this.shadowPasses[n]=r}}_applyDefaultLights(){const{ambientLight:e,pointLights:n,directionalLights:r}=this;!e&&n.length===0&&r.length===0&&(this.ambientLight=new JW(oX),this.directionalLights.push(new D2(k2[0]),new D2(k2[1])))}}class cX{constructor(e={}){this._pool=[],this.opts={overAlloc:2,poolSize:100},this.setOptions(e)}setOptions(e){Object.assign(this.opts,e)}allocate(e,n,{size:r=1,type:i,padding:a=0,copy:l=!1,initialize:u=!1,maxCount:f}){const h=i||e&&e.constructor||Float32Array,g=n*r+a;if(ArrayBuffer.isView(e)){if(g<=e.length)return e;if(g*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new h(e.buffer,0,g)}let m=1/0;f&&(m=f*r+a);const v=this._allocate(h,g,u,m);return e&&l?v.set(e):u||v.fill(0,0,4),this._release(e),v}release(e){this._release(e)}_allocate(e,n,r,i){let a=Math.max(Math.ceil(n*this.opts.overAlloc),1);a>i&&(a=i);const l=this._pool,u=e.BYTES_PER_ELEMENT*a,f=l.findIndex(h=>h.byteLength>=u);if(f>=0){const h=new e(l.splice(f,1)[0],0,a);return r&&h.fill(0),h}return new e(a)}_release(e){if(!ArrayBuffer.isView(e))return;const n=this._pool,{buffer:r}=e,{byteLength:i}=r,a=n.findIndex(l=>l.byteLength>=i);a<0?n.push(r):(a>0||n.length<this.opts.poolSize)&&n.splice(a,0,r),n.length>this.opts.poolSize&&n.shift()}}const Nf=new cX;function Yu(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function uX(t){return[t[12],t[13],t[14]]}function fX(t){return{left:zl(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:zl(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:zl(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:zl(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:zl(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:zl(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const B2=new bs;function zl(t,e,n,r){B2.set(t,e,n);const i=B2.len();return{distance:r/i,normal:new bs(-t/i,-e/i,-n/i)}}function dX(t){return t-Math.fround(t)}let Vu;function a0(t,e){const{size:n=1,startIndex:r=0}=e,i=e.endIndex!==void 0?e.endIndex:t.length,a=(i-r)/n;Vu=Nf.allocate(Vu,a,{type:Float32Array,size:n*2});let l=r,u=0;for(;l<i;){for(let f=0;f<n;f++){const h=t[l++];Vu[u+f]=h,Vu[u+f+n]=dX(h)}u+=n*2}return Vu.subarray(0,a*n*2)}function hX(t){let e=null,n=!1;for(const r of t)r&&(e?(n||(e=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],n=!0),e[0][0]=Math.min(e[0][0],r[0][0]),e[0][1]=Math.min(e[0][1],r[0][1]),e[1][0]=Math.max(e[1][0],r[1][0]),e[1][1]=Math.max(e[1][1],r[1][1])):e=r);return e}const gX=Math.PI/180,pX=Yu(),U2=[0,0,0],mX={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};function vX({width:t,height:e,orthographic:n,fovyRadians:r,focalDistance:i,padding:a,near:l,far:u}){const f=t/e,h=n?new Ss().orthographic({fovy:r,aspect:f,focalDistance:i,near:l,far:u}):new Ss().perspective({fovy:r,aspect:f,near:l,far:u});if(a){const{left:g=0,right:m=0,top:v=0,bottom:S=0}=a,w=Fa((g+t-m)/2,0,t)-t/2,E=Fa((v+e-S)/2,0,e)-e/2;h[8]-=w*2/t,h[9]+=E*2/e}return h}class Qf{constructor(e={}){this._frustumPlanes={},this.id=e.id||this.constructor.displayName||"viewport",this.x=e.x||0,this.y=e.y||0,this.width=e.width||1,this.height=e.height||1,this.zoom=e.zoom||0,this.padding=e.padding,this.distanceScales=e.distanceScales||mX,this.focalDistance=e.focalDistance||1,this.position=e.position||U2,this.modelMatrix=e.modelMatrix||null;const{longitude:n,latitude:r}=e;this.isGeospatial=Number.isFinite(r)&&Number.isFinite(n),this._initProps(e),this._initMatrices(e),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get subViewports(){return null}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?_s.WEB_MERCATOR:_s.WEB_MERCATOR_AUTO_OFFSET:_s.IDENTITY}equals(e){return e instanceof Qf?this===e?!0:e.width===this.width&&e.height===this.height&&e.scale===this.scale&&Of(e.projectionMatrix,this.projectionMatrix)&&Of(e.viewMatrix,this.viewMatrix):!1}project(e,{topLeft:n=!0}={}){const r=this.projectPosition(e),i=KM(r,this.pixelProjectionMatrix),[a,l]=i,u=n?l:this.height-l;return e.length===2?[a,u]:[a,u,i[2]]}unproject(e,{topLeft:n=!0,targetZ:r}={}){const[i,a,l]=e,u=n?a:this.height-a,f=r&&r*this.distanceScales.unitsPerMeter[2],h=mb([i,u,l],this.pixelUnprojectionMatrix,f),[g,m,v]=this.unprojectPosition(h);return Number.isFinite(l)?[g,m,v]:Number.isFinite(r)?[g,m,r]:[g,m]}projectPosition(e){const[n,r]=this.projectFlat(e),i=(e[2]||0)*this.distanceScales.unitsPerMeter[2];return[n,r,i]}unprojectPosition(e){const[n,r]=this.unprojectFlat(e),i=(e[2]||0)*this.distanceScales.metersPerUnit[2];return[n,r,i]}projectFlat(e){if(this.isGeospatial){const n=wg(e);return n[1]=Fa(n[1],-318,830),n}return e}unprojectFlat(e){return this.isGeospatial?Nc(e):e}getBounds(e={}){const n={targetZ:e.z||0},r=this.unproject([0,0],n),i=this.unproject([this.width,0],n),a=this.unproject([0,this.height],n),l=this.unproject([this.width,this.height],n);return[Math.min(r[0],i[0],a[0],l[0]),Math.min(r[1],i[1],a[1],l[1]),Math.max(r[0],i[0],a[0],l[0]),Math.max(r[1],i[1],a[1],l[1])]}getDistanceScales(e){return e&&this.isGeospatial?sy({longitude:e[0],latitude:e[1],highPrecision:!0}):this.distanceScales}containsPixel({x:e,y:n,width:r=1,height:i=1}){return e<this.x+this.width&&this.x<e+r&&n<this.y+this.height&&this.y<n+i}getFrustumPlanes(){return this._frustumPlanes.near?this._frustumPlanes:(Object.assign(this._frustumPlanes,fX(this.viewProjectionMatrix)),this._frustumPlanes)}panByPosition(e,n){return null}_initProps(e){const n=e.longitude,r=e.latitude;this.isGeospatial&&(Number.isFinite(e.zoom)||(this.zoom=xW({latitude:r})+Math.log2(this.focalDistance)),this.distanceScales=e.distanceScales||sy({latitude:r,longitude:n}));const i=Math.pow(2,this.zoom);this.scale=i;const{position:a,modelMatrix:l}=e;let u=U2;if(a&&(u=l?new Ss(l).transformAsVector(a,[]):a),this.isGeospatial){const f=this.projectPosition([n,r,0]);this.center=new bs(u).scale(this.distanceScales.unitsPerMeter).add(f)}else this.center=this.projectPosition(u)}_initMatrices(e){const{viewMatrix:n=pX,projectionMatrix:r=null,orthographic:i=!1,fovyRadians:a,fovy:l=75,near:u=.1,far:f=1e3,padding:h=null,focalDistance:g=1}=e;this.viewMatrixUncentered=n,this.viewMatrix=new Ss().multiplyRight(n).translate(new bs(this.center).negate()),this.projectionMatrix=r||vX({width:this.width,height:this.height,orthographic:i,fovyRadians:a||l*gX,focalDistance:g,padding:h,near:u,far:f});const m=Yu();Do(m,m,this.projectionMatrix),Do(m,m,this.viewMatrix),this.viewProjectionMatrix=m,this.viewMatrixInverse=Z_([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=uX(this.viewMatrixInverse);const v=Yu(),S=Yu();hb(v,v,[this.width/2,-this.height/2,1]),bg(v,v,[1,-1,0]),Do(S,v,this.viewProjectionMatrix),this.pixelProjectionMatrix=S,this.pixelUnprojectionMatrix=Z_(Yu(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||Sn.warn("Pixel project matrix not invertible")()}}Qf.displayName="Viewport";class Ic extends Qf{constructor(e={}){const{latitude:n=0,longitude:r=0,zoom:i=0,pitch:a=0,bearing:l=0,nearZMultiplier:u=.1,farZMultiplier:f=1.01,nearZ:h,farZ:g,orthographic:m=!1,projectionMatrix:v,repeat:S=!1,worldOffset:w=0,position:E,padding:b,legacyMeterSizes:C=!1}=e;let{width:T,height:A,altitude:O=1.5}=e;const x=Math.pow(2,i);T=T||1,A=A||1;let N,F=null;if(v)O=v[5]/2,N=Tg(O);else{e.fovy?(N=e.fovy,O=YM(N)):N=Tg(O);let D;if(b){const{top:V=0,bottom:B=0}=b;D=[0,Fa((V+A-B)/2,0,A)-A/2]}F=OW({width:T,height:A,scale:x,center:E&&[0,0,E[2]*s0(n)],offset:D,pitch:a,fovy:N,nearZMultiplier:u,farZMultiplier:f}),Number.isFinite(h)&&(F.near=h),Number.isFinite(g)&&(F.far=g)}let L=MW({height:A,pitch:a,bearing:l,scale:x,altitude:O});w&&(L=new Ss().translate([512*w,0,0]).multiplyLeft(L)),super({...e,width:T,height:A,viewMatrix:L,longitude:r,latitude:n,zoom:i,...F,fovy:N,focalDistance:O}),this.latitude=n,this.longitude=r,this.zoom=i,this.pitch=a,this.bearing=l,this.altitude=O,this.fovy=N,this.orthographic=m,this._subViewports=S?[]:null,this._pseudoMeters=C,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const e=this.getBounds(),n=Math.floor((e[0]+180)/360),r=Math.ceil((e[2]-180)/360);for(let i=n;i<=r;i++){const a=i?new Ic({...this,worldOffset:i}):this;this._subViewports.push(a)}}return this._subViewports}projectPosition(e){if(this._pseudoMeters)return super.projectPosition(e);const[n,r]=this.projectFlat(e),i=(e[2]||0)*s0(e[1]);return[n,r,i]}unprojectPosition(e){if(this._pseudoMeters)return super.unprojectPosition(e);const[n,r]=this.unprojectFlat(e),i=(e[2]||0)/s0(r);return[n,r,i]}addMetersToLngLat(e,n){return qM(e,n)}panByPosition(e,n){const r=mb(n,this.pixelUnprojectionMatrix),i=this.projectFlat(e),a=o2([],i,hH([],r)),l=o2([],this.center,a),[u,f]=this.unprojectFlat(l);return{longitude:u,latitude:f}}getBounds(e={}){const n=IW(this,e.z||0);return[Math.min(n[0][0],n[1][0],n[2][0],n[3][0]),Math.min(n[0][1],n[1][1],n[2][1],n[3][1]),Math.max(n[0][0],n[1][0],n[2][0],n[3][0]),Math.max(n[0][1],n[1][1],n[2][1],n[3][1])]}fitBounds(e,n={}){const{width:r,height:i}=this,{longitude:a,latitude:l,zoom:u}=PW({width:r,height:i,bounds:e,...n});return new Ic({width:r,height:i,longitude:a,latitude:l,zoom:u})}}Ic.displayName="WebMercatorViewport";const L2=[0,0,0];function o0(t,e,n=!1){const r=e.projectPosition(t);if(n&&e instanceof Ic){const[i,a,l=0]=t,u=e.getDistanceScales([i,a]);r[2]=l*u.unitsPerMeter[2]}return r}function _X(t){const{viewport:e,modelMatrix:n,coordinateOrigin:r}=t;let{coordinateSystem:i,fromCoordinateSystem:a,fromCoordinateOrigin:l}=t;return i===cn.DEFAULT&&(i=e.isGeospatial?cn.LNGLAT:cn.CARTESIAN),a===void 0&&(a=i),l===void 0&&(l=r),{viewport:e,coordinateSystem:i,coordinateOrigin:r,modelMatrix:n,fromCoordinateSystem:a,fromCoordinateOrigin:l}}function eO(t,{viewport:e,modelMatrix:n,coordinateSystem:r,coordinateOrigin:i,offsetMode:a}){let[l,u,f=0]=t;switch(n&&([l,u,f]=Kf([],[l,u,f,1],n)),r){case cn.LNGLAT:return o0([l,u,f],e,a);case cn.LNGLAT_OFFSETS:return o0([l+i[0],u+i[1],f+(i[2]||0)],e,a);case cn.METER_OFFSETS:return o0(qM(i,[l,u,f]),e,a);case cn.CARTESIAN:default:return e.isGeospatial?[l+i[0],u+i[1],f+i[2]]:e.projectPosition([l,u,f])}}function yX(t,e){const{viewport:n,coordinateSystem:r,coordinateOrigin:i,modelMatrix:a,fromCoordinateSystem:l,fromCoordinateOrigin:u}=_X(e),{autoOffset:f=!0}=e,{geospatialOrigin:h=L2,shaderCoordinateOrigin:g=L2,offsetMode:m=!1}=f?jM(n,r,i):{},v=eO(t,{viewport:n,modelMatrix:a,coordinateSystem:l,coordinateOrigin:u,offsetMode:m});if(m){const S=n.projectPosition(h||g);xH(v,v,S)}return v}let bX=1,SX=1;class tO{constructor(){M(this,"time",0);M(this,"channels",new Map);M(this,"animations",new Map);M(this,"playing",!1);M(this,"lastEngineTime",-1)}addChannel(e){const{delay:n=0,duration:r=Number.POSITIVE_INFINITY,rate:i=1,repeat:a=1}=e,l=bX++,u={time:0,delay:n,duration:r,rate:i,repeat:a};return this._setChannelTime(u,this.time),this.channels.set(l,u),l}removeChannel(e){this.channels.delete(e);for(const[n,r]of this.animations)r.channel===e&&this.detachAnimation(n)}isFinished(e){const n=this.channels.get(e);return n===void 0?!1:this.time>=n.delay+n.duration*n.repeat}getTime(e){if(e===void 0)return this.time;const n=this.channels.get(e);return n===void 0?-1:n.time}setTime(e){this.time=Math.max(0,e);const n=this.channels.values();for(const i of n)this._setChannelTime(i,this.time);const r=this.animations.values();for(const i of r){const{animation:a,channel:l}=i;a.setTime(this.getTime(l))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,n){const r=SX++;return this.animations.set(r,{animation:e,channel:n}),e.setTime(this.getTime(n)),r}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,n){const r=n-e.delay,i=e.duration*e.repeat;r>=i?e.time=e.duration*e.rate:(e.time=Math.max(0,r)%e.duration,e.time*=e.rate)}}function EX(t){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function wX(t){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}let TX=0;const CX={device:null,onAddHTML:()=>"",onInitialize:async()=>null,onRender:()=>{},onFinalize:()=>{},onError:t=>console.error(t),stats:L_.stats.get(`animation-loop-${TX++}`),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1};class AX{constructor(e){M(this,"device",null);M(this,"canvas",null);M(this,"props");M(this,"animationProps",null);M(this,"timeline",null);M(this,"stats");M(this,"cpuTime");M(this,"gpuTime");M(this,"frameRate");M(this,"display");M(this,"needsRedraw","initialized");M(this,"_initialized",!1);M(this,"_running",!1);M(this,"_animationFrameId",null);M(this,"_nextFramePromise",null);M(this,"_resolveNextFrame",null);M(this,"_cpuStartTime",0);M(this,"_error",null);if(this.props={...CX,...e},e=this.props,!e.device)throw new Error("No device provided");const{useDevicePixels:n=!0}=this.props;this.stats=e.stats||new qg({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:e.autoResizeViewport,autoResizeDrawingBuffer:e.autoResizeDrawingBuffer,useDevicePixels:n}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}destroy(){this.stop(),this._setDisplay(null)}delete(){this.destroy()}setError(e){var r,i;if(this.props.onError(e),this._error=Error(),((i=(r=this.device)==null?void 0:r.canvasContext)==null?void 0:i.canvas)instanceof HTMLCanvasElement){const a=document.createElement("h1");a.innerHTML=e.message,a.style.position="absolute",a.style.top="20%",a.style.left="10px",a.style.color="black",a.style.backgroundColor="red",document.body.appendChild(a)}}setNeedsRedraw(e){return this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.props.autoResizeViewport=e.autoResizeViewport||!1),"autoResizeDrawingBuffer"in e&&(this.props.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer||!1),"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1),this}async start(){if(this._running)return this;this._running=!0;try{let e;return this._initialized||(this._initialized=!0,await this._initDevice(),this._initialize(),await this.props.onInitialize(this._getAnimationProps())),this._running?(e!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),this):null}catch(e){const n=e instanceof Error?e:new Error("Unknown error");throw this.props.onError(n),n}}stop(){return this._running&&(this.animationProps&&!this._error&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this}redraw(){var e;return(e=this.device)!=null&&e.isLost||this._error?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}async toDataURL(){if(this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.canvas instanceof HTMLCanvasElement)return this.canvas.toDataURL();throw new Error("OffscreenCanvas")}_initialize(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_setDisplay(e){this.display&&(this.display.destroy(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_requestAnimationFrame(){this._running&&(this._animationFrameId=EX(this._animationFrame.bind(this)))}_cancelAnimationFrame(){this._animationFrameId!==null&&(wX(this._animationFrameId),this._animationFrameId=null)}_animationFrame(){this._running&&(this.redraw(),this._requestAnimationFrame())}_renderFrame(e){var n;if(this.display){this.display._renderFrame(e);return}this.props.onRender(this._getAnimationProps()),(n=this.device)==null||n.submit()}_clearNeedsRedraw(){this.needsRedraw=!1}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_initializeAnimationProps(){var n,r;const e=(r=(n=this.device)==null?void 0:n.canvasContext)==null?void 0:r.canvas;if(!this.device||!e)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:e,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}}_getAnimationProps(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps}_updateAnimationProps(){if(!this.animationProps)return;const{width:e,height:n,aspect:r}=this._getSizeAndAspect();(e!==this.animationProps.width||n!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),r!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=n,this.animationProps.aspect=r,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}async _initDevice(){var e;if(this.device=await this.props.device,!this.device)throw new Error("No device provided");this.canvas=((e=this.device.canvasContext)==null?void 0:e.canvas)||null}_createInfoDiv(){if(this.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const n=document.createElement("div");n.style.position="absolute",n.style.left="10px",n.style.bottom="10px",n.style.width="300px",n.style.background="white",this.canvas instanceof HTMLCanvasElement&&e.appendChild(this.canvas),e.appendChild(n);const r=this.props.onAddHTML(n);r&&(n.innerHTML=r)}}_getSizeAndAspect(){var a,l,u,f;if(!this.device)return{width:1,height:1,aspect:1};const[e,n]=((l=(a=this.device)==null?void 0:a.canvasContext)==null?void 0:l.getPixelSize())||[1,1];let r=1;const i=(f=(u=this.device)==null?void 0:u.canvasContext)==null?void 0:f.canvas;return i&&i.clientHeight?r=i.clientWidth/i.clientHeight:e>0&&n>0&&(r=e/n),{width:e,height:n,aspect:r}}_resizeViewport(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){var e,n;this.props.autoResizeDrawingBuffer&&((n=(e=this.device)==null?void 0:e.canvasContext)==null||n.resize({useDevicePixels:this.props.useDevicePixels}))}_beginFrameTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()}_endFrameTimers(){this.cpuTime.timeEnd()}_startEventHandling(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))}_onMousemove(e){e instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[e.offsetX,e.offsetY])}_onMouseleave(e){this._getAnimationProps()._mousePosition=null}}const l0={};function Gf(t="id"){l0[t]=l0[t]||1;const e=l0[t]++;return`${t}-${e}`}class z2{constructor(e){M(this,"id");M(this,"userData",{});M(this,"topology");M(this,"bufferLayout",[]);M(this,"vertexCount");M(this,"indices");M(this,"attributes");if(this.id=e.id||Gf("geometry"),this.topology=e.topology,this.indices=e.indices||null,this.attributes=e.attributes,this.vertexCount=e.vertexCount,this.bufferLayout=e.bufferLayout||[],this.indices&&!(this.indices.usage&$n.INDEX))throw new Error("Index buffer must have INDEX usage")}destroy(){var e;(e=this.indices)==null||e.destroy();for(const n of Object.values(this.attributes))n.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices||null}_calculateVertexCount(e){return e.byteLength/12}}function RX(t,e){if(e instanceof z2)return e;const n=xX(t,e),{attributes:r,bufferLayout:i}=MX(t,e);return new z2({topology:e.topology||"triangle-list",bufferLayout:i,vertexCount:e.vertexCount,indices:n,attributes:r})}function xX(t,e){if(!e.indices)return;const n=e.indices.value;return t.createBuffer({usage:$n.INDEX,data:n})}function MX(t,e){const n=[],r={};for(const[a,l]of Object.entries(e.attributes)){let u=a;switch(a){case"POSITION":u="positions";break;case"NORMAL":u="normals";break;case"TEXCOORD_0":u="texCoords";break;case"COLOR_0":u="colors";break}if(l){r[u]=t.createBuffer({data:l.value,id:`${a}-buffer`});const{value:f,size:h,normalized:g}=l;n.push({name:u,format:yV(f,h,g)})}}const i=e._calculateVertexCount(e.attributes,e.indices);return{attributes:r,bufferLayout:n,vertexCount:i}}const Hg=class Hg{constructor(e){M(this,"device");M(this,"destroyPolicy");M(this,"_hashCounter",0);M(this,"_hashes",{});M(this,"_renderPipelineCache",{});M(this,"_computePipelineCache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultPipelineFactory(e){return e._lumaData.defaultPipelineFactory=e._lumaData.defaultPipelineFactory||new Hg(e),e._lumaData.defaultPipelineFactory}createRenderPipeline(e){const n={...Rc.defaultProps,...e},r=this._hashRenderPipeline(n);if(!this._renderPipelineCache[r]){const i=this.device.createRenderPipeline({...n,id:n.id?`${n.id}-cached`:void 0});i.hash=r,this._renderPipelineCache[r]={pipeline:i,useCount:0}}return this._renderPipelineCache[r].useCount++,this._renderPipelineCache[r].pipeline}createComputePipeline(e){const n={...pg.defaultProps,...e},r=this._hashComputePipeline(n);if(!this._computePipelineCache[r]){const i=this.device.createComputePipeline({...n,id:n.id?`${n.id}-cached`:void 0});i.hash=r,this._computePipelineCache[r]={pipeline:i,useCount:0}}return this._computePipelineCache[r].useCount++,this._computePipelineCache[r].pipeline}release(e){const n=e.hash,r=e instanceof pg?this._computePipelineCache:this._renderPipelineCache;r[n].useCount--,r[n].useCount===0&&this.destroyPolicy==="unused"&&(r[n].pipeline.destroy(),delete r[n])}_hashComputePipeline(e){return`${this._getHash(e.shader.source)}`}_hashRenderPipeline(e){const n=e.vs?this._getHash(e.vs.source):0,r=e.fs?this._getHash(e.fs.source):0,i="-",a=this._getHash(JSON.stringify(e.bufferLayout));switch(this.device.type){case"webgl":return`${n}/${r}V${i}BL${a}`;default:const l=this._getHash(JSON.stringify(e.parameters));return`${n}/${r}V${i}T${e.topology}P${l}BL${a}`}}_getHash(e){return this._hashes[e]===void 0&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}};M(Hg,"defaultProps",{...Rc.defaultProps});let ay=Hg;const jg=class jg{constructor(e){M(this,"device");M(this,"destroyPolicy");M(this,"_cache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultShaderFactory(e){var n;return(n=e._lumaData).defaultShaderFactory||(n.defaultShaderFactory=new jg(e)),e._lumaData.defaultShaderFactory}createShader(e){const n=this._hashShader(e);let r=this._cache[n];if(!r){const i=this.device.createShader({...e,id:e.id?`${e.id}-cached`:void 0});this._cache[n]=r={shader:i,useCount:0}}return r.useCount++,r.shader}release(e){const n=this._hashShader(e),r=this._cache[n];r&&(r.useCount--,r.useCount===0&&this.destroyPolicy==="unused"&&(delete this._cache[n],r.shader.destroy()))}_hashShader(e){return`${e.stage}:${e.source}`}};M(jg,"defaultProps",{...dg.defaultProps});let oy=jg;function OX(t,e){var i;const n={},r="Values";if(t.attributes.length===0&&!((i=t.varyings)!=null&&i.length))return{"No attributes or varyings":{[r]:"N/A"}};for(const a of t.attributes)if(a){const l=`${a.location} ${a.name}: ${a.type}`;n[`in ${l}`]={[r]:a.stepMode||"vertex"}}for(const a of t.varyings||[]){const l=`${a.location} ${a.name}`;n[`out ${l}`]={[r]:JSON.stringify(a)}}return n}let yr=null,uo=null;function PX(t,{id:e,minimap:n,opaque:r,top:i="0",left:a="0",rgbaScale:l=1}){yr||(yr=document.createElement("canvas"),yr.id=e,yr.title=e,yr.style.zIndex="100",yr.style.position="absolute",yr.style.top=i,yr.style.left=a,yr.style.border="blue 5px solid",yr.style.transform="scaleY(-1)",document.body.appendChild(yr),uo=yr.getContext("2d")),(yr.width!==t.width||yr.height!==t.height)&&(yr.width=t.width/2,yr.height=t.height/2,yr.style.width="400px",yr.style.height="400px");const u=t.device.readPixelsToArrayWebGL(t),f=uo==null?void 0:uo.createImageData(t.width,t.height);if(f){for(let g=0;g<u.length;g+=4)f.data[0+g+0]=u[g+0]*l,f.data[0+g+1]=u[g+1]*l,f.data[0+g+2]=u[g+2]*l,f.data[0+g+3]=r?255:u[g+3]*l;uo==null||uo.putImageData(f,0,0)}}function ly(t,e,n){if(t===e)return!0;if(!n||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!ly(t[r],e[r],n-1))return!1;return!0}if(Array.isArray(e))return!1;if(typeof t=="object"&&typeof e=="object"){const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(const a of r)if(!e.hasOwnProperty(a)||!ly(t[a],e[a],n-1))return!1;return!0}return!1}function NX(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function IX(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number":!1}function nO(t){return NX(t)||IX(t)}function DX(t){return nO(t)||typeof t=="number"||typeof t=="boolean"}function rO(t){const e={bindings:{},uniforms:{}};return Object.keys(t).forEach(n=>{const r=t[n];DX(r)?e.uniforms[n]=r:e.bindings[n]=r}),e}class FX{constructor(e,n){M(this,"options",{disableWarnings:!1});M(this,"modules");M(this,"moduleUniforms");M(this,"moduleBindings");Object.assign(this.options,n);const r=fb(Object.values(e).filter(i=>i.dependencies));for(const i of r)e[i.name]=i;Re.log(1,"Creating ShaderInputs with modules",Object.keys(e))(),this.modules=e,this.moduleUniforms={},this.moduleBindings={};for(const[i,a]of Object.entries(e))this._addModule(a),a.name&&i!==a.name&&!this.options.disableWarnings&&Re.warn(`Module name: ${i} vs ${a.name}`)()}destroy(){}setProps(e){var n;for(const r of Object.keys(e)){const i=r,a=e[i]||{},l=this.modules[i];if(!l){this.options.disableWarnings||Re.warn(`Module ${r} not found`)();continue}const u=this.moduleUniforms[i],f=this.moduleBindings[i],h=((n=l.getUniforms)==null?void 0:n.call(l,a,u))||a,{uniforms:g,bindings:m}=rO(h);this.moduleUniforms[i]={...u,...g},this.moduleBindings[i]={...f,...m}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindingValues(){const e={};for(const n of Object.values(this.moduleBindings))Object.assign(e,n);return e}getDebugTable(){var n;const e={};for(const[r,i]of Object.entries(this.moduleUniforms))for(const[a,l]of Object.entries(i))e[`${r}.${a}`]={type:(n=this.modules[r].uniformTypes)==null?void 0:n[a],value:String(l)};return e}_addModule(e){const n=e.name;this.moduleUniforms[n]=e.defaultUniforms||{},this.moduleBindings[n]={}}}let kX="";async function BX(t,e){const n=new Image;return n.crossOrigin="anonymous",n.src=t.startsWith("http")?t:kX+t,await n.decode(),e?await createImageBitmap(n,e):await createImageBitmap(n)}class c0{constructor(e,n){M(this,"device");M(this,"id");M(this,"texture");M(this,"sampler");M(this,"view");M(this,"ready");M(this,"isReady",!1);M(this,"destroyed",!1);M(this,"resolveReady",()=>{});M(this,"rejectReady",()=>{});this.device=e,this.id=n.id||Gf("async-texture"),typeof(n==null?void 0:n.data)=="string"&&n.dimension==="2d"&&(n={...n,data:BX(n.data)}),this.ready=new Promise((r,i)=>{this.resolveReady=()=>{this.isReady=!0,r()},this.rejectReady=i}),this.initAsync(n)}get[Symbol.toStringTag](){return"AsyncTexture"}toString(){return`AsyncTexture:"${this.id}"(${this.isReady?"ready":"loading"})`}async initAsync(e){let n,r;const i=e.data,a=await iO(i).then(n,r);if(this.destroyed)return;const l={...e,data:a};this.texture=this.device.createTexture(l),this.sampler=this.texture.sampler,this.view=this.texture.view,this.isReady=!0}destroy(){this.texture&&(this.texture.destroy(),this.texture=null),this.destroyed=!0}resize(e){if(!this.isReady)throw new Error("Cannot resize texture before it is ready");if(e.width===this.texture.width&&e.height===this.texture.height)return!1;if(this.texture){const n=this.texture;this.texture=n.clone(e),n.destroy()}return!0}}async function iO(t){if(t=await t,Array.isArray(t))return await Promise.all(t.map(iO));if(t&&typeof t=="object"&&t.constructor===Object){const e=t,n=await Promise.all(Object.values(e)),r=Object.keys(e),i={};for(let a=0;a<r.length;a++)i[r[a]]=n[a];return i}return t}const fo=2,UX=1e4,Wg=class Wg{constructor(e,n){M(this,"device");M(this,"id");M(this,"source");M(this,"vs");M(this,"fs");M(this,"pipelineFactory");M(this,"shaderFactory");M(this,"userData",{});M(this,"parameters");M(this,"topology");M(this,"bufferLayout");M(this,"isInstanced");M(this,"instanceCount",0);M(this,"vertexCount");M(this,"indexBuffer",null);M(this,"bufferAttributes",{});M(this,"constantAttributes",{});M(this,"bindings",{});M(this,"uniforms",{});M(this,"vertexArray");M(this,"transformFeedback",null);M(this,"pipeline");M(this,"shaderInputs");M(this,"_uniformStore");M(this,"_attributeInfos",{});M(this,"_gpuGeometry",null);M(this,"_getModuleUniforms");M(this,"props");M(this,"_pipelineNeedsUpdate","newly created");M(this,"_needsRedraw","initializing");M(this,"_destroyed",!1);M(this,"_lastDrawTimestamp",-1);M(this,"_lastLogTime",0);M(this,"_logOpen",!1);M(this,"_drawCount",0);var f,h,g,m;this.props={...Wg.defaultProps,...n},n=this.props,this.id=n.id||Gf("model"),this.device=e,Object.assign(this.userData,n.userData);const r=Object.fromEntries(((f=this.props.modules)==null?void 0:f.map(v=>[v.name,v]))||[]),i=n.shaderInputs||new FX(r,{disableWarnings:this.props.disableWarnings});this.setShaderInputs(i);const a=zX(e),l=(((h=this.props.modules)==null?void 0:h.length)>0?this.props.modules:(g=this.shaderInputs)==null?void 0:g.getModules())||[];if(this.device.type==="webgpu"&&this.props.source){(m=this.props).shaderLayout||(m.shaderLayout=rH(this.props.source));const{source:v,getUniforms:S}=this.props.shaderAssembler.assembleWGSLShader({platformInfo:a,...this.props,modules:l});this.source=v,this._getModuleUniforms=S}else{const{vs:v,fs:S,getUniforms:w}=this.props.shaderAssembler.assembleGLSLShaderPair({platformInfo:a,...this.props,modules:l});this.vs=v,this.fs=S,this._getModuleUniforms=w}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,n.geometry&&this.setGeometry(n.geometry),this.pipelineFactory=n.pipelineFactory||ay.getDefaultPipelineFactory(this.device),this.shaderFactory=n.shaderFactory||oy.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=e.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),"isInstanced"in n&&(this.isInstanced=n.isInstanced),n.instanceCount&&this.setInstanceCount(n.instanceCount),n.vertexCount&&this.setVertexCount(n.vertexCount),n.indexBuffer&&this.setIndexBuffer(n.indexBuffer),n.attributes&&this.setAttributes(n.attributes),n.constantAttributes&&this.setConstantAttributes(n.constantAttributes),n.bindings&&this.setBindings(n.bindings),n.uniforms&&this.setUniformsWebGL(n.uniforms),n.moduleSettings&&this.updateModuleSettingsWebGL(n.moduleSettings),n.transformFeedback&&(this.transformFeedback=n.transformFeedback),Object.seal(this)}get[Symbol.toStringTag](){return"Model"}toString(){return`Model(${this.id})`}destroy(){var e;this._destroyed||(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),(e=this._gpuGeometry)==null||e.destroy(),this._destroyed=!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw("contents of bound textures or buffers updated");const e=this._needsRedraw;return this._needsRedraw=!1,e}setNeedsRedraw(e){this._needsRedraw||(this._needsRedraw=e)}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(e){const n=this._areBindingsLoading();if(n)return Re.info(fo,`>>> DRAWING ABORTED ${this.id}: ${n} not loaded`)(),!1;try{e.pushDebugGroup(`${this}.predraw(${e})`),this.predraw()}finally{e.popDebugGroup()}let r;try{e.pushDebugGroup(`${this}.draw(${e})`),this._logDrawCallStart(),this.pipeline=this._updatePipeline();const i=this._getBindings();this.pipeline.setBindings(i,{disableWarnings:this.props.disableWarnings}),cy(this.uniforms)||this.pipeline.setUniformsWebGL(this.uniforms);const{indexBuffer:a}=this.vertexArray,l=a?a.byteLength/(a.indexType==="uint32"?4:2):void 0;r=this.pipeline.draw({renderPass:e,vertexArray:this.vertexArray,isInstanced:this.isInstanced,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:l,transformFeedback:this.transformFeedback||void 0,parameters:this.parameters,topology:this.topology})}finally{e.popDebugGroup(),this._logDrawCallEnd()}return this._logFramebuffer(e),r?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):this._needsRedraw="waiting for resource initialization",r}setGeometry(e){var r;(r=this._gpuGeometry)==null||r.destroy();const n=e&&RX(this.device,e);if(n){this.setTopology(n.topology||"triangle-list");const i=new Zv(this.bufferLayout);this.bufferLayout=i.mergeBufferLayouts(n.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(n)}this._gpuGeometry=n}setTopology(e){e!==this.topology&&(this.topology=e,this._setPipelineNeedsUpdate("topology"))}setBufferLayout(e){const n=new Zv(this.bufferLayout);this.bufferLayout=this._gpuGeometry?n.mergeBufferLayouts(e,this._gpuGeometry.bufferLayout):e,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(e){ly(e,this.parameters,2)||(this.parameters=e,this._setPipelineNeedsUpdate("parameters"))}setInstanceCount(e){this.instanceCount=e,this.isInstanced===void 0&&e>0&&(this.isInstanced=!0),this.setNeedsRedraw("instanceCount")}setVertexCount(e){this.vertexCount=e,this.setNeedsRedraw("vertexCount")}setShaderInputs(e){this.shaderInputs=e,this._uniformStore=new _V(this.shaderInputs.modules);for(const[n,r]of Object.entries(this.shaderInputs.modules))if(LX(r)){const i=this._uniformStore.getManagedUniformBuffer(this.device,n);this.bindings[`${n}Uniforms`]=i}this.setNeedsRedraw("shaderInputs")}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setBindings(this.shaderInputs.getBindingValues()),this.setNeedsRedraw("shaderInputs")}setBindings(e){Object.assign(this.bindings,e),this.setNeedsRedraw("bindings")}setTransformFeedback(e){this.transformFeedback=e,this.setNeedsRedraw("transformFeedback")}setIndexBuffer(e){this.vertexArray.setIndexBuffer(e),this.setNeedsRedraw("indexBuffer")}setAttributes(e,n){const r=(n==null?void 0:n.disableWarnings)??this.props.disableWarnings;e.indices&&Re.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)();const i=new Zv(this.bufferLayout);for(const[a,l]of Object.entries(e)){const u=i.getBufferLayout(a);if(!u){r||Re.warn(`Model(${this.id}): Missing layout for buffer "${a}".`)();continue}const f=i.getAttributeNamesForBuffer(u);let h=!1;for(const g of f){const m=this._attributeInfos[g];m&&(this.vertexArray.setBuffer(m.location,l),h=!0)}!h&&!r&&Re.warn(`Model(${this.id}): Ignoring buffer "${l.id}" for unknown attribute "${a}"`)()}this.setNeedsRedraw("attributes")}setConstantAttributes(e,n){for(const[r,i]of Object.entries(e)){const a=this._attributeInfos[r];a?this.vertexArray.setConstantWebGL(a.location,i):((n==null?void 0:n.disableWarnings)??this.props.disableWarnings)||Re.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${r}"`)()}this.setNeedsRedraw("constants")}setUniforms(e){this.setUniformsWebGL(e)}setUniformsWebGL(e){cy(e)||(this.pipeline.setUniformsWebGL(e),Object.assign(this.uniforms,e)),this.setNeedsRedraw("uniforms")}updateModuleSettingsWebGL(e){const{bindings:n,uniforms:r}=rO(this._getModuleUniforms(e));Object.assign(this.bindings,n),Object.assign(this.uniforms,r),this.setNeedsRedraw("moduleSettings")}_areBindingsLoading(){for(const e of Object.values(this.bindings))if(e instanceof c0&&!e.isReady)return e.id;return!1}_getBindings(){const e={};for(const[n,r]of Object.entries(this.bindings))r instanceof c0?r.isReady&&(e[n]=r.texture):e[n]=r;return e}_getBindingsUpdateTimestamp(){let e=0;for(const n of Object.values(this.bindings))n instanceof fg?e=Math.max(e,n.texture.updateTimestamp):n instanceof $n||n instanceof Kn?e=Math.max(e,n.updateTimestamp):n instanceof c0?e=n.texture?Math.max(e,n.texture.updateTimestamp):1/0:n instanceof hg||(e=Math.max(e,n.buffer.updateTimestamp));return e}_setGeometryAttributes(e){const n={...e.attributes};for(const[r]of Object.entries(n))!this.pipeline.shaderLayout.attributes.find(i=>i.name===r)&&r!=="positions"&&delete n[r];this.vertexCount=e.vertexCount,this.setIndexBuffer(e.indices||null),this.setAttributes(e.attributes,{disableWarnings:!0}),this.setAttributes(n,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw("geometry attributes")}_setPipelineNeedsUpdate(e){this._pipelineNeedsUpdate||(this._pipelineNeedsUpdate=e),this.setNeedsRedraw(e)}_updatePipeline(){if(this._pipelineNeedsUpdate){let e=null,n=null;this.pipeline&&(Re.log(1,`Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)(),e=this.pipeline.vs,n=this.pipeline.fs),this._pipelineNeedsUpdate=!1;const r=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:"vertex",source:this.source||this.vs,debugShaders:this.props.debugShaders});let i=null;this.source?i=r:this.fs&&(i=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:"fragment",source:this.source||this.fs,debugShaders:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,bindings:this._getBindings(),vs:r,fs:i}),this._attributeInfos=uM(this.pipeline.shaderLayout,this.bufferLayout),e&&this.shaderFactory.release(e),n&&this.shaderFactory.release(n)}return this.pipeline}_logDrawCallStart(){const e=Re.level>3?0:UX;Re.level<2||Date.now()-this._lastLogTime<e||(this._lastLogTime=Date.now(),this._logOpen=!0,Re.group(fo,`>>> DRAWING MODEL ${this.id}`,{collapsed:Re.level<=2})())}_logDrawCallEnd(){if(this._logOpen){const e=OX(this.pipeline.shaderLayout,this.id);Re.table(fo,e)();const n=this.shaderInputs.getDebugTable();for(const[i,a]of Object.entries(this.uniforms))n[i]={value:a};Re.table(fo,n)();const r=this._getAttributeDebugTable();Re.table(fo,this._attributeInfos)(),Re.table(fo,r)(),Re.groupEnd(fo)(),this._logOpen=!1}}_logFramebuffer(e){const n=this.device.props.debugFramebuffers;if(this._drawCount++,!n)return;const r=e.props.framebuffer;r&&PX(r,{id:r.id,minimap:!0})}_getAttributeDebugTable(){const e={};for(const[n,r]of Object.entries(this._attributeInfos)){const i=this.vertexArray.attributes[r.location];e[r.location]={name:n,type:r.shaderType,values:i?this._getBufferOrConstantValues(i,r.bufferDataType):"null"}}if(this.vertexArray.indexBuffer){const{indexBuffer:n}=this.vertexArray,r=n.indexType==="uint32"?new Uint32Array(n.debugData):new Uint16Array(n.debugData);e.indices={name:"indices",type:n.indexType,values:r.toString()}}return e}_getBufferOrConstantValues(e,n){const r=hM(n);return(e instanceof $n?new r(e.debugData):e).toString()}};M(Wg,"defaultProps",{...Rc.defaultProps,source:void 0,vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],isInstanced:void 0,instanceCount:0,vertexCount:0,shaderInputs:void 0,pipelineFactory:void 0,shaderFactory:void 0,transformFeedback:void 0,shaderAssembler:ug.getDefaultShaderAssembler(),debugShaders:void 0,disableWarnings:void 0});let $o=Wg;function LX(t){return!!(t.uniformTypes&&!cy(t.uniformTypes))}function zX(t){return{type:t.type,shaderLanguage:t.info.shadingLanguage,shaderLanguageVersion:t.info.shadingLanguageVersion,gpu:t.info.gpu,features:t.features}}function cy(t){for(const e in t)return!1;return!0}const ff=class ff{constructor(e,n=ff.defaultProps){M(this,"device");M(this,"model");M(this,"transformFeedback");if(!ff.isSupported(e))throw new Error("BufferTransform not yet implemented on WebGPU");this.device=e,this.model=new $o(this.device,{id:n.id||"buffer-transform-model",fs:n.fs||S$(),topology:n.topology||"point-list",varyings:n.outputs||n.varyings,...n}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:n.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}static isSupported(e){var n;return((n=e==null?void 0:e.info)==null?void 0:n.type)==="webgl"}destroy(){this.model&&this.model.destroy()}delete(){this.destroy()}run(e){e!=null&&e.inputBuffers&&this.model.setAttributes(e.inputBuffers),e!=null&&e.outputBuffers&&this.transformFeedback.setBuffers(e.outputBuffers);const n=this.device.beginRenderPass(e);this.model.draw(n),n.end()}getBuffer(e){return this.transformFeedback.getBuffer(e)}readAsync(e){const n=this.getBuffer(e);if(!n)throw new Error("BufferTransform#getBuffer");if(n instanceof $n)return n.readAsync();const{buffer:r,byteOffset:i=0,byteLength:a=r.byteLength}=n;return r.readAsync(i,a)}};M(ff,"defaultProps",{...$o.defaultProps,outputs:void 0,feedbackBuffers:void 0});let If=ff;class _b{constructor(e){M(this,"id");M(this,"topology");M(this,"vertexCount");M(this,"indices");M(this,"attributes");M(this,"userData",{});const{attributes:n={},indices:r=null,vertexCount:i=null}=e;this.id=e.id||Gf("geometry"),this.topology=e.topology,r&&(this.indices=ArrayBuffer.isView(r)?{value:r,size:1}:r),this.attributes={};for(const[a,l]of Object.entries(n)){const u=ArrayBuffer.isView(l)?{value:l}:l;if(!ArrayBuffer.isView(u.value))throw new Error(`${this._print(a)}: must be typed array or object with value as typed array`);if((a==="POSITION"||a==="positions")&&!u.size&&(u.size=3),a==="indices"){if(this.indices)throw new Error("Multiple indices detected");this.indices=u}else this.attributes[a]=u}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=i||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,n){return this}_calculateVertexCount(e,n){if(n)return n.value.length;let r=1/0;for(const i of Object.values(e)){const{value:a,size:l,constant:u}=i;!u&&a&&l!==void 0&&l>=1&&(r=Math.min(r,a.length/l))}return r}}class $X extends _b{constructor(e={}){const{id:n=Gf("cube-geometry"),indices:r=!0}=e;super(r?{...e,id:n,topology:"triangle-list",indices:{size:1,value:VX},attributes:{...KX,...e.attributes}}:{...e,id:n,topology:"triangle-list",indices:void 0,attributes:{...ZX,...e.attributes}})}}const VX=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),HX=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),jX=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),WX=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),XX=new Float32Array([1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1]),qX=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),YX=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),KX={POSITION:{size:3,value:HX},NORMAL:{size:3,value:jX},TEXCOORD_0:{size:2,value:WX}},ZX={POSITION:{size:3,value:XX},TEXCOORD_0:{size:2,value:qX},COLOR_0:{size:3,value:YX}},QX={blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"zero",blendAlphaOperation:"add",blendAlphaSrcFactor:"constant-alpha",blendAlphaDstFactor:"zero"};class sO extends vb{constructor(){super(...arguments),this._colorEncoderState=null}render(e){return"pickingFBO"in e?this._drawPickingBuffer(e):super.render(e)}_drawPickingBuffer({layers:e,layerFilter:n,views:r,viewports:i,onViewportActive:a,pickingFBO:l,deviceRect:{x:u,y:f,width:h,height:g},cullRect:m,effects:v,pass:S="picking",pickZ:w,shaderModuleProps:E}){this.pickZ=w;const b=this._resetColorEncoder(w),C=[u,f,h,g],T=super.render({target:l,layers:e,layerFilter:n,views:r,viewports:i,onViewportActive:a,cullRect:m,effects:v==null?void 0:v.filter(O=>O.useInPicking),pass:S,isPicking:!0,shaderModuleProps:E,clearColor:[0,0,0,0],colorMask:15,scissorRect:C});return this._colorEncoderState=null,{decodePickingColor:b&&JX.bind(null,b),stats:T}}shouldDrawLayer(e){const{pickable:n,operation:r}=e.props;return n&&r.includes("draw")||r.includes("terrain")||r.includes("mask")}getShaderModuleProps(e,n,r){return{picking:{isActive:1,isAttribute:this.pickZ},lighting:{enabled:!1}}}getLayerParameters(e,n,r){const i={...e.props.parameters},{pickable:a,operation:l}=e.props;return!this._colorEncoderState||l.includes("terrain")?i.blend=!1:a&&l.includes("draw")&&(Object.assign(i,QX),i.blend=!0,i.blendColor=GX(this._colorEncoderState,e,r)),i}_resetColorEncoder(e){return this._colorEncoderState=e?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}}function GX(t,e,n){const{byLayer:r,byAlpha:i}=t;let a,l=r.get(e);return l?(l.viewports.push(n),a=l.a):(a=r.size+1,a<=255?(l={a,layer:e,viewports:[n]},r.set(e,l),i[a]=l):(Sn.warn("Too many pickable layers, only picking the first 255")(),a=0)),[0,0,0,a/255]}function JX(t,e){const n=t.byAlpha[e[3]];return n&&{pickedLayer:n.layer,pickedViewports:n.viewports,pickedObjectIndex:n.layer.decodePickingColor(e)}}const Vl={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},Cg=Symbol.for("component"),Fo=Symbol.for("propTypes"),u0=Symbol.for("deprecatedProps"),ic=Symbol.for("asyncPropDefaults"),Vo=Symbol.for("asyncPropOriginal"),ka=Symbol.for("asyncPropResolved");function aO(t,e=()=>!0){return Array.isArray(t)?oO(t,e,[]):e(t)?[t]:[]}function oO(t,e,n){let r=-1;for(;++r<t.length;){const i=t[r];Array.isArray(i)?oO(i,e,n):e(i)&&n.push(i)}return n}function eq({target:t,source:e,start:n=0,count:r=1}){const i=e.length,a=r*i;let l=0;for(let u=n;l<i;l++)t[u++]=e[l];for(;l<a;)l<a-l?(t.copyWithin(n+l,n,n+l),l*=2):(t.copyWithin(n+l,n,n+a-l),l=a);return t}class tq{constructor(e,n,r){this._loadCount=0,this._subscribers=new Set,this.id=e,this.context=r,this.setData(n)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,n){if(e===this._data&&!n)return;this._data=e;const r=++this._loadCount;let i=e;typeof e=="string"&&(i=jh(e)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then(a=>{this._loadCount===r&&(this.isLoaded=!0,this._error=void 0,this._content=a)}).catch(a=>{this._loadCount===r&&(this.isLoaded=!0,this._error=a||!0)})):(this.isLoaded=!0,this._error=void 0,this._content=e);for(const a of this._subscribers)a.onChange(this.getData())}}class nq{constructor(e){var n;this.protocol=e.protocol||"resource://",this._context={device:e.device,gl:(n=e.device)==null?void 0:n.gl,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return e.startsWith(this.protocol)?!0:e in this._resources}add({resourceId:e,data:n,forceUpdate:r=!1,persistent:i=!0}){let a=this._resources[e];a?a.setData(n,r):(a=new tq(e,n,this._context),this._resources[e]=a),a.persistent=i}remove(e){const n=this._resources[e];n&&(n.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const n=this._consumers[e];if(n){for(const r in n){const i=n[r],a=this._resources[i.resourceId];a&&a.unsubscribe(i)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:n,consumerId:r,requestId:i="default"}){const{_resources:a,protocol:l}=this;e.startsWith(l)&&(e=e.replace(l,""),a[e]||this.add({resourceId:e,data:null,persistent:!1}));const u=a[e];if(this._track(r,i,u,n),u)return u.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,n,r,i){const a=this._consumers,l=a[e]=a[e]||{};let u=l[n];const f=u&&u.resourceId&&this._resources[u.resourceId];f&&(f.unsubscribe(u),this.prune()),r&&(u?(u.onChange=i,u.resourceId=r.id):u={onChange:i,resourceId:r.id},l[n]=u,r.subscribe(u))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const n=this._resources[e];!n.persistent&&!n.inUse()&&(n.delete(),delete this._resources[e])}}}const rq="layerManager.setLayers",iq="layerManager.activateViewport";class sq{constructor(e,n){this._lastRenderedLayers=[],this._needsRedraw=!1,this._needsUpdate=!1,this._nextLayers=null,this._debug=!1,this._defaultShaderModulesChanged=!1,this.activateViewport=u=>{Hr(iq,this,u),u&&(this.context.viewport=u)};const{deck:r,stats:i,viewport:a,timeline:l}=n||{};this.layers=[],this.resourceManager=new nq({device:e,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,device:e,gl:e==null?void 0:e.gl,deck:r,shaderAssembler:KW(),defaultShaderModules:[hj],renderPass:void 0,stats:i||new qg({id:"deck.gl"}),viewport:a||new Qf({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:l||new tO,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let n=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const r of this.layers){const i=r.getNeedsRedraw(e);n=n||i}return n}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._defaultShaderModulesChanged?"shader modules changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e}={}){return e?this.layers.filter(n=>e.find(r=>n.id.indexOf(r)===0)):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,n){Hr(rq,this,n,e),this._lastRenderedLayers=e;const r=aO(e,Boolean);for(const i of r)i.context=this.context;this._updateLayers(this.layers,r)}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw(`updating layers: ${e}`),this.setLayers(this._nextLayers||this._lastRenderedLayers,e)),this._nextLayers=null}addDefaultShaderModule(e){const{defaultShaderModules:n}=this.context;n.find(r=>r.name===e.name)||(n.push(e),this._defaultShaderModulesChanged=!0)}removeDefaultShaderModule(e){const{defaultShaderModules:n}=this.context,r=n.findIndex(i=>i.name===e.name);r>=0&&(n.splice(r,1),this._defaultShaderModulesChanged=!0)}_handleError(e,n,r){r.raiseError(n,`${e} of ${r}`)}_updateLayers(e,n){const r={};for(const l of e)r[l.id]?Sn.warn(`Multiple old layers with same id ${l.id}`)():r[l.id]=l;if(this._defaultShaderModulesChanged){for(const l of e)l.setNeedsUpdate(),l.setChangeFlags({extensionsChanged:!0});this._defaultShaderModulesChanged=!1}const i=[];this._updateSublayersRecursively(n,r,i),this._finalizeOldLayers(r);let a=!1;for(const l of i)if(l.hasUniformTransition()){a=`Uniform transition in ${l}`;break}this._needsUpdate=a,this.layers=i}_updateSublayersRecursively(e,n,r){for(const i of e){i.context=this.context;const a=n[i.id];a===null&&Sn.warn(`Multiple new layers with same id ${i.id}`)(),n[i.id]=null;let l=null;try{this._debug&&a!==i&&i.validateProps(),a?(this._transferLayerState(a,i),this._updateLayer(i)):this._initializeLayer(i),r.push(i),l=i.isComposite?i.getSubLayers():null}catch(u){this._handleError("matching",u,i)}l&&this._updateSublayersRecursively(l,n,r)}}_finalizeOldLayers(e){for(const n in e){const r=e[n];r&&this._finalizeLayer(r)}}_initializeLayer(e){try{e._initialize(),e.lifecycle=Vl.INITIALIZED}catch(n){this._handleError("initialization",n,e)}}_transferLayerState(e,n){n._transferState(e),n.lifecycle=Vl.MATCHED,n!==e&&(e.lifecycle=Vl.AWAITING_GC)}_updateLayer(e){try{e._update()}catch(n){this._handleError("update",n,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||`finalized ${e}`,e.lifecycle=Vl.AWAITING_FINALIZATION;try{e._finalize(),e.lifecycle=Vl.FINALIZED}catch(n){this._handleError("finalization",n,e)}}}function Gi(t,e,n){if(t===e)return!0;if(!n||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!Gi(t[r],e[r],n-1))return!1;return!0}if(Array.isArray(e))return!1;if(typeof t=="object"&&typeof e=="object"){const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(const a of r)if(!e.hasOwnProperty(a)||!Gi(t[a],e[a],n-1))return!1;return!0}return!1}class aq{constructor(e){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="First render",this._needsUpdate="Initialize",this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers){const n=this.controllers[e];n&&n.finalize()}this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const n=this.controllers[e];n&&n.updateTransition()}}getViewports(e){return e?this._viewports.filter(n=>n.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(n=>{e[n.id]=n}),e}getView(e){return this.views.find(n=>n.id===e)}getViewState(e){const n=typeof e=="string"?this.getView(e):e,r=n&&this.viewState[n.getViewStateId()]||this.viewState;return n?n.filterViewState(r):r}getViewport(e){return this._viewportMap[e]}unproject(e,n){const r=this.getViewports(),i={x:e[0],y:e[1]};for(let a=r.length-1;a>=0;--a){const l=r[a];if(l.containsPixel(i)){const u=e.slice();return u[0]-=l.x,u[1]-=l.y,l.unproject(u,n)}}return null}setProps(e){e.views&&this._setViews(e.views),e.viewState&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,n){(e!==this.width||n!==this.height)&&(this.width=e,this.height=n,this.setNeedsUpdate("Size changed"))}_setViews(e){e=aO(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!Gi(e,this.viewState,3)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Sn.warn("missing `viewState` or `initialViewState`")()}_createController(e,n){const r=n.type;return new r({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._eventCallbacks.onViewStateChange,onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:a=>{var l;return(l=this.getView(e.id))==null?void 0:l.makeViewport({viewState:a,width:this.width,height:this.height})}})}_updateController(e,n,r,i){const a=e.controller;if(a&&r){const l={...n,...a,id:e.id,x:r.x,y:r.y,width:r.width,height:r.height};return(!i||i.constructor!==a.type)&&(i=this._createController(e,l)),i&&i.setProps(l),i}return null}_rebuildViewports(){const{views:e}=this,n=this.controllers;this._viewports=[],this.controllers={};let r=!1;for(let i=e.length;i--;){const a=e[i],l=this.getViewState(a),u=a.makeViewport({viewState:l,width:this.width,height:this.height});let f=n[a.id];const h=!!a.controller;h&&!f&&(r=!0),(r||!h)&&f&&(f.finalize(),f=null),this.controllers[a.id]=this._updateController(a,l,u,f),u&&this._viewports.unshift(u)}for(const i in n){const a=n[i];a&&!this.controllers[i]&&a.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,n){return e.length!==n.length?!0:e.some((r,i)=>!e[i].equals(n[i]))}}const oq=/([0-9]+\.?[0-9]*)(%|px)/;function ma(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=oq.exec(t);if(e&&e.length>=3){const n=e[2]==="%",r=parseFloat(e[1]);return{position:n?r/100:r,relative:n}}default:throw new Error(`Could not parse position string ${t}`)}}function va(t,e){return t.relative?Math.round(t.position*e):t.position}class Dc{constructor(e){const{id:n,x:r=0,y:i=0,width:a="100%",height:l="100%",padding:u=null}=e;this.id=n||this.constructor.displayName||"view",this.props={...e,id:this.id},this._x=ma(r),this._y=ma(i),this._width=ma(a),this._height=ma(l),this._padding=u&&{left:ma(u.left||0),right:ma(u.right||0),top:ma(u.top||0),bottom:ma(u.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e?!0:this.constructor===e.constructor&&Gi(this.props,e.props,2)}makeViewport({width:e,height:n,viewState:r}){r=this.filterViewState(r);const i=this.getDimensions({width:e,height:n});if(!i.height||!i.width)return null;const a=this.getViewportType(r);return new a({...r,...this.props,...i})}getViewStateId(){const{viewState:e}=this.props;return typeof e=="string"?e:(e==null?void 0:e.id)||this.id}filterViewState(e){if(this.props.viewState&&typeof this.props.viewState=="object"){if(!this.props.viewState.id)return this.props.viewState;const n={...e};for(const r in this.props.viewState)r!=="id"&&(n[r]=this.props.viewState[r]);return n}return e}getDimensions({width:e,height:n}){const r={x:va(this._x,e),y:va(this._y,n),width:va(this._width,e),height:va(this._height,n)};return this._padding&&(r.padding={left:va(this._padding.left,e),top:va(this._padding.top,n),right:va(this._padding.right,e),bottom:va(this._padding.bottom,n)}),r}get controller(){const e=this.props.controller;return e?e===!0?{type:this.ControllerType}:typeof e=="function"?{type:e}:{type:this.ControllerType,...e}:null}}class cp{constructor(e){this._inProgress=!1,this._handle=null,this.time=0,this.settings={duration:0},this._timeline=e}get inProgress(){return this._inProgress}start(e){var n,r;this.cancel(),this.settings=e,this._inProgress=!0,(r=(n=this.settings).onStart)==null||r.call(n,this)}end(){var e,n;this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,(n=(e=this.settings).onEnd)==null||n.call(e,this))}cancel(){var e,n;this._inProgress&&((n=(e=this.settings).onInterrupt)==null||n.call(e,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){var e,n;if(!this._inProgress)return!1;if(this._handle===null){const{_timeline:r,settings:i}=this;this._handle=r.addChannel({delay:r.getTime(),duration:i.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),(n=(e=this.settings).onUpdate)==null||n.call(e,this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const $2=()=>{},uy={BREAK:1,SNAP_TO_END:2,IGNORE:3},lq=t=>t,cq=uy.BREAK;class uq{constructor(e){this._onTransitionUpdate=n=>{const{time:r,settings:{interpolator:i,startProps:a,endProps:l,duration:u,easing:f}}=n,h=f(r/u),g=i.interpolateProps(a,l,h);this.propsInTransition=this.getControllerState({...this.props,...g}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})},this.getControllerState=e.getControllerState,this.propsInTransition=null,this.transition=new cp(e.timeline),this.onViewStateChange=e.onViewStateChange||$2,this.onStateChange=e.onStateChange||$2}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let n=!1;const r=this.props;if(this.props=e,!r||this._shouldIgnoreViewportChange(r,e))return!1;if(this._isTransitionEnabled(e)){let i=r;if(this.transition.inProgress){const{interruption:a,endProps:l}=this.transition.settings;i={...r,...a===uy.SNAP_TO_END?l:this.propsInTransition||r}}this._triggerTransition(i,e),n=!0}else this.transition.cancel();return n}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:n,transitionInterpolator:r}=e;return(n>0||n==="auto")&&!!r}_isUpdateDueToCurrentTransition(e){return this.transition.inProgress&&this.propsInTransition?this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition):!1}_shouldIgnoreViewportChange(e,n){return this.transition.inProgress?this.transition.settings.interruption===uy.IGNORE||this._isUpdateDueToCurrentTransition(n):this._isTransitionEnabled(n)?n.transitionInterpolator.arePropsEqual(e,n):!0}_triggerTransition(e,n){const r=this.getControllerState(e),i=this.getControllerState(n).shortestPathFrom(r),a=n.transitionInterpolator,l=a.getDuration?a.getDuration(e,n):n.transitionDuration;if(l===0)return;const u=a.initializeProps(e,i);this.propsInTransition={};const f={duration:l,easing:n.transitionEasing||lq,interpolator:a,interruption:n.transitionInterruption||cq,startProps:u.start,endProps:u.end,onStart:n.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(n.onTransitionInterrupt),onEnd:this._onTransitionEnd(n.onTransitionEnd)};this.transition.start(f),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return n=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e==null||e(n)}}}function Fr(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}class fq{constructor(e){const{compare:n,extract:r,required:i}=e;this._propsToCompare=n,this._propsToExtract=r||n,this._requiredProps=i}arePropsEqual(e,n){for(const r of this._propsToCompare)if(!(r in e)||!(r in n)||!Of(e[r],n[r]))return!1;return!0}initializeProps(e,n){const r={},i={};for(const a of this._propsToExtract)(a in e||a in n)&&(r[a]=e[a],i[a]=n[a]);return this._checkRequiredProps(r),this._checkRequiredProps(i),{start:r,end:i}}getDuration(e,n){return n.transitionDuration}_checkRequiredProps(e){this._requiredProps&&this._requiredProps.forEach(n=>{const r=e[n];Fr(Number.isFinite(r)||Array.isArray(r),`${n} is required for transition`)})}}const dq=["longitude","latitude","zoom","bearing","pitch"],hq=["longitude","latitude","zoom"];class lO extends fq{constructor(e={}){const n=Array.isArray(e)?e:e.transitionProps,r=Array.isArray(e)?{}:e;r.transitionProps=Array.isArray(n)?{compare:n,required:n}:n||{compare:dq,required:hq},super(r.transitionProps),this.opts=r}initializeProps(e,n){const r=super.initializeProps(e,n),{makeViewport:i,around:a}=this.opts;if(i&&a){const l=i(e),u=i(n),f=l.unproject(a);r.start.around=a,Object.assign(r.end,{around:u.project(f),aroundPosition:f,width:n.width,height:n.height})}return r}interpolateProps(e,n,r){const i={};for(const a of this._propsToExtract)i[a]=yg(e[a]||0,n[a]||0,r);if(n.aroundPosition&&this.opts.makeViewport){const a=this.opts.makeViewport({...n,...i});Object.assign(i,a.panByPosition(n.aroundPosition,yg(e.around,n.around,r)))}return i}}const _a={transitionDuration:0},gq=300,Th=t=>1-(1-t)*(1-t),$l={WHEEL:["wheel"],PAN:["panstart","panmove","panend"],PINCH:["pinchstart","pinchmove","pinchend"],MULTI_PAN:["multipanstart","multipanmove","multipanend"],DOUBLE_CLICK:["dblclick"],KEYBOARD:["keydown"]},ho={};class pq{constructor(e){this.state={},this._events={},this._interactionState={isDragging:!1},this._customEvents=[],this._eventStartBlocked=null,this._panMove=!1,this.invertPan=!1,this.dragMode="rotate",this.inertia=0,this.scrollZoom=!0,this.dragPan=!0,this.dragRotate=!0,this.doubleClickZoom=!0,this.touchZoom=!0,this.touchRotate=!1,this.keyboard=!0,this.transitionManager=new uq({...e,getControllerState:n=>new this.ControllerState(n),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=e.eventManager,this.onViewStateChange=e.onViewStateChange||(()=>{}),this.onStateChange=e.onStateChange||(()=>{}),this.makeViewport=e.makeViewport}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.props&&this.setProps(this.props)}finalize(){var e;for(const n in this._events)this._events[n]&&((e=this.eventManager)==null||e.off(n,this.handleEvent));this.transitionManager.finalize()}handleEvent(e){this._controllerState=void 0;const n=this._eventStartBlocked;switch(e.type){case"panstart":return n?!1:this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return n?!1:this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"multipanstart":return n?!1:this._onMultiPanStart(e);case"multipanmove":return this._onMultiPan(e);case"multipanend":return this._onMultiPanEnd(e);case"dblclick":return this._onDoubleClick(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(e){const{x:n,y:r}=this.props,{offsetCenter:i}=e;return[i.x-n,i.y-r]}isPointInBounds(e,n){const{width:r,height:i}=this.props;if(n&&n.handled)return!1;const a=e[0]>=0&&e[0]<=r&&e[1]>=0&&e[1]<=i;return a&&n&&n.stopPropagation(),a}isFunctionKeyPressed(e){const{srcEvent:n}=e;return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(e){const n=setTimeout(()=>{this._eventStartBlocked===n&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=n}setProps(e){e.dragMode&&(this.dragMode=e.dragMode),this.props=e,"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);const{inertia:n}=e;this.inertia=Number.isFinite(n)?n:n===!0?gq:0;const{scrollZoom:r=!0,dragPan:i=!0,dragRotate:a=!0,doubleClickZoom:l=!0,touchZoom:u=!0,touchRotate:f=!1,keyboard:h=!0}=e,g=!!this.onViewStateChange;this.toggleEvents($l.WHEEL,g&&r),this.toggleEvents($l.PAN,g),this.toggleEvents($l.PINCH,g&&(u||f)),this.toggleEvents($l.MULTI_PAN,g&&f),this.toggleEvents($l.DOUBLE_CLICK,g&&l),this.toggleEvents($l.KEYBOARD,g&&h),this.scrollZoom=r,this.dragPan=i,this.dragRotate=a,this.doubleClickZoom=l,this.touchZoom=u,this.touchRotate=f,this.keyboard=h}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,n){this.eventManager&&e.forEach(r=>{this._events[r]!==n&&(this._events[r]=n,n?this.eventManager.on(r,this.handleEvent):this.eventManager.off(r,this.handleEvent))})}updateViewport(e,n=null,r={}){const i={...e.getViewportProps(),...n},a=this.controllerState!==e;if(this.state=e.getState(),this._setInteractionState(r),a){const l=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:l,viewId:this.props.id})}}_onTransition(e){this.onViewStateChange({...e,interactionState:this._interactionState,viewId:this.props.id})}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange(this._interactionState)}_onPanStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;let r=this.isFunctionKeyPressed(e)||e.rightButton||!1;(this.invertPan||this.dragMode==="pan")&&(r=!r);const i=this.controllerState[r?"panStart":"rotateStart"]({pos:n});return this._panMove=r,this.updateViewport(i,_a,{isDragging:!0}),!0}_onPan(e){return this.isDragging()?this._panMove?this._onPanMove(e):this._onPanRotate(e):!1}_onPanEnd(e){return this.isDragging()?this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e):!1}_onPanMove(e){if(!this.dragPan)return!1;const n=this.getCenter(e),r=this.controllerState.pan({pos:n});return this.updateViewport(r,_a,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:n}=this;if(this.dragPan&&n&&e.velocity){const r=this.getCenter(e),i=[r[0]+e.velocityX*n/2,r[1]+e.velocityY*n/2],a=this.controllerState.pan({pos:i}).panEnd();this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Th},{isDragging:!1,isPanning:!0})}else{const r=this.controllerState.panEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const n=this.getCenter(e),r=this.controllerState.rotate({pos:n});return this.updateViewport(r,_a,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:n}=this;if(this.dragRotate&&n&&e.velocity){const r=this.getCenter(e),i=[r[0]+e.velocityX*n/2,r[1]+e.velocityY*n/2],a=this.controllerState.rotate({pos:i}).rotateEnd();this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Th},{isDragging:!1,isRotating:!0})}else{const r=this.controllerState.rotateEnd();this.updateViewport(r,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;e.srcEvent.preventDefault();const{speed:r=.01,smooth:i=!1}=this.scrollZoom===!0?{}:this.scrollZoom,{delta:a}=e;let l=2/(1+Math.exp(-Math.abs(a*r)));a<0&&l!==0&&(l=1/l);const u=this.controllerState.zoom({pos:n,scale:l});return this.updateViewport(u,{...this._getTransitionProps({around:n}),transitionDuration:i?250:1},{isZooming:!0,isPanning:!0}),!0}_onMultiPanStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.controllerState.rotateStart({pos:n});return this.updateViewport(r,_a,{isDragging:!0}),!0}_onMultiPan(e){if(!this.touchRotate||!this.isDragging())return!1;const n=this.getCenter(e);n[0]-=e.deltaX;const r=this.controllerState.rotate({pos:n});return this.updateViewport(r,_a,{isDragging:!0,isRotating:!0}),!0}_onMultiPanEnd(e){if(!this.isDragging())return!1;const{inertia:n}=this;if(this.touchRotate&&n&&e.velocityY){const r=this.getCenter(e),i=[r[0],r[1]+=e.velocityY*n/2],a=this.controllerState.rotate({pos:i});this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Th},{isDragging:!1,isRotating:!0}),this.blockEvents(n)}else{const r=this.controllerState.rotateEnd();this.updateViewport(r,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.controllerState.zoomStart({pos:n}).rotateStart({pos:n});return ho._startPinchRotation=e.rotation,ho._lastPinchEvent=e,this.updateViewport(r,_a,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let n=this.controllerState;if(this.touchZoom){const{scale:r}=e,i=this.getCenter(e);n=n.zoom({pos:i,scale:r})}if(this.touchRotate){const{rotation:r}=e;n=n.rotate({deltaAngleX:ho._startPinchRotation-r})}return this.updateViewport(n,_a,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),ho._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:n}=this,{_lastPinchEvent:r}=ho;if(this.touchZoom&&n&&r&&e.scale!==r.scale){const i=this.getCenter(e);let a=this.controllerState.rotateEnd();const l=Math.log2(e.scale),u=(l-Math.log2(r.scale))/(e.deltaTime-r.deltaTime),f=Math.pow(2,l+u*n/2);a=a.zoom({pos:i,scale:f}).zoomEnd(),this.updateViewport(a,{...this._getTransitionProps({around:i}),transitionDuration:n,transitionEasing:Th},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(n)}else{const i=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return ho._startPinchRotation=null,ho._lastPinchEvent=null,!0}_onDoubleClick(e){if(!this.doubleClickZoom)return!1;const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:n,scale:r?.5:2});return this.updateViewport(i,this._getTransitionProps({around:n}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const n=this.isFunctionKeyPressed(e),{zoomSpeed:r,moveSpeed:i,rotateSpeedX:a,rotateSpeedY:l}=this.keyboard===!0?{}:this.keyboard,{controllerState:u}=this;let f;const h={};switch(e.srcEvent.code){case"Minus":f=n?u.zoomOut(r).zoomOut(r):u.zoomOut(r),h.isZooming=!0;break;case"Equal":f=n?u.zoomIn(r).zoomIn(r):u.zoomIn(r),h.isZooming=!0;break;case"ArrowLeft":n?(f=u.rotateLeft(a),h.isRotating=!0):(f=u.moveLeft(i),h.isPanning=!0);break;case"ArrowRight":n?(f=u.rotateRight(a),h.isRotating=!0):(f=u.moveRight(i),h.isPanning=!0);break;case"ArrowUp":n?(f=u.rotateUp(l),h.isRotating=!0):(f=u.moveUp(i),h.isPanning=!0);break;case"ArrowDown":n?(f=u.rotateDown(l),h.isRotating=!0):(f=u.moveDown(i),h.isPanning=!0);break;default:return!1}return this.updateViewport(f,this._getTransitionProps(),h),!0}_getTransitionProps(e){const{transition:n}=this;return!n||!n.transitionInterpolator?_a:e?{...n,transitionInterpolator:new lO({...e,...n.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:n}}class mq{constructor(e,n){this._viewportProps=this.applyConstraints(e),this._state=n}getViewportProps(){return this._viewportProps}getState(){return this._state}}const V2=5,vq=1.2;class _q extends mq{constructor(e){const{width:n,height:r,latitude:i,longitude:a,zoom:l,bearing:u=0,pitch:f=0,altitude:h=1.5,position:g=[0,0,0],maxZoom:m=20,minZoom:v=0,maxPitch:S=60,minPitch:w=0,startPanLngLat:E,startZoomLngLat:b,startRotatePos:C,startBearing:T,startPitch:A,startZoom:O,normalize:x=!0}=e;Fr(Number.isFinite(a)),Fr(Number.isFinite(i)),Fr(Number.isFinite(l)),super({width:n,height:r,latitude:i,longitude:a,zoom:l,bearing:u,pitch:f,altitude:h,maxZoom:m,minZoom:v,maxPitch:S,minPitch:w,normalize:x,position:g},{startPanLngLat:E,startZoomLngLat:b,startRotatePos:C,startBearing:T,startPitch:A,startZoom:O}),this.makeViewport=e.makeViewport}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:n}){const r=this.getState().startPanLngLat||this._unproject(n);if(!r)return this;const a=this.makeViewport(this.getViewportProps()).panByPosition(r,e);return this._getUpdatedState(a)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:e,deltaAngleX:n=0,deltaAngleY:r=0}){const{startRotatePos:i,startBearing:a,startPitch:l}=this.getState();if(!i||a===void 0||l===void 0)return this;let u;return e?u=this._getNewRotation(e,i,l,a):u={bearing:a+n,pitch:l+r},this._getUpdatedState(u)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom({pos:e,startPos:n,scale:r}){let{startZoom:i,startZoomLngLat:a}=this.getState();if(a||(i=this.getViewportProps().zoom,a=this._unproject(n)||this._unproject(e)),!a)return this;const{maxZoom:l,minZoom:u}=this.getViewportProps();let f=i+Math.log2(r);f=Fa(f,u,l);const h=this.makeViewport({...this.getViewportProps(),zoom:f});return this._getUpdatedState({zoom:f,...h.panByPosition(a,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-e})}shortestPathFrom(e){const n=e.getViewportProps(),r={...this.getViewportProps()},{bearing:i,longitude:a}=r;return Math.abs(i-n.bearing)>180&&(r.bearing=i<0?i+360:i-360),Math.abs(a-n.longitude)>180&&(r.longitude=a<0?a+360:a-360),r}applyConstraints(e){const{maxZoom:n,minZoom:r,zoom:i}=e;e.zoom=Fa(i,r,n);const{maxPitch:a,minPitch:l,pitch:u}=e;e.pitch=Fa(u,l,a);const{normalize:f=!0}=e;return f&&Object.assign(e,DW(e)),e}_zoomFromCenter(e){const{width:n,height:r}=this.getViewportProps();return this.zoom({pos:[n/2,r/2],scale:e})}_panFromCenter(e){const{width:n,height:r}=this.getViewportProps();return this.pan({startPos:[n/2,r/2],pos:[n/2+e[0],r/2+e[1]]})}_getUpdatedState(e){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...e})}_unproject(e){const n=this.makeViewport(this.getViewportProps());return e&&n.unproject(e)}_getNewRotation(e,n,r,i){const a=e[0]-n[0],l=e[1]-n[1],u=e[1],f=n[1],{width:h,height:g}=this.getViewportProps(),m=a/h;let v=0;l>0?Math.abs(g-f)>V2&&(v=l/(f-g)*vq):l<0&&f>V2&&(v=1-u/f),v=Fa(v,-1,1);const{minPitch:S,maxPitch:w}=this.getViewportProps(),E=i+180*m;let b=r;return v>0?b=r+v*(w-r):v<0&&(b=r-v*(S-r)),{pitch:b,bearing:E}}}class yq extends pq{constructor(){super(...arguments),this.ControllerState=_q,this.transition={transitionDuration:300,transitionInterpolator:new lO({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})},this.dragMode="pan"}setProps(e){e.position=e.position||[0,0,0];const n=this.props;super.setProps(e),(!n||n.height!==e.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...e,...this.state}))}}class cO extends Dc{constructor(e={}){super(e)}getViewportType(){return Ic}get ControllerType(){return yq}}cO.displayName="MapView";const bq=new JM;function Sq(t,e){const n=t.order??1/0,r=e.order??1/0;return n-r}class Eq{constructor(e){this._resolvedEffects=[],this._defaultEffects=[],this.effects=[],this._context=e,this._needsRedraw="Initial render",this._setEffects([])}addDefaultEffect(e){const n=this._defaultEffects;if(!n.find(r=>r.id===e.id)){const r=n.findIndex(i=>Sq(i,e)>0);r<0?n.push(e):n.splice(r,0,e),e.setup(this._context),this._setEffects(this.effects)}}setProps(e){"effects"in e&&(Gi(e.effects,this.effects,1)||this._setEffects(e.effects))}needsRedraw(e={clearRedrawFlags:!1}){const n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}getEffects(){return this._resolvedEffects}_setEffects(e){const n={};for(const i of this.effects)n[i.id]=i;const r=[];for(const i of e){const a=n[i.id];let l=i;a&&a!==i?a.setProps?(a.setProps(i.props),l=a):a.cleanup(this._context):a||i.setup(this._context),r.push(l),delete n[i.id]}for(const i in n)n[i].cleanup(this._context);this.effects=r,this._resolvedEffects=r.concat(this._defaultEffects),e.some(i=>i instanceof JM)||this._resolvedEffects.push(bq),this._needsRedraw="effects changed"}finalize(){for(const e of this._resolvedEffects)e.cleanup(this._context);this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}}class wq extends vb{shouldDrawLayer(e){const{operation:n}=e.props;return n.includes("draw")||n.includes("terrain")}}const Tq="deckRenderer.renderLayers";class Cq{constructor(e){this.device=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new wq(e),this.pickLayersPass=new sO(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){if(!e.viewports.length)return;const n=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,r={layerFilter:this.layerFilter,isPicking:this.drawPickingColors,...e};r.effects&&this._preRender(r.effects,r);const i=this.lastPostProcessEffect?this.renderBuffers[0]:r.target;this.lastPostProcessEffect&&(r.clearColor=[0,0,0,0],r.clearCanvas=!0);const a=n.render({...r,target:i});r.effects&&this._postRender(r.effects,r),this.renderCount++,Hr(Tq,this,a,e)}needsRedraw(e={clearRedrawFlags:!1}){const n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}finalize(){const{renderBuffers:e}=this;for(const n of e)n.delete();e.length=0}_preRender(e,n){this.lastPostProcessEffect=null,n.preRenderStats=n.preRenderStats||{};for(const r of e)n.preRenderStats[r.id]=r.preRender(n),r.postRender&&(this.lastPostProcessEffect=r.id);this.lastPostProcessEffect&&this._resizeRenderBuffers()}_resizeRenderBuffers(){const{renderBuffers:e}=this,n=this.device.canvasContext.getDrawingBufferSize();e.length===0&&[0,1].map(r=>{const i=this.device.createTexture({sampler:{minFilter:"linear",magFilter:"linear"}});e.push(this.device.createFramebuffer({id:`deck-renderbuffer-${r}`,colorAttachments:[i]}))});for(const r of e)r.resize(n)}_postRender(e,n){const{renderBuffers:r}=this,i={...n,inputBuffer:r[0],swapBuffer:r[1]};for(const a of e)if(a.postRender){i.target=a.id===this.lastPostProcessEffect?n.target:void 0;const l=a.postRender(i);i.inputBuffer=l,i.swapBuffer=l===r[0]?r[1]:r[0]}}}const Aq={pickedColor:null,pickedObjectIndex:-1};function Rq({pickedColors:t,decodePickingColor:e,deviceX:n,deviceY:r,deviceRadius:i,deviceRect:a}){const{x:l,y:u,width:f,height:h}=a;let g=i*i,m=-1,v=0;for(let S=0;S<h;S++){const w=S+u-r,E=w*w;if(E>g)v+=4*f;else for(let b=0;b<f;b++){if(t[v+3]-1>=0){const T=b+l-n,A=T*T+E;A<=g&&(g=A,m=v)}v+=4}}if(m>=0){const S=t.slice(m,m+4),w=e(S);if(w){const E=Math.floor(m/4/f),b=m/4-E*f;return{...w,pickedColor:S,pickedX:l+b,pickedY:u+E}}Sn.error("Picked non-existent layer. Is picking buffer corrupt?")()}return Aq}function xq({pickedColors:t,decodePickingColor:e}){const n=new Map;if(t){for(let r=0;r<t.length;r+=4)if(t[r+3]-1>=0){const a=t.slice(r,r+4),l=a.join(",");if(!n.has(l)){const u=e(a);u?n.set(l,{...u,color:a}):Sn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(n.values())}function uO({pickInfo:t,viewports:e,pixelRatio:n,x:r,y:i,z:a}){let l=e[0];e.length>1&&(l=Oq((t==null?void 0:t.pickedViewports)||e,{x:r,y:i}));let u;if(l){const f=[r-l.x,i-l.y];a!==void 0&&(f[2]=a),u=l.unproject(f)}return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:r,y:i,pixel:[r,i],coordinate:u,devicePixel:t&&"pickedX"in t?[t.pickedX,t.pickedY]:void 0,pixelRatio:n}}function Mq(t){const{pickInfo:e,lastPickedInfo:n,mode:r,layers:i}=t,{pickedColor:a,pickedLayer:l,pickedObjectIndex:u}=e,f=l?[l]:[];if(r==="hover"){const m=n.index,v=n.layerId,S=l?l.props.id:null;if(S!==v||u!==m){if(S!==v){const w=i.find(E=>E.props.id===v);w&&f.unshift(w)}n.layerId=S,n.index=u,n.info=null}}const h=uO(t),g=new Map;return g.set(null,h),f.forEach(m=>{let v={...h};m===l&&(v.color=a,v.index=u,v.picked=!0),v=fO({layer:m,info:v,mode:r});const S=v.layer;m===l&&r==="hover"&&(n.info=v),g.set(S.id,v),r==="hover"&&S.updateAutoHighlight(v)}),g}function fO({layer:t,info:e,mode:n}){for(;t&&e;){const r=e.layer||null;e.sourceLayer=r,e.layer=t,e=t.getPickingInfo({info:e,mode:n,sourceLayer:r}),t=t.parent}return e}function Oq(t,e){for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.containsPixel(e))return r}return t[0]}class Pq{constructor(e){this._pickable=!0,this.device=e,this.pickLayersPass=new sO(e),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.destroy(),this.depthFBO&&this.depthFBO.destroy()}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:n,layers:r,viewports:i},a=this.lastPickedInfo.info){const l=a&&a.layer&&a.layer.id,u=a&&a.viewport&&a.viewport.id,f=l?r.find(v=>v.id===l):null,h=u&&i.find(v=>v.id===u)||i[0],g=h&&h.unproject([e-h.x,n-h.y]);return{...a,...{x:e,y:n,viewport:h,coordinate:g,layer:f}}}_resizeBuffer(){var n,r;if(!this.pickingFBO&&(this.pickingFBO=this.device.createFramebuffer({colorAttachments:["rgba8unorm"],depthStencilAttachment:"depth16unorm"}),this.device.isTextureFormatRenderable("rgba32float"))){const i=this.device.createFramebuffer({colorAttachments:["rgba32float"],depthStencilAttachment:"depth16unorm"});this.depthFBO=i}const{canvas:e}=this.device.getDefaultCanvasContext();(n=this.pickingFBO)==null||n.resize({width:e.width,height:e.height}),(r=this.depthFBO)==null||r.resize({width:e.width,height:e.height})}_getPickable(e){if(this._pickable===!1)return null;const n=e.filter(r=>this.pickLayersPass.shouldDrawLayer(r)&&!r.isComposite);return n.length?n:null}_pickClosestObject({layers:e,views:n,viewports:r,x:i,y:a,radius:l=0,depth:u=1,mode:f="query",unproject3D:h,onViewportActive:g,effects:m}){const v=this.device.canvasContext.cssToDeviceRatio(),S=this._getPickable(e);if(!S||r.length===0)return{result:[],emptyInfo:uO({viewports:r,x:i,y:a,pixelRatio:v})};this._resizeBuffer();const w=this.device.canvasContext.cssToDevicePixels([i,a],!0),E=[w.x+Math.floor(w.width/2),w.y+Math.floor(w.height/2)],b=Math.round(l*v),{width:C,height:T}=this.pickingFBO,A=this._getPickingRect({deviceX:E[0],deviceY:E[1],deviceRadius:b,deviceWidth:C,deviceHeight:T}),O={x:i-l,y:a-l,width:l*2+1,height:l*2+1};let x;const N=[],F=new Set;for(let L=0;L<u;L++){let D;if(A){const B=this._drawAndSample({layers:S,views:n,viewports:r,onViewportActive:g,deviceRect:A,cullRect:O,effects:m,pass:`picking:${f}`});D=Rq({...B,deviceX:E[0],deviceY:E[1],deviceRadius:b,deviceRect:A})}else D={pickedColor:null,pickedObjectIndex:-1};let V;if(D.pickedLayer&&h&&this.depthFBO){const{pickedColors:B}=this._drawAndSample({layers:[D.pickedLayer],views:n,viewports:r,onViewportActive:g,deviceRect:{x:D.pickedX,y:D.pickedY,width:1,height:1},cullRect:O,effects:m,pass:`picking:${f}:z`},!0);B[3]&&(V=B[0])}D.pickedLayer&&L+1<u&&(F.add(D.pickedLayer),D.pickedLayer.disablePickingIndex(D.pickedObjectIndex)),x=Mq({pickInfo:D,lastPickedInfo:this.lastPickedInfo,mode:f,layers:S,viewports:r,x:i,y:a,z:V,pixelRatio:v});for(const B of x.values())B.layer&&N.push(B);if(!D.pickedColor)break}for(const L of F)L.restorePickingColors();return{result:N,emptyInfo:x.get(null)}}_pickVisibleObjects({layers:e,views:n,viewports:r,x:i,y:a,width:l=1,height:u=1,mode:f="query",maxObjects:h=null,onViewportActive:g,effects:m}){const v=this._getPickable(e);if(!v||r.length===0)return[];this._resizeBuffer();const S=this.device.canvasContext.cssToDeviceRatio(),w=this.device.canvasContext.cssToDevicePixels([i,a],!0),E=w.x,b=w.y+w.height,C=this.device.canvasContext.cssToDevicePixels([i+l,a+u],!0),T=C.x+C.width,A=C.y,O={x:E,y:A,width:T-E,height:b-A},x=this._drawAndSample({layers:v,views:n,viewports:r,onViewportActive:g,deviceRect:O,cullRect:{x:i,y:a,width:l,height:u},effects:m,pass:`picking:${f}`}),N=xq(x),F=new Map,L=[],D=Number.isFinite(h);for(let V=0;V<N.length&&!(D&&L.length>=h);V++){const B=N[V];let W={color:B.pickedColor,layer:null,index:B.pickedObjectIndex,picked:!0,x:i,y:a,pixelRatio:S};W=fO({layer:B.pickedLayer,info:W,mode:f});const X=W.layer.id;F.has(X)||F.set(X,new Set);const Y=F.get(X),ae=W.object??W.index;Y.has(ae)||(Y.add(ae),L.push(W))}return L}_drawAndSample({layers:e,views:n,viewports:r,onViewportActive:i,deviceRect:a,cullRect:l,effects:u,pass:f},h=!1){const g=h?this.depthFBO:this.pickingFBO,m={layers:e,layerFilter:this.layerFilter,views:n,viewports:r,onViewportActive:i,pickingFBO:g,deviceRect:a,cullRect:l,effects:u,pass:f,pickZ:h,preRenderStats:{},isPicking:!0};for(const T of u)T.useInPicking&&(m.preRenderStats[T.id]=T.preRender(m));const{decodePickingColor:v}=this.pickLayersPass.render(m),{x:S,y:w,width:E,height:b}=a,C=new(h?Float32Array:Uint8Array)(E*b*4);return this.device.readPixelsToArrayWebGL(g,{sourceX:S,sourceY:w,sourceWidth:E,sourceHeight:b,target:C}),{pickedColors:C,decodePickingColor:v}}_getPickingRect({deviceX:e,deviceY:n,deviceRadius:r,deviceWidth:i,deviceHeight:a}){const l=Math.max(0,e-r),u=Math.max(0,n-r),f=Math.min(i,e+r+1)-l,h=Math.min(a,n+r+1)-u;return f<=0||h<=0?null:{x:l,y:u,width:f,height:h}}}const Nq={"top-left":{top:0,left:0},"top-right":{top:0,right:0},"bottom-left":{bottom:0,left:0},"bottom-right":{bottom:0,right:0},fill:{top:0,left:0,bottom:0,right:0}},Iq="top-left",H2="__root";class Dq{constructor({deck:e,parentElement:n}){this.defaultWidgets=[],this.widgets=[],this.resolvedWidgets=[],this.containers={},this.lastViewports={},this.deck=e,this.parentElement=n}getWidgets(){return this.resolvedWidgets}setProps(e){e.widgets&&!Gi(e.widgets,this.widgets,1)&&this._setWidgets(e.widgets)}finalize(){for(const e of this.getWidgets())this._remove(e);this.defaultWidgets.length=0,this.resolvedWidgets.length=0;for(const e in this.containers)this.containers[e].remove()}addDefault(e){this.defaultWidgets.find(n=>n.id===e.id)||(this._add(e),this.defaultWidgets.push(e),this._setWidgets(this.widgets))}_setWidgets(e){const n={};for(const r of this.resolvedWidgets)n[r.id]=r;this.resolvedWidgets.length=0;for(const r of this.defaultWidgets)n[r.id]=null,this.resolvedWidgets.push(r);for(let r of e){const i=n[r.id];i?i.viewId!==r.viewId||i.placement!==r.placement?(this._remove(i),this._add(r)):r!==i&&(i.setProps(r.props),r=i):this._add(r),n[r.id]=null,this.resolvedWidgets.push(r)}for(const r in n){const i=n[r];i&&this._remove(i)}this.widgets=e}_add(e){const{viewId:n=null,placement:r=Iq}=e,i=e.onAdd({deck:this.deck,viewId:n});i&&this._getContainer(n,r).append(i),e._element=i}_remove(e){var n;(n=e.onRemove)==null||n.call(e),e._element&&e._element.remove(),e._element=void 0}_getContainer(e,n){var l;const r=e||H2;let i=this.containers[r];i||(i=document.createElement("div"),i.style.pointerEvents="none",i.style.position="absolute",i.style.overflow="hidden",(l=this.parentElement)==null||l.append(i),this.containers[r]=i);let a=i.querySelector(`.${n}`);return a||(a=document.createElement("div"),a.className=n,a.style.position="absolute",a.style.zIndex="2",Object.assign(a.style,Nq[n]),i.append(a)),a}_updateContainers(){const e=this.deck.width,n=this.deck.height;for(const r in this.containers){const i=this.lastViewports[r]||null,a=r===H2||i,l=this.containers[r];a?(l.style.display="block",l.style.left=`${i?i.x:0}px`,l.style.top=`${i?i.y:0}px`,l.style.width=`${i?i.width:e}px`,l.style.height=`${i?i.height:n}px`):l.style.display="none"}}onRedraw({viewports:e,layers:n}){var i,a;const r=e.reduce((l,u)=>(l[u.id]=u,l),{});for(const l of this.getWidgets()){const{viewId:u}=l;if(u){const f=r[u];f&&(l.onViewportChange&&l.onViewportChange(f),(i=l.onRedraw)==null||i.call(l,{viewports:[f],layers:n}))}else{if(l.onViewportChange)for(const f of e)l.onViewportChange(f);(a=l.onRedraw)==null||a.call(l,{viewports:e,layers:n})}}this.lastViewports=r,this._updateContainers()}onHover(e,n){var r,i;for(const a of this.getWidgets()){const{viewId:l}=a;(!l||l===((r=e.viewport)==null?void 0:r.id))&&((i=a.onHover)==null||i.call(a,e,n))}}onEvent(e,n){var i,a;const r=ny[n.type];if(r)for(const l of this.getWidgets()){const{viewId:u}=l;(!u||u===((i=e.viewport)==null?void 0:i.id))&&((a=l[r])==null||a.call(l,e,n))}}}const Fq={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"};class kq{constructor(){this.id="default-tooltip",this.placement="fill",this.props={},this.isVisible=!1}onAdd({deck:e}){const n=document.createElement("div");return n.className="deck-tooltip",Object.assign(n.style,Fq),this.deck=e,this.element=n,n}onRemove(){this.deck=void 0,this.element=void 0}setProps(){}onViewportChange(e){var n;this.isVisible&&e.id===((n=this.lastViewport)==null?void 0:n.id)&&e!==this.lastViewport&&this.setTooltip(null)}onHover(e){const{deck:n}=this,r=n&&n.props.getTooltip;if(!r)return;const i=r(e);this.lastViewport=e.viewport,this.setTooltip(i,e.x,e.y)}setTooltip(e,n,r){const i=this.element;if(i){if(typeof e=="string")i.innerText=e;else if(e)e.text&&(i.innerText=e.text),e.html&&(i.innerHTML=e.html),e.className&&(i.className=e.className);else{this.isVisible=!1,i.style.display="none";return}this.isVisible=!0,i.style.display="block",i.style.transform=`translate(${n}px, ${r}px)`,e&&typeof e=="object"&&"style"in e&&Object.assign(i.style,e.style)}}}var Yl;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",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[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",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_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",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[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.R16_EXT=33322]="R16_EXT",t[t.RG16_EXT=33324]="RG16_EXT",t[t.RGB16_EXT=32852]="RGB16_EXT",t[t.RGBA16_EXT=32859]="RGBA16_EXT",t[t.R16_SNORM_EXT=36760]="R16_SNORM_EXT",t[t.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",t[t.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",t[t.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",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_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_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_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",t[t.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",t[t.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_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=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="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[t.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",t[t.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",t[t.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",t[t.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",t[t.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",t[t.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",t[t.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",t[t.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",t[t.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",t[t.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",t[t.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",t[t.LINE_WEBGL=6913]="LINE_WEBGL",t[t.FILL_WEBGL=6914]="FILL_WEBGL",t[t.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",t[t.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",t[t.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",t[t.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",t[t.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",t[t.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",t[t.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",t[t.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",t[t.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",t[t.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",t[t.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",t[t.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",t[t.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",t[t.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",t[t.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",t[t.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",t[t.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",t[t.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",t[t.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",t[t.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",t[t.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",t[t.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",t[t.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",t[t.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(Yl||(Yl={}));const yb={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,35725:null,36006:null,36007:null,34229:null,34964:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32926:!1,32928:!1,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],36389:null,36662:null,36663:null,35053:null,35055:null,35723:4352,36010:null,35977:!1,3333:4,3317:4,37440:!1,37441:!1,37443:37444,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},sr=(t,e,n)=>e?t.enable(n):t.disable(n),j2=(t,e,n)=>t.hint(n,e),ai=(t,e,n)=>t.pixelStorei(n,e),W2=(t,e,n)=>{const r=n===36006?36009:36008;return t.bindFramebuffer(r,e)},Hu=(t,e,n)=>{const i={34964:34962,36662:36662,36663:36663,35053:35051,35055:35052}[n];t.bindBuffer(i,e)};function f0(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}const Bq={3042:sr,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:sr,2885:(t,e)=>t.cullFace(e),2929:sr,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:sr,35723:j2,35725:(t,e)=>t.useProgram(e),36007:(t,e)=>t.bindRenderbuffer(36161,e),36389:(t,e)=>{var n;return(n=t.bindTransformFeedback)==null?void 0:n.call(t,36386,e)},34229:(t,e)=>t.bindVertexArray(e),36006:W2,36010:W2,34964:Hu,36662:Hu,36663:Hu,35053:Hu,35055:Hu,2886:(t,e)=>t.frontFace(e),33170:j2,2849:(t,e)=>t.lineWidth(e),32823:sr,32824:"polygonOffset",10752:"polygonOffset",35977:sr,32926:sr,32928:sr,32938:"sampleCoverage",32939:"sampleCoverage",3089:sr,3088:(t,e)=>t.scissor(...e),2960:sr,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),34383:sr,10754:sr,12288:sr,12289:sr,12290:sr,12291:sr,12292:sr,12293:sr,12294:sr,12295:sr,3333:ai,3317:ai,37440:ai,37441:ai,37443:ai,3330:ai,3332:ai,3331:ai,3314:ai,32878:ai,3316:ai,3315:ai,32877:ai,framebuffer:(t,e)=>{const n=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,n)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{const n=typeof e=="number"?[e,e]:e;t.blendEquationSeparate(...n)},blendFunc:(t,e)=>{const n=(e==null?void 0:e.length)===2?[...e,...e]:e;t.blendFuncSeparate(...n)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(e[0],e[1]||!1),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=f0(e)?e:[e,e];const[n,r]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,r)},stencilFunc:(t,e)=>{e=f0(e)&&e.length===3?[...e,...e]:e;const[n,r,i,a,l,u]=e;t.stencilFuncSeparate(1028,n,r,i),t.stencilFuncSeparate(1029,a,l,u)},stencilOp:(t,e)=>{e=f0(e)&&e.length===3?[...e,...e]:e;const[n,r,i,a,l,u]=e;t.stencilOpSeparate(1028,n,r,i),t.stencilOpSeparate(1029,a,l,u)},viewport:(t,e)=>t.viewport(...e)};function qn(t,e,n){return e[t]!==void 0?e[t]:n[t]}const Uq={blendEquation:(t,e,n)=>t.blendEquationSeparate(qn(32777,e,n),qn(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(qn(32969,e,n),qn(32968,e,n),qn(32971,e,n),qn(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(qn(32824,e,n),qn(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(qn(32938,e,n),qn(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,qn(2962,e,n),qn(2967,e,n),qn(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,qn(34816,e,n),qn(36003,e,n),qn(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,qn(2964,e,n),qn(2965,e,n),qn(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,qn(34817,e,n),qn(34818,e,n),qn(34819,e,n))},X2={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,n)=>t({[e]:n}),hint:(t,e,n)=>t({[e]:n}),useProgram:(t,e)=>t({35725:e}),bindRenderbuffer:(t,e,n)=>t({36007:n}),bindTransformFeedback:(t,e,n)=>t({36389:n}),bindVertexArray:(t,e)=>t({34229:e}),bindFramebuffer:(t,e,n)=>{switch(e){case 36160:return t({36006:n,36010:n});case 36009:return t({36006:n});case 36008:return t({36010:n});default:return null}},bindBuffer:(t,e,n)=>{const r={34962:[34964],36662:[36662],36663:[36663],35051:[35053],35052:[35055]}[e];return r?t({[r]:n}):{valueChanged:!0}},blendColor:(t,e,n,r,i)=>t({32773:new Float32Array([e,n,r,i])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,n)=>t({32777:e,34877:n}),blendFunc:(t,e,n)=>t({32969:e,32968:n,32971:e,32970:n}),blendFuncSeparate:(t,e,n,r,i)=>t({32969:e,32968:n,32971:r,32970:i}),clearColor:(t,e,n,r,i)=>t({3106:new Float32Array([e,n,r,i])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,n,r,i)=>t({3107:[e,n,r,i]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,n)=>t({2928:new Float32Array([e,n])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,n)=>t({32824:e,10752:n}),sampleCoverage:(t,e,n)=>t({32938:e,32939:n}),scissor:(t,e,n,r,i)=>t({3088:new Int32Array([e,n,r,i])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,n)=>t({[e===1028?2968:36005]:n}),stencilFunc:(t,e,n,r)=>t({2962:e,2967:n,2963:r,34816:e,36003:n,36004:r}),stencilFuncSeparate:(t,e,n,r,i)=>t({[e===1028?2962:34816]:n,[e===1028?2967:36003]:r,[e===1028?2963:36004]:i}),stencilOp:(t,e,n,r)=>t({2964:e,2965:n,2966:r,34817:e,34818:n,34819:r}),stencilOpSeparate:(t,e,n,r,i)=>t({[e===1028?2964:34817]:n,[e===1028?2965:34818]:r,[e===1028?2966:34819]:i}),viewport:(t,e,n,r,i)=>t({2978:[e,n,r,i]})},cs=(t,e)=>t.isEnabled(e),q2={3042:cs,2884:cs,2929:cs,3024:cs,32823:cs,32926:cs,32928:cs,3089:cs,2960:cs,35977:cs},Lq=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function jc(t,e){if($q(e))return;const n={};for(const i in e){const a=Number(i),l=Bq[i];l&&(typeof l=="string"?n[l]=!0:l(t,e[i],a))}const r=t.state&&t.state.cache;if(r)for(const i in n){const a=Uq[i];a(t,e,r)}}function dO(t,e=yb){if(typeof e=="number"){const i=e,a=q2[i];return a?a(t,i):t.getParameter(i)}const n=Array.isArray(e)?e:Object.keys(e),r={};for(const i of n){const a=q2[i];r[i]=a?a(t,Number(i)):t.getParameter(Number(i))}return r}function zq(t){jc(t,yb)}function $q(t){for(const e in t)return!1;return!0}function Vq(t,e){if(t===e)return!0;const n=Array.isArray(t)||ArrayBuffer.isView(t),r=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&r&&t.length===e.length){for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}class ko{constructor(e,n){M(this,"gl");M(this,"program",null);M(this,"stateStack",[]);M(this,"enable",!0);M(this,"cache",null);M(this,"log");M(this,"initialized",!1);this.gl=e,this.log=(n==null?void 0:n.log)||(()=>{}),this._updateCache=this._updateCache.bind(this),Object.seal(this)}static get(e){return e.state}push(e={}){this.stateStack.push({})}pop(){const e=this.stateStack[this.stateStack.length-1];jc(this.gl,e),this.stateStack.pop()}trackState(e,n){if(this.cache=n.copyState?dO(e):Object.assign({},yb),this.initialized)throw new Error("WebGLStateTracker");this.initialized=!0,this.gl.state=this,jq(e);for(const r in X2){const i=X2[r];Hq(e,r,i)}Y2(e,"getParameter"),Y2(e,"isEnabled")}_updateCache(e){let n=!1,r;const i=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(const a in e){const l=e[a],u=this.cache[a];Vq(l,u)||(n=!0,r=u,i&&!(a in i)&&(i[a]=u),this.cache[a]=l)}return{valueChanged:n,oldValue:r}}}function Y2(t,e){const n=t[e].bind(t);t[e]=function(i){if(i===void 0||Lq.has(i))return n(i);const a=ko.get(t);return i in a.cache||(a.cache[i]=n(i)),a.enable?a.cache[i]:n(i)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function Hq(t,e,n){if(!t[e])return;const r=t[e].bind(t);t[e]=function(...a){const l=ko.get(t),{valueChanged:u,oldValue:f}=n(l._updateCache,...a);return u&&r(...a),f},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}function jq(t){const e=t.useProgram.bind(t);t.useProgram=function(r){const i=ko.get(t);i.program!==r&&(e(r),i.program=r)}}function Wq(t,e,n){let r="";const i={preserveDrawingBuffer:!0,...n};let a=null;if(a||(a=t.getContext("webgl2",i)),i.failIfMajorPerformanceCaveat&&(r||(r="Only software GPU is available. Set `failIfMajorPerformanceCaveat: false` to allow.")),!a&&!n.failIfMajorPerformanceCaveat&&(i.failIfMajorPerformanceCaveat=!1,a=t.getContext("webgl2",i),a.luma||(a.luma={}),a.luma.softwareRenderer=!0),a||(a=t.getContext("webgl",{}),a&&(a=null,r||(r="Your browser only supports WebGL1"))),!a)throw r||(r="Your browser does not support WebGL"),new Error(`Failed to create WebGL context: ${r}`);const{onContextLost:l,onContextRestored:u}=e;return t.addEventListener("webglcontextlost",f=>l(f),!1),t.addEventListener("webglcontextrestored",f=>u(f),!1),a.luma||(a.luma={}),a}function Fc(t,e,n){return n[e]===void 0&&(n[e]=t.getExtension(e)||null),n[e]}function Xq(t,e){const n=t.getParameter(7936),r=t.getParameter(7937);Fc(t,"WEBGL_debug_renderer_info",e);const i=e.WEBGL_debug_renderer_info,a=t.getParameter(i?i.UNMASKED_VENDOR_WEBGL:7936),l=t.getParameter(i?i.UNMASKED_RENDERER_WEBGL:7937),u=a||n,f=l||r,h=t.getParameter(7938),g=hO(u,f),m=qq(u,f),v=Yq(u,f);return{type:"webgl",gpu:g,gpuType:v,gpuBackend:m,vendor:u,renderer:f,version:h,shadingLanguage:"glsl",shadingLanguageVersion:300}}function hO(t,e){return/NVIDIA/i.exec(t)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(t)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(t)||/Apple/i.exec(e)?"apple":/AMD/i.exec(t)||/AMD/i.exec(e)||/ATI/i.exec(t)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e)?"software":"unknown"}function qq(t,e){return/Metal/i.exec(t)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(t)||/ANGLE/i.exec(e)?"opengl":"unknown"}function Yq(t,e){if(/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e))return"cpu";switch(hO(t,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function gO(t){switch(t){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(t))}const Ku="WEBGL_compressed_texture_s3tc",Zu="WEBGL_compressed_texture_s3tc_srgb",Kl="EXT_texture_compression_rgtc",Zl="EXT_texture_compression_bptc",Kq="WEBGL_compressed_texture_etc",Zq="WEBGL_compressed_texture_astc",Qq="WEBGL_compressed_texture_etc1",Gq="WEBGL_compressed_texture_pvrtc",Jq="WEBGL_compressed_texture_atc",K2="EXT_texture_norm16",Z2="EXT_render_snorm",eY="EXT_color_buffer_float",bb={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat-renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[Z2],"norm16-renderable-webgl":[K2],"snorm16-renderable-webgl":[K2,Z2],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[Ku,Zu,Kl,Zl],"texture-compression-bc5-webgl":[Kl],"texture-compression-bc7-webgl":[Zl],"texture-compression-etc2":[Kq],"texture-compression-astc":[Zq],"texture-compression-etc1-webgl":[Qq],"texture-compression-pvrtc-webgl":[Gq],"texture-compression-atc-webgl":[Jq]};function tY(t){return t in bb}function nY(t,e,n){return(bb[e]||[]).every(i=>Fc(t,i,n))}const Sb={r8unorm:{gl:33321,rb:!0},r8snorm:{gl:36756},r8uint:{gl:33330,rb:!0},r8sint:{gl:33329,rb:!0},rg8unorm:{gl:33323,rb:!0},rg8snorm:{gl:36757},rg8uint:{gl:33336,rb:!0},rg8sint:{gl:33335,rb:!0},r16uint:{gl:33332,rb:!0},r16sint:{gl:33331,rb:!0},r16float:{gl:33325,rb:!0},"r16unorm-webgl":{gl:33322,rb:!0},"r16snorm-webgl":{gl:36760},"rgba4unorm-webgl":{gl:32854,rb:!0},"rgb565unorm-webgl":{gl:36194,rb:!0},"rgb5a1unorm-webgl":{gl:32855,rb:!0},"rgb8unorm-webgl":{gl:32849},"rgb8snorm-webgl":{gl:36758},rgba8unorm:{gl:32856},"rgba8unorm-srgb":{gl:35907},rgba8snorm:{gl:36759},rgba8uint:{gl:36220},rgba8sint:{gl:36238},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{gl:33338},rg16sint:{gl:33337},rg16float:{gl:33327,rb:!0},"rg16unorm-webgl":{gl:33324},"rg16snorm-webgl":{gl:36761},r32uint:{gl:33334,rb:!0},r32sint:{gl:33333,rb:!0},r32float:{gl:33326},rgb9e5ufloat:{gl:35901},rg11b10ufloat:{gl:35898,rb:!0},rgb10a2unorm:{gl:32857,rb:!0},"rgb10a2uint-webgl":{gl:36975,rb:!0},"rgb16unorm-webgl":{gl:32852},"rgb16snorm-webgl":{gl:36762},rg32uint:{gl:33340,rb:!0},rg32sint:{gl:33339,rb:!0},rg32float:{gl:33328,rb:!0},rgba16uint:{gl:36214,rb:!0},rgba16sint:{gl:36232,rb:!0},rgba16float:{gl:34842},"rgba16unorm-webgl":{gl:32859,rb:!0},"rgba16snorm-webgl":{gl:36763},"rgb32float-webgl":{gl:34837,x:eY,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,rb:!0},rgba32sint:{gl:36226,rb:!0},rgba32float:{gl:34836,rb:!0},stencil8:{gl:36168,rb:!0},depth16unorm:{gl:33189,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,dataFormat:6402,types:[5125]},depth32float:{gl:36012,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth32float-stencil8":{gl:36013,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:Ku},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:Zu},"bc1-rgba-unorm":{gl:33777,x:Ku},"bc1-rgba-unorm-srgb":{gl:35916,x:Zu},"bc2-rgba-unorm":{gl:33778,x:Ku},"bc2-rgba-unorm-srgb":{gl:35918,x:Zu},"bc3-rgba-unorm":{gl:33779,x:Ku},"bc3-rgba-unorm-srgb":{gl:35919,x:Zu},"bc4-r-unorm":{gl:36283,x:Kl},"bc4-r-snorm":{gl:36284,x:Kl},"bc5-rg-unorm":{gl:36285,x:Kl},"bc5-rg-snorm":{gl:36286,x:Kl},"bc6h-rgb-ufloat":{gl:36495,x:Zl},"bc6h-rgb-float":{gl:36494,x:Zl},"bc7-rgba-unorm":{gl:36492,x:Zl},"bc7-rgba-unorm-srgb":{gl:36493,x:Zl},"etc2-rgb8unorm":{gl:37492},"etc2-rgb8unorm-srgb":{gl:37494},"etc2-rgb8a1unorm":{gl:37496},"etc2-rgb8a1unorm-srgb":{gl:37497},"etc2-rgba8unorm":{gl:37493},"etc2-rgba8unorm-srgb":{gl:37495},"eac-r11unorm":{gl:37488},"eac-r11snorm":{gl:37489},"eac-rg11unorm":{gl:37490},"eac-rg11snorm":{gl:37491},"astc-4x4-unorm":{gl:37808},"astc-4x4-unorm-srgb":{gl:37840},"astc-5x4-unorm":{gl:37809},"astc-5x4-unorm-srgb":{gl:37841},"astc-5x5-unorm":{gl:37810},"astc-5x5-unorm-srgb":{gl:37842},"astc-6x5-unorm":{gl:37811},"astc-6x5-unorm-srgb":{gl:37843},"astc-6x6-unorm":{gl:37812},"astc-6x6-unorm-srgb":{gl:37844},"astc-8x5-unorm":{gl:37813},"astc-8x5-unorm-srgb":{gl:37845},"astc-8x6-unorm":{gl:37814},"astc-8x6-unorm-srgb":{gl:37846},"astc-8x8-unorm":{gl:37815},"astc-8x8-unorm-srgb":{gl:37847},"astc-10x5-unorm":{gl:37819},"astc-10x5-unorm-srgb":{gl:37851},"astc-10x6-unorm":{gl:37817},"astc-10x6-unorm-srgb":{gl:37849},"astc-10x8-unorm":{gl:37818},"astc-10x8-unorm-srgb":{gl:37850},"astc-10x10-unorm":{gl:37819},"astc-10x10-unorm-srgb":{gl:37851},"astc-12x10-unorm":{gl:37820},"astc-12x10-unorm-srgb":{gl:37852},"astc-12x12-unorm":{gl:37821},"astc-12x12-unorm-srgb":{gl:37853},"pvrtc-rgb4unorm-webgl":{gl:35840},"pvrtc-rgba4unorm-webgl":{gl:35842},"pvrtc-rbg2unorm-webgl":{gl:35841},"pvrtc-rgba2unorm-webgl":{gl:35843},"etc1-rbg-unorm-webgl":{gl:36196},"atc-rgb-unorm-webgl":{gl:35986},"atc-rgba-unorm-webgl":{gl:35986},"atc-rgbai-unorm-webgl":{gl:34798}};function rY(t,e,n){let r=e.create;const i=Sb[e.format];return(i==null?void 0:i.gl)===void 0&&(r=!1),i!=null&&i.x&&(r=r&&!!Fc(t,i.x,n)),{format:e.format,create:r&&e.create,render:r&&e.render,filter:r&&e.filter,blend:r&&e.blend,store:r&&e.store}}function pO(t){var i;const e=Sb[t],n=aY(t),r=db(t);return{internalFormat:n,format:(e==null?void 0:e.dataFormat)||sY(r.channels,r.integer,r.normalized,n),type:r.dataType?gO(r.dataType):((i=e==null?void 0:e.types)==null?void 0:i[0])||5121,compressed:r.compressed||!1}}function iY(t){switch(db(t).attachment){case"depth":return 36096;case"stencil":return 36128;case"depth-stencil":return 33306;default:throw new Error(`Not a depth stencil format: ${t}`)}}function sY(t,e,n,r){if(r===6408||r===6407)return r;switch(t){case"r":return e&&!n?36244:6403;case"rg":return e&&!n?33320:33319;case"rgb":return e&&!n?36248:6407;case"rgba":return e&&!n?36249:6408;case"bgra":throw new Error("bgra pixels not supported by WebGL");default:return 6408}}function aY(t){const e=Sb[t],n=e==null?void 0:e.gl;if(n===void 0)throw new Error(`Unsupported texture format ${t}`);return n}const Q2={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"};class oY extends B${constructor(n,r,i){super([],i);M(this,"gl");M(this,"extensions");M(this,"testedFeatures",new Set);this.gl=n,this.extensions=r,Fc(n,"EXT_color_buffer_float",r)}*[Symbol.iterator](){const n=this.getFeatures();for(const r of n)this.has(r)&&(yield r);return[]}has(n){var r;return(r=this.disabledFeatures)!=null&&r[n]?!1:(this.testedFeatures.has(n)||(this.testedFeatures.add(n),tY(n)&&nY(this.gl,n,this.extensions)&&this.features.add(n),this.getWebGLFeature(n)&&this.features.add(n)),this.features.has(n))}initializeFeatures(){const n=this.getFeatures().filter(r=>r!=="polygon-mode-webgl");for(const r of n)this.has(r)}getFeatures(){return[...Object.keys(Q2),...Object.keys(bb)]}getWebGLFeature(n){const r=Q2[n];return typeof r=="string"?!!Fc(this.gl,r,this.extensions):!!r}}class lY extends k${constructor(n){super();M(this,"gl");M(this,"limits",{});this.gl=n}get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderComponents(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}getParameter(n){return this.limits[n]===void 0&&(this.limits[n]=this.gl.getParameter(n)),this.limits[n]||0}}class af extends gg{constructor(n,r){super(n,r);M(this,"device");M(this,"gl");M(this,"handle");M(this,"colorAttachments",[]);M(this,"depthStencilAttachment",null);const i=r.handle===null;this.device=n,this.gl=n.gl,this.handle=this.props.handle||i?this.props.handle:this.gl.createFramebuffer(),i||(n.setSpectorMetadata(this.handle,{id:this.props.id,props:this.props}),this.autoCreateAttachmentTextures(),this.updateAttachments())}destroy(){super.destroy(),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)}updateAttachments(){const n=this.gl.bindFramebuffer(36160,this.handle);for(let r=0;r<this.colorAttachments.length;++r){const i=this.colorAttachments[r];if(i){const a=36064+r;this._attachTextureView(a,i)}}if(this.depthStencilAttachment){const r=iY(this.depthStencilAttachment.props.format);this._attachTextureView(r,this.depthStencilAttachment)}if(this.device.props.debug){const r=this.gl.checkFramebufferStatus(36160);if(r!==36053)throw new Error(`Framebuffer ${uY(r)}`)}this.gl.bindFramebuffer(36160,n)}_attachTextureView(n,r){const{gl:i}=this.device,{texture:a}=r,l=r.props.baseMipLevel,u=r.props.baseArrayLayer;switch(i.bindTexture(a.glTarget,a.handle),a.glTarget){case 35866:case 32879:i.framebufferTextureLayer(36160,n,a.handle,l,u);break;case 34067:const f=cY(u);i.framebufferTexture2D(36160,n,f,a.handle,l);break;case 3553:i.framebufferTexture2D(36160,n,3553,a.handle,l);break;default:throw new Error("Illegal texture type")}i.bindTexture(a.glTarget,null)}}function cY(t){return t<34069?t+34069:t}function uY(t){switch(t){case 36053:return"success";case 36054:return"Mismatched attachments";case 36055:return"No attachments";case 36057:return"Height/width mismatch";case 36061:return"Unsupported or split attachments";case 36182:return"Samples mismatch";default:return`${t}`}}class fY extends z_{constructor(n,r){super(r);M(this,"device");M(this,"format","rgba8unorm");M(this,"depthStencilFormat","depth24plus");M(this,"presentationSize");M(this,"_framebuffer",null);this.device=n,this.presentationSize=[-1,-1],this._setAutoCreatedCanvasId(`${this.device.id}-canvas`),this.update()}get[Symbol.toStringTag](){return"WebGLCanvasContext"}getCurrentFramebuffer(){return this.update(),this._framebuffer=this._framebuffer||new af(this.device,{handle:null}),this._framebuffer}update(){const n=this.getPixelSize();(n[0]!==this.presentationSize[0]||n[1]!==this.presentationSize[1])&&(this.presentationSize=n,this.resize())}resize(n){if(this.device.gl&&this.canvas){const r=this.getDevicePixelRatio(n==null?void 0:n.useDevicePixels);this.setDevicePixelRatio(r,n);return}}commit(){}}async function mO(t,e){const n=document.getElementsByTagName("head")[0];if(!n)throw new Error("loadScript");const r=document.createElement("script");return r.setAttribute("type","text/javascript"),r.setAttribute("src",t),new Promise((i,a)=>{r.onload=i,r.onerror=l=>a(new Error(`Unable to load script '${t}': ${l}`)),n.appendChild(r)})}const dY=1;let bn=null,G2=!1;const Eb={debugSpectorJS:Re.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function hY(t){if(!globalThis.SPECTOR)try{await mO(t.debugSpectorJSUrl||Eb.debugSpectorJSUrl)}catch(e){Re.warn(String(e))}}function gY(t){var e;if(t={...Eb,...t},!t.debugSpectorJS)return null;if(!bn&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){Re.probe(dY,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:n}=globalThis.SPECTOR;bn=new n,globalThis.luma&&(globalThis.luma.spector=bn)}if(!bn)return null;if(G2||(G2=!0,bn.spyCanvases(),bn==null||bn.onCaptureStarted.add(n=>Re.info("Spector capture started:",n)()),bn==null||bn.onCapture.add(n=>{Re.info("Spector capture complete:",n)(),bn==null||bn.getResultUI(),bn==null||bn.resultView.display(),bn==null||bn.resultView.addCapture(n)})),t.gl){const n=t.gl,r=n.device;bn==null||bn.startCapture(t.gl,500),n.device=r,new Promise(i=>setTimeout(i,2e3)).then(i=>{Re.info("Spector capture stopped after 2 seconds")(),bn==null||bn.stopCapture()})}return bn}const pY="https://unpkg.com/webgl-debug@2.0.1/index.js";function vO(t){return t.luma=t.luma||{},t.luma}async function mY(){Ho()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await mO(pY))}function vY(t,e={}){return e.debugWebGL||e.traceWebGL?yY(t,e):_Y(t)}function _Y(t){const e=vO(t);return e.realContext?e.realContext:t}function yY(t,e){if(!globalThis.WebGLDebugUtils)return Re.warn("webgl-debug not loaded")(),t;const n=vO(t);if(n.debugContext)return n.debugContext;globalThis.WebGLDebugUtils.init({...Yl,...t});const r=globalThis.WebGLDebugUtils.makeDebugContext(t,bY.bind(null,e),SY.bind(null,e));for(const l in Yl)!(l in r)&&typeof Yl[l]=="number"&&(r[l]=Yl[l]);class i{}Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.setPrototypeOf(i,r);const a=Object.create(i);return n.realContext=t,n.debugContext=a,a.debug=!0,a}function J2(t,e){e=Array.from(e).map(r=>r===void 0?"undefined":r);let n=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,e);return n=`${n.slice(0,100)}${n.length>100?"...":""}`,`gl.${t}(${n})`}function bY(t,e,n,r){r=Array.from(r).map(u=>u===void 0?"undefined":u);const i=globalThis.WebGLDebugUtils.glEnumToString(e),a=globalThis.WebGLDebugUtils.glFunctionArgsToString(n,r),l=`${i} in gl.${n}(${a})`;Re.error(l)();debugger}function SY(t,e,n){let r="";Re.level>=1&&(r=J2(e,n),t.traceWebGL&&Re.log(1,r)());for(const i of n)if(i===void 0){r=r||J2(e,n);debugger}}const d0={};function EY(t="id"){d0[t]=d0[t]||1;const e=d0[t]++;return`${t}-${e}`}class of extends $n{constructor(n,r={}){super(n,r);M(this,"device");M(this,"gl");M(this,"handle");M(this,"glTarget");M(this,"glUsage");M(this,"glIndexType",5123);M(this,"byteLength");M(this,"bytesUsed");this.device=n,this.gl=this.device.gl;const i=typeof r=="object"?r.handle:void 0;this.handle=i||this.gl.createBuffer(),n.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glTarget=wY(this.props.usage),this.glUsage=TY(this.props.usage),this.glIndexType=this.props.indexType==="uint32"?5125:5123,r.data?this._initWithData(r.data,r.byteOffset,r.byteLength):this._initWithByteLength(r.byteLength||0)}_initWithData(n,r=0,i=n.byteLength+r){const a=this.glTarget;this.gl.bindBuffer(a,this.handle),this.gl.bufferData(a,i,this.glUsage),this.gl.bufferSubData(a,r,n),this.gl.bindBuffer(a,null),this.bytesUsed=i,this.byteLength=i,this._setDebugData(n,r,i),this.trackAllocatedMemory(i)}_initWithByteLength(n){let r=n;n===0&&(r=new Float32Array(0));const i=this.glTarget;return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,this.glUsage),this.gl.bindBuffer(i,null),this.bytesUsed=n,this.byteLength=n,this._setDebugData(null,0,n),this.trackAllocatedMemory(n),this}destroy(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)}write(n,r=0){this.gl.bindBuffer(36663,this.handle),this.gl.bufferSubData(36663,r,n),this.gl.bindBuffer(36663,null),this._setDebugData(n,r,n.byteLength)}async readAsync(n=0,r){return this.readSyncWebGL(n,r)}readSyncWebGL(n=0,r){r=r??this.byteLength-n;const i=new Uint8Array(r),a=0;return this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,n,i,a,r),this.gl.bindBuffer(36662,null),this._setDebugData(i,n,r),i}}function wY(t){return t&$n.INDEX?34963:t&$n.VERTEX?34962:t&$n.UNIFORM?35345:34962}function TY(t){return t&$n.INDEX||t&$n.VERTEX?35044:t&$n.UNIFORM?35048:35044}function CY(t){const e=t.split(/\r?\n/),n=[];for(const r of e){if(r.length<=1)continue;const i=r.split(":");if(i.length===2){const[m,v]=i;n.push({message:v.trim(),type:eA(m),lineNum:0,linePos:0});continue}const[a,l,u,...f]=i;let h=parseInt(u,10);isNaN(h)&&(h=0);let g=parseInt(l,10);isNaN(g)&&(g=0),n.push({message:f.join(":").trim(),type:eA(a),lineNum:h,linePos:g})}return n}function eA(t){const e=["warning","error","info"],n=t.toLowerCase();return e.includes(n)?n:"info"}class AY extends dg{constructor(n,r){super(n,r);M(this,"device");M(this,"handle");switch(this.device=n,this.props.stage){case"vertex":this.handle=this.props.handle||this.device.gl.createShader(35633);break;case"fragment":this.handle=this.props.handle||this.device.gl.createShader(35632);break;default:throw new Error(this.props.stage)}this._compile(this.source)}destroy(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)}get asyncCompilationStatus(){return this._waitForCompilationComplete().then(()=>this.compilationStatus)}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){const n=this.device.gl.getShaderInfoLog(this.handle);return n?CY(n):[]}getTranslatedSource(){const r=this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders;return(r==null?void 0:r.getTranslatedShaderSource(this.handle))||null}async _compile(n){n=n.startsWith("#version ")?n:`#version 300 es
|
|
|
${n}`;const{gl:r}=this.device;if(r.shaderSource(this.handle,n),r.compileShader(this.handle),!this.device.props.debug){this.compilationStatus="pending";return}if(!this.device.features.has("compilation-status-async-webgl")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}Re.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),Re.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){const n=async a=>await new Promise(l=>setTimeout(l,a));if(!this.device.features.has("compilation-status-async-webgl")){await n(10);return}const{gl:i}=this.device;for(;;){if(i.getShaderParameter(this.handle,37297))return;await n(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}}function RY(t,e,n,r){if(PY(e))return r(t);const i=t;i.pushState();try{return xY(t,e),jc(i.gl,n),r(t)}finally{i.popState()}}function xY(t,e){const n=t,{gl:r}=n;if(e.cullMode)switch(e.cullMode){case"none":r.disable(2884);break;case"front":r.enable(2884),r.cullFace(1028);break;case"back":r.enable(2884),r.cullFace(1029);break}if(e.frontFace&&r.frontFace(Bo("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&t.features.has("depth-clip-control")&&r.enable(34383),e.depthBias!==void 0&&(r.enable(32823),r.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0)),e.provokingVertex&&t.features.has("provoking-vertex-webgl")){const a=n.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,l=Bo("provokingVertex",e.provokingVertex,{first:36429,last:36430});a==null||a.provokingVertexWEBGL(l)}if((e.polygonMode||e.polygonOffsetLine)&&t.features.has("polygon-mode-webgl")){if(e.polygonMode){const a=n.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,l=Bo("polygonMode",e.polygonMode,{fill:6914,line:6913});a==null||a.polygonModeWEBGL(1028,l),a==null||a.polygonModeWEBGL(1029,l)}e.polygonOffsetLine&&r.enable(10754)}if(t.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&r.enable(12288),e.clipDistance1&&r.enable(12289),e.clipDistance2&&r.enable(12290),e.clipDistance3&&r.enable(12291),e.clipDistance4&&r.enable(12292),e.clipDistance5&&r.enable(12293),e.clipDistance6&&r.enable(12294),e.clipDistance7&&r.enable(12295)),e.depthWriteEnabled!==void 0&&r.depthMask(OY("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?r.enable(2929):r.disable(2929),r.depthFunc(fy("depthCompare",e.depthCompare))),e.stencilWriteMask){const i=e.stencilWriteMask;r.stencilMaskSeparate(1028,i),r.stencilMaskSeparate(1029,i)}if(e.stencilReadMask&&Re.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){const i=e.stencilReadMask||4294967295,a=fy("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?r.enable(2960):r.disable(2960),r.stencilFuncSeparate(1028,a,0,i),r.stencilFuncSeparate(1029,a,0,i)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){const i=h0("stencilPassOperation",e.stencilPassOperation),a=h0("stencilFailOperation",e.stencilFailOperation),l=h0("stencilDepthFailOperation",e.stencilDepthFailOperation);r.stencilOpSeparate(1028,a,l,i),r.stencilOpSeparate(1029,a,l,i)}switch(e.blend){case!0:r.enable(3042);break;case!1:r.disable(3042);break}if(e.blendColorOperation||e.blendAlphaOperation){const i=tA("blendColorOperation",e.blendColorOperation||"add"),a=tA("blendAlphaOperation",e.blendAlphaOperation||"add");r.blendEquationSeparate(i,a);const l=Ch("blendColorSrcFactor",e.blendColorSrcFactor||"one"),u=Ch("blendColorDstFactor",e.blendColorDstFactor||"zero"),f=Ch("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),h=Ch("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");r.blendFuncSeparate(l,u,f,h)}}function fy(t,e){return Bo(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function h0(t,e){return Bo(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function tA(t,e){return Bo(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function Ch(t,e){return Bo(t,e,{one:1,zero:0,"src-color":768,"one-minus-src-color":769,"dst-color":774,"one-minus-dst-color":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773,"src-alpha-saturated":776,"constant-color":32769,"one-minus-constant-color":32770,"constant-alpha":32771,"one-minus-constant-alpha":32772})}function MY(t,e){return`Illegal parameter ${e} for ${t}`}function Bo(t,e,n){if(!(e in n))throw new Error(MY(t,e));return n[e]}function OY(t,e){return e}function PY(t){let e=!0;for(const n in t){e=!1;break}return e}function _O(t){const e={};return t.addressModeU&&(e[10242]=g0(t.addressModeU)),t.addressModeV&&(e[10243]=g0(t.addressModeV)),t.addressModeW&&(e[32882]=g0(t.addressModeW)),t.magFilter&&(e[10240]=dy(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=NY(t.minFilter||"linear",t.mipmapFilter)),t.lodMinClamp!==void 0&&(e[33082]=t.lodMinClamp),t.lodMaxClamp!==void 0&&(e[33083]=t.lodMaxClamp),t.type==="comparison-sampler"&&(e[34892]=34894),t.compare&&(e[34893]=fy("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function g0(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function dy(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}function NY(t,e="none"){if(!e)return dy(t);switch(e){case"none":return dy(t);case"nearest":return t==="nearest"?9984:9986;case"linear":return t==="nearest"?9985:9987}}class hy extends hg{constructor(n,r){super(n,r);M(this,"device");M(this,"handle");M(this,"parameters");this.device=n,this.parameters=_O(r),this.handle=this.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(n){for(const[r,i]of Object.entries(n)){const a=Number(r);switch(a){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,a,i);break;default:this.device.gl.samplerParameteri(this.handle,a,i);break}}}}class Ql extends fg{constructor(n,r){super(n,{...Kn.defaultProps,...r});M(this,"device");M(this,"gl");M(this,"handle");M(this,"texture");this.device=n,this.gl=this.device.gl,this.handle=null,this.texture=r.texture}}const IY="Failed to deduce GL constant from typed array";function DY(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(IY)}}function FY(t,e){const{clamped:n=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function yO(t){switch(t){case 6406:case 33326:case 6403:case 36244:return 1;case 33339:case 33340:case 33328:case 33320:case 33319:return 2;case 6407:case 36248:case 34837:return 3;case 6408:case 36249:case 34836:return 4;default:return 0}}function kY(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return 0}}function Ag(t,e,n){if(BY(e))return n(t);const{nocatch:r=!0}=e,i=ko.get(t);i.push(),jc(t,e);let a;if(r)a=n(t),i.pop();else try{a=n(t)}finally{i.pop()}return a}function BY(t){for(const e in t)return!1;return!0}function UY(t,e,n){const{dimension:r,width:i,height:a,depth:l=0}=n,{glInternalFormat:u}=n,f=n.glTarget;switch(r){case"2d-array":case"3d":t.texStorage3D(f,e,u,i,a,l);break;default:t.texStorage2D(f,e,u,i,a)}}function nA(t,e,n,r){const{width:i,height:a}=r,{dimension:l,depth:u=0,mipLevel:f=0}=r,{x:h=0,y:g=0,z:m=0}=r,{glFormat:v,glType:S}=r,w=bO(r.glTarget,l,u),E=r.flipY?{37440:!0}:{};Ag(t,E,()=>{switch(l){case"2d-array":case"3d":t.bindTexture(w,e),t.texSubImage3D(w,f,h,g,m,i,a,u,v,S,n),t.bindTexture(w,null);break;case"2d":case"cube":t.bindTexture(w,e),t.texSubImage2D(w,f,h,g,i,a,v,S,n),t.bindTexture(w,null);break;default:throw new Error(l)}})}function rA(t,e,n){const{dimension:r,width:i,height:a,depth:l=0,mipLevel:u=0,byteOffset:f=0}=n,{x:h=0,y:g=0,z:m=0}=n,{glFormat:v,glType:S,compressed:w}=n,E=bO(n.glTarget,r,l);switch(r){case"2d-array":case"3d":w?t.compressedTexSubImage3D(E,u,h,g,m,i,a,l,v,e,f):t.texSubImage3D(E,u,h,g,m,i,a,l,v,S,e,f);break;case"2d":case"cube":w?t.compressedTexSubImage2D(E,u,h,g,i,a,v,e,f):t.texSubImage2D(E,u,h,g,i,a,v,S,e,f);break;default:throw new Error(r)}}function LY(t){switch(t){case"1d":break;case"2d":return 3553;case"3d":return 32879;case"cube":return 34067;case"2d-array":return 35866}throw new Error(t)}function bO(t,e,n){return e==="cube"?34069+n:t}function zY(t,e){var C;const{sourceX:n=0,sourceY:r=0,sourceAttachment:i=0}=e||{};let{target:a=null,sourceWidth:l,sourceHeight:u,sourceDepth:f,sourceFormat:h,sourceType:g}=e||{};const{framebuffer:m,deleteFramebuffer:v}=SO(t),{gl:S,handle:w}=m;l||(l=m.width),u||(u=m.height);const E=(C=m.colorAttachments[i])==null?void 0:C.texture;if(!E)throw new Error(`Invalid framebuffer attachment ${i}`);f=(E==null?void 0:E.depth)||1,h||(h=(E==null?void 0:E.glFormat)||6408),g||(g=(E==null?void 0:E.glType)||5121),a=HY(a,g,h,l,u),g=g||DY(a);const b=S.bindFramebuffer(36160,w);return S.readBuffer(36064+i),S.readPixels(n,r,l,u,h,g,a),S.readBuffer(36064),S.bindFramebuffer(36160,b||null),v&&m.destroy(),a}function $Y(t,e){const{target:n,sourceX:r=0,sourceY:i=0,sourceFormat:a=6408,targetByteOffset:l=0}=e||{};let{sourceWidth:u,sourceHeight:f,sourceType:h}=e||{};const{framebuffer:g,deleteFramebuffer:m}=SO(t);u=u||g.width,f=f||g.height;const v=g;h=h||5121;let S=n;if(!S){const E=yO(a),b=kY(h),C=l+u*f*E*b;S=v.device.createBuffer({byteLength:C})}const w=t.device.createCommandEncoder();return w.copyTextureToBuffer({sourceTexture:t,width:u,height:f,origin:[r,i],destinationBuffer:S,byteOffset:l}),w.destroy(),m&&g.destroy(),S}function SO(t){return t instanceof gg?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:VY(t),deleteFramebuffer:!0}}function VY(t,e){const{device:n,width:r,height:i,id:a}=t;return n.createFramebuffer({...e,id:`framebuffer-for-${a}`,width:r,height:i,colorAttachments:[t]})}function HY(t,e,n,r,i,a){if(t)return t;e||(e=5121);const l=FY(e,{clamped:!1}),u=yO(n);return new l(r*i*u)}class lf extends Kn{constructor(n,r){super(n,r);M(this,"device");M(this,"gl");M(this,"handle");M(this,"sampler");M(this,"view");M(this,"mipmaps");M(this,"compressed");M(this,"glTarget");M(this,"glFormat");M(this,"glType");M(this,"glInternalFormat");M(this,"textureUnit",0);const i={...this.props};i.data=r.data,this.device=n,this.gl=this.device.gl,this.glTarget=LY(this.props.dimension);const a=pO(this.props.format);this.glInternalFormat=a.internalFormat,this.glFormat=a.format,this.glType=a.type,this.compressed=a.compressed,this.mipmaps=!!this.props.mipmaps,this._initialize(i),Object.seal(this)}_initialize(n){this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:n.data});let{width:r,height:i}=n;if(!r||!i){const a=Kn.getTextureDataSize(n.data);r=(a==null?void 0:a.width)||1,i=(a==null?void 0:a.height)||1}if(this.width=r,this.height=i,this.depth=n.depth,this.setSampler(n.sampler),this.view=new Ql(this.device,{...this.props,texture:this}),this.bind(),UY(this.gl,this.mipLevels,this),n.data)switch(n.dimension){case"1d":this.setTexture1DData(n.data);break;case"2d":this.setTexture2DData(n.data);break;case"3d":this.setTexture3DData(n.data);break;case"cube":this.setTextureCubeData(n.data);break;case"2d-array":this.setTextureArrayData(n.data);break;case"cube-array":this.setTextureCubeArrayData(n.data);break;default:throw new Error(n.dimension)}this.mipmaps&&this.generateMipmap()}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}createView(n){return new Ql(this.device,{...n,texture:this})}setSampler(n={}){let r;n instanceof hy?(this.sampler=n,r=n.props):(this.sampler=new hy(this.device,n),r=n);const i=_O(r);this._setSamplerParameters(i)}generateMipmap(n){if(!(!(this.device.isTextureFormatRenderable(this.props.format)&&this.device.isTextureFormatFilterable(this.props.format))&&(Re.warn(`${this} is not renderable or filterable, may not be able to generate mipmaps`)(),!(n!=null&&n.force))))try{this.gl.bindTexture(this.glTarget,this.handle),this.gl.generateMipmap(this.glTarget)}catch(i){Re.warn(`Error generating mipmap for ${this}: ${i.message}`)()}finally{this.gl.bindTexture(this.glTarget,null)}}copyExternalImage(n){const r=Kn.getExternalImageSize(n.image),i={...Kn.defaultCopyExternalImageOptions,...r,...n},{image:a,depth:l,mipLevel:u,x:f,y:h,z:g,flipY:m}=i;let{width:v,height:S}=i;const{dimension:w,glTarget:E,glFormat:b,glInternalFormat:C,glType:T}=this;if(v=Math.min(v,this.width-f),S=Math.min(S,this.height-h),n.sourceX||n.sourceY)throw new Error("WebGL does not support sourceX/sourceY)");return nA(this.device.gl,this.handle,a,{dimension:w,mipLevel:u,x:f,y:h,z:g,width:v,height:S,depth:l,glFormat:b,glType:T,glTarget:E,flipY:m}),{width:i.width,height:i.height}}setTexture1DData(n){throw new Error("setTexture1DData not supported in WebGL.")}setTexture2DData(n,r=0){this.bind();const i=Kn.normalizeTextureData(n,this);i.length>1&&this.props.mipmaps!==!1&&Re.warn(`Texture ${this.id} mipmap and multiple LODs.`)();for(let a=0;a<i.length;a++){const l=i[a];this._setMipLevel(r,a,l)}this.unbind()}setTexture3DData(n){if(this.props.dimension!=="3d")throw new Error(this.id);ArrayBuffer.isView(n)&&(this.bind(),rA(this.device.gl,n,this),this.unbind())}setTextureCubeData(n,r=0){if(this.props.dimension!=="cube")throw new Error(this.id);for(const i of Kn.CubeFaces)this.setTextureCubeFaceData(n[i],i)}setTextureArrayData(n){throw this.props.dimension!=="2d-array"?new Error(this.id):new Error("setTextureArrayData not implemented.")}setTextureCubeArrayData(n){throw new Error("setTextureCubeArrayData not supported in WebGL2.")}setTextureCubeFaceData(n,r,i=0){Array.isArray(n)&&n.length>1&&this.props.mipmaps!==!1&&Re.warn(`${this.id} has mipmap and multiple LODs.`)();const a=Kn.CubeFaces.indexOf(r);this.setTexture2DData(n,a)}update(){throw new Error("Texture.update() not implemented. Use ExternalTexture")}setImageDataForFace(n){const{face:r,width:i,height:a,pixels:l,data:u,format:f=6408,type:h=5121}=n,{gl:g}=this,m=l||u;this.bind(),m instanceof Promise?m.then(v=>this.setImageDataForFace(Object.assign({},n,{face:r,data:v,pixels:v}))):this.width||this.height?g.texImage2D(r,0,f,i,a,0,f,h,m):g.texImage2D(r,0,f,f,h,m)}_getImageDataMap(n){for(let r=0;r<Kn.CubeFaces.length;++r){const i=Kn.CubeFaces[r];n[i]&&(n[34069+r]=n[i],delete n[i])}return n}_setSamplerParameters(n){Re.log(1,`${this.id} sampler parameters`,this.device.getGLKeys(n))(),this.gl.bindTexture(this.glTarget,this.handle);for(const[r,i]of Object.entries(n)){const a=Number(r),l=i;switch(a){case 33082:case 33083:this.gl.texParameterf(this.glTarget,a,l);break;case 10241:this.gl.texParameteri(this.glTarget,a,l);break;case 10242:case 10243:this.gl.texParameteri(this.glTarget,a,l);break;case 34046:this.device.features.has("texture-filterable-anisotropic-webgl")&&this.gl.texParameteri(this.glTarget,a,l);break;default:this.gl.texParameteri(this.glTarget,a,l);break}}this.gl.bindTexture(this.glTarget,null)}_setMipLevel(n,r,i,a=this.glTarget){if(Kn.isExternalImage(i)){nA(this.device.gl,this.handle,i,{...this,depth:n,mipLevel:r,glTarget:a,flipY:this.props.flipY});return}if(Kn.isTextureLevelData(i)){rA(this.device.gl,i.data,{...this,depth:n,mipLevel:r,glTarget:a});return}throw new Error("Texture: invalid image data")}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(n){const{gl:r}=this;return n!==void 0&&(this.textureUnit=n,r.activeTexture(33984+n)),r.bindTexture(this.glTarget,this.handle),n}unbind(n){const{gl:r}=this;return n!==void 0&&(this.textureUnit=n,r.activeTexture(33984+n)),r.bindTexture(this.glTarget,null),n}}const jY=[1,2,4,8];class WY extends $_{constructor(n,r){var a;super(n,r);M(this,"device");M(this,"glParameters");this.device=n;let i;if(!((a=r==null?void 0:r.parameters)!=null&&a.viewport))if(r!=null&&r.framebuffer){const{width:l,height:u}=r.framebuffer;i=[0,0,l,u]}else{const[l,u]=n.getCanvasContext().getDrawingBufferSize();i=[0,0,l,u]}if(this.device.pushState(),this.setParameters({viewport:i,...this.props.parameters}),this.props.framebuffer){const l=this.props.framebuffer.colorAttachments.map((u,f)=>36064+f);this.device.gl.drawBuffers(l)}else this.device.gl.drawBuffers([1029]);this.clear()}end(){this.device.popState()}pushDebugGroup(n){}popDebugGroup(){}insertDebugMarker(n){}setParameters(n={}){const r={...this.glParameters};r.framebuffer=this.props.framebuffer||null,this.props.depthReadOnly&&(r.depthMask=!this.props.depthReadOnly),r.stencilMask=this.props.stencilReadOnly?0:1,r[35977]=this.props.discard,n.viewport&&(n.viewport.length>=6?(r.viewport=n.viewport.slice(0,4),r.depthRange=[n.viewport[4],n.viewport[5]]):r.viewport=n.viewport),n.scissorRect&&(r.scissorTest=!0,r.scissor=n.scissorRect),n.blendConstant&&(r.blendColor=n.blendConstant),n.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),n[2967]=n.stencilReference),n.colorMask&&(r.colorMask=jY.map(i=>!!(i&n.colorMask))),this.glParameters=r,jc(this.device.gl,r)}beginOcclusionQuery(n){const r=this.props.occlusionQuerySet;r==null||r.beginOcclusionQuery()}endOcclusionQuery(){const n=this.props.occlusionQuerySet;n==null||n.endOcclusionQuery()}clear(){const n={...this.glParameters};let r=0;this.props.clearColors&&this.props.clearColors.forEach((i,a)=>{i&&this.clearColorBuffer(a,i)}),this.props.clearColor!==!1&&this.props.clearColors===void 0&&(r|=16384,n.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=256,n.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=1024,n.clearStencil=this.props.clearStencil),r!==0&&Ag(this.device.gl,n,()=>{this.device.gl.clear(r)})}clearColorBuffer(n=0,r=[0,0,0,0]){Ag(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int8Array:case Int16Array:case Int32Array:this.device.gl.clearBufferiv(6144,n,r);break;case Uint8Array:case Uint8ClampedArray:case Uint16Array:case Uint32Array:this.device.gl.clearBufferuiv(6144,n,r);break;case Float32Array:this.device.gl.clearBufferfv(6144,n,r);break;default:throw new Error("clearColorBuffer: color must be typed array")}})}}function XY(t){return qY.includes(t)}const qY=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],EO={5126:[5126,1,"float","f32","float32"],35664:[5126,2,"vec2","vec2<f32>","float32x2"],35665:[5126,3,"vec3","vec3<f32>","float32x3"],35666:[5126,4,"vec4","vec4<f32>","float32x4"],5124:[5124,1,"int","i32","sint32"],35667:[5124,2,"ivec2","vec2<i32>","sint32x2"],35668:[5124,3,"ivec3","vec3<i32>","sint32x3"],35669:[5124,4,"ivec4","vec4<i32>","sint32x4"],5125:[5125,1,"uint","u32","uint32"],36294:[5125,2,"uvec2","vec2<u32>","uint32x2"],36295:[5125,3,"uvec3","vec3<u32>","uint32x3"],36296:[5125,4,"uvec4","vec4<u32>","uint32x4"],35670:[5126,1,"bool","f32","float32"],35671:[5126,2,"bvec2","vec2<f32>","float32x2"],35672:[5126,3,"bvec3","vec3<f32>","float32x3"],35673:[5126,4,"bvec4","vec4<f32>","float32x4"],35674:[5126,8,"mat2","mat2x2<f32>"],35685:[5126,8,"mat2x3","mat2x3<f32>"],35686:[5126,8,"mat2x4","mat2x4<f32>"],35687:[5126,12,"mat3x2","mat3x2<f32>"],35675:[5126,12,"mat3","mat3x3<f32>"],35688:[5126,12,"mat3x4","mat3x4<f32>"],35689:[5126,16,"mat4x2","mat4x2<f32>"],35690:[5126,16,"mat4x3","mat4x3<f32>"],35676:[5126,16,"mat4","mat4x4<f32>"]};function wO(t){const e=EO[t];if(!e)throw new Error("uniform");const[n,r,,i]=e;return{format:i,components:r,glType:n}}function YY(t){const e=EO[t];if(!e)throw new Error("attribute");const[,n,,r,i]=e;return{attributeType:r,vertexFormat:i,components:n}}function KY(t,e){const n={attributes:[],bindings:[]};n.attributes=ZY(t,e);const r=JY(t,e);for(const u of r){const f=u.uniforms.map(h=>({name:h.name,format:h.format,byteOffset:h.byteOffset,byteStride:h.byteStride,arrayLength:h.arrayLength}));n.bindings.push({type:"uniform",name:u.name,group:0,location:u.location,visibility:(u.vertex?1:0)&(u.fragment?2:0),minBindingSize:u.byteLength,uniforms:f})}const i=GY(t,e);let a=0;for(const u of i)if(XY(u.type)){const{viewDimension:f,sampleType:h}=tK(u.type);n.bindings.push({type:"texture",name:u.name,group:0,location:a,viewDimension:f,sampleType:h}),u.textureUnit=a,a+=1}i.length&&(n.uniforms=i);const l=QY(t,e);return l!=null&&l.length&&(n.varyings=l),n}function ZY(t,e){const n=[],r=t.getProgramParameter(e,35721);for(let i=0;i<r;i++){const a=t.getActiveAttrib(e,i);if(!a)throw new Error("activeInfo");const{name:l,type:u}=a,f=t.getAttribLocation(e,l);if(f>=0){const{attributeType:h}=YY(u),g=/instance/i.test(l)?"instance":"vertex";n.push({name:l,location:f,stepMode:g,type:h})}}return n.sort((i,a)=>i.location-a.location),n}function QY(t,e){const n=[],r=t.getProgramParameter(e,35971);for(let i=0;i<r;i++){const a=t.getTransformFeedbackVarying(e,i);if(!a)throw new Error("activeInfo");const{name:l,type:u,size:f}=a,{glType:h,components:g}=wO(u),m={location:i,name:l,type:h,size:f*g};n.push(m)}return n.sort((i,a)=>i.location-a.location),n}function GY(t,e){const n=[],r=t.getProgramParameter(e,35718);for(let i=0;i<r;i++){const a=t.getActiveUniform(e,i);if(!a)throw new Error("activeInfo");const{name:l,size:u,type:f}=a,{name:h,isArray:g}=nK(l);let m=t.getUniformLocation(e,h);const v={location:m,name:h,size:u,type:f,isArray:g};if(n.push(v),v.size>1)for(let S=0;S<v.size;S++){const w=`${h}[${S}]`;m=t.getUniformLocation(e,w);const E={...v,name:w,location:m};n.push(E)}}return n}function JY(t,e){const n=(a,l)=>t.getActiveUniformBlockParameter(e,a,l),r=[],i=t.getProgramParameter(e,35382);for(let a=0;a<i;a++){const l={name:t.getActiveUniformBlockName(e,a)||"",location:n(a,35391),byteLength:n(a,35392),vertex:n(a,35396),fragment:n(a,35398),uniformCount:n(a,35394),uniforms:[]},u=n(a,35395)||[],f=t.getActiveUniforms(e,u,35383),h=t.getActiveUniforms(e,u,35384),g=t.getActiveUniforms(e,u,35387),m=t.getActiveUniforms(e,u,35388);for(let v=0;v<l.uniformCount;++v){const S=t.getActiveUniform(e,u[v]);if(!S)throw new Error("activeInfo");l.uniforms.push({name:S.name,format:wO(f[v]).format,type:f[v],arrayLength:h[v],byteOffset:g[v],byteStride:m[v]})}r.push(l)}return r.sort((a,l)=>a.location-l.location),r}const eK={35678:["2d","float"],35680:["cube","float"],35679:["3d","float"],35682:["3d","depth"],36289:["2d-array","float"],36292:["2d-array","depth"],36293:["cube","float"],36298:["2d","sint"],36299:["3d","sint"],36300:["cube","sint"],36303:["2d-array","uint"],36306:["2d","uint"],36307:["3d","uint"],36308:["cube","uint"],36311:["2d-array","uint"]};function tK(t){const e=eK[t];if(!e)throw new Error("sampler");const[n,r]=e;return{viewDimension:n,sampleType:r}}function nK(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};const n=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!n||n.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:n[1],length:n[2]?1:0,isArray:!!n[2]}}function rK(t,e,n,r){const i=t;let a=r;a===!0&&(a=1),a===!1&&(a=0);const l=typeof a=="number"?[a]:a;switch(n){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof r!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,r);case 5126:return t.uniform1fv(e,l);case 35664:return t.uniform2fv(e,l);case 35665:return t.uniform3fv(e,l);case 35666:return t.uniform4fv(e,l);case 5124:return t.uniform1iv(e,l);case 35667:return t.uniform2iv(e,l);case 35668:return t.uniform3iv(e,l);case 35669:return t.uniform4iv(e,l);case 35670:return t.uniform1iv(e,l);case 35671:return t.uniform2iv(e,l);case 35672:return t.uniform3iv(e,l);case 35673:return t.uniform4iv(e,l);case 5125:return i.uniform1uiv(e,l,1);case 36294:return i.uniform2uiv(e,l,2);case 36295:return i.uniform3uiv(e,l,3);case 36296:return i.uniform4uiv(e,l,4);case 35674:return t.uniformMatrix2fv(e,!1,l);case 35675:return t.uniformMatrix3fv(e,!1,l);case 35676:return t.uniformMatrix4fv(e,!1,l);case 35685:return i.uniformMatrix2x3fv(e,!1,l);case 35686:return i.uniformMatrix2x4fv(e,!1,l);case 35687:return i.uniformMatrix3x2fv(e,!1,l);case 35688:return i.uniformMatrix3x4fv(e,!1,l);case 35689:return i.uniformMatrix4x2fv(e,!1,l);case 35690:return i.uniformMatrix4x3fv(e,!1,l)}throw new Error("Illegal uniform")}function iK(t){return nO(t)!==null||typeof t=="number"||typeof t=="boolean"}function sK(t){const e={bindings:{},uniforms:{}};return Object.keys(t).forEach(n=>{const r=t[n];iK(r)?e.uniforms[n]=r:e.bindings[n]=r}),e}function aK(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"triangle-list":return 4;case"triangle-strip":return 5;default:throw new Error(t)}}function oK(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;default:throw new Error(t)}}const iA=4;class lK extends Rc{constructor(n,r){super(n,r);M(this,"device");M(this,"handle");M(this,"vs");M(this,"fs");M(this,"introspectedLayout");M(this,"uniforms",{});M(this,"bindings",{});M(this,"varyings",null);M(this,"_uniformCount",0);M(this,"_uniformSetters",{});this.device=n,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=r.vs,this.fs=r.fs;const{varyings:i,bufferMode:a=35981}=r;i&&i.length>0&&(this.varyings=i,this.device.gl.transformFeedbackVaryings(this.handle,i,a)),this._linkShaders(),Re.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=KY(this.device.gl,this.handle),Re.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=cK(this.introspectedLayout,r.shaderLayout)}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(n,r){for(const[i,a]of Object.entries(n)){const l=this.shaderLayout.bindings.find(u=>u.name===i)||this.shaderLayout.bindings.find(u=>u.name===`${i}Uniforms`);if(!l){const u=this.shaderLayout.bindings.map(f=>`"${f.name}"`).join(", ");r!=null&&r.disableWarnings||Re.warn(`No binding "${i}" in render pipeline "${this.id}", expected one of ${u}`,a)();continue}switch(a||Re.warn(`Unsetting binding "${i}" in render pipeline "${this.id}"`)(),l.type){case"uniform":if(!(a instanceof of)&&!(a.buffer instanceof of))throw new Error("buffer value");break;case"texture":if(!(a instanceof Ql||a instanceof lf||a instanceof af))throw new Error("texture value");break;case"sampler":Re.warn(`Ignoring sampler ${i}`)();break;default:throw new Error(l.type)}this.bindings[i]=a}}draw(n){var b;const{renderPass:r,parameters:i=this.props.parameters,topology:a=this.props.topology,vertexArray:l,vertexCount:u,instanceCount:f,isInstanced:h=!1,firstVertex:g=0,transformFeedback:m}=n,v=aK(a),S=!!l.indexBuffer,w=(b=l.indexBuffer)==null?void 0:b.glIndexType;if(this.linkStatus!=="success")return Re.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable())return Re.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;this.device.gl.useProgram(this.handle),l.bindBeforeRender(r),m&&m.begin(this.props.topology),this._applyBindings(),this._applyUniforms();const E=r;return RY(this.device,i,E.glParameters,()=>{S&&h?this.device.gl.drawElementsInstanced(v,u||0,w,g,f||0):S?this.device.gl.drawElements(v,u||0,w,g):h?this.device.gl.drawArraysInstanced(v,g,u||0,f||0):this.device.gl.drawArrays(v,g,u||0),m&&m.end()}),l.unbindAfterRender(r),!0}setUniformsWebGL(n){const{bindings:r}=sK(n);Object.keys(r).forEach(i=>{Re.warn(`Unsupported value "${JSON.stringify(r[i])}" used in setUniforms() for key ${i}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,n)}async _linkShaders(){const{gl:n}=this.device;if(n.attachShader(this.handle,this.vs.handle),n.attachShader(this.handle,this.fs.handle),Re.time(iA,`linkProgram for ${this.id}`)(),n.linkProgram(this.handle),Re.timeEnd(iA,`linkProgram for ${this.id}`)(),Re.level,!this.device.features.has("compilation-status-async-webgl")){const i=this._getLinkStatus();this._reportLinkStatus(i);return}Re.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),Re.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();const r=this._getLinkStatus();this._reportLinkStatus(r)}async _reportLinkStatus(n){var r;switch(n){case"success":return;default:switch(this.vs.compilationStatus){case"error":throw this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`);case"pending":this.vs.asyncCompilationStatus.then(()=>this.vs.debugShader());break}switch((r=this.fs)==null?void 0:r.compilationStatus){case"error":throw this.fs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`);case"pending":this.fs.asyncCompilationStatus.then(()=>this.fs.debugShader());break}const i=this.device.gl.getProgramInfoLog(this.handle);throw new Error(`Error during ${n}: ${i}`)}}_getLinkStatus(){const{gl:n}=this.device;return n.getProgramParameter(this.handle,35714)?(n.validateProgram(this.handle),n.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation")):(this.linkStatus="error","linking")}async _waitForLinkComplete(){const n=async a=>await new Promise(l=>setTimeout(l,a));if(!this.device.features.has("compilation-status-async-webgl")){await n(10);return}const{gl:i}=this.device;for(;;){if(i.getProgramParameter(this.handle,37297))return;await n(10)}}_areTexturesRenderable(){let n=!0;for(const r of this.shaderLayout.bindings)!this.bindings[r.name]&&!this.bindings[r.name.replace(/Uniforms$/,"")]&&(Re.warn(`Binding ${r.name} not found in ${this.id}`)(),n=!1);return n}_applyBindings(){if(this.linkStatus!=="success")return;const{gl:n}=this.device;n.useProgram(this.handle);let r=0,i=0;for(const a of this.shaderLayout.bindings){const l=this.bindings[a.name]||this.bindings[a.name.replace(/Uniforms$/,"")];if(!l)throw new Error(`No value for binding ${a.name} in ${this.id}`);switch(a.type){case"uniform":const{name:u}=a,f=n.getUniformBlockIndex(this.handle,u);if(f===4294967295)throw new Error(`Invalid uniform block name ${u}`);n.uniformBlockBinding(this.handle,i,f),l instanceof of?n.bindBufferBase(35345,i,l.handle):n.bindBufferRange(35345,i,l.buffer.handle,l.offset||0,l.size||l.buffer.byteLength-l.offset),i+=1;break;case"texture":if(!(l instanceof Ql||l instanceof lf||l instanceof af))throw new Error("texture");let h;if(l instanceof Ql)h=l.texture;else if(l instanceof lf)h=l;else if(l instanceof af&&l.colorAttachments[0]instanceof Ql)Re.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),h=l.colorAttachments[0].texture;else throw new Error("No texture");n.activeTexture(33984+r),n.bindTexture(h.glTarget,h.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${a.type}' not supported in WebGL`)}}}_applyUniforms(){for(const n of this.shaderLayout.uniforms||[]){const{name:r,location:i,type:a,textureUnit:l}=n,u=this.uniforms[r]??l;u!==void 0&&rK(this.device.gl,i,a,u)}}}function cK(t,e){const n={...t,attributes:t.attributes.map(r=>({...r}))};for(const r of(e==null?void 0:e.attributes)||[]){const i=n.attributes.find(a=>a.name===r.name);i?(i.type=r.type||i.type,i.stepMode=r.stepMode||i.stepMode):Re.warn(`shader layout attribute ${r.name} not present in shader`)}return n}class uK extends H_{constructor(n){super(n,{});M(this,"device");M(this,"commands",[]);this.device=n}submitCommands(n=this.commands){for(const r of n)switch(r.name){case"copy-buffer-to-buffer":fK(this.device,r.options);break;case"copy-buffer-to-texture":dK(this.device,r.options);break;case"copy-texture-to-buffer":hK(this.device,r.options);break;case"copy-texture-to-texture":gK(this.device,r.options);break;default:throw new Error(r.name)}}}function fK(t,e){const n=e.sourceBuffer,r=e.destinationBuffer;t.gl.bindBuffer(36662,n.handle),t.gl.bindBuffer(36663,r.handle),t.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),t.gl.bindBuffer(36662,null),t.gl.bindBuffer(36663,null)}function dK(t,e){throw new Error("Not implemented")}function hK(t,e){const{sourceTexture:n,mipLevel:r=0,aspect:i="all",width:a=e.sourceTexture.width,height:l=e.sourceTexture.height,depthOrArrayLayers:u=0,origin:f=[0,0],destinationBuffer:h,byteOffset:g=0,bytesPerRow:m,rowsPerImage:v}=e;if(i!=="all")throw new Error("aspect not supported in WebGL");if(r!==0||u!==0||m||v)throw new Error("not implemented");const{framebuffer:S,destroyFramebuffer:w}=TO(n);let E;try{const b=h,C=a||S.width,T=l||S.height,A=pO(S.colorAttachments[0].texture.props.format),O=A.format,x=A.type;t.gl.bindBuffer(35051,b.handle),E=t.gl.bindFramebuffer(36160,S.handle),t.gl.readPixels(f[0],f[1],C,T,O,x,g)}finally{t.gl.bindBuffer(35051,null),E!==void 0&&t.gl.bindFramebuffer(36160,E),w&&S.destroy()}}function gK(t,e){const{sourceTexture:n,destinationMipLevel:r=0,origin:i=[0,0],destinationOrigin:a=[0,0],destinationTexture:l}=e;let{width:u=e.destinationTexture.width,height:f=e.destinationTexture.height}=e;const{framebuffer:h,destroyFramebuffer:g}=TO(n),[m,v]=i,[S,w,E]=a,b=t.gl.bindFramebuffer(36160,h.handle);let C=null,T;if(l instanceof lf)C=l,u=Number.isFinite(u)?u:C.width,f=Number.isFinite(f)?f:C.height,C.bind(0),T=C.glTarget;else throw new Error("invalid destination");switch(T){case 3553:case 34067:t.gl.copyTexSubImage2D(T,r,S,w,m,v,u,f);break;case 35866:case 32879:t.gl.copyTexSubImage3D(T,r,S,w,E,m,v,u,f);break}C&&C.unbind(),t.gl.bindFramebuffer(36160,b),g&&h.destroy()}function TO(t){if(t instanceof Kn){const{width:e,height:n,id:r}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${r}`,width:e,height:n,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}class pK extends V_{constructor(n,r){super(n,r);M(this,"device");M(this,"commandBuffer");this.device=n,this.commandBuffer=new uK(n)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(n){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:n})}copyBufferToTexture(n){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:n})}copyTextureToBuffer(n){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:n})}copyTextureToTexture(n){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:n})}pushDebugGroup(n){}popDebugGroup(){}insertDebugMarker(n){}resolveQuerySet(n,r,i){}}function mK(t){const{target:e,source:n,start:r=0,count:i=1}=t,a=n.length,l=i*a;let u=0;for(let f=r;u<a;u++)e[f++]=n[u];for(;u<l;)u<l-u?(e.copyWithin(r+u,r,r+u),u*=2):(e.copyWithin(r+u,r,r+l-u),u=l);return t.target}class wb extends j_{constructor(n,r){super(n,r);M(this,"device");M(this,"handle");M(this,"buffer",null);M(this,"bufferValue",null);this.device=n,this.handle=this.device.gl.createVertexArray()}get[Symbol.toStringTag](){return"VertexArray"}static isConstantAttributeZeroSupported(n){return BI()==="Chrome"}destroy(){var n;super.destroy(),this.buffer&&((n=this.buffer)==null||n.destroy()),this.handle&&(this.device.gl.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(n){const r=n;if(r&&r.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34963,r?r.handle:null),this.indexBuffer=r,this.device.gl.bindVertexArray(null)}setBuffer(n,r){const i=r;if(i.glTarget===34963)throw new Error("Use .setIndexBuffer()");const{size:a,type:l,stride:u,offset:f,normalized:h,integer:g,divisor:m}=this._getAccessor(n);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,i.handle),g?this.device.gl.vertexAttribIPointer(n,a,l,u,f):this.device.gl.vertexAttribPointer(n,a,l,h,u,f),this.device.gl.bindBuffer(34962,null),this.device.gl.enableVertexAttribArray(n),this.device.gl.vertexAttribDivisor(n,m||0),this.attributes[n]=i,this.device.gl.bindVertexArray(null)}setConstantWebGL(n,r){this._enable(n,!1),this.attributes[n]=r}bindBeforeRender(){this.device.gl.bindVertexArray(this.handle),this._applyConstantAttributes()}unbindAfterRender(){this.device.gl.bindVertexArray(null)}_applyConstantAttributes(){for(let n=0;n<this.maxVertexAttributes;++n){const r=this.attributes[n];ArrayBuffer.isView(r)&&this.device.setConstantAttributeWebGL(n,r)}}_getAccessor(n){const r=this.attributeInfos[n];if(!r)throw new Error(`Unknown attribute location ${n}`);const i=gO(r.bufferDataType);return{size:r.bufferComponents,type:i,stride:r.byteStride,offset:r.byteOffset,normalized:r.normalized,integer:r.integer,divisor:r.stepMode==="instance"?1:0}}_enable(n,r=!0){const a=wb.isConstantAttributeZeroSupported(this.device)||n!==0;(r||a)&&(n=Number(n),this.device.gl.bindVertexArray(this.handle),r?this.device.gl.enableVertexAttribArray(n):this.device.gl.disableVertexAttribArray(n),this.device.gl.bindVertexArray(null))}getConstantBuffer(n,r){const i=vK(r),a=i.byteLength*n,l=i.length*n;if(this.buffer&&a!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${a} !== ${this.buffer.byteLength}.`);let u=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:a}),u=u||!_K(i,this.bufferValue),u){const f=dV(r.constructor,l);mK({target:f,source:i,start:0,count:l}),this.buffer.write(f),this.bufferValue=r}return this.buffer}}function vK(t){return Array.isArray(t)?new Float32Array(t):t}function _K(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}class yK extends W_{constructor(n,r){super(n,r);M(this,"device");M(this,"gl");M(this,"handle");M(this,"layout");M(this,"buffers",{});M(this,"unusedBuffers",{});M(this,"bindOnUse",!0);M(this,"_bound",!1);this.device=n,this.gl=n.gl,this.handle=this.props.handle||this.gl.createTransformFeedback(),this.layout=this.props.layout,r.buffers&&this.setBuffers(r.buffers),Object.seal(this)}destroy(){this.gl.deleteTransformFeedback(this.handle),super.destroy()}begin(n="point-list"){this.gl.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl.beginTransformFeedback(oK(n))}end(){this.gl.endTransformFeedback(),this.bindOnUse&&this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null)}setBuffers(n){this.buffers={},this.unusedBuffers={},this.bind(()=>{for(const r in n)this.setBuffer(r,n[r])})}setBuffer(n,r){const i=this._getVaryingIndex(n),{buffer:a,byteLength:l,byteOffset:u}=this._getBufferRange(r);if(i<0){this.unusedBuffers[n]=a,Re.warn(`${this.id} unusedBuffers varying buffer ${n}`)();return}this.buffers[i]={buffer:a,byteLength:l,byteOffset:u},this.bindOnUse||this._bindBuffer(i,a,u,l)}getBuffer(n){if(sA(n))return this.buffers[n]||null;const r=this._getVaryingIndex(n);return r>=0?this.buffers[r]:null}bind(n=this.handle){if(typeof n!="function")return this.gl.bindTransformFeedback(36386,n),this;let r;return this._bound?r=n():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,r=n(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),r}unbind(){this.bind(null)}_getBufferRange(n){if(n instanceof of)return{buffer:n,byteOffset:0,byteLength:n.byteLength};const{buffer:r,byteOffset:i=0,byteLength:a=n.buffer.byteLength}=n;return{buffer:r,byteOffset:i,byteLength:a}}_getVaryingIndex(n){if(sA(n))return Number(n);for(const r of this.layout.varyings)if(n===r.name)return r.location;return-1}_bindBuffers(){for(const n in this.buffers){const{buffer:r,byteLength:i,byteOffset:a}=this._getBufferRange(this.buffers[n]);this._bindBuffer(Number(n),r,a,i)}}_unbindBuffers(){for(const n in this.buffers)this.gl.bindBufferBase(35982,Number(n),null)}_bindBuffer(n,r,i=0,a){const l=r&&r.handle;!l||a===void 0?this.gl.bindBufferBase(35982,n,l):this.gl.bindBufferRange(35982,n,l,i,a)}}function sA(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}class bK extends X_{constructor(n,r){super(n,r);M(this,"device");M(this,"handle");M(this,"target",null);M(this,"_queryPending",!1);M(this,"_pollingPromise",null);if(this.device=n,r.count>1)throw new Error("WebGL QuerySet can only have one value");this.handle=this.device.gl.createQuery(),Object.seal(this)}get[Symbol.toStringTag](){return"Query"}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(n){return this._begin(n!=null&&n.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(n){this._queryPending||(this.target=n,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;const n=this.device.gl.getQueryParameter(this.handle,34919);return n&&(this._queryPending=!1),n}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(n=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let r=0;return this._pollingPromise=new Promise((i,a)=>{const l=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):r++>n?(a("Timed out"),this._pollingPromise=null):requestAnimationFrame(l)};requestAnimationFrame(l)}),this._pollingPromise}}class Ba extends Ua{constructor(n){var m,v;super({...n,id:n.id||EY("webgl-device")});M(this,"type","webgl");M(this,"handle");M(this,"features");M(this,"limits");M(this,"info");M(this,"canvasContext");M(this,"lost");M(this,"_resolveContextLost");M(this,"gl");M(this,"debug",!1);M(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});M(this,"_extensions",{});M(this,"_polyfilled",!1);M(this,"spectorJS");M(this,"renderPass",null);M(this,"_constants");const r=Ua._getCanvasContextProps(n);if(!r)throw new Error("WebGLDevice requires props.createCanvasContext to be set");let i=(v=(m=r.canvas)==null?void 0:m.gl)==null?void 0:v.device;if(i)throw new Error(`WebGL context already attached to device ${i.id}`);this.canvasContext=new fY(this,r),this.lost=new Promise(S=>{this._resolveContextLost=S});const a={...n.webgl};r.alphaMode==="premultiplied"&&(a.premultipliedAlpha=!0),n.powerPreference!==void 0&&(a.powerPreference=n.powerPreference);const u=this.props._handle||Wq(this.canvasContext.canvas,{onContextLost:S=>{var w;return(w=this._resolveContextLost)==null?void 0:w.call(this,{reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})},onContextRestored:S=>console.log("WebGL context restored")},a);if(!u)throw new Error("WebGL context creation failed");if(i=u.device,i){if(n._reuseDevices)return Re.log(1,`Not creating a new Device, instead returning a reference to Device ${i.id} already attached to WebGL context`,i)(),i._reused=!0,i;throw new Error(`WebGL context already attached to device ${i.id}`)}this.handle=u,this.gl=u,this.spectorJS=gY({...this.props,gl:this.handle}),this.gl.device=this,this.gl._version=2,this.info=Xq(this.gl,this._extensions),this.limits=new lY(this.gl),this.features=new oY(this.gl,this._extensions,this.props._disabledFeatures),this.props._initializeFeatures&&this.features.initializeFeatures(),r.autoResize!==!1&&this.canvasContext.resize(),new ko(this.gl,{log:(...S)=>Re.log(1,...S)()}).trackState(this.gl,{copyState:!1});const h=n.debugWebGL||n.debug,g=n.debugWebGL;h&&(this.gl=vY(this.gl,{debugWebGL:h,traceWebGL:g}),Re.warn("WebGL debug mode activated. Performance reduced.")(),n.debugWebGL&&(Re.level=Math.max(Re.level,1)))}destroy(){!this.props._reuseDevices&&!this._reused&&delete this.gl.device}get isLost(){return this.gl.isContextLost()}createCanvasContext(n){throw new Error("WebGL only supports a single canvas")}createBuffer(n){const r=this._normalizeBufferProps(n);return new of(this,r)}createTexture(n){return new lf(this,n)}createExternalTexture(n){throw new Error("createExternalTexture() not implemented")}createSampler(n){return new hy(this,n)}createShader(n){return new AY(this,n)}createFramebuffer(n){return new af(this,n)}createVertexArray(n){return new wb(this,n)}createTransformFeedback(n){return new yK(this,n)}createQuerySet(n){return new bK(this,n)}createRenderPipeline(n){return new lK(this,n)}beginRenderPass(n){return new WY(this,n)}createComputePipeline(n){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(n){throw new Error("ComputePass not supported in WebGL")}createCommandEncoder(n={}){return new pK(this,n)}submit(){var n;(n=this.renderPass)==null||n.end(),this.renderPass=null}readPixelsToArrayWebGL(n,r){return zY(n,r)}readPixelsToBufferWebGL(n,r){return $Y(n,r)}setParametersWebGL(n){jc(this.gl,n)}getParametersWebGL(n){return dO(this.gl,n)}withParametersWebGL(n,r){return Ag(this.gl,n,r)}resetWebGL(){Re.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),zq(this.gl)}_getDeviceSpecificTextureFormatCapabilities(n){return rY(this.gl,n,this._extensions)}loseDevice(){var a;let n=!1;const i=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return i&&(n=!0,i.loseContext()),(a=this._resolveContextLost)==null||a.call(this,{reason:"destroyed",message:"Application triggered context loss"}),n}pushState(){ko.get(this.gl).push()}popState(){ko.get(this.gl).pop()}setSpectorMetadata(n,r){n.__SPECTOR_Metadata=r}getGLKey(n,r){const i=Number(n);for(const a in this.gl)if(this.gl[a]===i)return`GL.${a}`;return r!=null&&r.emptyIfUnknown?"":String(n)}getGLKeys(n){const r={emptyIfUnknown:!0};return Object.entries(n).reduce((i,[a,l])=>(i[`${a}:${this.getGLKey(a,r)}`]=`${l}:${this.getGLKey(l,r)}`,i),{})}setConstantAttributeWebGL(n,r){const i=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(i).fill(null);const a=this._constants[n];switch(a&&TK(a,r)&&Re.info(1,`setConstantAttributeWebGL(${n}) could have been skipped, value unchanged`)(),this._constants[n]=r,r.constructor){case Float32Array:SK(this,n,r);break;case Int32Array:EK(this,n,r);break;case Uint32Array:wK(this,n,r);break;default:throw new Error("constant")}}getExtension(n){return Fc(this.gl,n,this._extensions),this._extensions}}function SK(t,e,n){switch(n.length){case 1:t.gl.vertexAttrib1fv(e,n);break;case 2:t.gl.vertexAttrib2fv(e,n);break;case 3:t.gl.vertexAttrib3fv(e,n);break;case 4:t.gl.vertexAttrib4fv(e,n);break}}function EK(t,e,n){t.gl.vertexAttribI4iv(e,n)}function wK(t,e,n){t.gl.vertexAttribI4uiv(e,n)}function TK(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}const CK={WEBGL_depth_texture:{UNSIGNED_INT_24_8_WEBGL:34042},OES_element_index_uint:{},OES_texture_float:{},OES_texture_half_float:{HALF_FLOAT_OES:5131},EXT_color_buffer_float:{},OES_standard_derivatives:{FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723},EXT_frag_depth:{},EXT_blend_minmax:{MIN_EXT:32775,MAX_EXT:32776},EXT_shader_texture_lod:{}},AK=t=>({drawBuffersWEBGL(e){return t.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),RK=t=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return t.createVertexArray()},deleteVertexArrayOES(e){return t.deleteVertexArray(e)},isVertexArrayOES(e){return t.isVertexArray(e)},bindVertexArrayOES(e){return t.bindVertexArray(e)}}),xK=t=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...e){return t.drawArraysInstanced(...e)},drawElementsInstancedANGLE(...e){return t.drawElementsInstanced(...e)},vertexAttribDivisorANGLE(...e){return t.vertexAttribDivisor(...e)}});function MK(t=!0){const e=HTMLCanvasElement.prototype;if(!t&&e.originalGetContext){e.getContext=e.originalGetContext,e.originalGetContext=void 0;return}e.originalGetContext=e.getContext,e.getContext=function(n,r){if(n==="webgl"||n==="experimental-webgl"){const i=this.originalGetContext("webgl2",r);return i instanceof HTMLElement&&OK(i),i}return this.originalGetContext(n,r)}}function OK(t){t.getExtension("EXT_color_buffer_float");const e={...CK,WEBGL_disjoint_timer_query:t.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:AK(t),OES_vertex_array_object:RK(t),ANGLE_instanced_arrays:xK(t)},n=t.getExtension;t.getExtension=function(i){const a=n.call(t,i);return a||(i in e?e[i]:null)};const r=t.getSupportedExtensions;t.getSupportedExtensions=function(){const i=r.apply(t)||[];return i==null?void 0:i.concat(Object.keys(e))}}const Ah=1;class PK extends V${constructor(){super();M(this,"type","webgl");Ua.defaultProps={...Ua.defaultProps,...Eb},Ba.adapter=this}isSupported(){return typeof WebGL2RenderingContext<"u"}enforceWebGL2(n){MK(n)}async attach(n){if(n instanceof Ba)return n;if((n==null?void 0:n.device)instanceof Ua)return n.device;if(!NK(n))throw new Error("Invalid WebGL2RenderingContext");return new Ba({_handle:n,createCanvasContext:{canvas:n.canvas,autoResize:!1}})}async create(n={}){Re.groupCollapsed(Ah,"WebGLDevice created")();const r=[];(n.debugWebGL||n.debug)&&r.push(mY()),n.debugSpectorJS&&r.push(hY(n));const i=await Promise.allSettled(r);for(const u of i)u.status==="rejected"&&Re.error(`Failed to initialize debug libraries ${u.reason}`)();const a=new Ba(n),l=`${a._reused?"Reusing":"Created"} device with WebGL2 ${a.debug?"debug ":""}context: ${a.info.vendor}, ${a.info.renderer} for canvas: ${a.canvasContext.id}`;return Re.probe(Ah,l)(),Re.table(Ah,a.info)(),Re.groupEnd(Ah)(),a}}function NK(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:!!(t&&Number.isFinite(t._version))}const aA=new PK;function ya(){}const IK=({isDragging:t})=>t?"grabbing":"grab",CO={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,parameters:{},parent:null,device:null,deviceProps:{type:"webgl"},gl:null,canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,widgets:[],onDeviceInitialized:ya,onWebGLInitialized:ya,onResize:ya,onViewStateChange:ya,onInteractionStateChange:ya,onBeforeRender:ya,onAfterRender:ya,onLoad:ya,onError:t=>Sn.error(t.message,t.cause)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:IK,getTooltip:null,debug:!1,drawPickingColors:!1};class Tb{constructor(e){this.width=0,this.height=0,this.userData={},this.device=null,this.canvas=null,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this.eventManager=null,this.widgetManager=null,this.tooltip=null,this.animationLoop=null,this.cursorState={isHovering:!1,isDragging:!1},this.stats=new qg({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this._lastPointerDownInfo=null,this._onPointerMove=r=>{const{_pickRequest:i}=this;if(r.type==="pointerleave")i.x=-1,i.y=-1,i.radius=0;else{if(r.leftButton||r.rightButton)return;{const a=r.offsetCenter;if(!a)return;i.x=a.x,i.y=a.y,i.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:i.x,y:i.y}),i.event=r},this._onEvent=r=>{const i=ny[r.type],a=r.offsetCenter;if(!i||!a||!this.layerManager)return;const l=this.layerManager.getLayers(),u=this.deckPicker.getLastPickedObject({x:a.x,y:a.y,layers:l,viewports:this.getViewports(a)},this._lastPointerDownInfo),{layer:f}=u,h=f&&(f[i]||f.props[i]),g=this.props[i];let m=!1;h&&(m=h.call(f,u,r)),m||(g==null||g(u,r),this.widgetManager.onEvent(u,r))},this._onPointerDown=r=>{const i=r.offsetCenter,a=this._pick("pickObject","pickObject Time",{x:i.x,y:i.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=a.result[0]||a.emptyInfo},this.props={...CO,...e},e=this.props,e.viewState&&e.initialViewState&&Sn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),this.viewState=this.props.initialViewState,e.device&&(this.device=e.device);let n=this.device;!n&&e.gl&&(e.gl instanceof WebGLRenderingContext&&Sn.error("WebGL1 context not supported.")(),n=aA.attach(e.gl)),n||(n=L_.createDevice({type:"best-available",_reuseDevices:!0,adapters:[aA],...e.deviceProps,createCanvasContext:{canvas:this._createCanvas(e),useDevicePixels:this.props.useDevicePixels,autoResize:!1}})),this.animationLoop=this._createAnimationLoop(n,e),this.setProps(e),e._typedArrayManagerProps&&Nf.setOptions(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){var e,n,r,i,a,l,u,f,h,g;(e=this.animationLoop)==null||e.stop(),(n=this.animationLoop)==null||n.destroy(),this.animationLoop=null,this._lastPointerDownInfo=null,(r=this.layerManager)==null||r.finalize(),this.layerManager=null,(i=this.viewManager)==null||i.finalize(),this.viewManager=null,(a=this.effectManager)==null||a.finalize(),this.effectManager=null,(l=this.deckRenderer)==null||l.finalize(),this.deckRenderer=null,(u=this.deckPicker)==null||u.finalize(),this.deckPicker=null,(f=this.eventManager)==null||f.destroy(),this.eventManager=null,(h=this.widgetManager)==null||h.finalize(),this.widgetManager=null,!this.props.canvas&&!this.props.device&&!this.props.gl&&this.canvas&&((g=this.canvas.parentElement)==null||g.removeChild(this.canvas),this.canvas=null)}setProps(e){var r;this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Sn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Sn.removed("onLayerClick","onClick")(),e.initialViewState&&!Gi(this.props.initialViewState,e.initialViewState,3)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const n=Object.create(this.props);Object.assign(n,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),(r=this.animationLoop)==null||r.setProps(n),this.layerManager&&(this.viewManager.setProps(n),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(n),this.effectManager.setProps(n),this.deckRenderer.setProps(n),this.deckPicker.setProps(n),this.widgetManager.setProps(n)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";let n=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const r=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),a=this.effectManager.needsRedraw(e),l=this.deckRenderer.needsRedraw(e);return n=n||r||i||a||l,n}redraw(e){if(!this.layerManager)return;let n=this.needsRedraw({clearRedrawFlags:!0});n=e||n,n&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(n):this._drawLayers(n))}get isInitialized(){return this.viewManager!==null}getViews(){return Fr(this.viewManager),this.viewManager.views}getViewports(e){return Fr(this.viewManager),this.viewManager.getViewports(e)}getCanvas(){return this.canvas}pickObject(e){const n=this._pick("pickObject","pickObject Time",e).result;return n.length?n[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,n=!1){for(const r in e)this.layerManager.resourceManager.add({resourceId:r,data:e[r],forceUpdate:n})}_removeResources(e){for(const n of e)this.layerManager.resourceManager.remove(n)}_addDefaultEffect(e){this.effectManager.addDefaultEffect(e)}_addDefaultShaderModule(e){this.layerManager.addDefaultShaderModule(e)}_removeDefaultShaderModule(e){var n;(n=this.layerManager)==null||n.removeDefaultShaderModule(e)}_pick(e,n,r){Fr(this.deckPicker);const{stats:i}=this;i.get("Pick Count").incrementCount(),i.get(n).timeStart();const a=this.deckPicker[e]({layers:this.layerManager.getLayers(r),views:this.viewManager.getViews(),viewports:this.getViewports(r),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...r});return i.get(n).timeEnd(),a}_createCanvas(e){let n=e.canvas;return typeof n=="string"&&(n=document.getElementById(n),Fr(n)),n||(n=document.createElement("canvas"),n.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(n)),Object.assign(n.style,e.style),n}_setCanvasSize(e){var i;if(!this.canvas)return;const{width:n,height:r}=e;if(n||n===0){const a=Number.isFinite(n)?`${n}px`:n;this.canvas.style.width=a}if(r||r===0){const a=Number.isFinite(r)?`${r}px`:r;this.canvas.style.position=((i=e.style)==null?void 0:i.position)||"absolute",this.canvas.style.height=a}}_updateCanvasSize(){var i,a;const{canvas:e}=this;if(!e)return;const n=e.clientWidth??e.width,r=e.clientHeight??e.height;(n!==this.width||r!==this.height)&&(this.width=n,this.height=r,(i=this.viewManager)==null||i.setProps({width:n,height:r}),(a=this.layerManager)==null||a.activateViewport(this.getViewports()[0]),this.props.onResize({width:n,height:r}))}_createAnimationLoop(e,n){const{gl:r,onError:i,useDevicePixels:a}=n;return new AX({device:e,useDevicePixels:a,autoResizeDrawingBuffer:!r,autoResizeViewport:!1,onInitialize:l=>this._setDevice(l.device),onRender:this._onRenderFrame.bind(this),onError:i})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){const{views:e}=this.props,n=Array.isArray(e)?e:e?[e]:[new cO({id:"default-view"})];return n.length&&this.props.controller&&(n[0].props.controller=this.props.controller),n}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_pickAndCallback(){var n,r,i;const{_pickRequest:e}=this;if(e.event){const{result:a,emptyInfo:l}=this._pick("pickObject","pickObject Time",e);this.cursorState.isHovering=a.length>0;let u=l,f=!1;for(const h of a)u=h,f=((n=h.layer)==null?void 0:n.onHover(h,e.event))||f;f||((i=(r=this.props).onHover)==null||i.call(r,u,e.event),this.widgetManager.onHover(u,e.event)),e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.cursorState))}_setDevice(e){var i,a;if(this.device=e,!this.animationLoop)return;this.canvas||(this.canvas=(i=this.device.canvasContext)==null?void 0:i.canvas),this.device instanceof Ba&&this.device.setParametersWebGL({blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onDeviceInitialized(this.device),this.device instanceof Ba&&this.props.onWebGLInitialized(this.device.gl);const n=new tO;n.play(),this.animationLoop.attachTimeline(n),this.eventManager=new cW(this.props.parent||this.canvas,{touchAction:this.props.touchAction,recognizers:Object.keys(A2).map(l=>{var S;const[u,f,h,g]=A2[l],m=(S=this.props.eventRecognizerOptions)==null?void 0:S[l],v={...f,...m,event:l};return{recognizer:new u(v),recognizeWith:h,requestFailure:g}}),events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const l in ny)this.eventManager.on(l,this._onEvent);this.viewManager=new aq({timeline:n,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const r=this.viewManager.getViewports()[0];this.layerManager=new sq(this.device,{deck:this,stats:this.stats,viewport:r,timeline:n}),this.effectManager=new Eq({deck:this,device:this.device}),this.deckRenderer=new Cq(this.device),this.deckPicker=new Pq(this.device),this.widgetManager=new Dq({deck:this,parentElement:(a=this.canvas)==null?void 0:a.parentElement}),this.widgetManager.addDefault(new kq),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,n){var l;const{device:r,gl:i}=this.layerManager.context;this.props.onBeforeRender({device:r,gl:i});const a={target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",effects:this.effectManager.getEffects(),...n};(l=this.deckRenderer)==null||l.renderLayers(a),a.pass==="screen"&&this.widgetManager.onRedraw({viewports:a.viewports,layers:a.layers}),this.props.onAfterRender({device:r,gl:i})}_onRenderFrame(){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),Sn.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const n=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState={...this.viewState,[e.viewId]:n},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.cursorState.isDragging=e.isDragging||!1,this.props.onInteractionStateChange(e)}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const n=this.animationLoop.stats;e.get("GPU Time").addTime(n.get("GPU Time").lastTiming),e.get("CPU Time").addTime(n.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:n}=this;e.fps=n.get("frameRate").getHz(),e.setPropsTime=n.get("setProps Time").time,e.updateAttributesTime=n.get("Update Attributes").time,e.framesRedrawn=n.get("Redraw Count").count,e.pickTime=n.get("pickObject Time").time+n.get("pickMultipleObjects Time").time+n.get("pickObjects Time").time,e.pickCount=n.get("Pick Count").count,e.gpuTime=n.get("GPU Time").time,e.cpuTime=n.get("CPU Time").time,e.gpuTimePerFrame=n.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=n.get("CPU Time").getAverageTime();const r=L_.stats.get("Memory Usage");e.bufferMemory=r.get("Buffer Memory").count,e.textureMemory=r.get("Texture Memory").count,e.renderbufferMemory=r.get("Renderbuffer Memory").count,e.gpuMemory=r.get("GPU Memory").count}}Tb.defaultProps=CO;Tb.VERSION=qz;function DK(t){switch(t){case"float64":return Float64Array;case"uint8":case"unorm8":return Uint8ClampedArray;default:return hM(t)}}const FK=dM;function Rh(t,e){return{attribute:t,format:e.size>1?`${e.type}x${e.size}`:e.type,byteOffset:e.offset||0}}function Eo(t){return t.stride||t.size*t.bytesPerElement}function kK(t,e){return t.type===e.type&&t.size===e.size&&Eo(t)===Eo(e)&&(t.offset||0)===(e.offset||0)}function gy(t,e){e.offset&&Sn.removed("shaderAttribute.offset","vertexOffset, elementOffset")();const n=Eo(t),r=e.vertexOffset!==void 0?e.vertexOffset:t.vertexOffset||0,i=e.elementOffset||0,a=r*n+i*t.bytesPerElement+(t.offset||0);return{...e,offset:a,stride:n}}function BK(t,e){const n=gy(t,e);return{high:n,low:{...n,offset:n.offset+t.size*4}}}class UK{constructor(e,n,r){this._buffer=null,this.device=e,this.id=n.id||"",this.size=n.size||1;const i=n.logicalType||n.type,a=i==="float64";let{defaultValue:l}=n;l=Number.isFinite(l)?[l]:l||new Array(this.size).fill(0);let u;a?u="float32":!i&&n.isIndexed?u="uint32":u=i||"float32";let f=DK(i||u);this.doublePrecision=a,a&&n.fp64===!1&&(f=Float32Array),this.value=null,this.settings={...n,defaultType:f,defaultValue:l,logicalType:i,type:u,normalized:u.includes("norm"),size:this.size,bytesPerElement:f.BYTES_PER_ELEMENT},this.state={...r,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}}get isConstant(){return this.state.constant}get buffer(){return this._buffer}get byteOffset(){const e=this.getAccessor();return e.vertexOffset?e.vertexOffset*Eo(e):0}get numInstances(){return this.state.numInstances}set numInstances(e){this.state.numInstances=e}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),Nf.release(this.state.allocatedValue)}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(e=this.id,n=null){const r={};if(this.state.constant){const i=this.value;if(n){const a=gy(this.getAccessor(),n),l=a.offset/i.BYTES_PER_ELEMENT,u=a.size||this.size;r[e]=i.subarray(l,l+u)}else r[e]=i}else r[e]=this.getBuffer();return this.doublePrecision&&(this.value instanceof Float64Array?r[`${e}64Low`]=r[e]:r[`${e}64Low`]=new Float32Array(this.size)),r}_getBufferLayout(e=this.id,n=null){const r=this.getAccessor(),i=[],a={name:this.id,byteStride:Eo(r),attributes:i};if(this.doublePrecision){const l=BK(r,n||{});i.push(Rh(e,{...r,...l.high}),Rh(`${e}64Low`,{...r,...l.low}))}else if(n){const l=gy(r,n);i.push(Rh(e,{...r,...l}))}else i.push(Rh(e,r));return a}setAccessor(e){this.state.bufferAccessor=e}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let e=null;if(this.state.constant&&this.value){const n=Array.from(this.value);e=[n,n]}else{const{value:n,numInstances:r,size:i}=this,a=r*i;if(n&&a&&n.length>=a){const l=new Array(i).fill(1/0),u=new Array(i).fill(-1/0);for(let f=0;f<a;)for(let h=0;h<i;h++){const g=n[f++];g<l[h]&&(l[h]=g),g>u[h]&&(u[h]=g)}e=[l,u]}}return this.state.bounds=e,e}setData(e){const{state:n}=this;let r;ArrayBuffer.isView(e)?r={value:e}:e instanceof $n?r={buffer:e}:r=e;const i={...this.settings,...r};if(ArrayBuffer.isView(r.value)){if(!r.type)if(this.doublePrecision&&r.value instanceof Float64Array)i.type="float32";else{const l=FK(r.value);i.type=i.normalized?l.replace("int","norm"):l}i.bytesPerElement=r.value.BYTES_PER_ELEMENT,i.stride=Eo(i)}if(n.bounds=null,r.constant){let a=r.value;if(a=this._normalizeValue(a,[],0),this.settings.normalized&&(a=this.normalizeConstant(a)),!(!n.constant||!this._areValuesEqual(a,this.value)))return!1;n.externalBuffer=null,n.constant=!0,this.value=ArrayBuffer.isView(a)?a:new Float32Array(a)}else if(r.buffer){const a=r.buffer;n.externalBuffer=a,n.constant=!1,this.value=r.value||null}else if(r.value){this._checkExternalBuffer(r);let a=r.value;n.externalBuffer=null,n.constant=!1,this.value=a;let{buffer:l}=this;const u=Eo(i),f=(i.vertexOffset||0)*u;if(this.doublePrecision&&a instanceof Float64Array&&(a=a0(a,i)),this.settings.isIndexed){const g=this.settings.defaultType;a.constructor!==g&&(a=new g(a))}const h=a.byteLength+f+u*2;(!l||l.byteLength<h)&&(l=this._createBuffer(h)),l.write(a,f)}return this.setAccessor(i),!0}updateSubBuffer(e={}){this.state.bounds=null;const n=this.value,{startOffset:r=0,endOffset:i}=e;this.buffer.write(this.doublePrecision&&n instanceof Float64Array?a0(n,{size:this.size,startIndex:r,endIndex:i}):n.subarray(r,i),r*n.BYTES_PER_ELEMENT+this.byteOffset)}allocate(e,n=!1){const{state:r}=this,i=r.allocatedValue,a=Nf.allocate(i,e+1,{size:this.size,type:this.settings.defaultType,copy:n});this.value=a;const{byteOffset:l}=this;let{buffer:u}=this;return(!u||u.byteLength<a.byteLength+l)&&(u=this._createBuffer(a.byteLength+l),n&&i&&u.write(i instanceof Float64Array?a0(i,this):i,l)),r.allocatedValue=a,r.constant=!1,r.externalBuffer=null,this.setAccessor(this.settings),!0}_checkExternalBuffer(e){const{value:n}=e;if(!ArrayBuffer.isView(n))throw new Error(`Attribute ${this.id} value is not TypedArray`);const r=this.settings.defaultType;let i=!1;if(this.doublePrecision&&(i=n.BYTES_PER_ELEMENT<4),i)throw new Error(`Attribute ${this.id} does not support ${n.constructor.name}`);!(n instanceof r)&&this.settings.normalized&&!("normalized"in e)&&Sn.warn(`Attribute ${this.id} is normalized`)()}normalizeConstant(e){switch(this.settings.type){case"snorm8":return new Float32Array(e).map(n=>(n+128)/255*2-1);case"snorm16":return new Float32Array(e).map(n=>(n+32768)/65535*2-1);case"unorm8":return new Float32Array(e).map(n=>n/255);case"unorm16":return new Float32Array(e).map(n=>n/65535);default:return e}}_normalizeValue(e,n,r){const{defaultValue:i,size:a}=this.settings;if(Number.isFinite(e))return n[r]=e,n;if(!e){let l=a;for(;--l>=0;)n[r+l]=i[l];return n}switch(a){case 4:n[r+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:n[r+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:n[r+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:n[r+0]=Number.isFinite(e[0])?e[0]:i[0];break;default:let l=a;for(;--l>=0;)n[r+l]=Number.isFinite(e[l])?e[l]:i[l]}return n}_areValuesEqual(e,n){if(!e||!n)return!1;const{size:r}=this;for(let i=0;i<r;i++)if(e[i]!==n[i])return!1;return!0}_createBuffer(e){var i;this._buffer&&this._buffer.destroy();const{isIndexed:n,type:r}=this.settings;return this._buffer=this.device.createBuffer({...(i=this._buffer)==null?void 0:i.props,id:this.id,usage:n?$n.INDEX:$n.VERTEX,indexType:n?r:void 0,byteLength:e}),this._buffer}}const oA=[],lA=[];function LK(t,e=0,n=1/0){let r=oA;const i={index:-1,data:t,target:[]};return t?typeof t[Symbol.iterator]=="function"?r=t:t.length>0&&(lA.length=t.length,r=lA):r=oA,(e>0||Number.isFinite(n))&&(r=(Array.isArray(r)?r:Array.from(r)).slice(e,n),i.index=e-1),{iterable:r,objectInfo:i}}function AO(t){return t&&t[Symbol.asyncIterator]}function zK(t,e){const{size:n,stride:r,offset:i,startIndices:a,nested:l}=e,u=t.BYTES_PER_ELEMENT,f=r?r/u:n,h=i?i/u:0,g=Math.floor((t.length-h)/f);return(m,{index:v,target:S})=>{if(!a){const C=v*f+h;for(let T=0;T<n;T++)S[T]=t[C+T];return S}const w=a[v],E=a[v+1]||g;let b;if(l){b=new Array(E-w);for(let C=w;C<E;C++){const T=C*f+h;S=new Array(n);for(let A=0;A<n;A++)S[A]=t[T+A];b[C-w]=S}}else if(f===n)b=t.subarray(w*n+h,E*n+h);else{b=new t.constructor((E-w)*n);let C=0;for(let T=w;T<E;T++){const A=T*f+h;for(let O=0;O<n;O++)b[C++]=t[A+O]}}return b}}const $K=[],Uh=[[0,1/0]];function VK(t,e){if(t===Uh||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return t;const n=[],r=t.length;let i=0;for(let a=0;a<r;a++){const l=t[a];l[1]<e[0]?(n.push(l),i=a+1):l[0]>e[1]?n.push(l):e=[Math.min(l[0],e[0]),Math.max(l[1],e[1])]}return n.splice(i,0,e),n}const HK={interpolation:{duration:0,easing:t=>t},spring:{stiffness:.05,damping:.5}};function RO(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});const n=t.type||"interpolation";return{...HK[n],...e,...t,type:n}}class xO extends UK{constructor(e,n){super(e,n,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,layoutChanged:!1,updateRanges:Uh}),this.constant=!1,this.settings.update=n.update||(n.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(e){this.state.startIndices=e}needsUpdate(){return this.state.needsUpdate}needsRedraw({clearChangedFlags:e=!1}={}){const n=this.state.needsRedraw;return this.state.needsRedraw=n&&!e,n}layoutChanged(){return this.state.layoutChanged}setAccessor(e){var n;(n=this.state).layoutChanged||(n.layoutChanged=!kK(e,this.getAccessor())),super.setAccessor(e)}getUpdateTriggers(){const{accessor:e}=this.settings;return[this.id].concat(typeof e!="function"&&e||[])}supportsTransition(){return!!this.settings.transition}getTransitionSetting(e){if(!e||!this.supportsTransition())return null;const{accessor:n}=this.settings,r=this.settings.transition,i=Array.isArray(n)?e[n.find(a=>e[a])]:e[n];return RO(i,r)}setNeedsUpdate(e=this.id,n){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),n){const{startRow:r=0,endRow:i=1/0}=n;this.state.updateRanges=VK(this.state.updateRanges,[r,i])}else this.state.updateRanges=Uh}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=$K}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}allocate(e){const{state:n,settings:r}=this;return r.noAlloc?!1:r.update?(super.allocate(e,n.updateRanges!==Uh),!0):!1}updateBuffer({numInstances:e,data:n,props:r,context:i}){if(!this.needsUpdate())return!1;const{state:{updateRanges:a},settings:{update:l,noAlloc:u}}=this;let f=!0;if(l){for(const[h,g]of a)l.call(i,this,{data:n,startRow:h,endRow:g,props:r,numInstances:e});if(this.value)if(this.constant||!this.buffer||this.buffer.byteLength<this.value.byteLength+this.byteOffset)this.setData({value:this.value,constant:this.constant}),this.constant=!1;else for(const[h,g]of a){const m=Number.isFinite(h)?this.getVertexOffset(h):0,v=Number.isFinite(g)?this.getVertexOffset(g):u||!Number.isFinite(e)?this.value.length:e*this.size;super.updateSubBuffer({startOffset:m,endOffset:v})}this._checkAttributeArray()}else f=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),f}setConstantValue(e){return e===void 0||typeof e=="function"?!1:(this.setData({constant:!0,value:e})&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0)}setExternalBuffer(e){const{state:n}=this;return e?(this.clearNeedsUpdate(),n.lastExternalBuffer===e||(n.lastExternalBuffer=e,this.setNeedsRedraw(),this.setData(e)),!0):(n.lastExternalBuffer=null,!1)}setBinaryValue(e,n=null){const{state:r,settings:i}=this;if(!e)return r.binaryValue=null,r.binaryAccessor=null,!1;if(i.noAlloc)return!1;if(r.binaryValue===e)return this.clearNeedsUpdate(),!0;if(r.binaryValue=e,this.setNeedsRedraw(),i.transform||n!==this.startIndices){ArrayBuffer.isView(e)&&(e={value:e});const l=e;Fr(ArrayBuffer.isView(l.value),`invalid ${i.accessor}`);const u=!!l.size&&l.size!==this.size;return r.binaryAccessor=zK(l.value,{size:l.size||this.size,stride:l.stride,offset:l.offset,startIndices:n,nested:u}),!1}return this.clearNeedsUpdate(),this.setData(e),!0}getVertexOffset(e){const{startIndices:n}=this;return(n?e<n.length?n[e]:this.numInstances:e)*this.size}getValue(){const e=this.settings.shaderAttributes,n=super.getValue();if(!e)return n;for(const r in e)Object.assign(n,super.getValue(r,e[r]));return n}getBufferLayout(e){this.state.layoutChanged=!1;const n=this.settings.shaderAttributes,r=super._getBufferLayout(),{stepMode:i}=this.settings;if(i==="dynamic"?r.stepMode=e?e.isInstanced?"instance":"vertex":"instance":r.stepMode=i??"vertex",!n)return r;for(const a in n){const l=super._getBufferLayout(a,n[a]);r.attributes.push(...l.attributes)}return r}_autoUpdater(e,{data:n,startRow:r,endRow:i,props:a,numInstances:l}){if(e.constant)return;const{settings:u,state:f,value:h,size:g,startIndices:m}=e,{accessor:v,transform:S}=u,w=f.binaryAccessor||(typeof v=="function"?v:a[v]);Fr(typeof w=="function",`accessor "${v}" is not a function`);let E=e.getVertexOffset(r);const{iterable:b,objectInfo:C}=LK(n,r,i);for(const T of b){C.index++;let A=w(T,C);if(S&&(A=S.call(this,A)),m){const O=(C.index<m.length-1?m[C.index+1]:l)-m[C.index];if(A&&Array.isArray(A[0])){let x=E;for(const N of A)e._normalizeValue(N,h,x),x+=g}else A&&A.length>g?h.set(A,E):(e._normalizeValue(A,C.target,0),eq({target:h,source:C.target,start:E,count:O}));E+=O*g}else e._normalizeValue(A,h,E),E+=g}}_validateAttributeUpdaters(){const{settings:e}=this;if(!(e.noAlloc||typeof e.update=="function"))throw new Error(`Attribute ${this.id} missing update or accessor`)}_checkAttributeArray(){const{value:e}=this,n=Math.min(4,this.size);if(e&&e.length>=n){let r=!0;switch(n){case 4:r=r&&Number.isFinite(e[3]);case 3:r=r&&Number.isFinite(e[2]);case 2:r=r&&Number.isFinite(e[1]);case 1:r=r&&Number.isFinite(e[0]);break;default:r=!1}if(!r)throw new Error(`Illegal attribute generated for ${this.id}`)}}}function p0(t){const{source:e,target:n,start:r=0,size:i,getData:a}=t,l=t.end||n.length,u=e.length,f=l-r;if(u>f){n.set(e.subarray(0,f),r);return}if(n.set(e,r),!a)return;let h=u;for(;h<f;){const g=a(h,e);for(let m=0;m<i;m++)n[r+h]=g[m]||0,h++}}function jK({source:t,target:e,size:n,getData:r,sourceStartIndices:i,targetStartIndices:a}){if(!i||!a)return p0({source:t,target:e,size:n,getData:r}),e;let l=0,u=0;const f=r&&((g,m)=>r(g+u,m)),h=Math.min(i.length,a.length);for(let g=1;g<h;g++){const m=i[g]*n,v=a[g]*n;p0({source:t.subarray(l,m),target:e,start:u,end:v,size:n,getData:f}),l=m,u=v}return u<e.length&&p0({source:[],target:e,start:u,size:n,getData:f}),e}function WK(t){const{device:e,settings:n,value:r}=t,i=new xO(e,n);return i.setData({value:r instanceof Float64Array?new Float64Array(0):new Float32Array(0),normalized:n.normalized}),i}function MO(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error(`No defined attribute type for size "${t}"`)}}function OO(t){switch(t){case 1:return"float32";case 2:return"float32x2";case 3:return"float32x3";case 4:return"float32x4";default:throw new Error("invalid type size")}}function PO(t){t.push(t.shift())}function XK(t,e){const{doublePrecision:n,settings:r,value:i,size:a}=t,l=n&&i instanceof Float64Array?2:1;let u=0;const{shaderAttributes:f}=t.settings;if(f)for(const h of Object.values(f))u=Math.max(u,h.vertexOffset??0);return(r.noAlloc?i.length:(e+u)*a)*l}function NO({device:t,source:e,target:n}){return(!n||n.byteLength<e.byteLength)&&(n==null||n.destroy(),n=t.createBuffer({byteLength:e.byteLength,usage:e.usage})),n}function IO({device:t,buffer:e,attribute:n,fromLength:r,toLength:i,fromStartIndices:a,getData:l=u=>u}){const u=n.doublePrecision&&n.value instanceof Float64Array?2:1,f=n.size*u,h=n.byteOffset,g=n.settings.bytesPerElement<4?h/n.settings.bytesPerElement*4:h,m=n.startIndices,v=a&&m,S=n.isConstant;if(!v&&e&&r>=i)return e;const w=n.value instanceof Float64Array?Float32Array:n.value.constructor,E=S?n.value:new w(n.getBuffer().readSyncWebGL(h,i*w.BYTES_PER_ELEMENT).buffer);if(n.settings.normalized&&!S){const A=l;l=(O,x)=>n.normalizeConstant(A(O,x))}const b=S?(A,O)=>l(E,O):(A,O)=>l(E.subarray(A+h,A+h+f),O),C=e?new Float32Array(e.readSyncWebGL(g,r*4).buffer):new Float32Array(0),T=new Float32Array(i);return jK({source:C,target:T,sourceStartIndices:a,targetStartIndices:m,size:f,getData:b}),(!e||e.byteLength<T.byteLength+g)&&(e==null||e.destroy(),e=t.createBuffer({byteLength:T.byteLength+g,usage:35050})),e.write(T,g),e}class DO{constructor({device:e,attribute:n,timeline:r}){this.buffers=[],this.currentLength=0,this.device=e,this.transition=new cp(r),this.attribute=n,this.attributeInTransition=WK(n),this.currentStartIndices=n.startIndices}get inProgress(){return this.transition.inProgress}start(e,n,r=1/0){this.settings=e,this.currentStartIndices=this.attribute.startIndices,this.currentLength=XK(this.attribute,n),this.transition.start({...e,duration:r})}update(){const e=this.transition.update();return e&&this.onUpdate(),e}setBuffer(e){this.attributeInTransition.setData({buffer:e,normalized:this.attribute.settings.normalized,value:this.attributeInTransition.value})}cancel(){this.transition.cancel()}delete(){this.cancel();for(const e of this.buffers)e.destroy();this.buffers.length=0}}class qK extends DO{constructor({device:e,attribute:n,timeline:r}){super({device:e,attribute:n,timeline:r}),this.type="interpolation",this.transform=QK(e,n)}start(e,n){const r=this.currentLength,i=this.currentStartIndices;if(super.start(e,n,e.duration),e.duration<=0){this.transition.cancel();return}const{buffers:a,attribute:l}=this;PO(a),a[0]=IO({device:this.device,buffer:a[0],attribute:l,fromLength:r,toLength:this.currentLength,fromStartIndices:i,getData:e.enter}),a[1]=NO({device:this.device,source:a[0],target:a[1]}),this.setBuffer(a[1]);const{transform:u}=this,f=u.model;let h=Math.floor(this.currentLength/l.size);FO(l)&&(h/=2),f.setVertexCount(h),l.isConstant?(f.setAttributes({aFrom:a[0]}),f.setConstantAttributes({aTo:l.value})):f.setAttributes({aFrom:a[0],aTo:l.getBuffer()}),u.transformFeedback.setBuffers({vCurrent:a[1]})}onUpdate(){const{duration:e,easing:n}=this.settings,{time:r}=this.transition;let i=r/e;n&&(i=n(i));const{model:a}=this.transform,l={time:i};a.shaderInputs.setProps({interpolation:l}),this.transform.run({discard:!0})}delete(){super.delete(),this.transform.destroy()}}const YK=`uniform interpolationUniforms {
|
|
|
float time;
|
|
|
} interpolation;
|
|
|
`,cA={name:"interpolation",vs:YK,uniformTypes:{time:"f32"}},KK=`#version 300 es
|
|
|
#define SHADER_NAME interpolation-transition-vertex-shader
|
|
|
|
|
|
in ATTRIBUTE_TYPE aFrom;
|
|
|
in ATTRIBUTE_TYPE aTo;
|
|
|
out ATTRIBUTE_TYPE vCurrent;
|
|
|
|
|
|
void main(void) {
|
|
|
vCurrent = mix(aFrom, aTo, interpolation.time);
|
|
|
gl_Position = vec4(0.0);
|
|
|
}
|
|
|
`,ZK=`#version 300 es
|
|
|
#define SHADER_NAME interpolation-transition-vertex-shader
|
|
|
|
|
|
in ATTRIBUTE_TYPE aFrom;
|
|
|
in ATTRIBUTE_TYPE aFrom64Low;
|
|
|
in ATTRIBUTE_TYPE aTo;
|
|
|
in ATTRIBUTE_TYPE aTo64Low;
|
|
|
out ATTRIBUTE_TYPE vCurrent;
|
|
|
out ATTRIBUTE_TYPE vCurrent64Low;
|
|
|
|
|
|
vec2 mix_fp64(vec2 a, vec2 b, float x) {
|
|
|
vec2 range = sub_fp64(b, a);
|
|
|
return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));
|
|
|
}
|
|
|
|
|
|
void main(void) {
|
|
|
for (int i=0; i<ATTRIBUTE_SIZE; i++) {
|
|
|
vec2 value = mix_fp64(vec2(aFrom[i], aFrom64Low[i]), vec2(aTo[i], aTo64Low[i]), interpolation.time);
|
|
|
vCurrent[i] = value.x;
|
|
|
vCurrent64Low[i] = value.y;
|
|
|
}
|
|
|
gl_Position = vec4(0.0);
|
|
|
}
|
|
|
`;function FO(t){return t.doublePrecision&&t.value instanceof Float64Array}function QK(t,e){const n=e.size,r=MO(n),i=OO(n),a=e.getBufferLayout();return FO(e)?new If(t,{vs:ZK,bufferLayout:[{name:"aFrom",byteStride:8*n,attributes:[{attribute:"aFrom",format:i,byteOffset:0},{attribute:"aFrom64Low",format:i,byteOffset:4*n}]},{name:"aTo",byteStride:8*n,attributes:[{attribute:"aTo",format:i,byteOffset:0},{attribute:"aTo64Low",format:i,byteOffset:4*n}]}],modules:[nj,cA],defines:{ATTRIBUTE_TYPE:r,ATTRIBUTE_SIZE:n},moduleSettings:{},varyings:["vCurrent","vCurrent64Low"],bufferMode:35980,disableWarnings:!0}):new If(t,{vs:KK,bufferLayout:[{name:"aFrom",format:i},{name:"aTo",format:a.attributes[0].format}],modules:[cA],defines:{ATTRIBUTE_TYPE:r},varyings:["vCurrent"],disableWarnings:!0})}class GK extends DO{constructor({device:e,attribute:n,timeline:r}){super({device:e,attribute:n,timeline:r}),this.type="spring",this.texture=iZ(e),this.framebuffer=sZ(e,this.texture),this.transform=rZ(e,n)}start(e,n){const r=this.currentLength,i=this.currentStartIndices;super.start(e,n);const{buffers:a,attribute:l}=this;for(let f=0;f<2;f++)a[f]=IO({device:this.device,buffer:a[f],attribute:l,fromLength:r,toLength:this.currentLength,fromStartIndices:i,getData:e.enter});a[2]=NO({device:this.device,source:a[0],target:a[2]}),this.setBuffer(a[1]);const{model:u}=this.transform;u.setVertexCount(Math.floor(this.currentLength/l.size)),l.isConstant?u.setConstantAttributes({aTo:l.value}):u.setAttributes({aTo:l.getBuffer()})}onUpdate(){const{buffers:e,transform:n,framebuffer:r,transition:i}=this,a=this.settings;n.model.setAttributes({aPrev:e[0],aCur:e[1]}),n.transformFeedback.setBuffers({vNext:e[2]});const l={stiffness:a.stiffness,damping:a.damping};n.model.shaderInputs.setProps({spring:l}),n.run({framebuffer:r,discard:!1,parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]}),PO(e),this.setBuffer(e[1]),this.device.readPixelsToArrayWebGL(r)[0]>0||i.end()}delete(){super.delete(),this.transform.destroy(),this.texture.destroy(),this.framebuffer.destroy()}}const JK=`uniform springUniforms {
|
|
|
float damping;
|
|
|
float stiffness;
|
|
|
} spring;
|
|
|
`,eZ={name:"spring",vs:JK,uniformTypes:{damping:"f32",stiffness:"f32"}},tZ=`#version 300 es
|
|
|
#define SHADER_NAME spring-transition-vertex-shader
|
|
|
|
|
|
#define EPSILON 0.00001
|
|
|
|
|
|
in ATTRIBUTE_TYPE aPrev;
|
|
|
in ATTRIBUTE_TYPE aCur;
|
|
|
in ATTRIBUTE_TYPE aTo;
|
|
|
out ATTRIBUTE_TYPE vNext;
|
|
|
out float vIsTransitioningFlag;
|
|
|
|
|
|
ATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {
|
|
|
ATTRIBUTE_TYPE velocity = cur - prev;
|
|
|
ATTRIBUTE_TYPE delta = dest - cur;
|
|
|
ATTRIBUTE_TYPE force = delta * spring.stiffness;
|
|
|
ATTRIBUTE_TYPE resistance = velocity * spring.damping;
|
|
|
return force - resistance + velocity + cur;
|
|
|
}
|
|
|
|
|
|
void main(void) {
|
|
|
bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;
|
|
|
vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;
|
|
|
|
|
|
vNext = getNextValue(aCur, aPrev, aTo);
|
|
|
gl_Position = vec4(0, 0, 0, 1);
|
|
|
gl_PointSize = 100.0;
|
|
|
}
|
|
|
`,nZ=`#version 300 es
|
|
|
#define SHADER_NAME spring-transition-is-transitioning-fragment-shader
|
|
|
|
|
|
in float vIsTransitioningFlag;
|
|
|
|
|
|
out vec4 fragColor;
|
|
|
|
|
|
void main(void) {
|
|
|
if (vIsTransitioningFlag == 0.0) {
|
|
|
discard;
|
|
|
}
|
|
|
fragColor = vec4(1.0);
|
|
|
}`;function rZ(t,e){const n=MO(e.size),r=OO(e.size);return new If(t,{vs:tZ,fs:nZ,bufferLayout:[{name:"aPrev",format:r},{name:"aCur",format:r},{name:"aTo",format:e.getBufferLayout().attributes[0].format}],varyings:["vNext"],modules:[eZ],defines:{ATTRIBUTE_TYPE:n},parameters:{depthCompare:"always",blendColorOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}})}function iZ(t){return t.createTexture({data:new Uint8Array(4),format:"rgba8unorm",mipmaps:!1,width:1,height:1})}function sZ(t,e){return t.createFramebuffer({id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,colorAttachments:[e]})}const aZ={interpolation:qK,spring:GK};class oZ{constructor(e,{id:n,timeline:r}){if(!e)throw new Error("AttributeTransitionManager is constructed without device");this.id=n,this.device=e,this.timeline=r,this.transitions={},this.needsRedraw=!1,this.numInstances=1}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:n,numInstances:r}){this.numInstances=r||1;for(const i in e){const a=e[i],l=a.getTransitionSetting(n);l&&this._updateAttribute(i,a,l)}for(const i in this.transitions){const a=e[i];(!a||!a.getTransitionSetting(n))&&this._removeTransition(i)}}hasAttribute(e){const n=this.transitions[e];return n&&n.inProgress}getAttributes(){const e={};for(const n in this.transitions){const r=this.transitions[n];r.inProgress&&(e[n]=r.attributeInTransition)}return e}run(){if(this.numInstances===0)return!1;for(const n in this.transitions)this.transitions[n].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].delete(),delete this.transitions[e]}_updateAttribute(e,n,r){const i=this.transitions[e];let a=!i||i.type!==r.type;if(a){i&&this._removeTransition(e);const l=aZ[r.type];l?this.transitions[e]=new l({attribute:n,timeline:this.timeline,device:this.device}):(Sn.error(`unsupported transition type '${r.type}'`)(),a=!1)}(a||n.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(r,this.numInstances))}}const uA="attributeManager.invalidate",lZ="attributeManager.updateStart",cZ="attributeManager.updateEnd",uZ="attribute.updateStart",fZ="attribute.allocate",dZ="attribute.updateEnd";class hZ{constructor(e,{id:n="attribute-manager",stats:r,timeline:i}={}){this.mergeBoundsMemoized=Zf(hX),this.id=n,this.device=e,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=r,this.attributeTransitionManager=new oZ(e,{id:`${n}-transitions`,timeline:i}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const n=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,n&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(e){this._add(e)}addInstanced(e){this._add(e,{stepMode:"instance"})}remove(e){for(const n of e)this.attributes[n]!==void 0&&(this.attributes[n].delete(),delete this.attributes[n])}invalidate(e,n){const r=this._invalidateTrigger(e,n);Hr(uA,this,e,r)}invalidateAll(e){for(const n in this.attributes)this.attributes[n].setNeedsUpdate(n,e);Hr(uA,this,"all")}update({data:e,numInstances:n,startIndices:r=null,transitions:i,props:a={},buffers:l={},context:u={}}){let f=!1;Hr(lZ,this),this.stats&&this.stats.get("Update Attributes").timeStart();for(const h in this.attributes){const g=this.attributes[h],m=g.settings.accessor;g.startIndices=r,g.numInstances=n,a[h]&&Sn.removed(`props.${h}`,`data.attributes.${h}`)(),g.setExternalBuffer(l[h])||g.setBinaryValue(typeof m=="string"?l[m]:void 0,e.startIndices)||typeof m=="string"&&!l[m]&&g.setConstantValue(a[m])||g.needsUpdate()&&(f=!0,this._updateAttribute({attribute:g,numInstances:n,data:e,props:a,context:u})),this.needsRedraw=this.needsRedraw||g.needsRedraw()}f&&Hr(cZ,this,n),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:i})}updateTransition(){const{attributeTransitionManager:e}=this,n=e.run();return this.needsRedraw=this.needsRedraw||n,n}getAttributes(){return{...this.attributes,...this.attributeTransitionManager.getAttributes()}}getBounds(e){const n=e.map(r=>{var i;return(i=this.attributes[r])==null?void 0:i.getBounds()});return this.mergeBoundsMemoized(n)}getChangedAttributes(e={clearChangedFlags:!1}){const{attributes:n,attributeTransitionManager:r}=this,i={...r.getAttributes()};for(const a in n){const l=n[a];l.needsRedraw(e)&&!r.hasAttribute(a)&&(i[a]=l)}return i}getBufferLayouts(e){return Object.values(this.getAttributes()).map(n=>n.getBufferLayout(e))}_add(e,n){for(const r in e){const i=e[r],a={...i,id:r,size:i.isIndexed&&1||i.size||1,...n};this.attributes[r]=new xO(this.device,a)}this._mapUpdateTriggersToAttributes()}_mapUpdateTriggersToAttributes(){const e={};for(const n in this.attributes)this.attributes[n].getUpdateTriggers().forEach(i=>{e[i]||(e[i]=[]),e[i].push(n)});this.updateTriggers=e}_invalidateTrigger(e,n){const{attributes:r,updateTriggers:i}=this,a=i[e];return a&&a.forEach(l=>{const u=r[l];u&&u.setNeedsUpdate(u.id,n)}),a}_updateAttribute(e){const{attribute:n,numInstances:r}=e;if(Hr(uZ,n),n.constant){n.setConstantValue(n.value);return}n.allocate(r)&&Hr(fZ,n,r),n.updateBuffer(e)&&(this.needsRedraw=!0,Hr(dZ,n,r))}}class gZ extends cp{get value(){return this._value}_onUpdate(){const{time:e,settings:{fromValue:n,toValue:r,duration:i,easing:a}}=this,l=a(e/i);this._value=yg(n,r,l)}}const fA=1e-5;function dA(t,e,n,r,i){const a=e-t,u=(n-e)*i,f=-a*r;return u+f+a+e}function pZ(t,e,n,r,i){if(Array.isArray(n)){const a=[];for(let l=0;l<n.length;l++)a[l]=dA(t[l],e[l],n[l],r,i);return a}return dA(t,e,n,r,i)}function hA(t,e){if(Array.isArray(t)){let n=0;for(let r=0;r<t.length;r++){const i=t[r]-e[r];n+=i*i}return Math.sqrt(n)}return Math.abs(t-e)}class mZ extends cp{get value(){return this._currValue}_onUpdate(){const{fromValue:e,toValue:n,damping:r,stiffness:i}=this.settings,{_prevValue:a=e,_currValue:l=e}=this;let u=pZ(a,l,n,r,i);const f=hA(u,n),h=hA(u,l);f<fA&&h<fA&&(u=n,this.end()),this._prevValue=l,this._currValue=u}}const vZ={interpolation:gZ,spring:mZ};class _Z{constructor(e){this.transitions=new Map,this.timeline=e}get active(){return this.transitions.size>0}add(e,n,r,i){const{transitions:a}=this;if(a.has(e)){const f=a.get(e),{value:h=f.settings.fromValue}=f;n=h,this.remove(e)}if(i=RO(i),!i)return;const l=vZ[i.type];if(!l){Sn.error(`unsupported transition type '${i.type}'`)();return}const u=new l(this.timeline);u.start({...i,fromValue:n,toValue:r}),a.set(e,u)}remove(e){const{transitions:n}=this;n.has(e)&&(n.get(e).cancel(),n.delete(e))}update(){const e={};for(const[n,r]of this.transitions)r.update(),e[n]=r.value,r.inProgress||this.remove(n);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}function yZ(t){const e=t[Fo];for(const n in e){const r=e[n],{validate:i}=r;if(i&&!i(t[n],r))throw new Error(`Invalid prop ${n}: ${t[n]}`)}}function bZ(t,e){const n=kO({newProps:t,oldProps:e,propTypes:t[Fo],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),r=EZ(t,e);let i=!1;return r||(i=wZ(t,e)),{dataChanged:r,propsChanged:n,updateTriggersChanged:i,extensionsChanged:TZ(t,e),transitionsChanged:SZ(t,e)}}function SZ(t,e){if(!t.transitions)return!1;const n={},r=t[Fo];let i=!1;for(const a in t.transitions){const l=r[a],u=l&&l.type;(u==="number"||u==="color"||u==="array")&&py(t[a],e[a],l)&&(n[a]=!0,i=!0)}return i?n:!1}function kO({newProps:t,oldProps:e,ignoreProps:n={},propTypes:r={},triggerName:i="props"}){if(e===t)return!1;if(typeof t!="object"||t===null)return`${i} changed shallowly`;if(typeof e!="object"||e===null)return`${i} changed shallowly`;for(const a of Object.keys(t))if(!(a in n)){if(!(a in e))return`${i}.${a} added`;const l=py(t[a],e[a],r[a]);if(l)return`${i}.${a} ${l}`}for(const a of Object.keys(e))if(!(a in n)){if(!(a in t))return`${i}.${a} dropped`;if(!Object.hasOwnProperty.call(t,a)){const l=py(t[a],e[a],r[a]);if(l)return`${i}.${a} ${l}`}}return!1}function py(t,e,n){let r=n&&n.equal;return r&&!r(t,e,n)||!r&&(r=t&&e&&t.equals,r&&!r.call(t,e))?"changed deeply":!r&&e!==t?"changed shallowly":null}function EZ(t,e){if(e===null)return"oldProps is null, initial diff";let n=!1;const{dataComparator:r,_dataDiff:i}=t;return r?r(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied"),n&&i&&(n=i(t.data,e.data)||n),n}function wZ(t,e){if(e===null)return{all:!0};if("all"in t.updateTriggers&&gA(t,e,"all"))return{all:!0};const n={};let r=!1;for(const i in t.updateTriggers)i!=="all"&&gA(t,e,i)&&(n[i]=!0,r=!0);return r?n:!1}function TZ(t,e){if(e===null)return!0;const n=e.extensions,{extensions:r}=t;if(r===n)return!1;if(!n||!r||r.length!==n.length)return!0;for(let i=0;i<r.length;i++)if(!r[i].equals(n[i]))return!0;return!1}function gA(t,e,n){let r=t.updateTriggers[n];r=r??{};let i=e.updateTriggers[n];return i=i??{},kO({oldProps:i,newProps:r,triggerName:n})}const CZ="count(): argument not an object",AZ="count(): argument not a container";function RZ(t){if(!MZ(t))throw new Error(CZ);if(typeof t.count=="function")return t.count();if(Number.isFinite(t.size))return t.size;if(Number.isFinite(t.length))return t.length;if(xZ(t))return Object.keys(t).length;throw new Error(AZ)}function xZ(t){return t!==null&&typeof t=="object"&&t.constructor===Object}function MZ(t){return t!==null&&typeof t=="object"}function pA(t,e){if(!e)return t;const n={...t,...e};if("defines"in e&&(n.defines={...t.defines,...e.defines}),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some(r=>r.name==="project64"))){const r=n.modules.findIndex(i=>i.name==="project32");r>=0&&n.modules.splice(r,1)}if("inject"in e)if(!t.inject)n.inject=e.inject;else{const r={...t.inject};for(const i in e.inject)r[i]=(r[i]||"")+e.inject[i];n.inject=r}return n}const OZ={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},my={};function PZ(t,e,n,r){if(n instanceof Kn)return n;n.constructor&&n.constructor.name!=="Object"&&(n={data:n});let i=null;n.compressed&&(i={minFilter:"linear",mipmapFilter:n.data.length>1?"nearest":"linear"});const a=e.createTexture({...n,sampler:{...OZ,...i,...r},mipmaps:!0});return my[a.id]=t,a}function NZ(t,e){!e||!(e instanceof Kn)||my[e.id]===t&&(e.delete(),delete my[e.id])}const IZ={boolean:{validate(t,e){return!0},equal(t,e,n){return!!t==!!e}},number:{validate(t,e){return Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)}},color:{validate(t,e){return e.optional&&!t||vy(t)&&(t.length===3||t.length===4)},equal(t,e,n){return Gi(t,e,1)}},accessor:{validate(t,e){const n=Rg(t);return n==="function"||n===Rg(e.value)},equal(t,e,n){return typeof e=="function"?!0:Gi(t,e,1)}},array:{validate(t,e){return e.optional&&!t||vy(t)},equal(t,e,n){const{compare:r}=n,i=Number.isInteger(r)?r:r?1:0;return r?Gi(t,e,i):t===e}},object:{equal(t,e,n){if(n.ignore)return!0;const{compare:r}=n,i=Number.isInteger(r)?r:r?1:0;return r?Gi(t,e,i):t===e}},function:{validate(t,e){return e.optional&&!t||typeof t=="function"},equal(t,e,n){return!n.compare&&n.ignore!==!1||t===e}},data:{transform:(t,e,n)=>{if(!t)return t;const{dataTransform:r}=n.props;return r?r(t):typeof t.shape=="string"&&t.shape.endsWith("-table")&&Array.isArray(t.data)?t.data:t}},image:{transform:(t,e,n)=>{const r=n.context;return!r||!r.device?null:PZ(n.id,r.device,t,{...e.parameters,...n.props.textureParameters})},release:(t,e,n)=>{NZ(n.id,t)}}};function DZ(t){const e={},n={},r={};for(const[i,a]of Object.entries(t)){const l=a==null?void 0:a.deprecatedFor;if(l)r[i]=Array.isArray(l)?l:[l];else{const u=FZ(i,a);e[i]=u,n[i]=u.value}}return{propTypes:e,defaultProps:n,deprecatedProps:r}}function FZ(t,e){switch(Rg(e)){case"object":return ju(t,e);case"array":return ju(t,{type:"array",value:e,compare:!1});case"boolean":return ju(t,{type:"boolean",value:e});case"number":return ju(t,{type:"number",value:e});case"function":return ju(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function ju(t,e){return"type"in e?{name:t,...IZ[e.type],...e}:"value"in e?{name:t,type:Rg(e.value),...e}:{name:t,type:"object",value:e}}function vy(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function Rg(t){return vy(t)?"array":t===null?"null":typeof t}function kZ(t,e){let n;for(let a=e.length-1;a>=0;a--){const l=e[a];"extensions"in l&&(n=l.extensions)}const r=_y(t.constructor,n),i=Object.create(r);i[Cg]=t,i[Vo]={},i[ka]={};for(let a=0;a<e.length;++a){const l=e[a];for(const u in l)i[u]=l[u]}return Object.freeze(i),i}const BZ="_mergedDefaultProps";function _y(t,e){if(!(t instanceof up.constructor))return{};let n=BZ;if(e)for(const i of e){const a=i.constructor;a&&(n+=`:${a.extensionName||a.name}`)}const r=BO(t,n);return r||(t[n]=UZ(t,e||[]))}function UZ(t,e){if(!t.prototype)return null;const r=Object.getPrototypeOf(t),i=_y(r),a=BO(t,"defaultProps")||{},l=DZ(a),u=Object.assign(Object.create(null),i,l.defaultProps),f=Object.assign(Object.create(null),i==null?void 0:i[Fo],l.propTypes),h=Object.assign(Object.create(null),i==null?void 0:i[u0],l.deprecatedProps);for(const g of e){const m=_y(g.constructor);m&&(Object.assign(u,m),Object.assign(f,m[Fo]),Object.assign(h,m[u0]))}return LZ(u,t),$Z(u,f),zZ(u,h),u[Fo]=f,u[u0]=h,e.length===0&&!Cb(t,"_propTypes")&&(t._propTypes=f),u}function LZ(t,e){const n=HZ(e);Object.defineProperties(t,{id:{writable:!0,value:n}})}function zZ(t,e){for(const n in e)Object.defineProperty(t,n,{enumerable:!1,set(r){const i=`${this.id}: ${n}`;for(const a of e[n])Cb(this,a)||(this[a]=r);Sn.deprecated(i,e[n].join("/"))()}})}function $Z(t,e){const n={},r={};for(const i in e){const a=e[i],{name:l,value:u}=a;a.async&&(n[l]=u,r[l]=VZ(l))}t[ic]=n,t[Vo]={},Object.defineProperties(t,r)}function VZ(t){return{enumerable:!0,set(e){typeof e=="string"||e instanceof Promise||AO(e)?this[Vo][t]=e:this[ka][t]=e},get(){if(this[ka]){if(t in this[ka])return this[ka][t]||this[ic][t];if(t in this[Vo]){const e=this[Cg]&&this[Cg].internalState;if(e&&e.hasAsyncProp(t))return e.getAsyncProp(t)||this[ic][t]}}return this[ic][t]}}}function Cb(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function BO(t,e){return Cb(t,e)&&t[e]}function HZ(t){const e=t.componentName;return e||Sn.warn(`${t.name}.componentName not specified`)(),e||t.name}let jZ=0;class up{constructor(...e){this.props=kZ(this,e),this.id=this.props.id,this.count=jZ++}clone(e){const{props:n}=this,r={};for(const i in n[ic])i in n[ka]?r[i]=n[ka][i]:i in n[Vo]&&(r[i]=n[Vo][i]);return new this.constructor({...n,...r,...e})}}up.componentName="Component";up.defaultProps={};const WZ=Object.freeze({});class XZ{constructor(e){this.component=e,this.asyncProps={},this.onAsyncPropUpdated=()=>{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const n=this.asyncProps[e];n&&n.type&&n.type.release&&n.type.release(n.resolvedValue,n.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||WZ}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const n=this.asyncProps[e];return n&&n.resolvedValue}isAsyncPropLoading(e){if(e){const n=this.asyncProps[e];return!!(n&&n.pendingLoadCount>0&&n.pendingLoadCount!==n.resolvedLoadCount)}for(const n in this.asyncProps)if(this.isAsyncPropLoading(n))return!0;return!1}reloadAsyncProp(e,n){this._watchPromise(e,Promise.resolve(n))}setAsyncProps(e){this.component=e[Cg]||this.component;const n=e[ka]||{},r=e[Vo]||e,i=e[ic]||{};for(const a in n){const l=n[a];this._createAsyncPropData(a,i[a]),this._updateAsyncProp(a,l),n[a]=this.getAsyncProp(a)}for(const a in r){const l=r[a];this._createAsyncPropData(a,i[a]),this._updateAsyncProp(a,l)}}_fetch(e,n){return null}_onResolve(e,n){}_onError(e,n){}_updateAsyncProp(e,n){if(this._didAsyncInputValueChange(e,n)){if(typeof n=="string"&&(n=this._fetch(e,n)),n instanceof Promise){this._watchPromise(e,n);return}if(AO(n)){this._resolveAsyncIterable(e,n);return}this._setPropValue(e,n)}}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}_didAsyncInputValueChange(e,n){const r=this.asyncProps[e];return n===r.resolvedValue||n===r.lastValue?!1:(r.lastValue=n,!0)}_setPropValue(e,n){this._freezeAsyncOldProps();const r=this.asyncProps[e];r&&(n=this._postProcessValue(r,n),r.resolvedValue=n,r.pendingLoadCount++,r.resolvedLoadCount=r.pendingLoadCount)}_setAsyncPropValue(e,n,r){const i=this.asyncProps[e];i&&r>=i.resolvedLoadCount&&n!==void 0&&(this._freezeAsyncOldProps(),i.resolvedValue=n,i.resolvedLoadCount=r,this.onAsyncPropUpdated(e,n))}_watchPromise(e,n){const r=this.asyncProps[e];if(r){r.pendingLoadCount++;const i=r.pendingLoadCount;n.then(a=>{this.component&&(a=this._postProcessValue(r,a),this._setAsyncPropValue(e,a,i),this._onResolve(e,a))}).catch(a=>{this._onError(e,a)})}}async _resolveAsyncIterable(e,n){if(e!=="data"){this._setPropValue(e,n);return}const r=this.asyncProps[e];if(!r)return;r.pendingLoadCount++;const i=r.pendingLoadCount;let a=[],l=0;for await(const u of n){if(!this.component)return;const{dataTransform:f}=this.component.props;f?a=f(u,a):a=a.concat(u),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,this._setAsyncPropValue(e,a,i)}this._onResolve(e,a)}_postProcessValue(e,n){const r=e.type;return r&&this.component&&(r.release&&r.release(e.resolvedValue,r,this.component),r.transform)?r.transform(n,r,this.component):n}_createAsyncPropData(e,n){if(!this.asyncProps[e]){const i=this.component&&this.component.props[Fo];this.asyncProps[e]={type:i&&i[e],lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0}}}}class qZ extends XZ{constructor({attributeManager:e,layer:n}){super(n),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(e,n){const r=this.layer,i=r==null?void 0:r.props.fetch;return i?i(n,{propName:e,layer:r}):super._fetch(e,n)}_onResolve(e,n){const r=this.layer;if(r){const i=r.props.onDataLoad;e==="data"&&i&&i(n,{propName:e,layer:r})}}_onError(e,n){const r=this.layer;r&&r.raiseError(n,`loading ${e} of ${this.layer}`)}}const YZ="layer.changeFlag",KZ="layer.initialize",ZZ="layer.update",QZ="layer.finalize",GZ="layer.matched",mA=2**24-1,JZ=Object.freeze([]),eQ=Zf(({oldViewport:t,viewport:e})=>t.equals(e));let Vi=new Uint8ClampedArray(0);const tQ={data:{type:"data",value:JZ,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:t=>t&&t.__diff,optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:(t,{propName:e,layer:n,loaders:r,loadOptions:i,signal:a})=>{const{resourceManager:l}=n.context;i=i||n.getLoadOptions(),r=r||n.props.loaders,a&&(i={...i,fetch:{...i==null?void 0:i.fetch,signal:a}});let u=l.contains(t);return!u&&!i&&(l.add({resourceId:t,data:jh(t,r),persistent:!1}),u=!0),u?l.subscribe({resourceId:t,onChange:f=>{var h;return(h=n.internalState)==null?void 0:h.reloadAsyncProp(e,f)},consumerId:n.id,requestId:e}):jh(t,r,i)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:cn.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:({layerIndex:t})=>[0,-t*100]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class Jf extends up{constructor(){super(...arguments),this.internalState=null,this.lifecycle=Vl.NO_STATE,this.parent=null}static get componentName(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}get root(){let e=this;for(;e.parent;)e=e.parent;return e}toString(){return`${this.constructor.layerName||this.constructor.name}({id: '${this.props.id}'})`}project(e){Fr(this.internalState);const n=this.internalState.viewport||this.context.viewport,r=eO(e,{viewport:n,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,a,l]=KM(r,n.pixelProjectionMatrix);return e.length===2?[i,a]:[i,a,l]}unproject(e){return Fr(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(e)}projectPosition(e,n){Fr(this.internalState);const r=this.internalState.viewport||this.context.viewport;return yX(e,{viewport:r,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...n})}get isComposite(){return!1}get isDrawable(){return!0}setState(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return this.internalState?!this.internalState.isAsyncPropLoading():!1}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){const e=this.state;return e&&(e.models||e.model&&[e.model])||[]}setShaderModuleProps(...e){for(const n of this.getModels())n.shaderInputs.setProps(...e)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){const{coordinateSystem:e}=this.props;return e===cn.DEFAULT||e===cn.LNGLAT||e===cn.CARTESIAN}onHover(e,n){return this.props.onHover&&this.props.onHover(e,n)||!1}onClick(e,n){return this.props.onClick&&this.props.onClick(e,n)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(e,n=[]){return n[0]=e+1&255,n[1]=e+1>>8&255,n[2]=e+1>>8>>8&255,n}decodePickingColor(e){Fr(e instanceof Uint8Array);const[n,r,i]=e;return n+r*256+i*65536-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&this.state.numInstances!==void 0?this.state.numInstances:RZ(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){var e;return(e=this.getAttributeManager())==null?void 0:e.getBounds(["positions","instancePositions"])}getShaders(e){e=pA(e,{disableWarnings:!0,modules:this.context.defaultShaderModules});for(const n of this.props.extensions)e=pA(e,n.getShaders.call(this,n));return e}shouldUpdateState(e){return e.changeFlags.propsOrDataChanged}updateState(e){const n=this.getAttributeManager(),{dataChanged:r}=e.changeFlags;if(r&&n)if(Array.isArray(r))for(const i of r)n.invalidateAll(i);else n.invalidateAll();if(n){const{props:i}=e,a=this.internalState.hasPickingBuffer,l=Number.isInteger(i.highlightedObjectIndex)||i.pickable||i.extensions.some(u=>u.getNeedsPickingBuffer.call(this,u));if(a!==l){this.internalState.hasPickingBuffer=l;const{pickingColors:u,instancePickingColors:f}=n.attributes,h=u||f;h&&(l&&h.constant&&(h.constant=!1,n.invalidate(h.id)),!h.value&&!l&&(h.constant=!0,h.value=[0,0,0]))}}}finalizeState(e){for(const r of this.getModels())r.destroy();const n=this.getAttributeManager();n&&n.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(e){for(const n of this.getModels())n.draw(e.renderPass)}getPickingInfo({info:e,mode:n,sourceLayer:r}){const{index:i}=e;return i>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[i]),e}raiseError(e,n){var r,i,a,l;n&&(e=new Error(`${n}: ${e.message}`,{cause:e})),(i=(r=this.props).onError)!=null&&i.call(r,e)||(l=(a=this.context)==null?void 0:a.onError)==null||l.call(a,e,this)}getNeedsRedraw(e={clearRedrawFlags:!1}){return this._getNeedsRedraw(e)}needsUpdate(){return this.internalState?this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()):!1}hasUniformTransition(){var e;return((e=this.internalState)==null?void 0:e.uniformTransitions.active)||!1}activateViewport(e){if(!this.internalState)return;const n=this.internalState.viewport;this.internalState.viewport=e,(!n||!eQ({oldViewport:n,viewport:e}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(e="all"){const n=this.getAttributeManager();n&&(e==="all"?n.invalidateAll():n.invalidate(e))}updateAttributes(e){let n=!1;for(const r in e)e[r].layoutChanged()&&(n=!0);for(const r of this.getModels())this._setModelAttributes(r,e,n)}_updateAttributes(){const e=this.getAttributeManager();if(!e)return;const n=this.props,r=this.getNumInstances(),i=this.getStartIndices();e.update({data:n.data,numInstances:r,startIndices:i,props:n,transitions:n.transitions,buffers:n.data.attributes,context:this});const a=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(a)}_updateAttributeTransition(){const e=this.getAttributeManager();e&&e.updateTransition()}_updateUniformTransition(){const{uniformTransitions:e}=this.internalState;if(e.active){const n=e.update(),r=Object.create(this.props);for(const i in n)Object.defineProperty(r,i,{value:n[i]});return r}return this.props}calculateInstancePickingColors(e,{numInstances:n}){if(e.constant)return;const r=Math.floor(Vi.length/4);if(this.internalState.usesPickingColorCache=!0,r<n){n>mA&&Sn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Vi=Nf.allocate(Vi,n,{size:4,copy:!0,maxCount:Math.max(n,mA)});const i=Math.floor(Vi.length/4),a=[0,0,0];for(let l=r;l<i;l++)this.encodePickingColor(l,a),Vi[l*4+0]=a[0],Vi[l*4+1]=a[1],Vi[l*4+2]=a[2],Vi[l*4+3]=0}e.value=Vi.subarray(0,n*4)}_setModelAttributes(e,n,r=!1){var u;if(!Object.keys(n).length)return;if(r){const f=this.getAttributeManager();e.setBufferLayout(f.getBufferLayouts(e)),n=f.getAttributes()}const i=((u=e.userData)==null?void 0:u.excludeAttributes)||{},a={},l={};for(const f in n){if(i[f])continue;const h=n[f].getValue();for(const g in h){const m=h[g];m instanceof $n?n[f].settings.isIndexed?e.setIndexBuffer(m):a[g]=m:m&&(l[g]=m)}}e.setAttributes(a),e.setConstantAttributes(l)}disablePickingIndex(e){const n=this.props.data;if(!("attributes"in n)){this._disablePickingIndex(e);return}const{pickingColors:r,instancePickingColors:i}=this.getAttributeManager().attributes,a=r||i,l=a&&n.attributes&&n.attributes[a.id];if(l&&l.value){const u=l.value,f=this.encodePickingColor(e);for(let h=0;h<n.length;h++){const g=a.getVertexOffset(h);u[g]===f[0]&&u[g+1]===f[1]&&u[g+2]===f[2]&&this._disablePickingIndex(h)}}else this._disablePickingIndex(e)}_disablePickingIndex(e){const{pickingColors:n,instancePickingColors:r}=this.getAttributeManager().attributes,i=n||r;if(!i)return;const a=i.getVertexOffset(e),l=i.getVertexOffset(e+1);i.buffer.write(new Uint8Array(l-a),a)}restorePickingColors(){const{pickingColors:e,instancePickingColors:n}=this.getAttributeManager().attributes,r=e||n;r&&(this.internalState.usesPickingColorCache&&r.value.buffer!==Vi.buffer&&(r.value=Vi.subarray(0,r.value.length)),r.updateSubBuffer({startOffset:0}))}_initialize(){Fr(!this.internalState),Fr(Number.isFinite(this.props.coordinateSystem)),Hr(KZ,this);const e=this._getAttributeManager();e&&e.addInstanced({instancePickingColors:{type:"uint8",size:4,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new qZ({attributeManager:e,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Sn.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),e)}),this.internalState.uniformTransitions=new _Z(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(const n of this.props.extensions)n.initializeState.call(this,this.context,n);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(e){Hr(GZ,this,this===e);const{state:n,internalState:r}=e;this!==e&&(this.internalState=r,this.state=n,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){const e=this.needsUpdate();if(Hr(ZZ,this,e),!e)return;const n=this.props,r=this.context,i=this.internalState,a=r.viewport,l=this._updateUniformTransition();i.propsInTransition=l,r.viewport=i.viewport||a,this.props=l;try{const u=this._getUpdateParams(),f=this.getModels();if(r.device)this.updateState(u);else try{this.updateState(u)}catch{}for(const g of this.props.extensions)g.updateState.call(this,u,g);this.setNeedsRedraw(),this._updateAttributes();const h=this.getModels()[0]!==f[0];this._postUpdate(u,h)}finally{r.viewport=a,this.props=n,this._clearChangeFlags(),i.needsUpdate=!1,i.resetOldProps()}}_finalize(){Hr(QZ,this),this.finalizeState(this.context);for(const e of this.props.extensions)e.finalizeState.call(this,this.context,e)}_drawLayer({renderPass:e,shaderModuleProps:n=null,uniforms:r={},parameters:i={}}){this._updateAttributeTransition();const a=this.props,l=this.context;this.props=this.internalState.propsInTransition||a;try{n&&this.setShaderModuleProps(n);const{getPolygonOffset:u}=this.props,f=u&&u(r)||[0,0];l.device instanceof Ba&&l.device.setParametersWebGL({polygonOffset:f});for(const h of this.getModels())h.setParameters(i);if(l.device instanceof Ba)l.device.withParametersWebGL(i,()=>{const h={renderPass:e,shaderModuleProps:n,uniforms:r,parameters:i,context:l};for(const g of this.props.extensions)g.draw.call(this,h,g);this.draw(h)});else{const h={renderPass:e,shaderModuleProps:n,uniforms:r,parameters:i,context:l};for(const g of this.props.extensions)g.draw.call(this,h,g);this.draw(h)}}finally{this.props=a}}getChangeFlags(){var e;return(e=this.internalState)==null?void 0:e.changeFlags}setChangeFlags(e){if(!this.internalState)return;const{changeFlags:n}=this.internalState;for(const i in e)if(e[i]){let a=!1;switch(i){case"dataChanged":const l=e[i],u=n[i];l&&Array.isArray(u)&&(n.dataChanged=Array.isArray(l)?u.concat(l):l,a=!0);default:n[i]||(n[i]=e[i],a=!0)}a&&Hr(YZ,this,i,e)}const r=!!(n.dataChanged||n.updateTriggersChanged||n.propsChanged||n.extensionsChanged);n.propsOrDataChanged=r,n.somethingChanged=r||n.viewportChanged||n.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(e,n){var i;const r=bZ(e,n);if(r.updateTriggersChanged)for(const a in r.updateTriggersChanged)r.updateTriggersChanged[a]&&this.invalidateAttribute(a);if(r.transitionsChanged)for(const a in r.transitionsChanged)this.internalState.uniformTransitions.add(a,n[a],e[a],(i=e.transitions)==null?void 0:i[a]);return this.setChangeFlags(r)}validateProps(){yZ(this.props)}updateAutoHighlight(e){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(e)}_updateAutoHighlight(e){const n={highlightedObjectColor:e.picked?e.color:null},{highlightColor:r}=this.props;e.picked&&typeof r=="function"&&(n.highlightColor=r(e)),this.setShaderModuleProps({picking:n}),this.setNeedsRedraw()}_getAttributeManager(){const e=this.context;return new hZ(e.device,{id:this.props.id,stats:e.stats,timeline:e.timeline})}_postUpdate(e,n){const{props:r,oldProps:i}=e,a=this.state.model;a!=null&&a.isInstanced&&a.setInstanceCount(this.getNumInstances());const{autoHighlight:l,highlightedObjectIndex:u,highlightColor:f}=r;if(n||i.autoHighlight!==l||i.highlightedObjectIndex!==u||i.highlightColor!==f){const h={};Array.isArray(f)&&(h.highlightColor=f),(n||i.autoHighlight!==l||u!==i.highlightedObjectIndex)&&(h.highlightedObjectColor=Number.isFinite(u)&&u>=0?this.encodePickingColor(u):null),this.setShaderModuleProps({picking:h})}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(e){if(!this.internalState)return!1;let n=!1;n=n||this.internalState.needsRedraw&&this.id;const r=this.getAttributeManager(),i=r?r.getNeedsRedraw(e):!1;if(n=n||i,n)for(const a of this.props.extensions)a.onNeedsRedraw.call(this,a);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags,n}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}Jf.defaultProps=tQ;Jf.layerName="Layer";const vA=`uniform scatterplotUniforms {
|
|
|
float radiusScale;
|
|
|
float radiusMinPixels;
|
|
|
float radiusMaxPixels;
|
|
|
float lineWidthScale;
|
|
|
float lineWidthMinPixels;
|
|
|
float lineWidthMaxPixels;
|
|
|
float stroked;
|
|
|
bool filled;
|
|
|
bool antialiasing;
|
|
|
bool billboard;
|
|
|
highp int radiusUnits;
|
|
|
highp int lineWidthUnits;
|
|
|
} scatterplot;
|
|
|
`,nQ={name:"scatterplot",vs:vA,fs:vA,uniformTypes:{radiusScale:"f32",radiusMinPixels:"f32",radiusMaxPixels:"f32",lineWidthScale:"f32",lineWidthMinPixels:"f32",lineWidthMaxPixels:"f32",stroked:"f32",filled:"f32",antialiasing:"f32",billboard:"f32",radiusUnits:"i32",lineWidthUnits:"i32"}},rQ=`#version 300 es
|
|
|
#define SHADER_NAME scatterplot-layer-vertex-shader
|
|
|
in vec3 positions;
|
|
|
in vec3 instancePositions;
|
|
|
in vec3 instancePositions64Low;
|
|
|
in float instanceRadius;
|
|
|
in float instanceLineWidths;
|
|
|
in vec4 instanceFillColors;
|
|
|
in vec4 instanceLineColors;
|
|
|
in vec3 instancePickingColors;
|
|
|
out vec4 vFillColor;
|
|
|
out vec4 vLineColor;
|
|
|
out vec2 unitPosition;
|
|
|
out float innerUnitRadius;
|
|
|
out float outerRadiusPixels;
|
|
|
void main(void) {
|
|
|
geometry.worldPosition = instancePositions;
|
|
|
outerRadiusPixels = clamp(
|
|
|
project_size_to_pixel(scatterplot.radiusScale * instanceRadius, scatterplot.radiusUnits),
|
|
|
scatterplot.radiusMinPixels, scatterplot.radiusMaxPixels
|
|
|
);
|
|
|
float lineWidthPixels = clamp(
|
|
|
project_size_to_pixel(scatterplot.lineWidthScale * instanceLineWidths, scatterplot.lineWidthUnits),
|
|
|
scatterplot.lineWidthMinPixels, scatterplot.lineWidthMaxPixels
|
|
|
);
|
|
|
outerRadiusPixels += scatterplot.stroked * lineWidthPixels / 2.0;
|
|
|
float edgePadding = scatterplot.antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0;
|
|
|
unitPosition = edgePadding * positions.xy;
|
|
|
geometry.uv = unitPosition;
|
|
|
geometry.pickingColor = instancePickingColors;
|
|
|
innerUnitRadius = 1.0 - scatterplot.stroked * lineWidthPixels / outerRadiusPixels;
|
|
|
if (scatterplot.billboard) {
|
|
|
gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);
|
|
|
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
|
vec3 offset = edgePadding * positions * outerRadiusPixels;
|
|
|
DECKGL_FILTER_SIZE(offset, geometry);
|
|
|
gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);
|
|
|
} else {
|
|
|
vec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels);
|
|
|
DECKGL_FILTER_SIZE(offset, geometry);
|
|
|
gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);
|
|
|
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
|
}
|
|
|
vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * layer.opacity);
|
|
|
DECKGL_FILTER_COLOR(vFillColor, geometry);
|
|
|
vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * layer.opacity);
|
|
|
DECKGL_FILTER_COLOR(vLineColor, geometry);
|
|
|
}
|
|
|
`,iQ=`#version 300 es
|
|
|
#define SHADER_NAME scatterplot-layer-fragment-shader
|
|
|
precision highp float;
|
|
|
in vec4 vFillColor;
|
|
|
in vec4 vLineColor;
|
|
|
in vec2 unitPosition;
|
|
|
in float innerUnitRadius;
|
|
|
in float outerRadiusPixels;
|
|
|
out vec4 fragColor;
|
|
|
void main(void) {
|
|
|
geometry.uv = unitPosition;
|
|
|
float distToCenter = length(unitPosition) * outerRadiusPixels;
|
|
|
float inCircle = scatterplot.antialiasing ?
|
|
|
smoothedge(distToCenter, outerRadiusPixels) :
|
|
|
step(distToCenter, outerRadiusPixels);
|
|
|
if (inCircle == 0.0) {
|
|
|
discard;
|
|
|
}
|
|
|
if (scatterplot.stroked > 0.5) {
|
|
|
float isLine = scatterplot.antialiasing ?
|
|
|
smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :
|
|
|
step(innerUnitRadius * outerRadiusPixels, distToCenter);
|
|
|
if (scatterplot.filled) {
|
|
|
fragColor = mix(vFillColor, vLineColor, isLine);
|
|
|
} else {
|
|
|
if (isLine == 0.0) {
|
|
|
discard;
|
|
|
}
|
|
|
fragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);
|
|
|
}
|
|
|
} else if (scatterplot.filled == false) {
|
|
|
discard;
|
|
|
} else {
|
|
|
fragColor = vFillColor;
|
|
|
}
|
|
|
fragColor.a *= inCircle;
|
|
|
DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
|
}
|
|
|
`,_A=[0,0,0,255],sQ={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:"accessor",value:t=>t.position},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:_A},getLineColor:{type:"accessor",value:_A},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class xg extends Jf{getShaders(){return super.getShaders({vs:rQ,fs:iQ,modules:[WM,QM,nQ]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(e){var n;super.updateState(e),e.changeFlags.extensionsChanged&&((n=this.state.model)==null||n.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){const{radiusUnits:n,radiusScale:r,radiusMinPixels:i,radiusMaxPixels:a,stroked:l,filled:u,billboard:f,antialiasing:h,lineWidthUnits:g,lineWidthScale:m,lineWidthMinPixels:v,lineWidthMaxPixels:S}=this.props,w={stroked:l,filled:u,billboard:f,antialiasing:h,radiusUnits:zo[n],radiusScale:r,radiusMinPixels:i,radiusMaxPixels:a,lineWidthUnits:zo[g],lineWidthScale:m,lineWidthMinPixels:v,lineWidthMaxPixels:S},E=this.state.model;E.shaderInputs.setProps({scatterplot:w}),E.draw(this.context.renderPass)}_getModel(){const e=[-1,-1,0,1,-1,0,-1,1,0,1,1,0];return new $o(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new _b({topology:"triangle-strip",attributes:{positions:{size:3,value:new Float32Array(e)}}}),isInstanced:!0})}}xg.defaultProps=sQ;xg.layerName="ScatterplotLayer";const aQ={COUNTER_CLOCKWISE:-1};function oQ(t,e,n={}){return lQ(t,n)!==e?(uQ(t,n),!0):!1}function lQ(t,e={}){return Math.sign(cQ(t,e))}const yA={x:0,y:1,z:2};function cQ(t,e={}){const{start:n=0,end:r=t.length,plane:i="xy"}=e,a=e.size||2;let l=0;const u=yA[i[0]],f=yA[i[1]];for(let h=n,g=r-a;h<r;h+=a)l+=(t[h+u]-t[g+u])*(t[h+f]+t[g+f]),g=h;return l/2}function uQ(t,e){const{start:n=0,end:r=t.length,size:i=2}=e,a=(r-n)/i,l=Math.floor(a/2);for(let u=0;u<l;++u){const f=n+u*i,h=n+(a-1-u)*i;for(let g=0;g<i;++g){const m=t[f+g];t[f+g]=t[h+g],t[h+g]=m}}}class fQ extends _b{constructor(e){const{indices:n,attributes:r}=dQ(e);super({...e,indices:n,attributes:r})}}function dQ(t){const{radius:e,height:n=1,nradial:r=10}=t;let{vertices:i}=t;i&&(Sn.assert(i.length>=r),i=i.flatMap(S=>[S[0],S[1]]),oQ(i,aQ.COUNTER_CLOCKWISE));const a=n>0,l=r+1,u=a?l*3+1:r,f=Math.PI*2/r,h=new Uint16Array(a?r*3*2:0),g=new Float32Array(u*3),m=new Float32Array(u*3);let v=0;if(a){for(let S=0;S<l;S++){const w=S*f,E=S%r,b=Math.sin(w),C=Math.cos(w);for(let T=0;T<2;T++)g[v+0]=i?i[E*2]:C*e,g[v+1]=i?i[E*2+1]:b*e,g[v+2]=(1/2-T)*n,m[v+0]=i?i[E*2]:C,m[v+1]=i?i[E*2+1]:b,v+=3}g[v+0]=g[v-3],g[v+1]=g[v-2],g[v+2]=g[v-1],v+=3}for(let S=a?0:1;S<l;S++){const w=Math.floor(S/2)*Math.sign(.5-S%2),E=w*f,b=(w+r)%r,C=Math.sin(E),T=Math.cos(E);g[v+0]=i?i[b*2]:T*e,g[v+1]=i?i[b*2+1]:C*e,g[v+2]=n/2,m[v+2]=1,v+=3}if(a){let S=0;for(let w=0;w<r;w++)h[S++]=w*2+0,h[S++]=w*2+2,h[S++]=w*2+0,h[S++]=w*2+1,h[S++]=w*2+1,h[S++]=w*2+3}return{indices:h,attributes:{POSITION:{size:3,value:g},NORMAL:{size:3,value:m}}}}const bA=`uniform columnUniforms {
|
|
|
float radius;
|
|
|
float angle;
|
|
|
vec2 offset;
|
|
|
bool extruded;
|
|
|
bool stroked;
|
|
|
bool isStroke;
|
|
|
float coverage;
|
|
|
float elevationScale;
|
|
|
float edgeDistance;
|
|
|
float widthScale;
|
|
|
float widthMinPixels;
|
|
|
float widthMaxPixels;
|
|
|
highp int radiusUnits;
|
|
|
highp int widthUnits;
|
|
|
} column;
|
|
|
`,hQ={name:"column",vs:bA,fs:bA,uniformTypes:{radius:"f32",angle:"f32",offset:"vec2<f32>",extruded:"f32",stroked:"f32",isStroke:"f32",coverage:"f32",elevationScale:"f32",edgeDistance:"f32",widthScale:"f32",widthMinPixels:"f32",widthMaxPixels:"f32",radiusUnits:"i32",widthUnits:"i32"}},gQ=`#version 300 es
|
|
|
#define SHADER_NAME column-layer-vertex-shader
|
|
|
in vec3 positions;
|
|
|
in vec3 normals;
|
|
|
in vec3 instancePositions;
|
|
|
in float instanceElevations;
|
|
|
in vec3 instancePositions64Low;
|
|
|
in vec4 instanceFillColors;
|
|
|
in vec4 instanceLineColors;
|
|
|
in float instanceStrokeWidths;
|
|
|
in vec3 instancePickingColors;
|
|
|
out vec4 vColor;
|
|
|
#ifdef FLAT_SHADING
|
|
|
out vec3 cameraPosition;
|
|
|
out vec4 position_commonspace;
|
|
|
#endif
|
|
|
void main(void) {
|
|
|
geometry.worldPosition = instancePositions;
|
|
|
vec4 color = column.isStroke ? instanceLineColors : instanceFillColors;
|
|
|
mat2 rotationMatrix = mat2(cos(column.angle), sin(column.angle), -sin(column.angle), cos(column.angle));
|
|
|
float elevation = 0.0;
|
|
|
float strokeOffsetRatio = 1.0;
|
|
|
if (column.extruded) {
|
|
|
elevation = instanceElevations * (positions.z + 1.0) / 2.0 * column.elevationScale;
|
|
|
} else if (column.stroked) {
|
|
|
float widthPixels = clamp(
|
|
|
project_size_to_pixel(instanceStrokeWidths * column.widthScale, column.widthUnits),
|
|
|
column.widthMinPixels, column.widthMaxPixels) / 2.0;
|
|
|
float halfOffset = project_pixel_size(widthPixels) / project_size(column.edgeDistance * column.coverage * column.radius);
|
|
|
if (column.isStroke) {
|
|
|
strokeOffsetRatio -= sign(positions.z) * halfOffset;
|
|
|
} else {
|
|
|
strokeOffsetRatio -= halfOffset;
|
|
|
}
|
|
|
}
|
|
|
float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);
|
|
|
float dotRadius = column.radius * column.coverage * shouldRender;
|
|
|
geometry.pickingColor = instancePickingColors;
|
|
|
vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);
|
|
|
vec3 centroidPosition64Low = instancePositions64Low;
|
|
|
vec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + column.offset) * dotRadius;
|
|
|
if (column.radiusUnits == UNIT_METERS) {
|
|
|
offset = project_size(offset);
|
|
|
}
|
|
|
vec3 pos = vec3(offset, 0.);
|
|
|
DECKGL_FILTER_SIZE(pos, geometry);
|
|
|
gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);
|
|
|
geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));
|
|
|
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
|
if (column.extruded && !column.isStroke) {
|
|
|
#ifdef FLAT_SHADING
|
|
|
cameraPosition = project.cameraPosition;
|
|
|
position_commonspace = geometry.position;
|
|
|
vColor = vec4(color.rgb, color.a * layer.opacity);
|
|
|
#else
|
|
|
vec3 lightColor = lighting_getLightColor(color.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);
|
|
|
vColor = vec4(lightColor, color.a * layer.opacity);
|
|
|
#endif
|
|
|
} else {
|
|
|
vColor = vec4(color.rgb, color.a * layer.opacity);
|
|
|
}
|
|
|
DECKGL_FILTER_COLOR(vColor, geometry);
|
|
|
}
|
|
|
`,pQ=`#version 300 es
|
|
|
#define SHADER_NAME column-layer-fragment-shader
|
|
|
precision highp float;
|
|
|
out vec4 fragColor;
|
|
|
in vec4 vColor;
|
|
|
#ifdef FLAT_SHADING
|
|
|
in vec3 cameraPosition;
|
|
|
in vec4 position_commonspace;
|
|
|
#endif
|
|
|
void main(void) {
|
|
|
fragColor = vColor;
|
|
|
geometry.uv = vec2(0.);
|
|
|
#ifdef FLAT_SHADING
|
|
|
if (column.extruded && !column.isStroke && !bool(picking.isActive)) {
|
|
|
vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
|
|
|
fragColor.rgb = lighting_getLightColor(vColor.rgb, cameraPosition, position_commonspace.xyz, normal);
|
|
|
}
|
|
|
#endif
|
|
|
DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
|
}
|
|
|
`,Mg=[0,0,0,255],mQ={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,flatShading:!1,getPosition:{type:"accessor",value:t=>t.position},getFillColor:{type:"accessor",value:Mg},getLineColor:{type:"accessor",value:Mg},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class Ab extends Jf{getShaders(){const e={},{flatShading:n}=this.props;return n&&(e.FLAT_SHADING=1),super.getShaders({vs:gQ,fs:pQ,defines:e,modules:[WM,n?IM:NM,QM,hQ]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:Mg},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:Mg},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState(e){var u;super.updateState(e);const{props:n,oldProps:r,changeFlags:i}=e,a=i.extensionsChanged||n.flatShading!==r.flatShading;a&&((u=this.state.models)==null||u.forEach(f=>f.destroy()),this.setState(this._getModels()),this.getAttributeManager().invalidateAll());const l=this.getNumInstances();this.state.fillModel.setInstanceCount(l),this.state.wireframeModel.setInstanceCount(l),(a||n.diskResolution!==r.diskResolution||n.vertices!==r.vertices||(n.extruded||n.stroked)!==(r.extruded||r.stroked))&&this._updateGeometry(n)}getGeometry(e,n,r){const i=new fQ({radius:1,height:r?2:0,vertices:n,nradial:e});let a=0;if(n)for(let l=0;l<e;l++){const u=n[l],f=Math.sqrt(u[0]*u[0]+u[1]*u[1]);a+=f/e}else a=1;return this.setState({edgeDistance:Math.cos(Math.PI/e)*a}),i}_getModels(){const e=this.getShaders(),n=this.getAttributeManager().getBufferLayouts(),r=new $o(this.context.device,{...e,id:`${this.props.id}-fill`,bufferLayout:n,isInstanced:!0}),i=new $o(this.context.device,{...e,id:`${this.props.id}-wireframe`,bufferLayout:n,isInstanced:!0});return{fillModel:r,wireframeModel:i,models:[i,r]}}_updateGeometry({diskResolution:e,vertices:n,extruded:r,stroked:i}){const a=this.getGeometry(e,n,r||i);this.setState({fillVertexCount:a.attributes.POSITION.value.length/3});const l=this.state.fillModel,u=this.state.wireframeModel;l.setGeometry(a),l.setTopology("triangle-strip"),l.setIndexBuffer(null),u.setGeometry(a),u.setTopology("line-list")}draw({uniforms:e}){const{lineWidthUnits:n,lineWidthScale:r,lineWidthMinPixels:i,lineWidthMaxPixels:a,radiusUnits:l,elevationScale:u,extruded:f,filled:h,stroked:g,wireframe:m,offset:v,coverage:S,radius:w,angle:E}=this.props,b=this.state.fillModel,C=this.state.wireframeModel,{fillVertexCount:T,edgeDistance:A}=this.state,O={radius:w,angle:E/180*Math.PI,offset:v,extruded:f,stroked:g,coverage:S,elevationScale:u,edgeDistance:A,radiusUnits:zo[l],widthUnits:zo[n],widthScale:r,widthMinPixels:i,widthMaxPixels:a};f&&m&&(C.shaderInputs.setProps({column:{...O,isStroke:!0}}),C.draw(this.context.renderPass)),h&&(b.setVertexCount(T),b.shaderInputs.setProps({column:{...O,isStroke:!1}}),b.draw(this.context.renderPass)),!f&&g&&(b.setVertexCount(T*2/3),b.shaderInputs.setProps({column:{...O,isStroke:!0}}),b.draw(this.context.renderPass))}}Ab.layerName="ColumnLayer";Ab.defaultProps=mQ;const vQ={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",value:[1,1]}};class Rb extends Ab{_updateGeometry(){const e=new $X;this.state.fillModel.setGeometry(e)}draw({uniforms:e}){const{elevationScale:n,extruded:r,offset:i,coverage:a,cellSize:l,angle:u,radiusUnits:f}=this.props,h=this.state.fillModel,g={radius:l/2,radiusUnits:zo[f],angle:u,offset:i,extruded:r,stroked:!1,coverage:a,elevationScale:n,edgeDistance:1,isStroke:!1,widthUnits:0,widthScale:0,widthMinPixels:0,widthMaxPixels:0};h.shaderInputs.setProps({column:g}),h.draw(this.context.renderPass)}}Rb.layerName="GridCellLayer";Rb.defaultProps=vQ;const _Q=typeof window<"u"?_.useLayoutEffect:_.useEffect;function Og(t,e){for(;t;){if(t===e)return!0;t=Object.getPrototypeOf(t)}return!1}const yQ={position:"absolute",zIndex:-1};function UO(t,e){if(typeof t=="function")return t(e);if(Array.isArray(t))return t.map(n=>UO(n,e));if(fp(t)){if(bQ(t))return e.style=yQ,_.cloneElement(t,e);if(SQ(t))return _.cloneElement(t,e)}return t}function fp(t){return t&&typeof t=="object"&&"type"in t||!1}function bQ(t){var e;return(e=t.props)==null?void 0:e.mapStyle}function SQ(t){const e=t.type;return e&&e.deckGLViewProps}function yy(t){if(typeof t=="function")return _.createElement(Dc,{},t);if(Array.isArray(t))return t.map(yy);if(fp(t)){if(t.type===_.Fragment)return yy(t.props.children);if(Og(t.type,Dc))return t}return t}function EQ({children:t,layers:e=[],views:n=null}){const r=[],i=[],a={};return _.Children.forEach(yy(t),l=>{if(fp(l)){const u=l.type;if(Og(u,Jf)){const f=wQ(u,l.props);i.push(f)}else r.push(l);if(Og(u,Dc)&&u!==Dc&&l.props.id){const f=new u(l.props);a[f.id]=f}}else l&&r.push(l)}),Object.keys(a).length>0&&(Array.isArray(n)?n.forEach(l=>{a[l.id]=l}):n&&(a[n.id]=n),n=Object.values(a)),e=i.length>0?[...i,...e]:e,{layers:e,children:r,views:n}}function wQ(t,e){const n={},r=t.defaultProps||{};for(const i in e)r[i]!==e[i]&&(n[i]=e[i]);return new t(n)}const TQ=_.createContext();function CQ({children:t,deck:e,ContextProvider:n=TQ.Provider}){const{viewManager:r}=e||{};if(!r||!r.views.length)return[];const i={},a=r.views[0].id;for(const l of t){let u=a,f=l;fp(l)&&Og(l.type,Dc)&&(u=l.props.id||a,f=l.props.children);const h=r.getViewport(u),g=r.getViewState(u);if(h){g.padding=h.padding;const{x:m,y:v,width:S,height:w}=h;f=UO(f,{x:m,y:v,width:S,height:w,viewport:h,viewState:g}),i[u]||(i[u]={viewport:h,children:[]}),i[u].children.push(f)}}return Object.keys(i).map(l=>{const{viewport:u,children:f}=i[l],{x:h,y:g,width:m,height:v}=u,S={position:"absolute",left:h,top:g,width:m,height:v},w=`view-${l}`,E=_.createElement("div",{key:w,id:w,style:S},...f),b={deck:e,viewport:u,container:e.canvas.offsetParent,eventManager:e.eventManager,onViewStateChange:T=>{T.viewId=l,e._onViewStateChange(T)},widgets:[]},C=`view-${l}-context`;return _.createElement(n,{key:C,value:b},E)})}const AQ={mixBlendMode:null};function RQ({width:t,height:e,style:n}){const r={position:"absolute",zIndex:0,left:0,top:0,width:t,height:e},i={left:0,top:0};if(n)for(const a in n)a in AQ?i[a]=n[a]:r[a]=n[a];return{containerStyle:r,canvasStyle:i}}function xQ(t){return{get deck(){return t.deck},pickObject:e=>t.deck.pickObject(e),pickMultipleObjects:e=>t.deck.pickMultipleObjects(e),pickObjects:e=>t.deck.pickObjects(e)}}function LO(t){t.redrawReason&&(t.deck._drawLayers(t.redrawReason),t.redrawReason=null)}function MQ(t,e,n){const r=new e({...n,_customRender:i=>{t.redrawReason=i;const a=r.getViewports();t.lastRenderedViewports!==a?t.forceUpdate():LO(t)}});return r}function OQ(t,e){const[n,r]=_.useState(0),a=_.useRef({control:null,version:n,forceUpdate:()=>r(x=>x+1)}).current,l=_.useRef(null),u=_.useRef(null),f=_.useMemo(()=>EQ(t),[t.layers,t.views,t.children]);let h=!0;const g=x=>{var N;return h&&t.viewState?(a.viewStateUpdateRequested=x,null):(a.viewStateUpdateRequested=null,(N=t.onViewStateChange)==null?void 0:N.call(t,x))},m=x=>{var N;h?a.interactionStateUpdateRequested=x:(a.interactionStateUpdateRequested=null,(N=t.onInteractionStateChange)==null||N.call(t,x))},v=_.useMemo(()=>{const x={widgets:[],...t,style:null,width:"100%",height:"100%",parent:l.current,canvas:u.current,layers:f.layers,views:f.views,onViewStateChange:g,onInteractionStateChange:m};return delete x._customRender,a.deck&&a.deck.setProps(x),x},[t]);_.useEffect(()=>{const x=t.Deck||Tb;return a.deck=MQ(a,x,{...v,parent:l.current,canvas:u.current}),()=>{var N;return(N=a.deck)==null?void 0:N.finalize()}},[]),_Q(()=>{LO(a);const{viewStateUpdateRequested:x,interactionStateUpdateRequested:N}=a;x&&g(x),N&&m(N)}),_.useImperativeHandle(e,()=>xQ(a),[]);const S=a.deck&&a.deck.isInitialized?a.deck.getViewports():void 0,{ContextProvider:w,width:E="100%",height:b="100%",id:C,style:T}=t,{containerStyle:A,canvasStyle:O}=_.useMemo(()=>RQ({width:E,height:b,style:T}),[E,b,T]);if(!a.viewStateUpdateRequested&&a.lastRenderedViewports===S||a.version!==n){a.lastRenderedViewports=S,a.version=n;const x=CQ({children:f.children,deck:a.deck,ContextProvider:w}),N=_.createElement("canvas",{key:"canvas",id:C||"deckgl-overlay",ref:u,style:O});a.control=_.createElement("div",{id:`${C||"deckgl"}-wrapper`,ref:l,style:A},[N,x])}return h=!1,a.control}const PQ=_.forwardRef(OQ),NQ=_.createContext(null);function IQ(t,e){const n=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0,i=Array.isArray(e)?e[0]:e?e.x:0,a=Array.isArray(e)?e[1]:e?e.y:0;return n===i&&r===a}function ps(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!ps(t[n],e[n]))return!1;return!0}else if(Array.isArray(e))return!1;if(typeof t=="object"&&typeof e=="object"){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n)if(!e.hasOwnProperty(i)||!ps(t[i],e[i]))return!1;return!0}return!1}function SA(t){return{longitude:t.center.lng,latitude:t.center.lat,zoom:t.zoom,pitch:t.pitch,bearing:t.bearing,padding:t.padding}}function EA(t,e){const n=e.viewState||e,r={};if("longitude"in n&&"latitude"in n&&(n.longitude!==t.center.lng||n.latitude!==t.center.lat)){const i=t.center.constructor;r.center=new i(n.longitude,n.latitude)}return"zoom"in n&&n.zoom!==t.zoom&&(r.zoom=n.zoom),"bearing"in n&&n.bearing!==t.bearing&&(r.bearing=n.bearing),"pitch"in n&&n.pitch!==t.pitch&&(r.pitch=n.pitch),n.padding&&t.padding&&!ps(n.padding,t.padding)&&(r.padding=n.padding),r}const DQ=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function wA(t){if(!t)return null;if(typeof t=="string"||("toJS"in t&&(t=t.toJS()),!t.layers))return t;const e={};for(const r of t.layers)e[r.id]=r;const n=t.layers.map(r=>{let i=null;"interactive"in r&&(i=Object.assign({},r),delete i.interactive);const a=e[r.ref];if(a){i=i||Object.assign({},r),delete i.ref;for(const l of DQ)l in a&&(i[l]=a[l])}return i||r});return{...t,layers:n}}const TA={version:8,sources:{},layers:[]},CA={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},AA={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},RA={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},FQ=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],kQ=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class kc{constructor(e,n,r){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=i=>{const a=this.props[RA[i.type]];a?a(i):i.type==="error"&&console.error(i.error)},this._onCameraEvent=i=>{if(this._internalUpdate)return;i.viewState=this._propsedCameraUpdate||SA(this._map.transform);const a=this.props[AA[i.type]];a&&a(i)},this._onCameraUpdate=i=>this._internalUpdate?i:(this._propsedCameraUpdate=SA(i),EA(i,this.props)),this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const a=this.props[CA[i.type]];a&&(this.props.interactiveLayerIds&&i.type!=="mouseover"&&i.type!=="mouseout"&&(i.features=this._hoveredFeatures||this._queryRenderedFeatures(i.point)),a(i),delete i.features)},this._MapClass=e,this.props=n,this._initialize(r)}get map(){return this._map}setProps(e){const n=this.props;this.props=e;const r=this._updateSettings(e,n),i=this._updateSize(e),a=this._updateViewState(e);this._updateStyle(e,n),this._updateStyleComponents(e),this._updateHandlers(e,n),(r||i||a&&!this._map.isMoving())&&this.redraw()}static reuse(e,n){const r=kc.savedMaps.pop();if(!r)return null;const i=r.map,a=i.getContainer();for(n.className=a.className;a.childNodes.length>0;)n.appendChild(a.childNodes[0]);i._container=n;const l=i._resizeObserver;l&&(l.disconnect(),l.observe(n)),r.setProps({...e,styleDiffing:!1}),i.resize();const{initialViewState:u}=e;return u&&(u.bounds?i.fitBounds(u.bounds,{...u.fitBoundsOptions,duration:0}):r._updateViewState(u)),i.isStyleLoaded()?i.fire("load"):i.once("style.load",()=>i.fire("load")),i._update(),r}_initialize(e){const{props:n}=this,{mapStyle:r=TA}=n,i={...n,...n.initialViewState,container:e,style:wA(r)},a=i.initialViewState||i.viewState||i;if(Object.assign(i,{center:[a.longitude||0,a.latitude||0],zoom:a.zoom||0,pitch:a.pitch||0,bearing:a.bearing||0}),n.gl){const u=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=u,n.gl)}const l=new this._MapClass(i);a.padding&&l.setPadding(a.padding),n.cursor&&(l.getCanvas().style.cursor=n.cursor),l.transformCameraUpdate=this._onCameraUpdate,l.on("style.load",()=>{var u;this._styleComponents={light:l.getLight(),sky:l.getSky(),projection:(u=l.getProjection)==null?void 0:u.call(l),terrain:l.getTerrain()},this._updateStyleComponents(this.props)}),l.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const u in CA)l.on(u,this._onPointerEvent);for(const u in AA)l.on(u,this._onCameraEvent);for(const u in RA)l.on(u,this._onEvent);this._map=l}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),kc.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}_updateSize(e){const{viewState:n}=e;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(e){const n=this._map,r=n.transform;if(!n.isMoving()){const a=EA(r,e);if(Object.keys(a).length>0)return this._internalUpdate=!0,n.jumpTo(a),this._internalUpdate=!1,!0}return!1}_updateSettings(e,n){const r=this._map;let i=!1;for(const a of FQ)if(a in e&&!ps(e[a],n[a])){i=!0;const l=r[`set${a[0].toUpperCase()}${a.slice(1)}`];l==null||l.call(r,e[a])}return i}_updateStyle(e,n){if(e.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=e.cursor||""),e.mapStyle!==n.mapStyle){const{mapStyle:r=TA,styleDiffing:i=!0}=e,a={diff:i};"localIdeographFontFamily"in e&&(a.localIdeographFontFamily=e.localIdeographFontFamily),this._map.setStyle(wA(r),a)}}_updateStyleComponents({light:e,projection:n,sky:r,terrain:i}){var u,f;const a=this._map,l=this._styleComponents;a.style._loaded&&(e&&!ps(e,l.light)&&(l.light=e,a.setLight(e)),n&&!ps(n,l.projection)&&n!==((u=l.projection)==null?void 0:u.type)&&(l.projection=typeof n=="string"?{type:n}:n,(f=a.setProjection)==null||f.call(a,l.projection)),r&&!ps(r,l.sky)&&(l.sky=r,a.setSky(r)),i!==void 0&&!ps(i,l.terrain)&&(!i||a.getSource(i.source))&&(l.terrain=i,a.setTerrain(i)))}_updateHandlers(e,n){const r=this._map;for(const i of kQ){const a=e[i]??!0,l=n[i]??!0;ps(a,l)||(a?r[i].enable(a):r[i].disable())}}_queryRenderedFeatures(e){const n=this._map,{interactiveLayerIds:r=[]}=this.props;try{return n.queryRenderedFeatures(e,{layers:r.filter(n.getLayer.bind(n))})}catch{return[]}}_updateHover(e){var i;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const a=e.type,l=((i=this._hoveredFeatures)==null?void 0:i.length)>0,u=this._queryRenderedFeatures(e.point),f=u.length>0;!f&&l&&(e.type="mouseleave",this._onPointerEvent(e)),this._hoveredFeatures=u,f&&!l&&(e.type="mouseenter",this._onPointerEvent(e)),e.type=a}else this._hoveredFeatures=null}}kc.savedMaps=[];const BQ=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function UQ(t){if(!t)return null;const e=t.map,n={getMap:()=>e};for(const r of LQ(e))!(r in n)&&!BQ.includes(r)&&(n[r]=e[r].bind(e));return n}function LQ(t){const e=new Set;let n=t;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof t[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&e.add(r);n=Object.getPrototypeOf(n)}return Array.from(e)}const zQ=typeof document<"u"?_.useLayoutEffect:_.useEffect;function $Q(t,e){const{RTLTextPlugin:n,maxParallelImageRequests:r,workerCount:i,workerUrl:a}=e;if(n&&t.getRTLTextPluginStatus&&t.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:l,lazy:u=!0}=typeof n=="string"?{pluginUrl:n}:n;t.setRTLTextPlugin(l,f=>{f&&console.error(f)},u)}r!==void 0&&t.setMaxParallelImageRequests(r),i!==void 0&&t.setWorkerCount(i),a!==void 0&&t.setWorkerUrl(a)}const dp=_.createContext(null);function VQ(t,e){const n=_.useContext(NQ),[r,i]=_.useState(null),a=_.useRef(),{current:l}=_.useRef({mapLib:null,map:null});_.useEffect(()=>{const h=t.mapLib;let g=!0,m;return Promise.resolve(h||xI(()=>import("./maplibre-gl-CUnf5s77.js").then(v=>v.m),[])).then(v=>{if(!g)return;if(!v)throw new Error("Invalid mapLib");const S="Map"in v?v:v.default;if(!S.Map)throw new Error("Invalid mapLib");if($Q(S,t),!S.supported||S.supported(t))t.reuseMaps&&(m=kc.reuse(t,a.current)),m||(m=new kc(S.Map,t,a.current)),l.map=UQ(m),l.mapLib=S,i(m),n==null||n.onMapMount(l.map,t.id);else throw new Error("Map is not supported by this browser")}).catch(v=>{const{onError:S}=t;S?S({type:"error",target:null,originalEvent:null,error:v}):console.error(v)}),()=>{g=!1,m&&(n==null||n.onMapUnmount(t.id),t.reuseMaps?m.recycle():m.destroy())}},[]),zQ(()=>{r&&r.setProps(t)}),_.useImperativeHandle(e,()=>l.map,[r]);const u=_.useMemo(()=>({position:"relative",width:"100%",height:"100%",...t.style}),[t.style]),f={height:"100%"};return _.createElement("div",{id:t.id,ref:a,style:u},r&&_.createElement(dp.Provider,{value:l},_.createElement("div",{"mapboxgl-children":"",style:f},t.children)))}const HQ=_.forwardRef(VQ),jQ=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ys(t,e){if(!t||!e)return;const n=t.style;for(const r in e){const i=e[r];Number.isFinite(i)&&!jQ.test(r)?n[r]=`${i}px`:n[r]=i}}_.memo(_.forwardRef((t,e)=>{const{map:n,mapLib:r}=_.useContext(dp),i=_.useRef({props:t});i.current.props=t;const a=_.useMemo(()=>{let E=!1;_.Children.forEach(t.children,T=>{T&&(E=!0)});const b={...t,element:E?document.createElement("div"):null},C=new r.Marker(b);return C.setLngLat([t.longitude,t.latitude]),C.getElement().addEventListener("click",T=>{var A,O;(O=(A=i.current.props).onClick)==null||O.call(A,{type:"click",target:C,originalEvent:T})}),C.on("dragstart",T=>{var O,x;const A=T;A.lngLat=a.getLngLat(),(x=(O=i.current.props).onDragStart)==null||x.call(O,A)}),C.on("drag",T=>{var O,x;const A=T;A.lngLat=a.getLngLat(),(x=(O=i.current.props).onDrag)==null||x.call(O,A)}),C.on("dragend",T=>{var O,x;const A=T;A.lngLat=a.getLngLat(),(x=(O=i.current.props).onDragEnd)==null||x.call(O,A)}),C},[]);_.useEffect(()=>(a.addTo(n.getMap()),()=>{a.remove()}),[]);const{longitude:l,latitude:u,offset:f,style:h,draggable:g=!1,popup:m=null,rotation:v=0,rotationAlignment:S="auto",pitchAlignment:w="auto"}=t;return _.useEffect(()=>{Ys(a.getElement(),h)},[h]),_.useImperativeHandle(e,()=>a,[]),(a.getLngLat().lng!==l||a.getLngLat().lat!==u)&&a.setLngLat([l,u]),f&&!IQ(a.getOffset(),f)&&a.setOffset(f),a.isDraggable()!==g&&a.setDraggable(g),a.getRotation()!==v&&a.setRotation(v),a.getRotationAlignment()!==S&&a.setRotationAlignment(S),a.getPitchAlignment()!==w&&a.setPitchAlignment(w),a.getPopup()!==m&&a.setPopup(m),za.createPortal(t.children,a.getElement())}));function xA(t){return new Set(t?t.trim().split(/\s+/):[])}_.memo(_.forwardRef((t,e)=>{const{map:n,mapLib:r}=_.useContext(dp),i=_.useMemo(()=>document.createElement("div"),[]),a=_.useRef({props:t});a.current.props=t;const l=_.useMemo(()=>{const u={...t},f=new r.Popup(u);return f.setLngLat([t.longitude,t.latitude]),f.once("open",h=>{var g,m;(m=(g=a.current.props).onOpen)==null||m.call(g,h)}),f},[]);if(_.useEffect(()=>{const u=f=>{var h,g;(g=(h=a.current.props).onClose)==null||g.call(h,f)};return l.on("close",u),l.setDOMContent(i).addTo(n.getMap()),()=>{l.off("close",u),l.isOpen()&&l.remove()}},[]),_.useEffect(()=>{Ys(l.getElement(),t.style)},[t.style]),_.useImperativeHandle(e,()=>l,[]),l.isOpen()&&((l.getLngLat().lng!==t.longitude||l.getLngLat().lat!==t.latitude)&&l.setLngLat([t.longitude,t.latitude]),t.offset&&!ps(l.options.offset,t.offset)&&l.setOffset(t.offset),(l.options.anchor!==t.anchor||l.options.maxWidth!==t.maxWidth)&&(l.options.anchor=t.anchor,l.setMaxWidth(t.maxWidth)),l.options.className!==t.className)){const u=xA(l.options.className),f=xA(t.className);for(const h of u)f.has(h)||l.removeClassName(h);for(const h of f)u.has(h)||l.addClassName(h);l.options.className=t.className}return za.createPortal(t.children,i)}));function Qo(t,e,n,r){const i=_.useContext(dp),a=_.useMemo(()=>t(i),[]);return _.useEffect(()=>{const l=e,u=null,f=typeof e=="function"?e:null,{map:h}=i;return h.hasControl(a)||(h.addControl(a,l==null?void 0:l.position),u&&u(i)),()=>{f&&f(i),h.hasControl(a)&&h.removeControl(a)}},[]),a}function WQ(t){const e=Qo(({mapLib:n})=>new n.AttributionControl(t),{position:t.position});return _.useEffect(()=>{Ys(e._container,t.style)},[t.style]),null}_.memo(WQ);function XQ(t){const e=Qo(({mapLib:n})=>new n.FullscreenControl({container:t.containerId&&document.getElementById(t.containerId)}),{position:t.position});return _.useEffect(()=>{Ys(e._controlContainer,t.style)},[t.style]),null}_.memo(XQ);function qQ(t,e){const n=_.useRef({props:t}),r=Qo(({mapLib:i})=>{const a=new i.GeolocateControl(t),l=a._setupUI;return a._setupUI=()=>{a._container.hasChildNodes()||l()},a.on("geolocate",u=>{var f,h;(h=(f=n.current.props).onGeolocate)==null||h.call(f,u)}),a.on("error",u=>{var f,h;(h=(f=n.current.props).onError)==null||h.call(f,u)}),a.on("outofmaxbounds",u=>{var f,h;(h=(f=n.current.props).onOutOfMaxBounds)==null||h.call(f,u)}),a.on("trackuserlocationstart",u=>{var f,h;(h=(f=n.current.props).onTrackUserLocationStart)==null||h.call(f,u)}),a.on("trackuserlocationend",u=>{var f,h;(h=(f=n.current.props).onTrackUserLocationEnd)==null||h.call(f,u)}),a},{position:t.position});return n.current.props=t,_.useImperativeHandle(e,()=>r,[]),_.useEffect(()=>{Ys(r._container,t.style)},[t.style]),null}_.memo(_.forwardRef(qQ));function YQ(t){const e=Qo(({mapLib:n})=>new n.NavigationControl(t),{position:t.position});return _.useEffect(()=>{Ys(e._container,t.style)},[t.style]),null}_.memo(YQ);function KQ(t){const e=Qo(({mapLib:a})=>new a.ScaleControl(t),{position:t.position}),n=_.useRef(t),r=n.current;n.current=t;const{style:i}=t;return t.maxWidth!==void 0&&t.maxWidth!==r.maxWidth&&(e.options.maxWidth=t.maxWidth),t.unit!==void 0&&t.unit!==r.unit&&e.setUnit(t.unit),_.useEffect(()=>{Ys(e._container,i)},[i]),null}_.memo(KQ);function ZQ(t){const e=Qo(({mapLib:n})=>new n.TerrainControl(t),{position:t.position});return _.useEffect(()=>{Ys(e._container,t.style)},[t.style]),null}_.memo(ZQ);function QQ(t){const e=Qo(({mapLib:n})=>new n.LogoControl(t),{position:t.position});return _.useEffect(()=>{Ys(e._container,t.style)},[t.style]),null}_.memo(QQ);const MA=lb().domain([0,1e4]).range([BC(0),BC(1)]),GQ=lb().domain([0,12e3]).range([50,250]);function JQ(){const[t,e]=_.useState(0),[n,r]=_.useState("00:00:00"),[i,a]=_.useState("2023-12-01"),{isPending:l,error:u,data:f}=CI({queryKey:[i],queryFn:()=>jh(`./${i}.csv.gz`,Iy,{csv:{}})});u&&console.log(u);const h=[new xg({id:"deckgl-circle",data:[{position:[.45,51.47]}],getPosition:g=>g.position,getFillColor:[255,0,0,100],getRadius:1e3}),new Rb({id:"deckgl-grid",data:l?[]:f.data,getPosition:g=>[g.x,g.y],getFillColor:g=>MA(g[n]).slice(4,-1).split(", ").map(Number),cellSize:505,extruded:!1,updateTriggers:{getFillColor:[n]}}),new xg({id:"deckgl-circle2",getPosition:g=>[g.x,g.y],getFillColor:g=>MA(g[n]).slice(4,-1).split(", ").map(Number),getRadius:g=>GQ(g[n]),updateTriggers:{getFillColor:[n],getRadius:[n]}})];return Vr.jsxs(Vr.Fragment,{children:[Vr.jsx(PQ,{initialViewState:{longitude:37.028,latitude:55.778,zoom:7},controller:!0,layers:h,children:Vr.jsx(HQ,{mapStyle:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",hash:!0})}),Vr.jsxs(Dx,{style:{position:"absolute",zIndex:1,justifyContent:"center",padding:30},direction:"vertical",children:[Vr.jsx(Ux,{spinning:l}),Vr.jsx(Hc,{onChange:a,options:[{value:"2023-12-01"},{value:"2023-12-02"}],value:i}),Vr.jsx(j7,{value:t,min:0,max:47,onChange:g=>e(g),onChangeComplete:g=>{const m=Math.floor(g/2).toString().padStart(2,"0"),v=(g%2*30).toString().padStart(2,"0"),S=m+":"+v+":00";r(S)}}),Vr.jsx("p",{id:"time",children:n}),Vr.jsx("button",{onClick:()=>{e(t+1);const g=parseInt(t),m=Math.floor(g/2).toString().padStart(2,"0"),v=(g%2*30).toString().padStart(2,"0"),S=m+":"+v+":00";r(S)},children:"Плюс"})]})]})}const eG=new aI;FI.createRoot(document.getElementById("root")).render(Vr.jsx(_.StrictMode,{children:Vr.jsxs(dI,{client:eG,children:[Vr.jsx(JQ,{}),Vr.jsx(MI,{initialIsOpen:!1})]})}));export{by as g};
|