@deepagents/devtool 7.34.0 → 7.34.1

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.
Files changed (30) hide show
  1. package/dist/ui/assets/chat-BfcEqfe9.js +376 -0
  2. package/dist/ui/assets/{chunk-YOKDWASO--mimiz6j.js → chunk-YOKDWASO-DPJQuFb9.js} +20 -20
  3. package/dist/ui/assets/css-BGIxQoYs.js +1 -0
  4. package/dist/ui/assets/css-DUjzNfgv.js +1 -0
  5. package/dist/ui/assets/diff-woXpYk--.js +1 -0
  6. package/dist/ui/assets/github-dark-C-LZuMrd.js +1 -0
  7. package/dist/ui/assets/github-light-EUqPIrTm.js +1 -0
  8. package/dist/ui/assets/{highlighted-body-KPVGNVTW-B0PcemSH.js → highlighted-body-KPVGNVTW-CwiC3CSi.js} +1 -1
  9. package/dist/ui/assets/html-BHZv6uqE.js +1 -0
  10. package/dist/ui/assets/index-B04WhHLo.css +2 -0
  11. package/dist/ui/assets/index-Cljom0Oe.js +12 -0
  12. package/dist/ui/assets/javascript-BzbQS41l.js +1 -0
  13. package/dist/ui/assets/javascript-Yelw-5ZN.js +1 -0
  14. package/dist/ui/assets/json-qhed-kSA.js +1 -0
  15. package/dist/ui/assets/jsx-Bz0zcwM4.js +1 -0
  16. package/dist/ui/assets/markdown-BYOwaDjH.js +1 -0
  17. package/dist/ui/assets/mermaid-HWGCJPDP-Cq_YeSNh.js +1 -0
  18. package/dist/ui/assets/python-gzcpVVnB.js +1 -0
  19. package/dist/ui/assets/{runtime-data-khm-r79m.js → runtime-data-CM11Fv1S.js} +5 -5
  20. package/dist/ui/assets/shellscript-CLZ0U2zV.js +1 -0
  21. package/dist/ui/assets/sql-CEbI0hMM.js +1 -0
  22. package/dist/ui/assets/tsx-udAQXfEw.js +1 -0
  23. package/dist/ui/assets/typescript-bsJCZSQ-.js +1 -0
  24. package/dist/ui/assets/yaml-rwi0_p6S.js +1 -0
  25. package/dist/ui/index.html +3 -3
  26. package/package.json +11 -11
  27. package/dist/ui/assets/chat-WCVVPBF7.js +0 -226
  28. package/dist/ui/assets/index-D7BKgV0_.css +0 -2
  29. package/dist/ui/assets/index-DsxhKB0y.js +0 -12
  30. package/dist/ui/assets/mermaid-HWGCJPDP-B85ijWMV.js +0 -1
@@ -1,7 +1,7 @@
1
- import{a as e,d as t,i as n,n as r,o as i,r as a}from"./preload-helper-DtyrgAzE.js";var o=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},s=new class extends o{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},c={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=c;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function u(e){setTimeout(e,0)}var d=typeof window>`u`||`Deno`in globalThis;function f(){}function p(e,t){return typeof e==`function`?e(t):e}function m(e){return typeof e==`number`&&e>=0&&e!==1/0}function h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){return typeof e==`function`?e(t):e}function v(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==b(o,t.options))return!1}else if(!S(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function y(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(x(t.options.mutationKey)!==x(a))return!1}else if(!S(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function b(e,t){return(t?.queryKeyHashFn||x)(e)}function x(e){return JSON.stringify(e,(e,t)=>D(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function S(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>S(e[n],t[n])):!1}var C=Object.prototype.hasOwnProperty;function w(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=E(e)&&E(t);if(!r&&!(D(e)&&D(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:C.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=w(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function T(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function E(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function D(e){if(!O(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!O(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function O(e){return Object.prototype.toString.call(e)===`[object Object]`}function k(e){return new Promise(t=>{l.setTimeout(t,e)})}function A(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:w(e,t)}function 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(),L=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 R(e){return Math.min(1e3*2**e,3e4)}function z(e){return(e??`online`)!==`online`||L.isOnline()}var ae=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function oe(e){let t=!1,n=0,r,i=P(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ae(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>s.isFocused()&&(e.networkMode===`always`||L.isOnline())&&e.canRun(),d=()=>z(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??R,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 se=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 ce(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?le:B,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:B(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 B(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 le(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ue=class extends se{#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=pe(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=pe(this.options);e.data!==void 0&&(this.setState(fe(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`?ce(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=oe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ae&&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 ae){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,...de(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...fe(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 de(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:z(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function fe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function pe(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 me=class extends se{#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||he(),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=oe({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 he(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ge=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 me({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=_e(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=_e(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=_e(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=_e(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 _e(e){return e.options.scope?.id}var ve=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 ue({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()})})}},ye=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ve,this.#t=e.mutationCache||new ge,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=L.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 L.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()}},be=i((t=>{var n=e().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;t.c=function(e){return n.H.useMemoCache(e)}})),xe=i(((e,t)=>{t.exports=be()})),Se=xe(),V=t(e(),1),H=n(),Ce=(0,V.createContext)(null);function we(e){let t=(0,Se.c)(3),{clock:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,H.jsx)(Ce,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Te(){let e=(0,V.use)(Ce);if(e===null)throw Error(`No clock set, use ClockProvider to set one`);return e}var Ee=48,De=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Ee-t;return n},Oe=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},ke=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Ee;n+=i>>>1^-(i&1),t[r]=n}return t},Ae=384,je=[],Me=Oe(De(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Ne=Oe(De(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Pe=`@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`,Fe=(()=>{let e=Me.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=Me[n];i<Me[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(Me[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=Me[i];a<Me[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Ie=De(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),Le=Oe(De(`123333359346463635126536711576`)),Re=De(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),ze=De(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Be=ke(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),Ve=(()=>{let e=new Int32Array(319).fill(-1),t=ke(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=ke(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),He=`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}),Ue=ke(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),We=ke(`ɠ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`),Ge=ke(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±`),Ke=new Int32Array(995),qe=new Int32Array(995),Je=new Int32Array(995),Ye=``,Xe=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<Ue.length;r++)for(let i of He[Ge[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),Xe[a*2]=Ye.length,Xe[a*2+1]=i.length,Ye+=i),Ke[n]=Ue[r],qe[n]=We[r],Je[n]=a,n++}}var Ze=ke(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Qe=Oe(De(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),$e=ke(`2Š4A;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`),et=De(`ij`),tt=De(`—`),nt=De(`1`),rt={GROUP_COUNT:Ae,customValidatorNames:je,edgeStart:Me,labelStart:Ne,labelText:Pe,edgeTarget:Fe,nodeGroup:Ie,nodeVlist:Ve,vlistPat:Le,vlistOps:Re,vlistRef:ze,vlistGroup:Be,litAnchor:Ke,litGroup:qe,litPool:Je,poolOffsets:Xe,poolText:Ye,adjGid:Ze,adjStart:Qe,adjTgt:$e,patGid:et,patTgt:tt,postfixLookupGroups:nt,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},it=`line`in Error(),at=-1,ot=-1,st=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},ct=(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},lt=(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=(st(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=(st(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+`:`,L=I.length,R=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),z=/\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$/,ae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,se=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ce=0,B=-1,le=-1,ue=-1,de=-1,fe=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,pe=e=>/\s/.test(String.fromCharCode(e)),me=(e,t,n)=>{if(ce=0,B=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ce=1;else if(r===40&&i===41)ce=2;else return;ue=t+1,de=n-1;let a=t+1;if(fe(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!fe(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(B=t+1,le=a,ue=a+1)}},he=(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},ge=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ve=e=>!!e&&!Number.isNaN(Number(e)),ye=(e,t,n)=>{if(n-t<11||!he(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&&he(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&he(e,t+10,t+18,`-normal/`)},be=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],xe=`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(` `)),Se=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],V=(e,t,n,r)=>{if(e>=10){if(e>=25)return R[e-25](t.slice(n,r));let i=e-10;if(ce!==be[i])return!1;if(B>=0){for(let e of xe[i])if(he(t,B,le,e))return!0;return!1}switch(Se[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ue,de);return z.test(e)&&!ae.test(e)}case 3:return ve(t.slice(ue,de));case 4:return se.test(t.slice(ue,de));default:return oe.test(t.slice(ue,de))}}switch(e){case 0:return!0;case 1:return ce===0;case 2:return ce===1;case 3:return ce===2;case 4:return ge.test(t.slice(n,r));case 5:return ve(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&&ve(t.slice(n,r-1));case 8:return _e.test(t.slice(n,r));default:return ye(t,n,r)}},H=new Set(typeof E==`string`?E.split(` `):E),Ce=(e,t,n,r,i,a)=>{let o=st(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},we=new Map,Te=new Map,Ee=2,De=4096,Oe=(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||H.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=Te.get(s);return c===void 0&&Te.set(s,c=Ee++),c},ke=new Map,Ae=r,je=r+4096,Me=()=>Ae++,Ne=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,lt=new Float64Array(nt),ut=new Int32Array(nt),dt=0,pt=(e,t)=>{if(e===0&&t<r)return tt[t]===dt?1:(tt[t]=dt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>rt;for(;ut[i]===dt;){if(lt[i]===n)return 1;i=i+1&nt-1}return lt[i]=n,ut[i]=dt,0},mt=(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?at:Ce(ke,e,t+1,r,0,Me)}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;me(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(V(d[t],e,r,n))return p[h+t]}return at},ht=e=>{let t=e.length,n=0,c=0,u=!1;(Ee>De||we.size>De)&&(we=new Map,Te=new Map,Ee=2,He()),Ae>je&&(ke=new Map,Ae=r,He());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&pe(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&&pe(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(L!==0){if(h-p<=L||!e.startsWith(I,p)){qe[_]=at,Ve(y,e,p,h,v,at,0,0);continue}b=p+L}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=ot,ie=0;for(let t=te;t<D;t++)if(t===A&&(F=M<N?ot:j,ie=P),j!==ot){let n=e.charCodeAt(t),r=-1;if(M<N)o.charCodeAt(M)===n?(M++,M===N&&(r=j=re)):j=ot;else{let e=i[j],t=i[j+1],c=ot;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?ot:j,ie=P);let R=M<N?ot:j,z,ae=!1;if(A>=0)if(ae=!0,z=mt(e,E,A,F,ie),z!==at&&z<r&&ee[z]){let t=mt(e,E,D,R,P);t!==at&&t!==z&&(z=t,ae=!1)}else z===at&&(z=mt(e,E,D,R,P),ae=!1);else z=mt(e,E,D,R,P);let oe=0,se=0;z===at?qe[_]=at:(se=+!!ae,oe=b>=C?+!!O:Ce(we,e,b,C,+!!O,e=>Oe(e,O)),qe[_]=z,Ye[_]=se,Je[_]=oe),Ve(y,e,p,h,v,z,oe,se)}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--;lt=new Float64Array(nt),ut=new Int32Array(nt)}if(Ee>=Ne||Ae>=Ne)throw Error(`cn: too many distinct classes in one merge`);dt=dt+1|0,dt===0&&(tt.fill(0),ut.fill(0),dt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=qe[e];if(t===at){Xe[e]=1;continue}let n=Je[e];if(pt(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++)pt(n,x[e]);if(Ye[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&pt(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},gt=16384,_t=new Int32Array(gt*2),vt=0,U=1,yt=Object.create(null),bt=Object.create(null),xt=new Map,St=new Map,Ct=0,wt=0,Tt=()=>{vt^=gt,U=U+1|0,wt=0},Et=e=>{let t=yt[e];if(t!==void 0)return t;let n=ct(e,0,e.length),r=(n&16383)+vt,i=_t[r]===(n^U)||_t[r^gt]===(n^U-1);return i&&(t=bt[e],t!==void 0)?(yt[e]=t,t):(t=ht(e),i?(yt[e]=t,++Ct>F&&(Ct=0,bt=yt,yt=Object.create(null),Tt())):(_t[r]=n^U,++wt>gt&&Tt()),t)},Dt=e=>{let t=xt.get(e);if(t!==void 0)return t;let n=ct(e,0,e.length),r=(n&16383)+vt,i=_t[r]===(n^U)||_t[r^gt]===(n^U-1);return i&&(t=St.get(e),t!==void 0)?(xt.set(e,t),t):(t=ht(e),i?(xt.set(e,t),++Ct>F&&(Ct=0,St=xt,xt=new Map,Tt())):(_t[r]=n^U,++wt>gt&&Tt()),t)},Ot=e=>{let t=ct(e,0,e.length),n=(t&16383)+vt;return _t[n]===(t^U)||_t[n^gt]===(t^U-1)?!0:(_t[n]=t^U,++wt>gt&&Tt(),!1)},kt=F===0?ht:it?e=>{let t=xt.get(e);return t===void 0?Dt(e):t}:Et;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?kt(arguments[0]):kt(ft.apply(null,arguments))},mergeString:kt,seenBefore:F===0?()=>!1:Ot,mergeUncached:ht}},ut=(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:ut(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},dt=(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:ut(i,t);a&&(n&&(n+=` `),n+=a)}return n},ft=function(){return dt(arguments,!1)},pt=256,mt=16,ht=1024,gt=4096,_t=(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(gt).fill(``),l=Array(gt).fill(``),u=Array(gt).fill(``));let i=ct(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]=ut(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>mt&&(_.miss=mt,_.skip=ht,_.e.length=0,_.at=0);let u=_.e;u.length<pt?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(ut(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)}},vt=lt(rt),U=_t(vt.mergeString,vt);vt.merge;var yt=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase();function bt(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:yt(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var xt=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},St=e=>{let t=xt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ct=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)},wt={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 Tt(e){return e!=null}function Et(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??wt.width,a=e.size??e.height??wt.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?Ct(...c):Ct(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??wt[`stroke-width`])*Number(e.size??e.width??wt.width)/Number(t.size??t.width??wt.width):t.strokeWidth??wt[`stroke-width`];return[`svg`,{...Object.entries(wt).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Tt(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Tt(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Tt(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 Dt(e,t={}){return Et(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Ot=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1},kt=(0,V.createContext)({}),At=()=>(0,V.useContext)(kt),jt=(0,V.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=``}=At()??{},y=!!c||Ot(d),[b,x,S=[]]=Dt(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Ct(v,s),hasA11yProp:y,attributes:d});return(0,V.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,V.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Mt(e,t=[],n=[]){let r=typeof e==`string`?bt(e,t,n):e,i=(0,V.forwardRef)(({className:e,...t},n)=>(0,V.createElement)(jt,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=St(r.name)),i}var Nt={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};Nt.node;var Pt=Mt(Nt),Ft={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};Ft.node;var It=Mt(Ft),Lt={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Lt.node;var Rt=Mt(Lt),zt={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};zt.node;var Bt=Mt(zt),Vt={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Vt.node;var Ht=Mt(Vt),Ut={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Ut.node;var Wt=Mt(Ut),Gt={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]};Gt.node;var Kt=Mt(Gt),qt={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`]};qt.node;var Jt=Mt(qt),Yt={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Yt.node;var Xt=Mt(Yt),Zt={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Zt.node;var Qt=Mt(Zt),$t={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};$t.node;var en=Mt($t),tn={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`}]]};tn.node;var nn=Mt(tn),rn={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};rn.node;var an=Mt(rn),on={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};on.node;var sn=Mt(on);function cn({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=V.useRef(e!==void 0),[a,o]=V.useState(()=>t);return[i&&e!==void 0?e:a,V.useCallback(e=>{i||o(e)},[])]}var ln={...V},un={};function dn(e,t){let n=V.useRef(un);return n.current===un&&(n.current=e(t)),n}var fn=ln.useInsertionEffect,pn=fn&&fn!==ln.useLayoutEffect?fn:e=>e();function mn(e){let t=dn(hn).current;return t.next=e,pn(t.effect),t.trampoline}function hn(){let e={next:void 0,callback:gn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function gn(){}function W(){}var _n=Object.freeze([]),vn=Object.freeze({}),yn=typeof document<`u`?V.useLayoutEffect:()=>{},bn=V.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function xn(){return V.useContext(bn)}function Sn(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=mn(i),[,o]=V.useState(0),s=dn(wn).current,c=dn(Cn).current,l=V.useRef(0),u=V.useRef(!0),d=V.useRef(null),f=V.useRef(null),p=mn(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=mn((e,t)=>{c.set(e,t),p()}),h=mn(e=>{c.delete(e),p()}),g=mn(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(!Dn(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&On(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=En(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=mn(()=>{let[e,t]=Tn(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))});yn(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),yn(()=>{u.current&&v()}),yn(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=mn(e=>(s.add(e),()=>{s.delete(e)})),b=V.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,H.jsx)(bn.Provider,{value:b,children:t})}function Cn(){return new Map}function wn(){return new Set}function Tn(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)=>On(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 En(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Dn(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 On(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function kn(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 An=kn(`https://base-ui.com/production-error`,`Base UI`);function jn(e,t,n,r){let i=dn(Nn).current;return Pn(i,e,t,n,r)&&In(i,[e,t,n,r]),i.callback}function Mn(e){let t=dn(Nn).current;return Fn(t,e)&&In(t,e),t.callback}function Nn(){return{callback:null,cleanup:null,refs:[]}}function Pn(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Fn(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function In(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 Ln=19;function Rn(e){return Ln>=e}function zn(e){if(!V.isValidElement(e))return null;let t=e,n=t.props;return(Rn(19)?n?.ref:t.ref)??null}function Bn(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Vn(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 Hn(e,t){return typeof e==`function`?e(t):e}function Un(e,t){return typeof e==`function`?e(t):e}var Wn={};function Gn(e,t,n,r,i){if(!n&&!r&&!i&&!e)return qn(t);let a=qn(e);return t&&(a=Jn(a,t)),n&&(a=Jn(a,n)),r&&(a=Jn(a,r)),i&&(a=Jn(a,i)),a}function Kn(e){if(e.length===0)return Wn;if(e.length===1)return qn(e[0]);let t=qn(e[0]);for(let n=1;n<e.length;n+=1)t=Jn(t,e[n]);return t}function qn(e){return Qn(e)?{...e(Wn)}:Yn(e)}function Jn(e,t){return Qn(t)?t(e):Xn(e,t)}function Yn(e){let t={...e};for(let e in t){let n=t[e];Zn(e,n)&&(t[e]=er(n))}return t}function Xn(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Bn(e.style,r);break;case`className`:e[n]=nr(e.className,r);break;default:Zn(n,r)?e[n]=$n(e[n],r):e[n]=r}}return e}function Zn(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 Qn(e){return typeof e==`function`}function $n(e,t){return t?e?(...n)=>{let r=n[0];if(rr(r)){let i=r;tr(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:er(t):e}function er(e){return e&&((...t)=>{let n=t[0];return rr(n)&&tr(n),e(...t)})}function tr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function nr(e,t){return t?e?t+` `+e:t:e}function rr(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function ir(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=cr(r));let i=ar(t,n,r);if(n.enabled===!1)return null;let a=n.state??vn;return lr(e,r,i,a)}function ar(e,t,n){let{className:r,style:i}=e,{state:a=vn,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Hn(r,a):void 0,d=l?Un(i,a):void 0,f=l?Vn(a,c):vn,p=l&&s?or(s):void 0,m=l?Bn(f,p)??{}:vn;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=Mn([m.ref,zn(n),...o]):m.ref=jn(m.ref,zn(n),o):jn(null,null)),l?(u!==void 0&&(m.className=nr(m.className,u)),d!==void 0&&(m.style=Bn(m.style,d)),m):vn}function or(e){return Array.isArray(e)?Kn(e):Gn(void 0,e)}var sr=Symbol.for(`react.lazy`);function cr(e){if(e?.$$typeof!==sr)return e;let t=V.Children.toArray(e)[0];return V.isValidElement(t)?t:e}function lr(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Gn(n,t.props);return e.ref=n.ref,V.cloneElement(t,e)}return ur(e,n)}function ur(e,t){return e===`button`?(0,V.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,V.createElement)(`img`,{alt:``,...t,key:t.key}):V.createElement(e,t)}function dr(){let[,e]=V.useState({});return V.useCallback(()=>{e({})},[])}var fr=0;function pr(e,t=`mui`){let n=V.useRef(void 0),r=dr(),i=e??n.current;return V.useEffect(()=>{n.current??(fr+=1,n.current=`${t}-${fr}`,e??r())},[e,t,r]),i}var mr=ln.useId;function hr(e,t){if(mr!==void 0){let n=mr();return e??(t?`${t}-${n}`:n)}return pr(e,t)}function gr(e){return hr(e,`base-ui`)}function _r(e,t,n,r){let i=!1,a=!1,o=r??vn;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 vr(e,t,n){let r=n??vn;return{reason:e,event:t??new Event(`base-ui`),...r}}var yr=`none`,br=`trigger-press`,xr=`trigger-hover`,Sr=`trigger-focus`,Cr=`outside-press`,wr=`item-press`,Tr=`close-press`,Er=`focus-out`,Dr=`escape-key`,Or=`list-navigation`,kr=`keyboard`,Ar=`pointer`,jr=`cancel-open`,Mr=`sibling-open`,Nr=`disabled`,Pr=`imperative-action`,Fr=`window-resize`;function Ir(e){V.useEffect(e,_n)}var Lr=null;globalThis.requestAnimationFrame;var Rr=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)}},zr=class e{static create(){return new e}static request(e){return Rr.request(e)}static cancel(e){return Rr.cancel(e)}currentId=Lr;request(e){this.cancel(),this.currentId=Rr.request(()=>{this.currentId=Lr,e()})}cancel=()=>{this.currentId!==Lr&&(Rr.cancel(this.currentId),this.currentId=Lr)};disposeEffect=()=>this.cancel};function Br(){let e=dn(zr.create).current;return Ir(e.disposeEffect),e}function Vr(e,t=!1,n=!1,r=!1){let[i,a]=V.useState(e&&t?`idle`:void 0),[o,s]=V.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),yn(()=>{if(!e&&o&&i!==`ending`&&n){let e=zr.request(()=>{a(`ending`)});return()=>{zr.cancel(e)}}},[e,o,i,n]),yn(()=>{if(!e||t||i===void 0)return;let n=zr.request(()=>{a(void 0)});return()=>{zr.cancel(n)}},[t,e,i]),yn(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=zr.request(()=>{a(`idle`)});return()=>{zr.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Hr(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=xn(),u=V.useRef(-1),[d,f]=V.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=V.useRef(null),h=V.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 yn(()=>{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 Ur=`data-starting-style`,Wr=`data-ending-style`,Gr={[Ur]:``},Kr={[Wr]:``},qr={transitionStatus(e){return e===`starting`?Gr:e===`ending`?Kr:null}};function Jr(){return typeof window<`u`}function Yr(e){return Qr(e)?(e.nodeName||``).toLowerCase():`#document`}function Xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zr(e){return((Qr(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Qr(e){return Jr()?e instanceof Node||e instanceof Xr(e).Node:!1}function $r(e){return Jr()?e instanceof Element||e instanceof Xr(e).Element:!1}function ei(e){return Jr()?e instanceof HTMLElement||e instanceof Xr(e).HTMLElement:!1}function ti(e){return!Jr()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Xr(e).ShadowRoot}function ni(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=pi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ri(e){return/^(table|td|th)$/.test(Yr(e))}function ii(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ai=/transform|translate|scale|rotate|perspective|filter/,oi=/paint|layout|strict|content/,si=e=>!!e&&e!==`none`,ci;function li(e){let t=$r(e)?pi(e):e;return si(t.transform)||si(t.translate)||si(t.scale)||si(t.rotate)||si(t.perspective)||!di()&&(si(t.backdropFilter)||si(t.filter))||ai.test(t.willChange||``)||oi.test(t.contain||``)}function ui(e){let t=hi(e);for(;ei(t)&&!fi(t);){if(li(t))return t;if(ii(t))return null;t=hi(t)}return null}function di(){return ci??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ci}function fi(e){return/^(html|body|#document)$/.test(Yr(e))}function pi(e){return Xr(e).getComputedStyle(e)}function mi(e){return $r(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hi(e){if(Yr(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ti(e)&&e.host||Zr(e);return ti(t)?t.host:t}function gi(e){let t=hi(e);return fi(t)?(e.ownerDocument||e).body:ei(t)&&ni(t)?t:gi(t)}function _i(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=gi(e),i=r===e.ownerDocument?.body,a=Xr(r);if(i){let e=vi(a);return t.concat(a,a.visualViewport||[],ni(r)?r:[],e&&n?_i(e):[])}else return t.concat(r,_i(r,[],n))}function vi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var yi=V.createContext(void 0);function bi(e=!1){let t=V.useContext(yi);if(t===void 0&&!e)throw Error(An(16));return t}function xi(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:V.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 Si(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Xr(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 Ci(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=V.useRef(null),s=bi(!0),c=a??s!==void 0,{props:l}=xi({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=V.useCallback(()=>{let e=o.current;wi(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return yn(u,[u]),{getButtonProps:V.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Gn({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(tr(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=wi(r),s=!i&&Ti(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(),Si(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Si(r,e)))},onKeyUp(e){if(!t){if(tr(e),a?.(e),e.target===e.currentTarget&&i&&c&&wi(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Si(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:mn(e=>{o.current=e,u()})}}function wi(e){return ei(e)&&e.tagName===`BUTTON`}function Ti(e){return ei(e)&&e.tagName===`A`&&!!e.href}function Ei(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var Di=0,Oi=class e{static create(){return new e}currentId=Di;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Di,t()},e)}isStarted(){return this.currentId!==Di}clear=()=>{this.currentId!==Di&&(clearTimeout(this.currentId),this.currentId=Di)};disposeEffect=()=>this.clear};function ki(){let e=dn(Oi.create).current;return Ir(e.disposeEffect),e}function Ai(e){let t=dn(ji,e).current;return t.next=e,yn(t.effect),t}function ji(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Mi=t(a(),1);function Ni(e){return e==null?e:`current`in e?e.current:e}function Pi(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Fi=null;function Ii(e){if(!Fi){let e=[];Fi=e,queueMicrotask(()=>{Fi=null,Mi.flushSync(()=>{for(let t of e)t()})})}Fi.push(e)}function Li(e,t=!1,n=!1){let r=Br();return mn((i,a=null)=>{r.cancel();let o=Ni(e);if(o==null)return;let s=o,c=()=>{if(!n){Mi.flushSync(i);return}Ii(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Pi(s).map(e=>e.finished.then(W))).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(Pi(s).some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Ur;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 Ri(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=mn(a),s=Li(r,n,i);V.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var zi=V.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}=Ci({disabled:i,focusableWhenDisabled:a,native:o});return ir(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Bi=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Vi=r,Hi=(e,t)=>n=>{if(t?.variants==null)return Vi(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=Bi(t)||Bi(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 Vi(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)},Ui=Hi(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Wi({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,H.jsx)(zi,{"data-slot":`button`,className:U(Ui({variant:t,size:n,className:e})),...r})}function Gi(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Ki(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ti(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function qi(e,t){let n=e;for(;n;){if($r(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(ti(n)?n.host:null)}return null}function Ji(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Yi={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Xi={...Yi,position:`fixed`,margin:0,top:0,left:0},Zi={...Yi,position:`absolute`};function Qi(e,t){return t<0||t>=e.length}function $i(e,t){return na(e.current,{disabledIndices:t})}function ea(e,t){return na(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ta(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>na(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:Qi(e,u)?-1:u,wrapped:d}}function na(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&&ra(e,a,r));return a}function ra(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!aa(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function ia(e){return e.visibility===`hidden`||e.visibility===`collapse`}function aa(e,t=e?pi(e):null){return!e||!e.isConnected||!t||ia(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var oa=i((t=>{var n=e();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;t.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),sa=i(((e,t)=>{t.exports=oa()})),ca=i((t=>{var n=e(),r=sa();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}})),la=i(((e,t)=>{t.exports=ca()})),ua=`ArrowUp`,da=`ArrowDown`,fa=`ArrowLeft`,pa=`ArrowRight`,ma=`Home`,ha=new Set([ua,da,fa,pa,ma,`End`]),ga=`Shift`,_a=[ga,`Control`,`Alt`,`Meta`];function va(e){return ei(e)&&e.tagName===`INPUT`}function ya(e){return!!(va(e)&&e.selectionStart!=null||ei(e)&&e.tagName===`TEXTAREA`)}function ba(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=xa(e,t,`left`),a=Sa(e),o=Sa(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=xa(e,t,`top`),r=Sa(e),i=Sa(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 xa(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 Sa(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 Ca(e,t){let n=V.useRef(e),r=mn(t);yn(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var wa=Hi(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function Ta({className:e,variant:t,...n}){return(0,H.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:U(wa({variant:t}),e),...n})}function Ea({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-title`,className:U(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function Da({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-description`,className:U(`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 Oa(e){return ir(e.defaultTagName??`div`,e,e)}var ka=Hi(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Aa({className:e,variant:t=`default`,render:n,...r}){return Oa({defaultTagName:`span`,props:Gn({className:U(ka({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var ja=V.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return ir(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),Ma=`data-valid`,Na=`data-invalid`,Pa={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Fa={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ia={valid(e){return e===null?null:e?{[Ma]:``}:{[Na]:``}}},La={invalid:void 0,name:void 0,validityData:{state:Pa,errors:[],error:``,value:``,initialValue:null},setValidityData:W,disabled:void 0,setTouched:W,setDirty:W,setFilled:W,setFocused:W,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Fa,registerFieldControl:W,validation:{getValidationProps:(e,t=vn)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:W,getInputControl:()=>null,commit:async()=>{},change:W}},Ra=V.createContext(La);function za(e=!0){let t=V.useContext(Ra);if(t.setValidityData===W&&!e)throw Error(An(28));return t}function Ba(e,t,n){let{setFocused:r,focusOwnerRef:i}=za(),a=mn(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return yn(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function Va(e,t,n,r,i=!0,a){let{registerFieldControl:o}=za(),s=dn(()=>Symbol());yn(()=>{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]),yn(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var Ha=V.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:W,validationMode:`onSubmit`,submitCountRef:{current:0}});function Ua(){return V.useContext(Ha)}var Wa=V.createContext({controlId:void 0,registerControlId:W,resetControlId:W,labelId:void 0,setLabelId:W,messageIds:[],setMessageIds:W,getDescriptionProps:e=>e});function Ga(){return V.useContext(Wa)}function Ka(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=Ga(),o=gr(),s=dn(()=>Symbol()),c=V.useRef(!1),l=V.useRef(!1),u=mn(()=>{!c.current||i===W||(c.current=!1,i(s.current,void 0))});return yn(()=>{if(!n||i===W){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]),yn(()=>u,[u]),(n?r:void 0)??t??o}function qa({className:e,...t}){return(0,H.jsx)(`textarea`,{"data-slot":`textarea`,className:U(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function Ja(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var Ya=V.createContext(void 0);function Xa(){return V.useContext(Ya)?.direction??`ltr`}function Za(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=bi(),{ref:i,index:a}=Hr(e),o=n===a,s=V.useRef(null),c=jn(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 Qa(e){let{render:t,className:n,style:r,state:i=vn,props:a=_n,refs:o=_n,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Za({metadata:s});return ir(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function $a(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function eo({className:e,...t}){return(0,H.jsx)(`label`,{"data-slot":`label`,className:U(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var to=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,no=/^[\\/]{2}/;function ro(e,t){return t+e.replace(/\\/g,`/`)}var io=`popstate`;function ao(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function oo(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return uo(``,{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:fo(t)}return mo(t,n,null,e)}function G(e,t){if(e===!1||e==null)throw Error(t)}function so(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function co(){return Math.random().toString(36).substring(2,10)}function lo(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 uo(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?po(t):t,state:n,key:t&&t.key||r||co(),mask:i}}function fo({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 po(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 mo(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=ao(e)?e:uo(h.location,e,t);n&&n(r,e),l=u()+1;let d=lo(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=ao(e)?e:uo(h.location,e,t);n&&n(r,e),l=u();let i=lo(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 ho(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(io,d),c=e,()=>{i.removeEventListener(io,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 ho(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),G(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:fo(t);return i=i.replace(/ $/,`%20`),!n&&no.test(i)&&(i=r+i),new URL(i,r)}var go=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)}},_o=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function vo(e){return _o.has(e)}var yo=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function bo(e){return yo.has(e)}function xo(e){return e.index===!0}function So(e){let t={};return e.Component&&Object.assign(t,{element:V.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:V.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:V.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Co(e,t=So,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(G(e.index!==!0||!e.children,`Cannot specify children on an index route`),G(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),xo(e)){let n={...e,id:s};return r[s]=wo(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=wo(n,t(n)),e.children&&(n.children=Co(e.children,t,o,r,i)),n}})}function wo(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function To(e,t,n=`/`){return Eo(e,t,n,!1)}function Eo(e,t,n,r,i){let a=Yo((typeof t==`string`?po(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Oo(e),s=null,c=Jo(a);for(let e=0;s==null&&e<o.length;++e)s=Uo(o[e],c,r);return s}function Do(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 Oo(e){let t=ko(e);return jo(t),t}function ko(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;G(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=as([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(G(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ko(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Vo(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=qo(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 Ao(e.path))a(e,t,!0,n)}),t}function Ao(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=Ao(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 jo(e){e.sort((e,t)=>e.score===t.score?Ho(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Mo=/^:[\w-]+$/,No=/^:[\w-]+/,Po=3.5,Fo=3,Io=2,Lo=1,Ro=10,zo=-2,Bo=e=>e===`*`;function Vo(e,t){let n=e.split(`/`),r=n.length;return n.some(Bo)&&(r+=zo),t&&(r+=Io),n.filter(e=>!Bo(e)).reduce((e,t)=>e+(Mo.test(t)?Fo:No.test(t)?Po:t===``?Lo:Ro),r)}function Ho(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 Uo(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?Ko(u,l,s.matcher,s.compiledParams):Go(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Go({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:as([a,d.pathname]),pathnameBase:ss(as([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=as([a,d.pathnameBase]))}return o}function Wo(e,t={}){let n=e;n.endsWith(`*`)&&n!==`*`&&!n.endsWith(`/*`)&&(so(!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 G(n===`?`||o!=null,`Missing ":${e}" param`),encodeURIComponent(i(o))+r}return e.replace(/\?$/g,``)}).filter(e=>!!e).join(`/`)}function Go(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=qo(e.path,e.caseSensitive,e.end);return Ko(e,t,n,r)}function Ko(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 qo(e,t=!1,n=!0){so(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 Jo(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return so(!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 Yo(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 Xo({basename:e,pathname:t}){return t===`/`?e:as([e,t])}var Zo=e=>to.test(e);function Qo(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?po(e):e,a;return n?(n=is(n),a=n.startsWith(`/`)?$o(n.substring(1),`/`):$o(n,t)):a=t,{pathname:a,search:cs(r),hash:ls(i)}}function $o(e,t){let n=os(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function es(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 ts(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ns(e){let t=ts(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function rs(e,t,n,r=!1){let i;typeof e==`string`?i=po(e):(i={...e},G(!i.pathname||!i.pathname.includes(`?`),es(`?`,`pathname`,`search`,i)),G(!i.pathname||!i.pathname.includes(`#`),es(`#`,`pathname`,`hash`,i)),G(!i.search||!i.search.includes(`#`),es(`#`,`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=Qo(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var is=e=>e.replace(/[\\/]{2,}/g,`/`),as=e=>is(e.join(`/`)),os=e=>e.replace(/\/+$/,``),ss=e=>os(e).replace(/^\/*/,`/`),cs=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ls=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,us=(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})},ds=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],fs=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 ps(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ms(e){return as(e.map(e=>e.route.path).filter(Boolean))||`/`}function hs(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?po(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 gs=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function _s(e,t){let n=e;if(typeof n!=`string`||!to.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(gs)try{let e=new URL(window.location.href),r=no.test(n)?new URL(ro(n,e.protocol)):new URL(n),a=Yo(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{so(!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 vs=Symbol(`Uninstrumented`),ys=new WeakMap;function bs(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)=>Es(await Ds(n.lazy,void 0,()=>e(...t),Os))}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)=>Es(await Ds(n[`lazy.middleware`],void 0,()=>t(...e),Os))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>Es(await Ds(n[`lazy.loader`],void 0,()=>t(...e),Os))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>Es(await Ds(n[`lazy.action`],void 0,()=>t(...e),Os))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Ss(t.loader),i=async(...t)=>Es(await Ds(n.loader,ks(t[0]),()=>e(...t),Os));e.hydrate===!0&&(i.hydrate=!0),Cs(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Ss(t.action),i=async(...t)=>Es(await Ds(n.action,ks(t[0]),()=>e(...t),Os));Cs(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Ss(e),r=async(...e)=>Es(await Ds(n.middleware,ks(e[0]),()=>t(...e),Os));return Cs(r,t),r})),r}function xs(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=Ss(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?fo(i):`.`,...As(e,a??{})};return Es(await Ds(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=ws(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...Os(e),meta:o})))};Cs(r,t),e.navigate=r}if(n.fetch.length>0){let t=Ss(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return Es(await Ds(n.fetch,{href:o??`.`,fetcherKey:i,...As(e,s??{})},async()=>{let n=ws(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...Os(e),meta:c})))};Cs(r,t),e.fetch=r}return e}function Ss(e){return e[vs]??e}function Cs(e,t){e[vs]=t}function ws(e,t){return ys.set(e,t),()=>{ys.get(e)===t&&ys.delete(e)}}function Ts(e){let t=ys.get(e);return ys.delete(e),t}function Es(e){if(e.type===`error`)throw e.value;return e.value}async function Ds(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=Ds(e,t,n,r,i,a-1),await s,G(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 Os(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function ks(e){let{request:t,context:n,params:r}=e;return{...e,request:js(t),params:{...r},context:Ms(n)}}function As(e,t){return{currentUrl:fo(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 js(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Ms(e){return{get:t=>e.get(t)}}var Ns=[`POST`,`PUT`,`PATCH`,`DELETE`],Ps=new Set(Ns),Fs=[`GET`,...Ns],Is=new Set(Fs),Ls=new Set([301,302,303,307,308]),Rs=new Set([307,308]),zs={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},Bs={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Vs={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Hs=`remix-router-transitions`,Us=Symbol(`ResetLoaderData`),Ws=class{#e;#t;#n;#r;constructor(e){this.#e=e,this.#t=Oo(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=Oo(e)}setHmrRoutes(e){this.#n=e,this.#r=Oo(e)}commitHmrRoutes(){this.#n&&(this.#e=this.#n,this.#t=this.#r,this.#n=void 0,this.#r=void 0)}};function Gs(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;G(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),...bs(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Ws(Co(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||cc,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=Eo(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=Mc(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=jc(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Ve(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Ve(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=>Xs(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=Zs(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:zs,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,L=new Set,R=new Map,z,ae=null;function oe(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(z){z(),z=void 0;return}so(R.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=Fe({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{z=e});e.history.go(r*-1),Pe(i,{state:`blocked`,location:n,proceed(){Pe(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,Vs),B({blockers:e})}}),E?.resolve(),E=null;return}return fe(t,n)}),n){rl(t,A);let e=()=>il(t,A);t.addEventListener(`pagehide`,e),ee=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||fe(`POP`,w.location,{initialHydration:!0}),C}function se(){d&&d(),ee&&ee(),f.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>Ee(w.fetchers,t)),w.blockers.forEach((e,t)=>Ne(t))}function ce(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 B(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`&&(L.has(t)?n.push(t):r.push(t))}),L.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=>Ee(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function le(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&qc(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?Oc(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,Vs)));let l=!te&&Be(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&qc(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}}B({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:zs,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,ae?.resolve(),ae=null}async function ue(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=al();let n=E.promise;return e.history.go(t),n}let r=Ts(C),{path:i,submission:a,error:o}=Js(!1,qs(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),s;n?.mask&&(s={pathname:``,search:``,hash:``,...typeof n.mask==`string`?po(n.mask):{...w.location.mask,...n.mask}});let l=w.location,u=uo(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&&qc(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=Fe({currentLocation:l,nextLocation:u,historyAction:f});if(h){Pe(h,{state:`blocked`,location:u,proceed(){Pe(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),ue(t,n)},reset(){let e=new Map(w.blockers);e.set(h,Vs),B({blockers:e})}});return}await fe(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 de(){ae||=al(),V(),B({revalidation:`loading`});let e=ae.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(fe(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(fe(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function fe(t,n,r){O&&O.abort(),O=null,T=t,te=(r&&r.startUninterruptedRevalidation)===!0,ze(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:Eo(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!ne&&Fc(w.location,n)&&!(r&&r.submission&&qc(r.submission.formMethod))){le(n,{matches:a},{flushSync:o});return}let l=Ve(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),r?.instrumentationNavigateMetaReceiver){let t=Xc(e.history,n,a);r.instrumentationNavigateMetaReceiver(t)}if(!a){let{error:e,notFoundMatches:t,route:r}=Ie(n.pathname);le(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=Cc(e.history,n,O.signal,r&&r.submission),f=e.getContext?await e.getContext():new go,p;if(r&&r.pendingError)p=[Ac(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&qc(r.submission.formMethod)){let i=await pe(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(Bc(t)&&ps(t.error)&&t.error.status===404){O=null,le(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=Qc(n,a,t,r.submission),o=!1,l.active=!1,d=Cc(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await me(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,le(n,{matches:h||a,...kc(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function pe(t,n,i,l,u,d,f,p,m={}){if(V(),B({navigation:$c(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await He(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}=jc(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Ac(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}=Ie(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=Yc(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Mc(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await xe(t,n,mc(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(Vc(h)){let n;return n=m&&m.replace!=null?m.replace:Sc(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await be(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Bc(h)){let e=Ac(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 me(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||Qc(n,i,l,p),x=p||m||Zc(b),S=!te&&!g;if(d){if(S){let e=he(v);B({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await He(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}=jc(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Ac(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}=Ie(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=Ys(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,ne,j,L,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=Ae(e);return le(n,{matches:i,loaderData:{},errors:v&&Bc(v[1])?{[v[0]]:v[1].error}:null,...kc(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=he(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=ge(E)),B(e,{flushSync:_})}E.forEach(e=>{Oe(e.key),e.controller&&M.set(e.key,e.controller)});let D=()=>E.forEach(e=>Oe(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await Se(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=Nc(k);if(ee)return await be(t,ee.result,!0,{replace:h}),{shortCircuited:!0};if(ee=Nc(A),ee)return F.add(ee.key),await be(t,ee.result,!0,{replace:h}),{shortCircuited:!0};let P=new Map(w.fetchers),{loaderData:I,errors:R}=Dc(w,i,k,v,E,A,P);g&&w.errors&&(R={...w.errors,...R});let z=Ae(P),ae=je(re,P),oe=z||ae||E.length>0;return{matches:i,loaderData:I,errors:R,...oe?{workingFetchers:P}:{}}}function he(e){if(e&&!Bc(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function ge(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=el(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function _e(t,n,r,i){Oe(t);let a=(i&&i.flushSync)===!0,o=Ts(C),l=s.activeRoutes,u=qs(w.location,w.matches,c,r,n,i?.relative),d=Eo(l,u,c,!1,s.branches),f=Ve(d,l,u);if(f.active&&f.matches&&(d=f.matches),o&&o(Xc(e.history,u,d)),!d){Ce(t,n,Mc(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=Js(!0,u,i);if(h){Ce(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new go,_=(i&&i.preventScrollReset)===!0;if(m&&qc(m.formMethod)){await ve(t,n,p,d,g,f.active,a,_,m,i&&i.defaultShouldRevalidate);return}ie.set(t,{routeId:n,path:p}),await ye(t,n,p,d,g,f.active,a,_,m)}async function ve(t,n,i,l,u,d,f,p,m,h){V(),ie.delete(t),H(t,tl(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=Cc(e.history,i,g.signal,m);if(d){let e=await He(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ce(t,n,e.error,{flushSync:f});return}else if(e.matches)l=e.matches;else{Ce(t,n,Mc(404,{pathname:i}),{flushSync:f});return}}let v=Yc(l,i);if(!v.route.action&&!v.route.lazy){Ce(t,n,Mc(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}M.set(t,g);let y=N,b=mc(a,o,_,i,l,v,r,u),x=await xe(_,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(L.has(t)){if(Vc(S)||Bc(S)){H(t,nl(void 0));return}}else{if(Vc(S))if(M.delete(t),re>y){H(t,nl(void 0));return}else return F.add(t),H(t,el(m)),be(_,S,!1,{fetcherSubmission:m,preventScrollReset:p});if(Bc(S)){Ce(t,n,S.error);return}}let C=w.navigation.location||w.location,E=Cc(e.history,C,g.signal),D=s.activeRoutes,k=w.navigation.state===`idle`?w.matches:Eo(D,w.navigation.location,c,!1,s.branches);G(k,`Didn't find any matches after fetcher action`);let A=++N;P.set(t,A);let{dsMatches:ee,revalidatingFetchers:te}=Ys(E,u,a,o,e.history,w,k,m,C,r,!1,ne,j,L,ie,F,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),I=el(m,S.data),R=new Map(w.fetchers);R.set(t,I),te.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=R.get(t),r=el(void 0,n?n.data:void 0);R.set(t,r),Oe(t),e.controller&&M.set(t,e.controller)}),B({fetchers:R});let z=()=>te.forEach(e=>Oe(e.key));g.signal.addEventListener(`abort`,z);let{loaderResults:ae,fetcherResults:oe}=await Se(ee,te,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,z),P.delete(t),M.delete(t),te.forEach(e=>M.delete(e.key));let se=w.fetchers.has(t),ce=e=>{if(!se)return e;let n=new Map(e.fetchers);return n.set(t,nl(S.data)),{...e,fetchers:n}},ue=Nc(ae);if(ue)return w=ce(w),be(E,ue.result,!1,{preventScrollReset:p});if(ue=Nc(oe),ue)return F.add(ue.key),w=ce(w),be(E,ue.result,!1,{preventScrollReset:p});let de=new Map(w.fetchers);se&&de.set(t,nl(S.data));let{loaderData:fe,errors:pe}=Dc(w,k,ae,void 0,te,oe,de);je(A,de),w.navigation.state===`loading`&&A>re?(G(T,`Expected pending action`),O&&O.abort(),le(w.navigation.location,{matches:k,loaderData:fe,errors:pe,fetchers:de})):(B({errors:pe,loaderData:Oc(w.loaderData,fe,k,pe),fetchers:de}),ne=!1)}async function ye(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);H(t,el(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Cc(e.history,i,m.signal);if(l){let e=await He(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ce(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{Ce(t,n,Mc(404,{pathname:i}),{flushSync:u});return}}let g=Yc(s,i);M.set(t,m);let _=N,v=await xe(h,i,mc(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(L.has(t)){H(t,nl(void 0));return}if(Vc(y))if(re>_){H(t,nl(void 0));return}else{F.add(t),await be(h,y,!1,{preventScrollReset:d});return}if(Bc(y)){Ce(t,n,y.error);return}H(t,nl(y.data))}}async function be(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`);G(d,`Expected a Location header on the redirect Response`),d=Sc(d,new URL(r.url),c,e.history);let f=uo(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Zo(d)){let n=ho(t,d,!0);e=n.origin!==t.location.origin||Yo(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=Zc(w.navigation));let _=o||s;Rs.has(i.response.status)&&_&&qc(_.formMethod)?await fe(p,f,{submission:{..._,formAction:d},preventScrollReset:l||D,enableViewTransition:a?k:void 0}):await fe(p,f,{overrideNavigation:Qc(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?k:void 0})}async function xe(e,t,n,r,i){let a,o={};try{a=await hc(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(!qc(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(zc(r)){let i=r.result;o[t]={type:`redirect`,response:yc(i,e,t,n,c)}}else o[t]=await vc(r);return o}async function Se(e,t,n,r,i){let a=xe(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await xe(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:Mc(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function V(){ne=!0,ie.forEach((e,t)=>{M.has(t)&&j.add(t),Oe(t)})}function H(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),B({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Ce(e,t,n,r={}){let i=Ac(w.matches,t),a=new Map(w.fetchers);Ee(a,e),B({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function we(e){return I.set(e,(I.get(e)||0)+1),L.has(e)&&L.delete(e),w.fetchers.get(e)||Bs}function Te(e,t){Oe(e,t?.reason),H(e,nl(null))}function Ee(e,t){let n=w.fetchers.get(t);M.has(t)&&!(n&&n.state===`loading`&&P.has(t))&&Oe(t),ie.delete(t),P.delete(t),F.delete(t),L.delete(t),j.delete(t),e.delete(t)}function De(e){let t=(I.get(e)||0)-1;t<=0?(I.delete(e),L.add(e)):I.set(e,t),B({fetchers:new Map(w.fetchers)})}function Oe(e,t){let n=M.get(e);n&&(n.abort(t),M.delete(e))}function ke(e,t){for(let n of e){let e=t.get(n);G(e,`Expected fetcher: ${n}`);let r=nl(e.data);t.set(n,r)}}function Ae(e){let t=[],n=!1;for(let r of F){let i=e.get(r);G(i,`Expected fetcher: ${r}`),i.state===`loading`&&(F.delete(r),t.push(r),n=!0)}return ke(t,e),n}function je(e,t){let n=[];for(let[r,i]of P)if(i<e){let e=t.get(r);G(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Oe(r),P.delete(r),n.push(r))}return ke(n,t),n.length>0}function Me(e,t){let n=w.blockers.get(e)||Vs;return R.get(e)!==t&&R.set(e,t),n}function Ne(e){w.blockers.delete(e),R.delete(e)}function Pe(e,t){let n=w.blockers.get(e)||Vs;G(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),B({blockers:r})}function Fe({currentLocation:e,nextLocation:t,historyAction:n}){if(R.size===0)return;R.size>1&&so(!1,`A router only supports one blocker at a time`);let r=Array.from(R.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 Ie(e){let t=Mc(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=jc(n);return{notFoundMatches:r,route:i,error:t}}function Le(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===zs){_=!0;let e=Be(w.location,w.matches);e!=null&&B({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Re(e,t){return h&&h(e,t.map(e=>Do(e,w.loaderData)))||e.key}function ze(e,t){if(m&&g){let n=Re(e,t);m[n]=g()}}function Be(e,t){if(m){let n=Re(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Ve(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:Eo(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:Eo(n,r,c,!0,e)}}return{active:!1,matches:null}}async function He(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||tc(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=Eo(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=Eo(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&Ue(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=Eo(s.activeRoutes,n,c,!0,u),!f||Ue(l,f))return{type:`success`,matches:null};l=f}}function Ue(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function We(e){o={},s.setHmrRoutes(Co(e,a,void 0,o))}function Ge(e,t,n=!1){tc(e,t,s,o,a,n),s.hasHMRRoutes||B({})}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:oe,subscribe:ce,enableScrollRestoration:Le,navigate:ue,fetch:_e,revalidate:de,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:we,resetFetcher:Te,deleteFetcher:De,dispose:se,getBlocker:Me,deleteBlocker:Ne,patchRoutes:Ge,_internalFetchControllers:M,_internalSetRoutes:We,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){B(e)}},e.instrumentations&&(C=xs(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Ks(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function qs(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=rs(r||`.`,ns(o),Yo(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Jc(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=Xo({basename:n,pathname:c.pathname})),fo(c)}function Js(e,t,n){if(!n||!Ks(n))return{path:t};if(n.formMethod&&!Kc(n.formMethod))return{path:t,error:Mc(405,{method:n.formMethod})};let r=()=>({path:t,error:Mc(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Pc(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!qc(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(!qc(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()}}}G(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=wc(n.formData),s=n.formData;else if(n.body instanceof FormData)o=wc(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Tc(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Tc(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(qc(c.formMethod))return{path:t,submission:c};let l=po(t);return e&&l.search&&Jc(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:fo(l),submission:c}}function Ys(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Bc(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&&Bc(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=ms(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(!Xs(s))f=!1;else if(u){let{shouldLoad:e}=Zs(s,a.loaderData,a.errors);f=e}else Qs(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return pc(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?$s(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return pc(n,r,e,c,k,i,l,t,ec(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=Eo(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=Yc(b,e.path),C=new AbortController,w=Cc(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=mc(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=mc(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};ec(S,a)&&(T=mc(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 Xs(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Zs(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Xs(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 Qs(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function $s(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function ec(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function tc(e,t,n,r,i,a){let o;if(e){let t=r[e];G(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=>nc(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Co(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]=Co([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 nc(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=>nc(e,t)))??!1:!1}var rc=new WeakMap,ic=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(G(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=rc.get(i);o||(o={},rc.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=vo(e),n=i[e]!==void 0;if(t)so(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)so(!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},ac=new WeakMap;function oc(e,t,n,r,i){let a=n[e.id];if(G(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=ac.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{G(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=bo(e),o=a[e]!==void 0;i?so(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?so(!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 ac.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=ic({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 sc(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 cc(e){return e.matches.some(e=>e.route.middleware)?lc(e,()=>sc(e)):sc(e)}function lc(e,t){return uc(e,t,e=>{if(Gc(e))throw e;return e},Lc,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{[Ac(r,a).route.id]:{type:`error`,result:t}}}}}async function uc(e,t,n,r,i){let{matches:a,...o}=e;return await dc(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function dc(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 dc(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 fc(e,t,n,r,i){let a=ic({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=oc(r.route,qc(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function pc(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=fc(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?ec(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?ec(a,{...l,defaultShouldRevalidate:e}):ec(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!qc(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(qc(n.method)||!p)?gc({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 mc(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?pc(e,t,n,r,ms(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:fc(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function hc(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:hs(t,n),pattern:ms(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 lc(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 gc({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=qc(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:hs(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 Mc(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 Mc(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function _c(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 vc(e){let{result:t,type:n}=e;if(Uc(t)){let e;try{e=await _c(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new fs(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Hc(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:Ic(t),statusCode:ps(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:ps(t)?t.status:void 0}:Hc(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 yc(e,t,n,r,i){let a=e.headers.get(`Location`);if(G(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Zo(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=qs(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var bc=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function xc(e){try{return bc.includes(new URL(e).protocol)}catch{return!1}}function Sc(e,t,n,r){if(Zo(e)){let r=e,i=no.test(r)?new URL(ro(r,t.protocol)):new URL(r);if(xc(i.toString()))throw Error(`Invalid redirect location`);let a=Yo(i.pathname,n)!=null;if(i.origin===t.origin&&a)return is(i.pathname)+i.search+i.hash}try{if(xc(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Cc(e,t,n,r){let i=e.createURL(Pc(t)).toString(),a={signal:n};if(r&&qc(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=wc(r.formData):a.body=r.formData}return new Request(i,a)}function wc(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Tc(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Ec(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Bc(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(G(!Vc(f),`Cannot handle redirect results in processLoaderData`),Bc(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Ac(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Us),c||(c=!0,s=ps(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 Dc(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Ec(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(G(s,`Did not find corresponding fetcher result`),Bc(s)){let t=Ac(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Vc(s))G(!1,`Unhandled fetcher revalidation redirect`);else{let e=nl(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Oc(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Us).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 kc(e){return e?Bc(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ac(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 jc(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 Mc(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 fs(e||500,o,Error(s),!0)}function Nc(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Vc(r))return{key:n,result:r}}}function Pc(e){return fo({...typeof e==`string`?po(e):e,hash:``})}function Fc(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Ic(e){return new fs(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Lc(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Rc(t))}function Rc(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function zc(e){return Uc(e.result)&&Ls.has(e.result.status)}function Bc(e){return e.type===`error`}function Vc(e){return(e&&e.type)===`redirect`}function Hc(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Uc(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Wc(e){return Ls.has(e)}function Gc(e){return Uc(e)&&Wc(e.status)&&e.headers.has(`Location`)}function Kc(e){return Is.has(e.toUpperCase())}function qc(e){return Ps.has(e.toUpperCase())}function Jc(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Yc(e,t){let n=typeof t==`string`?po(t).search:t.search;if(e[e.length-1].route.index&&Jc(n||``))return e[e.length-1];let r=ts(e);return r[r.length-1]}function Xc(e,t,n){return{url:hs(e.createURL(t),t),pattern:n?ms(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function Zc(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 Qc(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 $c(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 el(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 tl(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 nl(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 rl(e,t){try{let n=e.sessionStorage.getItem(Hs);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 il(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Hs,JSON.stringify(n))}catch(e){so(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function al(){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 ol=V.createContext(null);ol.displayName=`DataRouter`;var sl=V.createContext(null);sl.displayName=`DataRouterState`;var cl=V.createContext(!1);function ll(){return V.useContext(cl)}var ul=V.createContext({isTransitioning:!1});ul.displayName=`ViewTransition`;var dl=V.createContext(new Map);dl.displayName=`Fetchers`;var fl=V.createContext(null);fl.displayName=`Await`;var pl=V.createContext(null);pl.displayName=`Navigation`;var ml=V.createContext(null);ml.displayName=`Location`;var hl=V.createContext({outlet:null,matches:[],isDataRoute:!1});hl.displayName=`Route`;var gl=V.createContext(null);gl.displayName=`RouteError`;var _l=`REACT_ROUTER_ERROR`,vl=`REDIRECT`,yl=`ROUTE_ERROR_RESPONSE`;function bl(e){if(e.startsWith(`${_l}:${vl}:{`))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 xl(e){if(e.startsWith(`${_l}:${yl}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new fs(t.status,t.statusText,t.data)}catch{}}function Sl(e,{relative:t}={}){G(Cl(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=V.useContext(pl),{hash:i,pathname:a,search:o}=jl(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:as([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Cl(){return V.useContext(ml)!=null}function wl(){return G(Cl(),`useLocation() may be used only in the context of a <Router> component.`),V.useContext(ml).location}var Tl=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function El(){let{isDataRoute:e}=V.useContext(hl);return e?Zl():Dl()}function Dl(){G(Cl(),`useNavigate() may be used only in the context of a <Router> component.`);let e=V.useContext(ol),{basename:t,navigator:n}=V.useContext(pl),{matches:r}=V.useContext(hl),{pathname:i}=wl(),a=JSON.stringify(ns(r)),o=V.useRef(!1);return V.useLayoutEffect(()=>{o.current=!0}),V.useCallback((r,s={})=>{if(so(o.current,Tl),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=rs(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:as([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Ol=V.createContext(null);function kl(e){let t=V.useContext(hl).outlet;return V.useMemo(()=>t&&V.createElement(Ol.Provider,{value:e},t),[t,e])}function Al(){let{matches:e}=V.useContext(hl);return e[e.length-1]?.params??{}}function jl(e,{relative:t}={}){let{matches:n}=V.useContext(hl),{pathname:r}=wl(),i=JSON.stringify(ns(n));return V.useMemo(()=>rs(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Ml(e,t,n){G(Cl(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=V.useContext(pl),{matches:i}=V.useContext(hl),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=wl(),l;if(t){let e=typeof t==`string`?po(t):t;G(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})):To(e,{pathname:d}),p=zl(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:as([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:as([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?V.createElement(ml.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function Nl(){let e=Xl(),t=ps(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return V.createElement(V.Fragment,null,V.createElement(`h2`,null,`Unexpected Application Error!`),V.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?V.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Pl=V.createElement(Nl,null),Fl=class extends V.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=cl;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=xl(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:V.createElement(hl.Provider,{value:this.props.routeContext},V.createElement(gl.Provider,{value:e,children:this.props.component}));return this.context?V.createElement(Ll,{error:e},t):t}},Il=new WeakMap;function Ll({children:e,error:t}){let{basename:n}=V.useContext(pl);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=bl(t.digest);if(e){let r=Il.get(t);if(r)throw r;let i=_s(e.location,n),a=i.absoluteURL||i.to;if(xc(a))throw Error(`Invalid redirect location`);if(gs&&!Il.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 Il.set(t,n),n}return V.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Rl({routeContext:e,match:t,children:n}){let r=V.useContext(ol);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),V.createElement(hl.Provider,{value:e},n)}function zl(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);G(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:ms(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||Pl,o&&(s<0&&c===0?($l(`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?V.createElement(n.route.Component,null):n.route.element?n.route.element:e,V.createElement(Rl,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?V.createElement(Fl,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Bl(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vl(e){let t=V.useContext(ol);return G(t,Bl(e)),t}function Hl(e){let t=V.useContext(sl);return G(t,Bl(e)),t}function Ul(e){let t=V.useContext(hl);return G(t,Bl(e)),t}function Wl(e){let t=Ul(e),n=t.matches[t.matches.length-1];return G(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Gl(){return Wl(`useRouteId`)}function Kl(){let e=Hl(`useNavigation`);return V.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function ql(){let e=Vl(`useRevalidator`),t=Hl(`useRevalidator`),n=V.useCallback(async()=>{await e.router.revalidate()},[e.router]);return V.useMemo(()=>({revalidate:n,state:t.revalidation}),[n,t.revalidation])}function Jl(){let{matches:e,loaderData:t}=Hl(`useMatches`);return V.useMemo(()=>e.map(e=>Do(e,t)),[e,t])}function Yl(){let e=Hl(`useLoaderData`),t=Wl(`useLoaderData`);return e.loaderData[t]}function Xl(){let e=V.useContext(gl),t=Hl(`useRouteError`),n=Wl(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Zl(){let{router:e}=Vl(`useNavigate`),t=Wl(`useNavigate`),n=V.useRef(!1);return V.useLayoutEffect(()=>{n.current=!0}),V.useCallback(async(r,i={})=>{so(n.current,Tl),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Ql={};function $l(e,t,n){!t&&!Ql[e]&&(Ql[e]=!0,so(!1,n))}function eu(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 tu(e,t=`|`){return e.map(e=>Ou(e)).join(t)}function nu(e,t){return typeof t==`bigint`?t.toString():t}var ru=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function iu(e){return new ru(e)}function au(e){return e==null}function ou(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function su(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var cu=Symbol(`evaluating`);function lu(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==cu)return r===void 0&&(r=cu,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function uu(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function du(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function fu(e){return du(e._zod.def)??e._zod.def.shape}function pu(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return uu(this,t,e),e},enumerable:!0,configurable:!0})}function mu(e,t,n){t in e?uu(e,t,n):e[t]=n}function hu(e,t,n,r){let i=fu(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?pu(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):mu(e,a,r?r(n.value,a):n.value))}}function gu(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?pu(e,n,()=>t[n]):mu(e,n,r.value))}}function _u(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function vu(e){return JSON.stringify(e)}function yu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var bu=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function xu(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Su=iu(()=>{if(_d.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Cu(e){if(xu(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(xu(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function wu(e){return Cu(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Tu=new Set([`string`,`number`,`symbol`]);function Eu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Du(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 Ou(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ku(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Au={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ju={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Mu(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return hu(i,e,Nu(e,t)),Du(e,_u(n,{shape:i,checks:[]}))}function Nu(e,t){let n=fu(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Pu(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Nu(e,t)),a={};return hu(a,e,Reflect.ownKeys(fu(e)).filter(e=>!i.has(e))),Du(e,_u(n,{shape:a,checks:[]}))}function Fu(e,t){if(!Cu(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=fu(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Du(e,_u(e._zod.def,{shape:Iu(e,t)}))}function Iu(e,t){let n={};return hu(n,e,Reflect.ownKeys(fu(e))),gu(n,t),n}function Lu(e,t){if(!Cu(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Du(e,_u(e._zod.def,{shape:Iu(e,t)}))}function Ru(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return hu(n,e,Reflect.ownKeys(fu(e))),hu(n,t,Reflect.ownKeys(fu(t))),Du(e,_u(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function zu(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Nu(t,n)):void 0,o={};return hu(o,t,Reflect.ownKeys(fu(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Du(t,_u(t._zod.def,{shape:o,checks:[]}))}function Bu(e,t,n){let r=n?new Set(Nu(t,n)):void 0,i={};return hu(i,t,Reflect.ownKeys(fu(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Du(t,_u(t._zod.def,{shape:i}))}function Vu(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 Hu(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 Uu(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Wu(e){return typeof e==`string`?e:e?.message}function Gu(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Ku(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function qu(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Wu(e.inst?._zod.def?.error?.(e))??Wu(a?.(e))??Wu(t?.error?.(e))??Wu(n.customError?.(e))??Wu(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t===`inst`||t===`schema`||t===`continue`||t===`input`||t===`__proto__`||(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Ju=/[\uD800-\uDBFF]/;function Yu(e){let t=e.length;if(!Ju.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Xu(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Zu(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Qu(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function $u(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):rd(e,n,r.value)}}function ed(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function td(e,t,n){return ed(e,t,n,!1)}function nd(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return ed(this,n,r(this))},set(e){ed(this,n,e)}})}return t}function rd(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:ed(this,t,n.bind(this))},set(e){ed(this,t,e)}})}function id(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var ad,od=!1,sd={configurable:!0,get(){od=!0}};function q(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&ad!==e._zod){ad=void 0;return}ad=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,sd);let e=od;od=!1;try{let r=n(this);return od?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),od||=e,r}catch(n){throw delete this[t],od||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function cd(e,t,n,r){let i=id(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var ld=`~constantCatch`;function ud(e){let t=()=>e;return t[ld]=!0,t}var dd,fd={value:void 0,enumerable:!1},pd=`captureStackTrace`in Error?Error:null;function md(e){let t=pd;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return pd=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function J(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){fd.value=new a(r);try{Object.defineProperty(n,"_zod",fd)}finally{fd.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),$u(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?md(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var hd=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},gd=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(dd=globalThis).__zod_globalConfig??(dd.__zod_globalConfig={});var _d=globalThis.__zod_globalConfig;function vd(e){return e&&Object.assign(_d,e),_d}function yd(){let e=this._zod;return e.message??=JSON.stringify(e.def,nu,2),e.message}function bd(e){this._zod.message=e}var xd={get:yd,set:bd,enumerable:!0,configurable:!0},Sd={value:void 0,enumerable:!1},Cd=new WeakSet([Object.prototype,Error.prototype]),wd=(e,t)=>{e.name=`$ZodError`,Sd.value=t,Object.defineProperty(e,"issues",Sd),Sd.value=void 0,Object.defineProperty(e,"message",xd);let n=Object.getPrototypeOf(e);Cd.has(n)||(Cd.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Td=J(`$ZodError`,wd);J(`$ZodError`,wd,void 0,{Parent:Error});function Ed(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Dd(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Ed(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Od(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function kd(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 Ad(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 ${kd(e.path)}`);return t.join(`
2
- `)}function jd(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Md=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new hd;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>qu(e,o,vd())));throw bu(n,a?.callee??t),n}return s.value};return t},Nd=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>qu(e,o,vd())));throw bu(n,a?.callee??t),n}return s.value};return t},Pd=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 hd;return a.issues.length?Fd(e,a.issues,i):{success:!0,data:a.value}};function Fd(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>qu(e,n,vd()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Id=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?Fd(e,a.issues,i):{success:!0,data:a.value}},Ld=Symbol.for(`zod.compile.invalid`),Rd=Symbol.for(`zod.compile.fallback`),zd=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Ld)return!0;if(r.definite===!0&&n===void 0)return!1}return Bd(e,t,n)});function Bd(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Rd]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new hd;return a.issues.length===0}var Vd=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Hd=e=>{let t=Md(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,jd(n,a))};return n},Ud=e=>{let t=Md(e),n=(e,r,i,a)=>t(e,r,i,jd(n,a));return n},Wd=e=>{let t=Nd(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,jd(n,a))};return n},Gd=e=>{let t=Nd(e),n=async(e,r,i,a)=>await t(e,r,i,jd(n,a));return n},Kd=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Pd(e)(t,n,i)},qd=e=>(t,n,r)=>Pd(e)(t,n,r),Jd=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Id(e)(t,n,i)},Yd=e=>async(t,n,r)=>Id(e)(t,n,r),Xd=/^[cC][0-9a-z]{6,}$/,Zd=/^[0-9a-z]+$/,Qd=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,$d=/^[0-9a-vA-V]{20}$/,ef=/^[A-Za-z0-9]{27}$/,tf=/^[a-zA-Z0-9_-]{21}$/;function nf(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var rf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,af=/^([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})$/,of=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)$/,sf=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cf=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function lf(){return new RegExp(cf,`u`)}var uf=/^(?:(?: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])$/,df=/^(([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}|:))$/,ff=/^((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])$/,pf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hf=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,gf=/^https?$/,_f=/^\+[1-9]\d{6,14}$/,vf=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function yf(e){return RegExp(`^${e}$`)}var bf=yf(vf);function xf(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Sf(e){return RegExp(`^${xf(e)}$`)}function Cf(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${xf({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${xf({precision:e.precision})}`:n;return RegExp(`^${vf}T(?:${r})$`)}var wf=/^[\s\S]{0,}$/,Tf=/^-?\d+$/,Ef=/^-?\d+(?:\.\d+)?$/,Df=/^(?:true|false)$/i,Of=/^null$/i,kf=/^[^A-Z]*$/,Af=/^[^a-z]*$/,jf=J(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Mf=e=>{let t=e.value;return!au(t)&&t.length!==void 0},Nf={number:`number`,bigint:`bigint`,object:`date`},Pf=J(`$ZodCheckLessThan`,(e,t)=>{jf.init(e,t);let n=Nf[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Nf[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ff=J(`$ZodCheckGreaterThan`,(e,t)=>{jf.init(e,t);let n=Nf[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Nf[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),If=J(`$ZodCheckMultipleOf`,(e,t)=>{jf.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):su(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})}}),Lf=J(`$ZodCheckNumberFormat`,(e,t)=>{jf.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Au[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Rf=J(`$ZodCheckMaxLength`,(e,t)=>{var n;jf.init(e,t),(n=e._zod.def).when??(n.when=Mf),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Yu(r):i)<=t.maximum)return;let a=Xu(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zf=J(`$ZodCheckMinLength`,(e,t)=>{var n;jf.init(e,t),(n=e._zod.def).when??(n.when=Mf),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Yu(r):i)>=t.minimum)return;let a=Xu(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bf=J(`$ZodCheckLengthEquals`,(e,t)=>{var n;jf.init(e,t),(n=e._zod.def).when??(n.when=Mf),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Yu(r):i;if(a===t.length)return;let o=Xu(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Vf=J(`$ZodCheckStringFormat`,(e,t)=>{var n,r;jf.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Hf=J(`$ZodCheckRegex`,(e,t)=>{Vf.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})}}),Uf=J(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=kf,Vf.init(e,t)}),Wf=J(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Af,Vf.init(e,t)}),Gf=J(`$ZodCheckIncludes`,(e,t)=>{jf.init(e,t);let n=Eu(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Kf=J(`$ZodCheckStartsWith`,(e,t)=>{jf.init(e,t);let n=RegExp(`^${Eu(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),qf=J(`$ZodCheckEndsWith`,(e,t)=>{jf.init(e,t);let n=RegExp(`.*${Eu(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function Jf(e,t,n){e.issues.length&&t.issues.push(...Uu(n,e.issues))}var Yf=J(`$ZodCheckProperties`,(e,t)=>{jf.init(e,t),td(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>Jf(t,r,e)))):Jf(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),Xf=J(`$ZodCheckOverwrite`,(e,t)=>{jf.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Zf=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
1
+ import{a as e,d as t,i as n,n as r,o as i,r as a}from"./preload-helper-DtyrgAzE.js";var o=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},s=new class extends o{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},c={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=c;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function u(e){setTimeout(e,0)}var d=typeof window>`u`||`Deno`in globalThis;function f(){}function p(e,t){return typeof e==`function`?e(t):e}function m(e){return typeof e==`number`&&e>=0&&e!==1/0}function h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){return typeof e==`function`?e(t):e}function v(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==b(o,t.options))return!1}else if(!S(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function y(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(x(t.options.mutationKey)!==x(a))return!1}else if(!S(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function b(e,t){return(t?.queryKeyHashFn||x)(e)}function x(e){return JSON.stringify(e,(e,t)=>D(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function S(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>S(e[n],t[n])):!1}var C=Object.prototype.hasOwnProperty;function w(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=E(e)&&E(t);if(!r&&!(D(e)&&D(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:C.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=w(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function T(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function E(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function D(e){if(!O(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!O(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function O(e){return Object.prototype.toString.call(e)===`[object Object]`}function k(e){return new Promise(t=>{l.setTimeout(t,e)})}function A(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:w(e,t)}function 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(),L=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 R(e){return Math.min(1e3*2**e,3e4)}function z(e){return(e??`online`)!==`online`||L.isOnline()}var ae=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function oe(e){let t=!1,n=0,r,i=P(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ae(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>s.isFocused()&&(e.networkMode===`always`||L.isOnline())&&e.canRun(),d=()=>z(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??R,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 se=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 ce(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?le:B,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:B(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 B(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 le(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ue=class extends se{#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=pe(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=pe(this.options);e.data!==void 0&&(this.setState(fe(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`?ce(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=oe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ae&&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 ae){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,...de(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...fe(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 de(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:z(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function fe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function pe(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 me=class extends se{#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||he(),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=oe({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 he(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ge=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 me({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=_e(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=_e(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=_e(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=_e(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 _e(e){return e.options.scope?.id}var ve=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 ue({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()})})}},ye=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ve,this.#t=e.mutationCache||new ge,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=L.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 L.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()}},be=i((t=>{var n=e().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;t.c=function(e){return n.H.useMemoCache(e)}})),xe=i(((e,t)=>{t.exports=be()})),Se=xe(),V=t(e(),1),H=n(),Ce=(0,V.createContext)(null);function we(e){let t=(0,Se.c)(3),{clock:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,H.jsx)(Ce,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Te(){let e=(0,V.use)(Ce);if(e===null)throw Error(`No clock set, use ClockProvider to set one`);return e}var Ee=48,De=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Ee-t;return n},Oe=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},ke=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Ee;n+=i>>>1^-(i&1),t[r]=n}return t},Ae=384,je=[],Me=Oe(De(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Ne=Oe(De(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Pe=`@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`,Fe=(()=>{let e=Me.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=Me[n];i<Me[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(Me[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=Me[i];a<Me[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Ie=De(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),Le=Oe(De(`123333359346463635126536711576`)),Re=De(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),ze=De(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Be=ke(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),Ve=(()=>{let e=new Int32Array(319).fill(-1),t=ke(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=ke(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),He=`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}),Ue=ke(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),We=ke(`ɠ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`),Ge=ke(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±`),Ke=new Int32Array(995),qe=new Int32Array(995),Je=new Int32Array(995),Ye=``,Xe=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<Ue.length;r++)for(let i of He[Ge[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),Xe[a*2]=Ye.length,Xe[a*2+1]=i.length,Ye+=i),Ke[n]=Ue[r],qe[n]=We[r],Je[n]=a,n++}}var Ze=ke(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Qe=Oe(De(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),$e=ke(`2Š4A;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`),et=De(`ij`),tt=De(`—`),nt=De(`1`),rt={GROUP_COUNT:Ae,customValidatorNames:je,edgeStart:Me,labelStart:Ne,labelText:Pe,edgeTarget:Fe,nodeGroup:Ie,nodeVlist:Ve,vlistPat:Le,vlistOps:Re,vlistRef:ze,vlistGroup:Be,litAnchor:Ke,litGroup:qe,litPool:Je,poolOffsets:Xe,poolText:Ye,adjGid:Ze,adjStart:Qe,adjTgt:$e,patGid:et,patTgt:tt,postfixLookupGroups:nt,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},it=`line`in Error(),at=-1,ot=-1,st=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},ct=(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},lt=(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=(st(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=(st(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+`:`,L=I.length,R=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),z=/\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$/,ae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,se=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ce=0,B=-1,le=-1,ue=-1,de=-1,fe=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,pe=e=>/\s/.test(String.fromCharCode(e)),me=(e,t,n)=>{if(ce=0,B=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ce=1;else if(r===40&&i===41)ce=2;else return;ue=t+1,de=n-1;let a=t+1;if(fe(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!fe(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(B=t+1,le=a,ue=a+1)}},he=(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},ge=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ve=e=>!!e&&!Number.isNaN(Number(e)),ye=(e,t,n)=>{if(n-t<11||!he(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&&he(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&he(e,t+10,t+18,`-normal/`)},be=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],xe=`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(` `)),Se=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],V=(e,t,n,r)=>{if(e>=10){if(e>=25)return R[e-25](t.slice(n,r));let i=e-10;if(ce!==be[i])return!1;if(B>=0){for(let e of xe[i])if(he(t,B,le,e))return!0;return!1}switch(Se[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ue,de);return z.test(e)&&!ae.test(e)}case 3:return ve(t.slice(ue,de));case 4:return se.test(t.slice(ue,de));default:return oe.test(t.slice(ue,de))}}switch(e){case 0:return!0;case 1:return ce===0;case 2:return ce===1;case 3:return ce===2;case 4:return ge.test(t.slice(n,r));case 5:return ve(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&&ve(t.slice(n,r-1));case 8:return _e.test(t.slice(n,r));default:return ye(t,n,r)}},H=new Set(typeof E==`string`?E.split(` `):E),Ce=(e,t,n,r,i,a)=>{let o=st(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},we=new Map,Te=new Map,Ee=2,De=4096,Oe=(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||H.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=Te.get(s);return c===void 0&&Te.set(s,c=Ee++),c},ke=new Map,Ae=r,je=r+4096,Me=()=>Ae++,Ne=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,lt=new Float64Array(nt),ut=new Int32Array(nt),dt=0,pt=(e,t)=>{if(e===0&&t<r)return tt[t]===dt?1:(tt[t]=dt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>rt;for(;ut[i]===dt;){if(lt[i]===n)return 1;i=i+1&nt-1}return lt[i]=n,ut[i]=dt,0},mt=(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?at:Ce(ke,e,t+1,r,0,Me)}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;me(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(V(d[t],e,r,n))return p[h+t]}return at},ht=e=>{let t=e.length,n=0,c=0,u=!1;(Ee>De||we.size>De)&&(we=new Map,Te=new Map,Ee=2,He()),Ae>je&&(ke=new Map,Ae=r,He());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&pe(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&&pe(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(L!==0){if(h-p<=L||!e.startsWith(I,p)){qe[_]=at,Ve(y,e,p,h,v,at,0,0);continue}b=p+L}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=ot,ie=0;for(let t=te;t<D;t++)if(t===A&&(F=M<N?ot:j,ie=P),j!==ot){let n=e.charCodeAt(t),r=-1;if(M<N)o.charCodeAt(M)===n?(M++,M===N&&(r=j=re)):j=ot;else{let e=i[j],t=i[j+1],c=ot;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?ot:j,ie=P);let R=M<N?ot:j,z,ae=!1;if(A>=0)if(ae=!0,z=mt(e,E,A,F,ie),z!==at&&z<r&&ee[z]){let t=mt(e,E,D,R,P);t!==at&&t!==z&&(z=t,ae=!1)}else z===at&&(z=mt(e,E,D,R,P),ae=!1);else z=mt(e,E,D,R,P);let oe=0,se=0;z===at?qe[_]=at:(se=+!!ae,oe=b>=C?+!!O:Ce(we,e,b,C,+!!O,e=>Oe(e,O)),qe[_]=z,Ye[_]=se,Je[_]=oe),Ve(y,e,p,h,v,z,oe,se)}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--;lt=new Float64Array(nt),ut=new Int32Array(nt)}if(Ee>=Ne||Ae>=Ne)throw Error(`cn: too many distinct classes in one merge`);dt=dt+1|0,dt===0&&(tt.fill(0),ut.fill(0),dt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=qe[e];if(t===at){Xe[e]=1;continue}let n=Je[e];if(pt(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++)pt(n,x[e]);if(Ye[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&pt(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},gt=16384,_t=new Int32Array(gt*2),vt=0,U=1,yt=Object.create(null),bt=Object.create(null),xt=new Map,St=new Map,Ct=0,wt=0,Tt=()=>{vt^=gt,U=U+1|0,wt=0},Et=e=>{let t=yt[e];if(t!==void 0)return t;let n=ct(e,0,e.length),r=(n&16383)+vt,i=_t[r]===(n^U)||_t[r^gt]===(n^U-1);return i&&(t=bt[e],t!==void 0)?(yt[e]=t,t):(t=ht(e),i?(yt[e]=t,++Ct>F&&(Ct=0,bt=yt,yt=Object.create(null),Tt())):(_t[r]=n^U,++wt>gt&&Tt()),t)},Dt=e=>{let t=xt.get(e);if(t!==void 0)return t;let n=ct(e,0,e.length),r=(n&16383)+vt,i=_t[r]===(n^U)||_t[r^gt]===(n^U-1);return i&&(t=St.get(e),t!==void 0)?(xt.set(e,t),t):(t=ht(e),i?(xt.set(e,t),++Ct>F&&(Ct=0,St=xt,xt=new Map,Tt())):(_t[r]=n^U,++wt>gt&&Tt()),t)},Ot=e=>{let t=ct(e,0,e.length),n=(t&16383)+vt;return _t[n]===(t^U)||_t[n^gt]===(t^U-1)?!0:(_t[n]=t^U,++wt>gt&&Tt(),!1)},kt=F===0?ht:it?e=>{let t=xt.get(e);return t===void 0?Dt(e):t}:Et;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?kt(arguments[0]):kt(ft.apply(null,arguments))},mergeString:kt,seenBefore:F===0?()=>!1:Ot,mergeUncached:ht}},ut=(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:ut(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},dt=(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:ut(i,t);a&&(n&&(n+=` `),n+=a)}return n},ft=function(){return dt(arguments,!1)},pt=256,mt=16,ht=1024,gt=4096,_t=(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(gt).fill(``),l=Array(gt).fill(``),u=Array(gt).fill(``));let i=ct(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]=ut(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>mt&&(_.miss=mt,_.skip=ht,_.e.length=0,_.at=0);let u=_.e;u.length<pt?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(ut(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)}},vt=lt(rt),U=_t(vt.mergeString,vt);vt.merge;var yt=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase();function bt(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:yt(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var xt=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},St=e=>{let t=xt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ct=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)},wt={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 Tt(e){return e!=null}function Et(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??wt.width,a=e.size??e.height??wt.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?Ct(...c):Ct(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??wt[`stroke-width`])*Number(e.size??e.width??wt.width)/Number(t.size??t.width??wt.width):t.strokeWidth??wt[`stroke-width`];return[`svg`,{...Object.entries(wt).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Tt(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Tt(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Tt(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 Dt(e,t={}){return Et(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Ot=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1},kt=(0,V.createContext)({}),At=()=>(0,V.useContext)(kt),jt=(0,V.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=``}=At()??{},y=!!c||Ot(d),[b,x,S=[]]=Dt(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Ct(v,s),hasA11yProp:y,attributes:d});return(0,V.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,V.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Mt(e,t=[],n=[]){let r=typeof e==`string`?bt(e,t,n):e,i=(0,V.forwardRef)(({className:e,...t},n)=>(0,V.createElement)(jt,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=St(r.name)),i}var Nt={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};Nt.node;var Pt=Mt(Nt),Ft={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};Ft.node;var It=Mt(Ft),Lt={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Lt.node;var Rt=Mt(Lt),zt={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};zt.node;var Bt=Mt(zt),Vt={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Vt.node;var Ht=Mt(Vt),Ut={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Ut.node;var Wt=Mt(Ut),Gt={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]};Gt.node;var Kt=Mt(Gt),qt={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`]};qt.node;var Jt=Mt(qt),Yt={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Yt.node;var Xt=Mt(Yt),Zt={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Zt.node;var Qt=Mt(Zt),$t={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};$t.node;var en=Mt($t),tn={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`}]]};tn.node;var nn=Mt(tn),rn={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};rn.node;var an=Mt(rn),on={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};on.node;var sn=Mt(on);function cn({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=V.useRef(e!==void 0),[a,o]=V.useState(()=>t);return[i&&e!==void 0?e:a,V.useCallback(e=>{i||o(e)},[])]}var ln={...V},un={};function dn(e,t){let n=V.useRef(un);return n.current===un&&(n.current=e(t)),n}var fn=ln.useInsertionEffect,pn=fn&&fn!==ln.useLayoutEffect?fn:e=>e();function mn(e){let t=dn(hn).current;return t.next=e,pn(t.effect),t.trampoline}function hn(){let e={next:void 0,callback:gn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function gn(){}function W(){}var _n=Object.freeze([]),vn=Object.freeze({}),yn=typeof document<`u`?V.useLayoutEffect:()=>{},bn=V.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function xn(){return V.useContext(bn)}function Sn(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=mn(i),[,o]=V.useState(0),s=dn(wn).current,c=dn(Cn).current,l=V.useRef(0),u=V.useRef(!0),d=V.useRef(null),f=V.useRef(null),p=mn(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=mn((e,t)=>{c.set(e,t),p()}),h=mn(e=>{c.delete(e),p()}),g=mn(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(!Dn(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&On(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=En(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=mn(()=>{let[e,t]=Tn(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))});yn(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),yn(()=>{u.current&&v()}),yn(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=mn(e=>(s.add(e),()=>{s.delete(e)})),b=V.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,H.jsx)(bn.Provider,{value:b,children:t})}function Cn(){return new Map}function wn(){return new Set}function Tn(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)=>On(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 En(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Dn(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 On(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function kn(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 An=kn(`https://base-ui.com/production-error`,`Base UI`);function jn(e,t,n,r){let i=dn(Nn).current;return Pn(i,e,t,n,r)&&In(i,[e,t,n,r]),i.callback}function Mn(e){let t=dn(Nn).current;return Fn(t,e)&&In(t,e),t.callback}function Nn(){return{callback:null,cleanup:null,refs:[]}}function Pn(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Fn(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function In(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 Ln=19;function Rn(e){return Ln>=e}function zn(e){if(!V.isValidElement(e))return null;let t=e,n=t.props;return(Rn(19)?n?.ref:t.ref)??null}function Bn(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Vn(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 Hn(e,t){return typeof e==`function`?e(t):e}function Un(e,t){return typeof e==`function`?e(t):e}var Wn={};function Gn(e,t,n,r,i){if(!n&&!r&&!i&&!e)return qn(t);let a=qn(e);return t&&(a=Jn(a,t)),n&&(a=Jn(a,n)),r&&(a=Jn(a,r)),i&&(a=Jn(a,i)),a}function Kn(e){if(e.length===0)return Wn;if(e.length===1)return qn(e[0]);let t=qn(e[0]);for(let n=1;n<e.length;n+=1)t=Jn(t,e[n]);return t}function qn(e){return Qn(e)?{...e(Wn)}:Yn(e)}function Jn(e,t){return Qn(t)?t(e):Xn(e,t)}function Yn(e){let t={...e};for(let e in t){let n=t[e];Zn(e,n)&&(t[e]=er(n))}return t}function Xn(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Bn(e.style,r);break;case`className`:e[n]=nr(e.className,r);break;default:Zn(n,r)?e[n]=$n(e[n],r):e[n]=r}}return e}function Zn(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 Qn(e){return typeof e==`function`}function $n(e,t){return t?e?(...n)=>{let r=n[0];if(rr(r)){let i=r;tr(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:er(t):e}function er(e){return e&&((...t)=>{let n=t[0];return rr(n)&&tr(n),e(...t)})}function tr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function nr(e,t){return t?e?t+` `+e:t:e}function rr(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function ir(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=cr(r));let i=ar(t,n,r);if(n.enabled===!1)return null;let a=n.state??vn;return lr(e,r,i,a)}function ar(e,t,n){let{className:r,style:i}=e,{state:a=vn,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Hn(r,a):void 0,d=l?Un(i,a):void 0,f=l?Vn(a,c):vn,p=l&&s?or(s):void 0,m=l?Bn(f,p)??{}:vn;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=Mn([m.ref,zn(n),...o]):m.ref=jn(m.ref,zn(n),o):jn(null,null)),l?(u!==void 0&&(m.className=nr(m.className,u)),d!==void 0&&(m.style=Bn(m.style,d)),m):vn}function or(e){return Array.isArray(e)?Kn(e):Gn(void 0,e)}var sr=Symbol.for(`react.lazy`);function cr(e){if(e?.$$typeof!==sr)return e;let t=V.Children.toArray(e)[0];return V.isValidElement(t)?t:e}function lr(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Gn(n,t.props);return e.ref=n.ref,V.cloneElement(t,e)}return ur(e,n)}function ur(e,t){return e===`button`?(0,V.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,V.createElement)(`img`,{alt:``,...t,key:t.key}):V.createElement(e,t)}function dr(){let[,e]=V.useState({});return V.useCallback(()=>{e({})},[])}var fr=0;function pr(e,t=`mui`){let n=V.useRef(void 0),r=dr(),i=e??n.current;return V.useEffect(()=>{n.current??(fr+=1,n.current=`${t}-${fr}`,e??r())},[e,t,r]),i}var mr=ln.useId;function hr(e,t){if(mr!==void 0){let n=mr();return e??(t?`${t}-${n}`:n)}return pr(e,t)}function gr(e){return hr(e,`base-ui`)}function _r(e,t,n,r){let i=!1,a=!1,o=r??vn;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 vr(e,t,n){let r=n??vn;return{reason:e,event:t??new Event(`base-ui`),...r}}var yr=`none`,br=`trigger-press`,xr=`trigger-hover`,Sr=`trigger-focus`,Cr=`outside-press`,wr=`item-press`,Tr=`close-press`,Er=`focus-out`,Dr=`escape-key`,Or=`list-navigation`,kr=`keyboard`,Ar=`pointer`,jr=`cancel-open`,Mr=`sibling-open`,Nr=`disabled`,Pr=`imperative-action`,Fr=`window-resize`;function Ir(e){V.useEffect(e,_n)}var Lr=null;globalThis.requestAnimationFrame;var Rr=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)}},zr=class e{static create(){return new e}static request(e){return Rr.request(e)}static cancel(e){return Rr.cancel(e)}currentId=Lr;request(e){this.cancel(),this.currentId=Rr.request(()=>{this.currentId=Lr,e()})}cancel=()=>{this.currentId!==Lr&&(Rr.cancel(this.currentId),this.currentId=Lr)};disposeEffect=()=>this.cancel};function Br(){let e=dn(zr.create).current;return Ir(e.disposeEffect),e}function Vr(e,t=!1,n=!1,r=!1){let[i,a]=V.useState(e&&t?`idle`:void 0),[o,s]=V.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),yn(()=>{if(!e&&o&&i!==`ending`&&n){let e=zr.request(()=>{a(`ending`)});return()=>{zr.cancel(e)}}},[e,o,i,n]),yn(()=>{if(!e||t||i===void 0)return;let n=zr.request(()=>{a(void 0)});return()=>{zr.cancel(n)}},[t,e,i]),yn(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=zr.request(()=>{a(`idle`)});return()=>{zr.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Hr(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=xn(),u=V.useRef(-1),[d,f]=V.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=V.useRef(null),h=V.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 yn(()=>{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 Ur=`data-starting-style`,Wr=`data-ending-style`,Gr={[Ur]:``},Kr={[Wr]:``},qr={transitionStatus(e){return e===`starting`?Gr:e===`ending`?Kr:null}};function Jr(){return typeof window<`u`}function Yr(e){return Qr(e)?(e.nodeName||``).toLowerCase():`#document`}function Xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zr(e){return((Qr(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Qr(e){return Jr()?e instanceof Node||e instanceof Xr(e).Node:!1}function $r(e){return Jr()?e instanceof Element||e instanceof Xr(e).Element:!1}function ei(e){return Jr()?e instanceof HTMLElement||e instanceof Xr(e).HTMLElement:!1}function ti(e){return!Jr()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Xr(e).ShadowRoot}function ni(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=pi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ri(e){return/^(table|td|th)$/.test(Yr(e))}function ii(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ai=/transform|translate|scale|rotate|perspective|filter/,oi=/paint|layout|strict|content/,si=e=>!!e&&e!==`none`,ci;function li(e){let t=$r(e)?pi(e):e;return si(t.transform)||si(t.translate)||si(t.scale)||si(t.rotate)||si(t.perspective)||!di()&&(si(t.backdropFilter)||si(t.filter))||ai.test(t.willChange||``)||oi.test(t.contain||``)}function ui(e){let t=hi(e);for(;ei(t)&&!fi(t);){if(li(t))return t;if(ii(t))return null;t=hi(t)}return null}function di(){return ci??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ci}function fi(e){return/^(html|body|#document)$/.test(Yr(e))}function pi(e){return Xr(e).getComputedStyle(e)}function mi(e){return $r(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hi(e){if(Yr(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ti(e)&&e.host||Zr(e);return ti(t)?t.host:t}function gi(e){let t=hi(e);return fi(t)?(e.ownerDocument||e).body:ei(t)&&ni(t)?t:gi(t)}function _i(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=gi(e),i=r===e.ownerDocument?.body,a=Xr(r);if(i){let e=vi(a);return t.concat(a,a.visualViewport||[],ni(r)?r:[],e&&n?_i(e):[])}else return t.concat(r,_i(r,[],n))}function vi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var yi=V.createContext(void 0);function bi(e=!1){let t=V.useContext(yi);if(t===void 0&&!e)throw Error(An(16));return t}function xi(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:V.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 Si(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Xr(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 Ci(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=V.useRef(null),s=bi(!0),c=a??s!==void 0,{props:l}=xi({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=V.useCallback(()=>{let e=o.current;wi(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return yn(u,[u]),{getButtonProps:V.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Gn({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(tr(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=wi(r),s=!i&&Ti(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(),Si(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Si(r,e)))},onKeyUp(e){if(!t){if(tr(e),a?.(e),e.target===e.currentTarget&&i&&c&&wi(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Si(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:mn(e=>{o.current=e,u()})}}function wi(e){return ei(e)&&e.tagName===`BUTTON`}function Ti(e){return ei(e)&&e.tagName===`A`&&!!e.href}function Ei(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var Di=0,Oi=class e{static create(){return new e}currentId=Di;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Di,t()},e)}isStarted(){return this.currentId!==Di}clear=()=>{this.currentId!==Di&&(clearTimeout(this.currentId),this.currentId=Di)};disposeEffect=()=>this.clear};function ki(){let e=dn(Oi.create).current;return Ir(e.disposeEffect),e}function Ai(e){let t=dn(ji,e).current;return t.next=e,yn(t.effect),t}function ji(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Mi=t(a(),1);function Ni(e){return e==null?e:`current`in e?e.current:e}function Pi(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Fi=null;function Ii(e){if(!Fi){let e=[];Fi=e,queueMicrotask(()=>{Fi=null,Mi.flushSync(()=>{for(let t of e)t()})})}Fi.push(e)}function Li(e,t=!1,n=!1){let r=Br();return mn((i,a=null)=>{r.cancel();let o=Ni(e);if(o==null)return;let s=o,c=()=>{if(!n){Mi.flushSync(i);return}Ii(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Pi(s).map(e=>e.finished.then(W))).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(Pi(s).some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Ur;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 Ri(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=mn(a),s=Li(r,n,i);V.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var zi=V.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}=Ci({disabled:i,focusableWhenDisabled:a,native:o});return ir(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Bi=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Vi=r,Hi=(e,t)=>n=>{if(t?.variants==null)return Vi(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=Bi(t)||Bi(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 Vi(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)},Ui=Hi(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Wi({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,H.jsx)(zi,{"data-slot":`button`,className:U(Ui({variant:t,size:n,className:e})),...r})}function Gi(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Ki(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ti(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function qi(e,t){let n=e;for(;n;){if($r(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(ti(n)?n.host:null)}return null}function Ji(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Yi={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Xi={...Yi,position:`fixed`,margin:0,top:0,left:0},Zi={...Yi,position:`absolute`};function Qi(e,t){return t<0||t>=e.length}function $i(e,t){return na(e.current,{disabledIndices:t})}function ea(e,t){return na(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ta(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>na(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:Qi(e,u)?-1:u,wrapped:d}}function na(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&&ra(e,a,r));return a}function ra(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!aa(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function ia(e){return e.visibility===`hidden`||e.visibility===`collapse`}function aa(e,t=e?pi(e):null){return!e||!e.isConnected||!t||ia(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var oa=i((t=>{var n=e();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;t.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),sa=i(((e,t)=>{t.exports=oa()})),ca=i((t=>{var n=e(),r=sa();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}})),la=i(((e,t)=>{t.exports=ca()})),ua=`ArrowUp`,da=`ArrowDown`,fa=`ArrowLeft`,pa=`ArrowRight`,ma=`Home`,ha=new Set([ua,da,fa,pa,ma,`End`]),ga=`Shift`,_a=[ga,`Control`,`Alt`,`Meta`];function va(e){return ei(e)&&e.tagName===`INPUT`}function ya(e){return!!(va(e)&&e.selectionStart!=null||ei(e)&&e.tagName===`TEXTAREA`)}function ba(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=xa(e,t,`left`),a=Sa(e),o=Sa(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=xa(e,t,`top`),r=Sa(e),i=Sa(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 xa(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 Sa(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 Ca(e,t){let n=V.useRef(e),r=mn(t);yn(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var wa=Hi(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function Ta({className:e,variant:t,...n}){return(0,H.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:U(wa({variant:t}),e),...n})}function Ea({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-title`,className:U(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function Da({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-description`,className:U(`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 Oa(e){return ir(e.defaultTagName??`div`,e,e)}var ka=Hi(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Aa({className:e,variant:t=`default`,render:n,...r}){return Oa({defaultTagName:`span`,props:Gn({className:U(ka({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var ja=V.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return ir(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),Ma=`data-valid`,Na=`data-invalid`,Pa={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Fa={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ia={valid(e){return e===null?null:e?{[Ma]:``}:{[Na]:``}}},La={invalid:void 0,name:void 0,validityData:{state:Pa,errors:[],error:``,value:``,initialValue:null},setValidityData:W,disabled:void 0,setTouched:W,setDirty:W,setFilled:W,setFocused:W,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Fa,registerFieldControl:W,validation:{getValidationProps:(e,t=vn)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:W,getInputControl:()=>null,commit:async()=>{},change:W}},Ra=V.createContext(La);function za(e=!0){let t=V.useContext(Ra);if(t.setValidityData===W&&!e)throw Error(An(28));return t}function Ba(e,t,n){let{setFocused:r,focusOwnerRef:i}=za(),a=mn(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return yn(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function Va(e,t,n,r,i=!0,a){let{registerFieldControl:o}=za(),s=dn(()=>Symbol());yn(()=>{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]),yn(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var Ha=V.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:W,validationMode:`onSubmit`,submitCountRef:{current:0}});function Ua(){return V.useContext(Ha)}var Wa=V.createContext({controlId:void 0,registerControlId:W,resetControlId:W,labelId:void 0,setLabelId:W,messageIds:[],setMessageIds:W,getDescriptionProps:e=>e});function Ga(){return V.useContext(Wa)}function Ka(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=Ga(),o=gr(),s=dn(()=>Symbol()),c=V.useRef(!1),l=V.useRef(!1),u=mn(()=>{!c.current||i===W||(c.current=!1,i(s.current,void 0))});return yn(()=>{if(!n||i===W){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]),yn(()=>u,[u]),(n?r:void 0)??t??o}function qa({className:e,...t}){return(0,H.jsx)(`textarea`,{"data-slot":`textarea`,className:U(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function Ja(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var Ya=V.createContext(void 0);function Xa(){return V.useContext(Ya)?.direction??`ltr`}function Za(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=bi(),{ref:i,index:a}=Hr(e),o=n===a,s=V.useRef(null),c=jn(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 Qa(e){let{render:t,className:n,style:r,state:i=vn,props:a=_n,refs:o=_n,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Za({metadata:s});return ir(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function $a(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function eo({className:e,...t}){return(0,H.jsx)(`label`,{"data-slot":`label`,className:U(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var to=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,no=/^[\\/]{2}/;function ro(e,t){return t+e.replace(/\\/g,`/`)}var io=`popstate`;function ao(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function oo(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return uo(``,{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:fo(t)}return mo(t,n,null,e)}function G(e,t){if(e===!1||e==null)throw Error(t)}function so(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function co(){return Math.random().toString(36).substring(2,10)}function lo(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 uo(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?po(t):t,state:n,key:t&&t.key||r||co(),mask:i}}function fo({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 po(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 mo(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=ao(e)?e:uo(h.location,e,t);n&&n(r,e),l=u()+1;let d=lo(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=ao(e)?e:uo(h.location,e,t);n&&n(r,e),l=u();let i=lo(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 ho(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(io,d),c=e,()=>{i.removeEventListener(io,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 ho(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),G(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:fo(t);return i=i.replace(/ $/,`%20`),!n&&no.test(i)&&(i=r+i),new URL(i,r)}var go=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)}},_o=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function vo(e){return _o.has(e)}var yo=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function bo(e){return yo.has(e)}function xo(e){return e.index===!0}function So(e){let t={};return e.Component&&Object.assign(t,{element:V.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:V.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:V.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Co(e,t=So,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(G(e.index!==!0||!e.children,`Cannot specify children on an index route`),G(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),xo(e)){let n={...e,id:s};return r[s]=wo(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=wo(n,t(n)),e.children&&(n.children=Co(e.children,t,o,r,i)),n}})}function wo(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function To(e,t,n=`/`){return Eo(e,t,n,!1)}function Eo(e,t,n,r,i){let a=Yo((typeof t==`string`?po(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Oo(e),s=null,c=Jo(a);for(let e=0;s==null&&e<o.length;++e)s=Uo(o[e],c,r);return s}function Do(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 Oo(e){let t=ko(e);return jo(t),t}function ko(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;G(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=as([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(G(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ko(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Vo(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=qo(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 Ao(e.path))a(e,t,!0,n)}),t}function Ao(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=Ao(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 jo(e){e.sort((e,t)=>e.score===t.score?Ho(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Mo=/^:[\w-]+$/,No=/^:[\w-]+/,Po=3.5,Fo=3,Io=2,Lo=1,Ro=10,zo=-2,Bo=e=>e===`*`;function Vo(e,t){let n=e.split(`/`),r=n.length;return n.some(Bo)&&(r+=zo),t&&(r+=Io),n.filter(e=>!Bo(e)).reduce((e,t)=>e+(Mo.test(t)?Fo:No.test(t)?Po:t===``?Lo:Ro),r)}function Ho(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 Uo(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?Ko(u,l,s.matcher,s.compiledParams):Go(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Go({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:as([a,d.pathname]),pathnameBase:ss(as([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=as([a,d.pathnameBase]))}return o}function Wo(e,t={}){let n=e;n.endsWith(`*`)&&n!==`*`&&!n.endsWith(`/*`)&&(so(!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 G(n===`?`||o!=null,`Missing ":${e}" param`),encodeURIComponent(i(o))+r}return e.replace(/\?$/g,``)}).filter(e=>!!e).join(`/`)}function Go(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=qo(e.path,e.caseSensitive,e.end);return Ko(e,t,n,r)}function Ko(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 qo(e,t=!1,n=!0){so(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 Jo(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return so(!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 Yo(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 Xo({basename:e,pathname:t}){return t===`/`?e:as([e,t])}var Zo=e=>to.test(e);function Qo(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?po(e):e,a;return n?(n=is(n),a=n.startsWith(`/`)?$o(n.substring(1),`/`):$o(n,t)):a=t,{pathname:a,search:cs(r),hash:ls(i)}}function $o(e,t){let n=os(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function es(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 ts(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ns(e){let t=ts(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function rs(e,t,n,r=!1){let i;typeof e==`string`?i=po(e):(i={...e},G(!i.pathname||!i.pathname.includes(`?`),es(`?`,`pathname`,`search`,i)),G(!i.pathname||!i.pathname.includes(`#`),es(`#`,`pathname`,`hash`,i)),G(!i.search||!i.search.includes(`#`),es(`#`,`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=Qo(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var is=e=>e.replace(/[\\/]{2,}/g,`/`),as=e=>is(e.join(`/`)),os=e=>e.replace(/\/+$/,``),ss=e=>os(e).replace(/^\/*/,`/`),cs=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ls=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,us=(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})},ds=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],fs=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 ps(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ms(e){return as(e.map(e=>e.route.path).filter(Boolean))||`/`}function hs(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?po(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 gs=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function _s(e,t){let n=e;if(typeof n!=`string`||!to.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(gs)try{let e=new URL(window.location.href),r=no.test(n)?new URL(ro(n,e.protocol)):new URL(n),a=Yo(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{so(!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 vs=Symbol(`Uninstrumented`),ys=new WeakMap;function bs(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)=>Es(await Ds(n.lazy,void 0,()=>e(...t),Os))}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)=>Es(await Ds(n[`lazy.middleware`],void 0,()=>t(...e),Os))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>Es(await Ds(n[`lazy.loader`],void 0,()=>t(...e),Os))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>Es(await Ds(n[`lazy.action`],void 0,()=>t(...e),Os))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Ss(t.loader),i=async(...t)=>Es(await Ds(n.loader,ks(t[0]),()=>e(...t),Os));e.hydrate===!0&&(i.hydrate=!0),Cs(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Ss(t.action),i=async(...t)=>Es(await Ds(n.action,ks(t[0]),()=>e(...t),Os));Cs(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Ss(e),r=async(...e)=>Es(await Ds(n.middleware,ks(e[0]),()=>t(...e),Os));return Cs(r,t),r})),r}function xs(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=Ss(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?fo(i):`.`,...As(e,a??{})};return Es(await Ds(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=ws(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...Os(e),meta:o})))};Cs(r,t),e.navigate=r}if(n.fetch.length>0){let t=Ss(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return Es(await Ds(n.fetch,{href:o??`.`,fetcherKey:i,...As(e,s??{})},async()=>{let n=ws(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...Os(e),meta:c})))};Cs(r,t),e.fetch=r}return e}function Ss(e){return e[vs]??e}function Cs(e,t){e[vs]=t}function ws(e,t){return ys.set(e,t),()=>{ys.get(e)===t&&ys.delete(e)}}function Ts(e){let t=ys.get(e);return ys.delete(e),t}function Es(e){if(e.type===`error`)throw e.value;return e.value}async function Ds(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=Ds(e,t,n,r,i,a-1),await s,G(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 Os(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function ks(e){let{request:t,context:n,params:r}=e;return{...e,request:js(t),params:{...r},context:Ms(n)}}function As(e,t){return{currentUrl:fo(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 js(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Ms(e){return{get:t=>e.get(t)}}var Ns=[`POST`,`PUT`,`PATCH`,`DELETE`],Ps=new Set(Ns),Fs=[`GET`,...Ns],Is=new Set(Fs),Ls=new Set([301,302,303,307,308]),Rs=new Set([307,308]),zs={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},Bs={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Vs={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Hs=`remix-router-transitions`,Us=Symbol(`ResetLoaderData`),Ws=class{#e;#t;#n;#r;constructor(e){this.#e=e,this.#t=Oo(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=Oo(e)}setHmrRoutes(e){this.#n=e,this.#r=Oo(e)}commitHmrRoutes(){this.#n&&(this.#e=this.#n,this.#t=this.#r,this.#n=void 0,this.#r=void 0)}};function Gs(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;G(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),...bs(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Ws(Co(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||cc,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=Eo(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=Mc(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=jc(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Ve(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Ve(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=>Xs(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=Zs(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:zs,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,L=new Set,R=new Map,z,ae=null;function oe(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(z){z(),z=void 0;return}so(R.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=Fe({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{z=e});e.history.go(r*-1),Pe(i,{state:`blocked`,location:n,proceed(){Pe(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,Vs),B({blockers:e})}}),E?.resolve(),E=null;return}return fe(t,n)}),n){rl(t,A);let e=()=>il(t,A);t.addEventListener(`pagehide`,e),ee=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||fe(`POP`,w.location,{initialHydration:!0}),C}function se(){d&&d(),ee&&ee(),f.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>Ee(w.fetchers,t)),w.blockers.forEach((e,t)=>Ne(t))}function ce(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 B(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`&&(L.has(t)?n.push(t):r.push(t))}),L.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=>Ee(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function le(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&qc(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?Oc(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,Vs)));let l=!te&&Be(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&qc(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}}B({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:zs,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,ae?.resolve(),ae=null}async function ue(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=al();let n=E.promise;return e.history.go(t),n}let r=Ts(C),{path:i,submission:a,error:o}=Js(!1,qs(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),s;n?.mask&&(s={pathname:``,search:``,hash:``,...typeof n.mask==`string`?po(n.mask):{...w.location.mask,...n.mask}});let l=w.location,u=uo(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&&qc(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=Fe({currentLocation:l,nextLocation:u,historyAction:f});if(h){Pe(h,{state:`blocked`,location:u,proceed(){Pe(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),ue(t,n)},reset(){let e=new Map(w.blockers);e.set(h,Vs),B({blockers:e})}});return}await fe(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 de(){ae||=al(),V(),B({revalidation:`loading`});let e=ae.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(fe(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(fe(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function fe(t,n,r){O&&O.abort(),O=null,T=t,te=(r&&r.startUninterruptedRevalidation)===!0,ze(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:Eo(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!ne&&Fc(w.location,n)&&!(r&&r.submission&&qc(r.submission.formMethod))){le(n,{matches:a},{flushSync:o});return}let l=Ve(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),r?.instrumentationNavigateMetaReceiver){let t=Xc(e.history,n,a);r.instrumentationNavigateMetaReceiver(t)}if(!a){let{error:e,notFoundMatches:t,route:r}=Ie(n.pathname);le(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=Cc(e.history,n,O.signal,r&&r.submission),f=e.getContext?await e.getContext():new go,p;if(r&&r.pendingError)p=[Ac(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&qc(r.submission.formMethod)){let i=await pe(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(Bc(t)&&ps(t.error)&&t.error.status===404){O=null,le(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=Qc(n,a,t,r.submission),o=!1,l.active=!1,d=Cc(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await me(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,le(n,{matches:h||a,...kc(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function pe(t,n,i,l,u,d,f,p,m={}){if(V(),B({navigation:$c(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await He(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}=jc(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Ac(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}=Ie(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=Yc(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Mc(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await xe(t,n,mc(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(Vc(h)){let n;return n=m&&m.replace!=null?m.replace:Sc(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await be(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Bc(h)){let e=Ac(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 me(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||Qc(n,i,l,p),x=p||m||Zc(b),S=!te&&!g;if(d){if(S){let e=he(v);B({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await He(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}=jc(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Ac(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}=Ie(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=Ys(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,ne,j,L,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=Ae(e);return le(n,{matches:i,loaderData:{},errors:v&&Bc(v[1])?{[v[0]]:v[1].error}:null,...kc(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=he(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=ge(E)),B(e,{flushSync:_})}E.forEach(e=>{Oe(e.key),e.controller&&M.set(e.key,e.controller)});let D=()=>E.forEach(e=>Oe(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await Se(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=Nc(k);if(ee)return await be(t,ee.result,!0,{replace:h}),{shortCircuited:!0};if(ee=Nc(A),ee)return F.add(ee.key),await be(t,ee.result,!0,{replace:h}),{shortCircuited:!0};let P=new Map(w.fetchers),{loaderData:I,errors:R}=Dc(w,i,k,v,E,A,P);g&&w.errors&&(R={...w.errors,...R});let z=Ae(P),ae=je(re,P),oe=z||ae||E.length>0;return{matches:i,loaderData:I,errors:R,...oe?{workingFetchers:P}:{}}}function he(e){if(e&&!Bc(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function ge(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=el(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function _e(t,n,r,i){Oe(t);let a=(i&&i.flushSync)===!0,o=Ts(C),l=s.activeRoutes,u=qs(w.location,w.matches,c,r,n,i?.relative),d=Eo(l,u,c,!1,s.branches),f=Ve(d,l,u);if(f.active&&f.matches&&(d=f.matches),o&&o(Xc(e.history,u,d)),!d){Ce(t,n,Mc(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=Js(!0,u,i);if(h){Ce(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new go,_=(i&&i.preventScrollReset)===!0;if(m&&qc(m.formMethod)){await ve(t,n,p,d,g,f.active,a,_,m,i&&i.defaultShouldRevalidate);return}ie.set(t,{routeId:n,path:p}),await ye(t,n,p,d,g,f.active,a,_,m)}async function ve(t,n,i,l,u,d,f,p,m,h){V(),ie.delete(t),H(t,tl(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=Cc(e.history,i,g.signal,m);if(d){let e=await He(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ce(t,n,e.error,{flushSync:f});return}else if(e.matches)l=e.matches;else{Ce(t,n,Mc(404,{pathname:i}),{flushSync:f});return}}let v=Yc(l,i);if(!v.route.action&&!v.route.lazy){Ce(t,n,Mc(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}M.set(t,g);let y=N,b=mc(a,o,_,i,l,v,r,u),x=await xe(_,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(L.has(t)){if(Vc(S)||Bc(S)){H(t,nl(void 0));return}}else{if(Vc(S))if(M.delete(t),re>y){H(t,nl(void 0));return}else return F.add(t),H(t,el(m)),be(_,S,!1,{fetcherSubmission:m,preventScrollReset:p});if(Bc(S)){Ce(t,n,S.error);return}}let C=w.navigation.location||w.location,E=Cc(e.history,C,g.signal),D=s.activeRoutes,k=w.navigation.state===`idle`?w.matches:Eo(D,w.navigation.location,c,!1,s.branches);G(k,`Didn't find any matches after fetcher action`);let A=++N;P.set(t,A);let{dsMatches:ee,revalidatingFetchers:te}=Ys(E,u,a,o,e.history,w,k,m,C,r,!1,ne,j,L,ie,F,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),I=el(m,S.data),R=new Map(w.fetchers);R.set(t,I),te.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=R.get(t),r=el(void 0,n?n.data:void 0);R.set(t,r),Oe(t),e.controller&&M.set(t,e.controller)}),B({fetchers:R});let z=()=>te.forEach(e=>Oe(e.key));g.signal.addEventListener(`abort`,z);let{loaderResults:ae,fetcherResults:oe}=await Se(ee,te,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,z),P.delete(t),M.delete(t),te.forEach(e=>M.delete(e.key));let se=w.fetchers.has(t),ce=e=>{if(!se)return e;let n=new Map(e.fetchers);return n.set(t,nl(S.data)),{...e,fetchers:n}},ue=Nc(ae);if(ue)return w=ce(w),be(E,ue.result,!1,{preventScrollReset:p});if(ue=Nc(oe),ue)return F.add(ue.key),w=ce(w),be(E,ue.result,!1,{preventScrollReset:p});let de=new Map(w.fetchers);se&&de.set(t,nl(S.data));let{loaderData:fe,errors:pe}=Dc(w,k,ae,void 0,te,oe,de);je(A,de),w.navigation.state===`loading`&&A>re?(G(T,`Expected pending action`),O&&O.abort(),le(w.navigation.location,{matches:k,loaderData:fe,errors:pe,fetchers:de})):(B({errors:pe,loaderData:Oc(w.loaderData,fe,k,pe),fetchers:de}),ne=!1)}async function ye(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);H(t,el(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Cc(e.history,i,m.signal);if(l){let e=await He(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ce(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{Ce(t,n,Mc(404,{pathname:i}),{flushSync:u});return}}let g=Yc(s,i);M.set(t,m);let _=N,v=await xe(h,i,mc(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(L.has(t)){H(t,nl(void 0));return}if(Vc(y))if(re>_){H(t,nl(void 0));return}else{F.add(t),await be(h,y,!1,{preventScrollReset:d});return}if(Bc(y)){Ce(t,n,y.error);return}H(t,nl(y.data))}}async function be(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`);G(d,`Expected a Location header on the redirect Response`),d=Sc(d,new URL(r.url),c,e.history);let f=uo(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Zo(d)){let n=ho(t,d,!0);e=n.origin!==t.location.origin||Yo(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=Zc(w.navigation));let _=o||s;Rs.has(i.response.status)&&_&&qc(_.formMethod)?await fe(p,f,{submission:{..._,formAction:d},preventScrollReset:l||D,enableViewTransition:a?k:void 0}):await fe(p,f,{overrideNavigation:Qc(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?k:void 0})}async function xe(e,t,n,r,i){let a,o={};try{a=await hc(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(!qc(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(zc(r)){let i=r.result;o[t]={type:`redirect`,response:yc(i,e,t,n,c)}}else o[t]=await vc(r);return o}async function Se(e,t,n,r,i){let a=xe(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await xe(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:Mc(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function V(){ne=!0,ie.forEach((e,t)=>{M.has(t)&&j.add(t),Oe(t)})}function H(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),B({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Ce(e,t,n,r={}){let i=Ac(w.matches,t),a=new Map(w.fetchers);Ee(a,e),B({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function we(e){return I.set(e,(I.get(e)||0)+1),L.has(e)&&L.delete(e),w.fetchers.get(e)||Bs}function Te(e,t){Oe(e,t?.reason),H(e,nl(null))}function Ee(e,t){let n=w.fetchers.get(t);M.has(t)&&!(n&&n.state===`loading`&&P.has(t))&&Oe(t),ie.delete(t),P.delete(t),F.delete(t),L.delete(t),j.delete(t),e.delete(t)}function De(e){let t=(I.get(e)||0)-1;t<=0?(I.delete(e),L.add(e)):I.set(e,t),B({fetchers:new Map(w.fetchers)})}function Oe(e,t){let n=M.get(e);n&&(n.abort(t),M.delete(e))}function ke(e,t){for(let n of e){let e=t.get(n);G(e,`Expected fetcher: ${n}`);let r=nl(e.data);t.set(n,r)}}function Ae(e){let t=[],n=!1;for(let r of F){let i=e.get(r);G(i,`Expected fetcher: ${r}`),i.state===`loading`&&(F.delete(r),t.push(r),n=!0)}return ke(t,e),n}function je(e,t){let n=[];for(let[r,i]of P)if(i<e){let e=t.get(r);G(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Oe(r),P.delete(r),n.push(r))}return ke(n,t),n.length>0}function Me(e,t){let n=w.blockers.get(e)||Vs;return R.get(e)!==t&&R.set(e,t),n}function Ne(e){w.blockers.delete(e),R.delete(e)}function Pe(e,t){let n=w.blockers.get(e)||Vs;G(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),B({blockers:r})}function Fe({currentLocation:e,nextLocation:t,historyAction:n}){if(R.size===0)return;R.size>1&&so(!1,`A router only supports one blocker at a time`);let r=Array.from(R.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 Ie(e){let t=Mc(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=jc(n);return{notFoundMatches:r,route:i,error:t}}function Le(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===zs){_=!0;let e=Be(w.location,w.matches);e!=null&&B({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Re(e,t){return h&&h(e,t.map(e=>Do(e,w.loaderData)))||e.key}function ze(e,t){if(m&&g){let n=Re(e,t);m[n]=g()}}function Be(e,t){if(m){let n=Re(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Ve(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:Eo(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:Eo(n,r,c,!0,e)}}return{active:!1,matches:null}}async function He(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||tc(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=Eo(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=Eo(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&Ue(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=Eo(s.activeRoutes,n,c,!0,u),!f||Ue(l,f))return{type:`success`,matches:null};l=f}}function Ue(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function We(e){o={},s.setHmrRoutes(Co(e,a,void 0,o))}function Ge(e,t,n=!1){tc(e,t,s,o,a,n),s.hasHMRRoutes||B({})}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:oe,subscribe:ce,enableScrollRestoration:Le,navigate:ue,fetch:_e,revalidate:de,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:we,resetFetcher:Te,deleteFetcher:De,dispose:se,getBlocker:Me,deleteBlocker:Ne,patchRoutes:Ge,_internalFetchControllers:M,_internalSetRoutes:We,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){B(e)}},e.instrumentations&&(C=xs(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Ks(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function qs(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=rs(r||`.`,ns(o),Yo(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Jc(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=Xo({basename:n,pathname:c.pathname})),fo(c)}function Js(e,t,n){if(!n||!Ks(n))return{path:t};if(n.formMethod&&!Kc(n.formMethod))return{path:t,error:Mc(405,{method:n.formMethod})};let r=()=>({path:t,error:Mc(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Pc(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!qc(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(!qc(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()}}}G(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=wc(n.formData),s=n.formData;else if(n.body instanceof FormData)o=wc(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Tc(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Tc(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(qc(c.formMethod))return{path:t,submission:c};let l=po(t);return e&&l.search&&Jc(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:fo(l),submission:c}}function Ys(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Bc(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&&Bc(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=ms(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(!Xs(s))f=!1;else if(u){let{shouldLoad:e}=Zs(s,a.loaderData,a.errors);f=e}else Qs(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return pc(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?$s(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return pc(n,r,e,c,k,i,l,t,ec(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=Eo(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=Yc(b,e.path),C=new AbortController,w=Cc(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=mc(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=mc(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};ec(S,a)&&(T=mc(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 Xs(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Zs(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Xs(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 Qs(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function $s(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function ec(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function tc(e,t,n,r,i,a){let o;if(e){let t=r[e];G(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=>nc(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Co(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]=Co([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 nc(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=>nc(e,t)))??!1:!1}var rc=new WeakMap,ic=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(G(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=rc.get(i);o||(o={},rc.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=vo(e),n=i[e]!==void 0;if(t)so(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)so(!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},ac=new WeakMap;function oc(e,t,n,r,i){let a=n[e.id];if(G(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=ac.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{G(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=bo(e),o=a[e]!==void 0;i?so(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?so(!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 ac.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=ic({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 sc(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 cc(e){return e.matches.some(e=>e.route.middleware)?lc(e,()=>sc(e)):sc(e)}function lc(e,t){return uc(e,t,e=>{if(Gc(e))throw e;return e},Lc,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{[Ac(r,a).route.id]:{type:`error`,result:t}}}}}async function uc(e,t,n,r,i){let{matches:a,...o}=e;return await dc(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function dc(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 dc(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 fc(e,t,n,r,i){let a=ic({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=oc(r.route,qc(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function pc(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=fc(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?ec(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?ec(a,{...l,defaultShouldRevalidate:e}):ec(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!qc(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(qc(n.method)||!p)?gc({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 mc(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?pc(e,t,n,r,ms(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:fc(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function hc(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:hs(t,n),pattern:ms(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 lc(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 gc({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=qc(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:hs(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 Mc(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 Mc(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function _c(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 vc(e){let{result:t,type:n}=e;if(Uc(t)){let e;try{e=await _c(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new fs(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Hc(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:Ic(t),statusCode:ps(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:ps(t)?t.status:void 0}:Hc(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 yc(e,t,n,r,i){let a=e.headers.get(`Location`);if(G(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Zo(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=qs(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var bc=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function xc(e){try{return bc.includes(new URL(e).protocol)}catch{return!1}}function Sc(e,t,n,r){if(Zo(e)){let r=e,i=no.test(r)?new URL(ro(r,t.protocol)):new URL(r);if(xc(i.toString()))throw Error(`Invalid redirect location`);let a=Yo(i.pathname,n)!=null;if(i.origin===t.origin&&a)return is(i.pathname)+i.search+i.hash}try{if(xc(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Cc(e,t,n,r){let i=e.createURL(Pc(t)).toString(),a={signal:n};if(r&&qc(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=wc(r.formData):a.body=r.formData}return new Request(i,a)}function wc(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Tc(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Ec(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Bc(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(G(!Vc(f),`Cannot handle redirect results in processLoaderData`),Bc(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Ac(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Us),c||(c=!0,s=ps(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 Dc(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Ec(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(G(s,`Did not find corresponding fetcher result`),Bc(s)){let t=Ac(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Vc(s))G(!1,`Unhandled fetcher revalidation redirect`);else{let e=nl(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Oc(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Us).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 kc(e){return e?Bc(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ac(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 jc(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 Mc(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 fs(e||500,o,Error(s),!0)}function Nc(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Vc(r))return{key:n,result:r}}}function Pc(e){return fo({...typeof e==`string`?po(e):e,hash:``})}function Fc(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Ic(e){return new fs(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Lc(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Rc(t))}function Rc(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function zc(e){return Uc(e.result)&&Ls.has(e.result.status)}function Bc(e){return e.type===`error`}function Vc(e){return(e&&e.type)===`redirect`}function Hc(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Uc(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Wc(e){return Ls.has(e)}function Gc(e){return Uc(e)&&Wc(e.status)&&e.headers.has(`Location`)}function Kc(e){return Is.has(e.toUpperCase())}function qc(e){return Ps.has(e.toUpperCase())}function Jc(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Yc(e,t){let n=typeof t==`string`?po(t).search:t.search;if(e[e.length-1].route.index&&Jc(n||``))return e[e.length-1];let r=ts(e);return r[r.length-1]}function Xc(e,t,n){return{url:hs(e.createURL(t),t),pattern:n?ms(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function Zc(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 Qc(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 $c(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 el(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 tl(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 nl(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 rl(e,t){try{let n=e.sessionStorage.getItem(Hs);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 il(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Hs,JSON.stringify(n))}catch(e){so(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function al(){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 ol=V.createContext(null);ol.displayName=`DataRouter`;var sl=V.createContext(null);sl.displayName=`DataRouterState`;var cl=V.createContext(!1);function ll(){return V.useContext(cl)}var ul=V.createContext({isTransitioning:!1});ul.displayName=`ViewTransition`;var dl=V.createContext(new Map);dl.displayName=`Fetchers`;var fl=V.createContext(null);fl.displayName=`Await`;var pl=V.createContext(null);pl.displayName=`Navigation`;var ml=V.createContext(null);ml.displayName=`Location`;var hl=V.createContext({outlet:null,matches:[],isDataRoute:!1});hl.displayName=`Route`;var gl=V.createContext(null);gl.displayName=`RouteError`;var _l=`REACT_ROUTER_ERROR`,vl=`REDIRECT`,yl=`ROUTE_ERROR_RESPONSE`;function bl(e){if(e.startsWith(`${_l}:${vl}:{`))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 xl(e){if(e.startsWith(`${_l}:${yl}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new fs(t.status,t.statusText,t.data)}catch{}}function Sl(e,{relative:t}={}){G(Cl(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=V.useContext(pl),{hash:i,pathname:a,search:o}=jl(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:as([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Cl(){return V.useContext(ml)!=null}function wl(){return G(Cl(),`useLocation() may be used only in the context of a <Router> component.`),V.useContext(ml).location}var Tl=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function El(){let{isDataRoute:e}=V.useContext(hl);return e?Zl():Dl()}function Dl(){G(Cl(),`useNavigate() may be used only in the context of a <Router> component.`);let e=V.useContext(ol),{basename:t,navigator:n}=V.useContext(pl),{matches:r}=V.useContext(hl),{pathname:i}=wl(),a=JSON.stringify(ns(r)),o=V.useRef(!1);return V.useLayoutEffect(()=>{o.current=!0}),V.useCallback((r,s={})=>{if(so(o.current,Tl),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=rs(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:as([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Ol=V.createContext(null);function kl(e){let t=V.useContext(hl).outlet;return V.useMemo(()=>t&&V.createElement(Ol.Provider,{value:e},t),[t,e])}function Al(){let{matches:e}=V.useContext(hl);return e[e.length-1]?.params??{}}function jl(e,{relative:t}={}){let{matches:n}=V.useContext(hl),{pathname:r}=wl(),i=JSON.stringify(ns(n));return V.useMemo(()=>rs(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Ml(e,t,n){G(Cl(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=V.useContext(pl),{matches:i}=V.useContext(hl),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=wl(),l;if(t){let e=typeof t==`string`?po(t):t;G(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})):To(e,{pathname:d}),p=zl(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:as([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:as([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?V.createElement(ml.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function Nl(){let e=Xl(),t=ps(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return V.createElement(V.Fragment,null,V.createElement(`h2`,null,`Unexpected Application Error!`),V.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?V.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Pl=V.createElement(Nl,null),Fl=class extends V.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=cl;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=xl(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:V.createElement(hl.Provider,{value:this.props.routeContext},V.createElement(gl.Provider,{value:e,children:this.props.component}));return this.context?V.createElement(Ll,{error:e},t):t}},Il=new WeakMap;function Ll({children:e,error:t}){let{basename:n}=V.useContext(pl);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=bl(t.digest);if(e){let r=Il.get(t);if(r)throw r;let i=_s(e.location,n),a=i.absoluteURL||i.to;if(xc(a))throw Error(`Invalid redirect location`);if(gs&&!Il.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 Il.set(t,n),n}return V.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Rl({routeContext:e,match:t,children:n}){let r=V.useContext(ol);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),V.createElement(hl.Provider,{value:e},n)}function zl(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);G(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:ms(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||Pl,o&&(s<0&&c===0?($l(`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?V.createElement(n.route.Component,null):n.route.element?n.route.element:e,V.createElement(Rl,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?V.createElement(Fl,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Bl(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vl(e){let t=V.useContext(ol);return G(t,Bl(e)),t}function Hl(e){let t=V.useContext(sl);return G(t,Bl(e)),t}function Ul(e){let t=V.useContext(hl);return G(t,Bl(e)),t}function Wl(e){let t=Ul(e),n=t.matches[t.matches.length-1];return G(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Gl(){return Wl(`useRouteId`)}function Kl(){let e=Hl(`useNavigation`);return V.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function ql(){let e=Vl(`useRevalidator`),t=Hl(`useRevalidator`),n=V.useCallback(async()=>{await e.router.revalidate()},[e.router]);return V.useMemo(()=>({revalidate:n,state:t.revalidation}),[n,t.revalidation])}function Jl(){let{matches:e,loaderData:t}=Hl(`useMatches`);return V.useMemo(()=>e.map(e=>Do(e,t)),[e,t])}function Yl(){let e=Hl(`useLoaderData`),t=Wl(`useLoaderData`);return e.loaderData[t]}function Xl(){let e=V.useContext(gl),t=Hl(`useRouteError`),n=Wl(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Zl(){let{router:e}=Vl(`useNavigate`),t=Wl(`useNavigate`),n=V.useRef(!1);return V.useLayoutEffect(()=>{n.current=!0}),V.useCallback(async(r,i={})=>{so(n.current,Tl),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Ql={};function $l(e,t,n){!t&&!Ql[e]&&(Ql[e]=!0,so(!1,n))}function eu(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 tu(e,t=`|`){return e.map(e=>Ou(e)).join(t)}function nu(e,t){return typeof t==`bigint`?t.toString():t}var ru=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function iu(e){return new ru(e)}function au(e){return e==null}function ou(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function su(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var cu=Symbol(`evaluating`);function lu(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==cu)return r===void 0&&(r=cu,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function uu(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function du(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function fu(e){return du(e._zod.def)??e._zod.def.shape}function pu(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return uu(this,t,e),e},enumerable:!0,configurable:!0})}function mu(e,t,n){t in e?uu(e,t,n):e[t]=n}function hu(e,t,n,r){let i=fu(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?pu(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):mu(e,a,r?r(n.value,a):n.value))}}function gu(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?pu(e,n,()=>t[n]):mu(e,n,r.value))}}function _u(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function vu(e){return JSON.stringify(e)}function yu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var bu=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function xu(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Su=iu(()=>{if(vd.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Cu(e){if(xu(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(xu(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function wu(e){return Cu(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Tu=new Set([`string`,`number`,`symbol`]);function Eu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Du(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 Ou(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ku(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Au={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ju={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Mu(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return hu(i,e,Nu(e,t)),Du(e,_u(n,{shape:i,checks:[]}))}function Nu(e,t){let n=fu(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Pu(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Nu(e,t)),a={};return hu(a,e,Reflect.ownKeys(fu(e)).filter(e=>!i.has(e))),Du(e,_u(n,{shape:a,checks:[]}))}function Fu(e,t){if(!Cu(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=fu(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Du(e,_u(e._zod.def,{shape:Iu(e,t)}))}function Iu(e,t){let n={};return hu(n,e,Reflect.ownKeys(fu(e))),gu(n,t),n}function Lu(e,t){if(!Cu(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Du(e,_u(e._zod.def,{shape:Iu(e,t)}))}function Ru(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return hu(n,e,Reflect.ownKeys(fu(e))),hu(n,t,Reflect.ownKeys(fu(t))),Du(e,_u(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function zu(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Nu(t,n)):void 0,o={};return hu(o,t,Reflect.ownKeys(fu(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Du(t,_u(t._zod.def,{shape:o,checks:[]}))}function Bu(e,t,n){let r=n?new Set(Nu(t,n)):void 0,i={};return hu(i,t,Reflect.ownKeys(fu(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Du(t,_u(t._zod.def,{shape:i}))}function Vu(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 Hu(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 Uu(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Wu(e){return typeof e==`string`?e:e?.message}function Gu(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Ku(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function qu(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Wu(e.inst?._zod.def?.error?.(e))??Wu(a?.(e))??Wu(t?.error?.(e))??Wu(n.customError?.(e))??Wu(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t===`inst`||t===`schema`||t===`continue`||t===`input`||t===`__proto__`||(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Ju=/[\uD800-\uDBFF]/;function Yu(e){let t=e.length;if(!Ju.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Xu(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Zu(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Qu(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function $u(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):rd(e,n,r.value)}}function ed(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function td(e,t,n){return ed(e,t,n,!1)}function nd(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return ed(this,n,r(this))},set(e){ed(this,n,e)}})}return t}function rd(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:ed(this,t,n.bind(this))},set(e){ed(this,t,e)}})}function id(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var ad,od=!1,sd={configurable:!0,get(){od=!0}};function q(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&ad!==e._zod){ad=void 0;return}ad=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,sd);let e=od;od=!1;try{let r=n(this);return od?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),od||=e,r}catch(n){throw delete this[t],od||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function cd(e,t,n,r){let i=id(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var ld=`~constantCatch`;function ud(e){let t=()=>e;return t[ld]=!0,t}var dd,fd=Object.freeze({status:`aborted`}),pd={value:void 0,enumerable:!1},md=`captureStackTrace`in Error?Error:null;function hd(e){let t=md;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return md=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function J(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){pd.value=new a(r);try{Object.defineProperty(n,"_zod",pd)}finally{pd.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),$u(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?hd(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var gd=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},_d=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(dd=globalThis).__zod_globalConfig??(dd.__zod_globalConfig={});var vd=globalThis.__zod_globalConfig;function yd(e){return e&&Object.assign(vd,e),vd}function bd(){let e=this._zod;return e.message??=JSON.stringify(e.def,nu,2),e.message}function xd(e){this._zod.message=e}var Sd={get:bd,set:xd,enumerable:!0,configurable:!0},Cd={value:void 0,enumerable:!1},wd=new WeakSet([Object.prototype,Error.prototype]),Td=(e,t)=>{e.name=`$ZodError`,Cd.value=t,Object.defineProperty(e,"issues",Cd),Cd.value=void 0,Object.defineProperty(e,"message",Sd);let n=Object.getPrototypeOf(e);wd.has(n)||(wd.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Ed=J(`$ZodError`,Td),Dd=J(`$ZodError`,Td,void 0,{Parent:Error});function Od(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function kd(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Od(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ad(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function jd(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 Md(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 ${jd(e.path)}`);return t.join(`
2
+ `)}function Nd(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Pd=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new gd;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>qu(e,o,yd())));throw bu(n,a?.callee??t),n}return s.value};return t},Fd=Pd(Dd),Id=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>qu(e,o,yd())));throw bu(n,a?.callee??t),n}return s.value};return t},Ld=Id(Dd),Rd=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 gd;return a.issues.length?Bd(e,a.issues,i):{success:!0,data:a.value}},zd=Rd(Dd);function Bd(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>qu(e,n,yd()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Vd=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?Bd(e,a.issues,i):{success:!0,data:a.value}},Hd=Vd(Dd),Ud=Symbol.for(`zod.compile.invalid`),Wd=Symbol.for(`zod.compile.fallback`),Gd=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Ud)return!0;if(r.definite===!0&&n===void 0)return!1}return Kd(e,t,n)});function Kd(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Wd]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new gd;return a.issues.length===0}var qd=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Jd=e=>{let t=Pd(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Nd(n,a))};return n},Yd=e=>{let t=Pd(e),n=(e,r,i,a)=>t(e,r,i,Nd(n,a));return n},Xd=e=>{let t=Id(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Nd(n,a))};return n},Zd=e=>{let t=Id(e),n=async(e,r,i,a)=>await t(e,r,i,Nd(n,a));return n},Qd=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Rd(e)(t,n,i)},$d=e=>(t,n,r)=>Rd(e)(t,n,r),ef=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Vd(e)(t,n,i)},tf=e=>async(t,n,r)=>Vd(e)(t,n,r),nf=/^[cC][0-9a-z]{6,}$/,rf=/^[0-9a-z]+$/,af=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,of=/^[0-9a-vA-V]{20}$/,sf=/^[A-Za-z0-9]{27}$/,cf=/^[a-zA-Z0-9_-]{21}$/;function lf(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var uf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,df=/^([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})$/,ff=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)$/,pf=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,mf=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function hf(){return new RegExp(mf,`u`)}var gf=/^(?:(?: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])$/,_f=/^(([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}|:))$/,vf=/^((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])$/,yf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xf=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Sf=/^https?$/,Cf=/^\+[1-9]\d{6,14}$/,wf=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Tf(e){return RegExp(`^${e}$`)}var Ef=Tf(wf);function Df(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Of(e){return RegExp(`^${Df(e)}$`)}function kf(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Df({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Df({precision:e.precision})}`:n;return RegExp(`^${wf}T(?:${r})$`)}var Af=/^[\s\S]{0,}$/,jf=/^-?\d+$/,Mf=/^-?\d+(?:\.\d+)?$/,Nf=/^(?:true|false)$/i,Pf=/^null$/i,Ff=/^[^A-Z]*$/,If=/^[^a-z]*$/,Lf=J(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Rf=e=>{let t=e.value;return!au(t)&&t.length!==void 0},zf={number:`number`,bigint:`bigint`,object:`date`},Bf=J(`$ZodCheckLessThan`,(e,t)=>{Lf.init(e,t);let n=zf[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:zf[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vf=J(`$ZodCheckGreaterThan`,(e,t)=>{Lf.init(e,t);let n=zf[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:zf[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Hf=J(`$ZodCheckMultipleOf`,(e,t)=>{Lf.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):su(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})}}),Uf=J(`$ZodCheckNumberFormat`,(e,t)=>{Lf.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Au[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Wf=J(`$ZodCheckMaxLength`,(e,t)=>{var n;Lf.init(e,t),(n=e._zod.def).when??(n.when=Rf),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Yu(r):i)<=t.maximum)return;let a=Xu(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Gf=J(`$ZodCheckMinLength`,(e,t)=>{var n;Lf.init(e,t),(n=e._zod.def).when??(n.when=Rf),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Yu(r):i)>=t.minimum)return;let a=Xu(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Kf=J(`$ZodCheckLengthEquals`,(e,t)=>{var n;Lf.init(e,t),(n=e._zod.def).when??(n.when=Rf),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Yu(r):i;if(a===t.length)return;let o=Xu(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),qf=J(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Lf.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Jf=J(`$ZodCheckRegex`,(e,t)=>{qf.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})}}),Yf=J(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ff,qf.init(e,t)}),Xf=J(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=If,qf.init(e,t)}),Zf=J(`$ZodCheckIncludes`,(e,t)=>{Lf.init(e,t);let n=Eu(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Qf=J(`$ZodCheckStartsWith`,(e,t)=>{Lf.init(e,t);let n=RegExp(`^${Eu(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),$f=J(`$ZodCheckEndsWith`,(e,t)=>{Lf.init(e,t);let n=RegExp(`.*${Eu(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function ep(e,t,n){e.issues.length&&t.issues.push(...Uu(n,e.issues))}var tp=J(`$ZodCheckProperties`,(e,t)=>{Lf.init(e,t),td(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>ep(t,r,e)))):ep(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),np=J(`$ZodCheckOverwrite`,(e,t)=>{Lf.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),rp=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
3
3
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
4
- `)}\n};`)(...Object.values(this.closed))}},Qf={major:4,minor:6,patch:7},Y=J(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Qf;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Vu(t),a;for(let o of n){if(o._zod.def.when){if(Hu(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new hd;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Ku(t.issues,n,e),i||=Vu(t,n))});else{if(t.issues.length===n)continue;Ku(t.issues,n,e),i||=Vu(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Vu(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new hd;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new hd;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return td(this,`~standard`,tp(this))},set"~standard"(e){ed(this,`~standard`,e)}}),$f=(e,t)=>e.issues.length?{issues:e.issues.map(e=>qu(e,t,vd()))}:{value:e.value};async function ep(e,t){let n={async:!0};return $f(await e._zod.run({value:t,issues:[]},n),n)}function tp(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return $f(r,n)}catch{}return ep(e,t)},vendor:`zod`,version:1}}var np=J(`$ZodString`,(e,t)=>{Y.init(e,t),e._zod.pattern=t.pattern??wf,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}}),X=J(`$ZodStringFormat`,(e,t)=>{Vf.init(e,t),np.init(e,t)}),rp=J(`$ZodGUID`,(e,t)=>{t.pattern??=af,X.init(e,t)}),ip=J(`$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??=of(e)}else t.pattern??=of();X.init(e,t)}),ap=J(`$ZodEmail`,(e,t)=>{t.pattern??=sf,X.init(e,t)});function op(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function sp(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?op(e)||2:cp(e,t)}function cp(e,t){if(!t.normalize&&t.protocol?.source===gf.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var lp=/[\t\n\r]/g;function up(e){return e.replace(lp,``)}function dp(e,t){return t.lastIndex=0,t.test(e.hostname)}function fp(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var pp=J(`$ZodURL`,(e,t)=>{X.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=sp(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=up(r);return}t.hostname&&!dp(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!fp(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:up(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),mp=J(`$ZodEmoji`,(e,t)=>{t.pattern??=lf(),X.init(e,t)}),hp=J(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?tf:nf(t.length),X.init(e,t)}),gp=J(`$ZodCUID`,(e,t)=>{t.pattern??=Xd,X.init(e,t)}),_p=J(`$ZodCUID2`,(e,t)=>{t.pattern??=Zd,X.init(e,t)}),vp=J(`$ZodULID`,(e,t)=>{t.pattern??=Qd,X.init(e,t)}),yp=J(`$ZodXID`,(e,t)=>{t.pattern??=$d,X.init(e,t)}),bp=J(`$ZodKSUID`,(e,t)=>{t.pattern??=ef,X.init(e,t)}),xp=J(`$ZodISODateTime`,(e,t)=>{t.pattern??=Cf(t),X.init(e,t)}),Sp=J(`$ZodISODate`,(e,t)=>{t.pattern??=bf,X.init(e,t)}),Cp=J(`$ZodISOTime`,(e,t)=>{t.pattern??=Sf(t),X.init(e,t)}),wp=J(`$ZodISODuration`,(e,t)=>{t.pattern??=rf,X.init(e,t)}),Tp=J(`$ZodIPv4`,(e,t)=>{t.pattern??=uf,X.init(e,t)}),Ep=/^[0-9a-fA-F:.]+$/;function Dp(e){return Ep.test(e)?op(`http://[${e}]`):!1}var Op=J(`$ZodIPv6`,(e,t)=>{t.pattern??=df,X.init(e,t),e._zod.check=n=>{Dp(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),kp=J(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ff,X.init(e,t)});function Ap(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Dp(n)}var jp=J(`$ZodCIDRv6`,(e,t)=>{t.pattern??=pf,X.init(e,t),e._zod.check=n=>{Ap(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Mp(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Np=/^[0-9a-zA-Z+/]*={0,2}$/,Pp=J(`$ZodBase64`,(e,t)=>{t.pattern??=Np,X.init(e,t),e._zod.check=n=>{Mp(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Fp=/^[A-Za-z0-9_-]*$/;function Ip(e){if(!Fp.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Mp(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Lp=J(`$ZodBase64URL`,(e,t)=>{t.pattern??=Fp,X.init(e,t),e._zod.check=n=>{Ip(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Rp=J(`$ZodE164`,(e,t)=>{t.pattern??=_f,X.init(e,t)});function zp(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 Bp=J(`$ZodJWT`,(e,t)=>{X.init(e,t),e._zod.check=n=>{zp(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Vp=J(`$ZodNumber`,(e,t)=>{Y.init(e,t),e._zod.pattern=Ef,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Hp=J(`$ZodNumberFormat`,(e,t)=>{Lf.init(e,t),Vp.init(e,t)}),Up=J(`$ZodBoolean`,(e,t)=>{Y.init(e,t),e._zod.pattern=Df,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}}),Wp=J(`$ZodNull`,(e,t)=>{Y.init(e,t),e._zod.pattern=Of,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}}),Gp=J(`$ZodUnknown`,(e,t)=>{Y.init(e,t),e._zod.parse=e=>e}),Kp=J(`$ZodNever`,(e,t)=>{Y.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function qp(e,t){let n=Gu(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Gu(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Ku(n.issues,t,e),n}}return i(n,a)}}var Jp=e=>Array.isArray(e)?e.length:-1;function Yp(e,t,n){e.issues.length&&t.issues.push(...Uu(n,e.issues)),t.value[n]=e.value}var Xp=J(`$ZodArray`,(e,t)=>{Y.init(e,t);let n=_d.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Yp(t,r,e)));else if(Yp(c,r,e),s&&c.issues.length!==0&&Vu(c))break}return o.length?Promise.all(o).then(()=>r):r},qp(e,Jp)});function Zp(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(!(!o&&s&&i===`optional`)){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Uu(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Qp=[];function $p(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Qp,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ku(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function em(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Vu(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Zp(e,n,i,t,d,f))):Zp(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var tm=J(`$ZodObject`,(e,t)=>{Y.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=iu(()=>$p(t));q(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||uu(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=xu,o=t.catchall,s,c=_d.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Vu(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Zp(n,t,e,r,a,o))):Zp(s,t,e,r,a,o)}return o?em(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),nm=J(`$ZodObjectJIT`,(e,t)=>{tm.init(e,t);let n=e._zod.parse,r=iu(()=>$p(t)),i=_d.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Zf([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
4
+ `)}\n};`)(...Object.values(this.closed))}},ip={major:4,minor:6,patch:7},Y=J(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ip;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Vu(t),a;for(let o of n){if(o._zod.def.when){if(Hu(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new gd;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Ku(t.issues,n,e),i||=Vu(t,n))});else{if(t.issues.length===n)continue;Ku(t.issues,n,e),i||=Vu(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Vu(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new gd;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new gd;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return td(this,`~standard`,sp(this))},set"~standard"(e){ed(this,`~standard`,e)}}),ap=(e,t)=>e.issues.length?{issues:e.issues.map(e=>qu(e,t,yd()))}:{value:e.value};async function op(e,t){let n={async:!0};return ap(await e._zod.run({value:t,issues:[]},n),n)}function sp(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return ap(r,n)}catch{}return op(e,t)},vendor:`zod`,version:1}}var cp=J(`$ZodString`,(e,t)=>{Y.init(e,t),e._zod.pattern=t.pattern??Af,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}}),X=J(`$ZodStringFormat`,(e,t)=>{qf.init(e,t),cp.init(e,t)}),lp=J(`$ZodGUID`,(e,t)=>{t.pattern??=df,X.init(e,t)}),up=J(`$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??=ff(e)}else t.pattern??=ff();X.init(e,t)}),dp=J(`$ZodEmail`,(e,t)=>{t.pattern??=pf,X.init(e,t)});function fp(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function pp(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?fp(e)||2:mp(e,t)}function mp(e,t){if(!t.normalize&&t.protocol?.source===Sf.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var hp=/[\t\n\r]/g;function gp(e){return e.replace(hp,``)}function _p(e,t){return t.lastIndex=0,t.test(e.hostname)}function vp(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var yp=J(`$ZodURL`,(e,t)=>{X.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=pp(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=gp(r);return}t.hostname&&!_p(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!vp(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:gp(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),bp=J(`$ZodEmoji`,(e,t)=>{t.pattern??=hf(),X.init(e,t)}),xp=J(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?cf:lf(t.length),X.init(e,t)}),Sp=J(`$ZodCUID`,(e,t)=>{t.pattern??=nf,X.init(e,t)}),Cp=J(`$ZodCUID2`,(e,t)=>{t.pattern??=rf,X.init(e,t)}),wp=J(`$ZodULID`,(e,t)=>{t.pattern??=af,X.init(e,t)}),Tp=J(`$ZodXID`,(e,t)=>{t.pattern??=of,X.init(e,t)}),Ep=J(`$ZodKSUID`,(e,t)=>{t.pattern??=sf,X.init(e,t)}),Dp=J(`$ZodISODateTime`,(e,t)=>{t.pattern??=kf(t),X.init(e,t)}),Op=J(`$ZodISODate`,(e,t)=>{t.pattern??=Ef,X.init(e,t)}),kp=J(`$ZodISOTime`,(e,t)=>{t.pattern??=Of(t),X.init(e,t)}),Ap=J(`$ZodISODuration`,(e,t)=>{t.pattern??=uf,X.init(e,t)}),jp=J(`$ZodIPv4`,(e,t)=>{t.pattern??=gf,X.init(e,t)}),Mp=/^[0-9a-fA-F:.]+$/;function Np(e){return Mp.test(e)?fp(`http://[${e}]`):!1}var Pp=J(`$ZodIPv6`,(e,t)=>{t.pattern??=_f,X.init(e,t),e._zod.check=n=>{Np(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Fp=J(`$ZodCIDRv4`,(e,t)=>{t.pattern??=vf,X.init(e,t)});function Ip(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Np(n)}var Lp=J(`$ZodCIDRv6`,(e,t)=>{t.pattern??=yf,X.init(e,t),e._zod.check=n=>{Ip(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Rp(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var zp=/^[0-9a-zA-Z+/]*={0,2}$/,Bp=J(`$ZodBase64`,(e,t)=>{t.pattern??=zp,X.init(e,t),e._zod.check=n=>{Rp(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Vp=/^[A-Za-z0-9_-]*$/;function Hp(e){if(!Vp.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Rp(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Up=J(`$ZodBase64URL`,(e,t)=>{t.pattern??=Vp,X.init(e,t),e._zod.check=n=>{Hp(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Wp=J(`$ZodE164`,(e,t)=>{t.pattern??=Cf,X.init(e,t)});function Gp(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 Kp=J(`$ZodJWT`,(e,t)=>{X.init(e,t),e._zod.check=n=>{Gp(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),qp=J(`$ZodNumber`,(e,t)=>{Y.init(e,t),e._zod.pattern=Mf,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Jp=J(`$ZodNumberFormat`,(e,t)=>{Uf.init(e,t),qp.init(e,t)}),Yp=J(`$ZodBoolean`,(e,t)=>{Y.init(e,t),e._zod.pattern=Nf,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}}),Xp=J(`$ZodNull`,(e,t)=>{Y.init(e,t),e._zod.pattern=Pf,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}}),Zp=J(`$ZodUnknown`,(e,t)=>{Y.init(e,t),e._zod.parse=e=>e}),Qp=J(`$ZodNever`,(e,t)=>{Y.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function $p(e,t){let n=Gu(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Gu(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Ku(n.issues,t,e),n}}return i(n,a)}}var em=e=>Array.isArray(e)?e.length:-1;function tm(e,t,n){e.issues.length&&t.issues.push(...Uu(n,e.issues)),t.value[n]=e.value}var nm=J(`$ZodArray`,(e,t)=>{Y.init(e,t);let n=vd.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>tm(t,r,e)));else if(tm(c,r,e),s&&c.issues.length!==0&&Vu(c))break}return o.length?Promise.all(o).then(()=>r):r},$p(e,em)});function rm(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(!(!o&&s&&i===`optional`)){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Uu(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var im=[];function am(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:im,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ku(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function om(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Vu(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>rm(e,n,i,t,d,f))):rm(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var sm=J(`$ZodObject`,(e,t)=>{Y.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=iu(()=>am(t));q(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||uu(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=xu,o=t.catchall,s,c=vd.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Vu(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>rm(n,t,e,r,a,o))):rm(s,t,e,r,a,o)}return o?om(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),cm=J(`$ZodObjectJIT`,(e,t)=>{sm.init(e,t);let n=e._zod.parse,r=iu(()=>am(t)),i=vd.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new rp([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
5
5
  let ${e}_ab = false;
6
6
  for (let i = 0; i < ${e}.issues.length; i++) {
7
7
  const iss = ${e}.issues[i];
@@ -51,6 +51,6 @@ import{a as e,d as t,i as n,n as r,o as i,r as a}from"./preload-helper-DtyrgAzE.
51
51
  newResult[${r}] = ${n}.value;
52
52
  }
53
53
 
54
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=xu,c=!_d.jitless,l=c&&Su.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?em([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function rm(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=>!Vu(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=>qu(e,r,vd())))}),t)}var im=J(`$ZodUnion`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),q(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),q(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),q(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>ou(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=>rm(t,r,e,i)):rm(o,r,e,i)}});function am(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var om=J(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,im.init(e,t);let n=e._zod.parse;q(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||uu(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=du(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=iu(()=>am(t));e._zod.parse=(i,a)=>{let o=i.value;if(!xu(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),sm=J(`$ZodIntersection`,(e,t)=>{Y.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])=>lm(e,t,n)):lm(e,i,a)}});function cm(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Cu(e)&&Cu(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=cm(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=cm(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 lm(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=cm(t.value,n.value);if(!c.valid){if(Vu(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var um=J(`$ZodRecord`,(e,t)=>{Y.init(e,t);let n=_d.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Cu(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>qu(e,i,vd())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Uu(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Uu(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e))if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e);l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Ef.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>qu(e,i,vd())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Uu(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Uu(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),dm=J(`$ZodEnum`,(e,t)=>{Y.init(e,t);let n=eu(t.entries),r=new Set(n);e._zod.values=r,q(e,`pattern`,e=>{let t=eu(e.def.entries).filter(e=>Tu.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Eu(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),fm=J(`$ZodLiteral`,(e,t)=>{Y.init(e,t);let n=new Set(t.values);e._zod.values=n,q(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Eu(e):e?Eu(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),pm=J(`$ZodTransform`,(e,t)=>{Y.init(e,t),e._zod.optin=`optional`,_d.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new gd(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new hd;return n.value=i,n}});function mm(e,t){return e.value=t.issues.length?void 0:t.value,e}var hm=J(`$ZodOptional`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,q(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),q(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ou(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>mm(e,t)):mm(e,r)}return t.innerType._zod.run(e,n)}}),gm=J(`$ZodExactOptional`,(e,t)=>{hm.init(e,t),q(e,`values`,e=>e.def.innerType._zod.values),q(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),_m=J(`$ZodNullable`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin),q(e,`optout`,e=>e.def.innerType._zod.optout),q(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ou(t.source)}|null)$`):void 0}),q(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),vm=J(`$ZodDefault`,(e,t)=>{Y.init(e,t),e._zod.optin=`defaulted`,q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ym(e,t)):ym(r,t)}});function ym(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var bm=J(`$ZodPrefault`,(e,t)=>{Y.init(e,t),e._zod.optin=`defaulted`,q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),xm=J(`$ZodNonOptional`,(e,t)=>{Y.init(e,t),q(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Sm(t,e)):Sm(i,e)}});function Sm(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Cm(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>qu(e,r,vd()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var wm=J(`$ZodCatch`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),q(e,`optout`,e=>e.def.innerType._zod.optout),q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Cm(e,r,t,n)):Cm(e,r,t,n)}}),Tm=J(`$ZodPipe`,(e,t)=>{Y.init(e,t),q(e,`values`,e=>e.def.in._zod.values),q(e,`optin`,e=>e.def.in._zod.optin),q(e,`optout`,e=>e.def.out._zod.optout),q(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Em(e,t.in,n)):Em(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Em(e,t.out,n)):Em(r,t.out,n)}});function Em(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Dm=J(`$ZodPreprocess`,(e,t)=>{Tm.init(e,t)}),Om=J(`$ZodReadonly`,(e,t)=>{Y.init(e,t),q(e,`propValues`,e=>e.def.innerType._zod.propValues),q(e,`values`,e=>e.def.innerType._zod.values),q(e,`optin`,e=>e.def.innerType?._zod?.optin),q(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(km):km(r)}});function km(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Am=J(`$ZodLazy`,(e,t)=>{Y.init(e,t),lu(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),q(e,`pattern`,e=>e.innerType?._zod?.pattern),q(e,`propValues`,e=>e.innerType?._zod?.propValues),q(e,`optin`,e=>e.innerType?._zod?.optin??void 0),q(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),jm=J(`$ZodCustom`,(e,t)=>{jf.init(e,t),Y.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=>Mm(t,n,r,e));Mm(i,n,r,e)}});function Mm(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(Qu(e))}}var Nm=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Pm=`~memo`,Fm=[];function Im(e){return typeof e==`object`&&!!e}function Lm(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Rm=new WeakMap,zm=0,Bm=1,Vm=2;function Hm(e,t,n){let r=Rm.get(e);if(r!==void 0)return r?Vm:zm;if(t.has(e))return Vm;t.add(e);let i=zm,a=e=>{if(i!==Vm&&e?._zod){let r=Hm(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=zm;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Bm:o.value?._zod?Hm(o.value,t,n):zm;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=du(c);s(e?o(e,!0):Bm),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Hm(r,t,!1):Bm);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(!(!n||typeof n!=`object`)){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Um(e,i)}function Um(e,t){return t!==Bm&&Rm.set(e,t===Vm),t}function Wm(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Gm,Km=[],qm={alloc(e,t,n){let r=Gm;if(!r)return n;Gm=void 0;let i={value:n,issues:null};return r.set(t.value,i),Km.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Ym(n,e.value))throw new Nm;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Hm(e,new Set,!1);if(i===zm)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Vm||r?n=!0:r=!0}let l=s.value;if(!Im(l))return t(s,c);let u=c[Pm];u||(u={buckets:new WeakMap,backEdges:void 0},c[Pm]=u);let d;i===c?d=a:(d=Wm(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Lm(f.issues)):(s.memo=!0,u.backEdges??=new WeakSet,u.backEdges.add(f.value)),s;Gm=d;let p=Km.length,m=t(s,c);Gm=void 0;let h=Km.length>p?Km.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Lm(e.issues):Fm),e)):(h&&(h.issues=m.issues.length?Lm(m.issues):Fm),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Jm(){return qm}function Ym(e,t){let n=e[Pm]?.backEdges;return n!==void 0&&Im(t)&&n.has(t)}var Xm=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Zu(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Ou(e.values[0])}`:`Invalid option: expected one of ${tu(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${tu(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Zm(){return{localeError:Xm()}}var Qm,$m=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 eh(){return new $m}(Qm=globalThis).__zod_globalRegistry??(Qm.__zod_globalRegistry=eh());var th=globalThis.__zod_globalRegistry;function nh(e){return e.checks&&=[...e.checks],e}function rh(e,t){return new e(nh({type:`string`,...K(t)}))}function ih(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...K(t)})}function ah(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...K(t)})}function oh(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...K(t)})}function sh(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...K(t)})}function ch(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...K(t)})}function lh(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...K(t)})}function uh(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...K(t)})}function dh(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...K(t)})}function fh(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...K(t)})}function ph(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...K(t)})}function mh(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...K(t)})}function hh(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...K(t)})}function gh(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...K(t)})}function _h(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...K(t)})}function vh(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...K(t)})}function yh(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...K(t)})}function bh(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...K(t)})}function xh(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...K(t)})}function Sh(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...K(t)})}function Ch(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...K(t)})}function wh(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...K(t)})}function Th(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...K(t)})}function Eh(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...K(t)})}function Dh(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...K(t)})}function Oh(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...K(t)})}function kh(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...K(t)})}function Ah(e,t){return new e(nh({type:`number`,checks:[],...K(t)}))}function jh(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...K(t)})}function Mh(e,t){return new e({type:`boolean`,...K(t)})}function Nh(e,t){return new e({type:`null`,...K(t)})}function Ph(e){return new e({type:`unknown`})}function Fh(e,t){return new e({type:`never`,...K(t)})}function Ih(e,t){return new Pf({check:`less_than`,...K(t),value:e,inclusive:!1})}function Lh(e,t){return new Pf({check:`less_than`,...K(t),value:e,inclusive:!0})}function Rh(e,t){return new Ff({check:`greater_than`,...K(t),value:e,inclusive:!1})}function zh(e,t){return new Ff({check:`greater_than`,...K(t),value:e,inclusive:!0})}function Bh(e,t){return new If({check:`multiple_of`,...K(t),value:e})}function Vh(e,t){return new Rf({check:`max_length`,...K(t),maximum:e})}function Hh(e,t){return new zf({check:`min_length`,...K(t),minimum:e})}function Uh(e,t){return new Bf({check:`length_equals`,...K(t),length:e})}function Wh(e,t){return new Hf({check:`string_format`,format:`regex`,...K(t),pattern:e})}function Gh(e){return new Uf({check:`string_format`,format:`lowercase`,...K(e)})}function Kh(e){return new Wf({check:`string_format`,format:`uppercase`,...K(e)})}function qh(e,t){return new Gf({check:`string_format`,format:`includes`,...K(t),includes:e})}function Jh(e,t){return new Kf({check:`string_format`,format:`starts_with`,...K(t),prefix:e})}function Yh(e,t){return new qf({check:`string_format`,format:`ends_with`,...K(t),suffix:e})}function Xh(e,t){return new Yf({check:`properties`,shape:e,...K(t)})}function Zh(e){return new Xf({check:`overwrite`,tx:e})}function Qh(e){return Zh(t=>t.normalize(e))}function $h(){return Zh(e=>e.trim())}function eg(){return Zh(e=>e.toLowerCase())}function tg(){return Zh(e=>e.toUpperCase())}function ng(){return Zh(e=>yu(e))}function rg(e,t,n){return new e({type:`array`,element:t,...K(n)})}function ig(e,t,n){let r=K(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function ag(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...K(n)})}function og(e,t){let n=sg(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Qu(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Qu(r))}},e(t.value,t)),t);return n}function sg(e,t){let n=new jf({check:`custom`,...K(t)});return n._zod.check=e,n}function cg(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&uu(e,t,n[t]);return e}function lg(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??th,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function ug(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Z(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Z(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&cg(o.schema,c),t.io===`input`&&bg(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 dg(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function fg(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${dg(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+dg(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>
54
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=xu,c=!vd.jitless,l=c&&Su.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?om([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function lm(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=>!Vu(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=>qu(e,r,yd())))}),t)}var um=J(`$ZodUnion`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),q(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),q(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),q(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>ou(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=>lm(t,r,e,i)):lm(o,r,e,i)}});function dm(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var fm=J(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,um.init(e,t);let n=e._zod.parse;q(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||uu(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=du(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=iu(()=>dm(t));e._zod.parse=(i,a)=>{let o=i.value;if(!xu(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),pm=J(`$ZodIntersection`,(e,t)=>{Y.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])=>hm(e,t,n)):hm(e,i,a)}});function mm(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Cu(e)&&Cu(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=mm(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=mm(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 hm(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=mm(t.value,n.value);if(!c.valid){if(Vu(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var gm=J(`$ZodRecord`,(e,t)=>{Y.init(e,t);let n=vd.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Cu(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>qu(e,i,yd())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Uu(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Uu(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e))if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e);l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Mf.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>qu(e,i,yd())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Uu(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Uu(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),_m=J(`$ZodEnum`,(e,t)=>{Y.init(e,t);let n=eu(t.entries),r=new Set(n);e._zod.values=r,q(e,`pattern`,e=>{let t=eu(e.def.entries).filter(e=>Tu.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Eu(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),vm=J(`$ZodLiteral`,(e,t)=>{Y.init(e,t);let n=new Set(t.values);e._zod.values=n,q(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Eu(e):e?Eu(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ym=J(`$ZodTransform`,(e,t)=>{Y.init(e,t),e._zod.optin=`optional`,vd.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new _d(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new gd;return n.value=i,n}});function bm(e,t){return e.value=t.issues.length?void 0:t.value,e}var xm=J(`$ZodOptional`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,q(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),q(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ou(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>bm(e,t)):bm(e,r)}return t.innerType._zod.run(e,n)}}),Sm=J(`$ZodExactOptional`,(e,t)=>{xm.init(e,t),q(e,`values`,e=>e.def.innerType._zod.values),q(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Cm=J(`$ZodNullable`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin),q(e,`optout`,e=>e.def.innerType._zod.optout),q(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ou(t.source)}|null)$`):void 0}),q(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),wm=J(`$ZodDefault`,(e,t)=>{Y.init(e,t),e._zod.optin=`defaulted`,q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Tm(e,t)):Tm(r,t)}});function Tm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Em=J(`$ZodPrefault`,(e,t)=>{Y.init(e,t),e._zod.optin=`defaulted`,q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Dm=J(`$ZodNonOptional`,(e,t)=>{Y.init(e,t),q(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Om(t,e)):Om(i,e)}});function Om(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function km(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>qu(e,r,yd()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Am=J(`$ZodCatch`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),q(e,`optout`,e=>e.def.innerType._zod.optout),q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>km(e,r,t,n)):km(e,r,t,n)}}),jm=J(`$ZodPipe`,(e,t)=>{Y.init(e,t),q(e,`values`,e=>e.def.in._zod.values),q(e,`optin`,e=>e.def.in._zod.optin),q(e,`optout`,e=>e.def.out._zod.optout),q(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Mm(e,t.in,n)):Mm(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Mm(e,t.out,n)):Mm(r,t.out,n)}});function Mm(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Nm=J(`$ZodPreprocess`,(e,t)=>{jm.init(e,t)}),Pm=J(`$ZodReadonly`,(e,t)=>{Y.init(e,t),q(e,`propValues`,e=>e.def.innerType._zod.propValues),q(e,`values`,e=>e.def.innerType._zod.values),q(e,`optin`,e=>e.def.innerType?._zod?.optin),q(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Fm):Fm(r)}});function Fm(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Im=J(`$ZodLazy`,(e,t)=>{Y.init(e,t),lu(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),q(e,`pattern`,e=>e.innerType?._zod?.pattern),q(e,`propValues`,e=>e.innerType?._zod?.propValues),q(e,`optin`,e=>e.innerType?._zod?.optin??void 0),q(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Lm=J(`$ZodCustom`,(e,t)=>{Lf.init(e,t),Y.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=>Rm(t,n,r,e));Rm(i,n,r,e)}});function Rm(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(Qu(e))}}var zm=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Bm=`~memo`,Vm=[];function Hm(e){return typeof e==`object`&&!!e}function Um(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Wm=new WeakMap,Gm=0,Km=1,qm=2;function Jm(e,t,n){let r=Wm.get(e);if(r!==void 0)return r?qm:Gm;if(t.has(e))return qm;t.add(e);let i=Gm,a=e=>{if(i!==qm&&e?._zod){let r=Jm(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Gm;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Km:o.value?._zod?Jm(o.value,t,n):Gm;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=du(c);s(e?o(e,!0):Km),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Jm(r,t,!1):Km);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(!(!n||typeof n!=`object`)){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Ym(e,i)}function Ym(e,t){return t!==Km&&Wm.set(e,t===qm),t}function Xm(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Zm,Qm=[],$m={alloc(e,t,n){let r=Zm;if(!r)return n;Zm=void 0;let i={value:n,issues:null};return r.set(t.value,i),Qm.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&th(n,e.value))throw new zm;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Jm(e,new Set,!1);if(i===Gm)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===qm||r?n=!0:r=!0}let l=s.value;if(!Hm(l))return t(s,c);let u=c[Bm];u||(u={buckets:new WeakMap,backEdges:void 0},c[Bm]=u);let d;i===c?d=a:(d=Xm(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Um(f.issues)):(s.memo=!0,u.backEdges??=new WeakSet,u.backEdges.add(f.value)),s;Zm=d;let p=Qm.length,m=t(s,c);Zm=void 0;let h=Qm.length>p?Qm.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Um(e.issues):Vm),e)):(h&&(h.issues=m.issues.length?Um(m.issues):Vm),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function eh(){return $m}function th(e,t){let n=e[Bm]?.backEdges;return n!==void 0&&Hm(t)&&n.has(t)}var nh=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Zu(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Ou(e.values[0])}`:`Invalid option: expected one of ${tu(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${tu(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function rh(){return{localeError:nh()}}var ih,ah=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 oh(){return new ah}(ih=globalThis).__zod_globalRegistry??(ih.__zod_globalRegistry=oh());var sh=globalThis.__zod_globalRegistry;function ch(e){return e.checks&&=[...e.checks],e}function lh(e,t){return new e(ch({type:`string`,...K(t)}))}function uh(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...K(t)})}function dh(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...K(t)})}function fh(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...K(t)})}function ph(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...K(t)})}function mh(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...K(t)})}function hh(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...K(t)})}function gh(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...K(t)})}function _h(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...K(t)})}function vh(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...K(t)})}function yh(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...K(t)})}function bh(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...K(t)})}function xh(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...K(t)})}function Sh(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...K(t)})}function Ch(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...K(t)})}function wh(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...K(t)})}function Th(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...K(t)})}function Eh(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...K(t)})}function Dh(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...K(t)})}function Oh(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...K(t)})}function kh(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...K(t)})}function Ah(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...K(t)})}function jh(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...K(t)})}function Mh(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...K(t)})}function Nh(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...K(t)})}function Ph(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...K(t)})}function Fh(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...K(t)})}function Ih(e,t){return new e(ch({type:`number`,checks:[],...K(t)}))}function Lh(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...K(t)})}function Rh(e,t){return new e({type:`boolean`,...K(t)})}function zh(e,t){return new e({type:`null`,...K(t)})}function Bh(e){return new e({type:`unknown`})}function Vh(e,t){return new e({type:`never`,...K(t)})}function Hh(e,t){return new Bf({check:`less_than`,...K(t),value:e,inclusive:!1})}function Uh(e,t){return new Bf({check:`less_than`,...K(t),value:e,inclusive:!0})}function Wh(e,t){return new Vf({check:`greater_than`,...K(t),value:e,inclusive:!1})}function Gh(e,t){return new Vf({check:`greater_than`,...K(t),value:e,inclusive:!0})}function Kh(e){return Wh(0,e)}function qh(e){return Gh(0,e)}function Jh(e,t){return new Hf({check:`multiple_of`,...K(t),value:e})}function Yh(e,t){return new Wf({check:`max_length`,...K(t),maximum:e})}function Xh(e,t){return new Gf({check:`min_length`,...K(t),minimum:e})}function Zh(e,t){return new Kf({check:`length_equals`,...K(t),length:e})}function Qh(e,t){return new Jf({check:`string_format`,format:`regex`,...K(t),pattern:e})}function $h(e){return new Yf({check:`string_format`,format:`lowercase`,...K(e)})}function eg(e){return new Xf({check:`string_format`,format:`uppercase`,...K(e)})}function tg(e,t){return new Zf({check:`string_format`,format:`includes`,...K(t),includes:e})}function ng(e,t){return new Qf({check:`string_format`,format:`starts_with`,...K(t),prefix:e})}function rg(e,t){return new $f({check:`string_format`,format:`ends_with`,...K(t),suffix:e})}function ig(e,t){return new tp({check:`properties`,shape:e,...K(t)})}function ag(e){return new np({check:`overwrite`,tx:e})}function og(e){return ag(t=>t.normalize(e))}function sg(){return ag(e=>e.trim())}function cg(){return ag(e=>e.toLowerCase())}function lg(){return ag(e=>e.toUpperCase())}function ug(){return ag(e=>yu(e))}function dg(e,t,n){return new e({type:`array`,element:t,...K(n)})}function fg(e,t,n){let r=K(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function pg(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...K(n)})}function mg(e,t){let n=hg(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Qu(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Qu(r))}},e(t.value,t)),t);return n}function hg(e,t){let n=new Lf({check:`custom`,...K(t)});return n._zod.check=e,n}function gg(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&uu(e,t,n[t]);return e}function _g(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??sh,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function vg(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Z(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Z(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&gg(o.schema,c),t.io===`input`&&Og(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 yg(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function bg(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${yg(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+yg(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
55
55
 
56
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function pg(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;pg(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var mg=new Set([`type`,`properties`,`required`,`additionalProperties`]),hg=[`oneOf`,`anyOf`];function gg(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function _g(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!mg.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??gg(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}uu(n,r,e.length===1?e[0]:_g(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=gg(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function vg(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of mg)if(t in e)return;let n=t.filter(e=>hg.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=_g(t);else{let e=n[0],i=hg.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>_g([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,cg(e,r))}function yg(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)):cg(i,s),cg(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())pg(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])vg(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}cg(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,uu(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Sg(t,`input`,e.processors),output:Sg(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function bg(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 bg(r.element,n);if(r.type===`set`)return bg(r.valueType,n);if(r.type===`lazy`)return bg(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return bg(r.innerType,n);if(r.type===`intersection`)return bg(r.left,n)||bg(r.right,n);if(r.type===`record`||r.type===`map`)return bg(r.keyType,n)||bg(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:bg(r.in,n)||bg(r.out,n);if(r.type===`object`){for(let e in r.shape)if(bg(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(bg(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(bg(e,n))return!0;return!!(r.rest&&bg(r.rest,n))}return!1}var xg=(e,t={})=>n=>{let r=lg({...n,processors:t});return Z(e,r),fg(r,e),yg(r,e)},Sg=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=lg({...i??{},target:a,io:t,processors:n});return Z(e,o),fg(o,e),yg(o,e)},Cg=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},wg=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Tg=(e,t)=>{Cg(e,`minimum`,t),wg(e,`maximum`,t)},Eg=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Dg=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Og=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},kg=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Ag=(e,t)=>Cg(e,`minimum`,t.minimum),jg=(e,t)=>wg(e,`maximum`,t.maximum),Mg=e=>(t,n)=>{kg(t,n.format);let[r,i]=e[n.format];Cg(t,`minimum`,r),wg(t,`maximum`,i)},Ng={greater_than:(e,t)=>Cg(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>wg(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Eg(e,t.value),number_format:Mg(Au),bigint_format:Mg(ju),min_length:Ag,max_length:jg,length_equals:(e,t)=>Tg(e,t.length),min_size:Ag,max_size:jg,size_equals:(e,t)=>Tg(e,t.size),string_format:(e,t)=>{kg(e,t.format),t.pattern&&Dg(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Og(e,t.mime)};function Pg(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Ng[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Cg(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Cg(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&wg(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&wg(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Eg(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Og(t,i.mime);for(let e of i.patterns??[])Dg(t,e);return t}var Fg={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ig=new Map([[Np,mf],[Fp,hf]]),Lg=e=>Ig.get(e)??e,Rg=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Pg(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Fg[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Lg);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}))])}},zg=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Pg(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):ug(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Bg=(e,t,n,r)=>{n.type=`boolean`},Vg=(e,t,n,r)=>{ug(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},Hg=(e,t,n,r)=>{ug(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},Ug=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Wg=(e,t,n,r)=>{ug(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},Gg=(e,t,n,r)=>{ug(e,t,n,r,`Void cannot be represented in JSON Schema`)},Kg=(e,t,n,r)=>{n.not={}},qg=(e,t,n,r)=>{},Jg=(e,t,n,r)=>{},Yg=(e,t,n,r)=>{ug(e,t,n,r,`Date cannot be represented in JSON Schema`)},Xg=(e,t,n,r)=>{let i=e._zod.def,a=eu(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Zg=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(ug(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(ug(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Qg=(e,t,n,r)=>{ug(e,t,n,r,`NaN cannot be represented in JSON Schema`)},$g=(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},e_=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=Pg(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},t_=(e,t,n,r)=>{n.type=`boolean`},n_=(e,t,n,r)=>{ug(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},r_=(e,t,n,r)=>{ug(e,t,n,r,`Function types cannot be represented in JSON Schema`)},i_=(e,t,n,r)=>{ug(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},a_=(e,t,n,r)=>{ug(e,t,n,r,`Map cannot be represented in JSON Schema`)},o_=(e,t,n,r)=>{ug(e,t,n,r,`Set cannot be represented in JSON Schema`)},s_=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Pg(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Z(a.element,t,{...r,path:[...r.path,`items`]})};function c_(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?c_(t.out):t.type===`catch`?c_(t.innerType):e._zod.optin}var l_=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&ug(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)uu(i.properties,e,Z(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?c_(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Z(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},u_=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Z(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},d_=(e,t,n,r)=>{let i=e._zod.def,a=Z(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Z(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},f_=(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)=>Z(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Z(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?c_(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=Pg(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function p_(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=p_(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>p_(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Ef:Tf).source),p):p}var m_=new WeakMap;function h_(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of m_.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=p_(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var g_=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Pg(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Z(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)uu(i.patternProperties,Lg(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Z(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=m_.get(t);n||(n=[],m_.set(t,n),t.deferred.push(()=>h_(t))),n.push(e)}i.additionalProperties=Z(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&c_(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},__=(e,t,n,r)=>{let i=e._zod.def,a=Z(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`}]},v_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},y_=Symbol();function b_(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(ug(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),y_):JSON.parse(o)}var x_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=b_(i.defaultValue,e,t,n,r);o!==y_&&(n.default=o)},S_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=b_(i.defaultValue,e,t,n,r);o!==y_&&(n._prefault=o)},C_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{ug(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},w_=(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;Z(o,t,r);let s=t.seen.get(e);s.ref=o},T_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},E_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},D_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},O_=(e,t,n,r)=>{let i=e._zod.innerType;Z(i,t,r);let a=t.seen.get(e);a.ref=i},k_={string:Rg,number:zg,boolean:Bg,bigint:Vg,symbol:Hg,null:Ug,undefined:Wg,void:Gg,never:Kg,any:qg,unknown:Jg,date:Yg,enum:Xg,literal:Zg,nan:Qg,template_literal:$g,file:e_,success:t_,custom:n_,function:r_,transform:i_,map:a_,set:o_,array:s_,object:l_,union:u_,intersection:d_,tuple:f_,record:g_,nullable:__,nonoptional:v_,default:x_,prefault:S_,catch:C_,pipe:w_,readonly:T_,promise:E_,optional:D_,lazy:O_};function A_(e,t){if(`_idmap`in e){let n=e,r=lg({...t,processors:k_}),i={};for(let e of n._idmap.entries()){let[t,n]=e;Z(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;fg(r,n),uu(a,t,yg(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=lg({...t,processors:k_});return Z(e,n),fg(n,e),yg(n,e)}var j_=new WeakSet([Object.prototype,Error.prototype]);function M_(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var N_=J(`ZodError`,(e,t)=>{Td.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);j_.has(n)||(j_.add(n),M_(n,`format`,e=>t=>Od(e,t)),M_(n,`flatten`,e=>t=>Dd(e,t)),M_(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,nu,2)}),M_(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,nu,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),P_=Md(N_),F_=Nd(N_),I_=Pd(N_),L_=Id(N_),R_=Hd(N_),z_=Ud(N_),B_=Wd(N_),V_=Gd(N_),H_=Kd(N_),U_=qd(N_),W_=Jd(N_),G_=Yd(N_);function K_(){_d.localeError||vd(Zm())}function q_(){_d.memoizer||vd({memoizer:Jm()})}var Q=J(`ZodType`,(e,t)=>(K_(),Y.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(_u(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 Du(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Sy(e,t))},superRefine(e,t){return this.check(Cy(e,t))},overwrite(e){return this.check(Zh(e))},optional(){return ey(this)},exactOptional(){return ny(this)},nullable(){return iy(this)},nullish(){return ey(iy(this))},nonoptional(e){return uy(this,e)},array(){return Pv(this)},or(e){return Bv([this,e])},and(e){return Wv(this,e)},transform(e){return my(this,Qv(e))},default(e){return oy(this,e)},prefault(e){return cy(this,e)},catch(e){return fy(this,e)},pipe(e){return my(this,e)},readonly(){return _y(this)},describe(e){let t=this.clone();return th.add(t,{description:e}),t},meta(...e){if(e.length===0)return th.get(this);let t=this.clone();return th.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return td(this,`~standard`,{...tp(this),jsonSchema:{input:Sg(this,`input`),output:Sg(this,`output`)}})},set"~standard"(e){ed(this,`~standard`,e)},parse:function e(t,n){return P_(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await F_(this,t,n,{callee:e})},safeParse(e,t){return I_(this,e,t)},async safeParseAsync(e,t){return L_(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ed(this,`spa`,e)},validate(e,t){return zd(this,e,t)},validateAsync(e,t){return Vd(this,e,t)},encode:function e(t,n){return R_(this,t,n,{callee:e})},decode:function e(t,n){return z_(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await B_(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await V_(this,t,n,{callee:e})},safeEncode(e,t){return H_(this,e,t)},safeDecode(e,t){return U_(this,e,t)},async safeEncodeAsync(e,t){return W_(this,e,t)},async safeDecodeAsync(e,t){return G_(this,e,t)},toJSONSchema(e){return xg(this,{})(e)},get description(){return th.get(this)?.description},get _def(){return this._zod.def}}),J_=J(`_ZodString`,(e,t)=>{np.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rg(e,t,n,r)},nd({format:e=>Pg(e).format??null,minLength:e=>Pg(e).minimum??null,maxLength:e=>Pg(e).maximum??null},{regex(...e){return this.check(Wh(...e))},includes(...e){return this.check(qh(...e))},startsWith(...e){return this.check(Jh(...e))},endsWith(...e){return this.check(Yh(...e))},min(...e){return this.check(Hh(...e))},max(...e){return this.check(Vh(...e))},length(...e){return this.check(Uh(...e))},nonempty(...e){return this.check(Hh(1,...e))},lowercase(e){return this.check(Gh(e))},uppercase(e){return this.check(Kh(e))},trim(){return this.check($h())},normalize(...e){return this.check(Qh(...e))},toLowerCase(){return this.check(eg())},toUpperCase(){return this.check(tg())},slugify(){return this.check(ng())}})),Y_=J(`ZodString`,(e,t)=>{np.init(e,t),J_.init(e,t)},{email(e){return this.check(ih(tv,e))},url(e){return this.check(uh(iv,e))},jwt(e){return this.check(Th(bv,e))},emoji(e){return this.check(dh(ov,e))},guid(e){return this.check(ah(nv,e))},uuid(e){return this.check(oh(rv,e))},uuidv4(e){return this.check(sh(rv,e))},uuidv6(e){return this.check(ch(rv,e))},uuidv7(e){return this.check(lh(rv,e))},nanoid(e){return this.check(fh(sv,e))},cuid(e){return this.check(ph(cv,e))},cuid2(e){return this.check(mh(lv,e))},ulid(e){return this.check(hh(uv,e))},base64(e){return this.check(Sh(_v,e))},base64url(e){return this.check(Ch(vv,e))},xid(e){return this.check(gh(dv,e))},ksuid(e){return this.check(_h(fv,e))},ipv4(e){return this.check(vh(pv,e))},ipv6(e){return this.check(yh(mv,e))},cidrv4(e){return this.check(bh(hv,e))},cidrv6(e){return this.check(xh(gv,e))},e164(e){return this.check(wh(yv,e))},datetime(e){return this.check(Eh(Z_,e))},date(e){return this.check(Dh(Q_,e))},time(e){return this.check(Oh($_,e))},duration(e){return this.check(kh(ev,e))}});function X_(e){return rh(Y_,e)}var $=J(`ZodStringFormat`,(e,t)=>{X.init(e,t),J_.init(e,t)}),Z_=J(`ZodISODateTime`,(e,t)=>{xp.init(e,t),$.init(e,t)}),Q_=J(`ZodISODate`,(e,t)=>{Sp.init(e,t),$.init(e,t)}),$_=J(`ZodISOTime`,(e,t)=>{Cp.init(e,t),$.init(e,t)}),ev=J(`ZodISODuration`,(e,t)=>{wp.init(e,t),$.init(e,t)}),tv=J(`ZodEmail`,(e,t)=>{ap.init(e,t),$.init(e,t)}),nv=J(`ZodGUID`,(e,t)=>{rp.init(e,t),$.init(e,t)}),rv=J(`ZodUUID`,(e,t)=>{ip.init(e,t),$.init(e,t)}),iv=J(`ZodURL`,(e,t)=>{pp.init(e,t),$.init(e,t)});function av(e){return uh(iv,e)}var ov=J(`ZodEmoji`,(e,t)=>{mp.init(e,t),$.init(e,t)}),sv=J(`ZodNanoID`,(e,t)=>{hp.init(e,t),$.init(e,t)}),cv=J(`ZodCUID`,(e,t)=>{gp.init(e,t),$.init(e,t)}),lv=J(`ZodCUID2`,(e,t)=>{_p.init(e,t),$.init(e,t)}),uv=J(`ZodULID`,(e,t)=>{vp.init(e,t),$.init(e,t)}),dv=J(`ZodXID`,(e,t)=>{yp.init(e,t),$.init(e,t)}),fv=J(`ZodKSUID`,(e,t)=>{bp.init(e,t),$.init(e,t)}),pv=J(`ZodIPv4`,(e,t)=>{Tp.init(e,t),$.init(e,t)}),mv=J(`ZodIPv6`,(e,t)=>{Op.init(e,t),$.init(e,t)}),hv=J(`ZodCIDRv4`,(e,t)=>{kp.init(e,t),$.init(e,t)}),gv=J(`ZodCIDRv6`,(e,t)=>{jp.init(e,t),$.init(e,t)}),_v=J(`ZodBase64`,(e,t)=>{Pp.init(e,t),$.init(e,t)}),vv=J(`ZodBase64URL`,(e,t)=>{Lp.init(e,t),$.init(e,t)}),yv=J(`ZodE164`,(e,t)=>{Rp.init(e,t),$.init(e,t)}),bv=J(`ZodJWT`,(e,t)=>{Bp.init(e,t),$.init(e,t)}),xv=J(`ZodNumber`,(e,t)=>{Vp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zg(e,t,n,r),e.isFinite=!0},nd({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Pg(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Pg(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Pg(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Pg(e).format??null},{gt(e,t){return this.check(Rh(e,t))},gte(e,t){return this.check(zh(e,t))},min(e,t){return this.check(zh(e,t))},lt(e,t){return this.check(Ih(e,t))},lte(e,t){return this.check(Lh(e,t))},max(e,t){return this.check(Lh(e,t))},int(e){return this.check(wv(e))},safe(e){return this.check(wv(e))},positive(e){return this.check(Rh(0,e))},nonnegative(e){return this.check(zh(0,e))},negative(e){return this.check(Ih(0,e))},nonpositive(e){return this.check(Lh(0,e))},multipleOf(e,t){return this.check(Bh(e,t))},step(e,t){return this.check(Bh(e,t))},finite(){return this}}));function Sv(e){return Ah(xv,e)}var Cv=J(`ZodNumberFormat`,(e,t)=>{Hp.init(e,t),xv.init(e,t)});function wv(e){return jh(Cv,e)}var Tv=J(`ZodBoolean`,(e,t)=>{Up.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bg(e,t,n,r)});function Ev(e){return Mh(Tv,e)}var Dv=J(`ZodNull`,(e,t)=>{Wp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ug(e,t,n,r)});function Ov(e){return Nh(Dv,e)}var kv=J(`ZodUnknown`,(e,t)=>{Gp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Av(){return Ph(kv)}var jv=J(`ZodNever`,(e,t)=>{Kp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kg(e,t,n,r)});function Mv(e){return Fh(jv,e)}var Nv=J(`ZodArray`,(e,t)=>{q_(),Xp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>s_(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Hh(e,t))},nonempty(e){return this.check(Hh(1,e))},max(e,t){return this.check(Vh(e,t))},length(e,t){return this.check(Uh(e,t))},unwrap(){return this.element}});function Pv(e,t){return rg(Nv,e,t)}var Fv=J(`ZodObject`,(e,t)=>{q_(),nm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>l_(e,t,n,r),cd(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Jv(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_u(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_u(this._zod.def,{catchall:Av()}))},loose(){return this.clone(_u(this._zod.def,{catchall:Av()}))},strict(){return this.clone(_u(this._zod.def,{catchall:Mv()}))},strip(){return this.clone(_u(this._zod.def,{catchall:void 0}))},extend(e){return Fu(this,e)},safeExtend(e){return Lu(this,e)},merge(e){return Ru(this,e)},pick(e){return Mu(this,e)},omit(e){return Pu(this,e)},partial(...e){return zu($v,this,e[0])},exactPartial(...e){return zu(ty,this,e[0],`exactPartial`)},required(...e){return Bu(ly,this,e[0])}});function Iv(e,t){return new Fv({type:`object`,shape:e??{},...K(t)})}function Lv(e,t){return new Fv({type:`object`,shape:e,catchall:Mv(),...K(t)})}function Rv(e,t){return new Fv({type:`object`,shape:e,catchall:Av(),...K(t)})}var zv=J(`ZodUnion`,(e,t)=>{im.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>u_(e,t,n,r),e.options=t.options});function Bv(e,t){return new zv({type:`union`,options:e,...K(t)})}var Vv=J(`ZodDiscriminatedUnion`,(e,t)=>{zv.init(e,t),om.init(e,t)});function Hv(e,t,n){return new Vv({type:`union`,options:t,discriminator:e,...K(n)})}var Uv=J(`ZodIntersection`,(e,t)=>{sm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>d_(e,t,n,r)});function Wv(e,t){return new Uv({type:`intersection`,left:e,right:t})}var Gv=J(`ZodRecord`,(e,t)=>{q_(),um.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>g_(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Kv(e,t,n){return!t||!t._zod?new Gv({type:`record`,keyType:X_(),valueType:e,...K(t)}):new Gv({type:`record`,keyType:e,valueType:t,...K(n)})}var qv=J(`ZodEnum`,(e,t)=>{dm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xg(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new qv({...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 qv({...t,checks:[],...K(r),entries:i})}});function Jv(e,t){return new qv({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...K(t)})}var Yv=J(`ZodLiteral`,(e,t)=>{fm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zg(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 Xv(e,t){return new Yv({type:`literal`,values:Array.isArray(e)?e:[e],...K(t)})}var Zv=J(`ZodTransform`,(e,t)=>{q_(),pm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>i_(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new gd(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Qu(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Qu(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Qv(e){return new Zv({type:`transform`,transform:e})}var $v=J(`ZodOptional`,(e,t)=>{hm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>D_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ey(e){return new $v({type:`optional`,innerType:e})}var ty=J(`ZodExactOptional`,(e,t)=>{gm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>D_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ny(e){return new ty({type:`optional`,innerType:e})}var ry=J(`ZodNullable`,(e,t)=>{_m.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>__(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function iy(e){return new ry({type:`nullable`,innerType:e})}var ay=J(`ZodDefault`,(e,t)=>{vm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>x_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function oy(e,t){return new ay({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():wu(t)}})}var sy=J(`ZodPrefault`,(e,t)=>{bm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>S_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cy(e,t){return new sy({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():wu(t)}})}var ly=J(`ZodNonOptional`,(e,t)=>{xm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>v_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uy(e,t){return new ly({type:`nonoptional`,innerType:e,...K(t)})}var dy=J(`ZodCatch`,(e,t)=>{wm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>C_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function fy(e,t){return new dy({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ud(t)})}var py=J(`ZodPipe`,(e,t)=>{Tm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>w_(e,t,n,r),e.in=t.in,e.out=t.out});function my(e,t){return new py({type:`pipe`,in:e,out:t})}var hy=J(`ZodPreprocess`,(e,t)=>{py.init(e,t),Dm.init(e,t)}),gy=J(`ZodReadonly`,(e,t)=>{Om.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>T_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _y(e){return new gy({type:`readonly`,innerType:e})}var vy=J(`ZodLazy`,(e,t)=>{Am.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>O_(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function yy(e){return new vy({type:`lazy`,getter:e})}var by=J(`ZodCustom`,(e,t)=>{jm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>n_(e,t,n,r)});function xy(e,t){return ig(by,e??(()=>!0),t)}function Sy(e,t={}){return ag(by,e,t)}function Cy(e,t){return og(e,t)}var wy=J(`ZodInstanceOf`,(e,t)=>{by.init(e,t)},{properties(e,t){return this.check(Xh(e,t))}});function Ty(e,t={}){let n=new wy({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 Ey(e,t){return new hy({type:`pipe`,in:Qv(e),out:t})}function Dy(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 Oy=(0,V.createContext)(null),ky=(0,V.createContext)([]);function Ay({href:e,onEvent:t,history:n=[],children:r}){let[i,a]=(0,V.useState)(new Map),o=(0,V.useEffectEvent)(t);return(0,V.useEffect)(()=>{if(!e)return;let t=new EventSource(e),n=e=>{let t=Ly(e.data);t&&(t.type===`ready`?a(new Map):Fy(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,H.jsx)(Oy,{value:i,children:(0,H.jsx)(ky,{value:n,children:r})})}function jy(e,t){let n=(0,V.use)(Oy);if(!n)throw Error(`useConversationStatus must be used inside <RuntimeEventsProvider>.`);return n.get(e)?.status??t}var My={pending:`Pending`,queued:`Queued`,running:`Running`,waitingOnApproval:`Waiting on approval`,waitingOnUserInput:`Waiting on user input`,completed:`Completed`,failed:`Failed`,interrupted:`Interrupted`},Ny={spawn:`Spawned`,message:`Message sent`,followup:`Follow-up sent`,interrupt:`Interrupt accepted`,completion:`Turn finished`};function Py({treeId:e,snapshot:t=[]}){let n=(0,V.use)(Oy),r=(0,V.use)(ky).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,H.jsxs)(`section`,{"aria-label":`Child agents`,className:`border-t px-6 py-3`,children:[(0,H.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:`Child agents`}),(0,H.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,H.jsxs)(`li`,{className:`flex items-center justify-between gap-4 text-sm`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`truncate font-mono text-xs`,children:e.path}),t&&(0,H.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[Ny[t.type],` · `,t.actorPath,` →`,` `,t.targetPath]})]}),(0,H.jsx)(Jy,{status:My[e.state]})]},e.chatId)})})]})}function Fy(e){return e.type===`change`&&e.resource===`conversation`&&Ry(e.status)&&(e.child===void 0||By(e.child)&&e.child.chatId===e.id)}function Iy(e){return zy(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`&&Ry(e.status)&&(e.children===void 0||Array.isArray(e.children)&&e.children.every(By))}function Ly(e){let t;try{t=JSON.parse(e)}catch{return}if(!(!zy(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`&&(!Ry(t.status)||t.child!==void 0&&(!By(t.child)||t.child.chatId!==t.id))))return{...t,type:`change`,resource:t.resource,id:t.id}}}function Ry(e){return!zy(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 zy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function By(e){return!zy(e)||!zy(e.activities)||![`chatId`,`treeId`,`path`,`parentChatId`,`declarationName`].every(t=>typeof e[t]==`string`)||typeof e.state!=`string`||!Object.hasOwn(My,e.state)?!1:Object.entries(e.activities).every(([e,t])=>Object.hasOwn(Ny,e)&&zy(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 Vy=(0,V.createContext)(null);function Hy(){let e=(0,V.use)(Vy);if(!e)throw Error(`History.* parts must be rendered inside <History.Root>.`);return e}function Uy({activeChatId:e,onSelect:t,className:n,children:r}){let i=(0,V.useMemo)(()=>({activeChatId:e,onSelect:t}),[e,t]);return(0,H.jsx)(Vy.Provider,{value:i,children:(0,H.jsx)(`div`,{className:U(`flex min-h-0 flex-col gap-1`,n),children:r})})}function Wy({className:e,children:t}){return(0,H.jsx)(`div`,{className:U(`group/history-item relative`,e),children:t})}function Gy({history:e,className:t,children:n}){let{activeChatId:r,onSelect:i}=Hy(),a=r===e.chatId;return(0,H.jsx)(`button`,{type:`button`,"aria-current":a?`true`:void 0,onClick:()=>i(e),className:U(`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 Ky({className:e,children:t}){return(0,H.jsx)(`div`,{className:U(`text-muted-foreground px-2 py-4 text-sm`,e),children:t})}function qy({chatId:e,status:t}){let n=`size-3.5 shrink-0`;switch(Dy(jy(e,t))){case`active`:return(0,H.jsx)(Wt,{"aria-label":`Active`,className:n});case`error`:return(0,H.jsx)(Kt,{"aria-label":`Error`,className:U(n,`text-destructive`)});case`idle`:return(0,H.jsx)(nn,{"aria-label":`idle`,className:n});case`approval`:return(0,H.jsx)(Jt,{"aria-label":`Waiting on approval`,className:n});case`input`:return(0,H.jsx)(en,{"aria-label":`Waiting on user input`,className:n})}}function Jy({status:e}){return(0,H.jsx)(`span`,{className:U(`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 Yy=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function Xy(e){return Yy.format(new Date(e))}var Zy={Root:Uy,Item:Wy,ItemTrigger:Gy,Empty:Ky},Qy=Iv({href:X_()}),$y=Iv({capabilities:Iv({chat:Qy,history:Qy,events:Qy,traces:Qy.optional(),schedules:Qy.optional(),uploads:Qy.extend({mediaTypes:Pv(X_()).optional()}).optional()})}),eb=new ye({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1}}});async function tb(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 eb.fetchQuery({queryKey:[`runtime`,`discovery`,t],queryFn:async()=>$y.parse(await nb(t,e)),staleTime:1/0});n=r;let i=await eb.fetchQuery({queryKey:[`runtime`,`history`,r.capabilities.history.href],queryFn:async()=>rb(await nb(r.capabilities.history.href,e))});return{discovery:n,history:i,historyError:!1}}catch{return{discovery:n,history:[],historyError:!0}}}async function nb(e,t){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`Request failed: ${n.status}`);return n.json()}function rb(e){if(!Array.isArray(e)||!e.every(Iy))throw Error(`History response is not a list of conversations`);return e}export{ml as $,Vr as $n,Te as $r,ba as $t,Bv as A,pi as An,jn as Ar,Ga as At,Jl as B,$r as Bn,sn as Br,Ta as Bt,Mv as C,Oi as Cn,hr as Cr,eo as Ct,Kv as D,Si as Dn,Gn as Dr,Ja as Dt,Ey as E,Ci as En,ir as Er,Xa as Et,Ad as F,mi as Fn,vn as Fr,Pa as Ft,jl as G,ti as Gn,Ht as Gr,fa as Gt,Kl as H,fi as Hn,Qt as Hr,Ea as Ht,Sl as I,_i as In,W as Ir,Ia as It,Ml as J,di as Jn,It as Jr,ha as Jt,ql as K,ri as Kn,Bt as Kr,pa as Kt,Cl as L,hi as Ln,mn as Lr,ja as Lt,av as M,Zr as Mn,Sn as Mr,Va as Mt,L_ as N,vi as Nn,yn as Nr,Ba as Nt,Lv as O,yi as On,Un as Or,qa as Ot,A_ as P,Yr as Pn,_n as Pr,za as Pt,dl as Q,Hr as Qn,we as Qr,ya as Qt,Yl as R,Xr as Rn,dn as Rr,Aa as Rt,Rv as S,Ai as Sn,gr as Sr,to as St,Iv as T,Ei as Tn,cr as Tr,Qa as Tt,kl as U,Qr as Un,Xt as Ur,Ca as Ut,El as V,ei as Vn,an as Vr,Da as Vt,Al as W,ni as Wn,Kt as Wr,da as Wt,ol as X,Wr as Xn,Mt as Xr,_a as Xt,fl as Y,qr as Yn,Pt as Yr,ma as Yt,sl as Z,Ur as Zn,U as Zr,ga as Zt,xy as _,s as _i,Hi as _n,xr as _r,oo as _t,Zy as a,re as ai,ta as an,Nr as ar,fs as at,yy as b,Li as bn,_r as br,po as bt,Dy as c,f as ci,ra as cn,Pr as cr,Wo as ct,jy as d,g as di,Gi as dn,Or as dr,Go as dt,xe as ei,la as en,zr as er,pl as et,Jv as f,T as fi,qi as fn,yr as fr,To as ft,Ev as g,l as gi,Ui as gn,Sr as gr,Yo as gt,Pv as h,h as hi,Wi as hn,Mr as hr,rs as ht,Py as i,P as ii,$i as in,Tr as ir,Gs as it,Av as j,ui as jn,An as jr,Ua as jt,X_ as k,bi as kn,Rn as kr,Ka as kt,Xy as l,A as li,Xi as ln,wr as lr,ms as lt,Ov as m,ne as mi,Ji as mn,Ar as mr,us as mt,eb as n,de as ni,na as nn,Ir as nr,ul as nt,Ay as o,x as oi,aa as on,Dr as or,ds as ot,Ty as p,M as pi,Ki as pn,Cr as pr,_s as pt,Gl as q,ii as qn,Rt as qr,ua as qt,qy as r,I as ri,ea as rn,jr as rr,ll as rt,Jy as s,m as si,Qi as sn,Er as sr,So as st,tb as t,he as ti,sa as tn,Br as tr,hl as tt,Fy as u,_ as ui,Zi as un,kr as ur,as as ut,Hv as v,o as vi,zi as vn,br as vr,fo as vt,Sv as w,ki as wn,dr as wr,$a as wt,Xv as x,Ni as xn,vr as xr,so as xt,wv as y,Ri as yn,Fr as yr,G as yt,wl as z,li as zn,cn as zr,Oa as zt};
56
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function xg(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;xg(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Sg=new Set([`type`,`properties`,`required`,`additionalProperties`]),Cg=[`oneOf`,`anyOf`];function wg(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Tg(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Sg.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??wg(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}uu(n,r,e.length===1?e[0]:Tg(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=wg(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Eg(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Sg)if(t in e)return;let n=t.filter(e=>Cg.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Tg(t);else{let e=n[0],i=Cg.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Tg([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,gg(e,r))}function Dg(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)):gg(i,s),gg(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())xg(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Eg(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}gg(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,uu(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ag(t,`input`,e.processors),output:Ag(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Og(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 Og(r.element,n);if(r.type===`set`)return Og(r.valueType,n);if(r.type===`lazy`)return Og(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Og(r.innerType,n);if(r.type===`intersection`)return Og(r.left,n)||Og(r.right,n);if(r.type===`record`||r.type===`map`)return Og(r.keyType,n)||Og(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Og(r.in,n)||Og(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Og(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Og(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Og(e,n))return!0;return!!(r.rest&&Og(r.rest,n))}return!1}var kg=(e,t={})=>n=>{let r=_g({...n,processors:t});return Z(e,r),bg(r,e),Dg(r,e)},Ag=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=_g({...i??{},target:a,io:t,processors:n});return Z(e,o),bg(o,e),Dg(o,e)},jg=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Mg=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ng=(e,t)=>{jg(e,`minimum`,t),Mg(e,`maximum`,t)},Pg=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Fg=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Ig=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Lg=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Rg=(e,t)=>jg(e,`minimum`,t.minimum),zg=(e,t)=>Mg(e,`maximum`,t.maximum),Bg=e=>(t,n)=>{Lg(t,n.format);let[r,i]=e[n.format];jg(t,`minimum`,r),Mg(t,`maximum`,i)},Vg={greater_than:(e,t)=>jg(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Mg(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Pg(e,t.value),number_format:Bg(Au),bigint_format:Bg(ju),min_length:Rg,max_length:zg,length_equals:(e,t)=>Ng(e,t.length),min_size:Rg,max_size:zg,size_equals:(e,t)=>Ng(e,t.size),string_format:(e,t)=>{Lg(e,t.format),t.pattern&&Fg(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Ig(e,t.mime)};function Hg(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Vg[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&jg(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&jg(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Mg(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Mg(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Pg(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Ig(t,i.mime);for(let e of i.patterns??[])Fg(t,e);return t}var Ug={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Wg=new Map([[zp,bf],[Vp,xf]]),Gg=e=>Wg.get(e)??e,Kg=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Hg(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ug[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Gg);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}))])}},qg=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Hg(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):vg(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Jg=(e,t,n,r)=>{n.type=`boolean`},Yg=(e,t,n,r)=>{vg(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},Xg=(e,t,n,r)=>{vg(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},Zg=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Qg=(e,t,n,r)=>{vg(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},$g=(e,t,n,r)=>{vg(e,t,n,r,`Void cannot be represented in JSON Schema`)},e_=(e,t,n,r)=>{n.not={}},t_=(e,t,n,r)=>{},n_=(e,t,n,r)=>{},r_=(e,t,n,r)=>{vg(e,t,n,r,`Date cannot be represented in JSON Schema`)},i_=(e,t,n,r)=>{let i=e._zod.def,a=eu(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},a_=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(vg(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(vg(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},o_=(e,t,n,r)=>{vg(e,t,n,r,`NaN cannot be represented in JSON Schema`)},s_=(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},c_=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=Hg(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},l_=(e,t,n,r)=>{n.type=`boolean`},u_=(e,t,n,r)=>{vg(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},d_=(e,t,n,r)=>{vg(e,t,n,r,`Function types cannot be represented in JSON Schema`)},f_=(e,t,n,r)=>{vg(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},p_=(e,t,n,r)=>{vg(e,t,n,r,`Map cannot be represented in JSON Schema`)},m_=(e,t,n,r)=>{vg(e,t,n,r,`Set cannot be represented in JSON Schema`)},h_=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Hg(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Z(a.element,t,{...r,path:[...r.path,`items`]})};function g_(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?g_(t.out):t.type===`catch`?g_(t.innerType):e._zod.optin}var __=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&vg(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)uu(i.properties,e,Z(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?g_(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Z(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},v_=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Z(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},y_=(e,t,n,r)=>{let i=e._zod.def,a=Z(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Z(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},b_=(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)=>Z(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Z(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?g_(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=Hg(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function x_(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=x_(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>x_(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Mf:jf).source),p):p}var S_=new WeakMap;function C_(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of S_.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=x_(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var w_=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Hg(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Z(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)uu(i.patternProperties,Gg(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Z(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=S_.get(t);n||(n=[],S_.set(t,n),t.deferred.push(()=>C_(t))),n.push(e)}i.additionalProperties=Z(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&g_(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},T_=(e,t,n,r)=>{let i=e._zod.def,a=Z(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`}]},E_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},D_=Symbol();function O_(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(vg(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),D_):JSON.parse(o)}var k_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=O_(i.defaultValue,e,t,n,r);o!==D_&&(n.default=o)},A_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=O_(i.defaultValue,e,t,n,r);o!==D_&&(n._prefault=o)},j_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{vg(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},M_=(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;Z(o,t,r);let s=t.seen.get(e);s.ref=o},N_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},P_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},F_=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},I_=(e,t,n,r)=>{let i=e._zod.innerType;Z(i,t,r);let a=t.seen.get(e);a.ref=i},L_={string:Kg,number:qg,boolean:Jg,bigint:Yg,symbol:Xg,null:Zg,undefined:Qg,void:$g,never:e_,any:t_,unknown:n_,date:r_,enum:i_,literal:a_,nan:o_,template_literal:s_,file:c_,success:l_,custom:u_,function:d_,transform:f_,map:p_,set:m_,array:h_,object:__,union:v_,intersection:y_,tuple:b_,record:w_,nullable:T_,nonoptional:E_,default:k_,prefault:A_,catch:j_,pipe:M_,readonly:N_,promise:P_,optional:F_,lazy:I_};function R_(e,t){if(`_idmap`in e){let n=e,r=_g({...t,processors:L_}),i={};for(let e of n._idmap.entries()){let[t,n]=e;Z(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;bg(r,n),uu(a,t,Dg(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=_g({...t,processors:L_});return Z(e,n),bg(n,e),Dg(n,e)}var z_=new WeakSet([Object.prototype,Error.prototype]);function B_(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var V_=J(`ZodError`,(e,t)=>{Ed.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);z_.has(n)||(z_.add(n),B_(n,`format`,e=>t=>Ad(e,t)),B_(n,`flatten`,e=>t=>kd(e,t)),B_(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,nu,2)}),B_(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,nu,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),H_=Pd(V_),U_=Id(V_),W_=Rd(V_),G_=Vd(V_),K_=Jd(V_),q_=Yd(V_),J_=Xd(V_),Y_=Zd(V_),X_=Qd(V_),Z_=$d(V_),Q_=ef(V_),$_=tf(V_);function ev(){vd.localeError||yd(rh())}function tv(){vd.memoizer||yd({memoizer:eh()})}var Q=J(`ZodType`,(e,t)=>(ev(),Y.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(_u(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 Du(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ay(e,t))},superRefine(e,t){return this.check(jy(e,t))},overwrite(e){return this.check(ag(e))},optional(){return cy(this)},exactOptional(){return uy(this)},nullable(){return fy(this)},nullish(){return cy(fy(this))},nonoptional(e){return vy(this,e)},array(){return Hv(this)},or(e){return Jv([this,e])},and(e){return Qv(this,e)},transform(e){return Sy(this,oy(e))},default(e){return my(this,e)},prefault(e){return gy(this,e)},catch(e){return by(this,e)},pipe(e){return Sy(this,e)},readonly(){return Ty(this)},describe(e){let t=this.clone();return sh.add(t,{description:e}),t},meta(...e){if(e.length===0)return sh.get(this);let t=this.clone();return sh.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return td(this,`~standard`,{...sp(this),jsonSchema:{input:Ag(this,`input`),output:Ag(this,`output`)}})},set"~standard"(e){ed(this,`~standard`,e)},parse:function e(t,n){return H_(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await U_(this,t,n,{callee:e})},safeParse(e,t){return W_(this,e,t)},async safeParseAsync(e,t){return G_(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ed(this,`spa`,e)},validate(e,t){return Gd(this,e,t)},validateAsync(e,t){return qd(this,e,t)},encode:function e(t,n){return K_(this,t,n,{callee:e})},decode:function e(t,n){return q_(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await J_(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Y_(this,t,n,{callee:e})},safeEncode(e,t){return X_(this,e,t)},safeDecode(e,t){return Z_(this,e,t)},async safeEncodeAsync(e,t){return Q_(this,e,t)},async safeDecodeAsync(e,t){return $_(this,e,t)},toJSONSchema(e){return kg(this,{})(e)},get description(){return sh.get(this)?.description},get _def(){return this._zod.def}}),nv=J(`_ZodString`,(e,t)=>{cp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kg(e,t,n,r)},nd({format:e=>Hg(e).format??null,minLength:e=>Hg(e).minimum??null,maxLength:e=>Hg(e).maximum??null},{regex(...e){return this.check(Qh(...e))},includes(...e){return this.check(tg(...e))},startsWith(...e){return this.check(ng(...e))},endsWith(...e){return this.check(rg(...e))},min(...e){return this.check(Xh(...e))},max(...e){return this.check(Yh(...e))},length(...e){return this.check(Zh(...e))},nonempty(...e){return this.check(Xh(1,...e))},lowercase(e){return this.check($h(e))},uppercase(e){return this.check(eg(e))},trim(){return this.check(sg())},normalize(...e){return this.check(og(...e))},toLowerCase(){return this.check(cg())},toUpperCase(){return this.check(lg())},slugify(){return this.check(ug())}})),rv=J(`ZodString`,(e,t)=>{cp.init(e,t),nv.init(e,t)},{email(e){return this.check(uh(lv,e))},url(e){return this.check(gh(fv,e))},jwt(e){return this.check(jh(Ov,e))},emoji(e){return this.check(_h(mv,e))},guid(e){return this.check(dh(uv,e))},uuid(e){return this.check(fh(dv,e))},uuidv4(e){return this.check(ph(dv,e))},uuidv6(e){return this.check(mh(dv,e))},uuidv7(e){return this.check(hh(dv,e))},nanoid(e){return this.check(vh(hv,e))},cuid(e){return this.check(yh(gv,e))},cuid2(e){return this.check(bh(_v,e))},ulid(e){return this.check(xh(vv,e))},base64(e){return this.check(Oh(Tv,e))},base64url(e){return this.check(kh(Ev,e))},xid(e){return this.check(Sh(yv,e))},ksuid(e){return this.check(Ch(bv,e))},ipv4(e){return this.check(wh(xv,e))},ipv6(e){return this.check(Th(Sv,e))},cidrv4(e){return this.check(Eh(Cv,e))},cidrv6(e){return this.check(Dh(wv,e))},e164(e){return this.check(Ah(Dv,e))},datetime(e){return this.check(Mh(av,e))},date(e){return this.check(Nh(ov,e))},time(e){return this.check(Ph(sv,e))},duration(e){return this.check(Fh(cv,e))}});function iv(e){return lh(rv,e)}var $=J(`ZodStringFormat`,(e,t)=>{X.init(e,t),nv.init(e,t)}),av=J(`ZodISODateTime`,(e,t)=>{Dp.init(e,t),$.init(e,t)}),ov=J(`ZodISODate`,(e,t)=>{Op.init(e,t),$.init(e,t)}),sv=J(`ZodISOTime`,(e,t)=>{kp.init(e,t),$.init(e,t)}),cv=J(`ZodISODuration`,(e,t)=>{Ap.init(e,t),$.init(e,t)}),lv=J(`ZodEmail`,(e,t)=>{dp.init(e,t),$.init(e,t)}),uv=J(`ZodGUID`,(e,t)=>{lp.init(e,t),$.init(e,t)}),dv=J(`ZodUUID`,(e,t)=>{up.init(e,t),$.init(e,t)}),fv=J(`ZodURL`,(e,t)=>{yp.init(e,t),$.init(e,t)});function pv(e){return gh(fv,e)}var mv=J(`ZodEmoji`,(e,t)=>{bp.init(e,t),$.init(e,t)}),hv=J(`ZodNanoID`,(e,t)=>{xp.init(e,t),$.init(e,t)}),gv=J(`ZodCUID`,(e,t)=>{Sp.init(e,t),$.init(e,t)}),_v=J(`ZodCUID2`,(e,t)=>{Cp.init(e,t),$.init(e,t)}),vv=J(`ZodULID`,(e,t)=>{wp.init(e,t),$.init(e,t)}),yv=J(`ZodXID`,(e,t)=>{Tp.init(e,t),$.init(e,t)}),bv=J(`ZodKSUID`,(e,t)=>{Ep.init(e,t),$.init(e,t)}),xv=J(`ZodIPv4`,(e,t)=>{jp.init(e,t),$.init(e,t)}),Sv=J(`ZodIPv6`,(e,t)=>{Pp.init(e,t),$.init(e,t)}),Cv=J(`ZodCIDRv4`,(e,t)=>{Fp.init(e,t),$.init(e,t)}),wv=J(`ZodCIDRv6`,(e,t)=>{Lp.init(e,t),$.init(e,t)}),Tv=J(`ZodBase64`,(e,t)=>{Bp.init(e,t),$.init(e,t)}),Ev=J(`ZodBase64URL`,(e,t)=>{Up.init(e,t),$.init(e,t)}),Dv=J(`ZodE164`,(e,t)=>{Wp.init(e,t),$.init(e,t)}),Ov=J(`ZodJWT`,(e,t)=>{Kp.init(e,t),$.init(e,t)}),kv=J(`ZodNumber`,(e,t)=>{qp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qg(e,t,n,r),e.isFinite=!0},nd({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Hg(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Hg(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Hg(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Hg(e).format??null},{gt(e,t){return this.check(Wh(e,t))},gte(e,t){return this.check(Gh(e,t))},min(e,t){return this.check(Gh(e,t))},lt(e,t){return this.check(Hh(e,t))},lte(e,t){return this.check(Uh(e,t))},max(e,t){return this.check(Uh(e,t))},int(e){return this.check(Mv(e))},safe(e){return this.check(Mv(e))},positive(e){return this.check(Wh(0,e))},nonnegative(e){return this.check(Gh(0,e))},negative(e){return this.check(Hh(0,e))},nonpositive(e){return this.check(Uh(0,e))},multipleOf(e,t){return this.check(Jh(e,t))},step(e,t){return this.check(Jh(e,t))},finite(){return this}}));function Av(e){return Ih(kv,e)}var jv=J(`ZodNumberFormat`,(e,t)=>{Jp.init(e,t),kv.init(e,t)});function Mv(e){return Lh(jv,e)}var Nv=J(`ZodBoolean`,(e,t)=>{Yp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jg(e,t,n,r)});function Pv(e){return Rh(Nv,e)}var Fv=J(`ZodNull`,(e,t)=>{Xp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zg(e,t,n,r)});function Iv(e){return zh(Fv,e)}var Lv=J(`ZodUnknown`,(e,t)=>{Zp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Rv(){return Bh(Lv)}var zv=J(`ZodNever`,(e,t)=>{Qp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>e_(e,t,n,r)});function Bv(e){return Vh(zv,e)}var Vv=J(`ZodArray`,(e,t)=>{tv(),nm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>h_(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Xh(e,t))},nonempty(e){return this.check(Xh(1,e))},max(e,t){return this.check(Yh(e,t))},length(e,t){return this.check(Zh(e,t))},unwrap(){return this.element}});function Hv(e,t){return dg(Vv,e,t)}var Uv=J(`ZodObject`,(e,t)=>{tv(),cm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>__(e,t,n,r),cd(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return ny(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_u(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_u(this._zod.def,{catchall:Rv()}))},loose(){return this.clone(_u(this._zod.def,{catchall:Rv()}))},strict(){return this.clone(_u(this._zod.def,{catchall:Bv()}))},strip(){return this.clone(_u(this._zod.def,{catchall:void 0}))},extend(e){return Fu(this,e)},safeExtend(e){return Lu(this,e)},merge(e){return Ru(this,e)},pick(e){return Mu(this,e)},omit(e){return Pu(this,e)},partial(...e){return zu(sy,this,e[0])},exactPartial(...e){return zu(ly,this,e[0],`exactPartial`)},required(...e){return Bu(_y,this,e[0])}});function Wv(e,t){return new Uv({type:`object`,shape:e??{},...K(t)})}function Gv(e,t){return new Uv({type:`object`,shape:e,catchall:Bv(),...K(t)})}function Kv(e,t){return new Uv({type:`object`,shape:e,catchall:Rv(),...K(t)})}var qv=J(`ZodUnion`,(e,t)=>{um.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>v_(e,t,n,r),e.options=t.options});function Jv(e,t){return new qv({type:`union`,options:e,...K(t)})}var Yv=J(`ZodDiscriminatedUnion`,(e,t)=>{qv.init(e,t),fm.init(e,t)});function Xv(e,t,n){return new Yv({type:`union`,options:t,discriminator:e,...K(n)})}var Zv=J(`ZodIntersection`,(e,t)=>{pm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>y_(e,t,n,r)});function Qv(e,t){return new Zv({type:`intersection`,left:e,right:t})}var $v=J(`ZodRecord`,(e,t)=>{tv(),gm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>w_(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ey(e,t,n){return!t||!t._zod?new $v({type:`record`,keyType:iv(),valueType:e,...K(t)}):new $v({type:`record`,keyType:e,valueType:t,...K(n)})}var ty=J(`ZodEnum`,(e,t)=>{_m.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>i_(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ty({...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 ty({...t,checks:[],...K(r),entries:i})}});function ny(e,t){return new ty({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...K(t)})}var ry=J(`ZodLiteral`,(e,t)=>{vm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>a_(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 iy(e,t){return new ry({type:`literal`,values:Array.isArray(e)?e:[e],...K(t)})}var ay=J(`ZodTransform`,(e,t)=>{tv(),ym.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>f_(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new _d(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Qu(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Qu(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function oy(e){return new ay({type:`transform`,transform:e})}var sy=J(`ZodOptional`,(e,t)=>{xm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>F_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cy(e){return new sy({type:`optional`,innerType:e})}var ly=J(`ZodExactOptional`,(e,t)=>{Sm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>F_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uy(e){return new ly({type:`optional`,innerType:e})}var dy=J(`ZodNullable`,(e,t)=>{Cm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>T_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fy(e){return new dy({type:`nullable`,innerType:e})}var py=J(`ZodDefault`,(e,t)=>{wm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>k_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function my(e,t){return new py({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():wu(t)}})}var hy=J(`ZodPrefault`,(e,t)=>{Em.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>A_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gy(e,t){return new hy({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():wu(t)}})}var _y=J(`ZodNonOptional`,(e,t)=>{Dm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>E_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vy(e,t){return new _y({type:`nonoptional`,innerType:e,...K(t)})}var yy=J(`ZodCatch`,(e,t)=>{Am.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function by(e,t){return new yy({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ud(t)})}var xy=J(`ZodPipe`,(e,t)=>{jm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>M_(e,t,n,r),e.in=t.in,e.out=t.out});function Sy(e,t){return new xy({type:`pipe`,in:e,out:t})}var Cy=J(`ZodPreprocess`,(e,t)=>{xy.init(e,t),Nm.init(e,t)}),wy=J(`ZodReadonly`,(e,t)=>{Pm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>N_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ty(e){return new wy({type:`readonly`,innerType:e})}var Ey=J(`ZodLazy`,(e,t)=>{Im.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>I_(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Dy(e){return new Ey({type:`lazy`,getter:e})}var Oy=J(`ZodCustom`,(e,t)=>{Lm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>u_(e,t,n,r)});function ky(e,t){return fg(Oy,e??(()=>!0),t)}function Ay(e,t={}){return pg(Oy,e,t)}function jy(e,t){return mg(e,t)}var My=J(`ZodInstanceOf`,(e,t)=>{Oy.init(e,t)},{properties(e,t){return this.check(ig(e,t))}});function Ny(e,t={}){let n=new My({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 Py(e,t){return new Cy({type:`pipe`,in:oy(e),out:t})}function Fy(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 Iy=(0,V.createContext)(null),Ly=(0,V.createContext)([]);function Ry({href:e,onEvent:t,history:n=[],children:r}){let[i,a]=(0,V.useState)(new Map),o=(0,V.useEffectEvent)(t);return(0,V.useEffect)(()=>{if(!e)return;let t=new EventSource(e),n=e=>{let t=Gy(e.data);t&&(t.type===`ready`?a(new Map):Uy(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,H.jsx)(Iy,{value:i,children:(0,H.jsx)(Ly,{value:n,children:r})})}function zy(e,t){let n=(0,V.use)(Iy);if(!n)throw Error(`useConversationStatus must be used inside <RuntimeEventsProvider>.`);return n.get(e)?.status??t}var By={pending:`Pending`,queued:`Queued`,running:`Running`,waitingOnApproval:`Waiting on approval`,waitingOnUserInput:`Waiting on user input`,completed:`Completed`,failed:`Failed`,interrupted:`Interrupted`},Vy={spawn:`Spawned`,message:`Message sent`,followup:`Follow-up sent`,interrupt:`Interrupt accepted`,completion:`Turn finished`};function Hy({treeId:e,snapshot:t=[]}){let n=(0,V.use)(Iy),r=(0,V.use)(Ly).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,H.jsxs)(`section`,{"aria-label":`Child agents`,className:`border-t px-6 py-3`,children:[(0,H.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:`Child agents`}),(0,H.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,H.jsxs)(`li`,{className:`flex items-center justify-between gap-4 text-sm`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`truncate font-mono text-xs`,children:e.path}),t&&(0,H.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[Vy[t.type],` · `,t.actorPath,` →`,` `,t.targetPath]})]}),(0,H.jsx)(nb,{status:By[e.state]})]},e.chatId)})})]})}function Uy(e){return e.type===`change`&&e.resource===`conversation`&&Ky(e.status)&&(e.child===void 0||Jy(e.child)&&e.child.chatId===e.id)}function Wy(e){return qy(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`&&Ky(e.status)&&(e.children===void 0||Array.isArray(e.children)&&e.children.every(Jy))}function Gy(e){let t;try{t=JSON.parse(e)}catch{return}if(!(!qy(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`&&(!Ky(t.status)||t.child!==void 0&&(!Jy(t.child)||t.child.chatId!==t.id))))return{...t,type:`change`,resource:t.resource,id:t.id}}}function Ky(e){return!qy(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 qy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Jy(e){return!qy(e)||!qy(e.activities)||![`chatId`,`treeId`,`path`,`parentChatId`,`declarationName`].every(t=>typeof e[t]==`string`)||typeof e.state!=`string`||!Object.hasOwn(By,e.state)?!1:Object.entries(e.activities).every(([e,t])=>Object.hasOwn(Vy,e)&&qy(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 Yy=(0,V.createContext)(null);function Xy(){let e=(0,V.use)(Yy);if(!e)throw Error(`History.* parts must be rendered inside <History.Root>.`);return e}function Zy({activeChatId:e,onSelect:t,className:n,children:r}){let i=(0,V.useMemo)(()=>({activeChatId:e,onSelect:t}),[e,t]);return(0,H.jsx)(Yy.Provider,{value:i,children:(0,H.jsx)(`div`,{className:U(`flex min-h-0 flex-col gap-1`,n),children:r})})}function Qy({className:e,children:t}){return(0,H.jsx)(`div`,{className:U(`group/history-item relative`,e),children:t})}function $y({history:e,className:t,children:n}){let{activeChatId:r,onSelect:i}=Xy(),a=r===e.chatId;return(0,H.jsx)(`button`,{type:`button`,"aria-current":a?`true`:void 0,onClick:()=>i(e),className:U(`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 eb({className:e,children:t}){return(0,H.jsx)(`div`,{className:U(`text-muted-foreground px-2 py-4 text-sm`,e),children:t})}function tb({chatId:e,status:t}){let n=`size-3.5 shrink-0`;switch(Fy(zy(e,t))){case`active`:return(0,H.jsx)(Wt,{"aria-label":`Active`,className:n});case`error`:return(0,H.jsx)(Kt,{"aria-label":`Error`,className:U(n,`text-destructive`)});case`idle`:return(0,H.jsx)(nn,{"aria-label":`idle`,className:n});case`approval`:return(0,H.jsx)(Jt,{"aria-label":`Waiting on approval`,className:n});case`input`:return(0,H.jsx)(en,{"aria-label":`Waiting on user input`,className:n})}}function nb({status:e}){return(0,H.jsx)(`span`,{className:U(`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 rb=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function ib(e){return rb.format(new Date(e))}var ab={Root:Zy,Item:Qy,ItemTrigger:$y,Empty:eb},ob=Wv({href:iv()}),sb=Wv({capabilities:Wv({chat:ob,history:ob,events:ob,traces:ob.optional(),schedules:ob.optional(),uploads:ob.extend({mediaTypes:Hv(iv()).optional()}).optional()})}),cb=new ye({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1}}});async function lb(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 cb.fetchQuery({queryKey:[`runtime`,`discovery`,t],queryFn:async()=>sb.parse(await ub(t,e)),staleTime:1/0});n=r;let i=await cb.fetchQuery({queryKey:[`runtime`,`history`,r.capabilities.history.href],queryFn:async()=>db(await ub(r.capabilities.history.href,e))});return{discovery:n,history:i,historyError:!1}}catch{return{discovery:n,history:[],historyError:!0}}}async function ub(e,t){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`Request failed: ${n.status}`);return n.json()}function db(e){if(!Array.isArray(e)||!e.every(Wy))throw Error(`History response is not a list of conversations`);return e}export{vm as $,_ as $i,Zi as $n,kr as $r,as as $t,Rv as A,an as Ai,Da as An,ei as Ar,El as At,qh as B,U as Bi,ga as Bn,Ur as Br,sl as Bt,Av as C,_n as Ci,za as Cn,Yr as Cr,K as Ct,Gv as D,dn as Di,Aa as Dn,Xr as Dr,Yl as Dt,ey as E,mn as Ei,ja as En,hi as Er,Cl as Et,fg as F,Bt as Fi,pa as Fn,ri as Fr,ql as Ft,lh as G,de as Gi,na as Gn,Ir as Gr,ul as Gt,Kh as H,Te as Hi,ba as Hn,Vr as Hr,ml as Ht,Lh as I,Rt as Ii,ua as In,ii as Ir,Gl as It,nm as J,re as Ji,ta as Jn,Nr as Jr,fs as Jt,Bh as K,I as Ki,ea as Kn,jr as Kr,ll as Kt,Uh as L,It as Li,ha as Ln,di as Lr,Ml as Lt,G_ as M,Xt as Mi,Ca as Mn,Qr as Mr,kl as Mt,R_ as N,Kt as Ni,da as Nn,ni as Nr,Al as Nt,iv as O,cn as Oi,Oa as On,li as Or,wl as Ot,Rh as P,Ht as Pi,fa as Pn,ti as Pr,jl as Pt,_m as Q,A as Qi,Xi as Qn,wr as Qr,ms as Qt,Xh as R,Pt as Ri,ma as Rn,qr as Rr,fl as Rt,Kv as S,yn as Si,Ba as Sn,vi as Sr,cd as St,Py as T,W as Ti,Ia as Tn,_i as Tr,Sl as Tt,pg as U,xe as Ui,la as Un,zr as Ur,pl as Ut,Ih as V,we as Vi,ya as Vn,Hr as Vr,dl as Vt,ng as W,he as Wi,sa as Wn,Br as Wr,hl as Wt,Lm as X,m as Xi,Qi as Xn,Er as Xr,So as Xt,Yp as Y,x as Yi,aa as Yn,Dr as Yr,ds as Yt,fm as Z,f as Zi,ra as Zn,Pr as Zr,Wo as Zt,ky as _,Un as _i,qa as _n,yi as _r,J as _t,ab as a,l as aa,Sr as ai,Yo as an,Ui as ar,jm as at,Dy as b,An as bi,Ua as bn,ui as br,Du as bt,Fy as c,Fr as ci,G as cn,Ri as cr,ym as ct,zy as d,gr as di,to as dn,Ai as dr,Zp as dt,g as ea,Or as ei,Go as en,Gi as er,Qp as et,ny as f,hr as fi,eo as fn,Oi as fr,Fd as ft,Pv as g,Gn as gi,Ja as gn,Si as gr,Md as gt,Hv as h,ir as hi,Xa as hn,Ci as hr,Hd as ht,Hy as i,h as ia,Mr as ii,rs as in,Wi as ir,xm as it,pv as j,Qt as ji,Ea as jn,fi as jr,Kl as jt,Jv as k,sn as ki,Ta as kn,$r as kr,Jl as kt,ib as l,_r as li,po as ln,Li as lr,Y as lt,Iv as m,cr as mi,Qa as mn,Ei as mr,zd as mt,cb as n,M as na,Cr as ni,_s as nn,Ki as nr,Jp as nt,Ry as o,s as oa,xr as oi,oo as on,Hi as or,gm as ot,Ny as p,dr as pi,$a as pn,ki as pr,Ld as pt,rh as q,P as qi,$i as qn,Tr as qr,Gs as qt,tb as r,ne as ra,Ar as ri,us as rn,Ji as rr,sm as rt,nb as s,o as sa,br as si,fo as sn,zi as sr,cp as st,lb as t,T as ta,yr as ti,To as tn,qi as tr,qp as tt,Uy as u,vr as ui,so as un,Ni as ur,um as ut,Xv as v,Rn as vi,Ka as vn,bi as vr,fd as vt,Wv as w,vn as wi,Pa as wn,mi as wr,ed as wt,iy as x,Sn as xi,Va as xn,Zr as xr,Fu as xt,Mv as y,jn as yi,Ga as yn,pi as yr,yd as yt,Vh as z,Mt as zi,_a as zn,Wr as zr,ol as zt};