@bluealba/pae-ui-react-core 4.2.2-develop-1364 → 4.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +4 -3
- package/dist/index.systemjs.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -205,7 +205,7 @@ to {
|
|
|
205
205
|
> * {
|
|
206
206
|
pointer-events: auto;
|
|
207
207
|
}
|
|
208
|
-
`,pr=16,ap=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,containerStyle:s,containerClassName:i})=>{let{toasts:a,handlers:c}=Lh(n);return d.createElement("div",{style:{position:"fixed",zIndex:9999,top:pr,left:pr,right:pr,bottom:pr,pointerEvents:"none",...s},className:i,onMouseEnter:c.startPause,onMouseLeave:c.endPause},a.map(u=>{let f=u.position||t,p=c.calculateOffset(u,{reverseOrder:e,gutter:r,defaultPosition:t}),m=sp(f,p);return d.createElement(op,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?ip:"",style:m},u.type==="custom"?Wr(u.message,u):o?o(u):d.createElement(rp,{toast:u,position:f}))}))},Yi=Pe;const Ws=()=>({notify:_.useCallback((t,n,r)=>{const o={style:{background:"var(--platform-background-primary-color)",color:"var(--platform-text-primary-color)"}};n==="warning"||n==="info"?Yi(t,{...o,icon:n==="warning"?"⚠️":"ℹ️"}):Yi[n](t,o),r&&console.error(r)},[])});var In=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Jt=typeof window>"u"||"Deno"in globalThis;function xe(){}function cp(e,t){return typeof e=="function"?e(t):e}function os(e){return typeof e=="number"&&e>=0&&e!==1/0}function qc(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Dt(e,t){return typeof e=="function"?e(t):e}function Fe(e,t){return typeof e=="function"?e(t):e}function Zi(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Hs(i,t.options))return!1}else if(!qn(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Xi(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(en(t.options.mutationKey)!==en(s))return!1}else if(!qn(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Hs(e,t){return((t==null?void 0:t.queryKeyHashFn)||en)(e)}function en(e){return JSON.stringify(e,(t,n)=>is(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function qn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>qn(e[n],t[n])):!1}function ss(e,t){if(e===t)return e;const n=Ji(e)&&Ji(t);if(n||is(e)&&is(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let c=0;for(let u=0;u<i;u++){const f=n?u:s[u];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(a[f]=void 0,c++):(a[f]=ss(e[f],t[f]),a[f]===e[f]&&e[f]!==void 0&&c++)}return o===i&&c===o?e:a}return t}function Hr(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ji(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function is(e){if(!ea(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!ea(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ea(e){return Object.prototype.toString.call(e)==="[object Object]"}function lp(e){return new Promise(t=>{setTimeout(t,e)})}function as(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){try{return ss(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return ss(e,t)}return t}function up(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function dp(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Vr=Symbol();function Gc(e,t){return e.queryFn===Vr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Vr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Kc(e,t){return typeof e=="function"?e(...t):!!e}var Ht,xt,gn,Ja,fp=(Ja=class extends In{constructor(){super();M(this,Ht);M(this,xt);M(this,gn);O(this,gn,t=>{if(!Jt&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,xt)||this.setEventListener(C(this,gn))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,xt))==null||t.call(this),O(this,xt,void 0))}setEventListener(t){var n;O(this,gn,t),(n=C(this,xt))==null||n.call(this),O(this,xt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,Ht)!==t&&(O(this,Ht,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,Ht)=="boolean"?C(this,Ht):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ht=new WeakMap,xt=new WeakMap,gn=new WeakMap,Ja),Vs=new fp,vn,St,yn,ec,hp=(ec=class extends In{constructor(){super();M(this,vn,!0);M(this,St);M(this,yn);O(this,yn,t=>{if(!Jt&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){C(this,St)||this.setEventListener(C(this,yn))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,St))==null||t.call(this),O(this,St,void 0))}setEventListener(t){var n;O(this,yn,t),(n=C(this,St))==null||n.call(this),O(this,St,t(this.setOnline.bind(this)))}setOnline(t){C(this,vn)!==t&&(O(this,vn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return C(this,vn)}},vn=new WeakMap,St=new WeakMap,yn=new WeakMap,ec),zr=new hp;function cs(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function pp(e){return Math.min(1e3*2**e,3e4)}function Qc(e){return(e??"online")==="online"?zr.isOnline():!0}var Yc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function No(e){return e instanceof Yc}function Zc(e){let t=!1,n=0,r=!1,o;const s=cs(),i=h=>{var v;r||(m(new Yc(h)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},c=()=>{t=!1},u=()=>Vs.isFocused()&&(e.networkMode==="always"||zr.isOnline())&&e.canRun(),f=()=>Qc(e.networkMode)&&e.canRun(),p=h=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,h),o==null||o(),s.resolve(h))},m=h=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,h),o==null||o(),s.reject(h))},g=()=>new Promise(h=>{var v;o=y=>{(r||u())&&h(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var h;o=void 0,r||(h=e.onContinue)==null||h.call(e)}),x=()=>{if(r)return;let h;const v=n===0?e.initialPromise:void 0;try{h=v??e.fn()}catch(y){h=Promise.reject(y)}Promise.resolve(h).then(p).catch(y=>{var T;if(r)return;const w=e.retry??(Jt?0:3),S=e.retryDelay??pp,E=typeof S=="function"?S(n,y):S,R=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,y);if(t||!R){m(y);return}n++,(T=e.onFail)==null||T.call(e,n,y),lp(E).then(()=>u()?void 0:g()).then(()=>{t?m(y):x()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:c,canStart:f,start:()=>(f()?x():g().then(x),s)}}var mp=e=>setTimeout(e,0);function gp(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=mp;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var he=gp(),Vt,tc,Xc=(tc=class{constructor(){M(this,Vt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),os(this.gcTime)&&O(this,Vt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Jt?1/0:5*60*1e3))}clearGcTimeout(){C(this,Vt)&&(clearTimeout(C(this,Vt)),O(this,Vt,void 0))}},Vt=new WeakMap,tc),bn,wn,Ne,zt,me,Yn,qt,ke,st,nc,vp=(nc=class extends Xc{constructor(t){super();M(this,ke);M(this,bn);M(this,wn);M(this,Ne);M(this,zt);M(this,me);M(this,Yn);M(this,qt);O(this,qt,!1),O(this,Yn,t.defaultOptions),this.setOptions(t.options),this.observers=[],O(this,zt,t.client),O(this,Ne,C(this,zt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,O(this,bn,yp(this.options)),this.state=t.state??C(this,bn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,me))==null?void 0:t.promise}setOptions(t){this.options={...C(this,Yn),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,Ne).remove(this)}setData(t,n){const r=as(this.state.data,t,this.options);return H(this,ke,st).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){H(this,ke,st).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=C(this,me))==null?void 0:r.promise;return(o=C(this,me))==null||o.cancel(t),n?n.then(xe).catch(xe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,bn))}isActive(){return this.observers.some(t=>Fe(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Dt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!qc(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,me))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,me))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,Ne).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(C(this,me)&&(C(this,qt)?C(this,me).cancel({revert:!0}):C(this,me).cancelRetry()),this.scheduleGc()),C(this,Ne).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||H(this,ke,st).call(this,{type:"invalidate"})}fetch(t,n){var u,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,me))return C(this,me).continueRetry(),C(this,me).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(g=>g.options.queryFn);m&&this.setOptions(m.options)}Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");const r=new AbortController,o=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(O(this,qt,!0),r.signal)})},s=()=>{const m=Gc(this.options,n),x=(()=>{const h={client:C(this,zt),queryKey:this.queryKey,meta:this.meta};return o(h),h})();return O(this,qt,!1),this.options.persister?this.options.persister(m,x,this):m(x)},a=(()=>{const m={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,zt),state:this.state,fetchFn:s};return o(m),m})();(u=this.options.behavior)==null||u.onFetch(a,this),O(this,wn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&H(this,ke,st).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const c=m=>{var g,x,h,v;No(m)&&m.silent||H(this,ke,st).call(this,{type:"error",error:m}),No(m)||((x=(g=C(this,Ne).config).onError)==null||x.call(g,m,this),(v=(h=C(this,Ne).config).onSettled)==null||v.call(h,this.state.data,m,this)),this.scheduleGc()};return O(this,me,Zc({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var g,x,h,v;if(m===void 0){console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(y){c(y);return}(x=(g=C(this,Ne).config).onSuccess)==null||x.call(g,m,this),(v=(h=C(this,Ne).config).onSettled)==null||v.call(h,m,this.state.error,this),this.scheduleGc()},onError:c,onFail:(m,g)=>{H(this,ke,st).call(this,{type:"failed",failureCount:m,error:g})},onPause:()=>{H(this,ke,st).call(this,{type:"pause"})},onContinue:()=>{H(this,ke,st).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),C(this,me).start()}},bn=new WeakMap,wn=new WeakMap,Ne=new WeakMap,zt=new WeakMap,me=new WeakMap,Yn=new WeakMap,qt=new WeakMap,ke=new WeakSet,st=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Jc(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return No(o)&&o.revert&&C(this,wn)?{...C(this,wn),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),he.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,Ne).notify({query:this,type:"updated",action:t})})},nc);function Jc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Qc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 Ge,rc,bp=(rc=class extends In{constructor(t={}){super();M(this,Ge);this.config=t,O(this,Ge,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Hs(o,n);let i=this.get(s);return i||(i=new vp({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){C(this,Ge).has(t.queryHash)||(C(this,Ge).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=C(this,Ge).get(t.queryHash);n&&(t.destroy(),n===t&&C(this,Ge).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){he.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,Ge).get(t)}getAll(){return[...C(this,Ge).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Zi(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Zi(t,r)):n}notify(t){he.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){he.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){he.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ge=new WeakMap,rc),Ke,we,Gt,Qe,yt,oc,wp=(oc=class extends Xc{constructor(t){super();M(this,Qe);M(this,Ke);M(this,we);M(this,Gt);this.mutationId=t.mutationId,O(this,we,t.mutationCache),O(this,Ke,[]),this.state=t.state||el(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,Ke).includes(t)||(C(this,Ke).push(t),this.clearGcTimeout(),C(this,we).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){O(this,Ke,C(this,Ke).filter(n=>n!==t)),this.scheduleGc(),C(this,we).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Ke).length||(this.state.status==="pending"?this.scheduleGc():C(this,we).remove(this))}continue(){var t;return((t=C(this,Gt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,a,c,u,f,p,m,g,x,h,v,y,w,S,E,R,T,P,D;const n=()=>{H(this,Qe,yt).call(this,{type:"continue"})};O(this,Gt,Zc({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,L)=>{H(this,Qe,yt).call(this,{type:"failed",failureCount:I,error:L})},onPause:()=>{H(this,Qe,yt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,we).canRun(this)}));const r=this.state.status==="pending",o=!C(this,Gt).canStart();try{if(r)n();else{H(this,Qe,yt).call(this,{type:"pending",variables:t,isPaused:o}),await((i=(s=C(this,we).config).onMutate)==null?void 0:i.call(s,t,this));const L=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,t));L!==this.state.context&&H(this,Qe,yt).call(this,{type:"pending",context:L,variables:t,isPaused:o})}const I=await C(this,Gt).start();return await((f=(u=C(this,we).config).onSuccess)==null?void 0:f.call(u,I,t,this.state.context,this)),await((m=(p=this.options).onSuccess)==null?void 0:m.call(p,I,t,this.state.context)),await((x=(g=C(this,we).config).onSettled)==null?void 0:x.call(g,I,null,this.state.variables,this.state.context,this)),await((v=(h=this.options).onSettled)==null?void 0:v.call(h,I,null,t,this.state.context)),H(this,Qe,yt).call(this,{type:"success",data:I}),I}catch(I){try{throw await((w=(y=C(this,we).config).onError)==null?void 0:w.call(y,I,t,this.state.context,this)),await((E=(S=this.options).onError)==null?void 0:E.call(S,I,t,this.state.context)),await((T=(R=C(this,we).config).onSettled)==null?void 0:T.call(R,void 0,I,this.state.variables,this.state.context,this)),await((D=(P=this.options).onSettled)==null?void 0:D.call(P,void 0,I,t,this.state.context)),I}finally{H(this,Qe,yt).call(this,{type:"error",error:I})}}finally{C(this,we).runNext(this)}}},Ke=new WeakMap,we=new WeakMap,Gt=new WeakMap,Qe=new WeakSet,yt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),he.batch(()=>{C(this,Ke).forEach(r=>{r.onMutationUpdate(t)}),C(this,we).notify({mutation:this,type:"updated",action:t})})},oc);function el(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var it,$e,Zn,sc,Cp=(sc=class extends In{constructor(t={}){super();M(this,it);M(this,$e);M(this,Zn);this.config=t,O(this,it,new Set),O(this,$e,new Map),O(this,Zn,0)}build(t,n,r){const o=new wp({mutationCache:this,mutationId:++dr(this,Zn)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){C(this,it).add(t);const n=mr(t);if(typeof n=="string"){const r=C(this,$e).get(n);r?r.push(t):C(this,$e).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,it).delete(t)){const n=mr(t);if(typeof n=="string"){const r=C(this,$e).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&C(this,$e).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=mr(t);if(typeof n=="string"){const r=C(this,$e).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=mr(t);if(typeof n=="string"){const o=(r=C(this,$e).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){he.batch(()=>{C(this,it).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,it).clear(),C(this,$e).clear()})}getAll(){return Array.from(C(this,it))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Xi(n,r))}findAll(t={}){return this.getAll().filter(n=>Xi(t,n))}notify(t){he.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return he.batch(()=>Promise.all(t.map(n=>n.continue().catch(xe))))}},it=new WeakMap,$e=new WeakMap,Zn=new WeakMap,sc);function mr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function ta(e){return{onFetch:(t,n)=>{var f,p,m,g,x;const r=t.options,o=(m=(p=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,s=((g=t.state.data)==null?void 0:g.pages)||[],i=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const v=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?h=!0:t.signal.addEventListener("abort",()=>{h=!0}),t.signal)})},y=Gc(t.options,t.fetchOptions),w=async(S,E,R)=>{if(h)return Promise.reject();if(E==null&&S.pages.length)return Promise.resolve(S);const P=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:E,direction:R?"backward":"forward",meta:t.options.meta};return v(B),B})(),D=await y(P),{maxPages:I}=t.options,L=R?dp:up;return{pages:L(S.pages,D,I),pageParams:L(S.pageParams,E,I)}};if(o&&s.length){const S=o==="backward",E=S?xp:na,R={pages:s,pageParams:i},T=E(r,R);a=await w(R,T,S)}else{const S=e??s.length;do{const E=c===0?i[0]??r.initialPageParam:na(r,a);if(c>0&&E==null)break;a=await w(a,E),c++}while(c<S)}return a};t.options.persister?t.fetchFn=()=>{var h,v;return(v=(h=t.options).persister)==null?void 0:v.call(h,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function na(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function xp(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var le,Et,_t,Cn,xn,Rt,Sn,En,ic,Sp=(ic=class{constructor(e={}){M(this,le);M(this,Et);M(this,_t);M(this,Cn);M(this,xn);M(this,Rt);M(this,Sn);M(this,En);O(this,le,e.queryCache||new bp),O(this,Et,e.mutationCache||new Cp),O(this,_t,e.defaultOptions||{}),O(this,Cn,new Map),O(this,xn,new Map),O(this,Rt,0)}mount(){dr(this,Rt)._++,C(this,Rt)===1&&(O(this,Sn,Vs.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,le).onFocus())})),O(this,En,zr.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,le).onOnline())})))}unmount(){var e,t;dr(this,Rt)._--,C(this,Rt)===0&&((e=C(this,Sn))==null||e.call(this),O(this,Sn,void 0),(t=C(this,En))==null||t.call(this),O(this,En,void 0))}isFetching(e){return C(this,le).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,Et).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,le).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=C(this,le).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Dt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return C(this,le).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=C(this,le).get(r.queryHash),s=o==null?void 0:o.state.data,i=cp(t,s);if(i!==void 0)return C(this,le).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return he.batch(()=>C(this,le).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,le).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=C(this,le);he.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=C(this,le);return he.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=he.batch(()=>C(this,le).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(xe).catch(xe)}invalidateQueries(e,t={}){return he.batch(()=>(C(this,le).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=he.batch(()=>C(this,le).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(xe)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(xe)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=C(this,le).build(this,t);return n.isStaleByTime(Dt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xe).catch(xe)}fetchInfiniteQuery(e){return e.behavior=ta(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xe).catch(xe)}ensureInfiniteQueryData(e){return e.behavior=ta(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return zr.isOnline()?C(this,Et).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,le)}getMutationCache(){return C(this,Et)}getDefaultOptions(){return C(this,_t)}setDefaultOptions(e){O(this,_t,e)}setQueryDefaults(e,t){C(this,Cn).set(en(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,Cn).values()],n={};return t.forEach(r=>{qn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){C(this,xn).set(en(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,xn).values()],n={};return t.forEach(r=>{qn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,_t).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Hs(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Vr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,_t).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,le).clear(),C(this,Et).clear()}},le=new WeakMap,Et=new WeakMap,_t=new WeakMap,Cn=new WeakMap,xn=new WeakMap,Rt=new WeakMap,Sn=new WeakMap,En=new WeakMap,ic),_e,G,Xn,Ce,Kt,_n,Tt,Pt,Jn,Rn,Tn,Qt,Yt,At,Pn,ne,Un,ls,us,ds,fs,hs,ps,ms,tl,ac,Ep=(ac=class extends In{constructor(t,n){super();M(this,ne);M(this,_e);M(this,G);M(this,Xn);M(this,Ce);M(this,Kt);M(this,_n);M(this,Tt);M(this,Pt);M(this,Jn);M(this,Rn);M(this,Tn);M(this,Qt);M(this,Yt);M(this,At);M(this,Pn,new Set);this.options=n,O(this,_e,t),O(this,Pt,null),O(this,Tt,cs()),this.options.experimental_prefetchInRender||C(this,Tt).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&&(C(this,G).addObserver(this),ra(C(this,G),this.options)?H(this,ne,Un).call(this):this.updateResult(),H(this,ne,fs).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return gs(C(this,G),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return gs(C(this,G),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,H(this,ne,hs).call(this),H(this,ne,ps).call(this),C(this,G).removeObserver(this)}setOptions(t){const n=this.options,r=C(this,G);if(this.options=C(this,_e).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fe(this.options.enabled,C(this,G))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");H(this,ne,ms).call(this),C(this,G).setOptions(this.options),n._defaulted&&!Hr(this.options,n)&&C(this,_e).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,G),observer:this});const o=this.hasListeners();o&&oa(C(this,G),r,this.options,n)&&H(this,ne,Un).call(this),this.updateResult(),o&&(C(this,G)!==r||Fe(this.options.enabled,C(this,G))!==Fe(n.enabled,C(this,G))||Dt(this.options.staleTime,C(this,G))!==Dt(n.staleTime,C(this,G)))&&H(this,ne,ls).call(this);const s=H(this,ne,us).call(this);o&&(C(this,G)!==r||Fe(this.options.enabled,C(this,G))!==Fe(n.enabled,C(this,G))||s!==C(this,At))&&H(this,ne,ds).call(this,s)}getOptimisticResult(t){const n=C(this,_e).getQueryCache().build(C(this,_e),t),r=this.createResult(n,t);return Rp(this,r)&&(O(this,Ce,r),O(this,_n,this.options),O(this,Kt,C(this,G).state)),r}getCurrentResult(){return C(this,Ce)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){C(this,Pn).add(t)}getCurrentQuery(){return C(this,G)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=C(this,_e).defaultQueryOptions(t),r=C(this,_e).getQueryCache().build(C(this,_e),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return H(this,ne,Un).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Ce)))}createResult(t,n){var I;const r=C(this,G),o=this.options,s=C(this,Ce),i=C(this,Kt),a=C(this,_n),u=t!==r?t.state:C(this,Xn),{state:f}=t;let p={...f},m=!1,g;if(n._optimisticResults){const L=this.hasListeners(),B=!L&&ra(t,n),U=L&&oa(t,r,n,o);(B||U)&&(p={...p,...Jc(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:h,status:v}=p;g=p.data;let y=!1;if(n.placeholderData!==void 0&&g===void 0&&v==="pending"){let L;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(L=s.data,y=!0):L=typeof n.placeholderData=="function"?n.placeholderData((I=C(this,Tn))==null?void 0:I.state.data,C(this,Tn)):n.placeholderData,L!==void 0&&(v="success",g=as(s==null?void 0:s.data,L,n),m=!0)}if(n.select&&g!==void 0&&!y)if(s&&g===(i==null?void 0:i.data)&&n.select===C(this,Jn))g=C(this,Rn);else try{O(this,Jn,n.select),g=n.select(g),g=as(s==null?void 0:s.data,g,n),O(this,Rn,g),O(this,Pt,null)}catch(L){O(this,Pt,L)}C(this,Pt)&&(x=C(this,Pt),g=C(this,Rn),h=Date.now(),v="error");const w=p.fetchStatus==="fetching",S=v==="pending",E=v==="error",R=S&&w,T=g!==void 0,D={status:v,fetchStatus:p.fetchStatus,isPending:S,isSuccess:v==="success",isError:E,isInitialLoading:R,isLoading:R,data:g,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:h,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>u.dataUpdateCount||p.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:E&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:E&&T,isStale:zs(t,n),refetch:this.refetch,promise:C(this,Tt)};if(this.options.experimental_prefetchInRender){const L=W=>{D.status==="error"?W.reject(D.error):D.data!==void 0&&W.resolve(D.data)},B=()=>{const W=O(this,Tt,D.promise=cs());L(W)},U=C(this,Tt);switch(U.status){case"pending":t.queryHash===r.queryHash&&L(U);break;case"fulfilled":(D.status==="error"||D.data!==U.value)&&B();break;case"rejected":(D.status!=="error"||D.error!==U.reason)&&B();break}}return D}updateResult(){const t=C(this,Ce),n=this.createResult(C(this,G),this.options);if(O(this,Kt,C(this,G).state),O(this,_n,this.options),C(this,Kt).data!==void 0&&O(this,Tn,C(this,G)),Hr(n,t))return;O(this,Ce,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!C(this,Pn).size)return!0;const i=new Set(s??C(this,Pn));return this.options.throwOnError&&i.add("error"),Object.keys(C(this,Ce)).some(a=>{const c=a;return C(this,Ce)[c]!==t[c]&&i.has(c)})};H(this,ne,tl).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&H(this,ne,fs).call(this)}},_e=new WeakMap,G=new WeakMap,Xn=new WeakMap,Ce=new WeakMap,Kt=new WeakMap,_n=new WeakMap,Tt=new WeakMap,Pt=new WeakMap,Jn=new WeakMap,Rn=new WeakMap,Tn=new WeakMap,Qt=new WeakMap,Yt=new WeakMap,At=new WeakMap,Pn=new WeakMap,ne=new WeakSet,Un=function(t){H(this,ne,ms).call(this);let n=C(this,G).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(xe)),n},ls=function(){H(this,ne,hs).call(this);const t=Dt(this.options.staleTime,C(this,G));if(Jt||C(this,Ce).isStale||!os(t))return;const r=qc(C(this,Ce).dataUpdatedAt,t)+1;O(this,Qt,setTimeout(()=>{C(this,Ce).isStale||this.updateResult()},r))},us=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,G)):this.options.refetchInterval)??!1},ds=function(t){H(this,ne,ps).call(this),O(this,At,t),!(Jt||Fe(this.options.enabled,C(this,G))===!1||!os(C(this,At))||C(this,At)===0)&&O(this,Yt,setInterval(()=>{(this.options.refetchIntervalInBackground||Vs.isFocused())&&H(this,ne,Un).call(this)},C(this,At)))},fs=function(){H(this,ne,ls).call(this),H(this,ne,ds).call(this,H(this,ne,us).call(this))},hs=function(){C(this,Qt)&&(clearTimeout(C(this,Qt)),O(this,Qt,void 0))},ps=function(){C(this,Yt)&&(clearInterval(C(this,Yt)),O(this,Yt,void 0))},ms=function(){const t=C(this,_e).getQueryCache().build(C(this,_e),this.options);if(t===C(this,G))return;const n=C(this,G);O(this,G,t),O(this,Xn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},tl=function(t){he.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(C(this,Ce))}),C(this,_e).getQueryCache().notify({query:C(this,G),type:"observerResultsUpdated"})})},ac);function _p(e,t){return Fe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ra(e,t){return _p(e,t)||e.state.data!==void 0&&gs(e,t,t.refetchOnMount)}function gs(e,t,n){if(Fe(t.enabled,e)!==!1&&Dt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zs(e,t)}return!1}function oa(e,t,n,r){return(e!==t||Fe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&zs(e,n)}function zs(e,t){return Fe(t.enabled,e)!==!1&&e.isStaleByTime(Dt(t.staleTime,e))}function Rp(e,t){return!Hr(e.getCurrentResult(),t)}var Ot,jt,Re,at,lt,Mr,vs,cc,Tp=(cc=class extends In{constructor(n,r){super();M(this,lt);M(this,Ot);M(this,jt);M(this,Re);M(this,at);O(this,Ot,n),this.setOptions(r),this.bindMethods(),H(this,lt,Mr).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=C(this,Ot).defaultMutationOptions(n),Hr(this.options,r)||C(this,Ot).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,Re),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&en(r.mutationKey)!==en(this.options.mutationKey)?this.reset():((o=C(this,Re))==null?void 0:o.state.status)==="pending"&&C(this,Re).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,Re))==null||n.removeObserver(this)}onMutationUpdate(n){H(this,lt,Mr).call(this),H(this,lt,vs).call(this,n)}getCurrentResult(){return C(this,jt)}reset(){var n;(n=C(this,Re))==null||n.removeObserver(this),O(this,Re,void 0),H(this,lt,Mr).call(this),H(this,lt,vs).call(this)}mutate(n,r){var o;return O(this,at,r),(o=C(this,Re))==null||o.removeObserver(this),O(this,Re,C(this,Ot).getMutationCache().build(C(this,Ot),this.options)),C(this,Re).addObserver(this),C(this,Re).execute(n)}},Ot=new WeakMap,jt=new WeakMap,Re=new WeakMap,at=new WeakMap,lt=new WeakSet,Mr=function(){var r;const n=((r=C(this,Re))==null?void 0:r.state)??el();O(this,jt,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},vs=function(n){he.batch(()=>{var r,o,s,i,a,c,u,f;if(C(this,at)&&this.hasListeners()){const p=C(this,jt).variables,m=C(this,jt).context;(n==null?void 0:n.type)==="success"?((o=(r=C(this,at)).onSuccess)==null||o.call(r,n.data,p,m),(i=(s=C(this,at)).onSettled)==null||i.call(s,n.data,null,p,m)):(n==null?void 0:n.type)==="error"&&((c=(a=C(this,at)).onError)==null||c.call(a,n.error,p,m),(f=(u=C(this,at)).onSettled)==null||f.call(u,void 0,n.error,p,m))}this.listeners.forEach(p=>{p(C(this,jt))})})},cc),nl=d.createContext(void 0),qs=e=>{const t=d.useContext(nl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Pp=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(nl.Provider,{value:e,children:t})),rl=d.createContext(!1),Ap=()=>d.useContext(rl);rl.Provider;function Op(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jp=d.createContext(Op()),Ip=()=>d.useContext(jp),Np=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Dp=e=>{d.useEffect(()=>{e.clearReset()},[e])},Lp=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Kc(n,[e.error,r])),Mp=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},kp=(e,t)=>e.isLoading&&e.isFetching&&!t,$p=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,sa=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Fp(e,t,n){var p,m,g,x,h;if(typeof e!="object"||Array.isArray(e))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Ap(),o=Ip(),s=qs(),i=s.defaultQueryOptions(e);(m=(p=s.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||m.call(p,i),i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`),i._optimisticResults=r?"isRestoring":"optimistic",Mp(i),Np(i,o),Dp(o);const a=!s.getQueryCache().get(i.queryHash),[c]=d.useState(()=>new t(s,i)),u=c.getOptimisticResult(i),f=!r&&e.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(v=>{const y=f?c.subscribe(he.batchCalls(v)):xe;return c.updateResult(),y},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),d.useEffect(()=>{c.setOptions(i)},[i,c]),$p(i,u))throw sa(i,c,o);if(Lp({result:u,errorResetBoundary:o,throwOnError:i.throwOnError,query:s.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((x=(g=s.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||x.call(g,i,u),i.experimental_prefetchInRender&&!Jt&&kp(u,r)){const v=a?sa(i,c,o):(h=s.getQueryCache().get(i.queryHash))==null?void 0:h.promise;v==null||v.catch(xe).finally(()=>{c.updateResult()})}return i.notifyOnChangeProps?u:c.trackResult(u)}function ia(e,t){return Fp(e,Ep)}function gr(e,t){const n=qs(),[r]=d.useState(()=>new Tp(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);const o=d.useSyncExternalStore(d.useCallback(i=>r.subscribe(he.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=d.useCallback((i,a)=>{r.mutate(i,a).catch(xe)},[r]);if(o.error&&Kc(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const vr={STALE_TIME:1e3*60*5,GC_TIME:1e3*60*10,RETRY_COUNT:1,RETRY_DELAY:1e3},aa={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:vr.STALE_TIME,gcTime:vr.GC_TIME,retry:vr.RETRY_COUNT,retryDelay:vr.RETRY_DELAY,enable:!0},yr=e=>e instanceof Error?e.message:String(e),ol=(e,t,n)=>{const r=qs(),{notify:o}=Ws(),{createFn:s,readFn:i,readByIdFn:a,updateFn:c,deleteFn:u,partialUpdateFn:f}=n,p=()=>{r.invalidateQueries({queryKey:[e]})},m=(E,R,T,P)=>o(P!=null&&P.overrideSuccessMessage?P==null?void 0:P.overrideSuccessMessage(E,R):T,"success"),g=(E,R,T,P)=>o(P!=null&&P.overrideErrorMessage?P==null?void 0:P.overrideErrorMessage(E,R):T,"error");return{useCreate:E=>gr({mutationFn:R=>s(R),onSuccess:R=>{p(),m(t,R,`${t} created successfully`,E)},onError:R=>{g(t,R,`Error creating ${t}: ${yr(R)}`,E)}}),useReadQuery:E=>ia({queryKey:[e],queryFn:i,...aa,...E}),useReadByIdQuery:(E,R)=>ia({queryKey:[e,E],queryFn:()=>a(E),...aa,enabled:!!E,...R}),useUpdate:E=>gr({mutationFn:({id:R,data:T})=>c(R,T),onSuccess:R=>{p(),m(t,R,`${t} updated successfully`,E)},onError:R=>{g(t,R,`Error updating ${t}: ${yr(R)}`,E)}}),usePartialUpdate:E=>f&&gr({mutationFn:({id:R,data:T})=>f(R,T),onSuccess:R=>{p(),m(t,R,`${t} updated successfully`,E)},onError:R=>{g(t,R,`Error updating ${t}: ${yr(R)}`,E)}}),useDelete:E=>gr({mutationFn:R=>u(R),onSuccess:()=>{p(),m(t,null,`${t} deleted successfully`,E)},onError:R=>{g(t,R,`Error deleting ${t}: ${yr(R)}`,E)}}),invalidateQueries:p}},Bp=(e,t)=>ol(e,t,{createFn:n=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(r=>r.json()),deleteFn:n=>fetch(`${e}/${n}`,{method:"DELETE"}).then(r=>{if(!r.ok)throw new Error(`Error deleting: ${r.status}`)}),readByIdFn:n=>fetch(`${e}/${n}`).then(r=>r.json()),readFn:()=>fetch(e).then(n=>n.json()),updateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json()),partialUpdateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json())}),Up={SINGLE_TENANT:"single-tenant"},Wp={COOKIE:"cookie"},Do="tenant",ca="tenant",la="tenant",Hp=Up.SINGLE_TENANT,Vp=Wp.COOKIE,zp={mode:Hp,clientSideMode:Vp,tenantIDPProvisioningStrategy:"none"};class qp{setTenant(t,n){const r=new URL(window.location.href);r.searchParams.set(ca,t.name),window.location.href=r.toString()}getCurrentTenantName(){const t=new URL(window.location.href);return new URLSearchParams(t.search).get(ca)}}class Gp{setTenant(t,n){sessionStorage.setItem(la,t.name),window.location.reload()}getCurrentTenantName(){return sessionStorage.getItem(la)}}/*! js-cookie v3.0.5 | MIT */function br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Kp={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ys(e,t){function n(o,s,i){if(!(typeof document>"u")){i=br({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,i[c]!==!0&&(a+="="+i[c].split(";")[0]));return document.cookie=o+"="+e.write(s,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],i={},a=0;a<s.length;a++){var c=s[a].split("="),u=c.slice(1).join("=");try{var f=decodeURIComponent(c[0]);if(i[f]=e.read(u,f),o===f)break}catch{}}return o?i[o]:i}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",br({},s,{expires:-1}))},withAttributes:function(o){return ys(this.converter,br({},this.attributes,o))},withConverter:function(o){return ys(br({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Lo=ys(Kp,{path:"/"});class Qp{setTenant(t,n){t?Lo.set(Do,t.name):Lo.remove(Do),window.location.reload()}getCurrentTenantName(){return Lo.get(Do)}}class Yp{extractSubdomain(t){if(t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t))return"";const n=t.split(".");if(n.length<2||n.length===2||n[0]==="www"&&n.length===3)return"";const o=(n[0]==="www"?n.slice(1):n).slice(0,-2);return o.length>0?o.join("."):""}getBaseDomain(t){const n=t.split(".");return t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t)||n.length<=2?t:n.slice(-2).join(".")}setTenant(t,n){var u;const r=(u=n.urlPatterns)==null?void 0:u.find(f=>f.patternType==="subdomain"&&f.tenantId===t.id&&f.isActive);if(!r)throw new Error(`No active subdomain pattern found for tenant '${t.name}'`);const o=new URL(window.location.href),s=r.patternValue,i=o.hostname,a=this.getBaseDomain(i),c=s?`${s}.${a}`:a;o.hostname=c,window.location.href=o.toString()}getCurrentTenantName(){const t=window.location.hostname;return this.extractSubdomain(t)||null}}const ua={queryParams:new qp,sessionStorage:new Gp,cookie:new Qp,subdomain:new Yp},Zp=e=>{const t=ua[e.clientSideMode];if(!t)throw new Error(`Client side tenant mode '${e.clientSideMode}' is not supported ${JSON.stringify({strategies:ua},null,2)}`);return t},Xp=(e,t,n)=>{const r=t.find(s=>s.name===n);if(!r)throw Error("No tenant permission");return Zp(e).setTenant(r,e),r},Jp=()=>{const[e,t]=er(),{tenants:n=[],currentTenant:r,tenantConfig:o=zp}=e,s=_.useCallback(i=>{const a=Xp(o,n,i);t({...e,currentTenant:a})},[o,e]);return{tenants:n,currentTenant:r,tenantConfig:o,selectTenant:s}};function e1(e){if(!e.ok)throw console.error(e),new Error(e.statusText)}async function wr(e,t,n,r){const o=await e(`/user-states/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,r);return e1(o),o}class Cr{static async get(t,n,r){const s=await wr(t,n,r,{method:"GET",headers:{"Content-Type":"application/json"}});return s.status===204?null:await s.json()}static async create(t,n,r,o){const s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await wr(t,n,r,s)).json()}static async update(t,n,r,o){const s={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await wr(t,n,r,s)).json()}static async delete(t,n,r){return await wr(t,n,r,{method:"DELETE",headers:{"Content-Type":"application/json"}}),null}}const t1=e=>{const t=Us("@bluealba/pae-nestjs-gateway-service"),n=Ac();if(!n)throw new Error("You must call the useUserState hook within a PAE application.");const[r,o]=_.useState(null),[s,i]=_.useState(!1),[a,c]=_.useState(!1),[u,f]=_.useState(null),p=(w,S)=>_.useCallback(async({newValue:E,shouldThrowError:R}={})=>{try{c(!0),f(null);const T=await w(t,n,e,E);return o(T),T?T.value:null}catch(T){if(f(T==null?void 0:T.message),console.error(`Failed to ${S} ${e}:`,T),R)throw T;return null}finally{c(!1)}},[t,n,e]),m=p(Cr.get,"fetch"),g=p(Cr.create,"create"),x=p(Cr.update,"update"),h=p(Cr.delete,"delete"),v=_.useCallback(async()=>{try{await m()}finally{i(!0)}},[m]);_.useEffect(()=>{v()},[v]);const y=_.useCallback(async(w,S=!1)=>r==null?await g({newValue:w,shouldThrowError:S}):await x({newValue:w,shouldThrowError:S}),[r,g,x]);return{value:r?r.value:null,hasFetched:s,loading:a,error:u,setValue:y,createValue:g,updateValue:x,deleteValue:h}},sl="__PAE_EXTENSION_POINT_REACT_CONTENT_EMPTY__",n1=({module:e,point:t,children:n})=>(Nc(e,t,n??sl),null),il=({name:e,children:t,...n})=>{const r=Ic(e);if(r===sl)return null;if(!r)return l.jsx(l.Fragment,{children:t??null});if(r1(r)){const o=r;return l.jsx(o,{...n})}else return r},r1=e=>typeof e=="function",o1=(e,t)=>{const n=r=>(t=t||e.displayName||e.name||"?",l.jsx(il,{name:t,...r,children:l.jsx(e,{...r})}));return n.displayName=`extensionPoint(${t})`,n},da="single-spa:app-change";function s1(){const[e,t]=_.useState(fa());return _.useEffect(()=>{const n=()=>{t(fa())};return window.addEventListener(da,n),()=>{window.removeEventListener(da,n)}},[]),e}function fa(){return jr.getAppNames().reduce((t,n)=>(jr.getAppStatus(n)?t[n]=jr.getAppStatus(n):t[n]="NOT_LOADED",t),{})}function i1(e){const n=s1()[e]??"LOAD_ERROR";return{statusName:n,isLoading:n==="LOADING_SOURCE_CODE"||n==="BOOTSTRAPPING"||n==="MOUNTING",isMounted:n==="MOUNTED",isBroken:n==="SKIP_BECAUSE_BROKEN"||n==="LOAD_ERROR"}}const al=({appName:e})=>l.jsx("div",{children:l.jsxs("p",{children:["Loading ",e,"..."]})});al.displayName="BaseLoading";const cl=({appName:e})=>l.jsxs("div",{children:[l.jsx("p",{children:"Something went wrong..."}),l.jsxs("p",{children:["Failed to load ",e]})]});cl.displayName="BaseError";const a1={display:"flex",flexDirection:"column",flex:1},ll=_.forwardRef((e,t)=>l.jsx("div",{ref:t,style:a1,...e}));ll.displayName="BaseContainer";const c1="pae-app:",ul=_.forwardRef(({appName:e,LoadingComponent:t=al,ErrorComponent:n=cl,ContainerComponent:r=ll,...o},s)=>{const i=i1(e);return l.jsxs(r,{ref:s,...o,id:`${c1}${e}`,children:[i.isLoading&&l.jsx(t,{appName:e}),i.isBroken&&l.jsx(n,{appName:e})]})});ul.displayName="ModulePlaceHolder";const Gs=({operations:e,children:t,forbiddenContent:n})=>{var o;const{hasAccess:r}=rr();if(!r(...e)){if(!n)return null;if(typeof n=="function")if((o=n==null?void 0:n.prototype)!=null&&o.isReactComponent){const s=n;return l.jsx(s,{operations:e})}else return n({operations:e});return _.isValidElement(n)?n:null}return t};Gs.displayName="Authorized";const l1=({eventName:e,listener:t})=>(Dc(e,t),null),u1=()=>l.jsx("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:l.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",d:"M8.737 8.737a21.49 21.49 0 0 1 3.308-2.724m0 0c3.063-2.026 5.99-2.641 7.331-1.3 1.827 1.828.026 6.591-4.023 10.64-4.049 4.049-8.812 5.85-10.64 4.023-1.33-1.33-.736-4.218 1.249-7.253m6.083-6.11c-3.063-2.026-5.99-2.641-7.331-1.3-1.827 1.828-.026 6.591 4.023 10.64m3.308-9.34a21.497 21.497 0 0 1 3.308 2.724m2.775 3.386c1.985 3.035 2.579 5.923 1.248 7.253-1.336 1.337-4.245.732-7.295-1.275M14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"})}),dl=({applicationName:e})=>{const t=Tc(e);if(t)if(typeof t=="function"){const n=t;return l.jsx(n,{})}else return t;return l.jsx(u1,{})};dl.displayName="ApplicationIcon";const fl=()=>l.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});fl.displayName="DarkModeIcon";const hl=()=>l.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:"matrix(-1,1.2246467991473532e-16,-1.2246467991473532e-16,-1,0,0)",children:l.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});hl.displayName="LightModeIcon";const d1="container__zBqbk",f1="expanded__EbsIr",h1="label__cdMnm",Mo={container:d1,expanded:f1,label:h1};function pl(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=pl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function N(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=pl(e))&&(r&&(r+=" "),r+=t);return r}const p1=e=>e.toLowerCase().trim().split(" ").join("-"),m1=e=>`${p1(e)}-theme`,ml=()=>{const{platformName:e="Platform"}=Ms(),t=m1(e),[n,r]=_.useState(()=>{const s=localStorage.getItem(t);return s==="light"||s==="dark"?s:"light"}),o=s=>{localStorage.setItem(t,s),r(s)};return _.useEffect(()=>{document.documentElement.setAttribute("data-theme",n)},[n]),{theme:n,setTheme:o}},g1="spinner__fakUN",v1="spinner-rotation__wUmPV",y1="button__8FA9H",b1="button--contained-primary__stkTx",w1="button--outlined-primary__KZ1ww",C1="button--text-primary__GLTfm",x1="button--contained-danger__L9ehT",S1="button--outlined-danger__eoYLd",E1="button--text-danger__Sw-ha",_1="icon__--umH",xr={spinner:g1,"spinner-rotation":"spinner-rotation__wUmPV",spinnerRotation:v1,button:y1,"button--contained-primary":"button--contained-primary__stkTx",buttonContainedPrimary:b1,"button--outlined-primary":"button--outlined-primary__KZ1ww",buttonOutlinedPrimary:w1,"button--text-primary":"button--text-primary__GLTfm",buttonTextPrimary:C1,"button--contained-danger":"button--contained-danger__L9ehT",buttonContainedDanger:x1,"button--outlined-danger":"button--outlined-danger__eoYLd",buttonOutlinedDanger:S1,"button--text-danger":"button--text-danger__Sw-ha",buttonTextDanger:E1,icon:_1},qr=_.forwardRef(({variant:e="contained",colorScheme:t="primary",loading:n=!1,IconComponent:r,className:o,children:s,...i},a)=>{const c=N(xr.button,xr[`button--${e}-${t}`],o);return l.jsxs("button",{ref:a,className:c,...i,children:[n?l.jsx("div",{className:xr.spinner}):r&&l.jsx(r,{className:xr.icon}),s]})});qr.displayName="Button";const R1="Badges__5jpum",T1="Badges__5jpum",P1="Badge__95MWM",A1="Badge__95MWM",O1="Badge--primary__Rx-bS",j1="Badge--secondary__d92bT",I1="Badge--success__Kdo98",N1="Badge--warning__bf-Nn",D1="Badge--danger__HTj39",L1="Badge--small__y93Pj",M1="Badge--regular__aT5AL",k1="Badge--large__wORCH",kr={Badges:R1,badges:T1,Badge:P1,badge:A1,"Badge--primary":"Badge--primary__Rx-bS",badgePrimary:O1,"Badge--secondary":"Badge--secondary__d92bT",badgeSecondary:j1,"Badge--success":"Badge--success__Kdo98",badgeSuccess:I1,"Badge--warning":"Badge--warning__bf-Nn",badgeWarning:N1,"Badge--danger":"Badge--danger__HTj39",badgeDanger:D1,"Badge--small":"Badge--small__y93Pj",badgeSmall:L1,"Badge--regular":"Badge--regular__aT5AL",badgeRegular:M1,"Badge--large":"Badge--large__wORCH",badgeLarge:k1},bs={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in bs)Object.freeze(bs[e]);const ha=Object.freeze(bs);var pa={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function $1(e){var f,p;var t,n=[],r=1,o;if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(e=String(e).toLowerCase(),ha[e])n=ha[e].slice(),o="rgb";else if(e==="transparent")r=0,o="rgb",n=[0,0,0];else if(e[0]==="#"){var s=e.slice(1),i=s.length,a=i<=4;r=1,a?(n=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],i===4&&(r=parseInt(s[3]+s[3],16)/255)):(n=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],i===8&&(r=parseInt(s[6]+s[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),o="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var c=t[1];o=c.replace(/a$/,"");var u=o==="cmyk"?4:o==="gray"?1:3;n=t[2].trim().split(/\s*[,\/]\s*|\s+/),o==="color"&&(o=n.shift()),n=n.map(function(m,g){if(m[m.length-1]==="%")return m=parseFloat(m)/100,g===3?m:o==="rgb"?m*255:o[0]==="h"||o[0]==="l"&&!g?m*100:o==="lab"?m*125:o==="lch"?g<2?m*150:m*360:o[0]==="o"&&!g?m:o==="oklab"?m*.4:o==="oklch"?g<2?m*.4:m*360:m;if(o[g]==="h"||g===2&&o[o.length-1]==="h"){if(pa[m]!==void 0)return pa[m];if(m.endsWith("deg"))return parseFloat(m);if(m.endsWith("turn"))return parseFloat(m)*360;if(m.endsWith("grad"))return parseFloat(m)*360/400;if(m.endsWith("rad"))return parseFloat(m)*180/Math.PI}return m==="none"?0:parseFloat(m)}),r=n.length>u?n.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(n=e.match(/([0-9]+)/g).map(function(m){return parseFloat(m)}),o=((p=(f=e.match(/([a-z])/ig))==null?void 0:f.join(""))==null?void 0:p.toLowerCase())||"rgb");return{space:o,values:n,alpha:r}}const F1=(e,t)=>{const{space:n,values:r}=$1(e);return n[0]==="h"?`${n}a(${r[0]}, ${r[1]}%, ${r[2]}%, ${t})`:`${n}a(${r}, ${t})`},Ks=_.forwardRef(({children:e,color:t,className:n,customColor:r,size:o="small",style:s,...i},a)=>{const c=r?{color:r,background:F1(r,.1)}:{},u=N(kr.Badge,kr[`Badge--${o}`],{[kr[`Badge--${t}`]]:!!t},n);return l.jsx("span",{ref:a,className:u,style:{...s,...c},...i,children:e})});Ks.displayName="Badge";const Qs=_.forwardRef(({children:e,className:t,...n},r)=>{const o=N(kr.Badges,t);return l.jsx("div",{ref:r,className:o,...n,children:e})});Qs.displayName="Badges";const gl=({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...s})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...s,children:[l.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),l.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"})]}),vl=({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...s})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...s,children:[l.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),l.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),l.jsx("path",{d:"m9 12 2 2 4-4"})]}),B1="CopyToClipboardButton__2Nd2m",U1={CopyToClipboardButton:B1},W1=({content:e})=>{const[t,n]=H1(),{notify:r}=Ws(),o=t?vl:gl,s=_.useCallback(async()=>{await n(e)&&r("Copied to the Clipboard !","success")},[e,r]);return l.jsx(o,{className:U1.CopyToClipboardButton,size:18,onClick:s})},H1=()=>{const[e,t]=_.useState(!1);return[e,async r=>{try{return await navigator.clipboard.writeText(r),t(!0),setTimeout(()=>t(!1),2e3),!0}catch(o){return console.error("Failed to copy text: ",o),!1}}]},V1="FieldGroup__Q2JCV",z1="FieldGroup__Q2JCV",q1="FieldGroup--horizontal__kpfL1",G1="FieldGroup--vertical__FLo-Q",ma={FieldGroup:V1,fieldGroup:z1,"FieldGroup--horizontal":"FieldGroup--horizontal__kpfL1",fieldGroupHorizontal:q1,"FieldGroup--vertical":"FieldGroup--vertical__FLo-Q",fieldGroupVertical:G1},yl=_.forwardRef(({children:e,className:t,orientation:n="vertical",...r},o)=>{const s=N(ma.FieldGroup,ma[`FieldGroup--${n}`],t);return l.jsx("div",{ref:o,className:s,...r,children:e})});yl.displayName="FieldGroup";const K1="Input__uS0sb",ga={Input:K1,Error:"Error__-DQpw"},co=_.forwardRef(({className:e,error:t,...n},r)=>{const o=N(ga.Input,t&&ga.Error,e);return l.jsx("input",{ref:r,className:o,...n})});co.displayName="Input";const Q1={Error:"Error__N4OP5"},bl=_.forwardRef(({children:e,className:t,...n},r)=>{const o=N(Q1.Error,t);return l.jsx("span",{ref:r,className:o,...n,children:e})});bl.displayName="InputError";const Y1="Label__VYUvW",va={Label:Y1,Error:"Error__Eu6DI"},wl=_.forwardRef(({children:e,className:t,error:n,...r},o)=>{const s=N(va.Label,n&&va.Error,t);return l.jsx("label",{ref:o,className:s,...r,children:e})});wl.displayName="Label";const Z1="Select__giqpe",X1="Chevron__YvhBd",ws={Select:Z1,Chevron:X1},Cl=_.forwardRef(({children:e,className:t,...n},r)=>{const o=N(ws.Option,t);return l.jsx("option",{ref:r,className:o,...n,children:e})});Cl.displayName="Option";const Ys=_.forwardRef(({children:e,className:t,...n},r)=>{const o=N(ws.Select,t);return l.jsxs("div",{className:o,children:[l.jsx("select",{ref:r,...n,children:e}),l.jsx("div",{className:ws.Chevron,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#818181",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})})})]})});Ys.displayName="Select";Ys.Option=Cl;function ya(e,[t,n]){return Math.min(n,Math.max(t,e))}function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function J1(e,t){const n=d.createContext(t),r=s=>{const{children:i,...a}=s,c=d.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function ir(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),c=n.length;n=[...n,i];const u=p=>{var y;const{scope:m,children:g,...x}=p,h=((y=m==null?void 0:m[e])==null?void 0:y[c])||a,v=d.useMemo(()=>x,Object.values(x));return l.jsx(h.Provider,{value:v,children:g})};u.displayName=s+"Provider";function f(p,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,x=d.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[u,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,em(o,...t)]}function em(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const p=c(s)[`__scope${u}`];return{...a,...p}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function ba(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ba(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ba(e[o],null)}}}}function ce(...e){return d.useCallback(Nn(...e),e)}function wa(e){const t=tm(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),c=a.find(rm);if(c){const u=c.props.children,f=a.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function tm(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=sm(o),a=om(s,o.props);return o.type!==d.Fragment&&(a.ref=r?Nn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nm=Symbol("radix.slottable");function rm(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nm}function om(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function sm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function im(e){const t=e+"CollectionProvider",[n,r]=ir(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:v,children:y}=h,w=_.useRef(null),S=_.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:S,collectionRef:w,children:y})};i.displayName=t;const a=e+"CollectionSlot",c=wa(a),u=_.forwardRef((h,v)=>{const{scope:y,children:w}=h,S=s(a,y),E=ce(v,S.collectionRef);return l.jsx(c,{ref:E,children:w})});u.displayName=a;const f=e+"CollectionItemSlot",p="data-radix-collection-item",m=wa(f),g=_.forwardRef((h,v)=>{const{scope:y,children:w,...S}=h,E=_.useRef(null),R=ce(v,E),T=s(f,y);return _.useEffect(()=>(T.itemMap.set(E,{ref:E,...S}),()=>void T.itemMap.delete(E))),l.jsx(m,{[p]:"",ref:R,children:w})});g.displayName=f;function x(h){const v=s(e+"CollectionConsumer",h);return _.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const S=Array.from(w.querySelectorAll(`[${p}]`));return Array.from(v.itemMap.values()).sort((T,P)=>S.indexOf(T.ref.current)-S.indexOf(P.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},x,r]}var am=d.createContext(void 0);function cm(e){const t=d.useContext(am);return e||t||"ltr"}function lm(e){const t=um(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),c=a.find(fm);if(c){const u=c.props.children,f=a.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function um(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=pm(o),a=hm(s,o.props);return o.type!==d.Fragment&&(a.ref=r?Nn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dm=Symbol("radix.slottable");function fm(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dm}function hm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function pm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=mm.reduce((e,t)=>{const n=lm(`Primitive.${t}`),r=d.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gm(e,t){e&&ro.flushSync(()=>e.dispatchEvent(t))}function tn(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function vm(e,t=globalThis==null?void 0:globalThis.document){const n=tn(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ym="DismissableLayer",Cs="dismissableLayer.update",bm="dismissableLayer.pointerDownOutside",wm="dismissableLayer.focusOutside",Ca,xl=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lo=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=d.useContext(xl),[f,p]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),x=ce(t,P=>p(P)),h=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=h.indexOf(v),w=f?h.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,E=w>=y,R=Sm(P=>{const D=P.target,I=[...u.branches].some(L=>L.contains(D));!E||I||(o==null||o(P),i==null||i(P),P.defaultPrevented||a==null||a())},m),T=Em(P=>{const D=P.target;[...u.branches].some(L=>L.contains(D))||(s==null||s(P),i==null||i(P),P.defaultPrevented||a==null||a())},m);return vm(P=>{w===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ca=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),xa(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ca)}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),xa())},[f,u]),d.useEffect(()=>{const P=()=>g({});return document.addEventListener(Cs,P),()=>document.removeEventListener(Cs,P)},[]),l.jsx(ie.div,{...c,ref:x,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,T.onFocusCapture),onBlurCapture:X(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,R.onPointerDownCapture)})});lo.displayName=ym;var Cm="DismissableLayerBranch",xm=d.forwardRef((e,t)=>{const n=d.useContext(xl),r=d.useRef(null),o=ce(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(ie.div,{...e,ref:o})});xm.displayName=Cm;function Sm(e,t=globalThis==null?void 0:globalThis.document){const n=tn(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Sl(bm,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Em(e,t=globalThis==null?void 0:globalThis.document){const n=tn(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Sl(wm,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function xa(){const e=new CustomEvent(Cs);document.dispatchEvent(e)}function Sl(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?gm(o,s):o.dispatchEvent(s)}var ko=0;function El(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sa()),document.body.insertAdjacentElement("beforeend",e[1]??Sa()),ko++,()=>{ko===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ko--}},[])}function Sa(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var $o="focusScope.autoFocusOnMount",Fo="focusScope.autoFocusOnUnmount",Ea={bubbles:!1,cancelable:!0},_m="FocusScope",Zs=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=d.useState(null),u=tn(o),f=tn(s),p=d.useRef(null),m=ce(t,h=>c(h)),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let h=function(S){if(g.paused||!a)return;const E=S.target;a.contains(E)?p.current=E:bt(p.current,{select:!0})},v=function(S){if(g.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||bt(p.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const R of S)R.removedNodes.length>0&&bt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",v);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,g.paused]),d.useEffect(()=>{if(a){Ra.add(g);const h=document.activeElement;if(!a.contains(h)){const y=new CustomEvent($o,Ea);a.addEventListener($o,u),a.dispatchEvent(y),y.defaultPrevented||(Rm(jm(_l(a)),{select:!0}),document.activeElement===h&&bt(a))}return()=>{a.removeEventListener($o,u),setTimeout(()=>{const y=new CustomEvent(Fo,Ea);a.addEventListener(Fo,f),a.dispatchEvent(y),y.defaultPrevented||bt(h??document.body,{select:!0}),a.removeEventListener(Fo,f),Ra.remove(g)},0)}}},[a,u,f,g]);const x=d.useCallback(h=>{if(!n&&!r||g.paused)return;const v=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,y=document.activeElement;if(v&&y){const w=h.currentTarget,[S,E]=Tm(w);S&&E?!h.shiftKey&&y===E?(h.preventDefault(),n&&bt(S,{select:!0})):h.shiftKey&&y===S&&(h.preventDefault(),n&&bt(E,{select:!0})):y===w&&h.preventDefault()}},[n,r,g.paused]);return l.jsx(ie.div,{tabIndex:-1,...i,ref:m,onKeyDown:x})});Zs.displayName=_m;function Rm(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bt(r,{select:t}),document.activeElement!==n)return}function Tm(e){const t=_l(e),n=_a(t,e),r=_a(t.reverse(),e);return[n,r]}function _l(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _a(e,t){for(const n of e)if(!Pm(n,{upTo:t}))return n}function Pm(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Am(e){return e instanceof HTMLInputElement&&"select"in e}function bt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Am(e)&&t&&e.select()}}var Ra=Om();function Om(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ta(e,t),e.unshift(t)},remove(t){var n;e=Ta(e,t),(n=e[0])==null||n.resume()}}}function Ta(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jm(e){return e.filter(t=>t.tagName!=="A")}var ve=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},Im=d[" useId ".trim().toString()]||(()=>{}),Nm=0;function Zt(e){const[t,n]=d.useState(Im());return ve(()=>{n(r=>r??String(Nm++))},[e]),e||(t?`radix-${t}`:"")}const Dm=["top","right","bottom","left"],Lt=Math.min,Te=Math.max,Gr=Math.round,Sr=Math.floor,Je=e=>({x:e,y:e}),Lm={left:"right",right:"left",bottom:"top",top:"bottom"},Mm={start:"end",end:"start"};function xs(e,t,n){return Te(e,Lt(t,n))}function dt(e,t){return typeof e=="function"?e(t):e}function ft(e){return e.split("-")[0]}function Dn(e){return e.split("-")[1]}function Xs(e){return e==="x"?"y":"x"}function Js(e){return e==="y"?"height":"width"}const km=new Set(["top","bottom"]);function Xe(e){return km.has(ft(e))?"y":"x"}function ei(e){return Xs(Xe(e))}function $m(e,t,n){n===void 0&&(n=!1);const r=Dn(e),o=ei(e),s=Js(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Kr(i)),[i,Kr(i)]}function Fm(e){const t=Kr(e);return[Ss(e),t,Ss(t)]}function Ss(e){return e.replace(/start|end/g,t=>Mm[t])}const Pa=["left","right"],Aa=["right","left"],Bm=["top","bottom"],Um=["bottom","top"];function Wm(e,t,n){switch(e){case"top":case"bottom":return n?t?Aa:Pa:t?Pa:Aa;case"left":case"right":return t?Bm:Um;default:return[]}}function Hm(e,t,n,r){const o=Dn(e);let s=Wm(ft(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ss)))),s}function Kr(e){return e.replace(/left|right|bottom|top/g,t=>Lm[t])}function Vm(e){return{top:0,right:0,bottom:0,left:0,...e}}function Rl(e){return typeof e!="number"?Vm(e):{top:e,right:e,bottom:e,left:e}}function Qr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Oa(e,t,n){let{reference:r,floating:o}=e;const s=Xe(t),i=ei(t),a=Js(i),c=ft(t),u=s==="y",f=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-o.width,y:p};break;default:g={x:r.x,y:r.y}}switch(Dn(t)){case"start":g[i]-=m*(n&&u?-1:1);break;case"end":g[i]+=m*(n&&u?-1:1);break}return g}async function zm(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=dt(t,e),x=Rl(g),v=a[m?p==="floating"?"reference":"floating":p],y=Qr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:c})),w=p==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},R=Qr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:S,strategy:c}):w);return{top:(y.top-R.top+x.top)/E.y,bottom:(R.bottom-y.bottom+x.bottom)/E.y,left:(y.left-R.left+x.left)/E.x,right:(R.right-y.right+x.right)/E.x}}const qm=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=Oa(u,r,c),m=r,g={},x=0;for(let v=0;v<a.length;v++){var h;const{name:y,fn:w}=a[v],{x:S,y:E,data:R,reset:T}=await w({x:f,y:p,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:u,platform:{...i,detectOverflow:(h=i.detectOverflow)!=null?h:zm},elements:{reference:e,floating:t}});f=S??f,p=E??p,g={...g,[y]:{...g[y],...R}},T&&x<=50&&(x++,typeof T=="object"&&(T.placement&&(m=T.placement),T.rects&&(u=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:f,y:p}=Oa(u,m,c)),v=-1)}return{x:f,y:p,placement:m,strategy:o,middlewareData:g}},Gm=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:f=0}=dt(e,t)||{};if(u==null)return{};const p=Rl(f),m={x:n,y:r},g=ei(o),x=Js(g),h=await i.getDimensions(u),v=g==="y",y=v?"top":"left",w=v?"bottom":"right",S=v?"clientHeight":"clientWidth",E=s.reference[x]+s.reference[g]-m[g]-s.floating[x],R=m[g]-s.reference[g],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let P=T?T[S]:0;(!P||!await(i.isElement==null?void 0:i.isElement(T)))&&(P=a.floating[S]||s.floating[x]);const D=E/2-R/2,I=P/2-h[x]/2-1,L=Lt(p[y],I),B=Lt(p[w],I),U=L,W=P-h[x]-B,V=P/2-h[x]/2+D,re=xs(U,V,W),z=!c.arrow&&Dn(o)!=null&&V!==re&&s.reference[x]/2-(V<U?L:B)-h[x]/2<0,Q=z?V<U?V-U:V-W:0;return{[g]:m[g]+Q,data:{[g]:re,centerOffset:V-re-Q,...z&&{alignmentOffset:Q}},reset:z}}}),Km=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:h=!0,...v}=dt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ft(o),w=Xe(a),S=ft(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(u.floating)),R=m||(S||!h?[Kr(a)]:Fm(a)),T=x!=="none";!m&&T&&R.push(...Hm(a,h,x,E));const P=[a,...R],D=await c.detectOverflow(t,v),I=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&I.push(D[y]),p){const V=$m(o,i,E);I.push(D[V[0]],D[V[1]])}if(L=[...L,{placement:o,overflows:I}],!I.every(V=>V<=0)){var B,U;const V=(((B=s.flip)==null?void 0:B.index)||0)+1,re=P[V];if(re&&(!(p==="alignment"?w!==Xe(re):!1)||L.every($=>Xe($.placement)===w?$.overflows[0]>0:!0)))return{data:{index:V,overflows:L},reset:{placement:re}};let z=(U=L.filter(Q=>Q.overflows[0]<=0).sort((Q,$)=>Q.overflows[1]-$.overflows[1])[0])==null?void 0:U.placement;if(!z)switch(g){case"bestFit":{var W;const Q=(W=L.filter($=>{if(T){const oe=Xe($.placement);return oe===w||oe==="y"}return!0}).map($=>[$.placement,$.overflows.filter(oe=>oe>0).reduce((oe,pe)=>oe+pe,0)]).sort(($,oe)=>$[1]-oe[1])[0])==null?void 0:W[0];Q&&(z=Q);break}case"initialPlacement":z=a;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function ja(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ia(e){return Dm.some(t=>e[t]>=0)}const Qm=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=dt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=ja(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ia(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=ja(i,n.floating);return{data:{escapedOffsets:a,escaped:Ia(a)}}}default:return{}}}}},Tl=new Set(["left","top"]);async function Ym(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ft(n),a=Dn(n),c=Xe(n)==="y",u=Tl.has(i)?-1:1,f=s&&c?-1:1,p=dt(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof x=="number"&&(g=a==="end"?x*-1:x),c?{x:g*f,y:m*u}:{x:m*u,y:g*f}}const Zm=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await Ym(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},Xm=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:w,y:S}=y;return{x:w,y:S}}},...u}=dt(e,t),f={x:n,y:r},p=await s.detectOverflow(t,u),m=Xe(ft(o)),g=Xs(m);let x=f[g],h=f[m];if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",S=x+p[y],E=x-p[w];x=xs(S,x,E)}if(a){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",S=h+p[y],E=h-p[w];h=xs(S,h,E)}const v=c.fn({...t,[g]:x,[m]:h});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[g]:i,[m]:a}}}}}},Jm=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=dt(e,t),f={x:n,y:r},p=Xe(o),m=Xs(p);let g=f[m],x=f[p];const h=dt(a,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const S=m==="y"?"height":"width",E=s.reference[m]-s.floating[S]+v.mainAxis,R=s.reference[m]+s.reference[S]-v.mainAxis;g<E?g=E:g>R&&(g=R)}if(u){var y,w;const S=m==="y"?"width":"height",E=Tl.has(ft(o)),R=s.reference[p]-s.floating[S]+(E&&((y=i.offset)==null?void 0:y[p])||0)+(E?0:v.crossAxis),T=s.reference[p]+s.reference[S]+(E?0:((w=i.offset)==null?void 0:w[p])||0)-(E?v.crossAxis:0);x<R?x=R:x>T&&(x=T)}return{[m]:g,[p]:x}}}},eg=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=dt(e,t),f=await i.detectOverflow(t,u),p=ft(o),m=Dn(o),g=Xe(o)==="y",{width:x,height:h}=s.floating;let v,y;p==="top"||p==="bottom"?(v=p,y=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=p,v=m==="end"?"top":"bottom");const w=h-f.top-f.bottom,S=x-f.left-f.right,E=Lt(h-f[v],w),R=Lt(x-f[y],S),T=!t.middlewareData.shift;let P=E,D=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=w),T&&!m){const L=Te(f.left,0),B=Te(f.right,0),U=Te(f.top,0),W=Te(f.bottom,0);g?D=x-2*(L!==0||B!==0?L+B:Te(f.left,f.right)):P=h-2*(U!==0||W!==0?U+W:Te(f.top,f.bottom))}await c({...t,availableWidth:D,availableHeight:P});const I=await i.getDimensions(a.floating);return x!==I.width||h!==I.height?{reset:{rects:!0}}:{}}}};function uo(){return typeof window<"u"}function Ln(e){return Pl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ae(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tt(e){var t;return(t=(Pl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Pl(e){return uo()?e instanceof Node||e instanceof Ae(e).Node:!1}function Ue(e){return uo()?e instanceof Element||e instanceof Ae(e).Element:!1}function et(e){return uo()?e instanceof HTMLElement||e instanceof Ae(e).HTMLElement:!1}function Na(e){return!uo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ae(e).ShadowRoot}const tg=new Set(["inline","contents"]);function ar(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=We(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!tg.has(o)}const ng=new Set(["table","td","th"]);function rg(e){return ng.has(Ln(e))}const og=[":popover-open",":modal"];function fo(e){return og.some(t=>{try{return e.matches(t)}catch{return!1}})}const sg=["transform","translate","scale","rotate","perspective"],ig=["transform","translate","scale","rotate","perspective","filter"],ag=["paint","layout","strict","content"];function ti(e){const t=ni(),n=Ue(e)?We(e):e;return sg.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||ig.some(r=>(n.willChange||"").includes(r))||ag.some(r=>(n.contain||"").includes(r))}function cg(e){let t=Mt(e);for(;et(t)&&!An(t);){if(ti(t))return t;if(fo(t))return null;t=Mt(t)}return null}function ni(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lg=new Set(["html","body","#document"]);function An(e){return lg.has(Ln(e))}function We(e){return Ae(e).getComputedStyle(e)}function ho(e){return Ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mt(e){if(Ln(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Na(e)&&e.host||tt(e);return Na(t)?t.host:t}function Al(e){const t=Mt(e);return An(t)?e.ownerDocument?e.ownerDocument.body:e.body:et(t)&&ar(t)?t:Al(t)}function Gn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Al(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ae(o);if(s){const a=Es(i);return t.concat(i,i.visualViewport||[],ar(o)?o:[],a&&n?Gn(a):[])}return t.concat(o,Gn(o,[],n))}function Es(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ol(e){const t=We(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=et(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Gr(n)!==s||Gr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function ri(e){return Ue(e)?e:e.contextElement}function pn(e){const t=ri(e);if(!et(t))return Je(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Ol(t);let i=(s?Gr(n.width):n.width)/r,a=(s?Gr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const ug=Je(0);function jl(e){const t=Ae(e);return!ni()||!t.visualViewport?ug:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ae(e)?!1:t}function nn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=ri(e);let i=Je(1);t&&(r?Ue(r)&&(i=pn(r)):i=pn(e));const a=dg(s,n,r)?jl(s):Je(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,f=o.width/i.x,p=o.height/i.y;if(s){const m=Ae(s),g=r&&Ue(r)?Ae(r):r;let x=m,h=Es(x);for(;h&&r&&g!==x;){const v=pn(h),y=h.getBoundingClientRect(),w=We(h),S=y.left+(h.clientLeft+parseFloat(w.paddingLeft))*v.x,E=y.top+(h.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,f*=v.x,p*=v.y,c+=S,u+=E,x=Ae(h),h=Es(x)}}return Qr({width:f,height:p,x:c,y:u})}function po(e,t){const n=ho(e).scrollLeft;return t?t.left+n:nn(tt(e)).left+n}function Il(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-po(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function fg(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=tt(r),a=t?fo(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Je(1);const f=Je(0),p=et(r);if((p||!p&&!s)&&((Ln(r)!=="body"||ar(i))&&(c=ho(r)),et(r))){const g=nn(r);u=pn(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=i&&!p&&!s?Il(i,c):Je(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x+m.x,y:n.y*u.y-c.scrollTop*u.y+f.y+m.y}}function hg(e){return Array.from(e.getClientRects())}function pg(e){const t=tt(e),n=ho(e),r=e.ownerDocument.body,o=Te(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Te(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+po(e);const a=-n.scrollTop;return We(r).direction==="rtl"&&(i+=Te(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Da=25;function mg(e,t){const n=Ae(e),r=tt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const f=ni();(!f||f&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=po(r);if(u<=0){const f=r.ownerDocument,p=f.body,m=getComputedStyle(p),g=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-g);x<=Da&&(s-=x)}else u<=Da&&(s+=u);return{width:s,height:i,x:a,y:c}}const gg=new Set(["absolute","fixed"]);function vg(e,t){const n=nn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=et(e)?pn(e):Je(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function La(e,t,n){let r;if(t==="viewport")r=mg(e,n);else if(t==="document")r=pg(tt(e));else if(Ue(t))r=vg(t,n);else{const o=jl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Qr(r)}function Nl(e,t){const n=Mt(e);return n===t||!Ue(n)||An(n)?!1:We(n).position==="fixed"||Nl(n,t)}function yg(e,t){const n=t.get(e);if(n)return n;let r=Gn(e,[],!1).filter(a=>Ue(a)&&Ln(a)!=="body"),o=null;const s=We(e).position==="fixed";let i=s?Mt(e):e;for(;Ue(i)&&!An(i);){const a=We(i),c=ti(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&gg.has(o.position)||ar(i)&&!c&&Nl(e,i))?r=r.filter(f=>f!==i):o=a,i=Mt(i)}return t.set(e,r),r}function bg(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?fo(t)?[]:yg(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((u,f)=>{const p=La(t,f,o);return u.top=Te(p.top,u.top),u.right=Lt(p.right,u.right),u.bottom=Lt(p.bottom,u.bottom),u.left=Te(p.left,u.left),u},La(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function wg(e){const{width:t,height:n}=Ol(e);return{width:t,height:n}}function Cg(e,t,n){const r=et(t),o=tt(t),s=n==="fixed",i=nn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Je(0);function u(){c.x=po(o)}if(r||!r&&!s)if((Ln(t)!=="body"||ar(o))&&(a=ho(t)),r){const g=nn(t,!0,s,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&u();s&&!r&&o&&u();const f=o&&!r&&!s?Il(o,a):Je(0),p=i.left+a.scrollLeft-c.x-f.x,m=i.top+a.scrollTop-c.y-f.y;return{x:p,y:m,width:i.width,height:i.height}}function Bo(e){return We(e).position==="static"}function Ma(e,t){if(!et(e)||We(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return tt(e)===n&&(n=n.ownerDocument.body),n}function Dl(e,t){const n=Ae(e);if(fo(e))return n;if(!et(e)){let o=Mt(e);for(;o&&!An(o);){if(Ue(o)&&!Bo(o))return o;o=Mt(o)}return n}let r=Ma(e,t);for(;r&&rg(r)&&Bo(r);)r=Ma(r,t);return r&&An(r)&&Bo(r)&&!ti(r)?n:r||cg(e)||n}const xg=async function(e){const t=this.getOffsetParent||Dl,n=this.getDimensions,r=await n(e.floating);return{reference:Cg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sg(e){return We(e).direction==="rtl"}const Eg={convertOffsetParentRelativeRectToViewportRelativeRect:fg,getDocumentElement:tt,getClippingRect:bg,getOffsetParent:Dl,getElementRects:xg,getClientRects:hg,getDimensions:wg,getScale:pn,isElement:Ue,isRTL:Sg};function Ll(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _g(e,t){let n=null,r;const o=tt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:f,top:p,width:m,height:g}=u;if(a||t(),!m||!g)return;const x=Sr(p),h=Sr(o.clientWidth-(f+m)),v=Sr(o.clientHeight-(p+g)),y=Sr(f),S={rootMargin:-x+"px "+-h+"px "+-v+"px "+-y+"px",threshold:Te(0,Lt(1,c))||1};let E=!0;function R(T){const P=T[0].intersectionRatio;if(P!==c){if(!E)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}P===1&&!Ll(u,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(R,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,S)}n.observe(e)}return i(!0),s}function Rg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=ri(e),f=o||s?[...u?Gn(u):[],...Gn(t)]:[];f.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const p=u&&a?_g(u,n):null;let m=-1,g=null;i&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let x,h=c?nn(e):null;c&&v();function v(){const y=nn(e);h&&!Ll(h,y)&&n(),h=y,x=requestAnimationFrame(v)}return n(),()=>{var y;f.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),p==null||p(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(x)}}const Tg=Zm,Pg=Xm,Ag=Km,Og=eg,jg=Qm,ka=Gm,Ig=Jm,Ng=(e,t,n)=>{const r=new Map,o={platform:Eg,...n},s={...o.platform,_c:r};return qm(e,t,{...o,platform:s})};var Dg=typeof document<"u",Lg=function(){},$r=Dg?_.useLayoutEffect:Lg;function Yr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Yr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Yr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ml(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $a(e,t){const n=Ml(e);return Math.round(t*n)/n}function Uo(e){const t=d.useRef(e);return $r(()=>{t.current=e}),t}function Mg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[f,p]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=d.useState(r);Yr(m,r)||g(r);const[x,h]=d.useState(null),[v,y]=d.useState(null),w=d.useCallback($=>{$!==T.current&&(T.current=$,h($))},[]),S=d.useCallback($=>{$!==P.current&&(P.current=$,y($))},[]),E=s||x,R=i||v,T=d.useRef(null),P=d.useRef(null),D=d.useRef(f),I=c!=null,L=Uo(c),B=Uo(o),U=Uo(u),W=d.useCallback(()=>{if(!T.current||!P.current)return;const $={placement:t,strategy:n,middleware:m};B.current&&($.platform=B.current),Ng(T.current,P.current,$).then(oe=>{const pe={...oe,isPositioned:U.current!==!1};V.current&&!Yr(D.current,pe)&&(D.current=pe,ro.flushSync(()=>{p(pe)}))})},[m,t,n,B,U]);$r(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[u]);const V=d.useRef(!1);$r(()=>(V.current=!0,()=>{V.current=!1}),[]),$r(()=>{if(E&&(T.current=E),R&&(P.current=R),E&&R){if(L.current)return L.current(E,R,W);W()}},[E,R,W,L,I]);const re=d.useMemo(()=>({reference:T,floating:P,setReference:w,setFloating:S}),[w,S]),z=d.useMemo(()=>({reference:E,floating:R}),[E,R]),Q=d.useMemo(()=>{const $={position:n,left:0,top:0};if(!z.floating)return $;const oe=$a(z.floating,f.x),pe=$a(z.floating,f.y);return a?{...$,transform:"translate("+oe+"px, "+pe+"px)",...Ml(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:pe}},[n,a,z.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:W,refs:re,elements:z,floatingStyles:Q}),[f,W,re,z,Q])}const kg=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ka({element:r.current,padding:o}).fn(n):{}:r?ka({element:r,padding:o}).fn(n):{}}}},$g=(e,t)=>({...Tg(e),options:[e,t]}),Fg=(e,t)=>({...Pg(e),options:[e,t]}),Bg=(e,t)=>({...Ig(e),options:[e,t]}),Ug=(e,t)=>({...Ag(e),options:[e,t]}),Wg=(e,t)=>({...Og(e),options:[e,t]}),Hg=(e,t)=>({...jg(e),options:[e,t]}),Vg=(e,t)=>({...kg(e),options:[e,t]});var zg="Arrow",kl=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(ie.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});kl.displayName=zg;var qg=kl;function Gg(e){const[t,n]=d.useState(void 0);return ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var oi="Popper",[$l,mo]=ir(oi),[Kg,Fl]=$l(oi),Bl=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(Kg,{scope:t,anchor:r,onAnchorChange:o,children:n})};Bl.displayName=oi;var Ul="PopperAnchor",Wl=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Fl(Ul,n),i=d.useRef(null),a=ce(t,i),c=d.useRef(null);return d.useEffect(()=>{const u=c.current;c.current=(r==null?void 0:r.current)||i.current,u!==c.current&&s.onAnchorChange(c.current)}),r?null:l.jsx(ie.div,{...o,ref:a})});Wl.displayName=Ul;var si="PopperContent",[Qg,Yg]=$l(si),Hl=d.forwardRef((e,t)=>{var k,J,de,Y,ee,Z;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:x,...h}=e,v=Fl(si,n),[y,w]=d.useState(null),S=ce(t,ye=>w(ye)),[E,R]=d.useState(null),T=Gg(E),P=(T==null?void 0:T.width)??0,D=(T==null?void 0:T.height)??0,I=r+(s!=="center"?"-"+s:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(u)?u:[u],U=B.length>0,W={padding:L,boundary:B.filter(Xg),altBoundary:U},{refs:V,floatingStyles:re,placement:z,isPositioned:Q,middlewareData:$}=Mg({strategy:"fixed",placement:I,whileElementsMounted:(...ye)=>Rg(...ye,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[$g({mainAxis:o+D,alignmentAxis:i}),c&&Fg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Bg():void 0,...W}),c&&Ug({...W}),Wg({...W,apply:({elements:ye,rects:je,availableWidth:ze,availableHeight:Le})=>{const{width:vt,height:ur}=je.reference,rt=ye.floating.style;rt.setProperty("--radix-popper-available-width",`${ze}px`),rt.setProperty("--radix-popper-available-height",`${Le}px`),rt.setProperty("--radix-popper-anchor-width",`${vt}px`),rt.setProperty("--radix-popper-anchor-height",`${ur}px`)}}),E&&Vg({element:E,padding:a}),Jg({arrowWidth:P,arrowHeight:D}),m&&Hg({strategy:"referenceHidden",...W})]}),[oe,pe]=ql(z),Oe=tn(x);ve(()=>{Q&&(Oe==null||Oe())},[Q,Oe]);const pt=(k=$.arrow)==null?void 0:k.x,mt=(J=$.arrow)==null?void 0:J.y,Ve=((de=$.arrow)==null?void 0:de.centerOffset)!==0,[gt,De]=d.useState();return ve(()=>{y&&De(window.getComputedStyle(y).zIndex)},[y]),l.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...re,transform:Q?re.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:gt,"--radix-popper-transform-origin":[(Y=$.transformOrigin)==null?void 0:Y.x,(ee=$.transformOrigin)==null?void 0:ee.y].join(" "),...((Z=$.hide)==null?void 0:Z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Qg,{scope:n,placedSide:oe,onArrowChange:R,arrowX:pt,arrowY:mt,shouldHideArrow:Ve,children:l.jsx(ie.div,{"data-side":oe,"data-align":pe,...h,ref:S,style:{...h.style,animation:Q?void 0:"none"}})})})});Hl.displayName=si;var Vl="PopperArrow",Zg={top:"bottom",right:"left",bottom:"top",left:"right"},zl=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Yg(Vl,r),i=Zg[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(qg,{...o,ref:n,style:{...o.style,display:"block"}})})});zl.displayName=Vl;function Xg(e){return e!==null}var Jg=e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,f]=ql(n),p={start:"0%",center:"50%",end:"100%"}[f],m=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,g=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let x="",h="";return u==="bottom"?(x=i?p:`${m}px`,h=`${-c}px`):u==="top"?(x=i?p:`${m}px`,h=`${r.floating.height+c}px`):u==="right"?(x=`${-c}px`,h=i?p:`${g}px`):u==="left"&&(x=`${r.floating.width+c}px`,h=i?p:`${g}px`),{data:{x,y:h}}}});function ql(e){const[t,n="center"]=e.split("-");return[t,n]}var Gl=Bl,Kl=Wl,Ql=Hl,Yl=zl,ev="Portal",ii=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);ve(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?lc.createPortal(l.jsx(ie.div,{...r,ref:t}),i):null});ii.displayName=ev;function tv(e){const t=nv(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),c=a.find(ov);if(c){const u=c.props.children,f=a.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function nv(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=iv(o),a=sv(s,o.props);return o.type!==d.Fragment&&(a.ref=r?Nn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rv=Symbol("radix.slottable");function ov(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rv}function sv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function iv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var av=d[" useInsertionEffect ".trim().toString()]||ve;function Zr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=cv({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const f=d.useRef(e!==void 0);d.useEffect(()=>{const p=f.current;p!==a&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=d.useCallback(f=>{var p;if(a){const m=lv(f)?f(e):f;m!==e&&((p=i.current)==null||p.call(i,m))}else s(f)},[a,e,s,i]);return[c,u]}function cv({defaultProp:e,onChange:t}){const[n,r]=d.useState(e),o=d.useRef(n),s=d.useRef(t);return av(()=>{s.current=t},[t]),d.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function lv(e){return typeof e=="function"}function uv(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Zl=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dv="VisuallyHidden",Xl=d.forwardRef((e,t)=>l.jsx(ie.span,{...e,ref:t,style:{...Zl,...e.style}}));Xl.displayName=dv;var fv=Xl,hv=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},dn=new WeakMap,Er=new WeakMap,_r={},Wo=0,Jl=function(e){return e&&(e.host||Jl(e.parentNode))},pv=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Jl(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},mv=function(e,t,n,r){var o=pv(t,Array.isArray(e)?e:[e]);_r[n]||(_r[n]=new WeakMap);var s=_r[n],i=[],a=new Set,c=new Set(o),u=function(p){!p||a.has(p)||(a.add(p),u(p.parentNode))};o.forEach(u);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(a.has(m))f(m);else try{var g=m.getAttribute(r),x=g!==null&&g!=="false",h=(dn.get(m)||0)+1,v=(s.get(m)||0)+1;dn.set(m,h),s.set(m,v),i.push(m),h===1&&x&&Er.set(m,!0),v===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return f(t),a.clear(),Wo++,function(){i.forEach(function(p){var m=dn.get(p)-1,g=s.get(p)-1;dn.set(p,m),s.set(p,g),m||(Er.has(p)||p.removeAttribute(r),Er.delete(p)),g||p.removeAttribute(n)}),Wo--,Wo||(dn=new WeakMap,dn=new WeakMap,Er=new WeakMap,_r={})}},eu=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=hv(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),mv(r,o,n,"aria-hidden")):function(){return null}},Fr="right-scroll-bar-position",Br="width-before-scroll-bar",gv="with-scroll-bars-hidden",vv="--removed-body-scroll-bar-size";function Ho(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function yv(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var bv=typeof window<"u"?d.useLayoutEffect:d.useEffect,Fa=new WeakMap;function wv(e,t){var n=yv(null,function(r){return e.forEach(function(o){return Ho(o,r)})});return bv(function(){var r=Fa.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Ho(a,null)}),s.forEach(function(a){o.has(a)||Ho(a,i)})}Fa.set(n,e)},[e]),n}function Cv(e){return e}function xv(e,t){t===void 0&&(t=Cv);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var f=i;i=[],f.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(f){i.push(f),u()},filter:function(f){return i=i.filter(f),n}}}};return o}function Sv(e){e===void 0&&(e={});var t=xv(null);return t.options=Ye({async:!0,ssr:!1},e),t}var tu=function(e){var t=e.sideCar,n=kc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Ye({},n))};tu.isSideCarExport=!0;function Ev(e,t){return e.useMedium(t),tu}var nu=Sv(),Vo=function(){},go=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:Vo,onWheelCapture:Vo,onTouchMoveCapture:Vo}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,f=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,x=e.noIsolation,h=e.inert,v=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,S=e.gapMode,E=kc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,T=wv([n,t]),P=Ye(Ye({},E),o);return d.createElement(d.Fragment,null,f&&d.createElement(R,{sideCar:nu,removeScrollBar:u,shards:p,noRelative:g,noIsolation:x,inert:h,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:S}),i?d.cloneElement(d.Children.only(a),Ye(Ye({},P),{ref:T})):d.createElement(w,Ye({},P,{className:c,ref:T}),a))});go.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};go.classNames={fullWidth:Br,zeroRight:Fr};var _v=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rv(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_v();return t&&e.setAttribute("nonce",t),e}function Tv(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Pv(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Av=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rv())&&(Tv(t,n),Pv(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ov=function(){var e=Av();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ru=function(){var e=Ov(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},jv={left:0,top:0,right:0,gap:0},zo=function(e){return parseInt(e||"",10)||0},Iv=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[zo(n),zo(r),zo(o)]},Nv=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jv;var t=Iv(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Dv=ru(),mn="data-scroll-locked",Lv=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
208
|
+
`,pr=16,ap=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,containerStyle:s,containerClassName:i})=>{let{toasts:a,handlers:c}=Lh(n);return d.createElement("div",{style:{position:"fixed",zIndex:9999,top:pr,left:pr,right:pr,bottom:pr,pointerEvents:"none",...s},className:i,onMouseEnter:c.startPause,onMouseLeave:c.endPause},a.map(u=>{let f=u.position||t,p=c.calculateOffset(u,{reverseOrder:e,gutter:r,defaultPosition:t}),m=sp(f,p);return d.createElement(op,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?ip:"",style:m},u.type==="custom"?Wr(u.message,u):o?o(u):d.createElement(rp,{toast:u,position:f}))}))},Yi=Pe;const Ws=()=>({notify:_.useCallback((t,n,r)=>{const o={style:{background:"var(--platform-background-primary-color)",color:"var(--platform-text-primary-color)"}};n==="warning"||n==="info"?Yi(t,{...o,icon:n==="warning"?"⚠️":"ℹ️"}):Yi[n](t,o),r&&console.error(r)},[])});var In=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Jt=typeof window>"u"||"Deno"in globalThis;function xe(){}function cp(e,t){return typeof e=="function"?e(t):e}function os(e){return typeof e=="number"&&e>=0&&e!==1/0}function qc(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Dt(e,t){return typeof e=="function"?e(t):e}function Fe(e,t){return typeof e=="function"?e(t):e}function Zi(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Hs(i,t.options))return!1}else if(!qn(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Xi(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(en(t.options.mutationKey)!==en(s))return!1}else if(!qn(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Hs(e,t){return((t==null?void 0:t.queryKeyHashFn)||en)(e)}function en(e){return JSON.stringify(e,(t,n)=>is(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function qn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>qn(e[n],t[n])):!1}function ss(e,t){if(e===t)return e;const n=Ji(e)&&Ji(t);if(n||is(e)&&is(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let c=0;for(let u=0;u<i;u++){const f=n?u:s[u];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(a[f]=void 0,c++):(a[f]=ss(e[f],t[f]),a[f]===e[f]&&e[f]!==void 0&&c++)}return o===i&&c===o?e:a}return t}function Hr(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ji(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function is(e){if(!ea(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!ea(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ea(e){return Object.prototype.toString.call(e)==="[object Object]"}function lp(e){return new Promise(t=>{setTimeout(t,e)})}function as(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){try{return ss(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return ss(e,t)}return t}function up(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function dp(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Vr=Symbol();function Gc(e,t){return e.queryFn===Vr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Vr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Kc(e,t){return typeof e=="function"?e(...t):!!e}var Ht,xt,gn,Ja,fp=(Ja=class extends In{constructor(){super();M(this,Ht);M(this,xt);M(this,gn);O(this,gn,t=>{if(!Jt&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,xt)||this.setEventListener(C(this,gn))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,xt))==null||t.call(this),O(this,xt,void 0))}setEventListener(t){var n;O(this,gn,t),(n=C(this,xt))==null||n.call(this),O(this,xt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,Ht)!==t&&(O(this,Ht,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,Ht)=="boolean"?C(this,Ht):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ht=new WeakMap,xt=new WeakMap,gn=new WeakMap,Ja),Vs=new fp,vn,St,yn,ec,hp=(ec=class extends In{constructor(){super();M(this,vn,!0);M(this,St);M(this,yn);O(this,yn,t=>{if(!Jt&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){C(this,St)||this.setEventListener(C(this,yn))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,St))==null||t.call(this),O(this,St,void 0))}setEventListener(t){var n;O(this,yn,t),(n=C(this,St))==null||n.call(this),O(this,St,t(this.setOnline.bind(this)))}setOnline(t){C(this,vn)!==t&&(O(this,vn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return C(this,vn)}},vn=new WeakMap,St=new WeakMap,yn=new WeakMap,ec),zr=new hp;function cs(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function pp(e){return Math.min(1e3*2**e,3e4)}function Qc(e){return(e??"online")==="online"?zr.isOnline():!0}var Yc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function No(e){return e instanceof Yc}function Zc(e){let t=!1,n=0,r=!1,o;const s=cs(),i=h=>{var v;r||(m(new Yc(h)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},c=()=>{t=!1},u=()=>Vs.isFocused()&&(e.networkMode==="always"||zr.isOnline())&&e.canRun(),f=()=>Qc(e.networkMode)&&e.canRun(),p=h=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,h),o==null||o(),s.resolve(h))},m=h=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,h),o==null||o(),s.reject(h))},g=()=>new Promise(h=>{var v;o=y=>{(r||u())&&h(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var h;o=void 0,r||(h=e.onContinue)==null||h.call(e)}),x=()=>{if(r)return;let h;const v=n===0?e.initialPromise:void 0;try{h=v??e.fn()}catch(y){h=Promise.reject(y)}Promise.resolve(h).then(p).catch(y=>{var T;if(r)return;const w=e.retry??(Jt?0:3),S=e.retryDelay??pp,E=typeof S=="function"?S(n,y):S,R=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,y);if(t||!R){m(y);return}n++,(T=e.onFail)==null||T.call(e,n,y),lp(E).then(()=>u()?void 0:g()).then(()=>{t?m(y):x()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:c,canStart:f,start:()=>(f()?x():g().then(x),s)}}var mp=e=>setTimeout(e,0);function gp(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=mp;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var he=gp(),Vt,tc,Xc=(tc=class{constructor(){M(this,Vt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),os(this.gcTime)&&O(this,Vt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Jt?1/0:5*60*1e3))}clearGcTimeout(){C(this,Vt)&&(clearTimeout(C(this,Vt)),O(this,Vt,void 0))}},Vt=new WeakMap,tc),bn,wn,Ne,zt,me,Yn,qt,ke,st,nc,vp=(nc=class extends Xc{constructor(t){super();M(this,ke);M(this,bn);M(this,wn);M(this,Ne);M(this,zt);M(this,me);M(this,Yn);M(this,qt);O(this,qt,!1),O(this,Yn,t.defaultOptions),this.setOptions(t.options),this.observers=[],O(this,zt,t.client),O(this,Ne,C(this,zt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,O(this,bn,yp(this.options)),this.state=t.state??C(this,bn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,me))==null?void 0:t.promise}setOptions(t){this.options={...C(this,Yn),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,Ne).remove(this)}setData(t,n){const r=as(this.state.data,t,this.options);return H(this,ke,st).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){H(this,ke,st).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=C(this,me))==null?void 0:r.promise;return(o=C(this,me))==null||o.cancel(t),n?n.then(xe).catch(xe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,bn))}isActive(){return this.observers.some(t=>Fe(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Dt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!qc(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,me))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,me))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,Ne).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(C(this,me)&&(C(this,qt)?C(this,me).cancel({revert:!0}):C(this,me).cancelRetry()),this.scheduleGc()),C(this,Ne).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||H(this,ke,st).call(this,{type:"invalidate"})}fetch(t,n){var u,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,me))return C(this,me).continueRetry(),C(this,me).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(g=>g.options.queryFn);m&&this.setOptions(m.options)}Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");const r=new AbortController,o=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(O(this,qt,!0),r.signal)})},s=()=>{const m=Gc(this.options,n),x=(()=>{const h={client:C(this,zt),queryKey:this.queryKey,meta:this.meta};return o(h),h})();return O(this,qt,!1),this.options.persister?this.options.persister(m,x,this):m(x)},a=(()=>{const m={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,zt),state:this.state,fetchFn:s};return o(m),m})();(u=this.options.behavior)==null||u.onFetch(a,this),O(this,wn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&H(this,ke,st).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const c=m=>{var g,x,h,v;No(m)&&m.silent||H(this,ke,st).call(this,{type:"error",error:m}),No(m)||((x=(g=C(this,Ne).config).onError)==null||x.call(g,m,this),(v=(h=C(this,Ne).config).onSettled)==null||v.call(h,this.state.data,m,this)),this.scheduleGc()};return O(this,me,Zc({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var g,x,h,v;if(m===void 0){console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(y){c(y);return}(x=(g=C(this,Ne).config).onSuccess)==null||x.call(g,m,this),(v=(h=C(this,Ne).config).onSettled)==null||v.call(h,m,this.state.error,this),this.scheduleGc()},onError:c,onFail:(m,g)=>{H(this,ke,st).call(this,{type:"failed",failureCount:m,error:g})},onPause:()=>{H(this,ke,st).call(this,{type:"pause"})},onContinue:()=>{H(this,ke,st).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),C(this,me).start()}},bn=new WeakMap,wn=new WeakMap,Ne=new WeakMap,zt=new WeakMap,me=new WeakMap,Yn=new WeakMap,qt=new WeakMap,ke=new WeakSet,st=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Jc(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return No(o)&&o.revert&&C(this,wn)?{...C(this,wn),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),he.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,Ne).notify({query:this,type:"updated",action:t})})},nc);function Jc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Qc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 Ge,rc,bp=(rc=class extends In{constructor(t={}){super();M(this,Ge);this.config=t,O(this,Ge,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Hs(o,n);let i=this.get(s);return i||(i=new vp({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){C(this,Ge).has(t.queryHash)||(C(this,Ge).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=C(this,Ge).get(t.queryHash);n&&(t.destroy(),n===t&&C(this,Ge).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){he.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,Ge).get(t)}getAll(){return[...C(this,Ge).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Zi(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Zi(t,r)):n}notify(t){he.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){he.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){he.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ge=new WeakMap,rc),Ke,we,Gt,Qe,yt,oc,wp=(oc=class extends Xc{constructor(t){super();M(this,Qe);M(this,Ke);M(this,we);M(this,Gt);this.mutationId=t.mutationId,O(this,we,t.mutationCache),O(this,Ke,[]),this.state=t.state||el(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,Ke).includes(t)||(C(this,Ke).push(t),this.clearGcTimeout(),C(this,we).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){O(this,Ke,C(this,Ke).filter(n=>n!==t)),this.scheduleGc(),C(this,we).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Ke).length||(this.state.status==="pending"?this.scheduleGc():C(this,we).remove(this))}continue(){var t;return((t=C(this,Gt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,a,c,u,f,p,m,g,x,h,v,y,w,S,E,R,T,P,D;const n=()=>{H(this,Qe,yt).call(this,{type:"continue"})};O(this,Gt,Zc({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,L)=>{H(this,Qe,yt).call(this,{type:"failed",failureCount:I,error:L})},onPause:()=>{H(this,Qe,yt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,we).canRun(this)}));const r=this.state.status==="pending",o=!C(this,Gt).canStart();try{if(r)n();else{H(this,Qe,yt).call(this,{type:"pending",variables:t,isPaused:o}),await((i=(s=C(this,we).config).onMutate)==null?void 0:i.call(s,t,this));const L=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,t));L!==this.state.context&&H(this,Qe,yt).call(this,{type:"pending",context:L,variables:t,isPaused:o})}const I=await C(this,Gt).start();return await((f=(u=C(this,we).config).onSuccess)==null?void 0:f.call(u,I,t,this.state.context,this)),await((m=(p=this.options).onSuccess)==null?void 0:m.call(p,I,t,this.state.context)),await((x=(g=C(this,we).config).onSettled)==null?void 0:x.call(g,I,null,this.state.variables,this.state.context,this)),await((v=(h=this.options).onSettled)==null?void 0:v.call(h,I,null,t,this.state.context)),H(this,Qe,yt).call(this,{type:"success",data:I}),I}catch(I){try{throw await((w=(y=C(this,we).config).onError)==null?void 0:w.call(y,I,t,this.state.context,this)),await((E=(S=this.options).onError)==null?void 0:E.call(S,I,t,this.state.context)),await((T=(R=C(this,we).config).onSettled)==null?void 0:T.call(R,void 0,I,this.state.variables,this.state.context,this)),await((D=(P=this.options).onSettled)==null?void 0:D.call(P,void 0,I,t,this.state.context)),I}finally{H(this,Qe,yt).call(this,{type:"error",error:I})}}finally{C(this,we).runNext(this)}}},Ke=new WeakMap,we=new WeakMap,Gt=new WeakMap,Qe=new WeakSet,yt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),he.batch(()=>{C(this,Ke).forEach(r=>{r.onMutationUpdate(t)}),C(this,we).notify({mutation:this,type:"updated",action:t})})},oc);function el(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var it,$e,Zn,sc,Cp=(sc=class extends In{constructor(t={}){super();M(this,it);M(this,$e);M(this,Zn);this.config=t,O(this,it,new Set),O(this,$e,new Map),O(this,Zn,0)}build(t,n,r){const o=new wp({mutationCache:this,mutationId:++dr(this,Zn)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){C(this,it).add(t);const n=mr(t);if(typeof n=="string"){const r=C(this,$e).get(n);r?r.push(t):C(this,$e).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,it).delete(t)){const n=mr(t);if(typeof n=="string"){const r=C(this,$e).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&C(this,$e).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=mr(t);if(typeof n=="string"){const r=C(this,$e).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=mr(t);if(typeof n=="string"){const o=(r=C(this,$e).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){he.batch(()=>{C(this,it).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,it).clear(),C(this,$e).clear()})}getAll(){return Array.from(C(this,it))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Xi(n,r))}findAll(t={}){return this.getAll().filter(n=>Xi(t,n))}notify(t){he.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return he.batch(()=>Promise.all(t.map(n=>n.continue().catch(xe))))}},it=new WeakMap,$e=new WeakMap,Zn=new WeakMap,sc);function mr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function ta(e){return{onFetch:(t,n)=>{var f,p,m,g,x;const r=t.options,o=(m=(p=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,s=((g=t.state.data)==null?void 0:g.pages)||[],i=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const v=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?h=!0:t.signal.addEventListener("abort",()=>{h=!0}),t.signal)})},y=Gc(t.options,t.fetchOptions),w=async(S,E,R)=>{if(h)return Promise.reject();if(E==null&&S.pages.length)return Promise.resolve(S);const P=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:E,direction:R?"backward":"forward",meta:t.options.meta};return v(B),B})(),D=await y(P),{maxPages:I}=t.options,L=R?dp:up;return{pages:L(S.pages,D,I),pageParams:L(S.pageParams,E,I)}};if(o&&s.length){const S=o==="backward",E=S?xp:na,R={pages:s,pageParams:i},T=E(r,R);a=await w(R,T,S)}else{const S=e??s.length;do{const E=c===0?i[0]??r.initialPageParam:na(r,a);if(c>0&&E==null)break;a=await w(a,E),c++}while(c<S)}return a};t.options.persister?t.fetchFn=()=>{var h,v;return(v=(h=t.options).persister)==null?void 0:v.call(h,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function na(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function xp(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var le,Et,_t,Cn,xn,Rt,Sn,En,ic,Sp=(ic=class{constructor(e={}){M(this,le);M(this,Et);M(this,_t);M(this,Cn);M(this,xn);M(this,Rt);M(this,Sn);M(this,En);O(this,le,e.queryCache||new bp),O(this,Et,e.mutationCache||new Cp),O(this,_t,e.defaultOptions||{}),O(this,Cn,new Map),O(this,xn,new Map),O(this,Rt,0)}mount(){dr(this,Rt)._++,C(this,Rt)===1&&(O(this,Sn,Vs.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,le).onFocus())})),O(this,En,zr.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,le).onOnline())})))}unmount(){var e,t;dr(this,Rt)._--,C(this,Rt)===0&&((e=C(this,Sn))==null||e.call(this),O(this,Sn,void 0),(t=C(this,En))==null||t.call(this),O(this,En,void 0))}isFetching(e){return C(this,le).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,Et).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,le).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=C(this,le).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Dt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return C(this,le).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=C(this,le).get(r.queryHash),s=o==null?void 0:o.state.data,i=cp(t,s);if(i!==void 0)return C(this,le).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return he.batch(()=>C(this,le).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,le).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=C(this,le);he.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=C(this,le);return he.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=he.batch(()=>C(this,le).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(xe).catch(xe)}invalidateQueries(e,t={}){return he.batch(()=>(C(this,le).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=he.batch(()=>C(this,le).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(xe)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(xe)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=C(this,le).build(this,t);return n.isStaleByTime(Dt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xe).catch(xe)}fetchInfiniteQuery(e){return e.behavior=ta(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xe).catch(xe)}ensureInfiniteQueryData(e){return e.behavior=ta(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return zr.isOnline()?C(this,Et).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,le)}getMutationCache(){return C(this,Et)}getDefaultOptions(){return C(this,_t)}setDefaultOptions(e){O(this,_t,e)}setQueryDefaults(e,t){C(this,Cn).set(en(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,Cn).values()],n={};return t.forEach(r=>{qn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){C(this,xn).set(en(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,xn).values()],n={};return t.forEach(r=>{qn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,_t).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Hs(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Vr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,_t).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,le).clear(),C(this,Et).clear()}},le=new WeakMap,Et=new WeakMap,_t=new WeakMap,Cn=new WeakMap,xn=new WeakMap,Rt=new WeakMap,Sn=new WeakMap,En=new WeakMap,ic),_e,G,Xn,Ce,Kt,_n,Tt,Pt,Jn,Rn,Tn,Qt,Yt,At,Pn,ne,Un,ls,us,ds,fs,hs,ps,ms,tl,ac,Ep=(ac=class extends In{constructor(t,n){super();M(this,ne);M(this,_e);M(this,G);M(this,Xn);M(this,Ce);M(this,Kt);M(this,_n);M(this,Tt);M(this,Pt);M(this,Jn);M(this,Rn);M(this,Tn);M(this,Qt);M(this,Yt);M(this,At);M(this,Pn,new Set);this.options=n,O(this,_e,t),O(this,Pt,null),O(this,Tt,cs()),this.options.experimental_prefetchInRender||C(this,Tt).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&&(C(this,G).addObserver(this),ra(C(this,G),this.options)?H(this,ne,Un).call(this):this.updateResult(),H(this,ne,fs).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return gs(C(this,G),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return gs(C(this,G),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,H(this,ne,hs).call(this),H(this,ne,ps).call(this),C(this,G).removeObserver(this)}setOptions(t){const n=this.options,r=C(this,G);if(this.options=C(this,_e).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fe(this.options.enabled,C(this,G))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");H(this,ne,ms).call(this),C(this,G).setOptions(this.options),n._defaulted&&!Hr(this.options,n)&&C(this,_e).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,G),observer:this});const o=this.hasListeners();o&&oa(C(this,G),r,this.options,n)&&H(this,ne,Un).call(this),this.updateResult(),o&&(C(this,G)!==r||Fe(this.options.enabled,C(this,G))!==Fe(n.enabled,C(this,G))||Dt(this.options.staleTime,C(this,G))!==Dt(n.staleTime,C(this,G)))&&H(this,ne,ls).call(this);const s=H(this,ne,us).call(this);o&&(C(this,G)!==r||Fe(this.options.enabled,C(this,G))!==Fe(n.enabled,C(this,G))||s!==C(this,At))&&H(this,ne,ds).call(this,s)}getOptimisticResult(t){const n=C(this,_e).getQueryCache().build(C(this,_e),t),r=this.createResult(n,t);return Rp(this,r)&&(O(this,Ce,r),O(this,_n,this.options),O(this,Kt,C(this,G).state)),r}getCurrentResult(){return C(this,Ce)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){C(this,Pn).add(t)}getCurrentQuery(){return C(this,G)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=C(this,_e).defaultQueryOptions(t),r=C(this,_e).getQueryCache().build(C(this,_e),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return H(this,ne,Un).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Ce)))}createResult(t,n){var I;const r=C(this,G),o=this.options,s=C(this,Ce),i=C(this,Kt),a=C(this,_n),u=t!==r?t.state:C(this,Xn),{state:f}=t;let p={...f},m=!1,g;if(n._optimisticResults){const L=this.hasListeners(),B=!L&&ra(t,n),U=L&&oa(t,r,n,o);(B||U)&&(p={...p,...Jc(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:h,status:v}=p;g=p.data;let y=!1;if(n.placeholderData!==void 0&&g===void 0&&v==="pending"){let L;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(L=s.data,y=!0):L=typeof n.placeholderData=="function"?n.placeholderData((I=C(this,Tn))==null?void 0:I.state.data,C(this,Tn)):n.placeholderData,L!==void 0&&(v="success",g=as(s==null?void 0:s.data,L,n),m=!0)}if(n.select&&g!==void 0&&!y)if(s&&g===(i==null?void 0:i.data)&&n.select===C(this,Jn))g=C(this,Rn);else try{O(this,Jn,n.select),g=n.select(g),g=as(s==null?void 0:s.data,g,n),O(this,Rn,g),O(this,Pt,null)}catch(L){O(this,Pt,L)}C(this,Pt)&&(x=C(this,Pt),g=C(this,Rn),h=Date.now(),v="error");const w=p.fetchStatus==="fetching",S=v==="pending",E=v==="error",R=S&&w,T=g!==void 0,D={status:v,fetchStatus:p.fetchStatus,isPending:S,isSuccess:v==="success",isError:E,isInitialLoading:R,isLoading:R,data:g,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:h,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>u.dataUpdateCount||p.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:E&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:E&&T,isStale:zs(t,n),refetch:this.refetch,promise:C(this,Tt)};if(this.options.experimental_prefetchInRender){const L=W=>{D.status==="error"?W.reject(D.error):D.data!==void 0&&W.resolve(D.data)},B=()=>{const W=O(this,Tt,D.promise=cs());L(W)},U=C(this,Tt);switch(U.status){case"pending":t.queryHash===r.queryHash&&L(U);break;case"fulfilled":(D.status==="error"||D.data!==U.value)&&B();break;case"rejected":(D.status!=="error"||D.error!==U.reason)&&B();break}}return D}updateResult(){const t=C(this,Ce),n=this.createResult(C(this,G),this.options);if(O(this,Kt,C(this,G).state),O(this,_n,this.options),C(this,Kt).data!==void 0&&O(this,Tn,C(this,G)),Hr(n,t))return;O(this,Ce,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!C(this,Pn).size)return!0;const i=new Set(s??C(this,Pn));return this.options.throwOnError&&i.add("error"),Object.keys(C(this,Ce)).some(a=>{const c=a;return C(this,Ce)[c]!==t[c]&&i.has(c)})};H(this,ne,tl).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&H(this,ne,fs).call(this)}},_e=new WeakMap,G=new WeakMap,Xn=new WeakMap,Ce=new WeakMap,Kt=new WeakMap,_n=new WeakMap,Tt=new WeakMap,Pt=new WeakMap,Jn=new WeakMap,Rn=new WeakMap,Tn=new WeakMap,Qt=new WeakMap,Yt=new WeakMap,At=new WeakMap,Pn=new WeakMap,ne=new WeakSet,Un=function(t){H(this,ne,ms).call(this);let n=C(this,G).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(xe)),n},ls=function(){H(this,ne,hs).call(this);const t=Dt(this.options.staleTime,C(this,G));if(Jt||C(this,Ce).isStale||!os(t))return;const r=qc(C(this,Ce).dataUpdatedAt,t)+1;O(this,Qt,setTimeout(()=>{C(this,Ce).isStale||this.updateResult()},r))},us=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,G)):this.options.refetchInterval)??!1},ds=function(t){H(this,ne,ps).call(this),O(this,At,t),!(Jt||Fe(this.options.enabled,C(this,G))===!1||!os(C(this,At))||C(this,At)===0)&&O(this,Yt,setInterval(()=>{(this.options.refetchIntervalInBackground||Vs.isFocused())&&H(this,ne,Un).call(this)},C(this,At)))},fs=function(){H(this,ne,ls).call(this),H(this,ne,ds).call(this,H(this,ne,us).call(this))},hs=function(){C(this,Qt)&&(clearTimeout(C(this,Qt)),O(this,Qt,void 0))},ps=function(){C(this,Yt)&&(clearInterval(C(this,Yt)),O(this,Yt,void 0))},ms=function(){const t=C(this,_e).getQueryCache().build(C(this,_e),this.options);if(t===C(this,G))return;const n=C(this,G);O(this,G,t),O(this,Xn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},tl=function(t){he.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(C(this,Ce))}),C(this,_e).getQueryCache().notify({query:C(this,G),type:"observerResultsUpdated"})})},ac);function _p(e,t){return Fe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ra(e,t){return _p(e,t)||e.state.data!==void 0&&gs(e,t,t.refetchOnMount)}function gs(e,t,n){if(Fe(t.enabled,e)!==!1&&Dt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zs(e,t)}return!1}function oa(e,t,n,r){return(e!==t||Fe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&zs(e,n)}function zs(e,t){return Fe(t.enabled,e)!==!1&&e.isStaleByTime(Dt(t.staleTime,e))}function Rp(e,t){return!Hr(e.getCurrentResult(),t)}var Ot,jt,Re,at,lt,Mr,vs,cc,Tp=(cc=class extends In{constructor(n,r){super();M(this,lt);M(this,Ot);M(this,jt);M(this,Re);M(this,at);O(this,Ot,n),this.setOptions(r),this.bindMethods(),H(this,lt,Mr).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=C(this,Ot).defaultMutationOptions(n),Hr(this.options,r)||C(this,Ot).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,Re),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&en(r.mutationKey)!==en(this.options.mutationKey)?this.reset():((o=C(this,Re))==null?void 0:o.state.status)==="pending"&&C(this,Re).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,Re))==null||n.removeObserver(this)}onMutationUpdate(n){H(this,lt,Mr).call(this),H(this,lt,vs).call(this,n)}getCurrentResult(){return C(this,jt)}reset(){var n;(n=C(this,Re))==null||n.removeObserver(this),O(this,Re,void 0),H(this,lt,Mr).call(this),H(this,lt,vs).call(this)}mutate(n,r){var o;return O(this,at,r),(o=C(this,Re))==null||o.removeObserver(this),O(this,Re,C(this,Ot).getMutationCache().build(C(this,Ot),this.options)),C(this,Re).addObserver(this),C(this,Re).execute(n)}},Ot=new WeakMap,jt=new WeakMap,Re=new WeakMap,at=new WeakMap,lt=new WeakSet,Mr=function(){var r;const n=((r=C(this,Re))==null?void 0:r.state)??el();O(this,jt,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},vs=function(n){he.batch(()=>{var r,o,s,i,a,c,u,f;if(C(this,at)&&this.hasListeners()){const p=C(this,jt).variables,m=C(this,jt).context;(n==null?void 0:n.type)==="success"?((o=(r=C(this,at)).onSuccess)==null||o.call(r,n.data,p,m),(i=(s=C(this,at)).onSettled)==null||i.call(s,n.data,null,p,m)):(n==null?void 0:n.type)==="error"&&((c=(a=C(this,at)).onError)==null||c.call(a,n.error,p,m),(f=(u=C(this,at)).onSettled)==null||f.call(u,void 0,n.error,p,m))}this.listeners.forEach(p=>{p(C(this,jt))})})},cc),nl=d.createContext(void 0),qs=e=>{const t=d.useContext(nl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Pp=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(nl.Provider,{value:e,children:t})),rl=d.createContext(!1),Ap=()=>d.useContext(rl);rl.Provider;function Op(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jp=d.createContext(Op()),Ip=()=>d.useContext(jp),Np=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Dp=e=>{d.useEffect(()=>{e.clearReset()},[e])},Lp=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Kc(n,[e.error,r])),Mp=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},kp=(e,t)=>e.isLoading&&e.isFetching&&!t,$p=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,sa=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Fp(e,t,n){var p,m,g,x,h;if(typeof e!="object"||Array.isArray(e))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Ap(),o=Ip(),s=qs(),i=s.defaultQueryOptions(e);(m=(p=s.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||m.call(p,i),i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`),i._optimisticResults=r?"isRestoring":"optimistic",Mp(i),Np(i,o),Dp(o);const a=!s.getQueryCache().get(i.queryHash),[c]=d.useState(()=>new t(s,i)),u=c.getOptimisticResult(i),f=!r&&e.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(v=>{const y=f?c.subscribe(he.batchCalls(v)):xe;return c.updateResult(),y},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),d.useEffect(()=>{c.setOptions(i)},[i,c]),$p(i,u))throw sa(i,c,o);if(Lp({result:u,errorResetBoundary:o,throwOnError:i.throwOnError,query:s.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((x=(g=s.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||x.call(g,i,u),i.experimental_prefetchInRender&&!Jt&&kp(u,r)){const v=a?sa(i,c,o):(h=s.getQueryCache().get(i.queryHash))==null?void 0:h.promise;v==null||v.catch(xe).finally(()=>{c.updateResult()})}return i.notifyOnChangeProps?u:c.trackResult(u)}function ia(e,t){return Fp(e,Ep)}function gr(e,t){const n=qs(),[r]=d.useState(()=>new Tp(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);const o=d.useSyncExternalStore(d.useCallback(i=>r.subscribe(he.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=d.useCallback((i,a)=>{r.mutate(i,a).catch(xe)},[r]);if(o.error&&Kc(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const vr={STALE_TIME:1e3*60*5,GC_TIME:1e3*60*10,RETRY_COUNT:1,RETRY_DELAY:1e3},aa={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:vr.STALE_TIME,gcTime:vr.GC_TIME,retry:vr.RETRY_COUNT,retryDelay:vr.RETRY_DELAY,enable:!0},yr=e=>e instanceof Error?e.message:String(e),ol=(e,t,n)=>{const r=qs(),{notify:o}=Ws(),{createFn:s,readFn:i,readByIdFn:a,updateFn:c,deleteFn:u,partialUpdateFn:f}=n,p=()=>{r.invalidateQueries({queryKey:[e]})},m=(E,R,T,P)=>o(P!=null&&P.overrideSuccessMessage?P==null?void 0:P.overrideSuccessMessage(E,R):T,"success"),g=(E,R,T,P)=>o(P!=null&&P.overrideErrorMessage?P==null?void 0:P.overrideErrorMessage(E,R):T,"error");return{useCreate:E=>gr({mutationFn:R=>s(R),onSuccess:R=>{p(),m(t,R,`${t} created successfully`,E)},onError:R=>{g(t,R,`Error creating ${t}: ${yr(R)}`,E)}}),useReadQuery:E=>ia({queryKey:[e],queryFn:i,...aa,...E}),useReadByIdQuery:(E,R)=>ia({queryKey:[e,E],queryFn:()=>a(E),...aa,enabled:!!E,...R}),useUpdate:E=>gr({mutationFn:({id:R,data:T})=>c(R,T),onSuccess:R=>{p(),m(t,R,`${t} updated successfully`,E)},onError:R=>{g(t,R,`Error updating ${t}: ${yr(R)}`,E)}}),usePartialUpdate:E=>f&&gr({mutationFn:({id:R,data:T})=>f(R,T),onSuccess:R=>{p(),m(t,R,`${t} updated successfully`,E)},onError:R=>{g(t,R,`Error updating ${t}: ${yr(R)}`,E)}}),useDelete:E=>gr({mutationFn:R=>u(R),onSuccess:()=>{p(),m(t,null,`${t} deleted successfully`,E)},onError:R=>{g(t,R,`Error deleting ${t}: ${yr(R)}`,E)}}),invalidateQueries:p}},Bp=(e,t)=>ol(e,t,{createFn:n=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(r=>r.json()),deleteFn:n=>fetch(`${e}/${n}`,{method:"DELETE"}).then(r=>{if(!r.ok)throw new Error(`Error deleting: ${r.status}`)}),readByIdFn:n=>fetch(`${e}/${n}`).then(r=>r.json()),readFn:()=>fetch(e).then(n=>n.json()),updateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json()),partialUpdateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json())}),Up={SINGLE_TENANT:"single-tenant"},Wp={COOKIE:"cookie"},Do="tenant",ca="tenant",la="tenant",Hp=Up.SINGLE_TENANT,Vp=Wp.COOKIE,zp={mode:Hp,clientSideMode:Vp,tenantIDPProvisioningStrategy:"none"};class qp{setTenant(t,n){const r=new URL(window.location.href);r.searchParams.set(ca,t.name),window.location.href=r.toString()}getCurrentTenantName(){const t=new URL(window.location.href);return new URLSearchParams(t.search).get(ca)}}class Gp{setTenant(t,n){sessionStorage.setItem(la,t.name),window.location.reload()}getCurrentTenantName(){return sessionStorage.getItem(la)}}/*! js-cookie v3.0.5 | MIT */function br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Kp={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ys(e,t){function n(o,s,i){if(!(typeof document>"u")){i=br({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,i[c]!==!0&&(a+="="+i[c].split(";")[0]));return document.cookie=o+"="+e.write(s,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],i={},a=0;a<s.length;a++){var c=s[a].split("="),u=c.slice(1).join("=");try{var f=decodeURIComponent(c[0]);if(i[f]=e.read(u,f),o===f)break}catch{}}return o?i[o]:i}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",br({},s,{expires:-1}))},withAttributes:function(o){return ys(this.converter,br({},this.attributes,o))},withConverter:function(o){return ys(br({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Lo=ys(Kp,{path:"/"});class Qp{setTenant(t,n){t?Lo.set(Do,t.name):Lo.remove(Do),window.location.reload()}getCurrentTenantName(){return Lo.get(Do)}}class Yp{extractSubdomain(t){if(t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t))return"";const n=t.split(".");if(n.length<2||n.length===2||n[0]==="www"&&n.length===3)return"";const o=(n[0]==="www"?n.slice(1):n).slice(0,-2);return o.length>0?o.join("."):""}getBaseDomain(t){const n=t.split(".");return t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t)||n.length<=2?t:n.slice(-2).join(".")}setTenant(t,n){var u;const r=(u=n.urlPatterns)==null?void 0:u.find(f=>f.patternType==="subdomain"&&f.tenantId===t.id&&f.isActive);if(!r)throw new Error(`No active subdomain pattern found for tenant '${t.name}'`);const o=new URL(window.location.href),s=r.patternValue,i=o.hostname,a=this.getBaseDomain(i),c=s?`${s}.${a}`:a;o.hostname=c,window.location.href=o.toString()}getCurrentTenantName(){const t=window.location.hostname;return this.extractSubdomain(t)||null}}const ua={queryParams:new qp,sessionStorage:new Gp,cookie:new Qp,subdomain:new Yp},Zp=e=>{const t=ua[e.clientSideMode];if(!t)throw new Error(`Client side tenant mode '${e.clientSideMode}' is not supported ${JSON.stringify({strategies:ua},null,2)}`);return t},Xp=(e,t,n)=>{const r=t.find(s=>s.name===n);if(!r)throw Error("No tenant permission");return Zp(e).setTenant(r,e),r},Jp=()=>{const[e,t]=er(),{tenants:n=[],currentTenant:r,tenantConfig:o=zp}=e,s=_.useCallback(i=>{const a=Xp(o,n,i);t({...e,currentTenant:a})},[o,e]);return{tenants:n,currentTenant:r,tenantConfig:o,selectTenant:s}};function e1(e){if(!e.ok)throw console.error(e),new Error(e.statusText)}async function wr(e,t,n,r){const o=await e(`/user-states/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,r);return e1(o),o}class Cr{static async get(t,n,r){const s=await wr(t,n,r,{method:"GET",headers:{"Content-Type":"application/json"}});return s.status===204?null:await s.json()}static async create(t,n,r,o){const s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await wr(t,n,r,s)).json()}static async update(t,n,r,o){const s={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await wr(t,n,r,s)).json()}static async delete(t,n,r){return await wr(t,n,r,{method:"DELETE",headers:{"Content-Type":"application/json"}}),null}}const t1=e=>{const t=Us("@bluealba/pae-nestjs-gateway-service"),n=Ac();if(!n)throw new Error("You must call the useUserState hook within a PAE application.");const[r,o]=_.useState(null),[s,i]=_.useState(!1),[a,c]=_.useState(!1),[u,f]=_.useState(null),p=(w,S)=>_.useCallback(async({newValue:E,shouldThrowError:R}={})=>{try{c(!0),f(null);const T=await w(t,n,e,E);return o(T),T?T.value:null}catch(T){if(f(T==null?void 0:T.message),console.error(`Failed to ${S} ${e}:`,T),R)throw T;return null}finally{c(!1)}},[t,n,e]),m=p(Cr.get,"fetch"),g=p(Cr.create,"create"),x=p(Cr.update,"update"),h=p(Cr.delete,"delete"),v=_.useCallback(async()=>{try{await m()}finally{i(!0)}},[m]);_.useEffect(()=>{v()},[v]);const y=_.useCallback(async(w,S=!1)=>r==null?await g({newValue:w,shouldThrowError:S}):await x({newValue:w,shouldThrowError:S}),[r,g,x]);return{value:r?r.value:null,hasFetched:s,loading:a,error:u,setValue:y,createValue:g,updateValue:x,deleteValue:h}},sl="__PAE_EXTENSION_POINT_REACT_CONTENT_EMPTY__",n1=({module:e,point:t,children:n})=>(Nc(e,t,n??sl),null),il=({name:e,children:t,...n})=>{const r=Ic(e);if(r===sl)return null;if(!r)return l.jsx(l.Fragment,{children:t??null});if(r1(r)){const o=r;return l.jsx(o,{...n})}else return r},r1=e=>typeof e=="function",o1=(e,t)=>{const n=r=>(t=t||e.displayName||e.name||"?",l.jsx(il,{name:t,...r,children:l.jsx(e,{...r})}));return n.displayName=`extensionPoint(${t})`,n},da="single-spa:app-change";function s1(){const[e,t]=_.useState(fa());return _.useEffect(()=>{const n=()=>{t(fa())};return window.addEventListener(da,n),()=>{window.removeEventListener(da,n)}},[]),e}function fa(){return jr.getAppNames().reduce((t,n)=>(jr.getAppStatus(n)?t[n]=jr.getAppStatus(n):t[n]="NOT_LOADED",t),{})}function i1(e){const n=s1()[e]??"LOAD_ERROR";return{statusName:n,isLoading:n==="LOADING_SOURCE_CODE"||n==="BOOTSTRAPPING"||n==="MOUNTING",isMounted:n==="MOUNTED",isBroken:n==="SKIP_BECAUSE_BROKEN"||n==="LOAD_ERROR"}}const al=({appName:e})=>l.jsx("div",{children:l.jsxs("p",{children:["Loading ",e,"..."]})});al.displayName="BaseLoading";const cl=({appName:e})=>l.jsxs("div",{children:[l.jsx("p",{children:"Something went wrong..."}),l.jsxs("p",{children:["Failed to load ",e]})]});cl.displayName="BaseError";const a1={display:"flex",flexDirection:"column",flex:1},ll=_.forwardRef((e,t)=>l.jsx("div",{ref:t,style:a1,...e}));ll.displayName="BaseContainer";const c1="pae-app:",ul=_.forwardRef(({appName:e,LoadingComponent:t=al,ErrorComponent:n=cl,ContainerComponent:r=ll,...o},s)=>{const i=i1(e);return l.jsxs(r,{ref:s,...o,id:`${c1}${e}`,children:[i.isLoading&&l.jsx(t,{appName:e}),i.isBroken&&l.jsx(n,{appName:e})]})});ul.displayName="ModulePlaceHolder";const Gs=({operations:e,children:t,forbiddenContent:n})=>{var o;const{hasAccess:r}=rr();if(!r(...e)){if(!n)return null;if(typeof n=="function")if((o=n==null?void 0:n.prototype)!=null&&o.isReactComponent){const s=n;return l.jsx(s,{operations:e})}else return n({operations:e});return _.isValidElement(n)?n:null}return t};Gs.displayName="Authorized";const l1=({eventName:e,listener:t})=>(Dc(e,t),null),u1=()=>l.jsx("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:l.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",d:"M8.737 8.737a21.49 21.49 0 0 1 3.308-2.724m0 0c3.063-2.026 5.99-2.641 7.331-1.3 1.827 1.828.026 6.591-4.023 10.64-4.049 4.049-8.812 5.85-10.64 4.023-1.33-1.33-.736-4.218 1.249-7.253m6.083-6.11c-3.063-2.026-5.99-2.641-7.331-1.3-1.827 1.828-.026 6.591 4.023 10.64m3.308-9.34a21.497 21.497 0 0 1 3.308 2.724m2.775 3.386c1.985 3.035 2.579 5.923 1.248 7.253-1.336 1.337-4.245.732-7.295-1.275M14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"})}),dl=({applicationName:e})=>{const t=Tc(e);if(t)if(typeof t=="function"){const n=t;return l.jsx(n,{})}else return t;return l.jsx(u1,{})};dl.displayName="ApplicationIcon";const fl=()=>l.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});fl.displayName="DarkModeIcon";const hl=()=>l.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:"matrix(-1,1.2246467991473532e-16,-1.2246467991473532e-16,-1,0,0)",children:l.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});hl.displayName="LightModeIcon";const d1="container__zBqbk",f1="expanded__EbsIr",h1="label__cdMnm",Mo={container:d1,expanded:f1,label:h1};function pl(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=pl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function N(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=pl(e))&&(r&&(r+=" "),r+=t);return r}const p1=e=>e.toLowerCase().trim().split(" ").join("-"),m1=e=>`${p1(e)}-theme`,ml=()=>{const{platformName:e="Platform"}=Ms(),t=m1(e),[n,r]=_.useState(()=>{const s=localStorage.getItem(t);return s==="light"||s==="dark"?s:"light"}),o=s=>{localStorage.setItem(t,s),r(s)};return _.useEffect(()=>{document.documentElement.setAttribute("data-theme",n)},[n]),{theme:n,setTheme:o}},g1="spinner__fakUN",v1="spinner-rotation__wUmPV",y1="button__8FA9H",b1="button--contained-primary__stkTx",w1="button--outlined-primary__KZ1ww",C1="button--text-primary__GLTfm",x1="button--contained-danger__L9ehT",S1="button--outlined-danger__eoYLd",E1="button--text-danger__Sw-ha",_1="icon__--umH",xr={spinner:g1,"spinner-rotation":"spinner-rotation__wUmPV",spinnerRotation:v1,button:y1,"button--contained-primary":"button--contained-primary__stkTx",buttonContainedPrimary:b1,"button--outlined-primary":"button--outlined-primary__KZ1ww",buttonOutlinedPrimary:w1,"button--text-primary":"button--text-primary__GLTfm",buttonTextPrimary:C1,"button--contained-danger":"button--contained-danger__L9ehT",buttonContainedDanger:x1,"button--outlined-danger":"button--outlined-danger__eoYLd",buttonOutlinedDanger:S1,"button--text-danger":"button--text-danger__Sw-ha",buttonTextDanger:E1,icon:_1},qr=_.forwardRef(({variant:e="contained",colorScheme:t="primary",loading:n=!1,IconComponent:r,className:o,children:s,...i},a)=>{const c=N(xr.button,xr[`button--${e}-${t}`],o);return l.jsxs("button",{ref:a,className:c,...i,children:[n?l.jsx("div",{className:xr.spinner}):r&&l.jsx(r,{className:xr.icon}),s]})});qr.displayName="Button";const R1="Badges__5jpum",T1="Badges__5jpum",P1="Badge__95MWM",A1="Badge__95MWM",O1="Badge--primary__Rx-bS",j1="Badge--secondary__d92bT",I1="Badge--success__Kdo98",N1="Badge--warning__bf-Nn",D1="Badge--danger__HTj39",L1="Badge--small__y93Pj",M1="Badge--regular__aT5AL",k1="Badge--large__wORCH",kr={Badges:R1,badges:T1,Badge:P1,badge:A1,"Badge--primary":"Badge--primary__Rx-bS",badgePrimary:O1,"Badge--secondary":"Badge--secondary__d92bT",badgeSecondary:j1,"Badge--success":"Badge--success__Kdo98",badgeSuccess:I1,"Badge--warning":"Badge--warning__bf-Nn",badgeWarning:N1,"Badge--danger":"Badge--danger__HTj39",badgeDanger:D1,"Badge--small":"Badge--small__y93Pj",badgeSmall:L1,"Badge--regular":"Badge--regular__aT5AL",badgeRegular:M1,"Badge--large":"Badge--large__wORCH",badgeLarge:k1},bs={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in bs)Object.freeze(bs[e]);const ha=Object.freeze(bs);var pa={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function $1(e){var f,p;var t,n=[],r=1,o;if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(e=String(e).toLowerCase(),ha[e])n=ha[e].slice(),o="rgb";else if(e==="transparent")r=0,o="rgb",n=[0,0,0];else if(e[0]==="#"){var s=e.slice(1),i=s.length,a=i<=4;r=1,a?(n=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],i===4&&(r=parseInt(s[3]+s[3],16)/255)):(n=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],i===8&&(r=parseInt(s[6]+s[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),o="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var c=t[1];o=c.replace(/a$/,"");var u=o==="cmyk"?4:o==="gray"?1:3;n=t[2].trim().split(/\s*[,\/]\s*|\s+/),o==="color"&&(o=n.shift()),n=n.map(function(m,g){if(m[m.length-1]==="%")return m=parseFloat(m)/100,g===3?m:o==="rgb"?m*255:o[0]==="h"||o[0]==="l"&&!g?m*100:o==="lab"?m*125:o==="lch"?g<2?m*150:m*360:o[0]==="o"&&!g?m:o==="oklab"?m*.4:o==="oklch"?g<2?m*.4:m*360:m;if(o[g]==="h"||g===2&&o[o.length-1]==="h"){if(pa[m]!==void 0)return pa[m];if(m.endsWith("deg"))return parseFloat(m);if(m.endsWith("turn"))return parseFloat(m)*360;if(m.endsWith("grad"))return parseFloat(m)*360/400;if(m.endsWith("rad"))return parseFloat(m)*180/Math.PI}return m==="none"?0:parseFloat(m)}),r=n.length>u?n.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(n=e.match(/([0-9]+)/g).map(function(m){return parseFloat(m)}),o=((p=(f=e.match(/([a-z])/ig))==null?void 0:f.join(""))==null?void 0:p.toLowerCase())||"rgb");return{space:o,values:n,alpha:r}}const F1=(e,t)=>{const{space:n,values:r}=$1(e);return n[0]==="h"?`${n}a(${r[0]}, ${r[1]}%, ${r[2]}%, ${t})`:`${n}a(${r}, ${t})`},Ks=_.forwardRef(({children:e,color:t,className:n,customColor:r,size:o="small",style:s,...i},a)=>{const c=r?{color:r,background:F1(r,.1)}:{},u=N(kr.Badge,kr[`Badge--${o}`],{[kr[`Badge--${t}`]]:!!t},n);return l.jsx("span",{ref:a,className:u,style:{...s,...c},...i,children:e})});Ks.displayName="Badge";const Qs=_.forwardRef(({children:e,className:t,...n},r)=>{const o=N(kr.Badges,t);return l.jsx("div",{ref:r,className:o,...n,children:e})});Qs.displayName="Badges";const gl=({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...s})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...s,children:[l.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),l.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"})]}),vl=({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...s})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...s,children:[l.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),l.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),l.jsx("path",{d:"m9 12 2 2 4-4"})]}),B1="CopyToClipboardButton__2Nd2m",U1={CopyToClipboardButton:B1},W1=({content:e})=>{const[t,n]=H1(),{notify:r}=Ws(),o=t?vl:gl,s=_.useCallback(async()=>{await n(e)&&r("Copied to the Clipboard !","success")},[e,r]);return l.jsx(o,{className:U1.CopyToClipboardButton,size:18,onClick:s})},H1=()=>{const[e,t]=_.useState(!1);return[e,async r=>{var o;try{return await((o=navigator==null?void 0:navigator.clipboard)==null?void 0:o.writeText(r)),t(!0),setTimeout(()=>t(!1),2e3),!0}catch(s){return console.error("Failed to copy text: ",s),!1}}]},V1="FieldGroup__Q2JCV",z1="FieldGroup__Q2JCV",q1="FieldGroup--horizontal__kpfL1",G1="FieldGroup--vertical__FLo-Q",ma={FieldGroup:V1,fieldGroup:z1,"FieldGroup--horizontal":"FieldGroup--horizontal__kpfL1",fieldGroupHorizontal:q1,"FieldGroup--vertical":"FieldGroup--vertical__FLo-Q",fieldGroupVertical:G1},yl=_.forwardRef(({children:e,className:t,orientation:n="vertical",...r},o)=>{const s=N(ma.FieldGroup,ma[`FieldGroup--${n}`],t);return l.jsx("div",{ref:o,className:s,...r,children:e})});yl.displayName="FieldGroup";const K1="Input__uS0sb",ga={Input:K1,Error:"Error__-DQpw"},co=_.forwardRef(({className:e,error:t,...n},r)=>{const o=N(ga.Input,t&&ga.Error,e);return l.jsx("input",{ref:r,className:o,...n})});co.displayName="Input";const Q1={Error:"Error__N4OP5"},bl=_.forwardRef(({children:e,className:t,...n},r)=>{const o=N(Q1.Error,t);return l.jsx("span",{ref:r,className:o,...n,children:e})});bl.displayName="InputError";const Y1="Label__VYUvW",va={Label:Y1,Error:"Error__Eu6DI"},wl=_.forwardRef(({children:e,className:t,error:n,...r},o)=>{const s=N(va.Label,n&&va.Error,t);return l.jsx("label",{ref:o,className:s,...r,children:e})});wl.displayName="Label";const Z1="Select__giqpe",X1="Chevron__YvhBd",ws={Select:Z1,Chevron:X1},Cl=_.forwardRef(({children:e,className:t,...n},r)=>{const o=N(ws.Option,t);return l.jsx("option",{ref:r,className:o,...n,children:e})});Cl.displayName="Option";const Ys=_.forwardRef(({children:e,className:t,...n},r)=>{const o=N(ws.Select,t);return l.jsxs("div",{className:o,children:[l.jsx("select",{ref:r,...n,children:e}),l.jsx("div",{className:ws.Chevron,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#818181",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})})})]})});Ys.displayName="Select";Ys.Option=Cl;function ya(e,[t,n]){return Math.min(n,Math.max(t,e))}function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function J1(e,t){const n=d.createContext(t),r=s=>{const{children:i,...a}=s,c=d.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function ir(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),c=n.length;n=[...n,i];const u=p=>{var y;const{scope:m,children:g,...x}=p,h=((y=m==null?void 0:m[e])==null?void 0:y[c])||a,v=d.useMemo(()=>x,Object.values(x));return l.jsx(h.Provider,{value:v,children:g})};u.displayName=s+"Provider";function f(p,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,x=d.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[u,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,em(o,...t)]}function em(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const p=c(s)[`__scope${u}`];return{...a,...p}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function ba(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ba(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ba(e[o],null)}}}}function ce(...e){return d.useCallback(Nn(...e),e)}function wa(e){const t=tm(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),c=a.find(rm);if(c){const u=c.props.children,f=a.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function tm(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=sm(o),a=om(s,o.props);return o.type!==d.Fragment&&(a.ref=r?Nn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nm=Symbol("radix.slottable");function rm(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nm}function om(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function sm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function im(e){const t=e+"CollectionProvider",[n,r]=ir(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:v,children:y}=h,w=_.useRef(null),S=_.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:S,collectionRef:w,children:y})};i.displayName=t;const a=e+"CollectionSlot",c=wa(a),u=_.forwardRef((h,v)=>{const{scope:y,children:w}=h,S=s(a,y),E=ce(v,S.collectionRef);return l.jsx(c,{ref:E,children:w})});u.displayName=a;const f=e+"CollectionItemSlot",p="data-radix-collection-item",m=wa(f),g=_.forwardRef((h,v)=>{const{scope:y,children:w,...S}=h,E=_.useRef(null),R=ce(v,E),T=s(f,y);return _.useEffect(()=>(T.itemMap.set(E,{ref:E,...S}),()=>void T.itemMap.delete(E))),l.jsx(m,{[p]:"",ref:R,children:w})});g.displayName=f;function x(h){const v=s(e+"CollectionConsumer",h);return _.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const S=Array.from(w.querySelectorAll(`[${p}]`));return Array.from(v.itemMap.values()).sort((T,P)=>S.indexOf(T.ref.current)-S.indexOf(P.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},x,r]}var am=d.createContext(void 0);function cm(e){const t=d.useContext(am);return e||t||"ltr"}function lm(e){const t=um(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),c=a.find(fm);if(c){const u=c.props.children,f=a.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function um(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=pm(o),a=hm(s,o.props);return o.type!==d.Fragment&&(a.ref=r?Nn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dm=Symbol("radix.slottable");function fm(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dm}function hm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function pm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=mm.reduce((e,t)=>{const n=lm(`Primitive.${t}`),r=d.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gm(e,t){e&&ro.flushSync(()=>e.dispatchEvent(t))}function tn(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function vm(e,t=globalThis==null?void 0:globalThis.document){const n=tn(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ym="DismissableLayer",Cs="dismissableLayer.update",bm="dismissableLayer.pointerDownOutside",wm="dismissableLayer.focusOutside",Ca,xl=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lo=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=d.useContext(xl),[f,p]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),x=ce(t,P=>p(P)),h=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=h.indexOf(v),w=f?h.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,E=w>=y,R=Sm(P=>{const D=P.target,I=[...u.branches].some(L=>L.contains(D));!E||I||(o==null||o(P),i==null||i(P),P.defaultPrevented||a==null||a())},m),T=Em(P=>{const D=P.target;[...u.branches].some(L=>L.contains(D))||(s==null||s(P),i==null||i(P),P.defaultPrevented||a==null||a())},m);return vm(P=>{w===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ca=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),xa(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ca)}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),xa())},[f,u]),d.useEffect(()=>{const P=()=>g({});return document.addEventListener(Cs,P),()=>document.removeEventListener(Cs,P)},[]),l.jsx(ie.div,{...c,ref:x,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,T.onFocusCapture),onBlurCapture:X(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,R.onPointerDownCapture)})});lo.displayName=ym;var Cm="DismissableLayerBranch",xm=d.forwardRef((e,t)=>{const n=d.useContext(xl),r=d.useRef(null),o=ce(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(ie.div,{...e,ref:o})});xm.displayName=Cm;function Sm(e,t=globalThis==null?void 0:globalThis.document){const n=tn(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Sl(bm,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Em(e,t=globalThis==null?void 0:globalThis.document){const n=tn(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Sl(wm,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function xa(){const e=new CustomEvent(Cs);document.dispatchEvent(e)}function Sl(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?gm(o,s):o.dispatchEvent(s)}var ko=0;function El(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sa()),document.body.insertAdjacentElement("beforeend",e[1]??Sa()),ko++,()=>{ko===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ko--}},[])}function Sa(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var $o="focusScope.autoFocusOnMount",Fo="focusScope.autoFocusOnUnmount",Ea={bubbles:!1,cancelable:!0},_m="FocusScope",Zs=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=d.useState(null),u=tn(o),f=tn(s),p=d.useRef(null),m=ce(t,h=>c(h)),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let h=function(S){if(g.paused||!a)return;const E=S.target;a.contains(E)?p.current=E:bt(p.current,{select:!0})},v=function(S){if(g.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||bt(p.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const R of S)R.removedNodes.length>0&&bt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",v);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,g.paused]),d.useEffect(()=>{if(a){Ra.add(g);const h=document.activeElement;if(!a.contains(h)){const y=new CustomEvent($o,Ea);a.addEventListener($o,u),a.dispatchEvent(y),y.defaultPrevented||(Rm(jm(_l(a)),{select:!0}),document.activeElement===h&&bt(a))}return()=>{a.removeEventListener($o,u),setTimeout(()=>{const y=new CustomEvent(Fo,Ea);a.addEventListener(Fo,f),a.dispatchEvent(y),y.defaultPrevented||bt(h??document.body,{select:!0}),a.removeEventListener(Fo,f),Ra.remove(g)},0)}}},[a,u,f,g]);const x=d.useCallback(h=>{if(!n&&!r||g.paused)return;const v=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,y=document.activeElement;if(v&&y){const w=h.currentTarget,[S,E]=Tm(w);S&&E?!h.shiftKey&&y===E?(h.preventDefault(),n&&bt(S,{select:!0})):h.shiftKey&&y===S&&(h.preventDefault(),n&&bt(E,{select:!0})):y===w&&h.preventDefault()}},[n,r,g.paused]);return l.jsx(ie.div,{tabIndex:-1,...i,ref:m,onKeyDown:x})});Zs.displayName=_m;function Rm(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bt(r,{select:t}),document.activeElement!==n)return}function Tm(e){const t=_l(e),n=_a(t,e),r=_a(t.reverse(),e);return[n,r]}function _l(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _a(e,t){for(const n of e)if(!Pm(n,{upTo:t}))return n}function Pm(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Am(e){return e instanceof HTMLInputElement&&"select"in e}function bt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Am(e)&&t&&e.select()}}var Ra=Om();function Om(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ta(e,t),e.unshift(t)},remove(t){var n;e=Ta(e,t),(n=e[0])==null||n.resume()}}}function Ta(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jm(e){return e.filter(t=>t.tagName!=="A")}var ve=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},Im=d[" useId ".trim().toString()]||(()=>{}),Nm=0;function Zt(e){const[t,n]=d.useState(Im());return ve(()=>{n(r=>r??String(Nm++))},[e]),e||(t?`radix-${t}`:"")}const Dm=["top","right","bottom","left"],Lt=Math.min,Te=Math.max,Gr=Math.round,Sr=Math.floor,Je=e=>({x:e,y:e}),Lm={left:"right",right:"left",bottom:"top",top:"bottom"},Mm={start:"end",end:"start"};function xs(e,t,n){return Te(e,Lt(t,n))}function dt(e,t){return typeof e=="function"?e(t):e}function ft(e){return e.split("-")[0]}function Dn(e){return e.split("-")[1]}function Xs(e){return e==="x"?"y":"x"}function Js(e){return e==="y"?"height":"width"}const km=new Set(["top","bottom"]);function Xe(e){return km.has(ft(e))?"y":"x"}function ei(e){return Xs(Xe(e))}function $m(e,t,n){n===void 0&&(n=!1);const r=Dn(e),o=ei(e),s=Js(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Kr(i)),[i,Kr(i)]}function Fm(e){const t=Kr(e);return[Ss(e),t,Ss(t)]}function Ss(e){return e.replace(/start|end/g,t=>Mm[t])}const Pa=["left","right"],Aa=["right","left"],Bm=["top","bottom"],Um=["bottom","top"];function Wm(e,t,n){switch(e){case"top":case"bottom":return n?t?Aa:Pa:t?Pa:Aa;case"left":case"right":return t?Bm:Um;default:return[]}}function Hm(e,t,n,r){const o=Dn(e);let s=Wm(ft(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ss)))),s}function Kr(e){return e.replace(/left|right|bottom|top/g,t=>Lm[t])}function Vm(e){return{top:0,right:0,bottom:0,left:0,...e}}function Rl(e){return typeof e!="number"?Vm(e):{top:e,right:e,bottom:e,left:e}}function Qr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Oa(e,t,n){let{reference:r,floating:o}=e;const s=Xe(t),i=ei(t),a=Js(i),c=ft(t),u=s==="y",f=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-o.width,y:p};break;default:g={x:r.x,y:r.y}}switch(Dn(t)){case"start":g[i]-=m*(n&&u?-1:1);break;case"end":g[i]+=m*(n&&u?-1:1);break}return g}async function zm(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=dt(t,e),x=Rl(g),v=a[m?p==="floating"?"reference":"floating":p],y=Qr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:c})),w=p==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},R=Qr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:S,strategy:c}):w);return{top:(y.top-R.top+x.top)/E.y,bottom:(R.bottom-y.bottom+x.bottom)/E.y,left:(y.left-R.left+x.left)/E.x,right:(R.right-y.right+x.right)/E.x}}const qm=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=Oa(u,r,c),m=r,g={},x=0;for(let v=0;v<a.length;v++){var h;const{name:y,fn:w}=a[v],{x:S,y:E,data:R,reset:T}=await w({x:f,y:p,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:u,platform:{...i,detectOverflow:(h=i.detectOverflow)!=null?h:zm},elements:{reference:e,floating:t}});f=S??f,p=E??p,g={...g,[y]:{...g[y],...R}},T&&x<=50&&(x++,typeof T=="object"&&(T.placement&&(m=T.placement),T.rects&&(u=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:f,y:p}=Oa(u,m,c)),v=-1)}return{x:f,y:p,placement:m,strategy:o,middlewareData:g}},Gm=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:f=0}=dt(e,t)||{};if(u==null)return{};const p=Rl(f),m={x:n,y:r},g=ei(o),x=Js(g),h=await i.getDimensions(u),v=g==="y",y=v?"top":"left",w=v?"bottom":"right",S=v?"clientHeight":"clientWidth",E=s.reference[x]+s.reference[g]-m[g]-s.floating[x],R=m[g]-s.reference[g],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let P=T?T[S]:0;(!P||!await(i.isElement==null?void 0:i.isElement(T)))&&(P=a.floating[S]||s.floating[x]);const D=E/2-R/2,I=P/2-h[x]/2-1,L=Lt(p[y],I),B=Lt(p[w],I),U=L,W=P-h[x]-B,V=P/2-h[x]/2+D,re=xs(U,V,W),z=!c.arrow&&Dn(o)!=null&&V!==re&&s.reference[x]/2-(V<U?L:B)-h[x]/2<0,Q=z?V<U?V-U:V-W:0;return{[g]:m[g]+Q,data:{[g]:re,centerOffset:V-re-Q,...z&&{alignmentOffset:Q}},reset:z}}}),Km=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:h=!0,...v}=dt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ft(o),w=Xe(a),S=ft(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(u.floating)),R=m||(S||!h?[Kr(a)]:Fm(a)),T=x!=="none";!m&&T&&R.push(...Hm(a,h,x,E));const P=[a,...R],D=await c.detectOverflow(t,v),I=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&I.push(D[y]),p){const V=$m(o,i,E);I.push(D[V[0]],D[V[1]])}if(L=[...L,{placement:o,overflows:I}],!I.every(V=>V<=0)){var B,U;const V=(((B=s.flip)==null?void 0:B.index)||0)+1,re=P[V];if(re&&(!(p==="alignment"?w!==Xe(re):!1)||L.every($=>Xe($.placement)===w?$.overflows[0]>0:!0)))return{data:{index:V,overflows:L},reset:{placement:re}};let z=(U=L.filter(Q=>Q.overflows[0]<=0).sort((Q,$)=>Q.overflows[1]-$.overflows[1])[0])==null?void 0:U.placement;if(!z)switch(g){case"bestFit":{var W;const Q=(W=L.filter($=>{if(T){const oe=Xe($.placement);return oe===w||oe==="y"}return!0}).map($=>[$.placement,$.overflows.filter(oe=>oe>0).reduce((oe,pe)=>oe+pe,0)]).sort(($,oe)=>$[1]-oe[1])[0])==null?void 0:W[0];Q&&(z=Q);break}case"initialPlacement":z=a;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function ja(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ia(e){return Dm.some(t=>e[t]>=0)}const Qm=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=dt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=ja(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ia(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=ja(i,n.floating);return{data:{escapedOffsets:a,escaped:Ia(a)}}}default:return{}}}}},Tl=new Set(["left","top"]);async function Ym(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ft(n),a=Dn(n),c=Xe(n)==="y",u=Tl.has(i)?-1:1,f=s&&c?-1:1,p=dt(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof x=="number"&&(g=a==="end"?x*-1:x),c?{x:g*f,y:m*u}:{x:m*u,y:g*f}}const Zm=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await Ym(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},Xm=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:w,y:S}=y;return{x:w,y:S}}},...u}=dt(e,t),f={x:n,y:r},p=await s.detectOverflow(t,u),m=Xe(ft(o)),g=Xs(m);let x=f[g],h=f[m];if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",S=x+p[y],E=x-p[w];x=xs(S,x,E)}if(a){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",S=h+p[y],E=h-p[w];h=xs(S,h,E)}const v=c.fn({...t,[g]:x,[m]:h});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[g]:i,[m]:a}}}}}},Jm=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=dt(e,t),f={x:n,y:r},p=Xe(o),m=Xs(p);let g=f[m],x=f[p];const h=dt(a,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const S=m==="y"?"height":"width",E=s.reference[m]-s.floating[S]+v.mainAxis,R=s.reference[m]+s.reference[S]-v.mainAxis;g<E?g=E:g>R&&(g=R)}if(u){var y,w;const S=m==="y"?"width":"height",E=Tl.has(ft(o)),R=s.reference[p]-s.floating[S]+(E&&((y=i.offset)==null?void 0:y[p])||0)+(E?0:v.crossAxis),T=s.reference[p]+s.reference[S]+(E?0:((w=i.offset)==null?void 0:w[p])||0)-(E?v.crossAxis:0);x<R?x=R:x>T&&(x=T)}return{[m]:g,[p]:x}}}},eg=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=dt(e,t),f=await i.detectOverflow(t,u),p=ft(o),m=Dn(o),g=Xe(o)==="y",{width:x,height:h}=s.floating;let v,y;p==="top"||p==="bottom"?(v=p,y=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=p,v=m==="end"?"top":"bottom");const w=h-f.top-f.bottom,S=x-f.left-f.right,E=Lt(h-f[v],w),R=Lt(x-f[y],S),T=!t.middlewareData.shift;let P=E,D=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=w),T&&!m){const L=Te(f.left,0),B=Te(f.right,0),U=Te(f.top,0),W=Te(f.bottom,0);g?D=x-2*(L!==0||B!==0?L+B:Te(f.left,f.right)):P=h-2*(U!==0||W!==0?U+W:Te(f.top,f.bottom))}await c({...t,availableWidth:D,availableHeight:P});const I=await i.getDimensions(a.floating);return x!==I.width||h!==I.height?{reset:{rects:!0}}:{}}}};function uo(){return typeof window<"u"}function Ln(e){return Pl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ae(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tt(e){var t;return(t=(Pl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Pl(e){return uo()?e instanceof Node||e instanceof Ae(e).Node:!1}function Ue(e){return uo()?e instanceof Element||e instanceof Ae(e).Element:!1}function et(e){return uo()?e instanceof HTMLElement||e instanceof Ae(e).HTMLElement:!1}function Na(e){return!uo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ae(e).ShadowRoot}const tg=new Set(["inline","contents"]);function ar(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=We(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!tg.has(o)}const ng=new Set(["table","td","th"]);function rg(e){return ng.has(Ln(e))}const og=[":popover-open",":modal"];function fo(e){return og.some(t=>{try{return e.matches(t)}catch{return!1}})}const sg=["transform","translate","scale","rotate","perspective"],ig=["transform","translate","scale","rotate","perspective","filter"],ag=["paint","layout","strict","content"];function ti(e){const t=ni(),n=Ue(e)?We(e):e;return sg.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||ig.some(r=>(n.willChange||"").includes(r))||ag.some(r=>(n.contain||"").includes(r))}function cg(e){let t=Mt(e);for(;et(t)&&!An(t);){if(ti(t))return t;if(fo(t))return null;t=Mt(t)}return null}function ni(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lg=new Set(["html","body","#document"]);function An(e){return lg.has(Ln(e))}function We(e){return Ae(e).getComputedStyle(e)}function ho(e){return Ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mt(e){if(Ln(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Na(e)&&e.host||tt(e);return Na(t)?t.host:t}function Al(e){const t=Mt(e);return An(t)?e.ownerDocument?e.ownerDocument.body:e.body:et(t)&&ar(t)?t:Al(t)}function Gn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Al(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ae(o);if(s){const a=Es(i);return t.concat(i,i.visualViewport||[],ar(o)?o:[],a&&n?Gn(a):[])}return t.concat(o,Gn(o,[],n))}function Es(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ol(e){const t=We(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=et(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Gr(n)!==s||Gr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function ri(e){return Ue(e)?e:e.contextElement}function pn(e){const t=ri(e);if(!et(t))return Je(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Ol(t);let i=(s?Gr(n.width):n.width)/r,a=(s?Gr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const ug=Je(0);function jl(e){const t=Ae(e);return!ni()||!t.visualViewport?ug:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ae(e)?!1:t}function nn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=ri(e);let i=Je(1);t&&(r?Ue(r)&&(i=pn(r)):i=pn(e));const a=dg(s,n,r)?jl(s):Je(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,f=o.width/i.x,p=o.height/i.y;if(s){const m=Ae(s),g=r&&Ue(r)?Ae(r):r;let x=m,h=Es(x);for(;h&&r&&g!==x;){const v=pn(h),y=h.getBoundingClientRect(),w=We(h),S=y.left+(h.clientLeft+parseFloat(w.paddingLeft))*v.x,E=y.top+(h.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,f*=v.x,p*=v.y,c+=S,u+=E,x=Ae(h),h=Es(x)}}return Qr({width:f,height:p,x:c,y:u})}function po(e,t){const n=ho(e).scrollLeft;return t?t.left+n:nn(tt(e)).left+n}function Il(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-po(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function fg(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=tt(r),a=t?fo(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Je(1);const f=Je(0),p=et(r);if((p||!p&&!s)&&((Ln(r)!=="body"||ar(i))&&(c=ho(r)),et(r))){const g=nn(r);u=pn(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=i&&!p&&!s?Il(i,c):Je(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x+m.x,y:n.y*u.y-c.scrollTop*u.y+f.y+m.y}}function hg(e){return Array.from(e.getClientRects())}function pg(e){const t=tt(e),n=ho(e),r=e.ownerDocument.body,o=Te(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Te(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+po(e);const a=-n.scrollTop;return We(r).direction==="rtl"&&(i+=Te(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Da=25;function mg(e,t){const n=Ae(e),r=tt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const f=ni();(!f||f&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=po(r);if(u<=0){const f=r.ownerDocument,p=f.body,m=getComputedStyle(p),g=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-g);x<=Da&&(s-=x)}else u<=Da&&(s+=u);return{width:s,height:i,x:a,y:c}}const gg=new Set(["absolute","fixed"]);function vg(e,t){const n=nn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=et(e)?pn(e):Je(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function La(e,t,n){let r;if(t==="viewport")r=mg(e,n);else if(t==="document")r=pg(tt(e));else if(Ue(t))r=vg(t,n);else{const o=jl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Qr(r)}function Nl(e,t){const n=Mt(e);return n===t||!Ue(n)||An(n)?!1:We(n).position==="fixed"||Nl(n,t)}function yg(e,t){const n=t.get(e);if(n)return n;let r=Gn(e,[],!1).filter(a=>Ue(a)&&Ln(a)!=="body"),o=null;const s=We(e).position==="fixed";let i=s?Mt(e):e;for(;Ue(i)&&!An(i);){const a=We(i),c=ti(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&gg.has(o.position)||ar(i)&&!c&&Nl(e,i))?r=r.filter(f=>f!==i):o=a,i=Mt(i)}return t.set(e,r),r}function bg(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?fo(t)?[]:yg(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((u,f)=>{const p=La(t,f,o);return u.top=Te(p.top,u.top),u.right=Lt(p.right,u.right),u.bottom=Lt(p.bottom,u.bottom),u.left=Te(p.left,u.left),u},La(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function wg(e){const{width:t,height:n}=Ol(e);return{width:t,height:n}}function Cg(e,t,n){const r=et(t),o=tt(t),s=n==="fixed",i=nn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Je(0);function u(){c.x=po(o)}if(r||!r&&!s)if((Ln(t)!=="body"||ar(o))&&(a=ho(t)),r){const g=nn(t,!0,s,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&u();s&&!r&&o&&u();const f=o&&!r&&!s?Il(o,a):Je(0),p=i.left+a.scrollLeft-c.x-f.x,m=i.top+a.scrollTop-c.y-f.y;return{x:p,y:m,width:i.width,height:i.height}}function Bo(e){return We(e).position==="static"}function Ma(e,t){if(!et(e)||We(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return tt(e)===n&&(n=n.ownerDocument.body),n}function Dl(e,t){const n=Ae(e);if(fo(e))return n;if(!et(e)){let o=Mt(e);for(;o&&!An(o);){if(Ue(o)&&!Bo(o))return o;o=Mt(o)}return n}let r=Ma(e,t);for(;r&&rg(r)&&Bo(r);)r=Ma(r,t);return r&&An(r)&&Bo(r)&&!ti(r)?n:r||cg(e)||n}const xg=async function(e){const t=this.getOffsetParent||Dl,n=this.getDimensions,r=await n(e.floating);return{reference:Cg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sg(e){return We(e).direction==="rtl"}const Eg={convertOffsetParentRelativeRectToViewportRelativeRect:fg,getDocumentElement:tt,getClippingRect:bg,getOffsetParent:Dl,getElementRects:xg,getClientRects:hg,getDimensions:wg,getScale:pn,isElement:Ue,isRTL:Sg};function Ll(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _g(e,t){let n=null,r;const o=tt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:f,top:p,width:m,height:g}=u;if(a||t(),!m||!g)return;const x=Sr(p),h=Sr(o.clientWidth-(f+m)),v=Sr(o.clientHeight-(p+g)),y=Sr(f),S={rootMargin:-x+"px "+-h+"px "+-v+"px "+-y+"px",threshold:Te(0,Lt(1,c))||1};let E=!0;function R(T){const P=T[0].intersectionRatio;if(P!==c){if(!E)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}P===1&&!Ll(u,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(R,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,S)}n.observe(e)}return i(!0),s}function Rg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=ri(e),f=o||s?[...u?Gn(u):[],...Gn(t)]:[];f.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const p=u&&a?_g(u,n):null;let m=-1,g=null;i&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let x,h=c?nn(e):null;c&&v();function v(){const y=nn(e);h&&!Ll(h,y)&&n(),h=y,x=requestAnimationFrame(v)}return n(),()=>{var y;f.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),p==null||p(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(x)}}const Tg=Zm,Pg=Xm,Ag=Km,Og=eg,jg=Qm,ka=Gm,Ig=Jm,Ng=(e,t,n)=>{const r=new Map,o={platform:Eg,...n},s={...o.platform,_c:r};return qm(e,t,{...o,platform:s})};var Dg=typeof document<"u",Lg=function(){},$r=Dg?_.useLayoutEffect:Lg;function Yr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Yr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Yr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ml(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $a(e,t){const n=Ml(e);return Math.round(t*n)/n}function Uo(e){const t=d.useRef(e);return $r(()=>{t.current=e}),t}function Mg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[f,p]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=d.useState(r);Yr(m,r)||g(r);const[x,h]=d.useState(null),[v,y]=d.useState(null),w=d.useCallback($=>{$!==T.current&&(T.current=$,h($))},[]),S=d.useCallback($=>{$!==P.current&&(P.current=$,y($))},[]),E=s||x,R=i||v,T=d.useRef(null),P=d.useRef(null),D=d.useRef(f),I=c!=null,L=Uo(c),B=Uo(o),U=Uo(u),W=d.useCallback(()=>{if(!T.current||!P.current)return;const $={placement:t,strategy:n,middleware:m};B.current&&($.platform=B.current),Ng(T.current,P.current,$).then(oe=>{const pe={...oe,isPositioned:U.current!==!1};V.current&&!Yr(D.current,pe)&&(D.current=pe,ro.flushSync(()=>{p(pe)}))})},[m,t,n,B,U]);$r(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[u]);const V=d.useRef(!1);$r(()=>(V.current=!0,()=>{V.current=!1}),[]),$r(()=>{if(E&&(T.current=E),R&&(P.current=R),E&&R){if(L.current)return L.current(E,R,W);W()}},[E,R,W,L,I]);const re=d.useMemo(()=>({reference:T,floating:P,setReference:w,setFloating:S}),[w,S]),z=d.useMemo(()=>({reference:E,floating:R}),[E,R]),Q=d.useMemo(()=>{const $={position:n,left:0,top:0};if(!z.floating)return $;const oe=$a(z.floating,f.x),pe=$a(z.floating,f.y);return a?{...$,transform:"translate("+oe+"px, "+pe+"px)",...Ml(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:pe}},[n,a,z.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:W,refs:re,elements:z,floatingStyles:Q}),[f,W,re,z,Q])}const kg=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ka({element:r.current,padding:o}).fn(n):{}:r?ka({element:r,padding:o}).fn(n):{}}}},$g=(e,t)=>({...Tg(e),options:[e,t]}),Fg=(e,t)=>({...Pg(e),options:[e,t]}),Bg=(e,t)=>({...Ig(e),options:[e,t]}),Ug=(e,t)=>({...Ag(e),options:[e,t]}),Wg=(e,t)=>({...Og(e),options:[e,t]}),Hg=(e,t)=>({...jg(e),options:[e,t]}),Vg=(e,t)=>({...kg(e),options:[e,t]});var zg="Arrow",kl=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(ie.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});kl.displayName=zg;var qg=kl;function Gg(e){const[t,n]=d.useState(void 0);return ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var oi="Popper",[$l,mo]=ir(oi),[Kg,Fl]=$l(oi),Bl=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(Kg,{scope:t,anchor:r,onAnchorChange:o,children:n})};Bl.displayName=oi;var Ul="PopperAnchor",Wl=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Fl(Ul,n),i=d.useRef(null),a=ce(t,i),c=d.useRef(null);return d.useEffect(()=>{const u=c.current;c.current=(r==null?void 0:r.current)||i.current,u!==c.current&&s.onAnchorChange(c.current)}),r?null:l.jsx(ie.div,{...o,ref:a})});Wl.displayName=Ul;var si="PopperContent",[Qg,Yg]=$l(si),Hl=d.forwardRef((e,t)=>{var k,J,de,Y,ee,Z;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:x,...h}=e,v=Fl(si,n),[y,w]=d.useState(null),S=ce(t,ye=>w(ye)),[E,R]=d.useState(null),T=Gg(E),P=(T==null?void 0:T.width)??0,D=(T==null?void 0:T.height)??0,I=r+(s!=="center"?"-"+s:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(u)?u:[u],U=B.length>0,W={padding:L,boundary:B.filter(Xg),altBoundary:U},{refs:V,floatingStyles:re,placement:z,isPositioned:Q,middlewareData:$}=Mg({strategy:"fixed",placement:I,whileElementsMounted:(...ye)=>Rg(...ye,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[$g({mainAxis:o+D,alignmentAxis:i}),c&&Fg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Bg():void 0,...W}),c&&Ug({...W}),Wg({...W,apply:({elements:ye,rects:je,availableWidth:ze,availableHeight:Le})=>{const{width:vt,height:ur}=je.reference,rt=ye.floating.style;rt.setProperty("--radix-popper-available-width",`${ze}px`),rt.setProperty("--radix-popper-available-height",`${Le}px`),rt.setProperty("--radix-popper-anchor-width",`${vt}px`),rt.setProperty("--radix-popper-anchor-height",`${ur}px`)}}),E&&Vg({element:E,padding:a}),Jg({arrowWidth:P,arrowHeight:D}),m&&Hg({strategy:"referenceHidden",...W})]}),[oe,pe]=ql(z),Oe=tn(x);ve(()=>{Q&&(Oe==null||Oe())},[Q,Oe]);const pt=(k=$.arrow)==null?void 0:k.x,mt=(J=$.arrow)==null?void 0:J.y,Ve=((de=$.arrow)==null?void 0:de.centerOffset)!==0,[gt,De]=d.useState();return ve(()=>{y&&De(window.getComputedStyle(y).zIndex)},[y]),l.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...re,transform:Q?re.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:gt,"--radix-popper-transform-origin":[(Y=$.transformOrigin)==null?void 0:Y.x,(ee=$.transformOrigin)==null?void 0:ee.y].join(" "),...((Z=$.hide)==null?void 0:Z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Qg,{scope:n,placedSide:oe,onArrowChange:R,arrowX:pt,arrowY:mt,shouldHideArrow:Ve,children:l.jsx(ie.div,{"data-side":oe,"data-align":pe,...h,ref:S,style:{...h.style,animation:Q?void 0:"none"}})})})});Hl.displayName=si;var Vl="PopperArrow",Zg={top:"bottom",right:"left",bottom:"top",left:"right"},zl=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Yg(Vl,r),i=Zg[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(qg,{...o,ref:n,style:{...o.style,display:"block"}})})});zl.displayName=Vl;function Xg(e){return e!==null}var Jg=e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,f]=ql(n),p={start:"0%",center:"50%",end:"100%"}[f],m=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,g=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let x="",h="";return u==="bottom"?(x=i?p:`${m}px`,h=`${-c}px`):u==="top"?(x=i?p:`${m}px`,h=`${r.floating.height+c}px`):u==="right"?(x=`${-c}px`,h=i?p:`${g}px`):u==="left"&&(x=`${r.floating.width+c}px`,h=i?p:`${g}px`),{data:{x,y:h}}}});function ql(e){const[t,n="center"]=e.split("-");return[t,n]}var Gl=Bl,Kl=Wl,Ql=Hl,Yl=zl,ev="Portal",ii=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);ve(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?lc.createPortal(l.jsx(ie.div,{...r,ref:t}),i):null});ii.displayName=ev;function tv(e){const t=nv(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),c=a.find(ov);if(c){const u=c.props.children,f=a.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function nv(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=iv(o),a=sv(s,o.props);return o.type!==d.Fragment&&(a.ref=r?Nn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rv=Symbol("radix.slottable");function ov(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rv}function sv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function iv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var av=d[" useInsertionEffect ".trim().toString()]||ve;function Zr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=cv({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const f=d.useRef(e!==void 0);d.useEffect(()=>{const p=f.current;p!==a&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=d.useCallback(f=>{var p;if(a){const m=lv(f)?f(e):f;m!==e&&((p=i.current)==null||p.call(i,m))}else s(f)},[a,e,s,i]);return[c,u]}function cv({defaultProp:e,onChange:t}){const[n,r]=d.useState(e),o=d.useRef(n),s=d.useRef(t);return av(()=>{s.current=t},[t]),d.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function lv(e){return typeof e=="function"}function uv(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Zl=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dv="VisuallyHidden",Xl=d.forwardRef((e,t)=>l.jsx(ie.span,{...e,ref:t,style:{...Zl,...e.style}}));Xl.displayName=dv;var fv=Xl,hv=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},dn=new WeakMap,Er=new WeakMap,_r={},Wo=0,Jl=function(e){return e&&(e.host||Jl(e.parentNode))},pv=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Jl(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},mv=function(e,t,n,r){var o=pv(t,Array.isArray(e)?e:[e]);_r[n]||(_r[n]=new WeakMap);var s=_r[n],i=[],a=new Set,c=new Set(o),u=function(p){!p||a.has(p)||(a.add(p),u(p.parentNode))};o.forEach(u);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(a.has(m))f(m);else try{var g=m.getAttribute(r),x=g!==null&&g!=="false",h=(dn.get(m)||0)+1,v=(s.get(m)||0)+1;dn.set(m,h),s.set(m,v),i.push(m),h===1&&x&&Er.set(m,!0),v===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return f(t),a.clear(),Wo++,function(){i.forEach(function(p){var m=dn.get(p)-1,g=s.get(p)-1;dn.set(p,m),s.set(p,g),m||(Er.has(p)||p.removeAttribute(r),Er.delete(p)),g||p.removeAttribute(n)}),Wo--,Wo||(dn=new WeakMap,dn=new WeakMap,Er=new WeakMap,_r={})}},eu=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=hv(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),mv(r,o,n,"aria-hidden")):function(){return null}},Fr="right-scroll-bar-position",Br="width-before-scroll-bar",gv="with-scroll-bars-hidden",vv="--removed-body-scroll-bar-size";function Ho(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function yv(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var bv=typeof window<"u"?d.useLayoutEffect:d.useEffect,Fa=new WeakMap;function wv(e,t){var n=yv(null,function(r){return e.forEach(function(o){return Ho(o,r)})});return bv(function(){var r=Fa.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Ho(a,null)}),s.forEach(function(a){o.has(a)||Ho(a,i)})}Fa.set(n,e)},[e]),n}function Cv(e){return e}function xv(e,t){t===void 0&&(t=Cv);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var f=i;i=[],f.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(f){i.push(f),u()},filter:function(f){return i=i.filter(f),n}}}};return o}function Sv(e){e===void 0&&(e={});var t=xv(null);return t.options=Ye({async:!0,ssr:!1},e),t}var tu=function(e){var t=e.sideCar,n=kc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Ye({},n))};tu.isSideCarExport=!0;function Ev(e,t){return e.useMedium(t),tu}var nu=Sv(),Vo=function(){},go=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:Vo,onWheelCapture:Vo,onTouchMoveCapture:Vo}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,f=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,x=e.noIsolation,h=e.inert,v=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,S=e.gapMode,E=kc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,T=wv([n,t]),P=Ye(Ye({},E),o);return d.createElement(d.Fragment,null,f&&d.createElement(R,{sideCar:nu,removeScrollBar:u,shards:p,noRelative:g,noIsolation:x,inert:h,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:S}),i?d.cloneElement(d.Children.only(a),Ye(Ye({},P),{ref:T})):d.createElement(w,Ye({},P,{className:c,ref:T}),a))});go.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};go.classNames={fullWidth:Br,zeroRight:Fr};var _v=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rv(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_v();return t&&e.setAttribute("nonce",t),e}function Tv(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Pv(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Av=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rv())&&(Tv(t,n),Pv(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ov=function(){var e=Av();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ru=function(){var e=Ov(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},jv={left:0,top:0,right:0,gap:0},zo=function(e){return parseInt(e||"",10)||0},Iv=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[zo(n),zo(r),zo(o)]},Nv=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jv;var t=Iv(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Dv=ru(),mn="data-scroll-locked",Lv=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
209
209
|
.`.concat(gv,` {
|
|
210
210
|
overflow: hidden `).concat(r,`;
|
|
211
211
|
padding-right: `).concat(a,"px ").concat(r,`;
|