@deepagents/devtool 7.1.0 → 7.1.2
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-BF4Zf0VD.js → chat-CDKqdLrI.js} +86 -86
- package/dist/ui/assets/chunk-YOKDWASO-CXjcfM6T.js +143 -0
- package/dist/ui/assets/clsx-BAOu4s7Q.js +1 -0
- package/dist/ui/assets/highlighted-body-KPVGNVTW-rokay5_G.js +1 -0
- package/dist/ui/assets/index-CnLKES7X.js +12 -0
- package/dist/ui/assets/index-Did3xVjn.css +2 -0
- package/dist/ui/assets/label-DDkJbcXF.js +65 -0
- package/dist/ui/assets/mermaid-HWGCJPDP-ChoNjVB7.js +1 -0
- package/dist/ui/index.html +4 -2
- package/package.json +13 -9
- package/dist/ui/assets/chunk-YOKDWASO-CoIFS4KL.js +0 -143
- package/dist/ui/assets/highlighted-body-KPVGNVTW-B2JX-ghK.js +0 -1
- package/dist/ui/assets/index-BgkaRF27.css +0 -2
- package/dist/ui/assets/index-oRBr817g.js +0 -95
- package/dist/ui/assets/mermaid-HWGCJPDP-DA8ujGq3.js +0 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import{a as e,d as t,i as n,o as r,r as i,t as a}from"./clsx-BAOu4s7Q.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 ee(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function te(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ne=Symbol();function j(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ne?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function M(e,t){return typeof e==`function`?e(...t):!!e}function N(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 re=(()=>{let e=()=>d;return{isServer(){return e()},setIsServer(t){e=t}}})();function P(){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 F=u;function ie(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=F,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 I=ie(),ae=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 L(e){return Math.min(1e3*2**e,3e4)}function R(e){return(e??`online`)!==`online`||ae.isOnline()}var oe=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function se(e){let t=!1,n=0,r,i=P(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new oe(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>s.isFocused()&&(e.networkMode===`always`||ae.isOnline())&&e.canRun(),d=()=>R(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??(re.isServer()?0:3),o=e.retryDelay??L,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 ce=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??(re.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(l.clearTimeout(this.#e),this.#e=void 0)}};function le(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=>{N(e,()=>t.signal,()=>n=!0)},u=j(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?te:ee;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ue:z,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:z(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 z(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 ue(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var de=class extends ce{#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=me(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=me(this.options);e.data!==void 0&&(this.setState(pe(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===ne||!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=j(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`?le(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=se({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof oe&&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 oe){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,...fe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...pe(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),I.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function fe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:R(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function pe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function me(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 he=class extends ce{#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||ge(),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=se({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),I.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ge(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var _e=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 he({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=ve(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=ve(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=ve(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=ve(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){I.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){I.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return I.batch(()=>Promise.all(e.map(e=>e.continue().catch(f))))}};function ve(e){return e.options.scope?.id}var ye=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 de({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(){I.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){I.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){I.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){I.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},be=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ye,this.#t=e.mutationCache||new _e,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=ae.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 I.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;I.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return I.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=I.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(f).catch(f)}invalidateQueries(e,t={}){return I.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=I.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 ae.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===ne&&(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()}},xe=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Se=/^[\\/]{2}/;function Ce(e,t){return t+e.replace(/\\/g,`/`)}var we=`popstate`;function Te(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Ee(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return ke(``,{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:Ae(t)}return Me(t,n,null,e)}function B(e,t){if(e===!1||e==null)throw Error(t)}function V(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function De(){return Math.random().toString(36).substring(2,10)}function Oe(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 ke(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?je(t):t,state:n,key:t&&t.key||r||De(),mask:i}}function Ae({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 je(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 Me(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=Te(e)?e:ke(h.location,e,t);n&&n(r,e),l=u()+1;let d=Oe(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=Te(e)?e:ke(h.location,e,t);n&&n(r,e),l=u();let i=Oe(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 Ne(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(we,d),c=e,()=>{i.removeEventListener(we,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 Ne(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),B(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Ae(t);return i=i.replace(/ $/,`%20`),!n&&Se.test(i)&&(i=r+i),new URL(i,r)}var H=t(e(),1),Pe=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)}},Fe=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function Ie(e){return Fe.has(e)}var Le=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function Re(e){return Le.has(e)}function ze(e){return e.index===!0}function Be(e){let t={};return e.Component&&Object.assign(t,{element:H.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:H.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:H.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Ve(e,t=Be,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(B(e.index!==!0||!e.children,`Cannot specify children on an index route`),B(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),ze(e)){let n={...e,id:s};return r[s]=He(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=He(n,t(n)),e.children&&(n.children=Ve(e.children,t,o,r,i)),n}})}function He(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ue(e,t,n=`/`){return We(e,t,n,!1)}function We(e,t,n,r,i){let a=U((typeof t==`string`?je(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Ke(e),s=null,c=ft(a);for(let e=0;s==null&&e<o.length;++e)s=st(o[e],c,r);return s}function Ge(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 Ke(e){let t=qe(e);return Ye(t),t}function qe(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;B(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=St([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(B(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),qe(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:at(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=dt(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 Je(e.path))a(e,t,!0,n)}),t}function Je(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=Je(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 Ye(e){e.sort((e,t)=>e.score===t.score?ot(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Xe=/^:[\w-]+$/,Ze=/^:[\w-]+/,Qe=3.5,$e=3,et=2,tt=1,nt=10,rt=-2,it=e=>e===`*`;function at(e,t){let n=e.split(`/`),r=n.length;return n.some(it)&&(r+=rt),t&&(r+=et),n.filter(e=>!it(e)).reduce((e,t)=>e+(Xe.test(t)?$e:Ze.test(t)?Qe:t===``?tt:nt),r)}function ot(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 st(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?ut(u,l,s.matcher,s.compiledParams):lt(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=lt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:St([a,d.pathname]),pathnameBase:wt(St([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=St([a,d.pathnameBase]))}return o}function ct(e,t={}){let n=e;n.endsWith(`*`)&&n!==`*`&&!n.endsWith(`/*`)&&(V(!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 B(n===`?`||o!=null,`Missing ":${e}" param`),encodeURIComponent(i(o))+r}return e.replace(/\?$/g,``)}).filter(e=>!!e).join(`/`)}function lt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=dt(e.path,e.caseSensitive,e.end);return ut(e,t,n,r)}function ut(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 dt(e,t=!1,n=!0){V(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 ft(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return V(!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 U(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 pt({basename:e,pathname:t}){return t===`/`?e:St([e,t])}var mt=e=>xe.test(e);function ht(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?je(e):e,a;return n?(n=xt(n),a=n.startsWith(`/`)?gt(n.substring(1),`/`):gt(n,t)):a=t,{pathname:a,search:Tt(r),hash:Et(i)}}function gt(e,t){let n=Ct(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function _t(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 vt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function yt(e){let t=vt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function bt(e,t,n,r=!1){let i;typeof e==`string`?i=je(e):(i={...e},B(!i.pathname||!i.pathname.includes(`?`),_t(`?`,`pathname`,`search`,i)),B(!i.pathname||!i.pathname.includes(`#`),_t(`#`,`pathname`,`hash`,i)),B(!i.search||!i.search.includes(`#`),_t(`#`,`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=ht(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var xt=e=>e.replace(/[\\/]{2,}/g,`/`),St=e=>xt(e.join(`/`)),Ct=e=>e.replace(/\/+$/,``),wt=e=>Ct(e).replace(/^\/*/,`/`),Tt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Et=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Dt=(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})},Ot=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],kt=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 At(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function jt(e){return St(e.map(e=>e.route.path).filter(Boolean))||`/`}function Mt(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?je(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 Nt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Pt(e,t){let n=e;if(typeof n!=`string`||!xe.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Nt)try{let e=new URL(window.location.href),r=Se.test(n)?new URL(Ce(n,e.protocol)):new URL(n),a=U(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{V(!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 Ft=Symbol(`Uninstrumented`),It=new WeakMap;function Lt(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)=>Ut(await Wt(n.lazy,void 0,()=>e(...t),Gt))}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)=>Ut(await Wt(n[`lazy.middleware`],void 0,()=>t(...e),Gt))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>Ut(await Wt(n[`lazy.loader`],void 0,()=>t(...e),Gt))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>Ut(await Wt(n[`lazy.action`],void 0,()=>t(...e),Gt))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=zt(t.loader),i=async(...t)=>Ut(await Wt(n.loader,Kt(t[0]),()=>e(...t),Gt));e.hydrate===!0&&(i.hydrate=!0),Bt(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=zt(t.action),i=async(...t)=>Ut(await Wt(n.action,Kt(t[0]),()=>e(...t),Gt));Bt(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=zt(e),r=async(...e)=>Ut(await Wt(n.middleware,Kt(e[0]),()=>t(...e),Gt));return Bt(r,t),r})),r}function Rt(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=zt(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?Ae(i):`.`,...qt(e,a??{})};return Ut(await Wt(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=Vt(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...Gt(e),meta:o})))};Bt(r,t),e.navigate=r}if(n.fetch.length>0){let t=zt(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return Ut(await Wt(n.fetch,{href:o??`.`,fetcherKey:i,...qt(e,s??{})},async()=>{let n=Vt(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...Gt(e),meta:c})))};Bt(r,t),e.fetch=r}return e}function zt(e){return e[Ft]??e}function Bt(e,t){e[Ft]=t}function Vt(e,t){return It.set(e,t),()=>{It.get(e)===t&&It.delete(e)}}function Ht(e){let t=It.get(e);return It.delete(e),t}function Ut(e){if(e.type===`error`)throw e.value;return e.value}async function Wt(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=Wt(e,t,n,r,i,a-1),await s,B(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 Gt(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Kt(e){let{request:t,context:n,params:r}=e;return{...e,request:Jt(t),params:{...r},context:Yt(n)}}function qt(e,t){return{currentUrl:Ae(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 Jt(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Yt(e){return{get:t=>e.get(t)}}var Xt=[`POST`,`PUT`,`PATCH`,`DELETE`],Zt=new Set(Xt),Qt=[`GET`,...Xt],$t=new Set(Qt),en=new Set([301,302,303,307,308]),tn=new Set([307,308]),nn={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},rn={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},an={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},on=`remix-router-transitions`,sn=Symbol(`ResetLoaderData`),cn=class{#e;#t;#n;#r;constructor(e){this.#e=e,this.#t=Ke(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=Ke(e)}setHmrRoutes(e){this.#n=e,this.#r=Ke(e)}commitHmrRoutes(){this.#n&&(this.#e=this.#n,this.#t=this.#r,this.#n=void 0,this.#r=void 0)}};function ln(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;B(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),...Lt(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new cn(Ve(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||En,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=We(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=Xn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Yn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Xe(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Xe(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=>mn(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=hn(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:nn,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,ee=null,te=!1,ne=!1,j=new Set,M=new Map,N=0,re=-1,P=new Map,F=new Set,ie=new Map,I=new Map,ae=new Set,L=new Map,R,oe=null;function se(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(R){R(),R=void 0;return}V(L.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=He({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{R=e});e.history.go(r*-1),Be(i,{state:`blocked`,location:n,proceed(){Be(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,an),z({blockers:e})}}),E?.resolve(),E=null;return}return pe(t,n)}),n){xr(t,A);let e=()=>Sr(t,A);t.addEventListener(`pagehide`,e),ee=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||pe(`POP`,w.location,{initialHydration:!0}),C}function ce(){d&&d(),ee&&ee(),f.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>Ae(w.fetchers,t)),w.blockers.forEach((e,t)=>ze(t))}function le(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 z(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`&&(ae.has(t)?n.push(t):r.push(t))}),ae.forEach(e=>{!w.fetchers.has(e)&&!M.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=>Ae(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function ue(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&dr(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?Kn(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&!te&&(c=new Map(c),c.forEach((e,t)=>c.set(t,an)));let l=!te&&Ye(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&dr(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),te||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}}z({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:nn,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,D=!1,k=!1,te=!1,ne=!1,E?.resolve(),E=null,oe?.resolve(),oe=null}async function de(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=Cr();let n=E.promise;return e.history.go(t),n}let r=Ht(C),{path:i,submission:a,error:o}=fn(!1,dn(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),s;n?.mask&&(s={pathname:``,search:``,hash:``,...typeof n.mask==`string`?je(n.mask):{...w.location.mask,...n.mask}});let l=w.location,u=ke(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&&dr(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=He({currentLocation:l,nextLocation:u,historyAction:f});if(h){Be(h,{state:`blocked`,location:u,proceed(){Be(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),de(t,n)},reset(){let e=new Map(w.blockers);e.set(h,an),z({blockers:e})}});return}await pe(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 fe(){oe||=Cr(),we(),z({revalidation:`loading`});let e=oe.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(pe(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(pe(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function pe(t,n,r){O&&O.abort(),O=null,T=t,te=(r&&r.startUninterruptedRevalidation)===!0,Je(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:We(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!ne&&$n(w.location,n)&&!(r&&r.submission&&dr(r.submission.formMethod))){ue(n,{matches:a},{flushSync:o});return}let l=Xe(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),r?.instrumentationNavigateMetaReceiver){let t=mr(e.history,n,a);r.instrumentationNavigateMetaReceiver(t)}if(!a){let{error:e,notFoundMatches:t,route:r}=Ue(n.pathname);ue(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=Vn(e.history,n,O.signal,r&&r.submission),f=e.getContext?await e.getContext():new Pe,p;if(r&&r.pendingError)p=[Jn(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&dr(r.submission.formMethod)){let i=await me(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(ir(t)&&At(t.error)&&t.error.status===404){O=null,ue(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=gr(n,a,t,r.submission),o=!1,l.active=!1,d=Vn(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await he(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,ue(n,{matches:h||a,...qn(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function me(t,n,i,l,u,d,f,p,m={}){if(we(),z({navigation:_r(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}=Yn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Jn(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}=Ue(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=pr(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Xn(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Se(t,n,Mn(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(ar(h)){let n;return n=m&&m.replace!=null?m.replace:Bn(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await xe(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(ir(h)){let e=Jn(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 he(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||gr(n,i,l,p),x=p||m||hr(b),S=!te&&!g;if(d){if(S){let e=ge(v);z({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}=Yn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Jn(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}=Ue(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=pn(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,ne,j,ae,ie,F,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(re=++N,!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=Ie(e);return ue(n,{matches:i,loaderData:{},errors:v&&ir(v[1])?{[v[0]]:v[1].error}:null,...qn(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=ge(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=_e(E)),z(e,{flushSync:_})}E.forEach(e=>{H(e.key),e.controller&&M.set(e.key,e.controller)});let D=()=>E.forEach(e=>H(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await Ce(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>M.delete(e.key));let ee=Zn(k);if(ee)return await xe(t,ee.result,!0,{replace:h}),{shortCircuited:!0};if(ee=Zn(A),ee)return F.add(ee.key),await xe(t,ee.result,!0,{replace:h}),{shortCircuited:!0};let P=new Map(w.fetchers),{loaderData:I,errors:L}=Gn(w,i,k,v,E,A,P);g&&w.errors&&(L={...w.errors,...L});let R=Ie(P),oe=Le(re,P),se=R||oe||E.length>0;return{matches:i,loaderData:I,errors:L,...se?{workingFetchers:P}:{}}}function ge(e){if(e&&!ir(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function _e(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=vr(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function ve(t,n,r,i){H(t);let a=(i&&i.flushSync)===!0,o=Ht(C),l=s.activeRoutes,u=dn(w.location,w.matches,c,r,n,i?.relative),d=We(l,u,c,!1,s.branches),f=Xe(d,l,u);if(f.active&&f.matches&&(d=f.matches),o&&o(mr(e.history,u,d)),!d){Ee(t,n,Xn(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=fn(!0,u,i);if(h){Ee(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new Pe,_=(i&&i.preventScrollReset)===!0;if(m&&dr(m.formMethod)){await ye(t,n,p,d,g,f.active,a,_,m,i&&i.defaultShouldRevalidate);return}ie.set(t,{routeId:n,path:p}),await be(t,n,p,d,g,f.active,a,_,m)}async function ye(t,n,i,l,u,d,f,p,m,h){we(),ie.delete(t),Te(t,yr(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=Vn(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`){Ee(t,n,e.error,{flushSync:f});return}else if(e.matches)l=e.matches;else{Ee(t,n,Xn(404,{pathname:i}),{flushSync:f});return}}let v=pr(l,i);if(!v.route.action&&!v.route.lazy){Ee(t,n,Xn(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}M.set(t,g);let y=N,b=Mn(a,o,_,i,l,v,r,u),x=await Se(_,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){M.get(t)===g&&M.delete(t);return}if(ae.has(t)){if(ar(S)||ir(S)){Te(t,br(void 0));return}}else{if(ar(S))if(M.delete(t),re>y){Te(t,br(void 0));return}else return F.add(t),Te(t,vr(m)),xe(_,S,!1,{fetcherSubmission:m,preventScrollReset:p});if(ir(S)){Ee(t,n,S.error);return}}let C=w.navigation.location||w.location,E=Vn(e.history,C,g.signal),D=s.activeRoutes,k=w.navigation.state===`idle`?w.matches:We(D,w.navigation.location,c,!1,s.branches);B(k,`Didn't find any matches after fetcher action`);let A=++N;P.set(t,A);let{dsMatches:ee,revalidatingFetchers:te}=pn(E,u,a,o,e.history,w,k,m,C,r,!1,ne,j,ae,ie,F,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),I=vr(m,S.data),L=new Map(w.fetchers);L.set(t,I),te.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=L.get(t),r=vr(void 0,n?n.data:void 0);L.set(t,r),H(t),e.controller&&M.set(t,e.controller)}),z({fetchers:L});let R=()=>te.forEach(e=>H(e.key));g.signal.addEventListener(`abort`,R);let{loaderResults:oe,fetcherResults:se}=await Ce(ee,te,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,R),P.delete(t),M.delete(t),te.forEach(e=>M.delete(e.key));let ce=w.fetchers.has(t),le=e=>{if(!ce)return e;let n=new Map(e.fetchers);return n.set(t,br(S.data)),{...e,fetchers:n}},de=Zn(oe);if(de)return w=le(w),xe(E,de.result,!1,{preventScrollReset:p});if(de=Zn(se),de)return F.add(de.key),w=le(w),xe(E,de.result,!1,{preventScrollReset:p});let fe=new Map(w.fetchers);ce&&fe.set(t,br(S.data));let{loaderData:pe,errors:me}=Gn(w,k,oe,void 0,te,se,fe);Le(A,fe),w.navigation.state===`loading`&&A>re?(B(T,`Expected pending action`),O&&O.abort(),ue(w.navigation.location,{matches:k,loaderData:pe,errors:me,fetchers:fe})):(z({errors:me,loaderData:Kn(w.loaderData,pe,k,me),fetchers:fe}),ne=!1)}async function be(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);Te(t,vr(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Vn(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`){Ee(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{Ee(t,n,Xn(404,{pathname:i}),{flushSync:u});return}}let g=pr(s,i);M.set(t,m);let _=N,v=await Se(h,i,Mn(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(M.get(t)===m&&M.delete(t),!h.signal.aborted){if(ae.has(t)){Te(t,br(void 0));return}if(ar(y))if(re>_){Te(t,br(void 0));return}else{F.add(t),await xe(h,y,!1,{preventScrollReset:d});return}if(ir(y)){Ee(t,n,y.error);return}Te(t,br(y.data))}}async function xe(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ne=!0);let d=i.response.headers.get(`Location`);B(d,`Expected a Location header on the redirect Response`),d=Bn(d,new URL(r.url),c,e.history);let f=ke(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(mt(d)){let n=Ne(t,d,!0);e=n.origin!==t.location.origin||U(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=hr(w.navigation));let _=o||s;tn.has(i.response.status)&&_&&dr(_.formMethod)?await pe(p,f,{submission:{..._,formAction:d},preventScrollReset:l||D,enableViewTransition:a?k:void 0}):await pe(p,f,{overrideNavigation:gr(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?k:void 0})}async function Se(e,t,n,r,i){let a,o={};try{a=await Nn(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(!dr(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(rr(r)){let i=r.result;o[t]={type:`redirect`,response:Ln(i,e,t,n,c)}}else o[t]=await In(r);return o}async function Ce(e,t,n,r,i){let a=Se(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Se(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:Xn(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function we(){ne=!0,ie.forEach((e,t)=>{M.has(t)&&j.add(t),H(t)})}function Te(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),z({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Ee(e,t,n,r={}){let i=Jn(w.matches,t),a=new Map(w.fetchers);Ae(a,e),z({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function De(e){return I.set(e,(I.get(e)||0)+1),ae.has(e)&&ae.delete(e),w.fetchers.get(e)||rn}function Oe(e,t){H(e,t?.reason),Te(e,br(null))}function Ae(e,t){let n=w.fetchers.get(t);M.has(t)&&!(n&&n.state===`loading`&&P.has(t))&&H(t),ie.delete(t),P.delete(t),F.delete(t),ae.delete(t),j.delete(t),e.delete(t)}function Me(e){let t=(I.get(e)||0)-1;t<=0?(I.delete(e),ae.add(e)):I.set(e,t),z({fetchers:new Map(w.fetchers)})}function H(e,t){let n=M.get(e);n&&(n.abort(t),M.delete(e))}function Fe(e,t){for(let n of e){let e=t.get(n);B(e,`Expected fetcher: ${n}`);let r=br(e.data);t.set(n,r)}}function Ie(e){let t=[],n=!1;for(let r of F){let i=e.get(r);B(i,`Expected fetcher: ${r}`),i.state===`loading`&&(F.delete(r),t.push(r),n=!0)}return Fe(t,e),n}function Le(e,t){let n=[];for(let[r,i]of P)if(i<e){let e=t.get(r);B(e,`Expected fetcher: ${r}`),e.state===`loading`&&(H(r),P.delete(r),n.push(r))}return Fe(n,t),n.length>0}function Re(e,t){let n=w.blockers.get(e)||an;return L.get(e)!==t&&L.set(e,t),n}function ze(e){w.blockers.delete(e),L.delete(e)}function Be(e,t){let n=w.blockers.get(e)||an;B(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),z({blockers:r})}function He({currentLocation:e,nextLocation:t,historyAction:n}){if(L.size===0)return;L.size>1&&V(!1,`A router only supports one blocker at a time`);let r=Array.from(L.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 Ue(e){let t=Xn(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Yn(n);return{notFoundMatches:r,route:i,error:t}}function Ke(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===nn){_=!0;let e=Ye(w.location,w.matches);e!=null&&z({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function qe(e,t){return h&&h(e,t.map(e=>Ge(e,w.loaderData)))||e.key}function Je(e,t){if(m&&g){let n=qe(e,t);m[n]=g()}}function Ye(e,t){if(m){let n=qe(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Xe(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:We(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:We(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||yn(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=We(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=We(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&Qe(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=We(s.activeRoutes,n,c,!0,u),!f||Qe(l,f))return{type:`success`,matches:null};l=f}}function Qe(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function $e(e){o={},s.setHmrRoutes(Ve(e,a,void 0,o))}function et(e,t,n=!1){yn(e,t,s,o,a,n),s.hasHMRRoutes||z({})}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:se,subscribe:le,enableScrollRestoration:Ke,navigate:de,fetch:ve,revalidate:fe,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:De,resetFetcher:Oe,deleteFetcher:Me,dispose:ce,getBlocker:Re,deleteBlocker:ze,patchRoutes:et,_internalFetchControllers:M,_internalSetRoutes:$e,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){z(e)}},e.instrumentations&&(C=Rt(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function un(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function dn(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=bt(r||`.`,yt(o),U(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=fr(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=pt({basename:n,pathname:c.pathname})),Ae(c)}function fn(e,t,n){if(!n||!un(n))return{path:t};if(n.formMethod&&!ur(n.formMethod))return{path:t,error:Xn(405,{method:n.formMethod})};let r=()=>({path:t,error:Xn(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Qn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!dr(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(!dr(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()}}}B(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Hn(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Hn(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Un(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Un(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(dr(c.formMethod))return{path:t,submission:c};let l=je(t);return e&&l.search&&fr(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Ae(l),submission:c}}function pn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?ir(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&&ir(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=jt(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(!mn(s))f=!1;else if(u){let{shouldLoad:e}=hn(s,a.loaderData,a.errors);f=e}else gn(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return jn(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?_n(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return jn(n,r,e,c,k,i,l,t,vn(i,m),m,x)}),ee=[];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=We(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;ee.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=pr(b,e.path),C=new AbortController,w=Vn(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Mn(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Mn(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};vn(S,a)&&(T=Mn(n,r,w,e.path,b,S,l,t,a))}T&&ee.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:ee}}function mn(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function hn(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!mn(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 gn(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function _n(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function vn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function yn(e,t,n,r,i,a){let o;if(e){let t=r[e];B(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=>bn(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Ve(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]=Ve([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 bn(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=>bn(e,t)))??!1:!1}var xn=new WeakMap,Sn=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(B(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=xn.get(i);o||(o={},xn.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=Ie(e),n=i[e]!==void 0;if(t)V(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)V(!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},Cn=new WeakMap;function wn(e,t,n,r,i){let a=n[e.id];if(B(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Cn.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{B(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=Re(e),o=a[e]!==void 0;i?V(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?V(!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 Cn.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=Sn({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 Tn(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 En(e){return e.matches.some(e=>e.route.middleware)?Dn(e,()=>Tn(e)):Tn(e)}function Dn(e,t){return On(e,t,e=>{if(lr(e))throw e;return e},tr,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{[Jn(r,a).route.id]:{type:`error`,result:t}}}}}async function On(e,t,n,r,i){let{matches:a,...o}=e;return await kn(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function kn(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 kn(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 An(e,t,n,r,i){let a=Sn({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=wn(r.route,dr(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function jn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=An(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?vn(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?vn(a,{...l,defaultShouldRevalidate:e}):vn(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!dr(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(dr(n.method)||!p)?Pn({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 Mn(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?jn(e,t,n,r,jt(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:An(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Nn(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:Mt(t,n),pattern:jt(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 Dn(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 Pn({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=dr(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:Mt(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 Xn(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 Xn(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Fn(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 In(e){let{result:t,type:n}=e;if(sr(t)){let e;try{e=await Fn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new kt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?or(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:er(t),statusCode:At(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:At(t)?t.status:void 0}:or(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 Ln(e,t,n,r,i){let a=e.headers.get(`Location`);if(B(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!mt(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=dn(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Rn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function zn(e){try{return Rn.includes(new URL(e).protocol)}catch{return!1}}function Bn(e,t,n,r){if(mt(e)){let r=e,i=Se.test(r)?new URL(Ce(r,t.protocol)):new URL(r);if(zn(i.toString()))throw Error(`Invalid redirect location`);let a=U(i.pathname,n)!=null;if(i.origin===t.origin&&a)return xt(i.pathname)+i.search+i.hash}try{if(zn(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Vn(e,t,n,r){let i=e.createURL(Qn(t)).toString(),a={signal:n};if(r&&dr(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=Hn(r.formData):a.body=r.formData}return new Request(i,a)}function Hn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Un(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Wn(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&ir(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(B(!ar(f),`Cannot handle redirect results in processLoaderData`),ir(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Jn(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=sn),c||(c=!0,s=At(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 Gn(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Wn(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(B(s,`Did not find corresponding fetcher result`),ir(s)){let t=Jn(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(ar(s))B(!1,`Unhandled fetcher revalidation redirect`);else{let e=br(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Kn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==sn).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 qn(e){return e?ir(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Jn(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 Yn(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 Xn(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 kt(e||500,o,Error(s),!0)}function Zn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(ar(r))return{key:n,result:r}}}function Qn(e){return Ae({...typeof e==`string`?je(e):e,hash:``})}function $n(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function er(e){return new kt(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function tr(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&nr(t))}function nr(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function rr(e){return sr(e.result)&&en.has(e.result.status)}function ir(e){return e.type===`error`}function ar(e){return(e&&e.type)===`redirect`}function or(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function sr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function cr(e){return en.has(e)}function lr(e){return sr(e)&&cr(e.status)&&e.headers.has(`Location`)}function ur(e){return $t.has(e.toUpperCase())}function dr(e){return Zt.has(e.toUpperCase())}function fr(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function pr(e,t){let n=typeof t==`string`?je(t).search:t.search;if(e[e.length-1].route.index&&fr(n||``))return e[e.length-1];let r=vt(e);return r[r.length-1]}function mr(e,t,n){return{url:Mt(e.createURL(t),t),pattern:n?jt(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function hr(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 gr(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 _r(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 vr(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 yr(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 br(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 xr(e,t){try{let n=e.sessionStorage.getItem(on);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 Sr(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(on,JSON.stringify(n))}catch(e){V(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Cr(){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 wr=H.createContext(null);wr.displayName=`DataRouter`;var Tr=H.createContext(null);Tr.displayName=`DataRouterState`;var Er=H.createContext(!1);function Dr(){return H.useContext(Er)}var Or=H.createContext({isTransitioning:!1});Or.displayName=`ViewTransition`;var kr=H.createContext(new Map);kr.displayName=`Fetchers`;var Ar=H.createContext(null);Ar.displayName=`Await`;var jr=H.createContext(null);jr.displayName=`Navigation`;var Mr=H.createContext(null);Mr.displayName=`Location`;var Nr=H.createContext({outlet:null,matches:[],isDataRoute:!1});Nr.displayName=`Route`;var Pr=H.createContext(null);Pr.displayName=`RouteError`;var Fr=`REACT_ROUTER_ERROR`,Ir=`REDIRECT`,Lr=`ROUTE_ERROR_RESPONSE`;function Rr(e){if(e.startsWith(`${Fr}:${Ir}:{`))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 zr(e){if(e.startsWith(`${Fr}:${Lr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new kt(t.status,t.statusText,t.data)}catch{}}function Br(e,{relative:t}={}){B(Vr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=H.useContext(jr),{hash:i,pathname:a,search:o}=Yr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:St([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Vr(){return H.useContext(Mr)!=null}function Hr(){return B(Vr(),`useLocation() may be used only in the context of a <Router> component.`),H.useContext(Mr).location}var Ur=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Wr(){let{isDataRoute:e}=H.useContext(Nr);return e?hi():Gr()}function Gr(){B(Vr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=H.useContext(wr),{basename:t,navigator:n}=H.useContext(jr),{matches:r}=H.useContext(Nr),{pathname:i}=Hr(),a=JSON.stringify(yt(r)),o=H.useRef(!1);return H.useLayoutEffect(()=>{o.current=!0}),H.useCallback((r,s={})=>{if(V(o.current,Ur),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=bt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:St([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Kr=H.createContext(null);function qr(e){let t=H.useContext(Nr).outlet;return H.useMemo(()=>t&&H.createElement(Kr.Provider,{value:e},t),[t,e])}function Jr(){let{matches:e}=H.useContext(Nr);return e[e.length-1]?.params??{}}function Yr(e,{relative:t}={}){let{matches:n}=H.useContext(Nr),{pathname:r}=Hr(),i=JSON.stringify(yt(n));return H.useMemo(()=>bt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Xr(e,t,n){B(Vr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=H.useContext(jr),{matches:i}=H.useContext(Nr),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=Hr(),l;if(t){let e=typeof t==`string`?je(t):t;B(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})):Ue(e,{pathname:d}),p=ri(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:St([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:St([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?H.createElement(Mr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function Zr(){let e=mi(),t=At(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return H.createElement(H.Fragment,null,H.createElement(`h2`,null,`Unexpected Application Error!`),H.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?H.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Qr=H.createElement(Zr,null),$r=class extends H.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=Er;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=zr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:H.createElement(Nr.Provider,{value:this.props.routeContext},H.createElement(Pr.Provider,{value:e,children:this.props.component}));return this.context?H.createElement(ti,{error:e},t):t}},ei=new WeakMap;function ti({children:e,error:t}){let{basename:n}=H.useContext(jr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Rr(t.digest);if(e){let r=ei.get(t);if(r)throw r;let i=Pt(e.location,n),a=i.absoluteURL||i.to;if(zn(a))throw Error(`Invalid redirect location`);if(Nt&&!ei.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 ei.set(t,n),n}return H.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function ni({routeContext:e,match:t,children:n}){let r=H.useContext(wr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),H.createElement(Nr.Provider,{value:e},n)}function ri(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);B(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:jt(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||Qr,o&&(s<0&&c===0?(_i(`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?H.createElement(n.route.Component,null):n.route.element?n.route.element:e,H.createElement(ni,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?H.createElement($r,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function ii(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ai(e){let t=H.useContext(wr);return B(t,ii(e)),t}function oi(e){let t=H.useContext(Tr);return B(t,ii(e)),t}function si(e){let t=H.useContext(Nr);return B(t,ii(e)),t}function ci(e){let t=si(e),n=t.matches[t.matches.length-1];return B(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function li(){return ci(`useRouteId`)}function ui(){let e=oi(`useNavigation`);return H.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function di(){let e=ai(`useRevalidator`),t=oi(`useRevalidator`),n=H.useCallback(async()=>{await e.router.revalidate()},[e.router]);return H.useMemo(()=>({revalidate:n,state:t.revalidation}),[n,t.revalidation])}function fi(){let{matches:e,loaderData:t}=oi(`useMatches`);return H.useMemo(()=>e.map(e=>Ge(e,t)),[e,t])}function pi(){let e=oi(`useLoaderData`),t=ci(`useLoaderData`);return e.loaderData[t]}function mi(){let e=H.useContext(Pr),t=oi(`useRouteError`),n=ci(`useRouteError`);return e===void 0?t.errors?.[n]:e}function hi(){let{router:e}=ai(`useNavigate`),t=ci(`useNavigate`),n=H.useRef(!1);return H.useLayoutEffect(()=>{n.current=!0}),H.useCallback(async(r,i={})=>{V(n.current,Ur),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var gi={};function _i(e,t,n){!t&&!gi[e]&&(gi[e]=!0,V(!1,n))}var vi;function W(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var yi=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},bi=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(vi=globalThis).__zod_globalConfig??(vi.__zod_globalConfig={});var xi=globalThis.__zod_globalConfig;function Si(e){return e&&Object.assign(xi,e),xi}function Ci(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 wi(e,t){return typeof t==`bigint`?t.toString():t}function Ti(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function Ei(e){return e==null}function Di(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Oi(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var ki=Symbol(`evaluating`);function G(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ki)return r===void 0&&(r=ki,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ai(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ji(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Mi(e){return JSON.stringify(e)}function Ni(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Pi=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Fi(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ii=Ti(()=>{if(xi.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Li(e){if(Fi(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Fi(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Ri(e){return Li(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var zi=new Set([`string`,`number`,`symbol`]);function Bi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Vi(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function K(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 Hi(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Ui={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Wi(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`);return Vi(e,ji(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Ai(this,`shape`,e),e},checks:[]}))}function Gi(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`);return Vi(e,ji(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Ai(this,`shape`,r),r},checks:[]}))}function Ki(e,t){if(!Li(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Vi(e,ji(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ai(this,`shape`,n),n}}))}function qi(e,t){if(!Li(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Vi(e,ji(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ai(this,`shape`,n),n}}))}function Ji(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Vi(e,ji(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ai(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Yi(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Vi(t,ji(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Ai(this,`shape`,i),i},checks:[]}))}function Xi(e,t,n){return Vi(t,ji(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Ai(this,`shape`,i),i}}))}function Zi(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 Qi(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 $i(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ea(e){return typeof e==`string`?e:e?.message}function ta(e,t,n){let r=e.message?e.message:ea(e.inst?._zod.def?.error?.(e))??ea(t?.error?.(e))??ea(n.customError?.(e))??ea(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function na(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function ra(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var ia=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,wi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},aa=W(`$ZodError`,ia),oa=W(`$ZodError`,ia,{Parent:Error});function sa(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ca(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];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function la(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 ua(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 ${la(e.path)}`);return t.join(`
|
|
2
|
+
`)}var da=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new yi;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ta(e,a,Si())));throw Pi(t,i?.callee),t}return o.value},fa=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ta(e,a,Si())));throw Pi(t,i?.callee),t}return o.value},pa=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 yi;return a.issues.length?{success:!1,error:new(e??aa)(a.issues.map(e=>ta(e,i,Si())))}:{success:!0,data:a.value}},ma=pa(oa),ha=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?{success:!1,error:new e(a.issues.map(e=>ta(e,i,Si())))}:{success:!0,data:a.value}},ga=ha(oa),_a=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return da(e)(t,n,i)},va=e=>(t,n,r)=>da(e)(t,n,r),ya=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return fa(e)(t,n,i)},ba=e=>async(t,n,r)=>fa(e)(t,n,r),xa=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return pa(e)(t,n,i)},Sa=e=>(t,n,r)=>pa(e)(t,n,r),Ca=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ha(e)(t,n,i)},wa=e=>async(t,n,r)=>ha(e)(t,n,r),Ta=/^[cC][0-9a-z]{6,}$/,Ea=/^[0-9a-z]+$/,Da=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Oa=/^[0-9a-vA-V]{20}$/,ka=/^[A-Za-z0-9]{27}$/,Aa=/^[a-zA-Z0-9_-]{21}$/,ja=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ma=/^([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})$/,Na=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)$/,Pa=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Fa=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Ia(){return new RegExp(Fa,`u`)}var La=/^(?:(?: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])$/,Ra=/^(([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}|:))$/,za=/^((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])$/,Ba=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Va=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ha=/^[A-Za-z0-9_-]*$/,Ua=/^https?$/,Wa=/^\+[1-9]\d{6,14}$/,Ga=`(?:(?:\\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])))`,Ka=RegExp(`^${Ga}$`);function qa(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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ja(e){return RegExp(`^${qa(e)}$`)}function Ya(e){let t=qa({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Ga}T(?:${r})$`)}var Xa=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Za=/^-?\d+$/,Qa=/^-?\d+(?:\.\d+)?$/,$a=/^(?:true|false)$/i,eo=/^null$/i,to=/^[^A-Z]*$/,no=/^[^a-z]*$/,ro=W(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),io={number:`number`,bigint:`bigint`,object:`date`},ao=W(`$ZodCheckLessThan`,(e,t)=>{ro.init(e,t);let n=io[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin: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})}}),oo=W(`$ZodCheckGreaterThan`,(e,t)=>{ro.init(e,t);let n=io[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin: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})}}),so=W(`$ZodCheckMultipleOf`,(e,t)=>{ro.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),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`?n.value%t.value===BigInt(0):Oi(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})}}),co=W(`$ZodCheckNumberFormat`,(e,t)=>{ro.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ui[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Za)}),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})}}),lo=W(`$ZodCheckMaxLength`,(e,t)=>{var n;ro.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ei(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=na(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),uo=W(`$ZodCheckMinLength`,(e,t)=>{var n;ro.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ei(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=na(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fo=W(`$ZodCheckLengthEquals`,(e,t)=>{var n;ro.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ei(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=na(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),po=W(`$ZodCheckStringFormat`,(e,t)=>{var n,r;ro.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),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=()=>{})}),mo=W(`$ZodCheckRegex`,(e,t)=>{po.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})}}),ho=W(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=to,po.init(e,t)}),go=W(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=no,po.init(e,t)}),_o=W(`$ZodCheckIncludes`,(e,t)=>{ro.init(e,t);let n=Bi(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),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})}}),vo=W(`$ZodCheckStartsWith`,(e,t)=>{ro.init(e,t);let n=RegExp(`^${Bi(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(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})}}),yo=W(`$ZodCheckEndsWith`,(e,t)=>{ro.init(e,t);let n=RegExp(`.*${Bi(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(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})}}),bo=W(`$ZodCheckOverwrite`,(e,t)=>{ro.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),xo=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--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?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
|
+
`))}},So={major:4,minor:4,patch:3},q=W(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=So;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Zi(e),i;for(let a of t){if(a._zod.def.when){if(Qi(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new yi;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Zi(e,t))});else{if(e.issues.length===t)continue;r||=Zi(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Zi(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new yi;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new yi;return o.then(e=>t(e,r,a))}return t(o,r,a)}}G(e,`~standard`,()=>({validate:t=>{try{let n=ma(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ga(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Co=W(`$ZodString`,(e,t)=>{q.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Xa(e._zod.bag),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}}),J=W(`$ZodStringFormat`,(e,t)=>{po.init(e,t),Co.init(e,t)}),wo=W(`$ZodGUID`,(e,t)=>{t.pattern??=Ma,J.init(e,t)}),To=W(`$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??=Na(e)}else t.pattern??=Na();J.init(e,t)}),Eo=W(`$ZodEmail`,(e,t)=>{t.pattern??=Pa,J.init(e,t)}),Do=W(`$ZodURL`,(e,t)=>{J.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Ua.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Oo=W(`$ZodEmoji`,(e,t)=>{t.pattern??=Ia(),J.init(e,t)}),ko=W(`$ZodNanoID`,(e,t)=>{t.pattern??=Aa,J.init(e,t)}),Ao=W(`$ZodCUID`,(e,t)=>{t.pattern??=Ta,J.init(e,t)}),jo=W(`$ZodCUID2`,(e,t)=>{t.pattern??=Ea,J.init(e,t)}),Mo=W(`$ZodULID`,(e,t)=>{t.pattern??=Da,J.init(e,t)}),No=W(`$ZodXID`,(e,t)=>{t.pattern??=Oa,J.init(e,t)}),Po=W(`$ZodKSUID`,(e,t)=>{t.pattern??=ka,J.init(e,t)}),Fo=W(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ya(t),J.init(e,t)}),Io=W(`$ZodISODate`,(e,t)=>{t.pattern??=Ka,J.init(e,t)}),Lo=W(`$ZodISOTime`,(e,t)=>{t.pattern??=Ja(t),J.init(e,t)}),Ro=W(`$ZodISODuration`,(e,t)=>{t.pattern??=ja,J.init(e,t)}),zo=W(`$ZodIPv4`,(e,t)=>{t.pattern??=La,J.init(e,t),e._zod.bag.format=`ipv4`}),Bo=W(`$ZodIPv6`,(e,t)=>{t.pattern??=Ra,J.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Vo=W(`$ZodCIDRv4`,(e,t)=>{t.pattern??=za,J.init(e,t)}),Ho=W(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ba,J.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Uo(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Wo=W(`$ZodBase64`,(e,t)=>{t.pattern??=Va,J.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Uo(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Go(e){if(!Ha.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Uo(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Ko=W(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ha,J.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Go(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),qo=W(`$ZodE164`,(e,t)=>{t.pattern??=Wa,J.init(e,t)});function Jo(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 Yo=W(`$ZodJWT`,(e,t)=>{J.init(e,t),e._zod.check=n=>{Jo(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Xo=W(`$ZodNumber`,(e,t)=>{q.init(e,t),e._zod.pattern=e._zod.bag.pattern??Qa,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:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Zo=W(`$ZodNumberFormat`,(e,t)=>{co.init(e,t),Xo.init(e,t)}),Qo=W(`$ZodBoolean`,(e,t)=>{q.init(e,t),e._zod.pattern=$a,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}}),$o=W(`$ZodNull`,(e,t)=>{q.init(e,t),e._zod.pattern=eo,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}}),es=W(`$ZodUnknown`,(e,t)=>{q.init(e,t),e._zod.parse=e=>e}),ts=W(`$ZodNever`,(e,t)=>{q.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ns(e,t,n){e.issues.length&&t.issues.push(...$i(n,e.issues)),t.value[n]=e.value}var rs=W(`$ZodArray`,(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>ns(t,n,e))):ns(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function is(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...$i(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function as(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Hi(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function os(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>is(e,n,i,t,u,d))):is(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var ss=W(`$ZodObject`,(e,t)=>{if(q.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=Ti(()=>as(t));G(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Fi,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>is(n,t,e,s,r,i))):is(a,t,e,s,r,i)}return i?os(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),cs=W(`$ZodObjectJIT`,(e,t)=>{ss.init(e,t);let n=e._zod.parse,r=Ti(()=>as(t)),i=e=>{let t=new xo([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Mi(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Mi(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
5
|
+
if (${n}.issues.length) {
|
|
6
|
+
if (${o} in input) {
|
|
7
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
8
|
+
...iss,
|
|
9
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
10
|
+
})));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (${n}.value === undefined) {
|
|
15
|
+
if (${o} in input) {
|
|
16
|
+
newResult[${o}] = undefined;
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
newResult[${o}] = ${n}.value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
`):c?t.write(`
|
|
23
|
+
if (${n}.issues.length) {
|
|
24
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
25
|
+
...iss,
|
|
26
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${n}.value === undefined) {
|
|
31
|
+
if (${o} in input) {
|
|
32
|
+
newResult[${o}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${o}] = ${n}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`):t.write(`
|
|
39
|
+
const ${n}_present = ${o} in input;
|
|
40
|
+
if (${n}.issues.length) {
|
|
41
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
42
|
+
...iss,
|
|
43
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
44
|
+
})));
|
|
45
|
+
}
|
|
46
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
47
|
+
payload.issues.push({
|
|
48
|
+
code: "invalid_type",
|
|
49
|
+
expected: "nonoptional",
|
|
50
|
+
input: undefined,
|
|
51
|
+
path: [${o}]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (${n}_present) {
|
|
56
|
+
if (${n}.value === undefined) {
|
|
57
|
+
newResult[${o}] = undefined;
|
|
58
|
+
} else {
|
|
59
|
+
newResult[${o}] = ${n}.value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Fi,s=!xi.jitless,c=s&&Ii.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?os([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function ls(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=>!Zi(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=>ta(e,r,Si())))}),t)}var us=W(`$ZodUnion`,(e,t)=>{q.init(e,t),G(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),G(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),G(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),G(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Di(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=>ls(t,r,e,i)):ls(o,r,e,i)}}),ds=W(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,us.init(e,t);let n=e._zod.parse;G(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Ti(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!Fi(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._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()),input:o,path:[t.discriminator],inst:e}),i)}}),fs=W(`$ZodIntersection`,(e,t)=>{q.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])=>ms(e,t,n)):ms(e,i,a)}});function ps(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Li(e)&&Li(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ps(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=ps(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 ms(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Zi(e))return e;let o=ps(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var hs=W(`$ZodRecord`,(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Li(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>ta(e,r,Si())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...$i(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...$i(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Qa.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ta(e,r,Si())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...$i(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...$i(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),gs=W(`$ZodEnum`,(e,t)=>{q.init(e,t);let n=Ci(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>zi.has(typeof e)).map(e=>typeof e==`string`?Bi(e):e.toString()).join(`|`)})$`),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}}),_s=W(`$ZodLiteral`,(e,t)=>{if(q.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Bi(e):e?Bi(e.toString()):String(e)).join(`|`)})$`),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}}),vs=W(`$ZodTransform`,(e,t)=>{q.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new bi(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.fallback=!0,n));if(i instanceof Promise)throw new yi;return n.value=i,n.fallback=!0,n}});function ys(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var bs=W(`$ZodOptional`,(e,t)=>{q.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,G(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),G(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Di(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>ys(e,r)):ys(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),xs=W(`$ZodExactOptional`,(e,t)=>{bs.init(e,t),G(e._zod,`values`,()=>t.innerType._zod.values),G(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ss=W(`$ZodNullable`,(e,t)=>{q.init(e,t),G(e._zod,`optin`,()=>t.innerType._zod.optin),G(e._zod,`optout`,()=>t.innerType._zod.optout),G(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Di(e.source)}|null)$`):void 0}),G(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Cs=W(`$ZodDefault`,(e,t)=>{q.init(e,t),e._zod.optin=`optional`,G(e._zod,`values`,()=>t.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=>ws(e,t)):ws(r,t)}});function ws(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ts=W(`$ZodPrefault`,(e,t)=>{q.init(e,t),e._zod.optin=`optional`,G(e._zod,`values`,()=>t.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))}),Es=W(`$ZodNonOptional`,(e,t)=>{q.init(e,t),G(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].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=>Ds(t,e)):Ds(i,e)}});function Ds(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Os=W(`$ZodCatch`,(e,t)=>{q.init(e,t),e._zod.optin=`optional`,G(e._zod,`optout`,()=>t.innerType._zod.optout),G(e._zod,`values`,()=>t.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(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ta(e,n,Si()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ta(e,n,Si()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),ks=W(`$ZodPipe`,(e,t)=>{q.init(e,t),G(e._zod,`values`,()=>t.in._zod.values),G(e._zod,`optin`,()=>t.in._zod.optin),G(e._zod,`optout`,()=>t.out._zod.optout),G(e._zod,`propValues`,()=>t.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=>As(e,t.in,n)):As(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>As(e,t.out,n)):As(r,t.out,n)}});function As(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var js=W(`$ZodPreprocess`,(e,t)=>{ks.init(e,t)}),Ms=W(`$ZodReadonly`,(e,t)=>{q.init(e,t),G(e._zod,`propValues`,()=>t.innerType._zod.propValues),G(e._zod,`values`,()=>t.innerType._zod.values),G(e._zod,`optin`,()=>t.innerType?._zod?.optin),G(e._zod,`optout`,()=>t.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(Ns):Ns(r)}});function Ns(e){return e.value=Object.freeze(e.value),e}var Ps=W(`$ZodLazy`,(e,t)=>{q.init(e,t),G(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),G(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),G(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),G(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),G(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Fs=W(`$ZodCustom`,(e,t)=>{ro.init(e,t),q.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=>Is(t,n,r,e));Is(i,n,r,e)}});function Is(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(ra(e))}}var Ls,Rs=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 zs(){return new Rs}(Ls=globalThis).__zod_globalRegistry??(Ls.__zod_globalRegistry=zs());var Bs=globalThis.__zod_globalRegistry;function Vs(e,t){return new e({type:`string`,...K(t)})}function Hs(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...K(t)})}function Us(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...K(t)})}function Ws(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...K(t)})}function Gs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...K(t)})}function Ks(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...K(t)})}function qs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...K(t)})}function Js(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...K(t)})}function Ys(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...K(t)})}function Xs(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...K(t)})}function Zs(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...K(t)})}function Qs(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...K(t)})}function $s(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...K(t)})}function ec(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...K(t)})}function tc(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...K(t)})}function nc(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...K(t)})}function rc(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...K(t)})}function ic(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...K(t)})}function ac(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...K(t)})}function oc(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...K(t)})}function sc(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...K(t)})}function cc(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...K(t)})}function lc(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...K(t)})}function uc(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...K(t)})}function dc(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...K(t)})}function fc(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...K(t)})}function pc(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...K(t)})}function mc(e,t){return new e({type:`number`,checks:[],...K(t)})}function hc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...K(t)})}function gc(e,t){return new e({type:`boolean`,...K(t)})}function _c(e,t){return new e({type:`null`,...K(t)})}function vc(e){return new e({type:`unknown`})}function yc(e,t){return new e({type:`never`,...K(t)})}function bc(e,t){return new ao({check:`less_than`,...K(t),value:e,inclusive:!1})}function xc(e,t){return new ao({check:`less_than`,...K(t),value:e,inclusive:!0})}function Sc(e,t){return new oo({check:`greater_than`,...K(t),value:e,inclusive:!1})}function Cc(e,t){return new oo({check:`greater_than`,...K(t),value:e,inclusive:!0})}function wc(e,t){return new so({check:`multiple_of`,...K(t),value:e})}function Tc(e,t){return new lo({check:`max_length`,...K(t),maximum:e})}function Ec(e,t){return new uo({check:`min_length`,...K(t),minimum:e})}function Dc(e,t){return new fo({check:`length_equals`,...K(t),length:e})}function Oc(e,t){return new mo({check:`string_format`,format:`regex`,...K(t),pattern:e})}function kc(e){return new ho({check:`string_format`,format:`lowercase`,...K(e)})}function Ac(e){return new go({check:`string_format`,format:`uppercase`,...K(e)})}function jc(e,t){return new _o({check:`string_format`,format:`includes`,...K(t),includes:e})}function Mc(e,t){return new vo({check:`string_format`,format:`starts_with`,...K(t),prefix:e})}function Nc(e,t){return new yo({check:`string_format`,format:`ends_with`,...K(t),suffix:e})}function Pc(e){return new bo({check:`overwrite`,tx:e})}function Fc(e){return Pc(t=>t.normalize(e))}function Ic(){return Pc(e=>e.trim())}function Lc(){return Pc(e=>e.toLowerCase())}function Rc(){return Pc(e=>e.toUpperCase())}function zc(){return Pc(e=>Ni(e))}function Bc(e,t,n){return new e({type:`array`,element:t,...K(n)})}function Vc(e,t,n){let r=K(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Hc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...K(n)})}function Uc(e,t){let n=Wc(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ra(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ra(r))}},e(t.value,t)),t);return n}function Wc(e,t){let n=new ro({check:`custom`,...K(t)});return n._zod.check=e,n}function Gc(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??Bs,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function Y(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);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,Y(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Jc(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 Kc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);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}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+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>
|
|
64
|
+
|
|
65
|
+
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}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function qc(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)):Object.assign(i,s),Object.assign(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??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);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)}Object.assign(i,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??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}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:Xc(t,`input`,e.processors),output:Xc(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Jc(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 Jc(r.element,n);if(r.type===`set`)return Jc(r.valueType,n);if(r.type===`lazy`)return Jc(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`)return Jc(r.innerType,n);if(r.type===`intersection`)return Jc(r.left,n)||Jc(r.right,n);if(r.type===`record`||r.type===`map`)return Jc(r.keyType,n)||Jc(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Jc(r.in,n)||Jc(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Jc(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Jc(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Jc(e,n))return!0;return!!(r.rest&&Jc(r.rest,n))}return!1}var Yc=(e,t={})=>n=>{let r=Gc({...n,processors:t});return Y(e,r),Kc(r,e),qc(r,e)},Xc=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Gc({...i??{},target:a,io:t,processors:n});return Y(e,o),Kc(o,e),qc(o,e)},Zc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Qc=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Zc[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];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}))])}},$c=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},el=(e,t,n,r)=>{n.type=`boolean`},tl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},nl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},rl=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},il=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},al=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},ol=(e,t,n,r)=>{n.not={}},sl=(e,t,n,r)=>{},cl=(e,t,n,r)=>{},ll=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},ul=(e,t,n,r)=>{let i=e._zod.def,a=Ci(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},dl=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);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},fl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},pl=(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},ml=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},hl=(e,t,n,r)=>{n.type=`boolean`},gl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},_l=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},vl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},yl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},bl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},xl=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Y(a.element,t,{...r,path:[...r.path,`items`]})},Sl=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=Y(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Y(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Cl=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Y(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},wl=(e,t,n,r)=>{let i=e._zod.def,a=Y(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Y(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Tl=(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)=>Y(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Y(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},El=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Y(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=Y(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=Y(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Dl=(e,t,n,r)=>{let i=e._zod.def,a=Y(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`}]},Ol=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},kl=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Al=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},jl=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ml=(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;Y(o,t,r);let s=t.seen.get(e);s.ref=o},Nl=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Pl=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Fl=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Il=(e,t,n,r)=>{let i=e._zod.innerType;Y(i,t,r);let a=t.seen.get(e);a.ref=i},Ll={string:Qc,number:$c,boolean:el,bigint:tl,symbol:nl,null:rl,undefined:il,void:al,never:ol,any:sl,unknown:cl,date:ll,enum:ul,literal:dl,nan:fl,template_literal:pl,file:ml,success:hl,custom:gl,function:_l,transform:vl,map:yl,set:bl,array:xl,object:Sl,union:Cl,intersection:wl,tuple:Tl,record:El,nullable:Dl,nonoptional:Ol,default:kl,prefault:Al,catch:jl,pipe:Ml,readonly:Nl,promise:Pl,optional:Fl,lazy:Il};function Rl(e,t){if(`_idmap`in e){let n=e,r=Gc({...t,processors:Ll}),i={};for(let e of n._idmap.entries()){let[t,n]=e;Y(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Kc(r,n),a[t]=qc(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Gc({...t,processors:Ll});return Y(e,n),Kc(n,e),qc(n,e)}var zl=W(`ZodISODateTime`,(e,t)=>{Fo.init(e,t),Z.init(e,t)});function Bl(e){return uc(zl,e)}var Vl=W(`ZodISODate`,(e,t)=>{Io.init(e,t),Z.init(e,t)});function Hl(e){return dc(Vl,e)}var Ul=W(`ZodISOTime`,(e,t)=>{Lo.init(e,t),Z.init(e,t)});function Wl(e){return fc(Ul,e)}var Gl=W(`ZodISODuration`,(e,t)=>{Ro.init(e,t),Z.init(e,t)});function Kl(e){return pc(Gl,e)}var ql=W(`ZodError`,(e,t)=>{aa.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ca(e,t)},flatten:{value:t=>sa(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,wi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,wi,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Jl=da(ql),Yl=fa(ql),Xl=pa(ql),Zl=ha(ql),Ql=_a(ql),$l=va(ql),eu=ya(ql),tu=ba(ql),nu=xa(ql),ru=Sa(ql),iu=Ca(ql),au=wa(ql),ou=new WeakMap;function su(e,t,n){let r=Object.getPrototypeOf(e),i=ou.get(r);if(i||(i=new Set,ou.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var X=W(`ZodType`,(e,t)=>(q.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Xc(e,`input`),output:Xc(e,`output`)}}),e.toJSONSchema=Yc(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Jl(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Xl(e,t,n),e.parseAsync=async(t,n)=>Yl(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Zl(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ql(e,t,n),e.decode=(t,n)=>$l(e,t,n),e.encodeAsync=async(t,n)=>eu(e,t,n),e.decodeAsync=async(t,n)=>tu(e,t,n),e.safeEncode=(t,n)=>nu(e,t,n),e.safeDecode=(t,n)=>ru(e,t,n),e.safeEncodeAsync=async(t,n)=>iu(e,t,n),e.safeDecodeAsync=async(t,n)=>au(e,t,n),su(e,`ZodType`,{check(...e){let t=this.def;return this.clone(ji(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 Vi(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Md(e,t))},superRefine(e,t){return this.check(Nd(e,t))},overwrite(e){return this.check(Pc(e))},optional(){return ud(this)},exactOptional(){return fd(this)},nullable(){return md(this)},nullish(){return ud(md(this))},nonoptional(e){return bd(this,e)},array(){return Wu(this)},or(e){return Xu([this,e])},and(e){return ed(this,e)},transform(e){return wd(this,cd(e))},default(e){return gd(this,e)},prefault(e){return vd(this,e)},catch(e){return Sd(this,e)},pipe(e){return wd(this,e)},readonly(){return Dd(this)},describe(e){let t=this.clone();return Bs.add(t,{description:e}),t},meta(...e){if(e.length===0)return Bs.get(this);let t=this.clone();return Bs.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Bs.get(e)?.description},configurable:!0}),e)),cu=W(`_ZodString`,(e,t)=>{Co.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qc(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,su(e,`_ZodString`,{regex(...e){return this.check(Oc(...e))},includes(...e){return this.check(jc(...e))},startsWith(...e){return this.check(Mc(...e))},endsWith(...e){return this.check(Nc(...e))},min(...e){return this.check(Ec(...e))},max(...e){return this.check(Tc(...e))},length(...e){return this.check(Dc(...e))},nonempty(...e){return this.check(Ec(1,...e))},lowercase(e){return this.check(kc(e))},uppercase(e){return this.check(Ac(e))},trim(){return this.check(Ic())},normalize(...e){return this.check(Fc(...e))},toLowerCase(){return this.check(Lc())},toUpperCase(){return this.check(Rc())},slugify(){return this.check(zc())}})}),lu=W(`ZodString`,(e,t)=>{Co.init(e,t),cu.init(e,t),e.email=t=>e.check(Hs(du,t)),e.url=t=>e.check(Js(mu,t)),e.jwt=t=>e.check(lc(Au,t)),e.emoji=t=>e.check(Ys(gu,t)),e.guid=t=>e.check(Us(fu,t)),e.uuid=t=>e.check(Ws(pu,t)),e.uuidv4=t=>e.check(Gs(pu,t)),e.uuidv6=t=>e.check(Ks(pu,t)),e.uuidv7=t=>e.check(qs(pu,t)),e.nanoid=t=>e.check(Xs(_u,t)),e.guid=t=>e.check(Us(fu,t)),e.cuid=t=>e.check(Zs(vu,t)),e.cuid2=t=>e.check(Qs(yu,t)),e.ulid=t=>e.check($s(bu,t)),e.base64=t=>e.check(oc(Du,t)),e.base64url=t=>e.check(sc(Ou,t)),e.xid=t=>e.check(ec(xu,t)),e.ksuid=t=>e.check(tc(Su,t)),e.ipv4=t=>e.check(nc(Cu,t)),e.ipv6=t=>e.check(rc(wu,t)),e.cidrv4=t=>e.check(ic(Tu,t)),e.cidrv6=t=>e.check(ac(Eu,t)),e.e164=t=>e.check(cc(ku,t)),e.datetime=t=>e.check(Bl(t)),e.date=t=>e.check(Hl(t)),e.time=t=>e.check(Wl(t)),e.duration=t=>e.check(Kl(t))});function uu(e){return Vs(lu,e)}var Z=W(`ZodStringFormat`,(e,t)=>{J.init(e,t),cu.init(e,t)}),du=W(`ZodEmail`,(e,t)=>{Eo.init(e,t),Z.init(e,t)}),fu=W(`ZodGUID`,(e,t)=>{wo.init(e,t),Z.init(e,t)}),pu=W(`ZodUUID`,(e,t)=>{To.init(e,t),Z.init(e,t)}),mu=W(`ZodURL`,(e,t)=>{Do.init(e,t),Z.init(e,t)});function hu(e){return Js(mu,e)}var gu=W(`ZodEmoji`,(e,t)=>{Oo.init(e,t),Z.init(e,t)}),_u=W(`ZodNanoID`,(e,t)=>{ko.init(e,t),Z.init(e,t)}),vu=W(`ZodCUID`,(e,t)=>{Ao.init(e,t),Z.init(e,t)}),yu=W(`ZodCUID2`,(e,t)=>{jo.init(e,t),Z.init(e,t)}),bu=W(`ZodULID`,(e,t)=>{Mo.init(e,t),Z.init(e,t)}),xu=W(`ZodXID`,(e,t)=>{No.init(e,t),Z.init(e,t)}),Su=W(`ZodKSUID`,(e,t)=>{Po.init(e,t),Z.init(e,t)}),Cu=W(`ZodIPv4`,(e,t)=>{zo.init(e,t),Z.init(e,t)}),wu=W(`ZodIPv6`,(e,t)=>{Bo.init(e,t),Z.init(e,t)}),Tu=W(`ZodCIDRv4`,(e,t)=>{Vo.init(e,t),Z.init(e,t)}),Eu=W(`ZodCIDRv6`,(e,t)=>{Ho.init(e,t),Z.init(e,t)}),Du=W(`ZodBase64`,(e,t)=>{Wo.init(e,t),Z.init(e,t)}),Ou=W(`ZodBase64URL`,(e,t)=>{Ko.init(e,t),Z.init(e,t)}),ku=W(`ZodE164`,(e,t)=>{qo.init(e,t),Z.init(e,t)}),Au=W(`ZodJWT`,(e,t)=>{Yo.init(e,t),Z.init(e,t)}),ju=W(`ZodNumber`,(e,t)=>{Xo.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$c(e,t,n,r),su(e,`ZodNumber`,{gt(e,t){return this.check(Sc(e,t))},gte(e,t){return this.check(Cc(e,t))},min(e,t){return this.check(Cc(e,t))},lt(e,t){return this.check(bc(e,t))},lte(e,t){return this.check(xc(e,t))},max(e,t){return this.check(xc(e,t))},int(e){return this.check(Pu(e))},safe(e){return this.check(Pu(e))},positive(e){return this.check(Sc(0,e))},nonnegative(e){return this.check(Cc(0,e))},negative(e){return this.check(bc(0,e))},nonpositive(e){return this.check(xc(0,e))},multipleOf(e,t){return this.check(wc(e,t))},step(e,t){return this.check(wc(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Mu(e){return mc(ju,e)}var Nu=W(`ZodNumberFormat`,(e,t)=>{Zo.init(e,t),ju.init(e,t)});function Pu(e){return hc(Nu,e)}var Fu=W(`ZodBoolean`,(e,t)=>{Qo.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,n,r)});function Iu(e){return gc(Fu,e)}var Lu=W(`ZodNull`,(e,t)=>{$o.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rl(e,t,n,r)});function Ru(e){return _c(Lu,e)}var zu=W(`ZodUnknown`,(e,t)=>{es.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Bu(){return vc(zu)}var Vu=W(`ZodNever`,(e,t)=>{ts.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ol(e,t,n,r)});function Hu(e){return yc(Vu,e)}var Uu=W(`ZodArray`,(e,t)=>{rs.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xl(e,t,n,r),e.element=t.element,su(e,`ZodArray`,{min(e,t){return this.check(Ec(e,t))},nonempty(e){return this.check(Ec(1,e))},max(e,t){return this.check(Tc(e,t))},length(e,t){return this.check(Dc(e,t))},unwrap(){return this.element}})});function Wu(e,t){return Bc(Uu,e,t)}var Gu=W(`ZodObject`,(e,t)=>{cs.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sl(e,t,n,r),G(e,`shape`,()=>t.shape),su(e,`ZodObject`,{keyof(){return id(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Bu()})},loose(){return this.clone({...this._zod.def,catchall:Bu()})},strict(){return this.clone({...this._zod.def,catchall:Hu()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Ki(this,e)},safeExtend(e){return qi(this,e)},merge(e){return Ji(this,e)},pick(e){return Wi(this,e)},omit(e){return Gi(this,e)},partial(...e){return Yi(ld,this,e[0])},required(...e){return Xi(yd,this,e[0])}})});function Ku(e,t){return new Gu({type:`object`,shape:e??{},...K(t)})}function qu(e,t){return new Gu({type:`object`,shape:e,catchall:Hu(),...K(t)})}function Ju(e,t){return new Gu({type:`object`,shape:e,catchall:Bu(),...K(t)})}var Yu=W(`ZodUnion`,(e,t)=>{us.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cl(e,t,n,r),e.options=t.options});function Xu(e,t){return new Yu({type:`union`,options:e,...K(t)})}var Zu=W(`ZodDiscriminatedUnion`,(e,t)=>{Yu.init(e,t),ds.init(e,t)});function Qu(e,t,n){return new Zu({type:`union`,options:t,discriminator:e,...K(n)})}var $u=W(`ZodIntersection`,(e,t)=>{fs.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wl(e,t,n,r)});function ed(e,t){return new $u({type:`intersection`,left:e,right:t})}var td=W(`ZodRecord`,(e,t)=>{hs.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>El(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function nd(e,t,n){return!t||!t._zod?new td({type:`record`,keyType:uu(),valueType:e,...K(t)}):new td({type:`record`,keyType:e,valueType:t,...K(n)})}var rd=W(`ZodEnum`,(e,t)=>{gs.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ul(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);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 rd({...t,checks:[],...K(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 rd({...t,checks:[],...K(r),entries:i})}});function id(e,t){return new rd({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...K(t)})}var ad=W(`ZodLiteral`,(e,t)=>{_s.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dl(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 od(e,t){return new ad({type:`literal`,values:Array.isArray(e)?e:[e],...K(t)})}var sd=W(`ZodTransform`,(e,t)=>{vs.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vl(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new bi(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ra(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(ra(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function cd(e){return new sd({type:`transform`,transform:e})}var ld=W(`ZodOptional`,(e,t)=>{bs.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ud(e){return new ld({type:`optional`,innerType:e})}var dd=W(`ZodExactOptional`,(e,t)=>{xs.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fd(e){return new dd({type:`optional`,innerType:e})}var pd=W(`ZodNullable`,(e,t)=>{Ss.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function md(e){return new pd({type:`nullable`,innerType:e})}var hd=W(`ZodDefault`,(e,t)=>{Cs.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gd(e,t){return new hd({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ri(t)}})}var _d=W(`ZodPrefault`,(e,t)=>{Ts.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Al(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vd(e,t){return new _d({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ri(t)}})}var yd=W(`ZodNonOptional`,(e,t)=>{Es.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ol(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bd(e,t){return new yd({type:`nonoptional`,innerType:e,...K(t)})}var xd=W(`ZodCatch`,(e,t)=>{Os.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Sd(e,t){return new xd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Cd=W(`ZodPipe`,(e,t)=>{ks.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ml(e,t,n,r),e.in=t.in,e.out=t.out});function wd(e,t){return new Cd({type:`pipe`,in:e,out:t})}var Td=W(`ZodPreprocess`,(e,t)=>{Cd.init(e,t),js.init(e,t)}),Ed=W(`ZodReadonly`,(e,t)=>{Ms.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dd(e){return new Ed({type:`readonly`,innerType:e})}var Od=W(`ZodLazy`,(e,t)=>{Ps.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Il(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function kd(e){return new Od({type:`lazy`,getter:e})}var Ad=W(`ZodCustom`,(e,t)=>{Fs.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gl(e,t,n,r)});function jd(e,t){return Vc(Ad,e??(()=>!0),t)}function Md(e,t={}){return Hc(Ad,e,t)}function Nd(e,t){return Uc(e,t)}function Pd(e,t={}){let n=new Ad({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...K(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 Fd(e,t){return new Td({type:`pipe`,in:cd(e),out:t})}var Id=48,Ld=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Id-t;return n},Rd=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},zd=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Id;n+=i>>>1^-(i&1),t[r]=n}return t},Bd=384,Vd=[],Hd=Rd(Ld(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Ud=Rd(Ld(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Wd=`@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`,Gd=(()=>{let e=Hd.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=Hd[n];i<Hd[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(Hd[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=Hd[i];a<Hd[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Kd=Ld(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),qd=Rd(Ld(`123333359346463635126536711576`)),Jd=Ld(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),Yd=Ld(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Xd=zd(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),Zd=(()=>{let e=new Int32Array(319).fill(-1),t=zd(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=zd(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),Qd=`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}),$d=zd(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),ef=zd(`ɠ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`),tf=zd(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±`),nf=new Int32Array(995),rf=new Int32Array(995),af=new Int32Array(995),of=``,sf=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<$d.length;r++)for(let i of Qd[tf[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),sf[a*2]=of.length,sf[a*2+1]=i.length,of+=i),nf[n]=$d[r],rf[n]=ef[r],af[n]=a,n++}}var cf=zd(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),lf=Rd(Ld(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),uf=zd(`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`),df=Ld(`ij`),ff=Ld(``),pf=Ld(`1`),mf={GROUP_COUNT:Bd,customValidatorNames:Vd,edgeStart:Hd,labelStart:Ud,labelText:Wd,edgeTarget:Gd,nodeGroup:Kd,nodeVlist:Zd,vlistPat:qd,vlistOps:Jd,vlistRef:Yd,vlistGroup:Xd,litAnchor:nf,litGroup:rf,litPool:af,poolOffsets:sf,poolText:of,adjGid:cf,adjStart:lf,adjTgt:uf,patGid:df,patTgt:ff,postfixLookupGroups:pf,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},hf=`line`in Error(),gf=-1,_f=-1,vf=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},yf=(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},bf=(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 ee=new Uint8Array(r);for(let e=0;e<w.length;e++)ee[w[e]]=1;let te=i.length-1,ne=new Uint8Array(te),j=0,M=!0;for(let e=0;e<m.length;e++){ne[m[e]]=1;let t=_[g[e]*2+1];t>j&&(j=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(M=!1)}let N=1;for(;N<m.length*2;)N<<=1;let re=new Int32Array(N).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(vf(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&N-1;for(;re[n]!==-1;)n=n+1&N-1;re[n]=e}let P=(e,t,n,r)=>{let i=(vf(t,n,r)^Math.imul(e,2654435761)|0)&N-1,a=r-n;for(;;){let r=re[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&N-1}},F=n.cacheSize??8192,ie=n.prefix??e.prefix??``,I=ie===``?``:ie+`:`,ae=I.length,L=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),R=/\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$/,oe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,se=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ce=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,le=0,z=-1,ue=-1,de=-1,fe=-1,pe=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,me=e=>/\s/.test(String.fromCharCode(e)),he=(e,t,n)=>{if(le=0,z=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)le=1;else if(r===40&&i===41)le=2;else return;de=t+1,fe=n-1;let a=t+1;if(pe(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!pe(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(z=t+1,ue=a,de=a+1)}},ge=(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},_e=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ve=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ye=e=>!!e&&!Number.isNaN(Number(e)),be=(e,t,n)=>{if(n-t<11||!ge(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&&ge(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&ge(e,t+10,t+18,`-normal/`)},xe=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],Se=`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(` `)),Ce=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],we=(e,t,n,r)=>{if(e>=10){if(e>=25)return L[e-25](t.slice(n,r));let i=e-10;if(le!==xe[i])return!1;if(z>=0){for(let e of Se[i])if(ge(t,z,ue,e))return!0;return!1}switch(Ce[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(de,fe);return R.test(e)&&!oe.test(e)}case 3:return ye(t.slice(de,fe));case 4:return ce.test(t.slice(de,fe));default:return se.test(t.slice(de,fe))}}switch(e){case 0:return!0;case 1:return le===0;case 2:return le===1;case 3:return le===2;case 4:return _e.test(t.slice(n,r));case 5:return ye(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&&ye(t.slice(n,r-1));case 8:return ve.test(t.slice(n,r));default:return be(t,n,r)}},Te=new Set(typeof E==`string`?E.split(` `):E),Ee=(e,t,n,r,i,a)=>{let o=vf(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},B=new Map,V=new Map,De=2,Oe=4096,ke=(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||Te.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=V.get(s);return c===void 0&&V.set(s,c=De++),c},Ae=new Map,je=r,Me=r+4096,Ne=()=>je++,H=2097152,Pe=8192,Fe=new Int32Array(Pe),Ie=Array(Pe).fill(null),Le=new Int32Array(Pe),Re=new Int32Array(Pe),ze=new Uint8Array(Pe),Be=0,Ve=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ie[e]!==null)if(Ie[e|1]===null)c=e|1;else if(!(Be++&3))c=e|Be>>2&1;else return;Ie[c]=t.slice(n,r),Fe[c]=i,Le[c]=a,Re[c]=o,ze[c]=s},He=()=>Ie.fill(null),Ue=256,We=[new Int32Array(Ue),new Int32Array(Ue),new Int32Array(Ue),new Int32Array(Ue)],[Ge,Ke,qe,Je]=We,Ye=new Uint8Array(Ue),Xe=new Uint8Array(Ue),Ze=()=>{Ue*=2,We=We.map(e=>{let t=new Int32Array(Ue);return t.set(e),t}),[Ge,Ke,qe,Je]=We;let e=new Uint8Array(Ue);e.set(Ye),Ye=e,Xe=new Uint8Array(Ue)},Qe=64,$e=new Int32Array(Qe),et=new Int32Array(Qe),tt=new Int32Array(r),nt=2048,rt=21,it=new Float64Array(nt),at=new Int32Array(nt),ot=0,st=(e,t)=>{if(e===0&&t<r)return tt[t]===ot?1:(tt[t]=ot,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>rt;for(;at[i]===ot;){if(it[i]===n)return 1;i=i+1&nt-1}return it[i]=n,at[i]=ot,0},ct=(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?gf:Ee(Ae,e,t+1,r,0,Ne)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=et[t];if(r>n)continue;let i=$e[t],a=n-r;if(ne[i]===1&&a>0&&a<=j){let t=e.charCodeAt(r);if(M===!1||t!==91&&t!==40){let t=P(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;he(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(we(d[t],e,r,n))return p[h+t]}return gf},lt=e=>{let t=e.length,n=0,c=0,u=!1;(De>Oe||B.size>Oe)&&(B=new Map,V=new Map,De=2,He()),je>Me&&(Ae=new Map,je=r,He());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&me(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&&me(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Ue&&Ze();let _=n++;Ge[_]=p,Ke[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Fe[y]===v&&Ie[y]!==null&&Ie[y].length===g?t=y:Fe[y|1]===v&&Ie[y|1]!==null&&Ie[y|1].length===g&&(t=y|1),t>=0){let n=Ie[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){qe[_]=Le[t],Je[_]=Re[t],Ye[_]=ze[t];continue}}}let b=p;if(ae!==0){if(h-p<=ae||!e.startsWith(I,p)){qe[_]=gf,Ve(y,e,p,h,v,gf,0,0);continue}b=p+ae}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 te=E;D-E>1&&e.charCodeAt(E)===45&&(te=E+1);let j=0,M=0,N=0,re=-1,P=0;(l[0]>=0||ne[0]===1)&&($e[0]=0,et[0]=te,P=1);let F=_f,ie=0;for(let t=te;t<D;t++)if(t===A&&(F=M<N?_f:j,ie=P),j!==_f){let n=e.charCodeAt(t),r=-1;if(M<N)o.charCodeAt(M)===n?(M++,M===N&&(r=j=re)):j=_f;else{let e=i[j],t=i[j+1],c=_f;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]:(M=e+1,N=a[i+1],re=s[i],c=j);break}}j=c}if(r>=0&&(l[r]>=0||ne[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(P===Qe){Qe*=2;let e=new Int32Array(Qe);e.set($e),$e=e;let t=new Int32Array(Qe);t.set(et),et=t}$e[P]=r,et[P]=t+2,P++}}A===D&&(F=M<N?_f:j,ie=P);let L=M<N?_f:j,R,oe=!1;if(A>=0)if(oe=!0,R=ct(e,E,A,F,ie),R!==gf&&R<r&&ee[R]){let t=ct(e,E,D,L,P);t!==gf&&t!==R&&(R=t,oe=!1)}else R===gf&&(R=ct(e,E,D,L,P),oe=!1);else R=ct(e,E,D,L,P);let se=0,ce=0;R===gf?qe[_]=gf:(ce=+!!oe,se=b>=C?+!!O:Ee(B,e,b,C,+!!O,e=>ke(e,O)),qe[_]=R,Ye[_]=ce,Je[_]=se),Ve(y,e,p,h,v,R,se,ce)}if(n===0)return``;if(n===1)return Ge[0]===0&&Ke[0]===t?e:e.slice(Ge[0],Ke[0]);if(n*k>nt){for(;n*k>nt;)nt<<=1,rt--;it=new Float64Array(nt),at=new Int32Array(nt)}if(De>=H||je>=H)throw Error(`cn: too many distinct classes in one merge`);ot=ot+1|0,ot===0&&(tt.fill(0),at.fill(0),ot=1);let f=!1;for(let e=n-1;e>=0;e--){let t=qe[e];if(t===gf){Xe[e]=1;continue}let n=Je[e];if(st(n,t)===1){Xe[e]=0,f=!0;continue}if(Xe[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)st(n,x[e]);if(Ye[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&st(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Xe[m]){m++;continue}let t=Ge[m],r=Ke[m],i=m+1;for(;i<n&&Xe[i]&&Ge[i]===r+1&&e.charCodeAt(r)===32;)r=Ke[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},ut=16384,dt=new Int32Array(ut*2),ft=0,U=1,pt=Object.create(null),mt=Object.create(null),ht=new Map,gt=new Map,_t=0,vt=0,yt=()=>{ft^=ut,U=U+1|0,vt=0},bt=e=>{let t=pt[e];if(t!==void 0)return t;let n=yf(e,0,e.length),r=(n&16383)+ft,i=dt[r]===(n^U)||dt[r^ut]===(n^U-1);return i&&(t=mt[e],t!==void 0)?(pt[e]=t,t):(t=lt(e),i?(pt[e]=t,++_t>F&&(_t=0,mt=pt,pt=Object.create(null),yt())):(dt[r]=n^U,++vt>ut&&yt()),t)},xt=e=>{let t=ht.get(e);if(t!==void 0)return t;let n=yf(e,0,e.length),r=(n&16383)+ft,i=dt[r]===(n^U)||dt[r^ut]===(n^U-1);return i&&(t=gt.get(e),t!==void 0)?(ht.set(e,t),t):(t=lt(e),i?(ht.set(e,t),++_t>F&&(_t=0,gt=ht,ht=new Map,yt())):(dt[r]=n^U,++vt>ut&&yt()),t)},St=e=>{let t=yf(e,0,e.length),n=(t&16383)+ft;return dt[n]===(t^U)||dt[n^ut]===(t^U-1)?!0:(dt[n]=t^U,++vt>ut&&yt(),!1)},Ct=F===0?lt:hf?e=>{let t=ht.get(e);return t===void 0?xt(e):t}:bt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?Ct(arguments[0]):Ct(Cf.apply(null,arguments))},mergeString:Ct,seenBefore:F===0?()=>!1:St,mergeUncached:lt}},xf=(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:xf(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},Sf=(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:xf(i,t);a&&(n&&(n+=` `),n+=a)}return n},Cf=function(){return Sf(arguments,!1)},wf=256,Tf=16,Ef=1024,Df=4096,Of=(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(Df).fill(``),l=Array(Df).fill(``),u=Array(Df).fill(``));let i=yf(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]=xf(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>Tf&&(_.miss=Tf,_.skip=Ef,_.e.length=0,_.at=0);let u=_.e;u.length<wf?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(xf(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)}},kf=bf(mf),Af=Of(kf.mergeString,kf);kf.merge;var jf=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Mf(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:jf(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Nf=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},Pf=e=>{let t=Nf(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ff=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),If={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 Lf(e){return e!=null}function Rf(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??If.width,a=e.size??e.height??If.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?Ff(...c):Ff(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??If[`stroke-width`])*Number(e.size??e.width??If.width)/Number(t.size??t.width??If.width):t.strokeWidth??If[`stroke-width`];return[`svg`,{...Object.entries(If).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Lf(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Lf(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Lf(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 zf(e,t={}){return Rf(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Bf=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Vf=(0,H.createContext)({}),Hf=()=>(0,H.useContext)(Vf),Uf=(0,H.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=``}=Hf()??{},y=!!c||Bf(d),[b,x,S=[]]=zf(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Ff(v,s),hasA11yProp:y,attributes:d});return(0,H.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,H.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Wf(e,t=[],n=[]){let r=typeof e==`string`?Mf(e,t,n):e,i=(0,H.forwardRef)(({className:e,...t},n)=>(0,H.createElement)(Uf,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Pf(r.name)),i}var Gf={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Gf.node;var Kf=Wf(Gf),qf={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};qf.node;var Jf=Wf(qf),Yf={name:`circle-alert`,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`]};Yf.node;var Xf=Wf(Yf),Zf={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Zf.node;var Qf=Wf(Zf),$f={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`]};$f.node;var ep=Wf($f),tp={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};tp.node;var np=Wf(tp),rp={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.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};rp.node;var ip=Wf(rp),ap={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`}]]};ap.node;var op=Wf(ap),sp={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};sp.node;var cp=Wf(sp),Q=n();function lp(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 up=(0,H.createContext)(null),dp=(0,H.createContext)([]);function fp({href:e,onEvent:t,history:n=[],children:r}){let[i,a]=(0,H.useState)(new Map),o=(0,H.useEffectEvent)(t);return(0,H.useEffect)(()=>{if(!e)return;let t=new EventSource(e),n=e=>{let t=yp(e.data);t&&(t.type===`ready`?a(new Map):_p(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,Q.jsx)(up,{value:i,children:(0,Q.jsx)(dp,{value:n,children:r})})}function pp(e,t){let n=(0,H.use)(up);if(!n)throw Error(`useConversationStatus must be used inside <RuntimeEventsProvider>.`);return n.get(e)?.status??t}var mp={pending:`Pending`,queued:`Queued`,running:`Running`,waitingOnApproval:`Waiting on approval`,waitingOnUserInput:`Waiting on user input`,completed:`Completed`,failed:`Failed`,interrupted:`Interrupted`},hp={spawn:`Spawned`,message:`Message sent`,followup:`Follow-up sent`,interrupt:`Interrupt accepted`,completion:`Turn finished`};function gp({treeId:e,snapshot:t=[]}){let n=(0,H.use)(up),r=(0,H.use)(dp).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,Q.jsxs)(`section`,{"aria-label":`Child agents`,className:`border-t px-6 py-3`,children:[(0,Q.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:`Child agents`}),(0,Q.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,Q.jsxs)(`li`,{className:`flex items-center justify-between gap-4 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`p`,{className:`truncate font-mono text-xs`,children:e.path}),t&&(0,Q.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[hp[t.type],` · `,t.actorPath,` →`,` `,t.targetPath]})]}),(0,Q.jsx)(Ap,{status:mp[e.state]})]},e.chatId)})})]})}function _p(e){return e.type===`change`&&e.resource===`conversation`&&bp(e.status)&&(e.child===void 0||Sp(e.child)&&e.child.chatId===e.id)}function vp(e){return xp(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`&&bp(e.status)&&(e.children===void 0||Array.isArray(e.children)&&e.children.every(Sp))}function yp(e){let t;try{t=JSON.parse(e)}catch{return}if(!(!xp(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`&&(!bp(t.status)||t.child!==void 0&&(!Sp(t.child)||t.child.chatId!==t.id))))return{...t,type:`change`,resource:t.resource,id:t.id}}}function bp(e){return!xp(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 xp(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Sp(e){return!xp(e)||!xp(e.activities)||![`chatId`,`treeId`,`path`,`parentChatId`,`declarationName`].every(t=>typeof e[t]==`string`)||typeof e.state!=`string`||!Object.hasOwn(mp,e.state)?!1:Object.entries(e.activities).every(([e,t])=>Object.hasOwn(hp,e)&&xp(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 Cp=(0,H.createContext)(null);function wp(){let e=(0,H.use)(Cp);if(!e)throw Error(`History.* parts must be rendered inside <History.Root>.`);return e}function Tp({activeChatId:e,onSelect:t,className:n,children:r}){let i=(0,H.useMemo)(()=>({activeChatId:e,onSelect:t}),[e,t]);return(0,Q.jsx)(Cp.Provider,{value:i,children:(0,Q.jsx)(`div`,{className:Af(`flex min-h-0 flex-col gap-1`,n),children:r})})}function Ep({className:e,children:t}){return(0,Q.jsx)(`div`,{className:Af(`group/history-item relative`,e),children:t})}function Dp({history:e,className:t,children:n}){let{activeChatId:r,onSelect:i}=wp(),a=r===e.chatId;return(0,Q.jsx)(`button`,{type:`button`,"aria-current":a?`true`:void 0,onClick:()=>i(e),className:Af(`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 Op({className:e,children:t}){return(0,Q.jsx)(`div`,{className:Af(`text-muted-foreground px-2 py-4 text-sm`,e),children:t})}function kp({chatId:e,status:t}){let n=`size-3.5 shrink-0`;switch(lp(pp(e,t))){case`active`:return(0,Q.jsx)(Qf,{"aria-label":`Active`,className:n});case`error`:return(0,Q.jsx)(Xf,{"aria-label":`Error`,className:Af(n,`text-destructive`)});case`idle`:return(0,Q.jsx)(op,{"aria-label":`idle`,className:n});case`approval`:return(0,Q.jsx)(ep,{"aria-label":`Waiting on approval`,className:n});case`input`:return(0,Q.jsx)(ip,{"aria-label":`Waiting on user input`,className:n})}}function Ap({status:e}){return(0,Q.jsx)(`span`,{className:Af(`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 jp=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function Mp(e){return jp.format(new Date(e))}var Np={Root:Tp,Item:Ep,ItemTrigger:Dp,Empty:Op},Pp=Ku({href:uu()}),Fp=Ku({capabilities:Ku({chat:Pp,history:Pp,events:Pp,traces:Pp.optional(),schedules:Pp.optional(),uploads:Pp.extend({mediaTypes:Wu(uu()).optional()}).optional()})}),Ip=new be({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1}}});async function Lp(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 Ip.fetchQuery({queryKey:[`runtime`,`discovery`,t],queryFn:async()=>Fp.parse(await Rp(t,e)),staleTime:1/0});n=r;let i=await Ip.fetchQuery({queryKey:[`runtime`,`history`,r.capabilities.history.href],queryFn:async()=>zp(await Rp(r.capabilities.history.href,e))});return{discovery:n,history:i,historyError:!1}}catch{return{discovery:n,history:[],historyError:!0}}}async function Rp(e,t){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`Request failed: ${n.status}`);return n.json()}function zp(e){if(!Array.isArray(e)||!e.every(vp))throw Error(`History response is not a list of conversations`);return e}var Bp={...H},Vp={};function Hp(e,t){let n=H.useRef(Vp);return n.current===Vp&&(n.current=e(t)),n}var Up=Bp.useInsertionEffect,Wp=Up&&Up!==Bp.useLayoutEffect?Up:e=>e();function Gp(e){let t=Hp(Kp).current;return t.next=e,Wp(t.effect),t.trampoline}function Kp(){let e={next:void 0,callback:qp,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function qp(){}function $(){}var Jp=Object.freeze([]),Yp=Object.freeze({}),Xp=typeof document<`u`?H.useLayoutEffect:()=>{},Zp=H.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Qp(){return H.useContext(Zp)}function $p(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Gp(i),[,o]=H.useState(0),s=Hp(tm).current,c=Hp(em).current,l=H.useRef(0),u=H.useRef(!0),d=H.useRef(null),f=H.useRef(null),p=Gp(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=Gp((e,t)=>{c.set(e,t),p()}),h=Gp(e=>{c.delete(e),p()}),g=Gp(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(!im(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&am(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=rm(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=Gp(()=>{let[e,t]=nm(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))});Xp(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Xp(()=>{u.current&&v()}),Xp(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=Gp(e=>(s.add(e),()=>{s.delete(e)})),b=H.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Q.jsx)(Zp.Provider,{value:b,children:t})}function em(){return new Map}function tm(){return new Set}function nm(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)=>am(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 rm(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function im(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 am(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var om=t(i(),1);function sm(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 cm=sm(`https://base-ui.com/production-error`,`Base UI`);function lm(e,t,n,r){let i=Hp(dm).current;return fm(i,e,t,n,r)&&mm(i,[e,t,n,r]),i.callback}function um(e){let t=Hp(dm).current;return pm(t,e)&&mm(t,e),t.callback}function dm(){return{callback:null,cleanup:null,refs:[]}}function fm(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function pm(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function mm(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 hm=19;function gm(e){return hm>=e}function _m(e){if(!H.isValidElement(e))return null;let t=e,n=t.props;return(gm(19)?n?.ref:t.ref)??null}function vm(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function ym(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 bm(e,t){return typeof e==`function`?e(t):e}function xm(e,t){return typeof e==`function`?e(t):e}var Sm={};function Cm(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Tm(t);let a=Tm(e);return t&&(a=Em(a,t)),n&&(a=Em(a,n)),r&&(a=Em(a,r)),i&&(a=Em(a,i)),a}function wm(e){if(e.length===0)return Sm;if(e.length===1)return Tm(e[0]);let t=Tm(e[0]);for(let n=1;n<e.length;n+=1)t=Em(t,e[n]);return t}function Tm(e){return Am(e)?{...e(Sm)}:Dm(e)}function Em(e,t){return Am(t)?t(e):Om(e,t)}function Dm(e){let t={...e};for(let e in t){let n=t[e];km(e,n)&&(t[e]=Mm(n))}return t}function Om(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=vm(e.style,r);break;case`className`:e[n]=Pm(e.className,r);break;default:km(n,r)?e[n]=jm(e[n],r):e[n]=r}}return e}function km(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 Am(e){return typeof e==`function`}function jm(e,t){return t?e?(...n)=>{let r=n[0];if(Fm(r)){let i=r;Nm(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Mm(t):e}function Mm(e){return e&&((...t)=>{let n=t[0];return Fm(n)&&Nm(n),e(...t)})}function Nm(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Pm(e,t){return t?e?t+` `+e:t:e}function Fm(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Im(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Bm(r));let i=Lm(t,n,r);if(n.enabled===!1)return null;let a=n.state??Yp;return Vm(e,r,i,a)}function Lm(e,t,n){let{className:r,style:i}=e,{state:a=Yp,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?bm(r,a):void 0,d=l?xm(i,a):void 0,f=l?ym(a,c):Yp,p=l&&s?Rm(s):void 0,m=l?vm(f,p)??{}:Yp;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=um([m.ref,_m(n),...o]):m.ref=lm(m.ref,_m(n),o):lm(null,null)),l?(u!==void 0&&(m.className=Pm(m.className,u)),d!==void 0&&(m.style=vm(m.style,d)),m):Yp}function Rm(e){return Array.isArray(e)?wm(e):Cm(void 0,e)}var zm=Symbol.for(`react.lazy`);function Bm(e){if(e?.$$typeof!==zm)return e;let t=H.Children.toArray(e)[0];return H.isValidElement(t)?t:e}function Vm(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Cm(n,t.props);return e.ref=n.ref,H.cloneElement(t,e)}return Hm(e,n)}function Hm(e,t){return e===`button`?(0,H.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,H.createElement)(`img`,{alt:``,...t,key:t.key}):H.createElement(e,t)}function Um(){let[,e]=H.useState({});return H.useCallback(()=>{e({})},[])}var Wm=0;function Gm(e,t=`mui`){let n=H.useRef(void 0),r=Um(),i=e??n.current;return H.useEffect(()=>{n.current??(Wm+=1,n.current=`${t}-${Wm}`,e??r())},[e,t,r]),i}var Km=Bp.useId;function qm(e,t){if(Km!==void 0){let n=Km();return e??(t?`${t}-${n}`:n)}return Gm(e,t)}function Jm(e){return qm(e,`base-ui`)}function Ym(e,t,n,r){let i=!1,a=!1,o=r??Yp;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 Xm(e,t,n){let r=n??Yp;return{reason:e,event:t??new Event(`base-ui`),...r}}var Zm=`none`,Qm=`trigger-press`,$m=`trigger-hover`,eh=`trigger-focus`,th=`outside-press`,nh=`item-press`,rh=`close-press`,ih=`focus-out`,ah=`escape-key`,oh=`list-navigation`,sh=`keyboard`,ch=`pointer`,lh=`cancel-open`,uh=`sibling-open`,dh=`disabled`,fh=`imperative-action`;function ph(e){H.useEffect(e,Jp)}var mh=null;globalThis.requestAnimationFrame;var hh=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)}},gh=class e{static create(){return new e}static request(e){return hh.request(e)}static cancel(e){return hh.cancel(e)}currentId=mh;request(e){this.cancel(),this.currentId=hh.request(()=>{this.currentId=mh,e()})}cancel=()=>{this.currentId!==mh&&(hh.cancel(this.currentId),this.currentId=mh)};disposeEffect=()=>this.cancel};function _h(){let e=Hp(gh.create).current;return ph(e.disposeEffect),e}function vh(e,t=!1,n=!1,r=!1){let[i,a]=H.useState(e&&t?`idle`:void 0),[o,s]=H.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Xp(()=>{if(!e&&o&&i!==`ending`&&n){let e=gh.request(()=>{a(`ending`)});return()=>{gh.cancel(e)}}},[e,o,i,n]),Xp(()=>{if(!e||t||i===void 0)return;let n=gh.request(()=>{a(void 0)});return()=>{gh.cancel(n)}},[t,e,i]),Xp(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=gh.request(()=>{a(`idle`)});return()=>{gh.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function yh(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Qp(),u=H.useRef(-1),[d,f]=H.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=H.useRef(null),h=H.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 Xp(()=>{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 bh=`data-starting-style`,xh=`data-ending-style`,Sh={[bh]:``},Ch={[xh]:``},wh={transitionStatus(e){return e===`starting`?Sh:e===`ending`?Ch:null}};function Th(){return typeof window<`u`}function Eh(e){return kh(e)?(e.nodeName||``).toLowerCase():`#document`}function Dh(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Oh(e){return((kh(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function kh(e){return Th()?e instanceof Node||e instanceof Dh(e).Node:!1}function Ah(e){return Th()?e instanceof Element||e instanceof Dh(e).Element:!1}function jh(e){return Th()?e instanceof HTMLElement||e instanceof Dh(e).HTMLElement:!1}function Mh(e){return!Th()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Dh(e).ShadowRoot}function Nh(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Wh(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ph(e){return/^(table|td|th)$/.test(Eh(e))}function Fh(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ih=/transform|translate|scale|rotate|perspective|filter/,Lh=/paint|layout|strict|content/,Rh=e=>!!e&&e!==`none`,zh;function Bh(e){let t=Ah(e)?Wh(e):e;return Rh(t.transform)||Rh(t.translate)||Rh(t.scale)||Rh(t.rotate)||Rh(t.perspective)||!Hh()&&(Rh(t.backdropFilter)||Rh(t.filter))||Ih.test(t.willChange||``)||Lh.test(t.contain||``)}function Vh(e){let t=Kh(e);for(;jh(t)&&!Uh(t);){if(Bh(t))return t;if(Fh(t))return null;t=Kh(t)}return null}function Hh(){return zh??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),zh}function Uh(e){return/^(html|body|#document)$/.test(Eh(e))}function Wh(e){return Dh(e).getComputedStyle(e)}function Gh(e){return Ah(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kh(e){if(Eh(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Mh(e)&&e.host||Oh(e);return Mh(t)?t.host:t}function qh(e){let t=Kh(e);return Uh(t)?(e.ownerDocument||e).body:jh(t)&&Nh(t)?t:qh(t)}function Jh(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qh(e),i=r===e.ownerDocument?.body,a=Dh(r);if(i){let e=Yh(a);return t.concat(a,a.visualViewport||[],Nh(r)?r:[],e&&n?Jh(e):[])}else return t.concat(r,Jh(r,[],n))}function Yh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Xh=H.createContext(void 0);function Zh(e=!1){let t=H.useContext(Xh);if(t===void 0&&!e)throw Error(cm(16));return t}function Qh(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:H.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 $h(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Dh(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 eg(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=H.useRef(null),s=Zh(!0),c=a??s!==void 0,{props:l}=Qh({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=H.useCallback(()=>{let e=o.current;tg(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Xp(u,[u]),{getButtonProps:H.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Cm({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Nm(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=tg(r),s=!i&&ng(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(),$h(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),$h(r,e)))},onKeyUp(e){if(!t){if(Nm(e),a?.(e),e.target===e.currentTarget&&i&&c&&tg(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),$h(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Gp(e=>{o.current=e,u()})}}function tg(e){return jh(e)&&e.tagName===`BUTTON`}function ng(e){return jh(e)&&e.tagName===`A`&&!!e.href}function rg(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var ig=0,ag=class e{static create(){return new e}currentId=ig;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ig,t()},e)}isStarted(){return this.currentId!==ig}clear=()=>{this.currentId!==ig&&(clearTimeout(this.currentId),this.currentId=ig)};disposeEffect=()=>this.clear};function og(){let e=Hp(ag.create).current;return ph(e.disposeEffect),e}function sg(e){let t=Hp(cg,e).current;return t.next=e,Xp(t.effect),t}function cg(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function lg(e){return e==null?e:`current`in e?e.current:e}function ug(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var dg=null;function fg(e){if(!dg){let e=[];dg=e,queueMicrotask(()=>{dg=null,om.flushSync(()=>{for(let t of e)t()})})}dg.push(e)}function pg(e,t=!1,n=!1){let r=_h();return Gp((i,a=null)=>{r.cancel();let o=lg(e);if(o==null)return;let s=o,c=()=>{if(!n){om.flushSync(i);return}fg(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(ug(s).map(e=>e.finished.then($))).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(ug(s).some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=bh;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 mg(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Gp(a),s=pg(r,n,i);H.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var hg=H.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}=eg({disabled:i,focusableWhenDisabled:a,native:o});return Im(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),gg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,_g=a,vg=(e,t)=>n=>{if(t?.variants==null)return _g(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=gg(t)||gg(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 _g(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)},yg=vg(`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]:pr-2 has-data-[icon=inline-start]:pl-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]:pr-1.5 has-data-[icon=inline-start]:pl-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]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-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 bg({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,Q.jsx)(hg,{"data-slot":`button`,className:Af(yg({variant:t,size:n,className:e})),...r})}function xg(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Sg(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Mh(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Cg(e,t){let n=e;for(;n;){if(Ah(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Mh(n)?n.host:null)}return null}function wg(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Tg={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Eg={...Tg,position:`fixed`,margin:0,top:0,left:0},Dg={...Tg,position:`absolute`};function Og(e,t){return t<0||t>=e.length}function kg(e,t){return Mg(e.current,{disabledIndices:t})}function Ag(e,t){return Mg(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function jg(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Mg(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:Og(e,u)?-1:u,wrapped:d}}function Mg(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&&Ng(e,a,r));return a}function Ng(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Fg(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Pg(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Fg(e,t=e?Wh(e):null){return!e||!e.isConnected||!t||Pg(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Ig=r((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})),Lg=r(((e,t)=>{t.exports=Ig()})),Rg=r((t=>{var n=e(),r=Lg();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}})),zg=r(((e,t)=>{t.exports=Rg()})),Bg=`ArrowUp`,Vg=`ArrowDown`,Hg=`ArrowLeft`,Ug=`ArrowRight`,Wg=`Home`,Gg=new Set([Bg,Vg,Hg,Ug,Wg,`End`]),Kg=`Shift`,qg=[Kg,`Control`,`Alt`,`Meta`];function Jg(e){return jh(e)&&e.tagName===`INPUT`}function Yg(e){return!!(Jg(e)&&e.selectionStart!=null||jh(e)&&e.tagName===`TEXTAREA`)}function Xg(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=Zg(e,t,`left`),a=Qg(e),o=Qg(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=Zg(e,t,`top`),r=Qg(e),i=Qg(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 Zg(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 Qg(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 $g(e,t){let n=H.useRef(e),r=Gp(t);Xp(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var e_=vg(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-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 t_({className:e,variant:t,...n}){return(0,Q.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:Af(e_({variant:t}),e),...n})}function n_({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`alert-title`,className:Af(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function r_({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`alert-description`,className:Af(`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 i_(e){return Im(e.defaultTagName??`div`,e,e)}var a_=vg(`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]:pr-1.5 has-data-[icon=inline-start]:pl-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 o_({className:e,variant:t=`default`,render:n,...r}){return i_({defaultTagName:`span`,props:Cm({className:Af(a_({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var s_=H.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Im(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),c_=`data-valid`,l_=`data-invalid`,u_={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},d_={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},f_={valid(e){return e===null?null:e?{[c_]:``}:{[l_]:``}}},p_={invalid:void 0,name:void 0,validityData:{state:u_,errors:[],error:``,value:``,initialValue:null},setValidityData:$,disabled:void 0,setTouched:$,setDirty:$,setFilled:$,setFocused:$,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:d_,registerFieldControl:$,validation:{getValidationProps:(e,t=Yp)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:$,getInputControl:()=>null,commit:async()=>{},change:$}},m_=H.createContext(p_);function h_(e=!0){let t=H.useContext(m_);if(t.setValidityData===$&&!e)throw Error(cm(28));return t}function g_(e,t,n){let{setFocused:r,focusOwnerRef:i}=h_(),a=Gp(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return Xp(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function __(e,t,n,r,i=!0,a){let{registerFieldControl:o}=h_(),s=Hp(()=>Symbol());Xp(()=>{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]),Xp(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var v_=H.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:$,validationMode:`onSubmit`,submitCountRef:{current:0}});function y_(){return H.useContext(v_)}var b_=H.createContext({controlId:void 0,registerControlId:$,resetControlId:$,labelId:void 0,setLabelId:$,messageIds:[],setMessageIds:$,getDescriptionProps:e=>e});function x_(){return H.useContext(b_)}function S_(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=x_(),o=Jm(),s=Hp(()=>Symbol()),c=H.useRef(!1),l=H.useRef(!1),u=Gp(()=>{!c.current||i===$||(c.current=!1,i(s.current,void 0))});return Xp(()=>{if(!n||i===$){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]),Xp(()=>u,[u]),(n?r:void 0)??t??o}function C_({className:e,...t}){return(0,Q.jsx)(`textarea`,{"data-slot":`textarea`,className:Af(`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})}var w_=H.createContext(void 0);function T_(){return H.useContext(w_)?.direction??`ltr`}function E_(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Zh(),{ref:i,index:a}=yh(e),o=n===a,s=H.useRef(null),c=lm(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 D_(e){let{render:t,className:n,style:r,state:i=Yp,props:a=Jp,refs:o=Jp,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=E_({metadata:s});return Im(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function O_({className:e,...t}){return(0,Q.jsx)(`label`,{"data-slot":`label`,className:Af(`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})}export{ag as $,Zl as $n,g as $r,Um as $t,zg as A,Wf as An,St as Ar,gh as At,Dg as B,kd as Bn,je as Br,sh as Bt,Bg as C,_p as Cn,Dr as Cr,Fh as Ct,Kg as D,Xf as Dn,Be as Dr,bh as Dt,qg as E,np as En,Ot as Er,xh as Et,jg as F,Wu as Fn,bt as Fr,dh as Ft,bg as G,Ku as Gn,I as Gr,uh as Gt,Cg as H,Ju as Hn,xe as Hr,Zm as Ht,Fg as I,Iu as In,U as Ir,ah as It,hg as J,qu as Jn,x as Jr,Qm as Jt,yg as K,Fd as Kn,P as Kr,eh as Kt,Og as L,jd as Ln,Ee as Lr,ih as Lt,Mg as M,id as Mn,Ue as Mr,ph as Mt,Ag as N,Pd as Nn,Pt as Nr,lh as Nt,Yg as O,Jf as On,ct as Or,yh as Ot,kg as P,Ru as Pn,Dt as Pr,rh as Pt,sg as Q,hu as Qn,_ as Qr,qm as Qt,Ng as R,Qu as Rn,Ae as Rr,fh as Rt,Ug as S,Mp as Sn,Or as Sr,Ph as St,Wg as T,cp as Tn,kt as Tr,wh as Tt,Sg as U,Hu as Un,ge as Ur,th as Ut,xg as V,od as Vn,V as Vr,oh as Vt,wg as W,Mu as Wn,fe as Wr,ch as Wt,pg as X,Xu as Xn,f as Xr,Xm as Xt,mg as Y,uu as Yn,m as Yr,Ym as Yt,lg as Z,Bu as Zn,A as Zr,Jm as Zt,r_ as _,gp as _n,Tr as _r,jh as _t,S_ as a,s as ai,lm as an,Hr as ar,Zh as at,Vg as b,Ap as bn,jr as br,Nh as bt,__ as c,Xp as cn,ui as cr,Oh as ct,u_ as d,$ as dn,Yr as dr,Gh as dt,T as ei,Bm as en,Rl as er,og as et,f_ as f,Gp as fn,di as fr,Jh as ft,t_ as g,kp as gn,wr as gr,Ah as gt,i_ as h,Ip as hn,Ar as hr,Bh as ht,C_ as i,l as ii,gm as in,pi as ir,Xh as it,Lg as j,Af as jn,lt as jr,_h as jt,Xg as k,Kf as kn,jt as kr,vh as kt,g_ as l,Jp as ln,qr as lr,Yh as lt,o_ as m,Lp as mn,Xr as mr,Dh as mt,D_ as n,ne as ni,Cm as nn,Br as nr,eg as nt,x_ as o,o as oi,cm as on,fi as or,Wh as ot,s_ as p,Hp as pn,li as pr,Kh as pt,vg as q,nd as qn,re as qr,$m as qt,T_ as r,h as ri,xm as rn,Vr as rr,$h as rt,y_ as s,$p as sn,Wr as sr,Vh as st,O_ as t,M as ti,Im as tn,ua as tr,rg as tt,h_ as u,Yp as un,Jr as ur,Eh as ut,n_ as v,Np as vn,kr as vr,Uh as vt,Gg as w,pp as wn,ln as wr,Hh as wt,Hg as x,lp as xn,Nr as xr,Mh as xt,$g as y,fp as yn,Mr as yr,kh as yt,Eg as z,Pu as zn,B as zr,nh as zt};
|