@deepagents/devtool 7.44.0 → 7.45.0
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/ui/assets/chat-D7Ok6eXq.js +352 -0
- package/dist/ui/assets/index-Dt0nCqi6.css +2 -0
- package/dist/ui/assets/index-TNzRpwiE.js +12 -0
- package/dist/ui/assets/runtime-data-D25NI3GU.js +56 -0
- package/dist/ui/index.html +3 -3
- package/package.json +8 -8
- package/dist/ui/assets/chat-CRniBiKK.js +0 -352
- package/dist/ui/assets/index-CfNGpC1x.css +0 -2
- package/dist/ui/assets/index-DDKoMA1M.js +0 -12
- package/dist/ui/assets/runtime-data-Cj2bjaL7.js +0 -56
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import{a as e,d as t,i as n,n as r,o as i,r as a}from"./preload-helper-DtyrgAzE.js";var o=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(){}},s=new class extends o{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},c={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=c;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function u(e){setTimeout(e,0)}var d=typeof window>`u`||`Deno`in globalThis;function f(){}function p(e,t){return typeof e==`function`?e(t):e}function m(e){return typeof e==`number`&&e>=0&&e!==1/0}function h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){return typeof e==`function`?e(t):e}function v(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==b(o,t.options))return!1}else if(!S(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function y(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(x(t.options.mutationKey)!==x(a))return!1}else if(!S(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function b(e,t){return(t?.queryKeyHashFn||x)(e)}function x(e){return JSON.stringify(e,(e,t)=>D(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function S(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>S(e[n],t[n])):!1}var C=Object.prototype.hasOwnProperty;function w(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=E(e)&&E(t);if(!r&&!(D(e)&&D(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:C.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=w(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function T(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function E(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function D(e){if(!O(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!O(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function O(e){return Object.prototype.toString.call(e)===`[object Object]`}function k(e){return new Promise(t=>{l.setTimeout(t,e)})}function A(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:w(e,t)}function j(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function M(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var N=Symbol();function P(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===N?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function F(e,t){return typeof e==`function`?e(...t):!!e}function I(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ee=(()=>{let e=()=>d;return{isServer(){return e()},setIsServer(t){e=t}}})();function L(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var R=u;function te(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=R,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ne=te(),z=new class extends o{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function re(e){return Math.min(1e3*2**e,3e4)}function B(e){return(e??`online`)!==`online`||z.isOnline()}var V=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ie(e){let t=!1,n=0,r,i=L(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new V(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>s.isFocused()&&(e.networkMode===`always`||z.isOnline())&&e.canRun(),d=()=>B(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(ee.isServer()?0:3),o=e.retryDelay??re,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),k(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var ae=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#e=l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ee.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(l.clearTimeout(this.#e),this.#e=void 0)}};function H(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{I(e,()=>t.signal,()=>n=!0)},u=P(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?M:j;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?oe:U,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:U(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function U(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function oe(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var se=class extends ae{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ue(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ue(this.options);e.data!==void 0&&(this.setState(le(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=A(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(f).catch(f):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>_(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===N||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>g(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!h(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=P(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?H(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=ie({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof V&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof V){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ce(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...le(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ne.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ce(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:B(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function le(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ue(e){let 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 de=class extends ae{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||fe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ie({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ne.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function fe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var pe=class extends o{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new de({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=me(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=me(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=me(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=me(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ne.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>y(t,e))}findAll(e={}){return this.getAll().filter(t=>y(e,t))}notify(e){ne.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ne.batch(()=>Promise.all(e.map(e=>e.continue().catch(f))))}};function me(e){return e.options.scope?.id}var he=class extends o{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??b(r,t),a=this.get(i);return a||(a=new se({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ne.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>v(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>v(e,t)):t}notify(e){ne.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ne.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ne.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ge=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new he,this.#t=e.mutationCache||new pe,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=s.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=z.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(g(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=p(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ne.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ne.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ne.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=ne.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(f).catch(f)}invalidateQueries(e,t={}){return ne.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ne.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(f)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(f)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(g(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(f).catch(f)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(f).catch(f)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return z.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(x(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{S(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(x(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{S(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=b(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===N&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},_e=i((t=>{var n=e().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;t.c=function(e){return n.H.useMemoCache(e)}})),ve=i(((e,t)=>{t.exports=_e()})),ye=ve(),W=t(e(),1),G=n(),be=(0,W.createContext)(null);function xe(e){let t=(0,ye.c)(3),{clock:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,G.jsx)(be,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Se(){let e=(0,W.use)(be);if(e===null)throw Error(`No clock set, use ClockProvider to set one`);return e}var Ce=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase();function we(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ce(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Te=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},Ee=e=>{let t=Te(e);return t.charAt(0).toUpperCase()+t.slice(1)},De=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)},Oe={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function ke(e){return e!=null}function Ae(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Oe.width,a=e.size??e.height??Oe.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?De(...c):De(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Oe[`stroke-width`])*Number(e.size??e.width??Oe.width)/Number(t.size??t.width??Oe.width):t.strokeWidth??Oe[`stroke-width`];return[`svg`,{...Object.entries(Oe).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&ke(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&ke(t.width)&&{[r(`width`)]:t.width},...`height`in t&&ke(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function je(e,t={}){return Ae(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Me=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1},Ne=(0,W.createContext)({}),Pe=()=>(0,W.useContext)(Ne),Fe=(0,W.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Pe()??{},y=!!c||Me(d),[b,x,S=[]]=je(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:De(v,s),hasA11yProp:y,attributes:d});return(0,W.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,W.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Ie(e,t=[],n=[]){let r=typeof e==`string`?we(e,t,n):e,i=(0,W.forwardRef)(({className:e,...t},n)=>(0,W.createElement)(Fe,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Ee(r.name)),i}var Le={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};Le.node;var Re=Ie(Le),ze={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};ze.node;var Be=Ie(ze),Ve={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Ve.node;var He=Ie(Ve),Ue={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Ue.node;var We=Ie(Ue),Ge={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Ge.node;var Ke=Ie(Ge),qe={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};qe.node;var Je=Ie(qe),Ye={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]};Ye.node;var Xe=Ie(Ye),Ze={name:`circle-pause`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]],aliases:[`pause-circle`]};Ze.node;var Qe=Ie(Ze),$e={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};$e.node;var et=Ie($e),tt={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};tt.node;var nt=Ie(tt),rt={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};rt.node;var it=Ie(rt),at={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};at.node;var ot=Ie(at),st={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};st.node;var ct=Ie(st),lt={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};lt.node;var ut=Ie(lt);function dt({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=W.useRef(e!==void 0),[a,o]=W.useState(()=>t);return[i&&e!==void 0?e:a,W.useCallback(e=>{i||o(e)},[])]}var ft={...W},pt={};function mt(e,t){let n=W.useRef(pt);return n.current===pt&&(n.current=e(t)),n}var ht=ft.useInsertionEffect,gt=ht&&ht!==ft.useLayoutEffect?ht:e=>e();function K(e){let t=mt(_t).current;return t.next=e,gt(t.effect),t.trampoline}function _t(){let e={next:void 0,callback:vt,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function vt(){}function yt(){}var bt=Object.freeze([]),xt=Object.freeze({}),q=typeof document<`u`?W.useLayoutEffect:()=>{},St=W.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Ct(){return W.useContext(St)}function wt(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=K(i),[,o]=W.useState(0),s=mt(Et).current,c=mt(Tt).current,l=W.useRef(0),u=W.useRef(!0),d=W.useRef(null),f=W.useRef(null),p=K(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=K((e,t)=>{c.set(e,t),p()}),h=K(e=>{c.delete(e),p()}),g=K(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!kt(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&At(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Ot(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=K(()=>{let[e,t]=Dt(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),q(()=>{u.current&&v()}),q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=K(e=>(s.add(e),()=>{s.delete(e)})),b=W.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,G.jsx)(St.Provider,{value:b,children:t})}function Tt(){return new Map}function Et(){return new Set}function Dt(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>At(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Ot(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function kt(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function At(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function jt(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Mt=jt(`https://base-ui.com/production-error`,`Base UI`);function Nt(e,t,n,r){let i=mt(Ft).current;return It(i,e,t,n,r)&&Rt(i,[e,t,n,r]),i.callback}function Pt(e){let t=mt(Ft).current;return Lt(t,e)&&Rt(t,e),t.callback}function Ft(){return{callback:null,cleanup:null,refs:[]}}function It(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Lt(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Rt(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var zt=19;function Bt(e){return zt>=e}function Vt(e){if(!W.isValidElement(e))return null;let t=e,n=t.props;return(Bt(19)?n?.ref:t.ref)??null}function Ht(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Ut(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Wt(e,t){return typeof e==`function`?e(t):e}function Gt(e,t){return typeof e==`function`?e(t):e}var Kt={};function qt(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Yt(t);let a=Yt(e);return t&&(a=Xt(a,t)),n&&(a=Xt(a,n)),r&&(a=Xt(a,r)),i&&(a=Xt(a,i)),a}function Jt(e){if(e.length===0)return Kt;if(e.length===1)return Yt(e[0]);let t=Yt(e[0]);for(let n=1;n<e.length;n+=1)t=Xt(t,e[n]);return t}function Yt(e){return en(e)?{...e(Kt)}:Zt(e)}function Xt(e,t){return en(t)?t(e):Qt(e,t)}function Zt(e){let t={...e};for(let e in t){let n=t[e];$t(e,n)&&(t[e]=nn(n))}return t}function Qt(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Ht(e.style,r);break;case`className`:e[n]=an(e.className,r);break;default:$t(n,r)?e[n]=tn(e[n],r):e[n]=r}}return e}function $t(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function en(e){return typeof e==`function`}function tn(e,t){return t?e?(...n)=>{let r=n[0];if(on(r)){let i=r;rn(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:nn(t):e}function nn(e){return e&&((...t)=>{let n=t[0];return on(n)&&rn(n),e(...t)})}function rn(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function an(e,t){return t?e?t+` `+e:t:e}function on(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function sn(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=dn(r));let i=cn(t,n,r);if(n.enabled===!1)return null;let a=n.state??xt;return fn(e,r,i,a)}function cn(e,t,n){let{className:r,style:i}=e,{state:a=xt,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Wt(r,a):void 0,d=l?Gt(i,a):void 0,f=l?Ut(a,c):xt,p=l&&s?ln(s):void 0,m=l?Ht(f,p)??{}:xt;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=Pt([m.ref,Vt(n),...o]):m.ref=Nt(m.ref,Vt(n),o):Nt(null,null)),l?(u!==void 0&&(m.className=an(m.className,u)),d!==void 0&&(m.style=Ht(m.style,d)),m):xt}function ln(e){return Array.isArray(e)?Jt(e):qt(void 0,e)}var un=Symbol.for(`react.lazy`);function dn(e){if(e?.$$typeof!==un)return e;let t=W.Children.toArray(e)[0];return W.isValidElement(t)?t:e}function fn(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=qt(n,t.props);return e.ref=n.ref,W.cloneElement(t,e)}return pn(e,n)}function pn(e,t){return e===`button`?(0,W.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,W.createElement)(`img`,{alt:``,...t,key:t.key}):W.createElement(e,t)}function mn(){let[,e]=W.useState({});return W.useCallback(()=>{e({})},[])}var hn=0;function gn(e,t=`mui`){let n=W.useRef(void 0),r=mn(),i=e??n.current;return W.useEffect(()=>{n.current??(hn+=1,n.current=`${t}-${hn}`,e??r())},[e,t,r]),i}var _n=ft.useId;function vn(e,t){if(_n!==void 0){let n=_n();return e??(t?`${t}-${n}`:n)}return gn(e,t)}function yn(e){return vn(e,`base-ui`)}function bn(e,t,n,r){let i=!1,a=!1,o=r??xt;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function xn(e,t,n){let r=n??xt;return{reason:e,event:t??new Event(`base-ui`),...r}}var Sn=`none`,Cn=`trigger-press`,wn=`trigger-hover`,Tn=`trigger-focus`,En=`outside-press`,Dn=`item-press`,On=`close-press`,kn=`focus-out`,An=`escape-key`,jn=`list-navigation`,Mn=`keyboard`,Nn=`pointer`,Pn=`cancel-open`,Fn=`sibling-open`,In=`disabled`,Ln=`imperative-action`,Rn=`window-resize`;function zn(e){W.useEffect(e,bt)}var Bn=null;globalThis.requestAnimationFrame;var Vn=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Hn=class e{static create(){return new e}static request(e){return Vn.request(e)}static cancel(e){return Vn.cancel(e)}currentId=Bn;request(e){this.cancel(),this.currentId=Vn.request(()=>{this.currentId=Bn,e()})}cancel=()=>{this.currentId!==Bn&&(Vn.cancel(this.currentId),this.currentId=Bn)};disposeEffect=()=>this.cancel};function Un(){let e=mt(Hn.create).current;return zn(e.disposeEffect),e}function Wn(e,t=!1,n=!1,r=!1){let[i,a]=W.useState(e&&t?`idle`:void 0),[o,s]=W.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),q(()=>{if(!e&&o&&i!==`ending`&&n){let e=Hn.request(()=>{a(`ending`)});return()=>{Hn.cancel(e)}}},[e,o,i,n]),q(()=>{if(!e||t||i===void 0)return;let n=Hn.request(()=>{a(void 0)});return()=>{Hn.cancel(n)}},[t,e,i]),q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Hn.request(()=>{a(`idle`)});return()=>{Hn.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Gn(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Ct(),u=W.useRef(-1),[d,f]=W.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=W.useRef(null),h=W.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Kn=`data-starting-style`,qn=`data-ending-style`,Jn={[Kn]:``},Yn={[qn]:``},Xn={transitionStatus(e){return e===`starting`?Jn:e===`ending`?Yn:null}};function Zn(){return typeof window<`u`}function Qn(e){return tr(e)?(e.nodeName||``).toLowerCase():`#document`}function $n(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function er(e){return((tr(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function tr(e){return Zn()?e instanceof Node||e instanceof $n(e).Node:!1}function nr(e){return Zn()?e instanceof Element||e instanceof $n(e).Element:!1}function rr(e){return Zn()?e instanceof HTMLElement||e instanceof $n(e).HTMLElement:!1}function ir(e){return!Zn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof $n(e).ShadowRoot}function ar(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=gr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function or(e){return/^(table|td|th)$/.test(Qn(e))}function sr(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var cr=/transform|translate|scale|rotate|perspective|filter/,lr=/paint|layout|strict|content/,ur=e=>!!e&&e!==`none`,dr;function fr(e){let t=nr(e)?gr(e):e;return ur(t.transform)||ur(t.translate)||ur(t.scale)||ur(t.rotate)||ur(t.perspective)||!mr()&&(ur(t.backdropFilter)||ur(t.filter))||cr.test(t.willChange||``)||lr.test(t.contain||``)}function pr(e){let t=vr(e);for(;rr(t)&&!hr(t);){if(fr(t))return t;if(sr(t))return null;t=vr(t)}return null}function mr(){return dr??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),dr}function hr(e){return/^(html|body|#document)$/.test(Qn(e))}function gr(e){return $n(e).getComputedStyle(e)}function _r(e){return nr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vr(e){if(Qn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ir(e)&&e.host||er(e);return ir(t)?t.host:t}function yr(e){let t=vr(e);return hr(t)?(e.ownerDocument||e).body:rr(t)&&ar(t)?t:yr(t)}function br(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=yr(e),i=r===e.ownerDocument?.body,a=$n(r);if(i){let e=xr(a);return t.concat(a,a.visualViewport||[],ar(r)?r:[],e&&n?br(e):[])}else return t.concat(r,br(r,[],n))}function xr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Sr=W.createContext(void 0);function Cr(e=!1){let t=W.useContext(Sr);if(t===void 0&&!e)throw Error(Mt(16));return t}function wr(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:W.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Tr(e){return e?.ownerDocument||document}function Er(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new($n(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Dr(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=W.useRef(null),s=Cr(!0),c=a??s!==void 0,{props:l}=wr({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=W.useCallback(()=>{let e=o.current;Or(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return q(u,[u]),{getButtonProps:W.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return qt({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(rn(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Or(r),s=!i&&kr(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Er(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Er(r,e)))},onKeyUp(e){if(!t){if(rn(e),a?.(e),e.target===e.currentTarget&&i&&c&&Or(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Er(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:K(e=>{o.current=e,u()})}}function Or(e){return rr(e)&&e.tagName===`BUTTON`}function kr(e){return rr(e)&&e.tagName===`A`&&!!e.href}function J(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var Ar=0,jr=class e{static create(){return new e}currentId=Ar;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ar,t()},e)}isStarted(){return this.currentId!==Ar}clear=()=>{this.currentId!==Ar&&(clearTimeout(this.currentId),this.currentId=Ar)};disposeEffect=()=>this.clear};function Mr(){let e=mt(jr.create).current;return zn(e.disposeEffect),e}function Nr(e){let t=mt(Pr,e).current;return t.next=e,q(t.effect),t}function Pr(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Fr=t(a(),1);function Ir(e){return e==null?e:`current`in e?e.current:e}function Lr(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Rr=null;function zr(e){if(!Rr){let e=[];Rr=e,queueMicrotask(()=>{Rr=null,Fr.flushSync(()=>{for(let t of e)t()})})}Rr.push(e)}function Br(e,t=!1,n=!1){let r=Un();return K((i,a=null)=>{r.cancel();let o=Ir(e);if(o==null)return;let s=o,c=()=>{if(!n){Fr.flushSync(i);return}zr(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Lr(s).map(e=>e.finished.then(yt))).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(Lr(s).some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Kn;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function Vr(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=K(a),s=Br(r,n,i);W.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var Hr=48,Ur=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Hr-t;return n},Wr=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},Gr=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Hr;n+=i>>>1^-(i&1),t[r]=n}return t},Kr=384,qr=[],Jr=Wr(Ur(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Yr=Wr(Ur(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Xr=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,Zr=(()=>{let e=Jr.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=Jr[n];i<Jr[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(Jr[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=Jr[i];a<Jr[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Qr=Ur(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),$r=Wr(Ur(`123333359346463635126536711576`)),ei=Ur(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),ti=Ur(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),ni=Gr(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),ri=(()=>{let e=new Int32Array(319).fill(-1),t=Gr(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=Gr(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),ii=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),ai=Gr(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),oi=Gr(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),si=Gr(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}22
:22z22222222222G000qOVI00000{2<40000@00000G¦§000ª00000000000000021K¬«00®000000000000000000000222HGH_1¸222½2¾2222ÇÊ000°2±`),ci=new Int32Array(987),li=new Int32Array(987),ui=new Int32Array(987),di=``,fi=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<ai.length;r++)for(let i of ii[si[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),fi[a*2]=di.length,fi[a*2+1]=i.length,di+=i),ci[n]=ai[r],li[n]=oi[r],ui[n]=a,n++}}var pi=Gr(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),mi=Wr(Ur(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),hi=Gr(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),gi=Ur(`ij`),_i=Ur(``),vi=Ur(`1`),yi={GROUP_COUNT:Kr,customValidatorNames:qr,edgeStart:Jr,labelStart:Yr,labelText:Xr,edgeTarget:Zr,nodeGroup:Qr,nodeVlist:ri,vlistPat:$r,vlistOps:ei,vlistRef:ti,vlistGroup:ni,litAnchor:ci,litGroup:li,litPool:ui,poolOffsets:fi,poolText:di,adjGid:pi,adjStart:mi,adjTgt:hi,patGid:gi,patTgt:_i,postfixLookupGroups:vi,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},bi=`line`in Error(),xi=-1,Si=-1,Ci=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},wi=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15|0},Ti=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let ee=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Ci(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;ee[n]!==-1;)n=n+1&I-1;ee[n]=e}let L=(e,t,n,r)=>{let i=(Ci(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=ee[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},R=n.cacheSize??8192,te=n.prefix??e.prefix??``,ne=te===``?``:te+`:`,z=ne.length,re=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),B=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,V=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,H=0,U=-1,oe=-1,se=-1,ce=-1,le=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ue=e=>/\s/.test(String.fromCharCode(e)),de=(e,t,n)=>{if(H=0,U=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)H=1;else if(r===40&&i===41)H=2;else return;se=t+1,ce=n-1;let a=t+1;if(le(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!le(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(U=t+1,oe=a,se=a+1)}},fe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},pe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,he=e=>!!e&&!Number.isNaN(Number(e)),ge=(e,t,n)=>{if(n-t<11||!fe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&fe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&fe(e,t+10,t+18,`-normal/`)},_e=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ve=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ye=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],W=(e,t,n,r)=>{if(e>=10){if(e>=25)return re[e-25](t.slice(n,r));let i=e-10;if(H!==_e[i])return!1;if(U>=0){for(let e of ve[i])if(fe(t,U,oe,e))return!0;return!1}switch(ye[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(se,ce);return B.test(e)&&!V.test(e)}case 3:return he(t.slice(se,ce));case 4:return ae.test(t.slice(se,ce));default:return ie.test(t.slice(se,ce))}}switch(e){case 0:return!0;case 1:return H===0;case 2:return H===1;case 3:return H===2;case 4:return pe.test(t.slice(n,r));case 5:return he(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&he(t.slice(n,r-1));case 8:return me.test(t.slice(n,r));default:return ge(t,n,r)}},G=new Set(typeof E==`string`?E.split(` `):E),be=(e,t,n,r,i,a)=>{let o=Ci(t,n,r)^(i?2654435769:0)|0,s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(!(a.imp!==i||a.k.length!==r-n)){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},xe=new Map,Se=new Map,Ce=2,we=4096,Te=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||G.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Se.get(s);return c===void 0&&Se.set(s,c=Ce++),c},Ee=new Map,De=r,Oe=r+4096,ke=()=>De++,Ae=2097152,je=8192,Me=new Int32Array(je),Ne=Array(je).fill(null),Pe=new Int32Array(je),Fe=new Int32Array(je),Ie=new Uint8Array(je),Le=0,Re=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ne[e]!==null)if(Ne[e|1]===null)c=e|1;else if(!(Le++&3))c=e|Le>>2&1;else return;Ne[c]=t.slice(n,r),Me[c]=i,Pe[c]=a,Fe[c]=o,Ie[c]=s},ze=()=>Ne.fill(null),Be=256,Ve=[new Int32Array(Be),new Int32Array(Be),new Int32Array(Be),new Int32Array(Be)],[He,Ue,We,Ge]=Ve,Ke=new Uint8Array(Be),qe=new Uint8Array(Be),Je=()=>{Be*=2,Ve=Ve.map(e=>{let t=new Int32Array(Be);return t.set(e),t}),[He,Ue,We,Ge]=Ve;let e=new Uint8Array(Be);e.set(Ke),Ke=e,qe=new Uint8Array(Be)},Ye=64,Xe=new Int32Array(Ye),Ze=new Int32Array(Ye),Qe=new Int32Array(r),$e=2048,et=21,tt=new Float64Array($e),nt=new Int32Array($e),rt=0,it=(e,t)=>{if(e===0&&t<r)return Qe[t]===rt?1:(Qe[t]=rt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>et;for(;nt[i]===rt;){if(tt[i]===n)return 1;i=i+1&$e-1}return tt[i]=n,nt[i]=rt,0},at=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?xi:be(Ee,e,t+1,r,0,ke)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Ze[t];if(r>n)continue;let i=Xe[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=L(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;de(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(W(d[t],e,r,n))return p[h+t]}return xi},ot=e=>{let t=e.length,n=0,c=0,u=!1;(Ce>we||xe.size>we)&&(xe=new Map,Se=new Map,Ce=2,ze()),De>Oe&&(Ee=new Map,De=r,ze());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ue(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ue(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Be&&Je();let _=n++;He[_]=p,Ue[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Me[y]===v&&Ne[y]!==null&&Ne[y].length===g?t=y:Me[y|1]===v&&Ne[y|1]!==null&&Ne[y|1].length===g&&(t=y|1),t>=0){let n=Ne[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){We[_]=Pe[t],Ge[_]=Fe[t],Ke[_]=Ie[t];continue}}}let b=p;if(z!==0){if(h-p<=z||!e.startsWith(ne,p)){We[_]=xi,Re(y,e,p,h,v,xi,0,0);continue}b=p+z}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,ee=-1,L=0;(l[0]>=0||N[0]===1)&&(Xe[0]=0,Ze[0]=M,L=1);let R=Si,te=0;for(let t=M;t<D;t++)if(t===A&&(R=F<I?Si:P,te=L),P!==Si){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=ee)):P=Si;else{let e=i[P],t=i[P+1],c=Si;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],ee=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(L===Ye){Ye*=2;let e=new Int32Array(Ye);e.set(Xe),Xe=e;let t=new Int32Array(Ye);t.set(Ze),Ze=t}Xe[L]=r,Ze[L]=t+2,L++}}A===D&&(R=F<I?Si:P,te=L);let re=F<I?Si:P,B,V=!1;if(A>=0)if(V=!0,B=at(e,E,A,R,te),B!==xi&&B<r&&j[B]){let t=at(e,E,D,re,L);t!==xi&&t!==B&&(B=t,V=!1)}else B===xi&&(B=at(e,E,D,re,L),V=!1);else B=at(e,E,D,re,L);let ie=0,ae=0;B===xi?We[_]=xi:(ae=+!!V,ie=b>=C?+!!O:be(xe,e,b,C,+!!O,e=>Te(e,O)),We[_]=B,Ke[_]=ae,Ge[_]=ie),Re(y,e,p,h,v,B,ie,ae)}if(n===0)return``;if(n===1)return He[0]===0&&Ue[0]===t?e:e.slice(He[0],Ue[0]);if(n*k>$e){for(;n*k>$e;)$e<<=1,et--;tt=new Float64Array($e),nt=new Int32Array($e)}if(Ce>=Ae||De>=Ae)throw Error(`cn: too many distinct classes in one merge`);rt=rt+1|0,rt===0&&(Qe.fill(0),nt.fill(0),rt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=We[e];if(t===xi){qe[e]=1;continue}let n=Ge[e];if(it(n,t)===1){qe[e]=0,f=!0;continue}if(qe[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)it(n,x[e]);if(Ke[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&it(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!qe[m]){m++;continue}let t=He[m],r=Ue[m],i=m+1;for(;i<n&&qe[i]&&He[i]===r+1&&e.charCodeAt(r)===32;)r=Ue[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},st=16384,ct=new Int32Array(st*2),lt=0,ut=1,dt=Object.create(null),ft=Object.create(null),pt=new Map,mt=new Map,ht=0,gt=0,K=()=>{lt^=st,ut=ut+1|0,gt=0},_t=e=>{let t=dt[e];if(t!==void 0)return t;let n=wi(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=ft[e],t!==void 0)?(dt[e]=t,t):(t=ot(e),i?(dt[e]=t,++ht>R&&(ht=0,ft=dt,dt=Object.create(null),K())):(ct[r]=n^ut,++gt>st&&K()),t)},vt=e=>{let t=pt.get(e);if(t!==void 0)return t;let n=wi(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=mt.get(e),t!==void 0)?(pt.set(e,t),t):(t=ot(e),i?(pt.set(e,t),++ht>R&&(ht=0,mt=pt,pt=new Map,K())):(ct[r]=n^ut,++gt>st&&K()),t)},yt=e=>{let t=wi(e,0,e.length),n=(t&16383)+lt;return ct[n]===(t^ut)||ct[n^st]===(t^ut-1)?!0:(ct[n]=t^ut,++gt>st&&K(),!1)},bt=R===0?ot:bi?e=>{let t=pt.get(e);return t===void 0?vt(e):t}:_t;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?bt(arguments[0]):bt(Oi.apply(null,arguments))},mergeString:bt,seenBefore:R===0?()=>!1:yt,mergeUncached:ot}},Ei=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Ei(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Di=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Ei(i,t);a&&(n&&(n+=` `),n+=a)}return n},Oi=function(){return Di(arguments,!1)},ki=256,Ai=16,ji=1024,Mi=4096,Ni=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Mi).fill(``),l=Array(Mi).fill(``),u=Array(Mi).fill(``));let i=wi(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Ei(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Ai&&(_.miss=Ai,_.skip=ji,_.e.length=0,_.at=0);let u=_.e;u.length<ki?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Ei(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Pi=Ti(yi),Fi=Ni(Pi.mergeString,Pi);Pi.merge;var Ii=W.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Dr({disabled:i,focusableWhenDisabled:a,native:o});return sn(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Li=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ri=r,zi=(e,t)=>n=>{if(t?.variants==null)return Ri(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Li(t)||Li(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ri(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Bi=zi(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Vi({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,G.jsx)(Ii,{"data-slot":`button`,className:Fi(Bi({variant:t,size:n,className:e})),...r})}function Hi(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ui,platform:Wi,maxTouchPoints:Gi}=Hi(),Ki=Ui.toLowerCase(),qi=Wi.toLowerCase(),Ji=/^i(os$|p)/.test(qi)||qi===`macintel`&&Gi>1,Yi=`android`,Xi=qi===Yi||Ki.includes(Yi),Zi=!Ji&&qi.startsWith(`mac`);qi.startsWith(`win`),!Xi&&/^(linux|chrome os)/.test(qi);var Qi=Zi||Ji,$i=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!$i&&Ki.includes(`firefox`),!$i&&Ki.includes(`chrom`);var ea=Qi,ta=/jsdom|happydom/.test(Ki),na={},ra={},ia=``;function aa(e,t){return ar(e)?e:t}function oa(e,t,n){return/hidden|clip/.test(e.getComputedStyle(aa(t,n)).overflowY)}function sa(e){if(typeof document>`u`)return!1;let t=Tr(e);return $n(t).innerWidth-t.documentElement.clientWidth>0}function ca(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Tr(e),n=t.documentElement,r=t.body,i=aa(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function la(e){let t=Tr(e),n=t.documentElement,r=t.body,i=aa(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function ua(e){let t=Tr(e),n=t.documentElement,r=t.body,i=$n(n),a=0,o=0,s=!1,c=Hn.create();if($i&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,na={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ia=n.style.scrollBehavior,ra={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=aa(n,r);if(s=ca(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,na),Object.assign(r.style,ra),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=ia)}function d(){u(),c.request(l)}l();let f=J(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var da=new class{lockCount=0;restore=null;timeoutLock=jr.create();timeoutUnlock=jr.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Tr(e),n=t.documentElement,r=t.body,i=$n(n);if(oa(i,n,r)){let t=new i.MutationObserver(()=>{oa(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Ji||!sa(e);this.restore=a?la(e):ua(e)}};function fa(e=!0,t=null){q(()=>{if(e)return da.acquire(t)},[e,t])}function pa(e){e.preventDefault(),e.stopPropagation()}function ma(e){return`nativeEvent`in e}function ha(e){return e.pointerType===``&&e.isTrusted?!0:Xi&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function ga(e){return ta?!1:!Xi&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Xi||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function _a(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function va(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function ya(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Y(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ir(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ba(e,t){let n=e;for(;n;){if(nr(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(ir(n)?n.host:null)}return null}function xa(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Sa=`data-base-ui-focusable`,Ca=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,wa=`ArrowLeft`,Ta=`ArrowRight`,Ea=`ArrowUp`,Da=`ArrowDown`,Oa=`data-open`,ka=`data-closed`,Aa=Kn,ja=qn,Ma=`data-anchor-hidden`,Na=`data-popup-open`,Pa=`data-pressed`,Fa={[Na]:``},Ia={[Na]:``,[Pa]:``},La={[Oa]:``},Ra={[ka]:``},za={[Ma]:``},Ba={open(e){return e?Fa:null}},Va={open(e){return e?Ia:null}},Ha={open(e){return e?La:Ra},anchorHidden(e){return e?za:null}},Ua={...Ha,...Xn},Wa=`data-trigger-disabled`;function Ga(e,t){if(!nr(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Wa);for(let[,e]of t.entries())if(Y(e,n))return!e.hasAttribute(Wa);return!1}function Ka(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function qa(e){return e.matches(`html,body`)}function Ja(e){return rr(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ya(e){return ba(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ca}`)!=null}function Xa(e){return e?e.getAttribute(`role`)===`combobox`&&Ja(e):!1}function Za(e){if(!e||ta)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Qa(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function $a(e,t){return t!=null&&!_a(t)?0:typeof e==`function`?e():e}function eo(e,t,n){let r=$a(e,n);return typeof r==`number`?r:r?.[t]}function to(e){return typeof e==`function`?e():e}function no(e,t){return t||e===`click`||e===`mousedown`}function ro(e){return e?.includes(`mouse`)&&e!==`mousedown`}function io(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var ao={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},oo={...ao,position:`fixed`,margin:0,top:0,left:0},so={...ao,position:`absolute`},co=W.forwardRef(function(e,t){let[n,r]=W.useState();q(()=>{ea&&$i&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,G.jsx)(`span`,{...e,ref:t,style:oo,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),lo=Math.min,uo=Math.max,fo=Math.round,po=Math.floor,mo=e=>({x:e,y:e}),ho={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function go(e,t,n){return uo(e,lo(t,n))}function _o(e,t){return typeof e==`function`?e(t):e}function vo(e){return e.split(`-`)[0]}function yo(e){return e.split(`-`)[1]}function bo(e){return e===`x`?`y`:`x`}function xo(e){return e===`y`?`height`:`width`}function So(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Co(e){return bo(So(e))}function wo(e,t,n){n===void 0&&(n=!1);let r=yo(e),i=Co(e),a=xo(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=No(o)),[o,No(o)]}function To(e){let t=No(e);return[Eo(e),t,Eo(t)]}function Eo(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Do=[`left`,`right`],Oo=[`right`,`left`],ko=[`top`,`bottom`],Ao=[`bottom`,`top`];function jo(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Oo:Do:t?Do:Oo;case`left`:case`right`:return t?ko:Ao;default:return[]}}function Mo(e,t,n,r){let i=yo(e),a=jo(vo(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Eo)))),a}function No(e){let t=vo(e);return ho[t]+e.slice(t.length)}function Po(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Fo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Po(e)}function Io(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Lo(e,t){return t<0||t>=e.length}function Ro(e,t){return Vo(e.current,{disabledIndices:t})}function zo(e,t){return Vo(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Bo(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Vo(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Lo(e,u)?-1:u,wrapped:d}}function Vo(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Ho(e,a,r));return a}function Ho(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Wo(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Uo(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Wo(e,t=e?gr(e):null){return!e||!e.isConnected||!t||Uo(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Go=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Ko(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ir(n)?n.host:null}function qo(e){for(let t of Array.from(e.children))if(Qn(t)===`summary`)return t;return null}function Jo(e,t){let n=qo(t);return!!n&&(e===n||Y(n,e))}function Yo(e){let t=e?Qn(e):``;return e!=null&&e.matches(Go)&&(t!==`summary`||e.parentElement!=null&&Qn(e.parentElement)===`details`&&qo(e.parentElement)===e)&&(t!==`details`||qo(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Xo(e){if(!Yo(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Ko(t)){let n=t!==e,r=Qn(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Qn(t)===`details`&&!t.open&&!Jo(e,t)||t.hasAttribute(`hidden`)||!r&&!Zo(t,n))return!1}return!0}function Zo(e,t){let n=gr(e);return t?n.display!==`none`:Wo(e,n)}function Qo(e){let t=e.tabIndex;if(t<0){let t=Qn(e);if(t===`details`||t===`audio`||t===`video`||rr(e)&&e.isContentEditable)return 0}return t}function $o(e){if(Qn(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function es(e,t){let n=$o(e);if(!n)return!0;let r=t.find(e=>{let t=$o(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=$o(e);return t?.name===n.name&&t.form===n.form})===n}function ts(e){if(rr(e)&&Qn(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return rr(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function ns(e,t){ts(e).forEach(e=>{Yo(e)&&t.push(e),ns(e,t)})}function rs(e,t,n){ts(e).forEach(e=>{rr(e)&&e.matches(t)&&n.push(e),rs(e,t,n)})}function is(e){return Xo(e)&&Qo(e)>=0}function as(e){let t=[];return ns(e,t),t.filter(Xo)}function os(e){let t=as(e);return t.filter(e=>Qo(e)>=0&&es(e,t))}function ss(e,t){let n=os(e),r=n.length;if(r===0)return;let i=ya(Tr(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function cs(e){return ss(Tr(e).body,1)||e}function ls(e){return ss(Tr(e).body,-1)||e}function us(e,t,n){if(!e)return null;let r=[];ns(Tr(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Xo);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Y(n,o)&&is(o)&&es(o,a))return o}return r[i]}function ds(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Y(n,r)}function fs(e){os(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ps(e){let t=[];rs(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ms(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ms(e,t.id,n)])}function hs(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function gs(e){return`data-base-ui-${e}`}var _s=0;function vs(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(_s);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),yt;let o=requestAnimationFrame(a);return _s=o,()=>{_s===o&&(cancelAnimationFrame(o),_s=0)}}var ys=`data-base-ui-inert`,bs=new WeakMap,xs=new WeakSet,Ss=new WeakMap,Cs=0;function ws(e){return e?ir(e)?e.host:ws(e.parentNode):null}var Ts=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=ws(t);return e.contains(n)?n:null}).filter(e=>e!=null),Es=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Ds=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{Qn(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Os(e,t,n,{mark:r=!0}){let i=Ts(t,e),a=r?Ds(t,Es(i),new Set(i)):[],o=[],s=[];if(n){let e=Ts(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Ds(t,Es(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(bs.get(e)||0)+1;bs.set(e,r),o.push(e),r===1&&n&&xs.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Ss.get(e)||0)+1;Ss.set(e,t),s.push(e),t===1&&e.setAttribute(ys,``)}),Cs+=1,()=>{o.forEach(e=>{let t=(bs.get(e)||0)-1;bs.set(e,t),t||(xs.has(e)||e.removeAttribute(`aria-hidden`),xs.delete(e))}),r&&s.forEach(e=>{let t=(Ss.get(e)||0)-1;Ss.set(e,t),t||e.removeAttribute(ys)}),--Cs,Cs||(bs=new WeakMap,xs=new WeakSet,Ss=new WeakMap)}}function ks(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Tr(e[0]).body;return Os(e,i,n,{mark:r})}var As={style:{transition:`none`}},js=`data-base-ui-click-trigger`,Ms={fallbackAxisSide:`none`},Ns={fallbackAxisSide:`end`},Ps={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Fs=W.createContext(null),Is=()=>W.useContext(Fs),Ls=gs(`portal`);function Rs(e={}){let{ref:t,container:n,componentProps:r=xt,elementProps:i}=e,a=vn(),o=Is()?.portalNode,[s,c]=W.useState(null),[l,u]=W.useState(null),d=K(e=>{e!==null&&u(e)}),f=W.useRef(null);q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(tr(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=sn(`div`,r,{ref:[t,d],props:[{id:a,[Ls]:``},i]}),m=s&&p?Fr.createPortal(p,s):null;return{node:l,nodeId:W.isValidElement(p)?p.props.id:void 0,subtree:m}}var zs=W.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Rs({container:o,ref:t,componentProps:e,elementProps:c}),f=W.useRef(null),p=W.useRef(null),m=W.useRef(null),h=W.useRef(null),[g,_]=W.useState(null),v=W.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;W.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&ds(e)&&(e.type===`focusin`?v.current&&=(ps(l),!1):(fs(l),v.current=!0))}return io(J(l,`focusin`,e,!0),J(l,`focusout`,e,!0))},[l,y]),q(()=>{!l||b!==!0||!v.current||(ps(l),v.current=!1)},[b,l]);let S=W.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,G.jsxs)(W.Fragment,{children:[d,(0,G.jsxs)(Fs.Provider,{value:S,children:[x&&l&&(0,G.jsx)(co,{"data-type":`outside`,ref:f,onFocus:e=>{ds(e,l)?m.current?.focus():ls(g?g.domReference:null)?.focus()}}),x&&l&&(0,G.jsx)(`span`,{role:s,"aria-owns":u,style:Ps}),l&&Fr.createPortal(a,l),x&&l&&(0,G.jsx)(co,{"data-type":`outside`,ref:p,onFocus:e=>{ds(e,l)?h.current?.focus():(cs(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,bn(`focus-out`,e.nativeEvent)))}})]})]})});function Bs(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Vs=class{nodesRef={current:[]};events=Bs();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Hs=W.createContext(null),Us=W.createContext(null),Ws=()=>W.useContext(Hs)?.id||null,Gs=e=>{let t=W.useContext(Us);return e??t};function Ks(e){let t=vn(),n=Gs(e),r=Ws();return q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function qs(e){let{children:t,id:n}=e,r=Ws();return(0,G.jsx)(Hs.Provider,{value:W.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Js(e){let{children:t,externalTree:n}=e,r=mt(()=>n??new Vs).current;return(0,G.jsx)(Us.Provider,{value:r,children:t})}function Ys(e,t){let n=$n(xa(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(ha(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Xs=20,Zs=[];function Qs(){Zs=Zs.filter(e=>e.deref()?.isConnected)}function $s(e){Qs(),e&&Qn(e)!==`body`&&(Zs.push(new WeakRef(e)),Zs.length>Xs&&(Zs=Zs.slice(-20)))}function ec(){return Qs(),Zs[Zs.length-1]?.deref()}function tc(e){return e?is(e)?e:os(e)[0]||e:null}function nc(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=as(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return is(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function rc(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=K(()=>b.current.floatingContext?.nodeId),S=i===!1,C=Xa(_)&&S,w=Nr(i),T=Nr(a),E=Nr(o),D=Nr(u),O=Nr(g),k=Gs(m),A=Is(),j=W.useRef(!1),M=W.useRef(!1),N=W.useRef(!1),P=W.useRef(null),F=W.useRef(``),I=W.useRef(``),ee=W.useRef(null),L=W.useRef(null),R=Nt(ee,p,A?.beforeInsideRef),te=Nt(L,A?.afterInsideRef),ne=Mr(),z=Mr(),re=Un(),B=A!=null,V=Qa(v),ie=K((e=V)=>e?os(e):[]),ae=K(()=>h?.().filter(e=>e!=null)??[]);W.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Y(V,ya(Tr(V)))&&ie().length===0&&!C&&pa(e)}return J(Tr(V),`keydown`,e)},[r,V,c,C,ie]),W.useEffect(()=>{if(r||!g)return;let e=Tr(V);function t(){N.current=!1}function n(e){let t=xa(e),n=ae(),r=Y(v,t)||Y(_,t)||Y(A?.portalNode,t)||n.some(e=>e===t||Y(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,ba(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,z.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return io(J(e,`pointerdown`,n,!0),J(e,`pointerup`,t,!0),J(e,`pointercancel`,t,!0),J(e,`keydown`,i,!0),t)},[r,v,_,V,g,A,z,ae]),W.useEffect(()=>{if(r||!l)return;let e=Tr(V);function n(){M.current=!0,z.start(0,()=>{M.current=!1})}function i(e){let t=xa(e);is(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=xa(n);c&&r==null&&a!=null&&Y(v,a)&&$s(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=ae(),p=r?.hasAttribute(gs(`focus-guard`))&&[ee.current,L.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Ir(f),Ir(d)].includes(r),m=!(Y(_,r)||Y(v,r)||Y(r,v)||Y(A?.portalNode,r)||u.some(e=>e===r||Y(e,r))||l.hasMatchingElement(e=>Y(e,r))||p||k&&(ms(k.nodesRef.current,o).find(e=>Y(e.context?.elements.floating,r)||Y(e.context?.elements.domReference,r))||hs(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,Qa(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&V&&nc(V),s&&i!==_&&!Wo(a)&&ya(e)===e.body){if(rr(V)&&(V.focus(),s===`popup`)){re.request(()=>{V.focus()});return}let e=ie(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||V;rr(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!c)&&r&&m&&!M.current&&(C||r!==ec())&&(j.current=!0,t.setOpen(!1,bn(kn,n)))})}function o(){N.current||(b.current.insideReactTree=!0,ne.start(0,()=>{b.current.insideReactTree=!1}))}let u=rr(_)?_:null;if(!(!v&&!u))return io(u&&J(u,`focusout`,a),u&&J(u,`pointerdown`,n),v&&J(v,`focusin`,i),v&&J(v,`focusout`,a),v&&A&&J(v,`focusout`,o,!0))},[r,_,v,V,c,k,A,t,l,s,ie,C,x,b,ne,z,re,d,f,ae]),W.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${gs(`portal`)}]`)||[]),t=(k?hs(k.nodesRef.current,x()):[]).find(e=>Xa(e.context?.elements.domReference||null))?.context?.elements.domReference,n=ks([v,...e,ee.current,L.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ae(),t,Ir(f),Ir(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=ks([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,ae]),q(()=>{if(!g||r||!rr(V))return;F.current=``,I.current=``;let e=Tr(V),t=ya(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Y(V,t))return;let i=null,a=()=>(i??=ie(V),i[0]||V),o;o=r===!0||r===null?a():Ir(r),o||=a();let s=Y(V,ya(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&ha(c);vs(o,{sync:l,preventScroll:o===V,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=ya(e);return!(t!==o&&Y(V,t))}})})},[r,g,V,ie,w,D,O,b]);let H=W.useRef(null);q(()=>{if(r||!V){H.current=null;return}H.current&&=(H.current.cancelled=!0,null);let e=Tr(V),t=ya(e),n=D.current==null;$s(t);function i(e){if(e.open||(F.current=Ys(e.nativeEvent,I.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(gs(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`)if(e.nested)j.current=!1;else if(ha(e.nativeEvent)||ga(e.nativeEvent))j.current=!1;else{let e=!1;Tr(V).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&Qn(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ec()||null,typeof i==`boolean`?s:Ir(i)||s||null}return()=>{y.off(`openchange`,i);let t=ya(e),n=ae(),r=Y(v,t)||n.some(e=>e===t||Y(e,t))||k&&ms(k.nodesRef.current,x(),!1).some(e=>Y(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};H.current=l,queueMicrotask(()=>{H.current===l&&(H.current=null);let n=tc(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&rr(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,V,T,E,D,y,k,_,x,ae]),q(()=>{if(!$i||g||!v)return;let e=ya(Tr(v));!rr(e)||!Ja(e)||Y(v,e)&&e.blur()},[g,v]),q(()=>{if(!(r||!A))return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),q(()=>{if(!(r||!V))return nc(V),()=>{queueMicrotask(Qs)}},[r,V]);let U=!r&&(!c||!C)&&(B||c);return(0,G.jsxs)(W.Fragment,{children:[U&&(0,G.jsx)(co,{"data-type":`inside`,ref:R,onFocus:e=>{if(c){let e=ie();vs(e[e.length-1])}else A?.portalNode&&(j.current=!1,ds(e,A.portalNode)?cs(_)?.focus():Ir(f??A.beforeOutsideRef)?.focus())}}),n,U&&(0,G.jsx)(co,{"data-type":`inside`,ref:te,onFocus:e=>{c?vs(ie()[0]):A?.portalNode&&(l&&(j.current=!0),ds(e,A.portalNode)?ls(_)?.focus():Ir(d??A.afterOutsideRef)?.focus())}})]})}function ic(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Cn}=t,l=e.context.dataRef,u=W.useRef(void 0),d=Un(),f=Mr(),p=W.useMemo(()=>{function t(t,n,r,i){let a=bn(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=_a(e.pointerType,!0)&&ga(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||_a(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=xa(s),p=Ja(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;if(r===`mousedown`&&o){u.current=void 0;return}_a(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return W.useMemo(()=>n?{reference:p}:xt,[n,p])}function ac(){return!1}function oc(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function sc(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=ac,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Gs(c),m=K(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=K(()=>a),{escapeKey:v,outsidePress:y}=oc(s),b=W.useRef(!1),x=W.useRef(!1),S=W.useRef(!1),C=W.useRef(!1),w=W.useRef(!1),T=W.useRef(``),E=W.useRef(null),D=Mr(),O=Mr(),k=Mr(),A=K(()=>{O.clear(),d.current.insideReactTree=!1}),j=K(e=>{let t=d.current.floatingContext?.nodeId;return(p?ms(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=K(t=>Ka(t,e.select(`floatingElement`))||Ka(t,e.select(`domReferenceElement`))),N=K(t=>{o()&&e.setOpen(!1,bn(Cn,t.nativeEvent))}),P=K(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=ma(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=bn(An,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),F=K(()=>{d.current.insideReactTree=!0,O.start(0,A)}),I=K(t=>{if(!l||!n||t.button!==0)return;let r=xa(t.nativeEvent);Y(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),ee=K(e=>{!l||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});W.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),W.useEffect(()=>A,[A]),W.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new jr,i=Tr(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start($i?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&ms(p.nodesRef.current,t).some(t=>Ka(e,t.context?.elements.floating));return M(e)||n}function N(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=xa(n),i=`[${gs(`inert`)}]`,a=nr(r)?r.getRootNode():null,o=Array.from((ir(a)?a:Tr(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Y(e,r))))return;let c=nr(r)?r:null;for(;c&&!hr(c);){let e=vr(c);if(hr(e)||!nr(e))break;c=e}if(!(o.length&&nr(r)&&!qa(r)&&!Y(r,e.select(`floatingElement`))&&o.every(e=>!Y(c,e)))){if(rr(r)&&!(`touches`in n)){let e=hr(r),t=gr(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!ha(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}typeof h==`function`&&!h(n)||j(`__outsidePressBubbles`)||(e.setOpen(!1,bn(En,n)),A())}}}function F(t){f()!==`sloppy`||t.pointerType===`touch`||!e.select(`open`)||!n||M(t)||N(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function ee(e,t){let n=xa(e);if(!n)return;let r=J(n,e.type,()=>{t(e),r()})}function L(e){T.current=`touch`,ee(e,I)}function R(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&ee(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function te(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;if(c(),f()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!O(e)){if(n){s();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,A())}}}function ne(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(N(e),D.clear(),E.current=null)}function z(e){ee(e,ne)}function re(e){f()!==`sloppy`||!E.current||M(e)||(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function B(e){ee(e,re)}let V=io(r&&io(J(i,`keydown`,P),J(i,`compositionstart`,a),J(i,`compositionend`,o)),g&&io(J(i,`click`,R,!0),J(i,`pointerdown`,R,!0),J(i,`pointerup`,te,!0),J(i,`pointercancel`,te,!0),J(i,`mousedown`,R,!0),J(i,`mouseup`,te,!0),J(i,`touchstart`,L,{capture:!0,passive:!0}),J(i,`touchmove`,z,{capture:!0,passive:!0}),J(i,`touchend`,B,{capture:!0,passive:!0})));return()=>{V(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,P,A,_,j,M,p,e,D,k]);let L=W.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),R=W.useMemo(()=>({onKeyDown:P,onPointerDown:ee,onMouseDown:ee,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,ee]);return W.useMemo(()=>n?{reference:L,floating:R,trigger:L}:{},[n,L,R])}function cc(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};nr(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function lc(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=K(i),{mounted:c,setMounted:l,transitionStatus:u}=Wn(t,!1,!1,o),d=!t&&r;q(()=>{t&&s(!1)},[t,s]);let f=W.useRef(c),p=W.useRef(!1),m=mn(),h=()=>{f.current=!1,l(!1),a()};q(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=K(()=>{if(f.current){if(t){p.current=!0,m();return}h()}});return Vr({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var uc={tabIndex:-1,[Sa]:``};function dc(e){return t=>t!==`touch`||e.current}function fc(e,t=!1){let n=vn(),r=Ws()!=null,i=mt(()=>e(n,r)).current;return cc({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function pc({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function mc(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function hc(e,t){let n=W.useRef(null);return K(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),mc(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),mc(t))})}function gc(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function _c(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function vc(e,t,n,r={}){let i=n.reason,a=i===wn,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=_c(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=gc(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Fr.flushSync(l):l()}function yc(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=hc(e,n),o=K(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=K(e=>{a(e),e&&o(e)});return q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function bc(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=W.useRef(null),i=e.useState(`open`);q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=bn(Sn);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function xc(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=lc({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return mt(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Sc(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:xt,inactiveTriggerProps:xt,popupProps:xt})},[e])}function Cc(e,t){q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var wc=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Tc=i((t=>{var n=e();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;t.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),Ec=i(((e,t)=>{t.exports=Tc()})),Dc=i((t=>{var n=e(),r=Ec();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Oc=i(((e,t)=>{t.exports=Dc()})),kc=Ec(),Ac=Oc(),jc=[],Mc=void 0;function Nc(){return Mc}function Pc(e){jc.push(e)}function Fc(e){let t=(t,n)=>{let r=mt(Lc).current,i;try{Mc=r;for(let e of jc)e.before(r);i=e(t,n);for(let e of jc)e.after(r);r.didInitialize=!0}finally{Mc=void 0}return i};return t.displayName=e.displayName||e.name,t}function Ic(e){return W.forwardRef(Fc(e))}function Lc(){return{didInitialize:!1}}var Rc=Bt(19)?Vc:Hc;function zc(e,t,n,r,i){return Rc(e,t,n,r,i)}function Bc(e,t,n,r,i){let a=W.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,kc.useSyncExternalStore)(e.subscribe,a,a)}Pc({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,kc.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Vc(e,t,n,r,i){let a=Nc();if(!a)return Bc(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Hc(e,t,n,r,i){return(0,Ac.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Uc=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return zc(this,e,t,n,r)}},Wc=class extends Uc{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){W.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){W.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return W.useDebugValue(e),zc(this,this.selectors[e],t,n,r)}useContextCallback(e,t){W.useDebugValue(e);let n=K(t??yt);this.context[e]=n}useStateSetter(e){let t=W.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Gc={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Kc=class extends Wc{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Bs(),nested:n,triggerElements:i},Gc),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&va(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function qc(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Kc({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:xt,inactiveTriggerProps:xt,popupProps:xt}}var Jc=e=>e.triggerIdProp??e.activeTriggerId,Yc=e=>e.openProp??e.open,Xc=e=>(e.popupElement?.id??e.floatingId)||void 0;function Zc(e,t){return t!==void 0&&Yc(e)&&Jc(e)===t}function Qc(e,t){return Zc(e,t)?!0:t!==void 0&&Yc(e)&&Jc(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var $c={open:Yc,mounted:e=>e.mounted,transitionStatus:e=>Yc(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Jc,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Xc,isTriggerActive:(e,t)=>t!==void 0&&Jc(e)===t,isOpenedByTrigger:(e,t)=>Zc(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Jc(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Qc(e,t)?Xc(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function el(e){return(0,kc.useSyncExternalStore)(W.useCallback(t=>e===void 0?yt:e.subscribeStore(t),[e]),W.useCallback(()=>e===void 0?void 0:e.store,[e]),()=>e?.serverStore)}var tl=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new jr;restTimeout=new jr;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},nl=new WeakMap;function rl(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&nl.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),nl.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function il(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=nl.get(n);a&&a!==e&&rl(a),rl(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,nl.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function al(e){let t=e.context.dataRef.current,n=mt(()=>t.hoverInteractionState??tl.create()).current;return t.hoverInteractionState||=n,zn(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ol(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=Gs(),u=Ws(),d=al(e),f=Mr(),p=K(()=>no(c.current.openEvent?.type,d.interactedInside)),m=K(()=>ro(c.current.openEvent?.type)),h=K(()=>{rl(d)});q(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),W.useEffect(()=>h,[h]),q(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&nr(s)&&o){let e=s,t=o,n=Tr(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??ba(e,`[data-rootownerid]`)??n.body;return il(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),W.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&ms(l.nodesRef.current,u).length>0)}function a(t){let n=eo(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,bn(wn,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=xa(e);if(!Ya(t)){d.interactedInside=!1;return}d.interactedInside=ba(t,`[aria-haspopup]`)!=null}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Ga(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(l&&r&&nr(o)&&ms(l.nodesRef.current,r,!1).some(e=>Y(e.context?.elements.floating,o)))){if(d.handler){d.handler(n);return}h(),m()&&!p()&&a(n)}}function v(n){!l||!u||t()||f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,bn(wn,n)),l.events.emit(`floating.closed`,n)})}let y=o;return io(y&&J(y,`mouseenter`,g),y&&J(y,`mouseleave`,_),y&&J(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var sl={current:null};function cl(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=sl,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=Gs(l),v=al(e),y=W.useRef(!1),b=Nr(i),x=Nr(r),S=Nr(o),C=Nr(n),w=Nr(p),T=Nr(f),E=K(()=>no(h.current.openEvent?.type,v.interactedInside)),D=K(()=>w.current?.()!==!1),O=K((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Y(t,n);if(!nr(r))return!1;let a=r;return i.hasMatchingElement(e=>Y(e,a))&&(!t||!Y(t,a))}),k=K(()=>{v.handler&&=(Tr(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=K(()=>{rl(v)});return u&&(v.handleCloseOptions=i?.__options),W.useEffect(()=>k,[k]),W.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===wn,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),W.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=eo(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,bn(wn,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,bn(wn,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!nr(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!_a(v.pointerType))return;let n=to(S.current),r=eo(x.current,`open`,v.pointerType),i=xa(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(nr(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Y(t,i)){c=t;break}}nr(o)&&nr(s)&&!e.context.triggerElements.hasElement(o)&&Y(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&nr(c)&&nr(s)&&Y(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){D()&&e.setOpen(!0,bn(wn,t,c));return}m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,bn(wn,t,c))}):g&&D()&&e.setOpen(!0,bn(wn,t,c)))}function o(n){if(E()){A();return}k();let r=Tr(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Ga(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n);return}(v.pointerType!==`touch`||!Y(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){Y(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?J(r,`mouseout`,l):void 0;return s?io(J(r,`mousemove`,i,{once:!0}),J(r,`mouseenter`,i),J(r,`mouseleave`,o),f):io(J(r,`mouseenter`,i),J(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),W.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!_a(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;il(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=to(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,bn(wn,n,r))}v.pointerType===`touch`?Fr.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}var ll=.1,ul=ll*ll,dl=.5;function fl(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function pl(e,t,n,r,i,a,o,s,c,l){let u=!1;return fl(e,t,n,r,i,a)&&(u=!u),fl(e,t,i,a,o,s)&&(u=!u),fl(e,t,o,s,c,l)&&(u=!u),fl(e,t,c,l,n,r)&&(u=!u),u}function ml(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function hl(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function gl(e={}){let{blockPointerEvents:t=!1}=e,n=new jr,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*ul;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=xa(r),g=r.type===`mouseleave`,_=Y(u,h),v=Y(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&nr(r.relatedTarget)&&Y(u,r.relatedTarget))return;function y(){return!!(s&&ms(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=hl(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=hl(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=hl(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=hl(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!ml(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?dl/2:dl*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+dl+1,o=C||T?S.bottom-dl:S.top,s=C?T?S.bottom-dl:S.top:S.bottom-dl;M=pl(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?dl/2:dl*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-dl,o=C||T?S.top+dl:S.bottom,s=C?T?S.top+dl:S.bottom:S.top+dl;M=pl(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?dl/2:dl*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+dl+1,o=w||E?S.right-dl:S.left,s=w?E?S.right-dl:S.left:S.right-dl;M=pl(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?dl/2:dl*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-dl,o=w||E?S.left+dl:S.right,s=w?E?S.left+dl:S.right:S.left+dl;M=pl(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function _l(e,t,n){let{reference:r,floating:i}=e,a=So(t),o=Co(t),s=xo(o),c=vo(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=yo(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function vl(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=_o(t,e),p=Fo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Io(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Io(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var yl=50,bl=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:vl},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_l(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<yl&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_l(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xl=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=_o(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=vo(r),_=So(o),v=vo(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[No(o)]:To(o)),x=p!==`none`;!d&&x&&b.push(...Mo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=wo(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==So(t))||T.every(e=>So(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=So(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Sl=new Set([`left`,`top`]);async function Cl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=vo(n),s=yo(n),c=So(n)===`y`,l=Sl.has(o)?-1:1,u=a&&c?-1:1,d=_o(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var wl=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Cl(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Tl=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=_o(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=So(i),p=bo(f),m=u[p],h=u[f],g=(e,t)=>go(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},El=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=_o(e,t),u={x:n,y:r},d=So(i),f=bo(d),p=u[f],m=u[d],h=_o(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Sl.has(vo(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Dl=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=_o(e,t),c=await i.detectOverflow(t,s),l=vo(n),u=yo(n),d=So(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=lo(p-c[m],g),y=lo(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*uo(c.left,c.right):S=p-2*uo(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Ol(e){let t=gr(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=rr(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=fo(n)!==a||fo(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function kl(e){return nr(e)?e:e.contextElement}function Al(e){let t=kl(e);if(!rr(t))return mo(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ol(t),o=(a?fo(n.width):n.width)/r,s=(a?fo(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var jl=mo(0);function Ml(e){let t=$n(e);return!mr()||!t.visualViewport?jl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Nl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===$n(e)}function Pl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=kl(e),o=mo(1);t&&(r?nr(r)&&(o=Al(r)):o=Al(e));let s=Nl(a,n,r)?Ml(a):mo(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=$n(a),t=nr(r)?$n(r):r,n=e,i=xr(n);for(;i&&t!==n;){let e=Al(i),t=i.getBoundingClientRect(),r=gr(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=$n(i),i=xr(n)}}return Io({width:u,height:d,x:c,y:l})}function Fl(e,t){let n=_r(e).scrollLeft;return t?t.left+n:Pl(er(e)).left+n}function Il(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Fl(e,n),y:n.top+t.scrollTop}}function Ll(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=er(r),s=t?sr(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=mo(1),u=mo(0),d=rr(r);if((d||!a)&&((Qn(r)!==`body`||ar(o))&&(c=_r(r)),d)){let e=Pl(r);l=Al(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Il(o,c):mo(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Rl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function zl(e){let t=_r(e),n=e.ownerDocument.body,r=uo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=uo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Fl(e),o=-t.scrollTop;return gr(n).direction===`rtl`&&(a+=uo(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Bl=25;function Vl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=$n(e),a=er(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!mr()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Fl(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Bl&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Hl(e,t){let n=Pl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Al(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ul(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Vl(e,n,t);else if(t===`document`)r=zl(er(e));else if(nr(t))r=Hl(t,n);else{let n=Ml(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Io(r)}function Wl(e,t){let n=t.get(e);if(n)return n;let r=br(e,[],!1).filter(e=>nr(e)&&Qn(e)!==`body`),i=null,a=gr(e).position===`fixed`,o=a?vr(e):e;for(;nr(o)&&!hr(o);){let e=gr(o),t=fr(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=vr(o)}return t.set(e,r),r}function Gl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?sr(t)?[]:Wl(t,this._c):[].concat(n),r],o=Ul(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ul(t,a[e],i);s=uo(n.top,s),c=lo(n.right,c),l=lo(n.bottom,l),u=uo(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Kl(e){let{width:t,height:n}=Ol(e);return{width:t,height:n}}function ql(e,t,n){let r=rr(t),i=er(t),a=n===`fixed`,o=Pl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=mo(0);if((r||!a)&&((Qn(t)!==`body`||ar(i))&&(s=_r(t)),r)){let e=Pl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Fl(i));let l=i&&!r&&!a?Il(i,s):mo(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Jl(e){return gr(e).position===`static`}function Yl(e,t){if(!rr(e)||gr(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return er(e)===n&&(n=n.ownerDocument.body),n}function Xl(e,t){let n=$n(e);if(sr(e))return n;if(!rr(e)){let t=vr(e);for(;t&&!hr(t);){if(nr(t)&&!Jl(t))return t;t=vr(t)}return n}let r=Yl(e,t);for(;r&&or(r)&&Jl(r);)r=Yl(r,t);return r&&hr(r)&&Jl(r)&&!fr(r)?n:r||pr(e)||n}var Zl=async function(e){let t=this.getOffsetParent||Xl,n=this.getDimensions,r=await n(e.floating);return{reference:ql(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ql(e){return gr(e).direction===`rtl`}var $l={convertOffsetParentRelativeRectToViewportRelativeRect:Ll,getDocumentElement:er,getClippingRect:Gl,getOffsetParent:Xl,getElementRects:Zl,getClientRects:Rl,getDimensions:Kl,getScale:Al,isElement:nr,isRTL:Ql};function eu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tu(e,t,n){let r=null,i,a=er(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=po(d),h=po(a.clientWidth-(u+f)),g=po(a.clientHeight-(d+p)),_=po(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:uo(0,lo(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!eu(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=$n(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function nu(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=kl(e),u=i||a?[...l?br(l):[],...t?br(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?tu(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Pl(e):null;c&&g();function g(){let t=Pl(e);h&&!eu(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ru=wl,iu=Tl,au=xl,ou=Dl,su=El,cu=(e,t,n)=>{let r=new Map,i=n??{},a={...$l,...i.platform,_c:r};return bl(e,t,{...i,platform:a})},lu=typeof document<`u`?W.useLayoutEffect:function(){};function uu(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,i;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(!uu(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!uu(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function du(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fu(e,t){let n=du(e);return Math.round(t*n)/n}function pu(e){let t=W.useRef(e);return lu(()=>{t.current=e}),t}function mu(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=W.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=W.useState(r);uu(f,r)||p(r);let[m,h]=W.useState(null),[g,_]=W.useState(null),v=W.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=W.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=W.useRef(null),C=W.useRef(null),w=W.useRef(u),T=c!=null,E=pu(c),D=pu(i),O=pu(l),k=W.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),cu(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!uu(w.current,t)&&(w.current=t,Fr.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);lu(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=W.useRef(!1);lu(()=>(A.current=!0,()=>{A.current=!1}),[]),lu(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=W.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=W.useMemo(()=>({reference:b,floating:x}),[b,x]),N=W.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=fu(M.floating,u.x),r=fu(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...du(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return W.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var hu=(e,t)=>{let n=ru(e);return{name:n.name,fn:n.fn,options:[e,t]}},gu=(e,t)=>{let n=iu(e);return{name:n.name,fn:n.fn,options:[e,t]}},_u=(e,t)=>({fn:su(e).fn,options:[e,t]}),vu=(e,t)=>{let n=au(e);return{name:n.name,fn:n.fn,options:[e,t]}},yu=(e,t)=>{let n=ou(e);return{name:n.name,fn:n.fn,options:[e,t]}},bu=`ArrowUp`,xu=`ArrowDown`,Su=`ArrowLeft`,Cu=`ArrowRight`,wu=`Home`,Tu=new Set([bu,xu,Su,Cu,wu,`End`]),Eu=`Shift`,Du=[Eu,`Control`,`Alt`,`Meta`];function Ou(e){return rr(e)&&e.tagName===`INPUT`}function ku(e){return!!(Ou(e)&&e.selectionStart!=null||rr(e)&&e.tagName===`TEXTAREA`)}function Au(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=ju(e,t,`left`),a=Mu(e),o=Mu(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=ju(e,t,`top`),r=Mu(e),i=Mu(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function ju(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Mu(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function Nu(e){return Bt(19)?e:e?`true`:void 0}var Pu=W.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Fu(e){let t=W.useRef(``),n=W.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:W.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Iu(e,t){let n=W.useRef(e),r=K(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Lu(e,t){let{onClick:n,onPointerDown:r}=Fu(K((n,r)=>{(typeof e==`function`?e():e)||t(r||(Ji?`touch`:``))}));return W.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Ru(e){let[t,n]=W.useState(null),r=Lu(e,n);return Iu(e,t=>{t&&!e&&n(null)}),W.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var zu=zi(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function Bu({className:e,variant:t,...n}){return(0,G.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:Fi(zu({variant:t}),e),...n})}function Vu({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`alert-title`,className:Fi(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function Hu({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`alert-description`,className:Fi(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function Uu(e){return sn(e.defaultTagName??`div`,e,e)}var Wu=zi(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Gu({className:e,variant:t=`default`,render:n,...r}){return Uu({defaultTagName:`span`,props:qt({className:Fi(Wu({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var Ku=W.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return sn(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),qu=`data-valid`,Ju=`data-invalid`,Yu={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Xu={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Zu={valid(e){return e===null?null:e?{[qu]:``}:{[Ju]:``}}},Qu={invalid:void 0,name:void 0,validityData:{state:Yu,errors:[],error:``,value:``,initialValue:null},setValidityData:yt,disabled:void 0,setTouched:yt,setDirty:yt,setFilled:yt,setFocused:yt,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Xu,registerFieldControl:yt,validation:{getValidationProps:(e,t=xt)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:yt,getInputControl:()=>null,commit:async()=>{},change:yt}},$u=W.createContext(Qu);function ed(e=!0){let t=W.useContext($u);if(t.setValidityData===yt&&!e)throw Error(Mt(28));return t}function td(e,t,n){let{setFocused:r,focusOwnerRef:i}=ed(),a=K(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function nd(e,t,n,r,i=!0,a){let{registerFieldControl:o}=ed(),s=mt(()=>Symbol());q(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var rd=W.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:yt,validationMode:`onSubmit`,submitCountRef:{current:0}});function id(){return W.useContext(rd)}var ad=W.createContext({controlId:void 0,registerControlId:yt,resetControlId:yt,labelId:void 0,setLabelId:yt,messageIds:[],setMessageIds:yt,getDescriptionProps:e=>e});function od(){return W.useContext(ad)}function sd(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=od(),o=yn(),s=mt(()=>Symbol()),c=W.useRef(!1),l=W.useRef(!1),u=K(()=>{!c.current||i===yt||(c.current=!1,i(s.current,void 0))});return q(()=>{if(!n||i===yt){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){u();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,u]),q(()=>u,[u]),(n?r:void 0)??t??o}function cd({className:e,...t}){return(0,G.jsx)(`textarea`,{"data-slot":`textarea`,className:Fi(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function ld(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var ud=W.createContext(void 0);function dd(){return W.useContext(ud)?.direction??`ltr`}function fd(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=W.useState(null),d=W.useRef(null),f=Gs(n),p=W.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=mu({...e,elements:{...p,...l&&{reference:l}}}),h=W.useCallback(e=>{let t=nr(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=W.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=W.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=W.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return q(()=>{o&&(d.current=o)},[o]),q(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),W.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var pd=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=_o(e,t)||{};if(l==null)return{};let d=Fo(u),f={x:n,y:r},p=Co(i),m=xo(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=go(D,k,O),j=!c.arrow&&yo(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),md=(e,t)=>{let{name:n,fn:r}=pd(e);return{name:n,fn:r,options:[e,t]}},hd={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},gd={sideX:`left`,sideY:`top`},_d=`--available-width`,vd=`--available-height`,yd=`--anchor-width`,bd=`--anchor-height`,xd=`--transform-origin`,Sd=_d,Cd=vd;function wd(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Td(e,t,n){let{rects:r,placement:i}=e;return{side:wd(t,vo(i),n),align:yo(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ed(e){return Dd(e,fd)}function Dd(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=K(O),A=O?k:n,j=Nr(n),M=Nr(g),N=dd()===`rtl`,[P,F]=W.useState(null);!g&&P!==null&&F(null);let I=x===`placement`,ee=P?vo(P):null,L=P&&I?yo(P)||`center`:null,R=ee||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],te=L||o,ne=te===`center`?R:`${R}-${te}`,z=l;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0};let re=+(i===`bottom`),B=+(i===`top`),V=+(i===`right`),ie=+(i===`left`),ae={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},H=W.useRef(null),U=Nr(a),oe=Nr(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,le=[];p&&le.push(p),le.push(hu(e=>{let t=Td(e,i,N),n=typeof U.current==`function`?U.current(t):U.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,N,i]));let ue=w===`none`&&C!==`shift`,de=!ue&&(u||E||C===`shift`),fe=C===`none`?null:vu({...ae,padding:{top:z.top+1+re,right:z.right+1+ie,bottom:z.bottom+1+B,left:z.left+1+V},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),pe=ue?null:gu({...ae,rootBoundary:D,mainAxis:w!==`none`,crossAxis:de,limiter:u||E?void 0:_u(e=>{if(!H.current)return{};let{width:t,height:n}=H.current.getBoundingClientRect(),r=So(vo(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[ae,u,E,D,z,w]);C===`shift`||w===`shift`||te===`center`?le.push(pe,fe):le.push(fe,pe),le.push(yu({...ae,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(Sd,`${t}px`),i.setProperty(Cd,`${n}px`);let a=$n(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(yd,`${u}px`),i.setProperty(bd,`${d}px`)}}),md(e=>({element:H.current||Tr(e.elements.floating).createElement(`div`),padding:H.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=vo(r),u=yo(r),d=So(l)===`y`,f=H.current,p=typeof a==`function`?a(Td(e,i,N)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return de&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(xd,d?`${m} ${h}`:`${h} ${m}`),{}}},hd,b),q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let me=W.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:he,elements:ge,x:_e,y:ve,middlewareData:ye,update:G,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:h,open:m?g:void 0,placement:ne,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...e)=>nu(...e,me),nodeId:y,externalTree:S}),{sideX:we,sideY:Te}=ye.adaptiveOrigin||gd,Ee=Se?r:`fixed`,De=W.useMemo(()=>{let e;return e=Se?b?{position:Ee,[we]:_e,[Te]:ve}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[Sd]=`100vw`,e[Cd]=`100vh`,Se||(e.opacity=0),e},[b,Ee,we,_e,Te,ve,Ce,Se]),Oe=W.useRef(null);q(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(Od(t)?t.current:t)||null;n!==Oe.current&&(he.setPositionReference(n),Oe.current=n)},[g,he,A,j]),W.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&Od(e)&&e.current!==Oe.current&&(he.setPositionReference(e.current),Oe.current=e.current)},[g,he,A,j]),W.useEffect(()=>{if(m&&g&&ge.reference&&ge.floating)return nu(ge.reference,ge.floating,G,me)},[m,g,ge,G,me]);let ke=vo(be),Ae=wd(i,ke,N),je=yo(be)||`center`,Me=!!ye.hide?.referenceHidden;q(()=>{x&&g&&Se&&(ke!==R||I&&je!==te)&&F(be)},[x,I,g,Se,be,ke,je,R,te]);let Ne=W.useMemo(()=>({position:`absolute`,top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Pe=ye.arrow?.centerOffset!==0;return W.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:H,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:he,context:xe,isPositioned:Se,update:G}),[De,Ne,H,Pe,Ae,je,ke,Me,he,xe,Se,G])}function Od(e){return e!=null&&`current`in e}function kd(e){return e===`starting`?As:xt}function Ad(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),sn(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},kd(r),i],stateAttributesMapping:Ha})}var jd=20;function Md(e,t,n,r){let[i,a]=W.useState(!1);q(()=>{if(!e||!t||n==null){a(!1);return}let r=Tr(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-jd)},[e,t,n]),fa(e&&(!t||i),r)}var Nd=W.createContext(void 0);function Pd(e){let t=W.useContext(Nd);if(t===void 0&&!e)throw Error(Mt(69));return t}function Fd(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=W.useRef(null),o=W.useRef(null),s=Br(r);q(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),q(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function Id(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Cr(),{ref:i,index:a}=Gn(e),o=n===a,s=W.useRef(null),c=Nt(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Ld(e){let{render:t,className:n,style:r,state:i=xt,props:a=bt,refs:o=bt,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Id({metadata:s});return sn(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function Rd(e,t){function n(n,r,i){let a=n.currentTarget;Fr.flushSync(()=>{e.setOpen(!1,bn(kn,n.nativeEvent,a))}),us(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&ds(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function zd(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function Bd({className:e,...t}){return(0,G.jsx)(`label`,{"data-slot":`label`,className:Fi(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var Vd=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Hd=/^[\\/]{2}/;function Ud(e,t){return t+e.replace(/\\/g,`/`)}var Wd=`popstate`;function Gd(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Kd(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Xd(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Zd(t)}return $d(t,n,null,e)}function X(e,t){if(e===!1||e==null)throw Error(t)}function qd(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Jd(){return Math.random().toString(36).substring(2,10)}function Yd(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Xd(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Qd(t):t,state:n,key:t&&t.key||r||Jd(),mask:i}}function Zd({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Qd(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function $d(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Gd(e)?e:Xd(h.location,e,t);n&&n(r,e),l=u()+1;let d=Yd(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Gd(e)?e:Xd(h.location,e,t);n&&n(r,e),l=u();let i=Yd(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ef(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Wd,d),c=e,()=>{i.removeEventListener(Wd,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ef(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),X(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Zd(t);return i=i.replace(/ $/,`%20`),!n&&Hd.test(i)&&(i=r+i),new URL(i,r)}var tf=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},nf=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function rf(e){return nf.has(e)}var af=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function of(e){return af.has(e)}function sf(e){return e.index===!0}function cf(e){let t={};return e.Component&&Object.assign(t,{element:W.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:W.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:W.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function lf(e,t=cf,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(X(e.index!==!0||!e.children,`Cannot specify children on an index route`),X(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),sf(e)){let n={...e,id:s};return r[s]=uf(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=uf(n,t(n)),e.children&&(n.children=lf(e.children,t,o,r,i)),n}})}function uf(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function df(e,t,n=`/`){return ff(e,t,n,!1)}function ff(e,t,n,r,i){let a=Ff((typeof t==`string`?Qd(t):t).pathname||`/`,n);if(a==null)return null;let o=i??mf(e),s=null,c=Pf(a);for(let e=0;s==null&&e<o.length;++e)s=kf(o[e],c,r);return s}function pf(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function mf(e){let t=hf(e);return _f(t),t}function hf(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;X(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Gf([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(X(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),hf(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Df(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Nf(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of gf(e.path))a(e,t,!0,n)}),t}function gf(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=gf(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function _f(e){e.sort((e,t)=>e.score===t.score?Of(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var vf=/^:[\w-]+$/,yf=/^:[\w-]+/,bf=3.5,xf=3,Sf=2,Cf=1,wf=10,Tf=-2,Ef=e=>e===`*`;function Df(e,t){let n=e.split(`/`),r=n.length;return n.some(Ef)&&(r+=Tf),t&&(r+=Sf),n.filter(e=>!Ef(e)).reduce((e,t)=>e+(vf.test(t)?xf:yf.test(t)?bf:t===``?Cf:wf),r)}function Of(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function kf(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Mf(u,l,s.matcher,s.compiledParams):jf(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=jf({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Gf([a,d.pathname]),pathnameBase:qf(Gf([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Gf([a,d.pathnameBase]))}return o}function Af(e,t={}){let n=e;n.endsWith(`*`)&&n!==`*`&&!n.endsWith(`/*`)&&(qd(!1,`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,`/*`)}".`),n=n.replace(/\*$/,`/*`));let r=n.startsWith(`/`)?`/`:``,i=e=>e==null?``:typeof e==`string`?e:String(e);return r+n.split(/\/+/).map((e,n,r)=>{if(n===r.length-1&&e===`*`)return i(t[`*`]);let a=e.match(/^:([\w-]+)(\??)(.*)/);if(a){let[,e,n,r]=a,o=t[e];return X(n===`?`||o!=null,`Missing ":${e}" param`),encodeURIComponent(i(o))+r}return e.replace(/\?$/g,``)}).filter(e=>!!e).join(`/`)}function jf(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Nf(e.path,e.caseSensitive,e.end);return Mf(e,t,n,r)}function Mf(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Nf(e,t=!1,n=!0){qd(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Pf(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return qd(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ff(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function If({basename:e,pathname:t}){return t===`/`?e:Gf([e,t])}var Lf=e=>Vd.test(e);function Rf(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Qd(e):e,a;return n?(n=Wf(n),a=n.startsWith(`/`)?zf(n.substring(1),`/`):zf(n,t)):a=t,{pathname:a,search:Jf(r),hash:Yf(i)}}function zf(e,t){let n=Kf(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Bf(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Vf(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Hf(e){let t=Vf(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Uf(e,t,n,r=!1){let i;typeof e==`string`?i=Qd(e):(i={...e},X(!i.pathname||!i.pathname.includes(`?`),Bf(`?`,`pathname`,`search`,i)),X(!i.pathname||!i.pathname.includes(`#`),Bf(`#`,`pathname`,`hash`,i)),X(!i.search||!i.search.includes(`#`),Bf(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Rf(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Wf=e=>e.replace(/[\\/]{2,}/g,`/`),Gf=e=>Wf(e.join(`/`)),Kf=e=>e.replace(/\/+$/,``),qf=e=>Kf(e).replace(/^\/*/,`/`),Jf=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Yf=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Xf=(e,t=302)=>{let n=t;typeof n==`number`?n={status:n}:n.status===void 0&&(n.status=302);let r=new Headers(n.headers);return r.set(`Location`,e),new Response(null,{...n,headers:r})},Zf=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Qf=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function $f(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ep(e){return Gf(e.map(e=>e.route.path).filter(Boolean))||`/`}function tp(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?Qd(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var np=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function rp(e,t){let n=e;if(typeof n!=`string`||!Vd.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(np)try{let e=new URL(window.location.href),r=Hd.test(n)?new URL(Ud(n,e.protocol)):new URL(n),a=Ff(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{qd(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var ip=Symbol(`Uninstrumented`),ap=new WeakMap;function op(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>fp(await pp(n.lazy,void 0,()=>e(...t),mp))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>fp(await pp(n[`lazy.middleware`],void 0,()=>t(...e),mp))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>fp(await pp(n[`lazy.loader`],void 0,()=>t(...e),mp))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>fp(await pp(n[`lazy.action`],void 0,()=>t(...e),mp))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=cp(t.loader),i=async(...t)=>fp(await pp(n.loader,hp(t[0]),()=>e(...t),mp));e.hydrate===!0&&(i.hydrate=!0),lp(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=cp(t.action),i=async(...t)=>fp(await pp(n.action,hp(t[0]),()=>e(...t),mp));lp(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=cp(e),r=async(...e)=>fp(await pp(n.middleware,hp(e[0]),()=>t(...e),mp));return lp(r,t),r})),r}function sp(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=cp(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?Zd(i):`.`,...gp(e,a??{})};return fp(await pp(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=up(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...mp(e),meta:o})))};lp(r,t),e.navigate=r}if(n.fetch.length>0){let t=cp(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return fp(await pp(n.fetch,{href:o??`.`,fetcherKey:i,...gp(e,s??{})},async()=>{let n=up(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...mp(e),meta:c})))};lp(r,t),e.fetch=r}return e}function cp(e){return e[ip]??e}function lp(e,t){e[ip]=t}function up(e,t){return ap.set(e,t),()=>{ap.get(e)===t&&ap.delete(e)}}function dp(e){let t=ap.get(e);return ap.delete(e),t}function fp(e){if(e.type===`error`)throw e.value;return e.value}async function pp(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=pp(e,t,n,r,i,a-1),await s,X(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result?i.result:(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t),i.result)}function mp(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function hp(e){let{request:t,context:n,params:r}=e;return{...e,request:_p(t),params:{...r},context:vp(n)}}function gp(e,t){return{currentUrl:Zd(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function _p(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function vp(e){return{get:t=>e.get(t)}}var yp=[`POST`,`PUT`,`PATCH`,`DELETE`],bp=new Set(yp),xp=[`GET`,...yp],Sp=new Set(xp),Cp=new Set([301,302,303,307,308]),wp=new Set([307,308]),Tp={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ep={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Dp={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Op=`remix-router-transitions`,kp=Symbol(`ResetLoaderData`),Ap=class{#e;#t;#n;#r;constructor(e){this.#e=e,this.#t=mf(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#n??this.#e}get branches(){return this.#r??this.#t}get hasHMRRoutes(){return this.#n!=null}setRoutes(e){this.#e=e,this.#t=mf(e)}setHmrRoutes(e){this.#n=e,this.#r=mf(e)}commitHmrRoutes(){this.#n&&(this.#e=this.#n,this.#t=this.#r,this.#n=void 0,this.#r=void 0)}};function jp(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;X(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...op(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Ap(lf(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Jp,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=ff(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=vm(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=_m(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Re(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Re(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>Ip(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=Lp(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:Tp,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,D=!1,O,k=!1,A=new Map,j=null,M=!1,N=!1,P=new Set,F=new Map,I=0,ee=-1,L=new Map,R=new Set,te=new Map,ne=new Map,z=new Set,re=new Map,B,V=null;function ie(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(B){B(),B=void 0;return}qd(re.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Me({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{B=e});e.history.go(r*-1),je(i,{state:`blocked`,location:n,proceed(){je(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,Dp),U({blockers:e})}}),E?.resolve(),E=null;return}return le(t,n)}),n){Um(t,A);let e=()=>Wm(t,A);t.addEventListener(`pagehide`,e),j=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||le(`POP`,w.location,{initialHydration:!0}),C}function ae(){d&&d(),j&&j(),f.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>Ce(w.fetchers,t)),w.blockers.forEach((e,t)=>Ae(t))}function H(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(w,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function U(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(z.has(t)?n.push(t):r.push(t))}),z.forEach(e=>{!w.fetchers.has(e)&&!F.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ce(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function oe(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&Nm(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?mm(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&!M&&(c=new Map(c),c.forEach((e,t)=>c.set(t,Dp)));let l=!M&&Le(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&Nm(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),M||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`){let e=A.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:A.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(k){let e=A.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}U({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:Tp,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,D=!1,k=!1,M=!1,N=!1,E?.resolve(),E=null,V?.resolve(),V=null}async function se(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=Gm();let n=E.promise;return e.history.go(t),n}let r=dp(C),{path:i,submission:a,error:o}=Pp(!1,Np(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),s;n?.mask&&(s={pathname:``,search:``,hash:``,...typeof n.mask==`string`?Qd(n.mask):{...w.location.mask,...n.mask}});let l=w.location,u=Xd(l,i,n&&n.state,void 0,s);u={...u,...e.history.encodeLocation(u)};let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||a!=null&&Nm(a.formMethod)&&a.formAction===w.location.pathname+w.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=Me({currentLocation:l,nextLocation:u,historyAction:f});if(h){je(h,{state:`blocked`,location:u,proceed(){je(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),se(t,n)},reset(){let e=new Map(w.blockers);e.set(h,Dp),U({blockers:e})}});return}await le(f,u,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function ce(){V||=Gm(),W(),U({revalidation:`loading`});let e=V.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(le(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(le(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function le(t,n,r){O&&O.abort(),O=null,T=t,M=(r&&r.startUninterruptedRevalidation)===!0,Ie(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:ff(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!N&&xm(w.location,n)&&!(r&&r.submission&&Nm(r.submission.formMethod))){oe(n,{matches:a},{flushSync:o});return}let l=Re(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),r?.instrumentationNavigateMetaReceiver){let t=Im(e.history,n,a);r.instrumentationNavigateMetaReceiver(t)}if(!a){let{error:e,notFoundMatches:t,route:r}=Ne(n.pathname);oe(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;O=new AbortController;let d=lm(e.history,n,O.signal,r&&r.submission),f=e.getContext?await e.getContext():new tf,p;if(r&&r.pendingError)p=[gm(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Nm(r.submission.formMethod)){let i=await ue(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Em(t)&&$f(t.error)&&t.error.status===404){O=null,oe(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=Rm(n,a,t,r.submission),o=!1,l.active=!1,d=lm(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await de(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(O=null,oe(n,{matches:h||a,...hm(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function ue(t,n,i,l,u,d,f,p,m={}){if(W(),U({navigation:zm(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await ze(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=_m(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=gm(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Ne(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=Fm(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:vm(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await ve(t,n,em(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Dm(h)){let n;return n=m&&m.replace!=null?m.replace:cm(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await _e(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Em(h)){let e=gm(l,g.route.id);return(m&&m.replace)!==!0&&(T=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function de(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||Rm(n,i,l,p),x=p||m||Lm(b),S=!M&&!g;if(d){if(S){let e=fe(v);U({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ze(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=_m(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=gm(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Ne(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=Fp(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,N,P,z,te,R,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(ee=++I,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(w.fetchers),t=De(e);return oe(n,{matches:i,loaderData:{},errors:v&&Em(v[1])?{[v[0]]:v[1].error}:null,...hm(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=fe(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=pe(E)),U(e,{flushSync:_})}E.forEach(e=>{Te(e.key),e.controller&&F.set(e.key,e.controller)});let D=()=>E.forEach(e=>Te(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await ye(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>F.delete(e.key));let j=ym(k);if(j)return await _e(t,j.result,!0,{replace:h}),{shortCircuited:!0};if(j=ym(A),j)return R.add(j.key),await _e(t,j.result,!0,{replace:h}),{shortCircuited:!0};let L=new Map(w.fetchers),{loaderData:ne,errors:re}=pm(w,i,k,v,E,A,L);g&&w.errors&&(re={...w.errors,...re});let B=De(L),V=Oe(ee,L),ie=B||V||E.length>0;return{matches:i,loaderData:ne,errors:re,...ie?{workingFetchers:L}:{}}}function fe(e){if(e&&!Em(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function pe(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Bm(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function me(t,n,r,i){Te(t);let a=(i&&i.flushSync)===!0,o=dp(C),l=s.activeRoutes,u=Np(w.location,w.matches,c,r,n,i?.relative),d=ff(l,u,c,!1,s.branches),f=Re(d,l,u);if(f.active&&f.matches&&(d=f.matches),o&&o(Im(e.history,u,d)),!d){be(t,n,vm(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=Pp(!0,u,i);if(h){be(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new tf,_=(i&&i.preventScrollReset)===!0;if(m&&Nm(m.formMethod)){await he(t,n,p,d,g,f.active,a,_,m,i&&i.defaultShouldRevalidate);return}te.set(t,{routeId:n,path:p}),await ge(t,n,p,d,g,f.active,a,_,m)}async function he(t,n,i,l,u,d,f,p,m,h){W(),te.delete(t),G(t,Vm(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=lm(e.history,i,g.signal,m);if(d){let e=await ze(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){be(t,n,e.error,{flushSync:f});return}else if(e.matches)l=e.matches;else{be(t,n,vm(404,{pathname:i}),{flushSync:f});return}}let v=Fm(l,i);if(!v.route.action&&!v.route.lazy){be(t,n,vm(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}F.set(t,g);let y=I,b=em(a,o,_,i,l,v,r,u),x=await ve(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){F.get(t)===g&&F.delete(t);return}if(z.has(t)){if(Dm(S)||Em(S)){G(t,Hm(void 0));return}}else{if(Dm(S))if(F.delete(t),ee>y){G(t,Hm(void 0));return}else return R.add(t),G(t,Bm(m)),_e(_,S,!1,{fetcherSubmission:m,preventScrollReset:p});if(Em(S)){be(t,n,S.error);return}}let C=w.navigation.location||w.location,E=lm(e.history,C,g.signal),D=s.activeRoutes,k=w.navigation.state===`idle`?w.matches:ff(D,w.navigation.location,c,!1,s.branches);X(k,`Didn't find any matches after fetcher action`);let A=++I;L.set(t,A);let{dsMatches:j,revalidatingFetchers:M}=Fp(E,u,a,o,e.history,w,k,m,C,r,!1,N,P,z,te,R,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),ne=Bm(m,S.data),re=new Map(w.fetchers);re.set(t,ne),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=re.get(t),r=Bm(void 0,n?n.data:void 0);re.set(t,r),Te(t),e.controller&&F.set(t,e.controller)}),U({fetchers:re});let B=()=>M.forEach(e=>Te(e.key));g.signal.addEventListener(`abort`,B);let{loaderResults:V,fetcherResults:ie}=await ye(j,M,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,B),L.delete(t),F.delete(t),M.forEach(e=>F.delete(e.key));let ae=w.fetchers.has(t),H=e=>{if(!ae)return e;let n=new Map(e.fetchers);return n.set(t,Hm(S.data)),{...e,fetchers:n}},se=ym(V);if(se)return w=H(w),_e(E,se.result,!1,{preventScrollReset:p});if(se=ym(ie),se)return R.add(se.key),w=H(w),_e(E,se.result,!1,{preventScrollReset:p});let ce=new Map(w.fetchers);ae&&ce.set(t,Hm(S.data));let{loaderData:le,errors:ue}=pm(w,k,V,void 0,M,ie,ce);Oe(A,ce),w.navigation.state===`loading`&&A>ee?(X(T,`Expected pending action`),O&&O.abort(),oe(w.navigation.location,{matches:k,loaderData:le,errors:ue,fetchers:ce})):(U({errors:ue,loaderData:mm(w.loaderData,le,k,ue),fetchers:ce}),N=!1)}async function ge(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);G(t,Bm(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=lm(e.history,i,m.signal);if(l){let e=await ze(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){be(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{be(t,n,vm(404,{pathname:i}),{flushSync:u});return}}let g=Fm(s,i);F.set(t,m);let _=I,v=await ve(h,i,em(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(F.get(t)===m&&F.delete(t),!h.signal.aborted){if(z.has(t)){G(t,Hm(void 0));return}if(Dm(y))if(ee>_){G(t,Hm(void 0));return}else{R.add(t),await _e(h,y,!1,{preventScrollReset:d});return}if(Em(y)){be(t,n,y.error);return}G(t,Hm(y.data))}}async function _e(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(N=!0);let d=i.response.headers.get(`Location`);X(d,`Expected a Location header on the redirect Response`),d=cm(d,new URL(r.url),c,e.history);let f=Xd(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Lf(d)){let n=ef(t,d,!0);e=n.origin!==t.location.origin||Ff(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=w.navigation;!o&&!s&&m&&h&&g&&(o=Lm(w.navigation));let _=o||s;wp.has(i.response.status)&&_&&Nm(_.formMethod)?await le(p,f,{submission:{..._,formAction:d},preventScrollReset:l||D,enableViewTransition:a?k:void 0}):await le(p,f,{overrideNavigation:Rm(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?k:void 0})}async function ve(e,t,n,r,i){let a,o={};try{a=await tm(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Nm(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(Tm(r)){let i=r.result;o[t]={type:`redirect`,response:am(i,e,t,n,c)}}else o[t]=await im(r);return o}async function ye(e,t,n,r,i){let a=ve(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ve(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:vm(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function W(){N=!0,te.forEach((e,t)=>{F.has(t)&&P.add(t),Te(t)})}function G(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),U({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function be(e,t,n,r={}){let i=gm(w.matches,t),a=new Map(w.fetchers);Ce(a,e),U({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function xe(e){return ne.set(e,(ne.get(e)||0)+1),z.has(e)&&z.delete(e),w.fetchers.get(e)||Ep}function Se(e,t){Te(e,t?.reason),G(e,Hm(null))}function Ce(e,t){let n=w.fetchers.get(t);F.has(t)&&!(n&&n.state===`loading`&&L.has(t))&&Te(t),te.delete(t),L.delete(t),R.delete(t),z.delete(t),P.delete(t),e.delete(t)}function we(e){let t=(ne.get(e)||0)-1;t<=0?(ne.delete(e),z.add(e)):ne.set(e,t),U({fetchers:new Map(w.fetchers)})}function Te(e,t){let n=F.get(e);n&&(n.abort(t),F.delete(e))}function Ee(e,t){for(let n of e){let e=t.get(n);X(e,`Expected fetcher: ${n}`);let r=Hm(e.data);t.set(n,r)}}function De(e){let t=[],n=!1;for(let r of R){let i=e.get(r);X(i,`Expected fetcher: ${r}`),i.state===`loading`&&(R.delete(r),t.push(r),n=!0)}return Ee(t,e),n}function Oe(e,t){let n=[];for(let[r,i]of L)if(i<e){let e=t.get(r);X(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Te(r),L.delete(r),n.push(r))}return Ee(n,t),n.length>0}function ke(e,t){let n=w.blockers.get(e)||Dp;return re.get(e)!==t&&re.set(e,t),n}function Ae(e){w.blockers.delete(e),re.delete(e)}function je(e,t){let n=w.blockers.get(e)||Dp;X(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),U({blockers:r})}function Me({currentLocation:e,nextLocation:t,historyAction:n}){if(re.size===0)return;re.size>1&&qd(!1,`A router only supports one blocker at a time`);let r=Array.from(re.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Ne(e){let t=vm(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=_m(n);return{notFoundMatches:r,route:i,error:t}}function Pe(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===Tp){_=!0;let e=Le(w.location,w.matches);e!=null&&U({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Fe(e,t){return h&&h(e,t.map(e=>pf(e,w.loaderData)))||e.key}function Ie(e,t){if(m&&g){let n=Fe(e,t);m[n]=g()}}function Le(e,t){if(m){let n=Fe(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Re(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:ff(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:ff(n,r,c,!0,e)}}return{active:!1,matches:null}}async function ze(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||Vp(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=ff(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=ff(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&Be(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=ff(s.activeRoutes,n,c,!0,u),!f||Be(l,f))return{type:`success`,matches:null};l=f}}function Be(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Ve(e){o={},s.setHmrRoutes(lf(e,a,void 0,o))}function He(e,t,n=!1){Vp(e,t,s,o,a,n),s.hasHMRRoutes||U({})}return C={get basename(){return c},get future(){return u},get state(){return w},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:ie,subscribe:H,enableScrollRestoration:Pe,navigate:se,fetch:me,revalidate:ce,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:xe,resetFetcher:Se,deleteFetcher:we,dispose:ae,getBlocker:ke,deleteBlocker:Ae,patchRoutes:He,_internalFetchControllers:F,_internalSetRoutes:Ve,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){U(e)}},e.instrumentations&&(C=sp(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Mp(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Np(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Uf(r||`.`,Hf(o),Ff(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Pm(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=If({basename:n,pathname:c.pathname})),Zd(c)}function Pp(e,t,n){if(!n||!Mp(n))return{path:t};if(n.formMethod&&!Mm(n.formMethod))return{path:t,error:vm(405,{method:n.formMethod})};let r=()=>({path:t,error:vm(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=bm(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Nm(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!Nm(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}X(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=um(n.formData),s=n.formData;else if(n.body instanceof FormData)o=um(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=dm(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=dm(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Nm(c.formMethod))return{path:t,submission:c};let l=Qd(t);return e&&l.search&&Pm(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Zd(l),submission:c}}function Fp(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Em(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&Em(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=ep(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!Ip(s))f=!1;else if(u){let{shouldLoad:e}=Lp(s,a.loaderData,a.errors);f=e}else Rp(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return $p(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?zp(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return $p(n,r,e,c,k,i,l,t,Bp(i,m),m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=ff(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=Fm(b,e.path),C=new AbortController,w=lm(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=em(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=em(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};Bp(S,a)&&(T=em(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function Ip(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Lp(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Ip(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Rp(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function zp(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Bp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Vp(e,t,n,r,i,a){let o;if(e){let t=r[e];X(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Hp(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=lf(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=lf([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function Hp(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>Hp(e,t)))??!1:!1}var Up=new WeakMap,Wp=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(X(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Up.get(i);o||(o={},Up.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=rf(e),n=i[e]!==void 0;if(t)qd(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)qd(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Gp=new WeakMap;function Kp(e,t,n,r,i){let a=n[e.id];if(X(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Gp.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{X(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=of(e),o=a[e]!==void 0;i?qd(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?qd(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Gp.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=Wp({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function qp(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Jp(e){return e.matches.some(e=>e.route.middleware)?Yp(e,()=>qp(e)):qp(e)}function Yp(e,t){return Xp(e,t,e=>{if(jm(e))throw e;return e},Cm,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[gm(r,a).route.id]:{type:`error`,result:t}}}}}async function Xp(e,t,n,r,i){let{matches:a,...o}=e;return await Zp(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Zp(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Zp(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Qp(e,t,n,r,i){let a=Wp({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Kp(r.route,Nm(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function $p(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Qp(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Bp(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Bp(a,{...l,defaultShouldRevalidate:e}):Bp(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Nm(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Nm(n.method)||!p)?nm({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function em(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?$p(e,t,n,r,ep(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Qp(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function tm(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:tp(t,n),pattern:ep(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Yp(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function nm({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Nm(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:tp(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw vm(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw vm(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function rm(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function im(e){let{result:t,type:n}=e;if(km(t)){let e;try{e=await rm(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Qf(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Om(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Sm(t),statusCode:$f(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:$f(t)?t.status:void 0}:Om(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function am(e,t,n,r,i){let a=e.headers.get(`Location`);if(X(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Lf(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Np(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var om=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function sm(e){try{return om.includes(new URL(e).protocol)}catch{return!1}}function cm(e,t,n,r){if(Lf(e)){let r=e,i=Hd.test(r)?new URL(Ud(r,t.protocol)):new URL(r);if(sm(i.toString()))throw Error(`Invalid redirect location`);let a=Ff(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Wf(i.pathname)+i.search+i.hash}try{if(sm(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function lm(e,t,n,r){let i=e.createURL(bm(t)).toString(),a={signal:n};if(r&&Nm(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=um(r.formData):a.body=r.formData}return new Request(i,a)}function um(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function dm(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function fm(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Em(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(X(!Dm(f),`Cannot handle redirect results in processLoaderData`),Em(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=gm(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=kp),c||(c=!0,s=$f(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function pm(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=fm(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(X(s,`Did not find corresponding fetcher result`),Em(s)){let t=gm(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Dm(s))X(!1,`Unhandled fetcher revalidation redirect`);else{let e=Hm(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function mm(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==kp).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function hm(e){return e?Em(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function gm(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function _m(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function vm(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Qf(e||500,o,Error(s),!0)}function ym(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Dm(r))return{key:n,result:r}}}function bm(e){return Zd({...typeof e==`string`?Qd(e):e,hash:``})}function xm(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Sm(e){return new Qf(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Cm(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&wm(t))}function wm(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Tm(e){return km(e.result)&&Cp.has(e.result.status)}function Em(e){return e.type===`error`}function Dm(e){return(e&&e.type)===`redirect`}function Om(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function km(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Am(e){return Cp.has(e)}function jm(e){return km(e)&&Am(e.status)&&e.headers.has(`Location`)}function Mm(e){return Sp.has(e.toUpperCase())}function Nm(e){return bp.has(e.toUpperCase())}function Pm(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Fm(e,t){let n=typeof t==`string`?Qd(t).search:t.search;if(e[e.length-1].route.index&&Pm(n||``))return e[e.length-1];let r=Vf(e);return r[r.length-1]}function Im(e,t,n){return{url:tp(e.createURL(t),t),pattern:n?ep(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function Lm(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Rm(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function zm(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Bm(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Vm(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Hm(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Um(e,t){try{let n=e.sessionStorage.getItem(Op);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function Wm(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Op,JSON.stringify(n))}catch(e){qd(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Gm(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Km=W.createContext(null);Km.displayName=`DataRouter`;var qm=W.createContext(null);qm.displayName=`DataRouterState`;var Jm=W.createContext(!1);function Ym(){return W.useContext(Jm)}var Xm=W.createContext({isTransitioning:!1});Xm.displayName=`ViewTransition`;var Zm=W.createContext(new Map);Zm.displayName=`Fetchers`;var Qm=W.createContext(null);Qm.displayName=`Await`;var $m=W.createContext(null);$m.displayName=`Navigation`;var eh=W.createContext(null);eh.displayName=`Location`;var th=W.createContext({outlet:null,matches:[],isDataRoute:!1});th.displayName=`Route`;var nh=W.createContext(null);nh.displayName=`RouteError`;var rh=`REACT_ROUTER_ERROR`,ih=`REDIRECT`,ah=`ROUTE_ERROR_RESPONSE`;function oh(e){if(e.startsWith(`${rh}:${ih}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function sh(e){if(e.startsWith(`${rh}:${ah}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Qf(t.status,t.statusText,t.data)}catch{}}function ch(e,{relative:t}={}){X(lh(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=W.useContext($m),{hash:i,pathname:a,search:o}=_h(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Gf([n,a])),r.createHref({pathname:s,search:o,hash:i})}function lh(){return W.useContext(eh)!=null}function uh(){return X(lh(),`useLocation() may be used only in the context of a <Router> component.`),W.useContext(eh).location}var dh=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function fh(){let{isDataRoute:e}=W.useContext(th);return e?Lh():ph()}function ph(){X(lh(),`useNavigate() may be used only in the context of a <Router> component.`);let e=W.useContext(Km),{basename:t,navigator:n}=W.useContext($m),{matches:r}=W.useContext(th),{pathname:i}=uh(),a=JSON.stringify(Hf(r)),o=W.useRef(!1);return W.useLayoutEffect(()=>{o.current=!0}),W.useCallback((r,s={})=>{if(qd(o.current,dh),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Uf(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Gf([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var mh=W.createContext(null);function hh(e){let t=W.useContext(th).outlet;return W.useMemo(()=>t&&W.createElement(mh.Provider,{value:e},t),[t,e])}function gh(){let{matches:e}=W.useContext(th);return e[e.length-1]?.params??{}}function _h(e,{relative:t}={}){let{matches:n}=W.useContext(th),{pathname:r}=uh(),i=JSON.stringify(Hf(n));return W.useMemo(()=>Uf(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function vh(e,t,n){X(lh(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=W.useContext($m),{matches:i}=W.useContext(th),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=uh(),l;if(t){let e=typeof t==`string`?Qd(t):t;X(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):df(e,{pathname:d}),p=Th(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Gf([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:Gf([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?W.createElement(eh.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function yh(){let e=Ih(),t=$f(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return W.createElement(W.Fragment,null,W.createElement(`h2`,null,`Unexpected Application Error!`),W.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?W.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var bh=W.createElement(yh,null),xh=class extends W.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=Jm;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=sh(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:W.createElement(th.Provider,{value:this.props.routeContext},W.createElement(nh.Provider,{value:e,children:this.props.component}));return this.context?W.createElement(Ch,{error:e},t):t}},Sh=new WeakMap;function Ch({children:e,error:t}){let{basename:n}=W.useContext($m);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=oh(t.digest);if(e){let r=Sh.get(t);if(r)throw r;let i=rp(e.location,n),a=i.absoluteURL||i.to;if(sm(a))throw Error(`Invalid redirect location`);if(np&&!Sh.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Sh.set(t,n),n}return W.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function wh({routeContext:e,match:t,children:n}){let r=W.useContext(Km);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),W.createElement(th.Provider,{value:e},n)}function Th(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);X(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:ep(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||bh,o&&(s<0&&c===0?(zh(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?W.createElement(n.route.Component,null):n.route.element?n.route.element:e,W.createElement(wh,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?W.createElement(xh,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Eh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Dh(e){let t=W.useContext(Km);return X(t,Eh(e)),t}function Oh(e){let t=W.useContext(qm);return X(t,Eh(e)),t}function kh(e){let t=W.useContext(th);return X(t,Eh(e)),t}function Ah(e){let t=kh(e),n=t.matches[t.matches.length-1];return X(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function jh(){return Ah(`useRouteId`)}function Mh(){let e=Oh(`useNavigation`);return W.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Nh(){let e=Dh(`useRevalidator`),t=Oh(`useRevalidator`),n=W.useCallback(async()=>{await e.router.revalidate()},[e.router]);return W.useMemo(()=>({revalidate:n,state:t.revalidation}),[n,t.revalidation])}function Ph(){let{matches:e,loaderData:t}=Oh(`useMatches`);return W.useMemo(()=>e.map(e=>pf(e,t)),[e,t])}function Fh(){let e=Oh(`useLoaderData`),t=Ah(`useLoaderData`);return e.loaderData[t]}function Ih(){let e=W.useContext(nh),t=Oh(`useRouteError`),n=Ah(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Lh(){let{router:e}=Dh(`useNavigate`),t=Ah(`useNavigate`),n=W.useRef(!1);return W.useLayoutEffect(()=>{n.current=!0}),W.useCallback(async(r,i={})=>{qd(n.current,dh),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Rh={};function zh(e,t,n){!t&&!Rh[e]&&(Rh[e]=!0,qd(!1,n))}function Bh(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Vh(e,t=`|`){return e.map(e=>mg(e)).join(t)}function Hh(e,t){return typeof t==`bigint`?t.toString():t}var Uh=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Wh(e){return new Uh(e)}function Gh(e){return e==null}function Kh(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function qh(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Jh=Symbol(`evaluating`);function Yh(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Jh)return r===void 0&&(r=Jh,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Xh(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Zh(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function Qh(e){return Zh(e._zod.def)??e._zod.def.shape}function $h(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Xh(this,t,e),e},enumerable:!0,configurable:!0})}function eg(e,t,n){t in e?Xh(e,t,n):e[t]=n}function tg(e,t,n,r){let i=Qh(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?$h(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):eg(e,a,r?r(n.value,a):n.value))}}function ng(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?$h(e,n,()=>t[n]):eg(e,n,r.value))}}function rg(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ig(e){return JSON.stringify(e)}function ag(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var og=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function sg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var cg=Wh(()=>{if(i_.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function lg(e){if(sg(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(sg(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ug(e){return lg(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var dg=new Set([`string`,`number`,`symbol`]);function fg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function pg(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Z(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function mg(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function hg(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var gg={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},_g={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function vg(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return tg(i,e,yg(e,t)),pg(e,rg(n,{shape:i,checks:[]}))}function yg(e,t){let n=Qh(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function bg(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(yg(e,t)),a={};return tg(a,e,Reflect.ownKeys(Qh(e)).filter(e=>!i.has(e))),pg(e,rg(n,{shape:a,checks:[]}))}function xg(e,t){if(!lg(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Qh(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return pg(e,rg(e._zod.def,{shape:Sg(e,t)}))}function Sg(e,t){let n={};return tg(n,e,Reflect.ownKeys(Qh(e))),ng(n,t),n}function Cg(e,t){if(!lg(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return pg(e,rg(e._zod.def,{shape:Sg(e,t)}))}function wg(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return tg(n,e,Reflect.ownKeys(Qh(e))),tg(n,t,Reflect.ownKeys(Qh(t))),pg(e,rg(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Tg(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(yg(t,n)):void 0,o={};return tg(o,t,Reflect.ownKeys(Qh(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),pg(t,rg(t._zod.def,{shape:o,checks:[]}))}function Eg(e,t,n){let r=n?new Set(yg(t,n)):void 0,i={};return tg(i,t,Reflect.ownKeys(Qh(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),pg(t,rg(t._zod.def,{shape:i}))}function Dg(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Og(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function kg(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ag(e){return typeof e==`string`?e:e?.message}function jg(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Mg(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Ng(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Ag(e.inst?._zod.def?.error?.(e))??Ag(a?.(e))??Ag(t?.error?.(e))??Ag(n.customError?.(e))??Ag(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t===`inst`||t===`schema`||t===`continue`||t===`input`||t===`__proto__`||(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Pg=/[\uD800-\uDBFF]/;function Fg(e){let t=e.length;if(!Pg.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Ig(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Lg(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Rg(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function zg(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ug(e,n,r.value)}}function Bg(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Vg(e,t,n){return Bg(e,t,n,!1)}function Hg(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Bg(this,n,r(this))},set(e){Bg(this,n,e)}})}return t}function Ug(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Bg(this,t,n.bind(this))},set(e){Bg(this,t,e)}})}function Wg(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Gg,Kg=!1,qg={configurable:!0,get(){Kg=!0}};function Q(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Gg!==e._zod){Gg=void 0;return}Gg=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,qg);let e=Kg;Kg=!1;try{let r=n(this);return Kg?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Kg||=e,r}catch(n){throw delete this[t],Kg||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Jg(e,t,n,r){let i=Wg(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Yg=`~constantCatch`;function Xg(e){let t=()=>e;return t[Yg]=!0,t}var Zg,Qg=Object.freeze({status:`aborted`}),$g={value:void 0,enumerable:!1},e_=`captureStackTrace`in Error?Error:null;function t_(e){let t=e_;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return e_=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function $(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){$g.value=new a(r);try{Object.defineProperty(n,"_zod",$g)}finally{$g.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),zg(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?t_(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var n_=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},r_=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Zg=globalThis).__zod_globalConfig??(Zg.__zod_globalConfig={});var i_=globalThis.__zod_globalConfig;function a_(e){return e&&Object.assign(i_,e),i_}function o_(){let e=this._zod;return e.message??=JSON.stringify(e.def,Hh,2),e.message}function s_(e){this._zod.message=e}var c_={get:o_,set:s_,enumerable:!0,configurable:!0},l_={value:void 0,enumerable:!1},u_=new WeakSet([Object.prototype,Error.prototype]),d_=(e,t)=>{e.name=`$ZodError`,l_.value=t,Object.defineProperty(e,"issues",l_),l_.value=void 0,Object.defineProperty(e,"message",c_);let n=Object.getPrototypeOf(e);u_.has(n)||(u_.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},f_=$(`$ZodError`,d_),p_=$(`$ZodError`,d_,void 0,{Parent:Error});function m_(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function h_(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?m_(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function g_(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function __(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function v_(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${__(e.path)}`);return t.join(`
|
|
2
|
+
`)}function y_(e,t){return{callee:t?.callee??e,Err:t?.Err}}var b_=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new n_;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Ng(e,o,a_())));throw og(n,a?.callee??t),n}return s.value};return t},x_=b_(p_),S_=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Ng(e,o,a_())));throw og(n,a?.callee??t),n}return s.value};return t},C_=S_(p_),w_=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new n_;return a.issues.length?E_(e,a.issues,i):{success:!0,data:a.value}},T_=w_(p_);function E_(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Ng(e,n,a_()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var D_=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?E_(e,a.issues,i):{success:!0,data:a.value}},O_=D_(p_),k_=Symbol.for(`zod.compile.invalid`),A_=Symbol.for(`zod.compile.fallback`),j_=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==k_)return!0;if(r.definite===!0&&n===void 0)return!1}return M_(e,t,n)});function M_(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[A_]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new n_;return a.issues.length===0}var N_=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},P_=e=>{let t=b_(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,y_(n,a))};return n},F_=e=>{let t=b_(e),n=(e,r,i,a)=>t(e,r,i,y_(n,a));return n},I_=e=>{let t=S_(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,y_(n,a))};return n},L_=e=>{let t=S_(e),n=async(e,r,i,a)=>await t(e,r,i,y_(n,a));return n},R_=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return w_(e)(t,n,i)},z_=e=>(t,n,r)=>w_(e)(t,n,r),B_=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return D_(e)(t,n,i)},V_=e=>async(t,n,r)=>D_(e)(t,n,r),H_=/^[cC][0-9a-z]{6,}$/,U_=/^[0-9a-z]+$/,W_=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,G_=/^[0-9a-vA-V]{20}$/,K_=/^[A-Za-z0-9]{27}$/,q_=/^[a-zA-Z0-9_-]{21}$/;function J_(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Y_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,X_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Z_=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Q_=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$_=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function ev(){return new RegExp($_,`u`)}var tv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nv=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,rv=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,iv=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,av=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ov=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,sv=/^https?$/,cv=/^\+[1-9]\d{6,14}$/,lv=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function uv(e){return RegExp(`^${e}$`)}var dv=uv(lv);function fv(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pv(e){return RegExp(`^${fv(e)}$`)}function mv(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${fv({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${fv({precision:e.precision})}`:n;return RegExp(`^${lv}T(?:${r})$`)}var hv=/^[\s\S]{0,}$/,gv=/^-?\d+$/,_v=/^-?\d+(?:\.\d+)?$/,vv=/^(?:true|false)$/i,yv=/^null$/i,bv=/^[^A-Z]*$/,xv=/^[^a-z]*$/,Sv=$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Cv=e=>{let t=e.value;return!Gh(t)&&t.length!==void 0},wv={number:`number`,bigint:`bigint`,object:`date`},Tv=$(`$ZodCheckLessThan`,(e,t)=>{Sv.init(e,t);let n=wv[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:wv[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ev=$(`$ZodCheckGreaterThan`,(e,t)=>{Sv.init(e,t);let n=wv[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:wv[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dv=$(`$ZodCheckMultipleOf`,(e,t)=>{Sv.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):qh(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ov=$(`$ZodCheckNumberFormat`,(e,t)=>{Sv.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=gg[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),kv=$(`$ZodCheckMaxLength`,(e,t)=>{var n;Sv.init(e,t),(n=e._zod.def).when??(n.when=Cv),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Fg(r):i)<=t.maximum)return;let a=Ig(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Av=$(`$ZodCheckMinLength`,(e,t)=>{var n;Sv.init(e,t),(n=e._zod.def).when??(n.when=Cv),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Fg(r):i)>=t.minimum)return;let a=Ig(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jv=$(`$ZodCheckLengthEquals`,(e,t)=>{var n;Sv.init(e,t),(n=e._zod.def).when??(n.when=Cv),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Fg(r):i;if(a===t.length)return;let o=Ig(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Mv=$(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Sv.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Nv=$(`$ZodCheckRegex`,(e,t)=>{Mv.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Pv=$(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=bv,Mv.init(e,t)}),Fv=$(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=xv,Mv.init(e,t)}),Iv=$(`$ZodCheckIncludes`,(e,t)=>{Sv.init(e,t);let n=fg(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Lv=$(`$ZodCheckStartsWith`,(e,t)=>{Sv.init(e,t);let n=RegExp(`^${fg(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Rv=$(`$ZodCheckEndsWith`,(e,t)=>{Sv.init(e,t);let n=RegExp(`.*${fg(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function zv(e,t,n){e.issues.length&&t.issues.push(...kg(n,e.issues))}var Bv=$(`$ZodCheckProperties`,(e,t)=>{Sv.init(e,t),Vg(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>zv(t,r,e)))):zv(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),Vv=$(`$ZodCheckOverwrite`,(e,t)=>{Sv.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Hv=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
4
|
+
`)}\n};`)(...Object.values(this.closed))}},Uv={major:4,minor:6,patch:7},Wv=$(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Uv;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Dg(t),a;for(let o of n){if(o._zod.def.when){if(Og(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new n_;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Mg(t.issues,n,e),i||=Dg(t,n))});else{if(t.issues.length===n)continue;Mg(t.issues,n,e),i||=Dg(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Dg(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new n_;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new n_;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Vg(this,`~standard`,qv(this))},set"~standard"(e){Bg(this,`~standard`,e)}}),Gv=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Ng(e,t,a_()))}:{value:e.value};async function Kv(e,t){let n={async:!0};return Gv(await e._zod.run({value:t,issues:[]},n),n)}function qv(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Gv(r,n)}catch{}return Kv(e,t)},vendor:`zod`,version:1}}var Jv=$(`$ZodString`,(e,t)=>{Wv.init(e,t),e._zod.pattern=t.pattern??hv,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Yv=$(`$ZodStringFormat`,(e,t)=>{Mv.init(e,t),Jv.init(e,t)}),Xv=$(`$ZodGUID`,(e,t)=>{t.pattern??=X_,Yv.init(e,t)}),Zv=$(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Z_(e)}else t.pattern??=Z_();Yv.init(e,t)}),Qv=$(`$ZodEmail`,(e,t)=>{t.pattern??=Q_,Yv.init(e,t)});function $v(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ey(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?$v(e)||2:ty(e,t)}function ty(e,t){if(!t.normalize&&t.protocol?.source===sv.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var ny=/[\t\n\r]/g;function ry(e){return e.replace(ny,``)}function iy(e,t){return t.lastIndex=0,t.test(e.hostname)}function ay(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var oy=$(`$ZodURL`,(e,t)=>{Yv.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=ey(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=ry(r);return}t.hostname&&!iy(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!ay(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:ry(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),sy=$(`$ZodEmoji`,(e,t)=>{t.pattern??=ev(),Yv.init(e,t)}),cy=$(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?q_:J_(t.length),Yv.init(e,t)}),ly=$(`$ZodCUID`,(e,t)=>{t.pattern??=H_,Yv.init(e,t)}),uy=$(`$ZodCUID2`,(e,t)=>{t.pattern??=U_,Yv.init(e,t)}),dy=$(`$ZodULID`,(e,t)=>{t.pattern??=W_,Yv.init(e,t)}),fy=$(`$ZodXID`,(e,t)=>{t.pattern??=G_,Yv.init(e,t)}),py=$(`$ZodKSUID`,(e,t)=>{t.pattern??=K_,Yv.init(e,t)}),my=$(`$ZodISODateTime`,(e,t)=>{t.pattern??=mv(t),Yv.init(e,t)}),hy=$(`$ZodISODate`,(e,t)=>{t.pattern??=dv,Yv.init(e,t)}),gy=$(`$ZodISOTime`,(e,t)=>{t.pattern??=pv(t),Yv.init(e,t)}),_y=$(`$ZodISODuration`,(e,t)=>{t.pattern??=Y_,Yv.init(e,t)}),vy=$(`$ZodIPv4`,(e,t)=>{t.pattern??=tv,Yv.init(e,t)}),yy=/^[0-9a-fA-F:.]+$/;function by(e){return yy.test(e)?$v(`http://[${e}]`):!1}var xy=$(`$ZodIPv6`,(e,t)=>{t.pattern??=nv,Yv.init(e,t),e._zod.check=n=>{by(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Sy=$(`$ZodCIDRv4`,(e,t)=>{t.pattern??=rv,Yv.init(e,t)});function Cy(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:by(n)}var wy=$(`$ZodCIDRv6`,(e,t)=>{t.pattern??=iv,Yv.init(e,t),e._zod.check=n=>{Cy(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Ty(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Ey=/^[0-9a-zA-Z+/]*={0,2}$/,Dy=$(`$ZodBase64`,(e,t)=>{t.pattern??=Ey,Yv.init(e,t),e._zod.check=n=>{Ty(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Oy=/^[A-Za-z0-9_-]*$/;function ky(e){if(!Oy.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Ty(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Ay=$(`$ZodBase64URL`,(e,t)=>{t.pattern??=Oy,Yv.init(e,t),e._zod.check=n=>{ky(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),jy=$(`$ZodE164`,(e,t)=>{t.pattern??=cv,Yv.init(e,t)});function My(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Ny=$(`$ZodJWT`,(e,t)=>{Yv.init(e,t),e._zod.check=n=>{My(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Py=$(`$ZodNumber`,(e,t)=>{Wv.init(e,t),e._zod.pattern=_v,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Fy=$(`$ZodNumberFormat`,(e,t)=>{Ov.init(e,t),Py.init(e,t)}),Iy=$(`$ZodBoolean`,(e,t)=>{Wv.init(e,t),e._zod.pattern=vv,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Ly=$(`$ZodNull`,(e,t)=>{Wv.init(e,t),e._zod.pattern=yv,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Ry=$(`$ZodUnknown`,(e,t)=>{Wv.init(e,t),e._zod.parse=e=>e}),zy=$(`$ZodNever`,(e,t)=>{Wv.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function By(e,t){let n=jg(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of jg(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Mg(n.issues,t,e),n}}return i(n,a)}}var Vy=e=>Array.isArray(e)?e.length:-1;function Hy(e,t,n){e.issues.length&&t.issues.push(...kg(n,e.issues)),t.value[n]=e.value}var Uy=$(`$ZodArray`,(e,t)=>{Wv.init(e,t);let n=i_.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Hy(t,r,e)));else if(Hy(c,r,e),s&&c.issues.length!==0&&Dg(c))break}return o.length?Promise.all(o).then(()=>r):r},By(e,Vy)});function Wy(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(!(!o&&s&&i===`optional`)){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...kg(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Gy=[];function Ky(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Gy,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=hg(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function qy(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Dg(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Wy(e,n,i,t,d,f))):Wy(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Jy=$(`$ZodObject`,(e,t)=>{Wv.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Wh(()=>Ky(t));Q(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Xh(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=sg,o=t.catchall,s,c=i_.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Dg(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Wy(n,t,e,r,a,o))):Wy(s,t,e,r,a,o)}return o?qy(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Yy=$(`$ZodObjectJIT`,(e,t)=>{Jy.init(e,t);let n=e._zod.parse,r=Wh(()=>Ky(t)),i=i_.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Hv([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
5
|
+
let ${e}_ab = false;
|
|
6
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
7
|
+
const iss = ${e}.issues[i];
|
|
8
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
9
|
+
payload.issues.push(iss);
|
|
10
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
11
|
+
}
|
|
12
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
13
|
+
payload.value = newResult;
|
|
14
|
+
return payload;
|
|
15
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:ig(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
16
|
+
const ${n}_present = ${i};
|
|
17
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
18
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (${e}) {
|
|
22
|
+
newResult[${r}] = ${n}.value;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
`)}else f?(o.write(`
|
|
27
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
28
|
+
}
|
|
29
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
30
|
+
if (${n}.value !== undefined || ${i}) {
|
|
31
|
+
newResult[${r}] = ${n}.value;
|
|
32
|
+
}
|
|
33
|
+
`)):o.write(`
|
|
34
|
+
const ${n}_present = ${i};
|
|
35
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
36
|
+
}
|
|
37
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
38
|
+
payload.issues.push({
|
|
39
|
+
code: "invalid_type",
|
|
40
|
+
expected: "nonoptional",
|
|
41
|
+
input: undefined,
|
|
42
|
+
path: [${r}]
|
|
43
|
+
});
|
|
44
|
+
if (ctx && ctx.abortEarly) {
|
|
45
|
+
payload.value = newResult;
|
|
46
|
+
return payload;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (${n}_present) {
|
|
51
|
+
newResult[${r}] = ${n}.value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=sg,c=!i_.jitless,l=c&&cg.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?qy([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Xy(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Dg(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Ng(e,r,a_())))}),t)}var Zy=$(`$ZodUnion`,(e,t)=>{Wv.init(e,t),Q(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),Q(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Q(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Q(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Kh(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Xy(t,r,e,i)):Xy(o,r,e,i)}});function Qy(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var $y=$(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Zy.init(e,t);let n=e._zod.parse;Q(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||Xh(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Zh(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Wh(()=>Qy(t));e._zod.parse=(i,a)=>{let o=i.value;if(!sg(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),eb=$(`$ZodIntersection`,(e,t)=>{Wv.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>nb(e,t,n)):nb(e,i,a)}});function tb(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(lg(e)&&lg(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=tb(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=tb(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function nb(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=tb(t.value,n.value);if(!c.valid){if(Dg(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var rb=$(`$ZodRecord`,(e,t)=>{Wv.init(e,t);let n=i_.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!lg(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Ng(e,i,a_())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...kg(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...kg(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e))if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e);l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&_v.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Ng(e,i,a_())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...kg(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...kg(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),ib=$(`$ZodEnum`,(e,t)=>{Wv.init(e,t);let n=Bh(t.entries),r=new Set(n);e._zod.values=r,Q(e,`pattern`,e=>{let t=Bh(e.def.entries).filter(e=>dg.has(typeof e));return RegExp(t.length?`^(${t.map(e=>fg(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ab=$(`$ZodLiteral`,(e,t)=>{Wv.init(e,t);let n=new Set(t.values);e._zod.values=n,Q(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?fg(e):e?fg(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ob=$(`$ZodTransform`,(e,t)=>{Wv.init(e,t),e._zod.optin=`optional`,i_.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new r_(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new n_;return n.value=i,n}});function sb(e,t){return e.value=t.issues.length?void 0:t.value,e}var cb=$(`$ZodOptional`,(e,t)=>{Wv.init(e,t),Q(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Q(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Q(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Kh(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>sb(e,t)):sb(e,r)}return t.innerType._zod.run(e,n)}}),lb=$(`$ZodExactOptional`,(e,t)=>{cb.init(e,t),Q(e,`values`,e=>e.def.innerType._zod.values),Q(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ub=$(`$ZodNullable`,(e,t)=>{Wv.init(e,t),Q(e,`optin`,e=>e.def.innerType._zod.optin),Q(e,`optout`,e=>e.def.innerType._zod.optout),Q(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Kh(t.source)}|null)$`):void 0}),Q(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),db=$(`$ZodDefault`,(e,t)=>{Wv.init(e,t),e._zod.optin=`defaulted`,Q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>fb(e,t)):fb(r,t)}});function fb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var pb=$(`$ZodPrefault`,(e,t)=>{Wv.init(e,t),e._zod.optin=`defaulted`,Q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),mb=$(`$ZodNonOptional`,(e,t)=>{Wv.init(e,t),Q(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>hb(t,e)):hb(i,e)}});function hb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function gb(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Ng(e,r,a_()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var _b=$(`$ZodCatch`,(e,t)=>{Wv.init(e,t),Q(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Q(e,`optout`,e=>e.def.innerType._zod.optout),Q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>gb(e,r,t,n)):gb(e,r,t,n)}}),vb=$(`$ZodPipe`,(e,t)=>{Wv.init(e,t),Q(e,`values`,e=>e.def.in._zod.values),Q(e,`optin`,e=>e.def.in._zod.optin),Q(e,`optout`,e=>e.def.out._zod.optout),Q(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>yb(e,t.in,n)):yb(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>yb(e,t.out,n)):yb(r,t.out,n)}});function yb(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var bb=$(`$ZodPreprocess`,(e,t)=>{vb.init(e,t)}),xb=$(`$ZodReadonly`,(e,t)=>{Wv.init(e,t),Q(e,`propValues`,e=>e.def.innerType._zod.propValues),Q(e,`values`,e=>e.def.innerType._zod.values),Q(e,`optin`,e=>e.def.innerType?._zod?.optin),Q(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Sb):Sb(r)}});function Sb(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Cb=$(`$ZodLazy`,(e,t)=>{Wv.init(e,t),Yh(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),Q(e,`pattern`,e=>e.innerType?._zod?.pattern),Q(e,`propValues`,e=>e.innerType?._zod?.propValues),Q(e,`optin`,e=>e.innerType?._zod?.optin??void 0),Q(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),wb=$(`$ZodCustom`,(e,t)=>{Sv.init(e,t),Wv.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Tb(t,n,r,e));Tb(i,n,r,e)}});function Tb(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Rg(e))}}var Eb=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Db=`~memo`,Ob=[];function kb(e){return typeof e==`object`&&!!e}function Ab(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var jb=new WeakMap,Mb=0,Nb=1,Pb=2;function Fb(e,t,n){let r=jb.get(e);if(r!==void 0)return r?Pb:Mb;if(t.has(e))return Pb;t.add(e);let i=Mb,a=e=>{if(i!==Pb&&e?._zod){let r=Fb(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Mb;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Nb:o.value?._zod?Fb(o.value,t,n):Mb;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Zh(c);s(e?o(e,!0):Nb),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Fb(r,t,!1):Nb);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(!(!n||typeof n!=`object`)){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Ib(e,i)}function Ib(e,t){return t!==Nb&&jb.set(e,t===Pb),t}function Lb(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Rb,zb=[],Bb={alloc(e,t,n){let r=Rb;if(!r)return n;Rb=void 0;let i={value:n,issues:null};return r.set(t.value,i),zb.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Hb(n,e.value))throw new Eb;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Fb(e,new Set,!1);if(i===Mb)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Pb||r?n=!0:r=!0}let l=s.value;if(!kb(l))return t(s,c);let u=c[Db];u||(u={buckets:new WeakMap,backEdges:void 0},c[Db]=u);let d;i===c?d=a:(d=Lb(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Ab(f.issues)):(s.memo=!0,u.backEdges??=new WeakSet,u.backEdges.add(f.value)),s;Rb=d;let p=zb.length,m=t(s,c);Rb=void 0;let h=zb.length>p?zb.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Ab(e.issues):Ob),e)):(h&&(h.issues=m.issues.length?Ab(m.issues):Ob),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Vb(){return Bb}function Hb(e,t){let n=e[Db]?.backEdges;return n!==void 0&&kb(t)&&n.has(t)}var Ub=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Lg(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${mg(e.values[0])}`:`Invalid option: expected one of ${Vh(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Vh(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Wb(){return{localeError:Ub()}}var Gb,Kb=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function qb(){return new Kb}(Gb=globalThis).__zod_globalRegistry??(Gb.__zod_globalRegistry=qb());var Jb=globalThis.__zod_globalRegistry;function Yb(e){return e.checks&&=[...e.checks],e}function Xb(e,t){return new e(Yb({type:`string`,...Z(t)}))}function Zb(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Z(t)})}function Qb(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Z(t)})}function $b(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Z(t)})}function ex(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Z(t)})}function tx(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Z(t)})}function nx(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Z(t)})}function rx(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Z(t)})}function ix(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Z(t)})}function ax(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Z(t)})}function ox(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Z(t)})}function sx(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Z(t)})}function cx(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Z(t)})}function lx(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Z(t)})}function ux(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Z(t)})}function dx(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Z(t)})}function fx(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Z(t)})}function px(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Z(t)})}function mx(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Z(t)})}function hx(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Z(t)})}function gx(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Z(t)})}function _x(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Z(t)})}function vx(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Z(t)})}function yx(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Z(t)})}function bx(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Z(t)})}function xx(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Z(t)})}function Sx(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Z(t)})}function Cx(e,t){return new e(Yb({type:`number`,checks:[],...Z(t)}))}function wx(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...Z(t)})}function Tx(e,t){return new e({type:`boolean`,...Z(t)})}function Ex(e,t){return new e({type:`null`,...Z(t)})}function Dx(e){return new e({type:`unknown`})}function Ox(e,t){return new e({type:`never`,...Z(t)})}function kx(e,t){return new Tv({check:`less_than`,...Z(t),value:e,inclusive:!1})}function Ax(e,t){return new Tv({check:`less_than`,...Z(t),value:e,inclusive:!0})}function jx(e,t){return new Ev({check:`greater_than`,...Z(t),value:e,inclusive:!1})}function Mx(e,t){return new Ev({check:`greater_than`,...Z(t),value:e,inclusive:!0})}function Nx(e){return jx(0,e)}function Px(e){return Mx(0,e)}function Fx(e,t){return new Dv({check:`multiple_of`,...Z(t),value:e})}function Ix(e,t){return new kv({check:`max_length`,...Z(t),maximum:e})}function Lx(e,t){return new Av({check:`min_length`,...Z(t),minimum:e})}function Rx(e,t){return new jv({check:`length_equals`,...Z(t),length:e})}function zx(e,t){return new Nv({check:`string_format`,format:`regex`,...Z(t),pattern:e})}function Bx(e){return new Pv({check:`string_format`,format:`lowercase`,...Z(e)})}function Vx(e){return new Fv({check:`string_format`,format:`uppercase`,...Z(e)})}function Hx(e,t){return new Iv({check:`string_format`,format:`includes`,...Z(t),includes:e})}function Ux(e,t){return new Lv({check:`string_format`,format:`starts_with`,...Z(t),prefix:e})}function Wx(e,t){return new Rv({check:`string_format`,format:`ends_with`,...Z(t),suffix:e})}function Gx(e,t){return new Bv({check:`properties`,shape:e,...Z(t)})}function Kx(e){return new Vv({check:`overwrite`,tx:e})}function qx(e){return Kx(t=>t.normalize(e))}function Jx(){return Kx(e=>e.trim())}function Yx(){return Kx(e=>e.toLowerCase())}function Xx(){return Kx(e=>e.toUpperCase())}function Zx(){return Kx(e=>ag(e))}function Qx(e,t,n){return new e({type:`array`,element:t,...Z(n)})}function $x(e,t,n){let r=Z(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function eS(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Z(n)})}function tS(e,t){let n=nS(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Rg(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Rg(r))}},e(t.value,t)),t);return n}function nS(e,t){let n=new Sv({check:`custom`,...Z(t)});return n._zod.check=e,n}function rS(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Xh(e,t,n[t]);return e}function iS(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Jb,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function aS(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function oS(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,oS(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&rS(o.schema,c),t.io===`input`&&gS(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function sS(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function cS(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${sS(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+sS(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
55
|
+
|
|
56
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function lS(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;lS(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var uS=new Set([`type`,`properties`,`required`,`additionalProperties`]),dS=[`oneOf`,`anyOf`];function fS(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function pS(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!uS.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??fS(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Xh(n,r,e.length===1?e[0]:pS(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=fS(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function mS(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of uS)if(t in e)return;let n=t.filter(e=>dS.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=pS(t);else{let e=n[0],i=dS.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>pS([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,rS(e,r))}function hS(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):rS(i,s),rS(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())lS(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])mS(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}rS(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Xh(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:vS(t,`input`,e.processors),output:vS(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function gS(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return gS(r.element,n);if(r.type===`set`)return gS(r.valueType,n);if(r.type===`lazy`)return gS(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return gS(r.innerType,n);if(r.type===`intersection`)return gS(r.left,n)||gS(r.right,n);if(r.type===`record`||r.type===`map`)return gS(r.keyType,n)||gS(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:gS(r.in,n)||gS(r.out,n);if(r.type===`object`){for(let e in r.shape)if(gS(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(gS(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(gS(e,n))return!0;return!!(r.rest&&gS(r.rest,n))}return!1}var _S=(e,t={})=>n=>{let r=iS({...n,processors:t});return oS(e,r),cS(r,e),hS(r,e)},vS=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=iS({...i??{},target:a,io:t,processors:n});return oS(e,o),cS(o,e),hS(o,e)},yS=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},bS=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},xS=(e,t)=>{yS(e,`minimum`,t),bS(e,`maximum`,t)},SS=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},CS=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},wS=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},TS=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ES=(e,t)=>yS(e,`minimum`,t.minimum),DS=(e,t)=>bS(e,`maximum`,t.maximum),OS=e=>(t,n)=>{TS(t,n.format);let[r,i]=e[n.format];yS(t,`minimum`,r),bS(t,`maximum`,i)},kS={greater_than:(e,t)=>yS(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>bS(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>SS(e,t.value),number_format:OS(gg),bigint_format:OS(_g),min_length:ES,max_length:DS,length_equals:(e,t)=>xS(e,t.length),min_size:ES,max_size:DS,size_equals:(e,t)=>xS(e,t.size),string_format:(e,t)=>{TS(e,t.format),t.pattern&&CS(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>wS(e,t.mime)};function AS(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)kS[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&yS(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&yS(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&bS(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&bS(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&SS(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&wS(t,i.mime);for(let e of i.patterns??[])CS(t,e);return t}var jS={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},MS=new Map([[Ey,av],[Oy,ov]]),NS=e=>MS.get(e)??e,PS=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=AS(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=jS[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(NS);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},FS=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=AS(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):aS(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},IS=(e,t,n,r)=>{n.type=`boolean`},LS=(e,t,n,r)=>{aS(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},RS=(e,t,n,r)=>{aS(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},zS=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},BS=(e,t,n,r)=>{aS(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},VS=(e,t,n,r)=>{aS(e,t,n,r,`Void cannot be represented in JSON Schema`)},HS=(e,t,n,r)=>{n.not={}},US=(e,t,n,r)=>{},WS=(e,t,n,r)=>{},GS=(e,t,n,r)=>{aS(e,t,n,r,`Date cannot be represented in JSON Schema`)},KS=(e,t,n,r)=>{let i=e._zod.def,a=Bh(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},qS=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(aS(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(aS(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},JS=(e,t,n,r)=>{aS(e,t,n,r,`NaN cannot be represented in JSON Schema`)},YS=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},XS=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=AS(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},ZS=(e,t,n,r)=>{n.type=`boolean`},QS=(e,t,n,r)=>{aS(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},$S=(e,t,n,r)=>{aS(e,t,n,r,`Function types cannot be represented in JSON Schema`)},eC=(e,t,n,r)=>{aS(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},tC=(e,t,n,r)=>{aS(e,t,n,r,`Map cannot be represented in JSON Schema`)},nC=(e,t,n,r)=>{aS(e,t,n,r,`Set cannot be represented in JSON Schema`)},rC=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=AS(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=oS(a.element,t,{...r,path:[...r.path,`items`]})};function iC(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?iC(t.out):t.type===`catch`?iC(t.innerType):e._zod.optin}var aC=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&aS(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Xh(i.properties,e,oS(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?iC(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=oS(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},oC=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>oS(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},sC=(e,t,n,r)=>{let i=e._zod.def,a=oS(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=oS(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},cC=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>oS(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?oS(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?iC(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=AS(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function lC(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=lC(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>lC(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?_v:gv).source),p):p}var uC=new WeakMap;function dC(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of uC.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=lC(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var fC=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=AS(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=oS(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Xh(i.patternProperties,NS(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=oS(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=uC.get(t);n||(n=[],uC.set(t,n),t.deferred.push(()=>dC(t))),n.push(e)}i.additionalProperties=oS(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&iC(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},pC=(e,t,n,r)=>{let i=e._zod.def,a=oS(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},mC=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},hC=Symbol();function gC(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(aS(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),hC):JSON.parse(o)}var _C=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=gC(i.defaultValue,e,t,n,r);o!==hC&&(n.default=o)},vC=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=gC(i.defaultValue,e,t,n,r);o!==hC&&(n._prefault=o)},yC=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{aS(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},bC=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;oS(o,t,r);let s=t.seen.get(e);s.ref=o},xC=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},SC=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},CC=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},wC=(e,t,n,r)=>{let i=e._zod.innerType;oS(i,t,r);let a=t.seen.get(e);a.ref=i},TC={string:PS,number:FS,boolean:IS,bigint:LS,symbol:RS,null:zS,undefined:BS,void:VS,never:HS,any:US,unknown:WS,date:GS,enum:KS,literal:qS,nan:JS,template_literal:YS,file:XS,success:ZS,custom:QS,function:$S,transform:eC,map:tC,set:nC,array:rC,object:aC,union:oC,intersection:sC,tuple:cC,record:fC,nullable:pC,nonoptional:mC,default:_C,prefault:vC,catch:yC,pipe:bC,readonly:xC,promise:SC,optional:CC,lazy:wC};function EC(e,t){if(`_idmap`in e){let n=e,r=iS({...t,processors:TC}),i={};for(let e of n._idmap.entries()){let[t,n]=e;oS(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;cS(r,n),Xh(a,t,hS(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=iS({...t,processors:TC});return oS(e,n),cS(n,e),hS(n,e)}var DC=new WeakSet([Object.prototype,Error.prototype]);function OC(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var kC=$(`ZodError`,(e,t)=>{f_.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);DC.has(n)||(DC.add(n),OC(n,`format`,e=>t=>g_(e,t)),OC(n,`flatten`,e=>t=>h_(e,t)),OC(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Hh,2)}),OC(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Hh,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),AC=b_(kC),jC=S_(kC),MC=w_(kC),NC=D_(kC),PC=P_(kC),FC=F_(kC),IC=I_(kC),LC=L_(kC),RC=R_(kC),zC=z_(kC),BC=B_(kC),VC=V_(kC);function HC(){i_.localeError||a_(Wb())}function UC(){i_.memoizer||a_({memoizer:Vb()})}var WC=$(`ZodType`,(e,t)=>(HC(),Wv.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(rg(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return pg(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(bT(e,t))},superRefine(e,t){return this.check(xT(e,t))},overwrite(e){return this.check(Kx(e))},optional(){return Qw(this)},exactOptional(){return eT(this)},nullable(){return nT(this)},nullish(){return Qw(nT(this))},nonoptional(e){return cT(this,e)},array(){return Mw(this)},or(e){return Rw([this,e])},and(e){return Hw(this,e)},transform(e){return fT(this,Xw(e))},default(e){return iT(this,e)},prefault(e){return oT(this,e)},catch(e){return uT(this,e)},pipe(e){return fT(this,e)},readonly(){return hT(this)},describe(e){let t=this.clone();return Jb.add(t,{description:e}),t},meta(...e){if(e.length===0)return Jb.get(this);let t=this.clone();return Jb.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Vg(this,`~standard`,{...qv(this),jsonSchema:{input:vS(this,`input`),output:vS(this,`output`)}})},set"~standard"(e){Bg(this,`~standard`,e)},parse:function e(t,n){return AC(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await jC(this,t,n,{callee:e})},safeParse(e,t){return MC(this,e,t)},async safeParseAsync(e,t){return NC(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Bg(this,`spa`,e)},validate(e,t){return j_(this,e,t)},validateAsync(e,t){return N_(this,e,t)},encode:function e(t,n){return PC(this,t,n,{callee:e})},decode:function e(t,n){return FC(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await IC(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await LC(this,t,n,{callee:e})},safeEncode(e,t){return RC(this,e,t)},safeDecode(e,t){return zC(this,e,t)},async safeEncodeAsync(e,t){return BC(this,e,t)},async safeDecodeAsync(e,t){return VC(this,e,t)},toJSONSchema(e){return _S(this,{})(e)},get description(){return Jb.get(this)?.description},get _def(){return this._zod.def}}),GC=$(`_ZodString`,(e,t)=>{Jv.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PS(e,t,n,r)},Hg({format:e=>AS(e).format??null,minLength:e=>AS(e).minimum??null,maxLength:e=>AS(e).maximum??null},{regex(...e){return this.check(zx(...e))},includes(...e){return this.check(Hx(...e))},startsWith(...e){return this.check(Ux(...e))},endsWith(...e){return this.check(Wx(...e))},min(...e){return this.check(Lx(...e))},max(...e){return this.check(Ix(...e))},length(...e){return this.check(Rx(...e))},nonempty(...e){return this.check(Lx(1,...e))},lowercase(e){return this.check(Bx(e))},uppercase(e){return this.check(Vx(e))},trim(){return this.check(Jx())},normalize(...e){return this.check(qx(...e))},toLowerCase(){return this.check(Yx())},toUpperCase(){return this.check(Xx())},slugify(){return this.check(Zx())}})),KC=$(`ZodString`,(e,t)=>{Jv.init(e,t),GC.init(e,t)},{email(e){return this.check(Zb($C,e))},url(e){return this.check(rx(nw,e))},jwt(e){return this.check(vx(vw,e))},emoji(e){return this.check(ix(iw,e))},guid(e){return this.check(Qb(ew,e))},uuid(e){return this.check($b(tw,e))},uuidv4(e){return this.check(ex(tw,e))},uuidv6(e){return this.check(tx(tw,e))},uuidv7(e){return this.check(nx(tw,e))},nanoid(e){return this.check(ax(aw,e))},cuid(e){return this.check(ox(ow,e))},cuid2(e){return this.check(sx(sw,e))},ulid(e){return this.check(cx(cw,e))},base64(e){return this.check(hx(hw,e))},base64url(e){return this.check(gx(gw,e))},xid(e){return this.check(lx(lw,e))},ksuid(e){return this.check(ux(uw,e))},ipv4(e){return this.check(dx(dw,e))},ipv6(e){return this.check(fx(fw,e))},cidrv4(e){return this.check(px(pw,e))},cidrv6(e){return this.check(mx(mw,e))},e164(e){return this.check(_x(_w,e))},datetime(e){return this.check(yx(YC,e))},date(e){return this.check(bx(XC,e))},time(e){return this.check(xx(ZC,e))},duration(e){return this.check(Sx(QC,e))}});function qC(e){return Xb(KC,e)}var JC=$(`ZodStringFormat`,(e,t)=>{Yv.init(e,t),GC.init(e,t)}),YC=$(`ZodISODateTime`,(e,t)=>{my.init(e,t),JC.init(e,t)}),XC=$(`ZodISODate`,(e,t)=>{hy.init(e,t),JC.init(e,t)}),ZC=$(`ZodISOTime`,(e,t)=>{gy.init(e,t),JC.init(e,t)}),QC=$(`ZodISODuration`,(e,t)=>{_y.init(e,t),JC.init(e,t)}),$C=$(`ZodEmail`,(e,t)=>{Qv.init(e,t),JC.init(e,t)}),ew=$(`ZodGUID`,(e,t)=>{Xv.init(e,t),JC.init(e,t)}),tw=$(`ZodUUID`,(e,t)=>{Zv.init(e,t),JC.init(e,t)}),nw=$(`ZodURL`,(e,t)=>{oy.init(e,t),JC.init(e,t)});function rw(e){return rx(nw,e)}var iw=$(`ZodEmoji`,(e,t)=>{sy.init(e,t),JC.init(e,t)}),aw=$(`ZodNanoID`,(e,t)=>{cy.init(e,t),JC.init(e,t)}),ow=$(`ZodCUID`,(e,t)=>{ly.init(e,t),JC.init(e,t)}),sw=$(`ZodCUID2`,(e,t)=>{uy.init(e,t),JC.init(e,t)}),cw=$(`ZodULID`,(e,t)=>{dy.init(e,t),JC.init(e,t)}),lw=$(`ZodXID`,(e,t)=>{fy.init(e,t),JC.init(e,t)}),uw=$(`ZodKSUID`,(e,t)=>{py.init(e,t),JC.init(e,t)}),dw=$(`ZodIPv4`,(e,t)=>{vy.init(e,t),JC.init(e,t)}),fw=$(`ZodIPv6`,(e,t)=>{xy.init(e,t),JC.init(e,t)}),pw=$(`ZodCIDRv4`,(e,t)=>{Sy.init(e,t),JC.init(e,t)}),mw=$(`ZodCIDRv6`,(e,t)=>{wy.init(e,t),JC.init(e,t)}),hw=$(`ZodBase64`,(e,t)=>{Dy.init(e,t),JC.init(e,t)}),gw=$(`ZodBase64URL`,(e,t)=>{Ay.init(e,t),JC.init(e,t)}),_w=$(`ZodE164`,(e,t)=>{jy.init(e,t),JC.init(e,t)}),vw=$(`ZodJWT`,(e,t)=>{Ny.init(e,t),JC.init(e,t)}),yw=$(`ZodNumber`,(e,t)=>{Py.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FS(e,t,n,r),e.isFinite=!0},Hg({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=AS(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=AS(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=AS(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>AS(e).format??null},{gt(e,t){return this.check(jx(e,t))},gte(e,t){return this.check(Mx(e,t))},min(e,t){return this.check(Mx(e,t))},lt(e,t){return this.check(kx(e,t))},lte(e,t){return this.check(Ax(e,t))},max(e,t){return this.check(Ax(e,t))},int(e){return this.check(Sw(e))},safe(e){return this.check(Sw(e))},positive(e){return this.check(jx(0,e))},nonnegative(e){return this.check(Mx(0,e))},negative(e){return this.check(kx(0,e))},nonpositive(e){return this.check(Ax(0,e))},multipleOf(e,t){return this.check(Fx(e,t))},step(e,t){return this.check(Fx(e,t))},finite(){return this}}));function bw(e){return Cx(yw,e)}var xw=$(`ZodNumberFormat`,(e,t)=>{Fy.init(e,t),yw.init(e,t)});function Sw(e){return wx(xw,e)}var Cw=$(`ZodBoolean`,(e,t)=>{Iy.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IS(e,t,n,r)});function ww(e){return Tx(Cw,e)}var Tw=$(`ZodNull`,(e,t)=>{Ly.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zS(e,t,n,r)});function Ew(e){return Ex(Tw,e)}var Dw=$(`ZodUnknown`,(e,t)=>{Ry.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ow(){return Dx(Dw)}var kw=$(`ZodNever`,(e,t)=>{zy.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HS(e,t,n,r)});function Aw(e){return Ox(kw,e)}var jw=$(`ZodArray`,(e,t)=>{UC(),Uy.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rC(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Lx(e,t))},nonempty(e){return this.check(Lx(1,e))},max(e,t){return this.check(Ix(e,t))},length(e,t){return this.check(Rx(e,t))},unwrap(){return this.element}});function Mw(e,t){return Qx(jw,e,t)}var Nw=$(`ZodObject`,(e,t)=>{UC(),Yy.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aC(e,t,n,r),Jg(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Kw(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(rg(this._zod.def,{catchall:e}))},passthrough(){return this.clone(rg(this._zod.def,{catchall:Ow()}))},loose(){return this.clone(rg(this._zod.def,{catchall:Ow()}))},strict(){return this.clone(rg(this._zod.def,{catchall:Aw()}))},strip(){return this.clone(rg(this._zod.def,{catchall:void 0}))},extend(e){return xg(this,e)},safeExtend(e){return Cg(this,e)},merge(e){return wg(this,e)},pick(e){return vg(this,e)},omit(e){return bg(this,e)},partial(...e){return Tg(Zw,this,e[0])},exactPartial(...e){return Tg($w,this,e[0],`exactPartial`)},required(...e){return Eg(sT,this,e[0])}});function Pw(e,t){return new Nw({type:`object`,shape:e??{},...Z(t)})}function Fw(e,t){return new Nw({type:`object`,shape:e,catchall:Aw(),...Z(t)})}function Iw(e,t){return new Nw({type:`object`,shape:e,catchall:Ow(),...Z(t)})}var Lw=$(`ZodUnion`,(e,t)=>{Zy.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oC(e,t,n,r),e.options=t.options});function Rw(e,t){return new Lw({type:`union`,options:e,...Z(t)})}var zw=$(`ZodDiscriminatedUnion`,(e,t)=>{Lw.init(e,t),$y.init(e,t)});function Bw(e,t,n){return new zw({type:`union`,options:t,discriminator:e,...Z(n)})}var Vw=$(`ZodIntersection`,(e,t)=>{eb.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sC(e,t,n,r)});function Hw(e,t){return new Vw({type:`intersection`,left:e,right:t})}var Uw=$(`ZodRecord`,(e,t)=>{UC(),rb.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fC(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ww(e,t,n){return!t||!t._zod?new Uw({type:`record`,keyType:qC(),valueType:e,...Z(t)}):new Uw({type:`record`,keyType:e,valueType:t,...Z(n)})}var Gw=$(`ZodEnum`,(e,t)=>{ib.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KS(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Gw({...t,checks:[],...Z(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Gw({...t,checks:[],...Z(r),entries:i})}});function Kw(e,t){return new Gw({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Z(t)})}var qw=$(`ZodLiteral`,(e,t)=>{ab.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qS(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Jw(e,t){return new qw({type:`literal`,values:Array.isArray(e)?e:[e],...Z(t)})}var Yw=$(`ZodTransform`,(e,t)=>{UC(),ob.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eC(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new r_(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Rg(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Rg(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Xw(e){return new Yw({type:`transform`,transform:e})}var Zw=$(`ZodOptional`,(e,t)=>{cb.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qw(e){return new Zw({type:`optional`,innerType:e})}var $w=$(`ZodExactOptional`,(e,t)=>{lb.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function eT(e){return new $w({type:`optional`,innerType:e})}var tT=$(`ZodNullable`,(e,t)=>{ub.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function nT(e){return new tT({type:`nullable`,innerType:e})}var rT=$(`ZodDefault`,(e,t)=>{db.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_C(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function iT(e,t){return new rT({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ug(t)}})}var aT=$(`ZodPrefault`,(e,t)=>{pb.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function oT(e,t){return new aT({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ug(t)}})}var sT=$(`ZodNonOptional`,(e,t)=>{mb.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cT(e,t){return new sT({type:`nonoptional`,innerType:e,...Z(t)})}var lT=$(`ZodCatch`,(e,t)=>{_b.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function uT(e,t){return new lT({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Xg(t)})}var dT=$(`ZodPipe`,(e,t)=>{vb.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bC(e,t,n,r),e.in=t.in,e.out=t.out});function fT(e,t){return new dT({type:`pipe`,in:e,out:t})}var pT=$(`ZodPreprocess`,(e,t)=>{dT.init(e,t),bb.init(e,t)}),mT=$(`ZodReadonly`,(e,t)=>{xb.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hT(e){return new mT({type:`readonly`,innerType:e})}var gT=$(`ZodLazy`,(e,t)=>{Cb.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wC(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function _T(e){return new gT({type:`lazy`,getter:e})}var vT=$(`ZodCustom`,(e,t)=>{wb.init(e,t),WC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>QS(e,t,n,r)});function yT(e,t){return $x(vT,e??(()=>!0),t)}function bT(e,t={}){return eS(vT,e,t)}function xT(e,t){return tS(e,t)}var ST=$(`ZodInstanceOf`,(e,t)=>{vT.init(e,t)},{properties(e,t){return this.check(Gx(e,t))}});function CT(e,t={}){let n=new ST({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...Z(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function wT(e,t){return new pT({type:`pipe`,in:Xw(e),out:t})}var TT=48,ET=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-TT-t;return n},DT=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},OT=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-TT;n+=i>>>1^-(i&1),t[r]=n}return t},kT=384,AT=[],jT=DT(ET(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),MT=DT(ET(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),NT=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,PT=(()=>{let e=jT.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=jT[n];i<jT[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(jT[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=jT[i];a<jT[i+1];a++)n[r++]=e,e+=t[e]}return n})(),FT=ET(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),IT=DT(ET(`123333359346463635126536711576`)),LT=ET(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),RT=ET(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),zT=OT(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),BT=(()=>{let e=new Int32Array(319).fill(-1),t=OT(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=OT(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),VT=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),HT=OT(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),UT=OT(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),WT=OT(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±`),GT=new Int32Array(995),KT=new Int32Array(995),qT=new Int32Array(995),JT=``,YT=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<HT.length;r++)for(let i of VT[WT[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),YT[a*2]=JT.length,YT[a*2+1]=i.length,JT+=i),GT[n]=HT[r],KT[n]=UT[r],qT[n]=a,n++}}var XT=OT(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),ZT=DT(ET(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),QT=OT(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),$T=ET(`ij`),eE=ET(``),tE=ET(`1`),nE={GROUP_COUNT:kT,customValidatorNames:AT,edgeStart:jT,labelStart:MT,labelText:NT,edgeTarget:PT,nodeGroup:FT,nodeVlist:BT,vlistPat:IT,vlistOps:LT,vlistRef:RT,vlistGroup:zT,litAnchor:GT,litGroup:KT,litPool:qT,poolOffsets:YT,poolText:JT,adjGid:XT,adjStart:ZT,adjTgt:QT,patGid:$T,patTgt:eE,postfixLookupGroups:tE,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},rE=`line`in Error(),iE=-1,aE=-1,oE=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},sE=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15|0},cE=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let ee=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(oE(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;ee[n]!==-1;)n=n+1&I-1;ee[n]=e}let L=(e,t,n,r)=>{let i=(oE(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=ee[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},R=n.cacheSize??8192,te=n.prefix??e.prefix??``,ne=te===``?``:te+`:`,z=ne.length,re=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),B=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,V=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,H=0,U=-1,oe=-1,se=-1,ce=-1,le=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ue=e=>/\s/.test(String.fromCharCode(e)),de=(e,t,n)=>{if(H=0,U=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)H=1;else if(r===40&&i===41)H=2;else return;se=t+1,ce=n-1;let a=t+1;if(le(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!le(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(U=t+1,oe=a,se=a+1)}},fe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},pe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,he=e=>!!e&&!Number.isNaN(Number(e)),ge=(e,t,n)=>{if(n-t<11||!fe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&fe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&fe(e,t+10,t+18,`-normal/`)},_e=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ve=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ye=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],W=(e,t,n,r)=>{if(e>=10){if(e>=25)return re[e-25](t.slice(n,r));let i=e-10;if(H!==_e[i])return!1;if(U>=0){for(let e of ve[i])if(fe(t,U,oe,e))return!0;return!1}switch(ye[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(se,ce);return B.test(e)&&!V.test(e)}case 3:return he(t.slice(se,ce));case 4:return ae.test(t.slice(se,ce));default:return ie.test(t.slice(se,ce))}}switch(e){case 0:return!0;case 1:return H===0;case 2:return H===1;case 3:return H===2;case 4:return pe.test(t.slice(n,r));case 5:return he(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&he(t.slice(n,r-1));case 8:return me.test(t.slice(n,r));default:return ge(t,n,r)}},G=new Set(typeof E==`string`?E.split(` `):E),be=(e,t,n,r,i,a)=>{let o=oE(t,n,r)^(i?2654435769:0)|0,s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(!(a.imp!==i||a.k.length!==r-n)){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},xe=new Map,Se=new Map,Ce=2,we=4096,Te=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||G.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Se.get(s);return c===void 0&&Se.set(s,c=Ce++),c},Ee=new Map,De=r,Oe=r+4096,ke=()=>De++,Ae=2097152,je=8192,Me=new Int32Array(je),Ne=Array(je).fill(null),Pe=new Int32Array(je),Fe=new Int32Array(je),Ie=new Uint8Array(je),Le=0,Re=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ne[e]!==null)if(Ne[e|1]===null)c=e|1;else if(!(Le++&3))c=e|Le>>2&1;else return;Ne[c]=t.slice(n,r),Me[c]=i,Pe[c]=a,Fe[c]=o,Ie[c]=s},ze=()=>Ne.fill(null),Be=256,Ve=[new Int32Array(Be),new Int32Array(Be),new Int32Array(Be),new Int32Array(Be)],[He,Ue,We,Ge]=Ve,Ke=new Uint8Array(Be),qe=new Uint8Array(Be),Je=()=>{Be*=2,Ve=Ve.map(e=>{let t=new Int32Array(Be);return t.set(e),t}),[He,Ue,We,Ge]=Ve;let e=new Uint8Array(Be);e.set(Ke),Ke=e,qe=new Uint8Array(Be)},Ye=64,Xe=new Int32Array(Ye),Ze=new Int32Array(Ye),Qe=new Int32Array(r),$e=2048,et=21,tt=new Float64Array($e),nt=new Int32Array($e),rt=0,it=(e,t)=>{if(e===0&&t<r)return Qe[t]===rt?1:(Qe[t]=rt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>et;for(;nt[i]===rt;){if(tt[i]===n)return 1;i=i+1&$e-1}return tt[i]=n,nt[i]=rt,0},at=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?iE:be(Ee,e,t+1,r,0,ke)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Ze[t];if(r>n)continue;let i=Xe[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=L(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;de(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(W(d[t],e,r,n))return p[h+t]}return iE},ot=e=>{let t=e.length,n=0,c=0,u=!1;(Ce>we||xe.size>we)&&(xe=new Map,Se=new Map,Ce=2,ze()),De>Oe&&(Ee=new Map,De=r,ze());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ue(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ue(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Be&&Je();let _=n++;He[_]=p,Ue[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Me[y]===v&&Ne[y]!==null&&Ne[y].length===g?t=y:Me[y|1]===v&&Ne[y|1]!==null&&Ne[y|1].length===g&&(t=y|1),t>=0){let n=Ne[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){We[_]=Pe[t],Ge[_]=Fe[t],Ke[_]=Ie[t];continue}}}let b=p;if(z!==0){if(h-p<=z||!e.startsWith(ne,p)){We[_]=iE,Re(y,e,p,h,v,iE,0,0);continue}b=p+z}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,ee=-1,L=0;(l[0]>=0||N[0]===1)&&(Xe[0]=0,Ze[0]=M,L=1);let R=aE,te=0;for(let t=M;t<D;t++)if(t===A&&(R=F<I?aE:P,te=L),P!==aE){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=ee)):P=aE;else{let e=i[P],t=i[P+1],c=aE;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],ee=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(L===Ye){Ye*=2;let e=new Int32Array(Ye);e.set(Xe),Xe=e;let t=new Int32Array(Ye);t.set(Ze),Ze=t}Xe[L]=r,Ze[L]=t+2,L++}}A===D&&(R=F<I?aE:P,te=L);let re=F<I?aE:P,B,V=!1;if(A>=0)if(V=!0,B=at(e,E,A,R,te),B!==iE&&B<r&&j[B]){let t=at(e,E,D,re,L);t!==iE&&t!==B&&(B=t,V=!1)}else B===iE&&(B=at(e,E,D,re,L),V=!1);else B=at(e,E,D,re,L);let ie=0,ae=0;B===iE?We[_]=iE:(ae=+!!V,ie=b>=C?+!!O:be(xe,e,b,C,+!!O,e=>Te(e,O)),We[_]=B,Ke[_]=ae,Ge[_]=ie),Re(y,e,p,h,v,B,ie,ae)}if(n===0)return``;if(n===1)return He[0]===0&&Ue[0]===t?e:e.slice(He[0],Ue[0]);if(n*k>$e){for(;n*k>$e;)$e<<=1,et--;tt=new Float64Array($e),nt=new Int32Array($e)}if(Ce>=Ae||De>=Ae)throw Error(`cn: too many distinct classes in one merge`);rt=rt+1|0,rt===0&&(Qe.fill(0),nt.fill(0),rt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=We[e];if(t===iE){qe[e]=1;continue}let n=Ge[e];if(it(n,t)===1){qe[e]=0,f=!0;continue}if(qe[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)it(n,x[e]);if(Ke[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&it(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!qe[m]){m++;continue}let t=He[m],r=Ue[m],i=m+1;for(;i<n&&qe[i]&&He[i]===r+1&&e.charCodeAt(r)===32;)r=Ue[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},st=16384,ct=new Int32Array(st*2),lt=0,ut=1,dt=Object.create(null),ft=Object.create(null),pt=new Map,mt=new Map,ht=0,gt=0,K=()=>{lt^=st,ut=ut+1|0,gt=0},_t=e=>{let t=dt[e];if(t!==void 0)return t;let n=sE(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=ft[e],t!==void 0)?(dt[e]=t,t):(t=ot(e),i?(dt[e]=t,++ht>R&&(ht=0,ft=dt,dt=Object.create(null),K())):(ct[r]=n^ut,++gt>st&&K()),t)},vt=e=>{let t=pt.get(e);if(t!==void 0)return t;let n=sE(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=mt.get(e),t!==void 0)?(pt.set(e,t),t):(t=ot(e),i?(pt.set(e,t),++ht>R&&(ht=0,mt=pt,pt=new Map,K())):(ct[r]=n^ut,++gt>st&&K()),t)},yt=e=>{let t=sE(e,0,e.length),n=(t&16383)+lt;return ct[n]===(t^ut)||ct[n^st]===(t^ut-1)?!0:(ct[n]=t^ut,++gt>st&&K(),!1)},bt=R===0?ot:rE?e=>{let t=pt.get(e);return t===void 0?vt(e):t}:_t;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?bt(arguments[0]):bt(dE.apply(null,arguments))},mergeString:bt,seenBefore:R===0?()=>!1:yt,mergeUncached:ot}},lE=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:lE(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},uE=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:lE(i,t);a&&(n&&(n+=` `),n+=a)}return n},dE=function(){return uE(arguments,!1)},fE=256,pE=16,mE=1024,hE=4096,gE=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(hE).fill(``),l=Array(hE).fill(``),u=Array(hE).fill(``));let i=sE(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=lE(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>pE&&(_.miss=pE,_.skip=mE,_.e.length=0,_.at=0);let u=_.e;u.length<fE?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(lE(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},_E=cE(nE),vE=gE(_E.mergeString,_E);_E.merge;function yE(e){switch(e.type){case`idle`:return`idle`;case`systemError`:return`error`;case`active`:return e.activeFlags.includes(`waitingOnApproval`)?`approval`:e.activeFlags.includes(`waitingOnUserInput`)?`input`:`active`}}var bE=(0,W.createContext)(null),xE=(0,W.createContext)([]);function SE({href:e,onEvent:t,history:n=[],children:r}){let[i,a]=(0,W.useState)(new Map),o=(0,W.useEffectEvent)(t);return(0,W.useEffect)(()=>{if(!e)return;let t=new EventSource(e),n=e=>{let t=kE(e.data);t&&(t.type===`ready`?a(new Map):DE(t)&&a(e=>new Map(e).set(t.id,t)),o(t))};return t.addEventListener(`message`,n),()=>{t.removeEventListener(`message`,n),t.close()}},[e]),(0,G.jsx)(bE,{value:i,children:(0,G.jsx)(xE,{value:n,children:r})})}function CE(e,t){let n=(0,W.use)(bE);if(!n)throw Error(`useConversationStatus must be used inside <RuntimeEventsProvider>.`);return n.get(e)?.status??t}var wE={pending:`Pending`,queued:`Queued`,running:`Running`,waitingOnApproval:`Waiting on approval`,waitingOnUserInput:`Waiting on user input`,completed:`Completed`,failed:`Failed`,interrupted:`Interrupted`},TE={spawn:`Spawned`,message:`Message sent`,followup:`Follow-up sent`,interrupt:`Interrupt accepted`,completion:`Turn finished`};function EE({treeId:e,snapshot:t=[]}){let n=(0,W.use)(bE),r=(0,W.use)(xE).find(t=>t.chatId===e)?.children??t,i=new Map(r.filter(t=>t.treeId===e).map(e=>[e.chatId,e]));for(let t of n?.values()??[])t.child?.treeId===e&&i.set(t.id,t.child);return i.size===0?null:(0,G.jsxs)(`section`,{"aria-label":`Child agents`,className:`border-t px-6 py-3`,children:[(0,G.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:`Child agents`}),(0,G.jsx)(`ul`,{className:`space-y-2`,children:[...i.values()].sort((e,t)=>e.path.localeCompare(t.path)).map(e=>{let t=Object.values(e.activities).sort((e,t)=>t.at-e.at)[0];return(0,G.jsxs)(`li`,{className:`flex items-center justify-between gap-4 text-sm`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate font-mono text-xs`,children:e.path}),t&&(0,G.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[TE[t.type],` · `,t.actorPath,` →`,` `,t.targetPath]})]}),(0,G.jsx)(BE,{status:wE[e.state]})]},e.chatId)})})]})}function DE(e){return e.type===`change`&&e.resource===`conversation`&&AE(e.status)&&(e.child===void 0||ME(e.child)&&e.child.chatId===e.id)}function OE(e){return jE(e)&&typeof e.chatId==`string`&&typeof e.userId==`string`&&(e.title===void 0||typeof e.title==`string`)&&typeof e.createdAt==`number`&&typeof e.updatedAt==`number`&&typeof e.messageCount==`number`&&AE(e.status)&&(e.children===void 0||Array.isArray(e.children)&&e.children.every(ME))}function kE(e){let t;try{t=JSON.parse(e)}catch{return}if(!(!jE(t)||typeof t.type!=`string`)){if(t.type===`ready`)return{type:`ready`};if(!(t.type!==`change`||typeof t.resource!=`string`||!t.resource||typeof t.id!=`string`||!t.id)&&!(t.resource===`conversation`&&(!AE(t.status)||t.child!==void 0&&(!ME(t.child)||t.child.chatId!==t.id))))return{...t,type:`change`,resource:t.resource,id:t.id}}}function AE(e){return!jE(e)||typeof e.type!=`string`?!1:e.type===`idle`||e.type===`systemError`||e.type===`active`&&Array.isArray(e.activeFlags)&&e.activeFlags.every(e=>e===`waitingOnApproval`||e===`waitingOnUserInput`)}function jE(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ME(e){return!jE(e)||!jE(e.activities)||![`chatId`,`treeId`,`path`,`parentChatId`,`declarationName`].every(t=>typeof e[t]==`string`)||typeof e.state!=`string`||!Object.hasOwn(wE,e.state)?!1:Object.entries(e.activities).every(([e,t])=>Object.hasOwn(TE,e)&&jE(t)&&t.type===e&&typeof t.at==`number`&&Number.isFinite(t.at)&&(t.outcome===void 0||t.outcome===`completed`||t.outcome===`failed`||t.outcome===`cancelled`)&&[`id`,`actorPath`,`targetPath`,`streamId`].every(e=>typeof t[e]==`string`))}var NE=(0,W.createContext)(null);function PE(){let e=(0,W.use)(NE);if(!e)throw Error(`History.* parts must be rendered inside <History.Root>.`);return e}function FE({activeChatId:e,onSelect:t,className:n,children:r}){let i=(0,W.useMemo)(()=>({activeChatId:e,onSelect:t}),[e,t]);return(0,G.jsx)(NE.Provider,{value:i,children:(0,G.jsx)(`div`,{className:vE(`flex min-h-0 flex-col gap-1`,n),children:r})})}function IE({className:e,children:t}){return(0,G.jsx)(`div`,{className:vE(`group/history-item relative`,e),children:t})}function LE({history:e,className:t,children:n}){let{activeChatId:r,onSelect:i}=PE(),a=r===e.chatId;return(0,G.jsx)(`button`,{type:`button`,"aria-current":a?`true`:void 0,onClick:()=>i(e),className:vE(`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm transition-colors`,a?`bg-accent text-foreground`:`text-muted-foreground hover:bg-accent hover:text-foreground`,t),children:n})}function RE({className:e,children:t}){return(0,G.jsx)(`div`,{className:vE(`text-muted-foreground px-2 py-4 text-sm`,e),children:t})}function zE({chatId:e,status:t}){let n=`size-3.5 shrink-0`;switch(yE(CE(e,t))){case`active`:return(0,G.jsx)(Je,{"aria-label":`Active`,className:n});case`error`:return(0,G.jsx)(Xe,{"aria-label":`Error`,className:vE(n,`text-destructive`)});case`idle`:return(0,G.jsx)(ot,{"aria-label":`idle`,className:n});case`approval`:return(0,G.jsx)(Qe,{"aria-label":`Waiting on approval`,className:n});case`input`:return(0,G.jsx)(it,{"aria-label":`Waiting on user input`,className:n})}}function BE({status:e}){return(0,G.jsx)(`span`,{className:vE(`text-muted-foreground rounded-md border px-2 py-1 font-mono text-[0.6875rem] capitalize`,(e===`failed`||e===`error`)&&`text-destructive border-destructive/30`),children:e})}var VE=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function HE(e){return VE.format(new Date(e))}var UE={Root:FE,Item:IE,ItemTrigger:LE,Empty:RE},WE=Pw({href:qC()}),GE=Pw({capabilities:Pw({chat:WE,history:WE,events:WE,traces:WE.optional(),schedules:WE.optional(),uploads:WE.extend({mediaTypes:Mw(qC()).optional()}).optional()})}),KE=new ge({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1}}});async function qE(e){let t=document.querySelector(`meta[name="deepagents-zukhruf-info"]`)?.content;if(!t)throw Error(`DevTool host did not configure the Zukhruf protocol path`);let n;try{let r=await KE.fetchQuery({queryKey:[`runtime`,`discovery`,t],queryFn:async()=>GE.parse(await JE(t,e)),staleTime:1/0});n=r;let i=await KE.fetchQuery({queryKey:[`runtime`,`history`,r.capabilities.history.href],queryFn:async()=>YE(await JE(r.capabilities.history.href,e))});return{discovery:n,history:i,historyError:!1}}catch{return{discovery:n,history:[],historyError:!0}}}async function JE(e,t){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`Request failed: ${n.status}`);return n.json()}function YE(e){if(!Array.isArray(e)||!e.every(OE))throw Error(`History response is not a list of conversations`);return e}export{ib as $,He as $a,vr as $i,ku as $n,Io as $r,ep as $t,Rw as A,yn as Aa,ha as Ai,td as An,sc as Ar,Ph as At,Ox as B,bt as Ba,Ii as Bi,Ru as Bn,Rs as Br,Km as Bt,Iw as C,Fn as Ca,Ta as Ci,dd as Cn,o as Co,xc as Cr,Jg as Ct,Ww as D,Rn as Da,Y as Di,od as Dn,yc as Dr,lh as Dt,wT as E,Cn as Ea,ba as Ei,sd as En,Cc as Er,ch as Et,Tx as F,Gt as Fa,$i as Fi,Gu as Fn,Ks as Fr,_h as Ft,Ux as G,dt as Ga,jr as Gi,xu as Gn,gs as Gr,th as Gt,Cx as H,yt as Ha,Vr as Hi,Iu as Hn,Ms as Hr,Zm as Ht,$x as I,Nt as Ia,Zi as Ii,Uu as In,Ws as Ir,Nh as It,Wb as J,nt as Ja,Dr as Ji,bu as Jn,Ro as Jr,jp as Jt,Xb as K,ut as Ka,Mr as Ki,Su as Kn,Vo as Kr,Xm as Kt,wx as L,Mt as La,Vi as Li,Bu as Ln,Gs as Lr,jh as Lt,rw as M,dn as Ma,pa as Mi,Yu as Mn,rc as Mr,Mh as Mt,NC as N,sn as Na,fa as Ni,Zu as Nn,qs as Nr,hh as Nt,Fw as O,bn as Oa,xa as Oi,id as On,lc as Or,Fh as Ot,EC as P,qt as Pa,ta as Pi,Ku as Pn,Js as Pr,gh as Pt,$y as Q,We as Qa,Cr as Qi,Eu as Qn,Ho as Qr,Af as Qt,Ax as R,wt as Ra,Bi as Ri,Hu as Rn,Vs as Rr,vh as Rt,Jw as S,Nn as Sa,wa as Si,Ed as Sn,s as So,bc as Sr,xg as St,Pw as T,wn as Ta,ya as Ti,cd as Tn,fc as Tr,Bg as Tt,Nx as U,K as Ua,Br as Ui,Pu as Un,Ns as Ur,eh as Ut,Px as V,xt as Va,Fi as Vi,Lu as Vn,js as Vr,qm as Vt,eS as W,mt as Wa,Nr as Wi,Nu as Wn,vs as Wr,$m as Wt,Iy as X,Xe as Xa,Tr as Xi,wu as Xn,Wo as Xr,Zf as Xt,Uy as Y,et as Ya,Er as Yi,Tu as Yn,Bo as Yr,Qf as Yt,wb as Z,Ke as Za,Sr as Zi,Du as Zn,Lo as Zr,cf as Zt,ww as _,Dn as _a,ka as _i,Fd as _n,T as _o,pc as _r,v_ as _t,UE as a,qn as aa,Qa as ai,Uf as an,ve as ao,al as ar,cb as at,Sw as b,Sn as ba,Aa as bi,Ad as bn,h as bo,dc as br,a_ as bt,yE as c,Wn as ca,Ja as ci,Zd as cn,ne as co,$c as cr,Jv as ct,CE as d,Pn as da,Ha as di,qd as dn,x as do,Fc as dr,Zy as dt,$n as ea,co as ei,Gf as en,Be as eo,Au as er,ab as et,vE as f,On as fa,Ua as fi,Vd as fn,m as fo,Ic as fr,Ry as ft,Mw as g,Ln as ga,Pa as gi,Ld as gn,g as go,uc as gr,O_ as gt,Ew as h,kn as ha,Na as hi,Rd as hn,_ as ho,wc as hr,T_ as ht,EE as i,Xn as ia,eo as ii,Xf as in,Se as io,ol as ir,Jy as it,Ow as j,vn as ja,ga as ji,ed as jn,ic as jr,fh as jt,qC as k,xn as ka,_a as ki,nd as kn,cc as kr,uh as kt,HE as l,Hn as la,Za as li,X as ln,L as lo,Kc as lr,ob as lt,CT as m,An as ma,Ba as mi,zd as mn,A as mo,Ec as mr,C_ as mt,KE as n,rr as na,so as ni,df as nn,Ie as no,gl as nr,Py as nt,SE as o,Kn as oa,Ga as oi,Ff as on,fe as oo,el as or,vb as ot,Kw as p,In as pa,Va as pi,Bd as pn,f as po,Oc as pr,x_ as pt,Dx as q,ct as qa,J as qi,Cu as qn,zo as qr,Ym as qt,zE as r,hr as ra,io as ri,rp as rn,xe as ro,cl as rr,Fy as rt,BE as s,Gn as sa,Xa as si,Kd as sn,ce as so,qc as sr,rb as st,qE as t,nr as ta,oo as ti,jf as tn,Re as to,$l as tr,zy as tt,DE as u,Un as ua,Wa as ui,Qd as un,ee as uo,Wc as ur,Wv as ut,yT as v,Mn as va,ja as vi,Pd as vn,F as vo,vc as vr,$ as vt,bw as w,Tn as wa,Ea as wi,ld as wn,Sc as wr,Z as wt,_T as x,En as xa,Da as xi,kd as xn,l as xo,gc as xr,pg as xt,Bw as y,jn as ya,Oa as yi,Md as yn,N as yo,_c as yr,Qg as yt,Lx as z,q as za,zi,Vu as zn,zs as zr,Qm as zt};
|