@fuma-content/studio 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/build/client/assets/{app-sidebar-DmZmaTFZ.js → app-sidebar-pNmserEz.js} +1 -1
  2. package/build/client/assets/{client-DCkt8g_f.js → client-CiKaCnwt.js} +2 -2
  3. package/build/client/assets/{client-CEEVDnpu.js → client-DQSIY5Q2.js} +141 -141
  4. package/build/client/assets/client-DoI_730h.js +39 -0
  5. package/build/client/assets/{context-menu-BKCfyZyn.js → context-menu-DmqgkYYt.js} +1 -1
  6. package/build/client/assets/{cssMode-DLORRHDr.js → cssMode-Coi5O5zy.js} +1 -1
  7. package/build/client/assets/entry.rsc-Dg8bPYHW.js +1 -0
  8. package/build/client/assets/{freemarker2-DaJ0VeUL.js → freemarker2-1O7dsC5n.js} +1 -1
  9. package/build/client/assets/{handlebars-DLHw1EEJ.js → handlebars-CV8AX3NZ.js} +1 -1
  10. package/build/client/assets/{html-O04EC3MX.js → html-Blvbrx_-.js} +1 -1
  11. package/build/client/assets/{htmlMode-DQ7y7lfT.js → htmlMode-C2GytKxI.js} +1 -1
  12. package/build/client/assets/{index-C0ecV8RK.js → index-BJkIIQzT.js} +1 -1
  13. package/build/client/assets/{index-DyfAV_di.js → index-BYgxF2sp.js} +1 -1
  14. package/build/client/assets/{index-DYGF1SVj.js → index-DaIko2JM.js} +1 -1
  15. package/build/client/assets/{index-B6b4_3Hd.js → index-DcOHxMKV.js} +1 -1
  16. package/build/client/assets/{index-BO1u3G9x.js → index-MJySYuke.js} +1 -1
  17. package/build/client/assets/{index-pxp216Su.js → index-ShKFcMvP.js} +1 -1
  18. package/build/client/assets/{index-SdiO_PfY.js → index-oqTiWTgb.js} +1 -1
  19. package/build/client/assets/{javascript-CrGLGAoQ.js → javascript-Bl1Q_Nkx.js} +1 -1
  20. package/build/client/assets/{jsonMode-CF67c9TM.js → jsonMode-Wb-dBUwH.js} +1 -1
  21. package/build/client/assets/{layout-DFh-gM7Y.js → layout-BLEhq2Xc.js} +1 -1
  22. package/build/client/assets/{liquid-CLUvqbUj.js → liquid-CRXJh1mG.js} +1 -1
  23. package/build/client/assets/{lspLanguageFeatures-C4ogykLr.js → lspLanguageFeatures-CBxjayZZ.js} +1 -1
  24. package/build/client/assets/{mdx-I5c0PFNf.js → mdx-C5mACBRu.js} +1 -1
  25. package/build/client/assets/{page-Cnp0usS5.js → page-CDAXLFEn.js} +1 -1
  26. package/build/client/assets/{page-vw-b-9V8.js → page-DH_hjJdm.js} +1 -1
  27. package/build/client/assets/{popover-BTaeGuVq.js → popover-BeYx_kX_.js} +1 -1
  28. package/build/client/assets/{python-9pLFSYtk.js → python-WC2gRa53.js} +1 -1
  29. package/build/client/assets/{razor-C1F71AoJ.js → razor-DtDoIoVr.js} +1 -1
  30. package/build/client/assets/{react-H1IN5wR7.js → react-Dk3PRQ9V.js} +2 -2
  31. package/build/client/assets/root-Bxrr2p-9.js +1 -0
  32. package/build/client/assets/{root-CquYm4yb.js → root-OdV9Gcaa.js} +1 -1
  33. package/build/client/assets/route-DoJXbWq2.js +1 -0
  34. package/build/client/assets/{router-DNbvCK8g.js → router-Ccb8Hbb0.js} +1 -1
  35. package/build/client/assets/{separator-QmXXuyOl.js → separator-Sua3PhYj.js} +1 -1
  36. package/build/client/assets/{site-header-pChVNzpf.js → site-header-Cyiy71CX.js} +1 -1
  37. package/build/client/assets/{spinner-Cs2baDxX.js → spinner-C1xi9J1T.js} +1 -1
  38. package/build/client/assets/{suspense-DqXzPoi1.js → suspense-Be4bKxiB.js} +1 -1
  39. package/build/client/assets/{tsMode-C27O5pAT.js → tsMode-C-5dlAKI.js} +1 -1
  40. package/build/client/assets/{typescript-CdWDFqnx.js → typescript-DtZ3r-8F.js} +1 -1
  41. package/build/client/assets/{xml-CyqvPPRa.js → xml-2JwqkWbu.js} +1 -1
  42. package/build/client/assets/{yaml-BReIckoY.js → yaml-B7FthBd9.js} +3 -3
  43. package/build/client/assets/{yaml-CIgtTHvG.js → yaml-B8ielN8F.js} +1 -1
  44. package/build/server/__ssr_build/__vite_rsc_assets_manifest.js +100 -100
  45. package/build/server/__ssr_build/assets/{client-DZ7MH4ui.js → client-BbQZwY1s.js} +1 -1
  46. package/build/server/__ssr_build/assets/{client-DIrftxPs.js → client-Dm8-2ev7.js} +183 -167
  47. package/build/server/__ssr_build/assets/{client-CoRUI7H1.js → client-aUUPy-yC.js} +46 -27
  48. package/build/server/__ssr_build/assets/{route-r7ypDwBC.js → route-D3n8i03R.js} +1 -1
  49. package/build/server/__ssr_build/index.js +4 -4
  50. package/build/server/__vite_rsc_assets_manifest.js +100 -100
  51. package/build/server/assets/{route-Be37zvut.js → route-BDaI_mx5.js} +1 -1
  52. package/build/server/index.js +5 -5
  53. package/dist/bin/cli.mjs +1 -3
  54. package/dist/bin/hocuspocus.mjs +1 -3
  55. package/dist/bin.mjs +1 -3
  56. package/dist/lib/yjs/index.mjs +3 -5
  57. package/dist/package.mjs +2 -3
  58. package/package.json +26 -26
  59. package/build/client/assets/client-B1Ov3B6B.js +0 -39
  60. package/build/client/assets/entry.rsc-D-AmsoFy.js +0 -1
  61. package/build/client/assets/root-tlv37SRw.js +0 -1
  62. package/build/client/assets/route-C720h6ya.js +0 -1
@@ -0,0 +1 @@
1
+ import{l as r,A as o,L as t,E as a}from"./root-OdV9Gcaa.js";import"./react-Dk3PRQ9V.js";import"./router-Ccb8Hbb0.js";import"./index-oqTiWTgb.js";const e={ErrorBoundary:a,Layout:t,default:o,links:r};export{e as export_3e8fc4d4edf5};
@@ -1 +1 @@
1
- import{h as o,j as e}from"./react-H1IN5wR7.js";import{O as a,M as i,d as c,S as l,i as u}from"./router-DNbvCK8g.js";import{J as d}from"./index-SdiO_PfY.js";function m(s){const t=o.c(2),{children:n}=s;let r;return t[0]!==n?(r=e.jsx(d,{attribute:"class",enableSystem:!0,disableTransitionOnChange:!0,children:n}),t[0]=n,t[1]=r):r=t[1],r}const g=()=>[{rel:"preconnect",href:"https://fonts.googleapis.com"},{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"},{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&display=swap"}];function j({children:s}){return e.jsxs("html",{lang:"en",suppressHydrationWarning:!0,children:[e.jsxs("head",{children:[e.jsx("meta",{charSet:"utf-8"}),e.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),e.jsx(i,{}),e.jsx(c,{})]}),e.jsxs("body",{children:[e.jsx(m,{children:s}),e.jsx(l,{})]})]})}function y(){return e.jsx(a,{})}class p extends Error{}function E({error:s}){let t="Oops!",n="An unexpected error occurred.",r;return s instanceof p?(t="404",n="The requested page could not be found."):u(s)&&(t=s.status===404?"404":"Error",n=s.status===404?"The requested page could not be found.":s.statusText||n),e.jsxs("main",{className:"flex flex-col gap-2 min-h-screen items-center justify-center p-6 text-center",children:[e.jsx("h1",{className:"font-medium text-lg",children:t}),e.jsx("p",{className:"text-muted-foreground",children:n}),r]})}export{y as A,E,j as L,p as N,g as l};
1
+ import{h as o,j as e}from"./react-Dk3PRQ9V.js";import{O as a,M as i,d as c,S as l,i as u}from"./router-Ccb8Hbb0.js";import{J as d}from"./index-oqTiWTgb.js";function m(s){const t=o.c(2),{children:n}=s;let r;return t[0]!==n?(r=e.jsx(d,{attribute:"class",enableSystem:!0,disableTransitionOnChange:!0,children:n}),t[0]=n,t[1]=r):r=t[1],r}const g=()=>[{rel:"preconnect",href:"https://fonts.googleapis.com"},{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"},{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&display=swap"}];function j({children:s}){return e.jsxs("html",{lang:"en",suppressHydrationWarning:!0,children:[e.jsxs("head",{children:[e.jsx("meta",{charSet:"utf-8"}),e.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),e.jsx(i,{}),e.jsx(c,{})]}),e.jsxs("body",{children:[e.jsx(m,{children:s}),e.jsx(l,{})]})]})}function y(){return e.jsx(a,{})}class p extends Error{}function E({error:s}){let t="Oops!",n="An unexpected error occurred.",r;return s instanceof p?(t="404",n="The requested page could not be found."):u(s)&&(t=s.status===404?"404":"Error",n=s.status===404?"The requested page could not be found.":s.statusText||n),e.jsxs("main",{className:"flex flex-col gap-2 min-h-screen items-center justify-center p-6 text-center",children:[e.jsx("h1",{className:"font-medium text-lg",children:t}),e.jsx("p",{className:"text-muted-foreground",children:n}),r]})}export{y as A,E,j as L,p as N,g as l};
@@ -0,0 +1 @@
1
+ import{J as o,a as r}from"./client-DoI_730h.js";import{P as e,a as t,b as p}from"./popover-BeYx_kX_.js";import"./react-Dk3PRQ9V.js";import"./index-BYgxF2sp.js";import"./index-BJkIIQzT.js";const c={JSONSchemaEditorContent:r,JSONSchemaEditorProvider:o},v={Popover:p,PopoverContent:t,PopoverTrigger:e};export{v as export_793b5b94ae43,c as export_dc3a4fc5767f};
@@ -1,4 +1,4 @@
1
- import{r as h,R as En,W as se,a as bn}from"./react-H1IN5wR7.js";var fa=e=>{throw TypeError(e)},Sn=(e,t,r)=>t.has(e)||fa("Cannot "+r),Vt=(e,t,r)=>(Sn(e,t,"read from private field"),r?r.call(e):t.get(e)),Ln=(e,t,r)=>t.has(e)?fa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ir="popstate";function Or(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Dn(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:u}=o||a.location;return st("",{pathname:i,search:l,hash:u},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:Le(n)}return Cn(t,r,null,e)}function O(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Q(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xn(){return Math.random().toString(36).substring(2,10)}function Ar(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function st(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?_e(t):t,state:r,key:t&&t.key||a||xn(),unstable_mask:n}}function Le({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function _e(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function Cn(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",u=null,s=f();s==null&&(s=0,i.replaceState({...i.state,idx:s},""));function f(){return(i.state||{idx:null}).idx}function c(){l="POP";let R=f(),L=R==null?null:R-s;s=R,u&&u({action:l,location:b.location,delta:L})}function p(R,L){l="PUSH";let D=Or(R)?R:st(b.location,R,L);s=f()+1;let _=Ar(D,s),H=b.createHref(D.unstable_mask||D);try{i.pushState(_,"",H)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;n.location.assign(H)}o&&u&&u({action:l,location:b.location,delta:1})}function g(R,L){l="REPLACE";let D=Or(R)?R:st(b.location,R,L);s=f();let _=Ar(D,s),H=b.createHref(D.unstable_mask||D);i.replaceState(_,"",H),o&&u&&u({action:l,location:b.location,delta:0})}function w(R){return ha(R)}let b={get action(){return l},get location(){return e(n,i)},listen(R){if(u)throw new Error("A history only accepts one active listener");return n.addEventListener(Ir,c),u=R,()=>{n.removeEventListener(Ir,c),u=null}},createHref(R){return t(n,R)},createURL:w,encodeLocation(R){let L=w(R);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:p,replace:g,go(R){return i.go(R)}};return b}function ha(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),O(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Le(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}function Mn(e){return{defaultValue:e}}var ot,kr=class{constructor(e){if(Ln(this,ot,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Vt(this,ot).has(e))return Vt(this,ot).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Vt(this,ot).set(e,t)}};ot=new WeakMap;var Pn=new Set(["lazy","caseSensitive","path","id","index","children"]);function _n(e){return Pn.has(e)}var Tn=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Fn(e){return Tn.has(e)}function In(e){return e.index===!0}function ut(e,t,r=[],a={},n=!1){return e.map((o,i)=>{let l=[...r,String(i)],u=typeof o.id=="string"?o.id:l.join("-");if(O(o.index!==!0||!o.children,"Cannot specify children on an index route"),O(n||!a[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),In(o)){let s={...o,id:u};return a[u]=$r(s,t(s)),s}else{let s={...o,id:u,children:void 0};return a[u]=$r(s,t(s)),o.children&&(s.children=ut(o.children,t,l,a,n)),s}})}function $r(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Pe(e,t,r="/"){return it(e,t,r,!1)}function it(e,t,r,a){let n=typeof t=="string"?_e(t):t,o=pe(n.pathname||"/",r);if(o==null)return null;let i=pa(e);On(i);let l=null;for(let u=0;l==null&&u<i.length;++u){let s=Vn(o);l=Bn(i[u],s,a)}return l}function ma(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function pa(e,t=[],r=[],a="",n=!1){let o=(i,l,u=n,s)=>{let f={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(a)&&u)return;O(f.relativePath.startsWith(a),`Absolute route path "${f.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(a.length)}let c=ge([a,f.relativePath]),p=r.concat(f);i.children&&i.children.length>0&&(O(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),pa(i.children,t,p,c,u)),!(i.path==null&&!i.index)&&t.push({path:c,score:jn(c,i.index),routesMeta:p})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let u of ya(i.path))o(i,l,!0,u)}),t}function ya(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=ya(a.join("/")),l=[];return l.push(...i.map(u=>u===""?o:[o,u].join("/"))),n&&l.push(...i),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function On(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Hn(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var An=/^:[\w-]+$/,kn=3,$n=2,Un=1,Nn=10,zn=-2,Ur=e=>e==="*";function jn(e,t){let r=e.split("/"),a=r.length;return r.some(Ur)&&(a+=zn),t&&(a+=$n),r.filter(n=>!Ur(n)).reduce((n,o)=>n+(An.test(o)?kn:o===""?Un:Nn),a)}function Hn(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Bn(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let u=a[l],s=l===a.length-1,f=o==="/"?t:t.slice(o.length)||"/",c=It({path:u.relativePath,caseSensitive:u.caseSensitive,end:s},f),p=u.route;if(!c&&s&&r&&!a[a.length-1].route.index&&(c=It({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!c)return null;Object.assign(n,c.params),i.push({params:n,pathname:ge([o,c.pathname]),pathnameBase:Kn(ge([o,c.pathnameBase])),route:p}),c.pathnameBase!=="/"&&(o=ge([o,c.pathnameBase]))}return i}function It(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Wn(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),l=n.slice(1);return{params:a.reduce((s,{paramName:f,isOptional:c},p)=>{if(f==="*"){let w=l[p]||"";i=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const g=l[p];return c&&!g?s[f]=void 0:s[f]=(g||"").replace(/%2F/g,"/"),s},{}),pathname:o,pathnameBase:i,pattern:e}}function Wn(e,t=!1,r=!0){Q(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 a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,u,s,f)=>{if(a.push({paramName:l,isOptional:u!=null}),u){let c=f.charAt(s+i.length);return c&&c!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Vn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Q(!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 pe(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Yn({basename:e,pathname:t}){return t==="/"?e:ge([e,t])}var va=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ir=e=>va.test(e);function Jn(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?_e(e):e,o;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?o=Nr(r.substring(1),"/"):o=Nr(r,t)):o=t,{pathname:o,search:Gn(a),hash:Xn(n)}}function Nr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Yt(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ga(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function lr(e){let t=ga(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function kt(e,t,r,a=!1){let n;typeof e=="string"?n=_e(e):(n={...e},O(!n.pathname||!n.pathname.includes("?"),Yt("?","pathname","search",n)),O(!n.pathname||!n.pathname.includes("#"),Yt("#","pathname","hash",n)),O(!n.search||!n.search.includes("#"),Yt("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let c=t.length-1;if(!a&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),c-=1;n.pathname=p.join("/")}l=c>=0?t[c]:"/"}let u=Jn(n,l),s=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(s||f)&&(u.pathname+="/"),u}var ge=e=>e.join("/").replace(/\/\/+/g,"/"),Kn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Gn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Xn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,qn=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function Qn(e,t){return new qn(e,typeof t=="number"?{status:t}:t)}var Zn=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let a=new Headers(r.headers);return a.set("Location",e),new Response(null,{...r,headers:a})},Be=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function He(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ct(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var wa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ra(e,t){let r=e;if(typeof r!="string"||!va.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(wa)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),l=pe(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{Q(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var Oe=Symbol("Uninstrumented");function eo(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(n=>n({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let l of i)o[l]&&r[l].push(o[l])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let n=Ke(r.lazy,t.lazy,()=>{});n&&(a.lazy=n)}if(typeof t.lazy=="object"){let n=t.lazy;["middleware","loader","action"].forEach(o=>{let i=n[o],l=r[`lazy.${o}`];if(typeof i=="function"&&l.length>0){let u=Ke(l,i,()=>{});u&&(a.lazy=Object.assign(a.lazy||{},{[o]:u}))}})}return["loader","action"].forEach(n=>{let o=t[n];if(typeof o=="function"&&r[n].length>0){let i=o[Oe]??o,l=Ke(r[n],i,(...u)=>zr(u[0]));l&&(n==="loader"&&i.hydrate===!0&&(l.hydrate=!0),l[Oe]=i,a[n]=l)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(n=>{let o=n[Oe]??n,i=Ke(r.middleware,o,(...l)=>zr(l[0]));return i?(i[Oe]=o,i):n})),a}function to(e,t){let r={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(n){let o=Object.keys(n);for(let i of o)n[i]&&r[i].push(n[i])}})),r.navigate.length>0){let a=e.navigate[Oe]??e.navigate,n=Ke(r.navigate,a,(...o)=>{let[i,l]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?Le(i):".",...jr(e,l??{})}});n&&(n[Oe]=a,e.navigate=n)}if(r.fetch.length>0){let a=e.fetch[Oe]??e.fetch,n=Ke(r.fetch,a,(...o)=>{let[i,,l,u]=o;return{href:l??".",fetcherKey:i,...jr(e,u??{})}});n&&(n[Oe]=a,e.fetch=n)}return e}function Ke(e,t,r){return e.length===0?null:async(...a)=>{let n=await Ea(e,r(...a),()=>t(...a),e.length-1);if(n.type==="error")throw n.value;return n.value}}async function Ea(e,t,r,a){let n=e[a],o;if(n){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Ea(e,t,r,a-1),o=await i,O(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await n(l,t)}catch(u){console.error("An instrumentation function threw an error:",u)}i||await l(),await i}else try{o={type:"success",value:await r()}}catch(i){o={type:"error",value:i}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function zr(e){let{request:t,context:r,params:a,unstable_pattern:n}=e;return{request:ro(t),params:{...a},unstable_pattern:n,context:ao(r)}}function jr(e,t){return{currentUrl:Le(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 ro(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function ao(e){if(oo(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var no=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oo(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===no}var ba=["POST","PUT","PATCH","DELETE"],io=new Set(ba),lo=["GET",...ba],so=new Set(lo),Sa=new Set([301,302,303,307,308]),uo=new Set([307,308]),Jt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},co={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},rt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fo=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),La="remix-router-transitions",Da=Symbol("ResetLoaderData");function ho(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";O(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||fo,o=n;if(e.unstable_instrumentations){let d=e.unstable_instrumentations;o=m=>({...n(m),...eo(d.map(v=>v.route).filter(Boolean),m)})}let i={},l=ut(e.routes,o,void 0,i),u,s=e.basename||"/";s.startsWith("/")||(s=`/${s}`);let f=e.dataStrategy||go,c={...e.future},p=null,g=new Set,w=null,b=null,R=null,L=e.hydrationData!=null,D=Pe(l,e.history.location,s),_=!1,H=null,A,j;if(D==null&&!e.patchRoutesOnNavigation){let d=ve(404,{pathname:e.history.location.pathname}),{matches:m,route:v}=Lt(l);A=!0,j=!A,D=m,H={[v.id]:d}}else if(D&&!e.hydrationData&&wt(D,l,e.history.location.pathname).active&&(D=null),D)if(D.some(d=>d.route.lazy))A=!1,j=!A;else if(!D.some(d=>sr(d.route)))A=!0,j=!A;else{let d=e.hydrationData?e.hydrationData.loaderData:null,m=e.hydrationData?e.hydrationData.errors:null,v=D;if(m){let E=D.findIndex(S=>m[S.route.id]!==void 0);v=v.slice(0,E+1)}j=!1,A=v.every(E=>{let S=xa(E.route,d,m);return j=j||S.renderFallback,!S.shouldLoad})}else{A=!1,j=!A,D=[];let d=wt(null,l,e.history.location.pathname);d.active&&d.matches&&(_=!0,D=d.matches)}let G,y={historyAction:e.history.action,location:e.history.location,matches:D,initialized:A,renderFallback:j,navigation:Jt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||H,fetchers:new Map,blockers:new Map},U="POP",V=null,te=!1,B,ue=!1,J=new Map,k=null,q=!1,ne=!1,oe=new Set,N=new Map,de=0,Ee=-1,fe=new Map,ie=new Set,he=new Map,Te=new Map,be=new Set,Ae=new Map,vt,Qe=null;function rn(){if(p=e.history.listen(({action:d,location:m,delta:v})=>{if(vt){vt(),vt=void 0;return}Q(Ae.size===0||v!=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 E=Mr({currentLocation:y.location,nextLocation:m,historyAction:d});if(E&&v!=null){let S=new Promise(M=>{vt=M});e.history.go(v*-1),gt(E,{state:"blocked",location:m,proceed(){gt(E,{state:"proceeding",proceed:void 0,reset:void 0,location:m}),S.then(()=>e.history.go(v))},reset(){let M=new Map(y.blockers);M.set(E,rt),re({blockers:M})}}),V?.resolve(),V=null;return}return ke(d,m)}),r){ko(t,J);let d=()=>$o(t,J);t.addEventListener("pagehide",d),k=()=>t.removeEventListener("pagehide",d)}return y.initialized||ke("POP",y.location,{initialHydration:!0}),G}function an(){p&&p(),k&&k(),g.clear(),B&&B.abort(),y.fetchers.forEach((d,m)=>Ht(m)),y.blockers.forEach((d,m)=>Cr(m))}function nn(d){return g.add(d),()=>g.delete(d)}function re(d,m={}){d.matches&&(d.matches=d.matches.map(S=>{let M=i[S.route.id],x=S.route;return x.element!==M.element||x.errorElement!==M.errorElement||x.hydrateFallbackElement!==M.hydrateFallbackElement?{...S,route:M}:S})),y={...y,...d};let v=[],E=[];y.fetchers.forEach((S,M)=>{S.state==="idle"&&(be.has(M)?v.push(M):E.push(M))}),be.forEach(S=>{!y.fetchers.has(S)&&!N.has(S)&&v.push(S)}),[...g].forEach(S=>S(y,{deletedFetchers:v,newErrors:d.errors??null,viewTransitionOpts:m.viewTransitionOpts,flushSync:m.flushSync===!0})),v.forEach(S=>Ht(S)),E.forEach(S=>y.fetchers.delete(S))}function Ve(d,m,{flushSync:v}={}){let E=y.actionData!=null&&y.navigation.formMethod!=null&&ee(y.navigation.formMethod)&&y.navigation.state==="loading"&&d.state?._isRedirect!==!0,S;m.actionData?Object.keys(m.actionData).length>0?S=m.actionData:S=null:E?S=y.actionData:S=null;let M=m.loaderData?qr(y.loaderData,m.loaderData,m.matches||[],m.errors):y.loaderData,x=y.blockers;x.size>0&&(x=new Map(x),x.forEach((I,P)=>x.set(P,rt)));let T=q?!1:_r(d,m.matches||y.matches),C=te===!0||y.navigation.formMethod!=null&&ee(y.navigation.formMethod)&&d.state?._isRedirect!==!0;u&&(l=u,u=void 0),q||U==="POP"||(U==="PUSH"?e.history.push(d,d.state):U==="REPLACE"&&e.history.replace(d,d.state));let F;if(U==="POP"){let I=J.get(y.location.pathname);I&&I.has(d.pathname)?F={currentLocation:y.location,nextLocation:d}:J.has(d.pathname)&&(F={currentLocation:d,nextLocation:y.location})}else if(ue){let I=J.get(y.location.pathname);I?I.add(d.pathname):(I=new Set([d.pathname]),J.set(y.location.pathname,I)),F={currentLocation:y.location,nextLocation:d}}re({...m,actionData:S,loaderData:M,historyAction:U,location:d,initialized:!0,renderFallback:!1,navigation:Jt,revalidation:"idle",restoreScrollPosition:T,preventScrollReset:C,blockers:x},{viewTransitionOpts:F,flushSync:v===!0}),U="POP",te=!1,ue=!1,q=!1,ne=!1,V?.resolve(),V=null,Qe?.resolve(),Qe=null}async function Rr(d,m){if(V?.resolve(),V=null,typeof d=="number"){V||(V=ea());let K=V.promise;return e.history.go(d),K}let v=qt(y.location,y.matches,s,d,m?.fromRouteId,m?.relative),{path:E,submission:S,error:M}=Hr(!1,v,m),x;m?.unstable_mask&&(x={pathname:"",search:"",hash:"",...typeof m.unstable_mask=="string"?_e(m.unstable_mask):{...y.location.unstable_mask,...m.unstable_mask}});let T=y.location,C=st(T,E,m&&m.state,void 0,x);C={...C,...e.history.encodeLocation(C)};let F=m&&m.replace!=null?m.replace:void 0,I="PUSH";F===!0?I="REPLACE":F===!1||S!=null&&ee(S.formMethod)&&S.formAction===y.location.pathname+y.location.search&&(I="REPLACE");let P=m&&"preventScrollReset"in m?m.preventScrollReset===!0:void 0,W=(m&&m.flushSync)===!0,z=Mr({currentLocation:T,nextLocation:C,historyAction:I});if(z){gt(z,{state:"blocked",location:C,proceed(){gt(z,{state:"proceeding",proceed:void 0,reset:void 0,location:C}),Rr(d,m)},reset(){let K=new Map(y.blockers);K.set(z,rt),re({blockers:K})}});return}await ke(I,C,{submission:S,pendingError:M,preventScrollReset:P,replace:m&&m.replace,enableViewTransition:m&&m.viewTransition,flushSync:W,callSiteDefaultShouldRevalidate:m&&m.unstable_defaultShouldRevalidate})}function on(){Qe||(Qe=ea()),jt(),re({revalidation:"loading"});let d=Qe.promise;return y.navigation.state==="submitting"?d:y.navigation.state==="idle"?(ke(y.historyAction,y.location,{startUninterruptedRevalidation:!0}),d):(ke(U||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:ue===!0}),d)}async function ke(d,m,v){B&&B.abort(),B=null,U=d,q=(v&&v.startUninterruptedRevalidation)===!0,vn(y.location,y.matches),te=(v&&v.preventScrollReset)===!0,ue=(v&&v.enableViewTransition)===!0;let E=u||l,S=v&&v.overrideNavigation,M=v?.initialHydration&&y.matches&&y.matches.length>0&&!_?y.matches:Pe(E,m,s),x=(v&&v.flushSync)===!0;if(M&&y.initialized&&!ne&&xo(y.location,m)&&!(v&&v.submission&&ee(v.submission.formMethod))){Ve(m,{matches:M},{flushSync:x});return}let T=wt(M,E,m.pathname);if(T.active&&T.matches&&(M=T.matches),!M){let{error:Z,notFoundMatches:le,route:Y}=Bt(m.pathname);Ve(m,{matches:le,loaderData:{},errors:{[Y.id]:Z}},{flushSync:x});return}B=new AbortController;let C=Je(e.history,m,B.signal,v&&v.submission),F=e.getContext?await e.getContext():new kr,I;if(v&&v.pendingError)I=[Ie(M).route.id,{type:"error",error:v.pendingError}];else if(v&&v.submission&&ee(v.submission.formMethod)){let Z=await ln(C,m,v.submission,M,F,T.active,v&&v.initialHydration===!0,{replace:v.replace,flushSync:x});if(Z.shortCircuited)return;if(Z.pendingActionResult){let[le,Y]=Z.pendingActionResult;if(me(Y)&&He(Y.error)&&Y.error.status===404){B=null,Ve(m,{matches:Z.matches,loaderData:{},errors:{[le]:Y.error}});return}}M=Z.matches||M,I=Z.pendingActionResult,S=Kt(m,v.submission),x=!1,T.active=!1,C=Je(e.history,C.url,C.signal)}let{shortCircuited:P,matches:W,loaderData:z,errors:K}=await sn(C,m,M,F,T.active,S,v&&v.submission,v&&v.fetcherSubmission,v&&v.replace,v&&v.initialHydration===!0,x,I,v&&v.callSiteDefaultShouldRevalidate);P||(B=null,Ve(m,{matches:W||M,...Qr(I),loaderData:z,errors:K}))}async function ln(d,m,v,E,S,M,x,T={}){jt();let C=Oo(m,v);if(re({navigation:C},{flushSync:T.flushSync===!0}),M){let P=await Rt(E,m.pathname,d.signal);if(P.type==="aborted")return{shortCircuited:!0};if(P.type==="error"){if(P.partialMatches.length===0){let{matches:z,route:K}=Lt(l);return{matches:z,pendingActionResult:[K.id,{type:"error",error:P.error}]}}let W=Ie(P.partialMatches).route.id;return{matches:P.partialMatches,pendingActionResult:[W,{type:"error",error:P.error}]}}else if(P.matches)E=P.matches;else{let{notFoundMatches:W,error:z,route:K}=Bt(m.pathname);return{matches:W,pendingActionResult:[K.id,{type:"error",error:z}]}}}let F,I=Pt(E,m);if(!I.route.action&&!I.route.lazy)F={type:"error",error:ve(405,{method:d.method,pathname:m.pathname,routeId:I.route.id})};else{let P=Ge(o,i,d,E,I,x?[]:a,S),W=await Ze(d,P,S,null);if(F=W[I.route.id],!F){for(let z of E)if(W[z.route.id]){F=W[z.route.id];break}}if(d.signal.aborted)return{shortCircuited:!0}}if(je(F)){let P;return T&&T.replace!=null?P=T.replace:P=Kr(F.response.headers.get("Location"),new URL(d.url),s,e.history)===y.location.pathname+y.location.search,await $e(d,F,!0,{submission:v,replace:P}),{shortCircuited:!0}}if(me(F)){let P=Ie(E,I.route.id);return(T&&T.replace)!==!0&&(U="PUSH"),{matches:E,pendingActionResult:[P.route.id,F,I.route.id]}}return{matches:E,pendingActionResult:[I.route.id,F]}}async function sn(d,m,v,E,S,M,x,T,C,F,I,P,W){let z=M||Kt(m,x),K=x||T||Zr(z),Z=!q&&!F;if(S){if(Z){let ae=Er(P);re({navigation:z,...ae!==void 0?{actionData:ae}:{}},{flushSync:I})}let $=await Rt(v,m.pathname,d.signal);if($.type==="aborted")return{shortCircuited:!0};if($.type==="error"){if($.partialMatches.length===0){let{matches:Ye,route:ze}=Lt(l);return{matches:Ye,loaderData:{},errors:{[ze.id]:$.error}}}let ae=Ie($.partialMatches).route.id;return{matches:$.partialMatches,loaderData:{},errors:{[ae]:$.error}}}else if($.matches)v=$.matches;else{let{error:ae,notFoundMatches:Ye,route:ze}=Bt(m.pathname);return{matches:Ye,loaderData:{},errors:{[ze.id]:ae}}}}let le=u||l,{dsMatches:Y,revalidatingFetchers:ye}=Br(d,E,o,i,e.history,y,v,K,m,F?[]:a,F===!0,ne,oe,be,he,ie,le,s,e.patchRoutesOnNavigation!=null,P,W);if(Ee=++de,!e.dataStrategy&&!Y.some($=>$.shouldLoad)&&!Y.some($=>$.route.middleware&&$.route.middleware.length>0)&&ye.length===0){let $=Dr();return Ve(m,{matches:v,loaderData:{},errors:P&&me(P[1])?{[P[0]]:P[1].error}:null,...Qr(P),...$?{fetchers:new Map(y.fetchers)}:{}},{flushSync:I}),{shortCircuited:!0}}if(Z){let $={};if(!S){$.navigation=z;let ae=Er(P);ae!==void 0&&($.actionData=ae)}ye.length>0&&($.fetchers=un(ye)),re($,{flushSync:I})}ye.forEach($=>{Ce($.key),$.controller&&N.set($.key,$.controller)});let Ue=()=>ye.forEach($=>Ce($.key));B&&B.signal.addEventListener("abort",Ue);let{loaderResults:et,fetcherResults:Fe}=await br(Y,ye,d,E);if(d.signal.aborted)return{shortCircuited:!0};B&&B.signal.removeEventListener("abort",Ue),ye.forEach($=>N.delete($.key));let Se=Dt(et);if(Se)return await $e(d,Se.result,!0,{replace:C}),{shortCircuited:!0};if(Se=Dt(Fe),Se)return ie.add(Se.key),await $e(d,Se.result,!0,{replace:C}),{shortCircuited:!0};let{loaderData:Wt,errors:tt}=Xr(y,v,et,P,ye,Fe);F&&y.errors&&(tt={...y.errors,...tt});let Ne=Dr(),Et=xr(Ee),bt=Ne||Et||ye.length>0;return{matches:v,loaderData:Wt,errors:tt,...bt?{fetchers:new Map(y.fetchers)}:{}}}function Er(d){if(d&&!me(d[1]))return{[d[0]]:d[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function un(d){return d.forEach(m=>{let v=y.fetchers.get(m.key),E=at(void 0,v?v.data:void 0);y.fetchers.set(m.key,E)}),new Map(y.fetchers)}async function cn(d,m,v,E){Ce(d);let S=(E&&E.flushSync)===!0,M=u||l,x=qt(y.location,y.matches,s,v,m,E?.relative),T=Pe(M,x,s),C=wt(T,M,x);if(C.active&&C.matches&&(T=C.matches),!T){xe(d,m,ve(404,{pathname:x}),{flushSync:S});return}let{path:F,submission:I,error:P}=Hr(!0,x,E);if(P){xe(d,m,P,{flushSync:S});return}let W=e.getContext?await e.getContext():new kr,z=(E&&E.preventScrollReset)===!0;if(I&&ee(I.formMethod)){await dn(d,m,F,T,W,C.active,S,z,I,E&&E.unstable_defaultShouldRevalidate);return}he.set(d,{routeId:m,path:F}),await fn(d,m,F,T,W,C.active,S,z,I)}async function dn(d,m,v,E,S,M,x,T,C,F){jt(),he.delete(d);let I=y.fetchers.get(d);De(d,Ao(C,I),{flushSync:x});let P=new AbortController,W=Je(e.history,v,P.signal,C);if(M){let X=await Rt(E,new URL(W.url).pathname,W.signal,d);if(X.type==="aborted")return;if(X.type==="error"){xe(d,m,X.error,{flushSync:x});return}else if(X.matches)E=X.matches;else{xe(d,m,ve(404,{pathname:v}),{flushSync:x});return}}let z=Pt(E,v);if(!z.route.action&&!z.route.lazy){let X=ve(405,{method:C.formMethod,pathname:v,routeId:m});xe(d,m,X,{flushSync:x});return}N.set(d,P);let K=de,Z=Ge(o,i,W,E,z,a,S),le=await Ze(W,Z,S,d),Y=le[z.route.id];if(!Y){for(let X of Z)if(le[X.route.id]){Y=le[X.route.id];break}}if(W.signal.aborted){N.get(d)===P&&N.delete(d);return}if(be.has(d)){if(je(Y)||me(Y)){De(d,Me(void 0));return}}else{if(je(Y))if(N.delete(d),Ee>K){De(d,Me(void 0));return}else return ie.add(d),De(d,at(C)),$e(W,Y,!1,{fetcherSubmission:C,preventScrollReset:T});if(me(Y)){xe(d,m,Y.error);return}}let ye=y.navigation.location||y.location,Ue=Je(e.history,ye,P.signal),et=u||l,Fe=y.navigation.state!=="idle"?Pe(et,y.navigation.location,s):y.matches;O(Fe,"Didn't find any matches after fetcher action");let Se=++de;fe.set(d,Se);let Wt=at(C,Y.data);y.fetchers.set(d,Wt);let{dsMatches:tt,revalidatingFetchers:Ne}=Br(Ue,S,o,i,e.history,y,Fe,C,ye,a,!1,ne,oe,be,he,ie,et,s,e.patchRoutesOnNavigation!=null,[z.route.id,Y],F);Ne.filter(X=>X.key!==d).forEach(X=>{let St=X.key,Fr=y.fetchers.get(St),Rn=at(void 0,Fr?Fr.data:void 0);y.fetchers.set(St,Rn),Ce(St),X.controller&&N.set(St,X.controller)}),re({fetchers:new Map(y.fetchers)});let Et=()=>Ne.forEach(X=>Ce(X.key));P.signal.addEventListener("abort",Et);let{loaderResults:bt,fetcherResults:$}=await br(tt,Ne,Ue,S);if(P.signal.aborted)return;if(P.signal.removeEventListener("abort",Et),fe.delete(d),N.delete(d),Ne.forEach(X=>N.delete(X.key)),y.fetchers.has(d)){let X=Me(Y.data);y.fetchers.set(d,X)}let ae=Dt(bt);if(ae)return $e(Ue,ae.result,!1,{preventScrollReset:T});if(ae=Dt($),ae)return ie.add(ae.key),$e(Ue,ae.result,!1,{preventScrollReset:T});let{loaderData:Ye,errors:ze}=Xr(y,Fe,bt,void 0,Ne,$);xr(Se),y.navigation.state==="loading"&&Se>Ee?(O(U,"Expected pending action"),B&&B.abort(),Ve(y.navigation.location,{matches:Fe,loaderData:Ye,errors:ze,fetchers:new Map(y.fetchers)})):(re({errors:ze,loaderData:qr(y.loaderData,Ye,Fe,ze),fetchers:new Map(y.fetchers)}),ne=!1)}async function fn(d,m,v,E,S,M,x,T,C){let F=y.fetchers.get(d);De(d,at(C,F?F.data:void 0),{flushSync:x});let I=new AbortController,P=Je(e.history,v,I.signal);if(M){let Y=await Rt(E,new URL(P.url).pathname,P.signal,d);if(Y.type==="aborted")return;if(Y.type==="error"){xe(d,m,Y.error,{flushSync:x});return}else if(Y.matches)E=Y.matches;else{xe(d,m,ve(404,{pathname:v}),{flushSync:x});return}}let W=Pt(E,v);N.set(d,I);let z=de,K=Ge(o,i,P,E,W,a,S),le=(await Ze(P,K,S,d))[W.route.id];if(N.get(d)===I&&N.delete(d),!P.signal.aborted){if(be.has(d)){De(d,Me(void 0));return}if(je(le))if(Ee>z){De(d,Me(void 0));return}else{ie.add(d),await $e(P,le,!1,{preventScrollReset:T});return}if(me(le)){xe(d,m,le.error);return}De(d,Me(le.data))}}async function $e(d,m,v,{submission:E,fetcherSubmission:S,preventScrollReset:M,replace:x}={}){v||(V?.resolve(),V=null),m.response.headers.has("X-Remix-Revalidate")&&(ne=!0);let T=m.response.headers.get("Location");O(T,"Expected a Location header on the redirect Response"),T=Kr(T,new URL(d.url),s,e.history);let C=st(y.location,T,{_isRedirect:!0});if(r){let K=!1;if(m.response.headers.has("X-Remix-Reload-Document"))K=!0;else if(ir(T)){const Z=ha(T,!0);K=Z.origin!==t.location.origin||pe(Z.pathname,s)==null}if(K){x?t.location.replace(T):t.location.assign(T);return}}B=null;let F=x===!0||m.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:I,formAction:P,formEncType:W}=y.navigation;!E&&!S&&I&&P&&W&&(E=Zr(y.navigation));let z=E||S;if(uo.has(m.response.status)&&z&&ee(z.formMethod))await ke(F,C,{submission:{...z,formAction:T},preventScrollReset:M||te,enableViewTransition:v?ue:void 0});else{let K=Kt(C,E);await ke(F,C,{overrideNavigation:K,fetcherSubmission:S,preventScrollReset:M||te,enableViewTransition:v?ue:void 0})}}async function Ze(d,m,v,E){let S,M={};try{S=await Ro(f,d,m,E,v,!1)}catch(x){return m.filter(T=>T.shouldLoad).forEach(T=>{M[T.route.id]={type:"error",error:x}}),M}if(d.signal.aborted)return M;if(!ee(d.method))for(let x of m){if(S[x.route.id]?.type==="error")break;!S.hasOwnProperty(x.route.id)&&!y.loaderData.hasOwnProperty(x.route.id)&&(!y.errors||!y.errors.hasOwnProperty(x.route.id))&&x.shouldCallHandler()&&(S[x.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${x.route.id}`)})}for(let[x,T]of Object.entries(S))if(_o(T)){let C=T.result;M[x]={type:"redirect",response:Lo(C,d,x,m,s)}}else M[x]=await So(T);return M}async function br(d,m,v,E){let S=Ze(v,d,E,null),M=Promise.all(m.map(async C=>{if(C.matches&&C.match&&C.request&&C.controller){let I=(await Ze(C.request,C.matches,E,C.key))[C.match.route.id];return{[C.key]:I}}else return Promise.resolve({[C.key]:{type:"error",error:ve(404,{pathname:C.path})}})})),x=await S,T=(await M).reduce((C,F)=>Object.assign(C,F),{});return{loaderResults:x,fetcherResults:T}}function jt(){ne=!0,he.forEach((d,m)=>{N.has(m)&&oe.add(m),Ce(m)})}function De(d,m,v={}){y.fetchers.set(d,m),re({fetchers:new Map(y.fetchers)},{flushSync:(v&&v.flushSync)===!0})}function xe(d,m,v,E={}){let S=Ie(y.matches,m);Ht(d),re({errors:{[S.route.id]:v},fetchers:new Map(y.fetchers)},{flushSync:(E&&E.flushSync)===!0})}function Sr(d){return Te.set(d,(Te.get(d)||0)+1),be.has(d)&&be.delete(d),y.fetchers.get(d)||co}function hn(d,m){Ce(d,m?.reason),De(d,Me(null))}function Ht(d){let m=y.fetchers.get(d);N.has(d)&&!(m&&m.state==="loading"&&fe.has(d))&&Ce(d),he.delete(d),fe.delete(d),ie.delete(d),be.delete(d),oe.delete(d),y.fetchers.delete(d)}function mn(d){let m=(Te.get(d)||0)-1;m<=0?(Te.delete(d),be.add(d)):Te.set(d,m),re({fetchers:new Map(y.fetchers)})}function Ce(d,m){let v=N.get(d);v&&(v.abort(m),N.delete(d))}function Lr(d){for(let m of d){let v=Sr(m),E=Me(v.data);y.fetchers.set(m,E)}}function Dr(){let d=[],m=!1;for(let v of ie){let E=y.fetchers.get(v);O(E,`Expected fetcher: ${v}`),E.state==="loading"&&(ie.delete(v),d.push(v),m=!0)}return Lr(d),m}function xr(d){let m=[];for(let[v,E]of fe)if(E<d){let S=y.fetchers.get(v);O(S,`Expected fetcher: ${v}`),S.state==="loading"&&(Ce(v),fe.delete(v),m.push(v))}return Lr(m),m.length>0}function pn(d,m){let v=y.blockers.get(d)||rt;return Ae.get(d)!==m&&Ae.set(d,m),v}function Cr(d){y.blockers.delete(d),Ae.delete(d)}function gt(d,m){let v=y.blockers.get(d)||rt;O(v.state==="unblocked"&&m.state==="blocked"||v.state==="blocked"&&m.state==="blocked"||v.state==="blocked"&&m.state==="proceeding"||v.state==="blocked"&&m.state==="unblocked"||v.state==="proceeding"&&m.state==="unblocked",`Invalid blocker state transition: ${v.state} -> ${m.state}`);let E=new Map(y.blockers);E.set(d,m),re({blockers:E})}function Mr({currentLocation:d,nextLocation:m,historyAction:v}){if(Ae.size===0)return;Ae.size>1&&Q(!1,"A router only supports one blocker at a time");let E=Array.from(Ae.entries()),[S,M]=E[E.length-1],x=y.blockers.get(S);if(!(x&&x.state==="proceeding")&&M({currentLocation:d,nextLocation:m,historyAction:v}))return S}function Bt(d){let m=ve(404,{pathname:d}),v=u||l,{matches:E,route:S}=Lt(v);return{notFoundMatches:E,route:S,error:m}}function yn(d,m,v){if(w=d,R=m,b=v||null,!L&&y.navigation===Jt){L=!0;let E=_r(y.location,y.matches);E!=null&&re({restoreScrollPosition:E})}return()=>{w=null,R=null,b=null}}function Pr(d,m){return b&&b(d,m.map(E=>ma(E,y.loaderData)))||d.key}function vn(d,m){if(w&&R){let v=Pr(d,m);w[v]=R()}}function _r(d,m){if(w){let v=Pr(d,m),E=w[v];if(typeof E=="number")return E}return null}function wt(d,m,v){if(e.patchRoutesOnNavigation)if(d){if(Object.keys(d[0].params).length>0)return{active:!0,matches:it(m,v,s,!0)}}else return{active:!0,matches:it(m,v,s,!0)||[]};return{active:!1,matches:null}}async function Rt(d,m,v,E){if(!e.patchRoutesOnNavigation)return{type:"success",matches:d};let S=d;for(;;){let M=u==null,x=u||l,T=i;try{await e.patchRoutesOnNavigation({signal:v,path:m,matches:S,fetcherKey:E,patch:(I,P)=>{v.aborted||Wr(I,P,x,T,o,!1)}})}catch(I){return{type:"error",error:I,partialMatches:S}}finally{M&&!v.aborted&&(l=[...l])}if(v.aborted)return{type:"aborted"};let C=Pe(x,m,s),F=null;if(C){if(Object.keys(C[0].params).length===0)return{type:"success",matches:C};if(F=it(x,m,s,!0),!(F&&S.length<F.length&&Tr(S,F.slice(0,S.length))))return{type:"success",matches:C}}if(F||(F=it(x,m,s,!0)),!F||Tr(S,F))return{type:"success",matches:null};S=F}}function Tr(d,m){return d.length===m.length&&d.every((v,E)=>v.route.id===m[E].route.id)}function gn(d){i={},u=ut(d,o,void 0,i)}function wn(d,m,v=!1){let E=u==null;Wr(d,m,u||l,i,o,v),E&&(l=[...l],re({}))}return G={get basename(){return s},get future(){return c},get state(){return y},get routes(){return l},get window(){return t},initialize:rn,subscribe:nn,enableScrollRestoration:yn,navigate:Rr,fetch:cn,revalidate:on,createHref:d=>e.history.createHref(d),encodeLocation:d=>e.history.encodeLocation(d),getFetcher:Sr,resetFetcher:hn,deleteFetcher:mn,dispose:an,getBlocker:pn,deleteBlocker:Cr,patchRoutes:wn,_internalFetchControllers:N,_internalSetRoutes:gn,_internalSetStateDoNotUseOrYouWillBreakYourApp(d){re(d)}},e.unstable_instrumentations&&(G=to(G,e.unstable_instrumentations.map(d=>d.router).filter(Boolean))),G}function mo(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function qt(e,t,r,a,n,o){let i,l;if(n){i=[];for(let s of t)if(i.push(s),s.route.id===n){l=s;break}}else i=t,l=t[t.length-1];let u=kt(a||".",lr(i),pe(e.pathname,r)||e.pathname,o==="path");if(a==null&&(u.search=e.search,u.hash=e.hash),(a==null||a===""||a===".")&&l){let s=ur(u.search);if(l.route.index&&!s)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&s){let f=new URLSearchParams(u.search),c=f.getAll("index");f.delete("index"),c.filter(g=>g).forEach(g=>f.append("index",g));let p=f.toString();u.search=p?`?${p}`:""}}return r!=="/"&&(u.pathname=Yn({basename:r,pathname:u.pathname})),Le(u)}function Hr(e,t,r){if(!r||!mo(r))return{path:t};if(r.formMethod&&!Io(r.formMethod))return{path:t,error:ve(405,{method:r.formMethod})};let a=()=>({path:t,error:ve(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=Fa(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ee(o))return a();let c=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,[g,w])=>`${p}${g}=${w}
1
+ import{r as h,R as En,W as se,a as bn}from"./react-Dk3PRQ9V.js";var fa=e=>{throw TypeError(e)},Sn=(e,t,r)=>t.has(e)||fa("Cannot "+r),Vt=(e,t,r)=>(Sn(e,t,"read from private field"),r?r.call(e):t.get(e)),Ln=(e,t,r)=>t.has(e)?fa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ir="popstate";function Or(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Dn(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:u}=o||a.location;return st("",{pathname:i,search:l,hash:u},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:Le(n)}return Cn(t,r,null,e)}function O(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Q(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xn(){return Math.random().toString(36).substring(2,10)}function Ar(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function st(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?_e(t):t,state:r,key:t&&t.key||a||xn(),unstable_mask:n}}function Le({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function _e(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function Cn(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",u=null,s=f();s==null&&(s=0,i.replaceState({...i.state,idx:s},""));function f(){return(i.state||{idx:null}).idx}function c(){l="POP";let R=f(),L=R==null?null:R-s;s=R,u&&u({action:l,location:b.location,delta:L})}function p(R,L){l="PUSH";let D=Or(R)?R:st(b.location,R,L);s=f()+1;let _=Ar(D,s),H=b.createHref(D.unstable_mask||D);try{i.pushState(_,"",H)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;n.location.assign(H)}o&&u&&u({action:l,location:b.location,delta:1})}function g(R,L){l="REPLACE";let D=Or(R)?R:st(b.location,R,L);s=f();let _=Ar(D,s),H=b.createHref(D.unstable_mask||D);i.replaceState(_,"",H),o&&u&&u({action:l,location:b.location,delta:0})}function w(R){return ha(R)}let b={get action(){return l},get location(){return e(n,i)},listen(R){if(u)throw new Error("A history only accepts one active listener");return n.addEventListener(Ir,c),u=R,()=>{n.removeEventListener(Ir,c),u=null}},createHref(R){return t(n,R)},createURL:w,encodeLocation(R){let L=w(R);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:p,replace:g,go(R){return i.go(R)}};return b}function ha(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),O(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Le(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}function Mn(e){return{defaultValue:e}}var ot,kr=class{constructor(e){if(Ln(this,ot,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Vt(this,ot).has(e))return Vt(this,ot).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Vt(this,ot).set(e,t)}};ot=new WeakMap;var Pn=new Set(["lazy","caseSensitive","path","id","index","children"]);function _n(e){return Pn.has(e)}var Tn=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Fn(e){return Tn.has(e)}function In(e){return e.index===!0}function ut(e,t,r=[],a={},n=!1){return e.map((o,i)=>{let l=[...r,String(i)],u=typeof o.id=="string"?o.id:l.join("-");if(O(o.index!==!0||!o.children,"Cannot specify children on an index route"),O(n||!a[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),In(o)){let s={...o,id:u};return a[u]=$r(s,t(s)),s}else{let s={...o,id:u,children:void 0};return a[u]=$r(s,t(s)),o.children&&(s.children=ut(o.children,t,l,a,n)),s}})}function $r(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Pe(e,t,r="/"){return it(e,t,r,!1)}function it(e,t,r,a){let n=typeof t=="string"?_e(t):t,o=pe(n.pathname||"/",r);if(o==null)return null;let i=pa(e);On(i);let l=null;for(let u=0;l==null&&u<i.length;++u){let s=Vn(o);l=Bn(i[u],s,a)}return l}function ma(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function pa(e,t=[],r=[],a="",n=!1){let o=(i,l,u=n,s)=>{let f={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(a)&&u)return;O(f.relativePath.startsWith(a),`Absolute route path "${f.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(a.length)}let c=ge([a,f.relativePath]),p=r.concat(f);i.children&&i.children.length>0&&(O(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),pa(i.children,t,p,c,u)),!(i.path==null&&!i.index)&&t.push({path:c,score:jn(c,i.index),routesMeta:p})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let u of ya(i.path))o(i,l,!0,u)}),t}function ya(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=ya(a.join("/")),l=[];return l.push(...i.map(u=>u===""?o:[o,u].join("/"))),n&&l.push(...i),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function On(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Hn(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var An=/^:[\w-]+$/,kn=3,$n=2,Un=1,Nn=10,zn=-2,Ur=e=>e==="*";function jn(e,t){let r=e.split("/"),a=r.length;return r.some(Ur)&&(a+=zn),t&&(a+=$n),r.filter(n=>!Ur(n)).reduce((n,o)=>n+(An.test(o)?kn:o===""?Un:Nn),a)}function Hn(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Bn(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let u=a[l],s=l===a.length-1,f=o==="/"?t:t.slice(o.length)||"/",c=It({path:u.relativePath,caseSensitive:u.caseSensitive,end:s},f),p=u.route;if(!c&&s&&r&&!a[a.length-1].route.index&&(c=It({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!c)return null;Object.assign(n,c.params),i.push({params:n,pathname:ge([o,c.pathname]),pathnameBase:Kn(ge([o,c.pathnameBase])),route:p}),c.pathnameBase!=="/"&&(o=ge([o,c.pathnameBase]))}return i}function It(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Wn(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),l=n.slice(1);return{params:a.reduce((s,{paramName:f,isOptional:c},p)=>{if(f==="*"){let w=l[p]||"";i=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const g=l[p];return c&&!g?s[f]=void 0:s[f]=(g||"").replace(/%2F/g,"/"),s},{}),pathname:o,pathnameBase:i,pattern:e}}function Wn(e,t=!1,r=!0){Q(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 a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,u,s,f)=>{if(a.push({paramName:l,isOptional:u!=null}),u){let c=f.charAt(s+i.length);return c&&c!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Vn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Q(!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 pe(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Yn({basename:e,pathname:t}){return t==="/"?e:ge([e,t])}var va=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ir=e=>va.test(e);function Jn(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?_e(e):e,o;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?o=Nr(r.substring(1),"/"):o=Nr(r,t)):o=t,{pathname:o,search:Gn(a),hash:Xn(n)}}function Nr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Yt(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ga(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function lr(e){let t=ga(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function kt(e,t,r,a=!1){let n;typeof e=="string"?n=_e(e):(n={...e},O(!n.pathname||!n.pathname.includes("?"),Yt("?","pathname","search",n)),O(!n.pathname||!n.pathname.includes("#"),Yt("#","pathname","hash",n)),O(!n.search||!n.search.includes("#"),Yt("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let c=t.length-1;if(!a&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),c-=1;n.pathname=p.join("/")}l=c>=0?t[c]:"/"}let u=Jn(n,l),s=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(s||f)&&(u.pathname+="/"),u}var ge=e=>e.join("/").replace(/\/\/+/g,"/"),Kn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Gn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Xn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,qn=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function Qn(e,t){return new qn(e,typeof t=="number"?{status:t}:t)}var Zn=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let a=new Headers(r.headers);return a.set("Location",e),new Response(null,{...r,headers:a})},Be=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function He(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ct(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var wa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ra(e,t){let r=e;if(typeof r!="string"||!va.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(wa)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),l=pe(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{Q(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var Oe=Symbol("Uninstrumented");function eo(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(n=>n({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let l of i)o[l]&&r[l].push(o[l])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let n=Ke(r.lazy,t.lazy,()=>{});n&&(a.lazy=n)}if(typeof t.lazy=="object"){let n=t.lazy;["middleware","loader","action"].forEach(o=>{let i=n[o],l=r[`lazy.${o}`];if(typeof i=="function"&&l.length>0){let u=Ke(l,i,()=>{});u&&(a.lazy=Object.assign(a.lazy||{},{[o]:u}))}})}return["loader","action"].forEach(n=>{let o=t[n];if(typeof o=="function"&&r[n].length>0){let i=o[Oe]??o,l=Ke(r[n],i,(...u)=>zr(u[0]));l&&(n==="loader"&&i.hydrate===!0&&(l.hydrate=!0),l[Oe]=i,a[n]=l)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(n=>{let o=n[Oe]??n,i=Ke(r.middleware,o,(...l)=>zr(l[0]));return i?(i[Oe]=o,i):n})),a}function to(e,t){let r={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(n){let o=Object.keys(n);for(let i of o)n[i]&&r[i].push(n[i])}})),r.navigate.length>0){let a=e.navigate[Oe]??e.navigate,n=Ke(r.navigate,a,(...o)=>{let[i,l]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?Le(i):".",...jr(e,l??{})}});n&&(n[Oe]=a,e.navigate=n)}if(r.fetch.length>0){let a=e.fetch[Oe]??e.fetch,n=Ke(r.fetch,a,(...o)=>{let[i,,l,u]=o;return{href:l??".",fetcherKey:i,...jr(e,u??{})}});n&&(n[Oe]=a,e.fetch=n)}return e}function Ke(e,t,r){return e.length===0?null:async(...a)=>{let n=await Ea(e,r(...a),()=>t(...a),e.length-1);if(n.type==="error")throw n.value;return n.value}}async function Ea(e,t,r,a){let n=e[a],o;if(n){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Ea(e,t,r,a-1),o=await i,O(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await n(l,t)}catch(u){console.error("An instrumentation function threw an error:",u)}i||await l(),await i}else try{o={type:"success",value:await r()}}catch(i){o={type:"error",value:i}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function zr(e){let{request:t,context:r,params:a,unstable_pattern:n}=e;return{request:ro(t),params:{...a},unstable_pattern:n,context:ao(r)}}function jr(e,t){return{currentUrl:Le(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 ro(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function ao(e){if(oo(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var no=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oo(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===no}var ba=["POST","PUT","PATCH","DELETE"],io=new Set(ba),lo=["GET",...ba],so=new Set(lo),Sa=new Set([301,302,303,307,308]),uo=new Set([307,308]),Jt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},co={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},rt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fo=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),La="remix-router-transitions",Da=Symbol("ResetLoaderData");function ho(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";O(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||fo,o=n;if(e.unstable_instrumentations){let d=e.unstable_instrumentations;o=m=>({...n(m),...eo(d.map(v=>v.route).filter(Boolean),m)})}let i={},l=ut(e.routes,o,void 0,i),u,s=e.basename||"/";s.startsWith("/")||(s=`/${s}`);let f=e.dataStrategy||go,c={...e.future},p=null,g=new Set,w=null,b=null,R=null,L=e.hydrationData!=null,D=Pe(l,e.history.location,s),_=!1,H=null,A,j;if(D==null&&!e.patchRoutesOnNavigation){let d=ve(404,{pathname:e.history.location.pathname}),{matches:m,route:v}=Lt(l);A=!0,j=!A,D=m,H={[v.id]:d}}else if(D&&!e.hydrationData&&wt(D,l,e.history.location.pathname).active&&(D=null),D)if(D.some(d=>d.route.lazy))A=!1,j=!A;else if(!D.some(d=>sr(d.route)))A=!0,j=!A;else{let d=e.hydrationData?e.hydrationData.loaderData:null,m=e.hydrationData?e.hydrationData.errors:null,v=D;if(m){let E=D.findIndex(S=>m[S.route.id]!==void 0);v=v.slice(0,E+1)}j=!1,A=v.every(E=>{let S=xa(E.route,d,m);return j=j||S.renderFallback,!S.shouldLoad})}else{A=!1,j=!A,D=[];let d=wt(null,l,e.history.location.pathname);d.active&&d.matches&&(_=!0,D=d.matches)}let G,y={historyAction:e.history.action,location:e.history.location,matches:D,initialized:A,renderFallback:j,navigation:Jt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||H,fetchers:new Map,blockers:new Map},U="POP",V=null,te=!1,B,ue=!1,J=new Map,k=null,q=!1,ne=!1,oe=new Set,N=new Map,de=0,Ee=-1,fe=new Map,ie=new Set,he=new Map,Te=new Map,be=new Set,Ae=new Map,vt,Qe=null;function rn(){if(p=e.history.listen(({action:d,location:m,delta:v})=>{if(vt){vt(),vt=void 0;return}Q(Ae.size===0||v!=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 E=Mr({currentLocation:y.location,nextLocation:m,historyAction:d});if(E&&v!=null){let S=new Promise(M=>{vt=M});e.history.go(v*-1),gt(E,{state:"blocked",location:m,proceed(){gt(E,{state:"proceeding",proceed:void 0,reset:void 0,location:m}),S.then(()=>e.history.go(v))},reset(){let M=new Map(y.blockers);M.set(E,rt),re({blockers:M})}}),V?.resolve(),V=null;return}return ke(d,m)}),r){ko(t,J);let d=()=>$o(t,J);t.addEventListener("pagehide",d),k=()=>t.removeEventListener("pagehide",d)}return y.initialized||ke("POP",y.location,{initialHydration:!0}),G}function an(){p&&p(),k&&k(),g.clear(),B&&B.abort(),y.fetchers.forEach((d,m)=>Ht(m)),y.blockers.forEach((d,m)=>Cr(m))}function nn(d){return g.add(d),()=>g.delete(d)}function re(d,m={}){d.matches&&(d.matches=d.matches.map(S=>{let M=i[S.route.id],x=S.route;return x.element!==M.element||x.errorElement!==M.errorElement||x.hydrateFallbackElement!==M.hydrateFallbackElement?{...S,route:M}:S})),y={...y,...d};let v=[],E=[];y.fetchers.forEach((S,M)=>{S.state==="idle"&&(be.has(M)?v.push(M):E.push(M))}),be.forEach(S=>{!y.fetchers.has(S)&&!N.has(S)&&v.push(S)}),[...g].forEach(S=>S(y,{deletedFetchers:v,newErrors:d.errors??null,viewTransitionOpts:m.viewTransitionOpts,flushSync:m.flushSync===!0})),v.forEach(S=>Ht(S)),E.forEach(S=>y.fetchers.delete(S))}function Ve(d,m,{flushSync:v}={}){let E=y.actionData!=null&&y.navigation.formMethod!=null&&ee(y.navigation.formMethod)&&y.navigation.state==="loading"&&d.state?._isRedirect!==!0,S;m.actionData?Object.keys(m.actionData).length>0?S=m.actionData:S=null:E?S=y.actionData:S=null;let M=m.loaderData?qr(y.loaderData,m.loaderData,m.matches||[],m.errors):y.loaderData,x=y.blockers;x.size>0&&(x=new Map(x),x.forEach((I,P)=>x.set(P,rt)));let T=q?!1:_r(d,m.matches||y.matches),C=te===!0||y.navigation.formMethod!=null&&ee(y.navigation.formMethod)&&d.state?._isRedirect!==!0;u&&(l=u,u=void 0),q||U==="POP"||(U==="PUSH"?e.history.push(d,d.state):U==="REPLACE"&&e.history.replace(d,d.state));let F;if(U==="POP"){let I=J.get(y.location.pathname);I&&I.has(d.pathname)?F={currentLocation:y.location,nextLocation:d}:J.has(d.pathname)&&(F={currentLocation:d,nextLocation:y.location})}else if(ue){let I=J.get(y.location.pathname);I?I.add(d.pathname):(I=new Set([d.pathname]),J.set(y.location.pathname,I)),F={currentLocation:y.location,nextLocation:d}}re({...m,actionData:S,loaderData:M,historyAction:U,location:d,initialized:!0,renderFallback:!1,navigation:Jt,revalidation:"idle",restoreScrollPosition:T,preventScrollReset:C,blockers:x},{viewTransitionOpts:F,flushSync:v===!0}),U="POP",te=!1,ue=!1,q=!1,ne=!1,V?.resolve(),V=null,Qe?.resolve(),Qe=null}async function Rr(d,m){if(V?.resolve(),V=null,typeof d=="number"){V||(V=ea());let K=V.promise;return e.history.go(d),K}let v=qt(y.location,y.matches,s,d,m?.fromRouteId,m?.relative),{path:E,submission:S,error:M}=Hr(!1,v,m),x;m?.unstable_mask&&(x={pathname:"",search:"",hash:"",...typeof m.unstable_mask=="string"?_e(m.unstable_mask):{...y.location.unstable_mask,...m.unstable_mask}});let T=y.location,C=st(T,E,m&&m.state,void 0,x);C={...C,...e.history.encodeLocation(C)};let F=m&&m.replace!=null?m.replace:void 0,I="PUSH";F===!0?I="REPLACE":F===!1||S!=null&&ee(S.formMethod)&&S.formAction===y.location.pathname+y.location.search&&(I="REPLACE");let P=m&&"preventScrollReset"in m?m.preventScrollReset===!0:void 0,W=(m&&m.flushSync)===!0,z=Mr({currentLocation:T,nextLocation:C,historyAction:I});if(z){gt(z,{state:"blocked",location:C,proceed(){gt(z,{state:"proceeding",proceed:void 0,reset:void 0,location:C}),Rr(d,m)},reset(){let K=new Map(y.blockers);K.set(z,rt),re({blockers:K})}});return}await ke(I,C,{submission:S,pendingError:M,preventScrollReset:P,replace:m&&m.replace,enableViewTransition:m&&m.viewTransition,flushSync:W,callSiteDefaultShouldRevalidate:m&&m.unstable_defaultShouldRevalidate})}function on(){Qe||(Qe=ea()),jt(),re({revalidation:"loading"});let d=Qe.promise;return y.navigation.state==="submitting"?d:y.navigation.state==="idle"?(ke(y.historyAction,y.location,{startUninterruptedRevalidation:!0}),d):(ke(U||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:ue===!0}),d)}async function ke(d,m,v){B&&B.abort(),B=null,U=d,q=(v&&v.startUninterruptedRevalidation)===!0,vn(y.location,y.matches),te=(v&&v.preventScrollReset)===!0,ue=(v&&v.enableViewTransition)===!0;let E=u||l,S=v&&v.overrideNavigation,M=v?.initialHydration&&y.matches&&y.matches.length>0&&!_?y.matches:Pe(E,m,s),x=(v&&v.flushSync)===!0;if(M&&y.initialized&&!ne&&xo(y.location,m)&&!(v&&v.submission&&ee(v.submission.formMethod))){Ve(m,{matches:M},{flushSync:x});return}let T=wt(M,E,m.pathname);if(T.active&&T.matches&&(M=T.matches),!M){let{error:Z,notFoundMatches:le,route:Y}=Bt(m.pathname);Ve(m,{matches:le,loaderData:{},errors:{[Y.id]:Z}},{flushSync:x});return}B=new AbortController;let C=Je(e.history,m,B.signal,v&&v.submission),F=e.getContext?await e.getContext():new kr,I;if(v&&v.pendingError)I=[Ie(M).route.id,{type:"error",error:v.pendingError}];else if(v&&v.submission&&ee(v.submission.formMethod)){let Z=await ln(C,m,v.submission,M,F,T.active,v&&v.initialHydration===!0,{replace:v.replace,flushSync:x});if(Z.shortCircuited)return;if(Z.pendingActionResult){let[le,Y]=Z.pendingActionResult;if(me(Y)&&He(Y.error)&&Y.error.status===404){B=null,Ve(m,{matches:Z.matches,loaderData:{},errors:{[le]:Y.error}});return}}M=Z.matches||M,I=Z.pendingActionResult,S=Kt(m,v.submission),x=!1,T.active=!1,C=Je(e.history,C.url,C.signal)}let{shortCircuited:P,matches:W,loaderData:z,errors:K}=await sn(C,m,M,F,T.active,S,v&&v.submission,v&&v.fetcherSubmission,v&&v.replace,v&&v.initialHydration===!0,x,I,v&&v.callSiteDefaultShouldRevalidate);P||(B=null,Ve(m,{matches:W||M,...Qr(I),loaderData:z,errors:K}))}async function ln(d,m,v,E,S,M,x,T={}){jt();let C=Oo(m,v);if(re({navigation:C},{flushSync:T.flushSync===!0}),M){let P=await Rt(E,m.pathname,d.signal);if(P.type==="aborted")return{shortCircuited:!0};if(P.type==="error"){if(P.partialMatches.length===0){let{matches:z,route:K}=Lt(l);return{matches:z,pendingActionResult:[K.id,{type:"error",error:P.error}]}}let W=Ie(P.partialMatches).route.id;return{matches:P.partialMatches,pendingActionResult:[W,{type:"error",error:P.error}]}}else if(P.matches)E=P.matches;else{let{notFoundMatches:W,error:z,route:K}=Bt(m.pathname);return{matches:W,pendingActionResult:[K.id,{type:"error",error:z}]}}}let F,I=Pt(E,m);if(!I.route.action&&!I.route.lazy)F={type:"error",error:ve(405,{method:d.method,pathname:m.pathname,routeId:I.route.id})};else{let P=Ge(o,i,d,E,I,x?[]:a,S),W=await Ze(d,P,S,null);if(F=W[I.route.id],!F){for(let z of E)if(W[z.route.id]){F=W[z.route.id];break}}if(d.signal.aborted)return{shortCircuited:!0}}if(je(F)){let P;return T&&T.replace!=null?P=T.replace:P=Kr(F.response.headers.get("Location"),new URL(d.url),s,e.history)===y.location.pathname+y.location.search,await $e(d,F,!0,{submission:v,replace:P}),{shortCircuited:!0}}if(me(F)){let P=Ie(E,I.route.id);return(T&&T.replace)!==!0&&(U="PUSH"),{matches:E,pendingActionResult:[P.route.id,F,I.route.id]}}return{matches:E,pendingActionResult:[I.route.id,F]}}async function sn(d,m,v,E,S,M,x,T,C,F,I,P,W){let z=M||Kt(m,x),K=x||T||Zr(z),Z=!q&&!F;if(S){if(Z){let ae=Er(P);re({navigation:z,...ae!==void 0?{actionData:ae}:{}},{flushSync:I})}let $=await Rt(v,m.pathname,d.signal);if($.type==="aborted")return{shortCircuited:!0};if($.type==="error"){if($.partialMatches.length===0){let{matches:Ye,route:ze}=Lt(l);return{matches:Ye,loaderData:{},errors:{[ze.id]:$.error}}}let ae=Ie($.partialMatches).route.id;return{matches:$.partialMatches,loaderData:{},errors:{[ae]:$.error}}}else if($.matches)v=$.matches;else{let{error:ae,notFoundMatches:Ye,route:ze}=Bt(m.pathname);return{matches:Ye,loaderData:{},errors:{[ze.id]:ae}}}}let le=u||l,{dsMatches:Y,revalidatingFetchers:ye}=Br(d,E,o,i,e.history,y,v,K,m,F?[]:a,F===!0,ne,oe,be,he,ie,le,s,e.patchRoutesOnNavigation!=null,P,W);if(Ee=++de,!e.dataStrategy&&!Y.some($=>$.shouldLoad)&&!Y.some($=>$.route.middleware&&$.route.middleware.length>0)&&ye.length===0){let $=Dr();return Ve(m,{matches:v,loaderData:{},errors:P&&me(P[1])?{[P[0]]:P[1].error}:null,...Qr(P),...$?{fetchers:new Map(y.fetchers)}:{}},{flushSync:I}),{shortCircuited:!0}}if(Z){let $={};if(!S){$.navigation=z;let ae=Er(P);ae!==void 0&&($.actionData=ae)}ye.length>0&&($.fetchers=un(ye)),re($,{flushSync:I})}ye.forEach($=>{Ce($.key),$.controller&&N.set($.key,$.controller)});let Ue=()=>ye.forEach($=>Ce($.key));B&&B.signal.addEventListener("abort",Ue);let{loaderResults:et,fetcherResults:Fe}=await br(Y,ye,d,E);if(d.signal.aborted)return{shortCircuited:!0};B&&B.signal.removeEventListener("abort",Ue),ye.forEach($=>N.delete($.key));let Se=Dt(et);if(Se)return await $e(d,Se.result,!0,{replace:C}),{shortCircuited:!0};if(Se=Dt(Fe),Se)return ie.add(Se.key),await $e(d,Se.result,!0,{replace:C}),{shortCircuited:!0};let{loaderData:Wt,errors:tt}=Xr(y,v,et,P,ye,Fe);F&&y.errors&&(tt={...y.errors,...tt});let Ne=Dr(),Et=xr(Ee),bt=Ne||Et||ye.length>0;return{matches:v,loaderData:Wt,errors:tt,...bt?{fetchers:new Map(y.fetchers)}:{}}}function Er(d){if(d&&!me(d[1]))return{[d[0]]:d[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function un(d){return d.forEach(m=>{let v=y.fetchers.get(m.key),E=at(void 0,v?v.data:void 0);y.fetchers.set(m.key,E)}),new Map(y.fetchers)}async function cn(d,m,v,E){Ce(d);let S=(E&&E.flushSync)===!0,M=u||l,x=qt(y.location,y.matches,s,v,m,E?.relative),T=Pe(M,x,s),C=wt(T,M,x);if(C.active&&C.matches&&(T=C.matches),!T){xe(d,m,ve(404,{pathname:x}),{flushSync:S});return}let{path:F,submission:I,error:P}=Hr(!0,x,E);if(P){xe(d,m,P,{flushSync:S});return}let W=e.getContext?await e.getContext():new kr,z=(E&&E.preventScrollReset)===!0;if(I&&ee(I.formMethod)){await dn(d,m,F,T,W,C.active,S,z,I,E&&E.unstable_defaultShouldRevalidate);return}he.set(d,{routeId:m,path:F}),await fn(d,m,F,T,W,C.active,S,z,I)}async function dn(d,m,v,E,S,M,x,T,C,F){jt(),he.delete(d);let I=y.fetchers.get(d);De(d,Ao(C,I),{flushSync:x});let P=new AbortController,W=Je(e.history,v,P.signal,C);if(M){let X=await Rt(E,new URL(W.url).pathname,W.signal,d);if(X.type==="aborted")return;if(X.type==="error"){xe(d,m,X.error,{flushSync:x});return}else if(X.matches)E=X.matches;else{xe(d,m,ve(404,{pathname:v}),{flushSync:x});return}}let z=Pt(E,v);if(!z.route.action&&!z.route.lazy){let X=ve(405,{method:C.formMethod,pathname:v,routeId:m});xe(d,m,X,{flushSync:x});return}N.set(d,P);let K=de,Z=Ge(o,i,W,E,z,a,S),le=await Ze(W,Z,S,d),Y=le[z.route.id];if(!Y){for(let X of Z)if(le[X.route.id]){Y=le[X.route.id];break}}if(W.signal.aborted){N.get(d)===P&&N.delete(d);return}if(be.has(d)){if(je(Y)||me(Y)){De(d,Me(void 0));return}}else{if(je(Y))if(N.delete(d),Ee>K){De(d,Me(void 0));return}else return ie.add(d),De(d,at(C)),$e(W,Y,!1,{fetcherSubmission:C,preventScrollReset:T});if(me(Y)){xe(d,m,Y.error);return}}let ye=y.navigation.location||y.location,Ue=Je(e.history,ye,P.signal),et=u||l,Fe=y.navigation.state!=="idle"?Pe(et,y.navigation.location,s):y.matches;O(Fe,"Didn't find any matches after fetcher action");let Se=++de;fe.set(d,Se);let Wt=at(C,Y.data);y.fetchers.set(d,Wt);let{dsMatches:tt,revalidatingFetchers:Ne}=Br(Ue,S,o,i,e.history,y,Fe,C,ye,a,!1,ne,oe,be,he,ie,et,s,e.patchRoutesOnNavigation!=null,[z.route.id,Y],F);Ne.filter(X=>X.key!==d).forEach(X=>{let St=X.key,Fr=y.fetchers.get(St),Rn=at(void 0,Fr?Fr.data:void 0);y.fetchers.set(St,Rn),Ce(St),X.controller&&N.set(St,X.controller)}),re({fetchers:new Map(y.fetchers)});let Et=()=>Ne.forEach(X=>Ce(X.key));P.signal.addEventListener("abort",Et);let{loaderResults:bt,fetcherResults:$}=await br(tt,Ne,Ue,S);if(P.signal.aborted)return;if(P.signal.removeEventListener("abort",Et),fe.delete(d),N.delete(d),Ne.forEach(X=>N.delete(X.key)),y.fetchers.has(d)){let X=Me(Y.data);y.fetchers.set(d,X)}let ae=Dt(bt);if(ae)return $e(Ue,ae.result,!1,{preventScrollReset:T});if(ae=Dt($),ae)return ie.add(ae.key),$e(Ue,ae.result,!1,{preventScrollReset:T});let{loaderData:Ye,errors:ze}=Xr(y,Fe,bt,void 0,Ne,$);xr(Se),y.navigation.state==="loading"&&Se>Ee?(O(U,"Expected pending action"),B&&B.abort(),Ve(y.navigation.location,{matches:Fe,loaderData:Ye,errors:ze,fetchers:new Map(y.fetchers)})):(re({errors:ze,loaderData:qr(y.loaderData,Ye,Fe,ze),fetchers:new Map(y.fetchers)}),ne=!1)}async function fn(d,m,v,E,S,M,x,T,C){let F=y.fetchers.get(d);De(d,at(C,F?F.data:void 0),{flushSync:x});let I=new AbortController,P=Je(e.history,v,I.signal);if(M){let Y=await Rt(E,new URL(P.url).pathname,P.signal,d);if(Y.type==="aborted")return;if(Y.type==="error"){xe(d,m,Y.error,{flushSync:x});return}else if(Y.matches)E=Y.matches;else{xe(d,m,ve(404,{pathname:v}),{flushSync:x});return}}let W=Pt(E,v);N.set(d,I);let z=de,K=Ge(o,i,P,E,W,a,S),le=(await Ze(P,K,S,d))[W.route.id];if(N.get(d)===I&&N.delete(d),!P.signal.aborted){if(be.has(d)){De(d,Me(void 0));return}if(je(le))if(Ee>z){De(d,Me(void 0));return}else{ie.add(d),await $e(P,le,!1,{preventScrollReset:T});return}if(me(le)){xe(d,m,le.error);return}De(d,Me(le.data))}}async function $e(d,m,v,{submission:E,fetcherSubmission:S,preventScrollReset:M,replace:x}={}){v||(V?.resolve(),V=null),m.response.headers.has("X-Remix-Revalidate")&&(ne=!0);let T=m.response.headers.get("Location");O(T,"Expected a Location header on the redirect Response"),T=Kr(T,new URL(d.url),s,e.history);let C=st(y.location,T,{_isRedirect:!0});if(r){let K=!1;if(m.response.headers.has("X-Remix-Reload-Document"))K=!0;else if(ir(T)){const Z=ha(T,!0);K=Z.origin!==t.location.origin||pe(Z.pathname,s)==null}if(K){x?t.location.replace(T):t.location.assign(T);return}}B=null;let F=x===!0||m.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:I,formAction:P,formEncType:W}=y.navigation;!E&&!S&&I&&P&&W&&(E=Zr(y.navigation));let z=E||S;if(uo.has(m.response.status)&&z&&ee(z.formMethod))await ke(F,C,{submission:{...z,formAction:T},preventScrollReset:M||te,enableViewTransition:v?ue:void 0});else{let K=Kt(C,E);await ke(F,C,{overrideNavigation:K,fetcherSubmission:S,preventScrollReset:M||te,enableViewTransition:v?ue:void 0})}}async function Ze(d,m,v,E){let S,M={};try{S=await Ro(f,d,m,E,v,!1)}catch(x){return m.filter(T=>T.shouldLoad).forEach(T=>{M[T.route.id]={type:"error",error:x}}),M}if(d.signal.aborted)return M;if(!ee(d.method))for(let x of m){if(S[x.route.id]?.type==="error")break;!S.hasOwnProperty(x.route.id)&&!y.loaderData.hasOwnProperty(x.route.id)&&(!y.errors||!y.errors.hasOwnProperty(x.route.id))&&x.shouldCallHandler()&&(S[x.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${x.route.id}`)})}for(let[x,T]of Object.entries(S))if(_o(T)){let C=T.result;M[x]={type:"redirect",response:Lo(C,d,x,m,s)}}else M[x]=await So(T);return M}async function br(d,m,v,E){let S=Ze(v,d,E,null),M=Promise.all(m.map(async C=>{if(C.matches&&C.match&&C.request&&C.controller){let I=(await Ze(C.request,C.matches,E,C.key))[C.match.route.id];return{[C.key]:I}}else return Promise.resolve({[C.key]:{type:"error",error:ve(404,{pathname:C.path})}})})),x=await S,T=(await M).reduce((C,F)=>Object.assign(C,F),{});return{loaderResults:x,fetcherResults:T}}function jt(){ne=!0,he.forEach((d,m)=>{N.has(m)&&oe.add(m),Ce(m)})}function De(d,m,v={}){y.fetchers.set(d,m),re({fetchers:new Map(y.fetchers)},{flushSync:(v&&v.flushSync)===!0})}function xe(d,m,v,E={}){let S=Ie(y.matches,m);Ht(d),re({errors:{[S.route.id]:v},fetchers:new Map(y.fetchers)},{flushSync:(E&&E.flushSync)===!0})}function Sr(d){return Te.set(d,(Te.get(d)||0)+1),be.has(d)&&be.delete(d),y.fetchers.get(d)||co}function hn(d,m){Ce(d,m?.reason),De(d,Me(null))}function Ht(d){let m=y.fetchers.get(d);N.has(d)&&!(m&&m.state==="loading"&&fe.has(d))&&Ce(d),he.delete(d),fe.delete(d),ie.delete(d),be.delete(d),oe.delete(d),y.fetchers.delete(d)}function mn(d){let m=(Te.get(d)||0)-1;m<=0?(Te.delete(d),be.add(d)):Te.set(d,m),re({fetchers:new Map(y.fetchers)})}function Ce(d,m){let v=N.get(d);v&&(v.abort(m),N.delete(d))}function Lr(d){for(let m of d){let v=Sr(m),E=Me(v.data);y.fetchers.set(m,E)}}function Dr(){let d=[],m=!1;for(let v of ie){let E=y.fetchers.get(v);O(E,`Expected fetcher: ${v}`),E.state==="loading"&&(ie.delete(v),d.push(v),m=!0)}return Lr(d),m}function xr(d){let m=[];for(let[v,E]of fe)if(E<d){let S=y.fetchers.get(v);O(S,`Expected fetcher: ${v}`),S.state==="loading"&&(Ce(v),fe.delete(v),m.push(v))}return Lr(m),m.length>0}function pn(d,m){let v=y.blockers.get(d)||rt;return Ae.get(d)!==m&&Ae.set(d,m),v}function Cr(d){y.blockers.delete(d),Ae.delete(d)}function gt(d,m){let v=y.blockers.get(d)||rt;O(v.state==="unblocked"&&m.state==="blocked"||v.state==="blocked"&&m.state==="blocked"||v.state==="blocked"&&m.state==="proceeding"||v.state==="blocked"&&m.state==="unblocked"||v.state==="proceeding"&&m.state==="unblocked",`Invalid blocker state transition: ${v.state} -> ${m.state}`);let E=new Map(y.blockers);E.set(d,m),re({blockers:E})}function Mr({currentLocation:d,nextLocation:m,historyAction:v}){if(Ae.size===0)return;Ae.size>1&&Q(!1,"A router only supports one blocker at a time");let E=Array.from(Ae.entries()),[S,M]=E[E.length-1],x=y.blockers.get(S);if(!(x&&x.state==="proceeding")&&M({currentLocation:d,nextLocation:m,historyAction:v}))return S}function Bt(d){let m=ve(404,{pathname:d}),v=u||l,{matches:E,route:S}=Lt(v);return{notFoundMatches:E,route:S,error:m}}function yn(d,m,v){if(w=d,R=m,b=v||null,!L&&y.navigation===Jt){L=!0;let E=_r(y.location,y.matches);E!=null&&re({restoreScrollPosition:E})}return()=>{w=null,R=null,b=null}}function Pr(d,m){return b&&b(d,m.map(E=>ma(E,y.loaderData)))||d.key}function vn(d,m){if(w&&R){let v=Pr(d,m);w[v]=R()}}function _r(d,m){if(w){let v=Pr(d,m),E=w[v];if(typeof E=="number")return E}return null}function wt(d,m,v){if(e.patchRoutesOnNavigation)if(d){if(Object.keys(d[0].params).length>0)return{active:!0,matches:it(m,v,s,!0)}}else return{active:!0,matches:it(m,v,s,!0)||[]};return{active:!1,matches:null}}async function Rt(d,m,v,E){if(!e.patchRoutesOnNavigation)return{type:"success",matches:d};let S=d;for(;;){let M=u==null,x=u||l,T=i;try{await e.patchRoutesOnNavigation({signal:v,path:m,matches:S,fetcherKey:E,patch:(I,P)=>{v.aborted||Wr(I,P,x,T,o,!1)}})}catch(I){return{type:"error",error:I,partialMatches:S}}finally{M&&!v.aborted&&(l=[...l])}if(v.aborted)return{type:"aborted"};let C=Pe(x,m,s),F=null;if(C){if(Object.keys(C[0].params).length===0)return{type:"success",matches:C};if(F=it(x,m,s,!0),!(F&&S.length<F.length&&Tr(S,F.slice(0,S.length))))return{type:"success",matches:C}}if(F||(F=it(x,m,s,!0)),!F||Tr(S,F))return{type:"success",matches:null};S=F}}function Tr(d,m){return d.length===m.length&&d.every((v,E)=>v.route.id===m[E].route.id)}function gn(d){i={},u=ut(d,o,void 0,i)}function wn(d,m,v=!1){let E=u==null;Wr(d,m,u||l,i,o,v),E&&(l=[...l],re({}))}return G={get basename(){return s},get future(){return c},get state(){return y},get routes(){return l},get window(){return t},initialize:rn,subscribe:nn,enableScrollRestoration:yn,navigate:Rr,fetch:cn,revalidate:on,createHref:d=>e.history.createHref(d),encodeLocation:d=>e.history.encodeLocation(d),getFetcher:Sr,resetFetcher:hn,deleteFetcher:mn,dispose:an,getBlocker:pn,deleteBlocker:Cr,patchRoutes:wn,_internalFetchControllers:N,_internalSetRoutes:gn,_internalSetStateDoNotUseOrYouWillBreakYourApp(d){re(d)}},e.unstable_instrumentations&&(G=to(G,e.unstable_instrumentations.map(d=>d.router).filter(Boolean))),G}function mo(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function qt(e,t,r,a,n,o){let i,l;if(n){i=[];for(let s of t)if(i.push(s),s.route.id===n){l=s;break}}else i=t,l=t[t.length-1];let u=kt(a||".",lr(i),pe(e.pathname,r)||e.pathname,o==="path");if(a==null&&(u.search=e.search,u.hash=e.hash),(a==null||a===""||a===".")&&l){let s=ur(u.search);if(l.route.index&&!s)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&s){let f=new URLSearchParams(u.search),c=f.getAll("index");f.delete("index"),c.filter(g=>g).forEach(g=>f.append("index",g));let p=f.toString();u.search=p?`?${p}`:""}}return r!=="/"&&(u.pathname=Yn({basename:r,pathname:u.pathname})),Le(u)}function Hr(e,t,r){if(!r||!mo(r))return{path:t};if(r.formMethod&&!Io(r.formMethod))return{path:t,error:ve(405,{method:r.formMethod})};let a=()=>({path:t,error:ve(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=Fa(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ee(o))return a();let c=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,[g,w])=>`${p}${g}=${w}
2
2
  `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:c}}}else if(r.formEncType==="application/json"){if(!ee(o))return a();try{let c=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:c,text:void 0}}}catch{return a()}}}O(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=Zt(r.formData),u=r.formData;else if(r.body instanceof FormData)l=Zt(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=Gr(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=Gr(l)}catch{return a()}let s={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(ee(s.formMethod))return{path:t,submission:s};let f=_e(t);return e&&f.search&&ur(f.search)&&l.append("index",""),f.search=`?${l}`,{path:Le(f),submission:s}}function Br(e,t,r,a,n,o,i,l,u,s,f,c,p,g,w,b,R,L,D,_,H){let A=_?me(_[1])?_[1].error:_[1].data:void 0,j=n.createURL(o.location),G=n.createURL(u),y;if(f&&o.errors){let k=Object.keys(o.errors)[0];y=i.findIndex(q=>q.route.id===k)}else if(_&&me(_[1])){let k=_[0];y=i.findIndex(q=>q.route.id===k)-1}let U=_?_[1].statusCode:void 0,V=U&&U>=400,te={currentUrl:j,currentParams:o.matches[0]?.params||{},nextUrl:G,nextParams:i[0].params,...l,actionResult:A,actionStatus:U},B=ct(i),ue=i.map((k,q)=>{let{route:ne}=k,oe=null;if(y!=null&&q>y)oe=!1;else if(ne.lazy)oe=!0;else if(!sr(ne))oe=!1;else if(f){let{shouldLoad:fe}=xa(ne,o.loaderData,o.errors);oe=fe}else po(o.loaderData,o.matches[q],k)&&(oe=!0);if(oe!==null)return Qt(r,a,e,B,k,s,t,oe);let N=!1;typeof H=="boolean"?N=H:V?N=!1:(c||j.pathname+j.search===G.pathname+G.search||j.search!==G.search||yo(o.matches[q],k))&&(N=!0);let de={...te,defaultShouldRevalidate:N},Ee=lt(k,de);return Qt(r,a,e,B,k,s,t,Ee,de,H)}),J=[];return w.forEach((k,q)=>{if(f||!i.some(he=>he.route.id===k.routeId)||g.has(q))return;let ne=o.fetchers.get(q),oe=ne&&ne.state!=="idle"&&ne.data===void 0,N=Pe(R,k.path,L);if(!N){if(D&&oe)return;J.push({key:q,routeId:k.routeId,path:k.path,matches:null,match:null,request:null,controller:null});return}if(b.has(q))return;let de=Pt(N,k.path),Ee=new AbortController,fe=Je(n,k.path,Ee.signal),ie=null;if(p.has(q))p.delete(q),ie=Ge(r,a,fe,N,de,s,t);else if(oe)c&&(ie=Ge(r,a,fe,N,de,s,t));else{let he;typeof H=="boolean"?he=H:V?he=!1:he=c;let Te={...te,defaultShouldRevalidate:he};lt(de,Te)&&(ie=Ge(r,a,fe,N,de,s,t,Te))}ie&&J.push({key:q,routeId:k.routeId,path:k.path,matches:ie,match:de,request:fe,controller:Ee})}),{dsMatches:ue,revalidatingFetchers:J}}function sr(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function xa(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!sr(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,n=r!=null&&r[e.id]!==void 0;if(!a&&n)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let o=!a&&!n;return{shouldLoad:o,renderFallback:o}}function po(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function yo(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function lt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Wr(e,t,r,a,n,o){let i;if(e){let s=a[e];O(s,`No route found to patch children into: routeId = ${e}`),s.children||(s.children=[]),i=s.children}else i=r;let l=[],u=[];if(t.forEach(s=>{let f=i.find(c=>Ca(s,c));f?u.push({existingRoute:f,newRoute:s}):l.push(s)}),l.length>0){let s=ut(l,n,[e||"_","patch",String(i?.length||"0")],a);i.push(...s)}if(o&&u.length>0)for(let s=0;s<u.length;s++){let{existingRoute:f,newRoute:c}=u[s],p=f,[g]=ut([c],n,[],{},!0);Object.assign(p,{element:g.element?g.element:p.element,errorElement:g.errorElement?g.errorElement:p.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:p.hydrateFallbackElement})}}function Ca(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((r,a)=>t.children?.some(n=>Ca(r,n)))??!1:!1}var Vr=new WeakMap,Ma=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];if(O(n,"No route found in manifest"),!n.lazy||typeof n.lazy!="object")return;let o=n.lazy[e];if(!o)return;let i=Vr.get(n);i||(i={},Vr.set(n,i));let l=i[e];if(l)return l;let u=(async()=>{let s=_n(e),c=n[e]!==void 0&&e!=="hasErrorBoundary";if(s)Q(!s,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(c)Q(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let p=await o();p!=null&&(Object.assign(n,{[e]:p}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(p=>p===void 0)&&(n.lazy=void 0))})();return i[e]=u,u},Yr=new WeakMap;function vo(e,t,r,a,n){let o=r[e.id];if(O(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let f=Yr.get(o);if(f)return{lazyRoutePromise:f,lazyHandlerPromise:f};let c=(async()=>{O(typeof e.lazy=="function","No lazy route function found");let p=await e.lazy(),g={};for(let w in p){let b=p[w];if(b===void 0)continue;let R=Fn(w),D=o[w]!==void 0&&w!=="hasErrorBoundary";R?Q(!R,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):D?Q(!D,`Route "${o.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):g[w]=b}Object.assign(o,g),Object.assign(o,{...a(o),lazy:void 0})})();return Yr.set(o,c),c.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:c}}let i=Object.keys(e.lazy),l=[],u;for(let f of i){if(n&&n.includes(f))continue;let c=Ma({key:f,route:e,manifest:r,mapRouteProperties:a});c&&(l.push(c),f===t&&(u=c))}let s=l.length>0?Promise.all(l).then(()=>{}):void 0;return s?.catch(()=>{}),u?.catch(()=>{}),{lazyRoutePromise:s,lazyHandlerPromise:u}}async function Jr(e){let t=e.matches.filter(n=>n.shouldLoad),r={};return(await Promise.all(t.map(n=>n.resolve()))).forEach((n,o)=>{r[t[o].route.id]=n}),r}async function go(e){return e.matches.some(t=>t.route.middleware)?Pa(e,()=>Jr(e)):Jr(e)}function Pa(e,t){return wo(e,t,a=>{if(Fo(a))throw a;return a},Mo,r);function r(a,n,o){if(o)return Promise.resolve(Object.assign(o.value,{[n]:{type:"error",result:a}}));{let{matches:i}=e,l=Math.min(Math.max(i.findIndex(s=>s.route.id===n),0),Math.max(i.findIndex(s=>s.shouldCallHandler()),0)),u=Ie(i,i[l].route.id).route.id;return Promise.resolve({[u]:{type:"error",result:a}})}}}async function wo(e,t,r,a,n){let{matches:o,request:i,params:l,context:u,unstable_pattern:s}=e,f=o.flatMap(p=>p.route.middleware?p.route.middleware.map(g=>[p.route.id,g]):[]);return await _a({request:i,params:l,context:u,unstable_pattern:s},f,t,r,a,n)}async function _a(e,t,r,a,n,o,i=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let u=t[i];if(!u)return await r();let[s,f]=u,c,p=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");try{return c={value:await _a(e,t,r,a,n,o,i+1)},c.value}catch(g){return c={value:await o(g,s,c)},c.value}};try{let g=await f(e,p),w=g!=null?a(g):void 0;return n(w)?w:c?w??c.value:(c={value:await p()},c.value)}catch(g){return await o(g,s,c)}}function Ta(e,t,r,a,n){let o=Ma({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),i=vo(a.route,ee(r.method)?"action":"loader",t,e,n);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function Qt(e,t,r,a,n,o,i,l,u=null,s){let f=!1,c=Ta(e,t,r,n,o);return{...n,_lazyPromises:c,shouldLoad:l,shouldRevalidateArgs:u,shouldCallHandler(p){return f=!0,u?typeof s=="boolean"?lt(n,{...u,defaultShouldRevalidate:s}):typeof p=="boolean"?lt(n,{...u,defaultShouldRevalidate:p}):lt(n,u):l},resolve(p){let{lazy:g,loader:w,middleware:b}=n.route,R=f||l||p&&!ee(r.method)&&(g||w),L=b&&b.length>0&&!w&&!g;return R&&(ee(r.method)||!L)?Eo({request:r,unstable_pattern:a,match:n,lazyHandlerPromise:c?.handler,lazyRoutePromise:c?.route,handlerOverride:p,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Ge(e,t,r,a,n,o,i,l=null){return a.map(u=>u.route.id!==n.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:Ta(e,t,r,u,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Qt(e,t,r,ct(a),u,o,i,!0,l))}async function Ro(e,t,r,a,n,o){r.some(s=>s._lazyPromises?.middleware)&&await Promise.all(r.map(s=>s._lazyPromises?.middleware));let i={request:t,unstable_pattern:ct(r),params:r[0].params,context:n,matches:r},u=await e({...i,fetcherKey:a,runClientMiddleware:s=>{let f=i;return Pa(f,()=>s({...f,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(s=>[s._lazyPromises?.handler,s._lazyPromises?.route]))}catch{}return u}async function Eo({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:a,lazyRoutePromise:n,handlerOverride:o,scopedContext:i}){let l,u,s=ee(e.method),f=s?"action":"loader",c=p=>{let g,w=new Promise((L,D)=>g=D);u=()=>g(),e.signal.addEventListener("abort",u);let b=L=>typeof p!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${f}" [routeId: ${r.route.id}]`)):p({request:e,unstable_pattern:t,params:r.params,context:i},...L!==void 0?[L]:[]),R=(async()=>{try{return{type:"data",result:await(o?o(D=>b(D)):b())}}catch(L){return{type:"error",result:L}}})();return Promise.race([R,w])};try{let p=s?r.route.action:r.route.loader;if(a||n)if(p){let g,[w]=await Promise.all([c(p).catch(b=>{g=b}),a,n]);if(g!==void 0)throw g;l=w}else{await a;let g=s?r.route.action:r.route.loader;if(g)[l]=await Promise.all([c(g),n]);else if(f==="action"){let w=new URL(e.url),b=w.pathname+w.search;throw ve(405,{method:e.method,pathname:b,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(p)l=await c(p);else{let g=new URL(e.url),w=g.pathname+g.search;throw ve(404,{pathname:w})}}catch(p){return{type:"error",result:p}}finally{u&&e.signal.removeEventListener("abort",u)}return l}async function bo(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 So(e){let{result:t,type:r}=e;if($t(t)){let a;try{a=await bo(t)}catch(n){return{type:"error",error:n}}return r==="error"?{type:"error",error:new Be(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return r==="error"?er(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:Co(t),statusCode:He(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:He(t)?t.status:void 0}:er(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 Lo(e,t,r,a,n){let o=e.headers.get("Location");if(O(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!ir(o)){let i=a.slice(0,a.findIndex(l=>l.route.id===r)+1);o=qt(new URL(t.url),i,n,o),e.headers.set("Location",o)}return e}function Kr(e,t,r,a){let n=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(ir(e)){let o=e,i=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(n.includes(i.protocol))throw new Error("Invalid redirect location");let l=pe(i.pathname,r)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}try{let o=a.createURL(e);if(n.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Je(e,t,r,a){let n=e.createURL(Fa(t)).toString(),o={signal:r};if(a&&ee(a.formMethod)){let{formMethod:i,formEncType:l}=a;o.method=i.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(a.json)):l==="text/plain"?o.body=a.text:l==="application/x-www-form-urlencoded"&&a.formData?o.body=Zt(a.formData):o.body=a.formData}return new Request(n,o)}function Zt(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function Gr(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function Do(e,t,r,a=!1,n=!1){let o={},i=null,l,u=!1,s={},f=r&&me(r[1])?r[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let p=c.route.id,g=t[p];if(O(!je(g),"Cannot handle redirect results in processLoaderData"),me(g)){let w=g.error;if(f!==void 0&&(w=f,f=void 0),i=i||{},n)i[p]=w;else{let b=Ie(e,p);i[b.route.id]==null&&(i[b.route.id]=w)}a||(o[p]=Da),u||(u=!0,l=He(g.error)?g.error.status:500),g.headers&&(s[p]=g.headers)}else o[p]=g.data,g.statusCode&&g.statusCode!==200&&!u&&(l=g.statusCode),g.headers&&(s[p]=g.headers)}),f!==void 0&&r&&(i={[r[0]]:f},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:l||200,loaderHeaders:s}}function Xr(e,t,r,a,n,o){let{loaderData:i,errors:l}=Do(t,r,a);return n.filter(u=>!u.matches||u.matches.some(s=>s.shouldLoad)).forEach(u=>{let{key:s,match:f,controller:c}=u;if(c&&c.signal.aborted)return;let p=o[s];if(O(p,"Did not find corresponding fetcher result"),me(p)){let g=Ie(e.matches,f?.route.id);l&&l[g.route.id]||(l={...l,[g.route.id]:p.error}),e.fetchers.delete(s)}else if(je(p))O(!1,"Unhandled fetcher revalidation redirect");else{let g=Me(p.data);e.fetchers.set(s,g)}}),{loaderData:i,errors:l}}function qr(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==Da).reduce((o,[i,l])=>(o[i]=l,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(n[i]=e[i]),a&&a.hasOwnProperty(i))break}return n}function Qr(e){return e?me(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ie(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function Lt(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ve(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&t&&r?l=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:n==="invalid-body"&&(l="Unable to encode submission body")):e===403?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",l=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",a&&t&&r?l=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:a&&(l=`Invalid request method "${a.toUpperCase()}"`)),new Be(e||500,i,new Error(l),!0)}function Dt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(je(n))return{key:a,result:n}}}function Fa(e){let t=typeof e=="string"?_e(e):e;return Le({...t,hash:""})}function xo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Co(e){return new Be(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function Mo(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&Po(r))}function Po(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function _o(e){return $t(e.result)&&Sa.has(e.result.status)}function me(e){return e.type==="error"}function je(e){return(e&&e.type)==="redirect"}function er(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function $t(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function To(e){return Sa.has(e)}function Fo(e){return $t(e)&&To(e.status)&&e.headers.has("Location")}function Io(e){return so.has(e.toUpperCase())}function ee(e){return io.has(e.toUpperCase())}function ur(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Pt(e,t){let r=typeof t=="string"?_e(t).search:t.search;if(e[e.length-1].route.index&&ur(r||""))return e[e.length-1];let a=ga(e);return a[a.length-1]}function Zr(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:i}=e;if(!(!t||!r||!a)){if(n!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:n};if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:i,text:void 0}}}function Kt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Oo(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function at(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 Ao(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 Me(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 ko(e,t){try{let r=e.sessionStorage.getItem(La);if(r){let a=JSON.parse(r);for(let[n,o]of Object.entries(a||{}))o&&Array.isArray(o)&&t.set(n,new Set(o||[]))}}catch{}}function $o(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(La,JSON.stringify(r))}catch(a){Q(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function ea(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var We=h.createContext(null);We.displayName="DataRouter";var qe=h.createContext(null);qe.displayName="DataRouterState";var cr=h.createContext(!1);function Uo(){return h.useContext(cr)}var dr=h.createContext({isTransitioning:!1});dr.displayName="ViewTransition";var Ia=h.createContext(new Map);Ia.displayName="Fetchers";var No=h.createContext(null);No.displayName="Await";var ce=h.createContext(null);ce.displayName="Navigation";var Ut=h.createContext(null);Ut.displayName="Location";var we=h.createContext({outlet:null,matches:[],isDataRoute:!1});we.displayName="Route";var fr=h.createContext(null);fr.displayName="RouteError";var Oa="REACT_ROUTER_ERROR",zo="REDIRECT",jo="ROUTE_ERROR_RESPONSE";function Ho(e){if(e.startsWith(`${Oa}:${zo}:{`))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 Bo(e){if(e.startsWith(`${Oa}:${jo}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Be(t.status,t.statusText,t.data)}catch{}}function Wo(e,{relative:t}={}){O(dt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=h.useContext(ce),{hash:n,pathname:o,search:i}=ft(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:ge([r,o])),a.createHref({pathname:l,search:i,hash:n})}function dt(){return h.useContext(Ut)!=null}function Re(){return O(dt(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Ut).location}var Aa="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ka(e){h.useContext(ce).static||h.useLayoutEffect(e)}function Vo(){let{isDataRoute:e}=h.useContext(we);return e?oi():Yo()}function Yo(){O(dt(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(We),{basename:t,navigator:r}=h.useContext(ce),{matches:a}=h.useContext(we),{pathname:n}=Re(),o=JSON.stringify(lr(a)),i=h.useRef(!1);return ka(()=>{i.current=!0}),h.useCallback((u,s={})=>{if(Q(i.current,Aa),!i.current)return;if(typeof u=="number"){r.go(u);return}let f=kt(u,JSON.parse(o),n,s.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ge([t,f.pathname])),(s.replace?r.replace:r.push)(f,s.state,s)},[t,r,o,n,e])}var Jo=h.createContext(null);function Ko(e){let t=h.useContext(we).outlet;return h.useMemo(()=>t&&h.createElement(Jo.Provider,{value:e},t),[t,e])}function hr(){let{matches:e}=h.useContext(we),t=e[e.length-1];return t?t.params:{}}function ft(e,{relative:t}={}){let{matches:r}=h.useContext(we),{pathname:a}=Re(),n=JSON.stringify(lr(r));return h.useMemo(()=>kt(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Go(e,t,r){O(dt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=h.useContext(ce),{matches:n}=h.useContext(we),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",u=o?o.pathnameBase:"/",s=o&&o.route;{let R=s&&s.path||"";Na(l,!s||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
3
3
 
4
4
  Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let f=Re(),c;c=f;let p=c.pathname||"/",g=p;if(u!=="/"){let R=u.replace(/^\//,"").split("/");g="/"+p.replace(/^\//,"").split("/").slice(R.length).join("/")}let w=Pe(e,{pathname:g});return Q(s||w!=null,`No routes matched location "${c.pathname}${c.search}${c.hash}" `),Q(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${c.pathname}${c.search}${c.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),ei(w&&w.map(R=>Object.assign({},R,{params:Object.assign({},i,R.params),pathname:ge([u,a.encodeLocation?a.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?u:ge([u,a.encodeLocation?a.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),n,r)}function Xo(){let e=Ua(),t=He(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:n},r):null,i)}var qo=h.createElement(Xo,null),$a=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}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?e.error:t.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"){const r=Bo(e.digest);r&&(e=r)}let t=e!==void 0?h.createElement(we.Provider,{value:this.props.routeContext},h.createElement(fr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?h.createElement(Qo,{error:e},t):t}};$a.contextType=cr;var Gt=new WeakMap;function Qo({children:e,error:t}){let{basename:r}=h.useContext(ce);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=Ho(t.digest);if(a){let n=Gt.get(t);if(n)throw n;let o=Ra(a.location,r);if(wa&&!Gt.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw Gt.set(t,i),i}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function Zo({routeContext:e,match:t,children:r}){let a=h.useContext(We);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(we.Provider,{value:e},r)}function ei(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a?.errors;if(o!=null){let f=n.findIndex(c=>c.route.id&&o?.[c.route.id]!==void 0);O(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,f+1))}let i=!1,l=-1;if(r&&a){i=a.renderFallback;for(let f=0;f<n.length;f++){let c=n[f];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=f),c.route.id){let{loaderData:p,errors:g}=a,w=c.route.loader&&!p.hasOwnProperty(c.route.id)&&(!g||g[c.route.id]===void 0);if(c.route.lazy||w){r.isStatic&&(i=!0),l>=0?n=n.slice(0,l+1):n=[n[0]];break}}}}let u=r?.onError,s=a&&u?(f,c)=>{u(f,{location:a.location,params:a.matches?.[0]?.params??{},unstable_pattern:ct(a.matches),errorInfo:c})}:void 0;return n.reduceRight((f,c,p)=>{let g,w=!1,b=null,R=null;a&&(g=o&&c.route.id?o[c.route.id]:void 0,b=c.route.errorElement||qo,i&&(l<0&&p===0?(Na("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,R=null):l===p&&(w=!0,R=c.route.hydrateFallbackElement||null)));let L=t.concat(n.slice(0,p+1)),D=()=>{let _;return g?_=b:w?_=R:c.route.Component?_=h.createElement(c.route.Component,null):c.route.element?_=c.route.element:_=f,h.createElement(Zo,{match:c,routeContext:{outlet:f,matches:L,isDataRoute:a!=null},children:_})};return a&&(c.route.ErrorBoundary||c.route.errorElement||p===0)?h.createElement($a,{location:a.location,revalidation:a.revalidation,component:b,error:g,children:D(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:s}):D()},null)}function mr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ti(e){let t=h.useContext(We);return O(t,mr(e)),t}function ht(e){let t=h.useContext(qe);return O(t,mr(e)),t}function ri(e){let t=h.useContext(we);return O(t,mr(e)),t}function mt(e){let t=ri(e),r=t.matches[t.matches.length-1];return O(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function ai(){return mt("useRouteId")}function ni(){return ht("useNavigation").navigation}function pr(){let{matches:e,loaderData:t}=ht("useMatches");return h.useMemo(()=>e.map(r=>ma(r,t)),[e,t])}function yr(){let e=ht("useLoaderData"),t=mt("useLoaderData");return e.loaderData[t]}function vr(){let e=ht("useActionData"),t=mt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Ua(){let e=h.useContext(fr),t=ht("useRouteError"),r=mt("useRouteError");return e!==void 0?e:t.errors?.[r]}function oi(){let{router:e}=ti("useNavigate"),t=mt("useNavigate"),r=h.useRef(!1);return ka(()=>{r.current=!0}),h.useCallback(async(n,o={})=>{Q(r.current,Aa),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var ta={};function Na(e,t,r){!t&&!ta[e]&&(ta[e]=!0,Q(!1,r))}var ra={};function aa(e,t){!e&&!ra[t]&&(ra[t]=!0,console.warn(t))}var ii="useOptimistic",na=En[ii],li=()=>{};function si(e){return na?na(e):[e,li]}var ui=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function ci({router:e,flushSync:t,onError:r,unstable_useTransitions:a}){a=Uo()||a;let[o,i]=h.useState(e.state),[l,u]=si(o),[s,f]=h.useState(),[c,p]=h.useState({isTransitioning:!1}),[g,w]=h.useState(),[b,R]=h.useState(),[L,D]=h.useState(),_=h.useRef(new Map),H=h.useCallback((y,{deletedFetchers:U,newErrors:V,flushSync:te,viewTransitionOpts:B})=>{V&&r&&Object.values(V).forEach(J=>r(J,{location:y.location,params:y.matches[0]?.params??{},unstable_pattern:ct(y.matches)})),y.fetchers.forEach((J,k)=>{J.data!==void 0&&_.current.set(k,J.data)}),U.forEach(J=>_.current.delete(J)),aa(te===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let ue=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(aa(B==null||ue,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!B||!ue){t&&te?t(()=>i(y)):a===!1?i(y):h.startTransition(()=>{a===!0&&u(J=>oa(J,y)),i(y)});return}if(t&&te){t(()=>{b&&(g?.resolve(),b.skipTransition()),p({isTransitioning:!0,flushSync:!0,currentLocation:B.currentLocation,nextLocation:B.nextLocation})});let J=e.window.document.startViewTransition(()=>{t(()=>i(y))});J.finished.finally(()=>{t(()=>{w(void 0),R(void 0),f(void 0),p({isTransitioning:!1})})}),t(()=>R(J));return}b?(g?.resolve(),b.skipTransition(),D({state:y,currentLocation:B.currentLocation,nextLocation:B.nextLocation})):(f(y),p({isTransitioning:!0,flushSync:!1,currentLocation:B.currentLocation,nextLocation:B.nextLocation}))},[e.window,t,b,g,a,u,r]);h.useLayoutEffect(()=>e.subscribe(H),[e,H]),h.useEffect(()=>{c.isTransitioning&&!c.flushSync&&w(new ui)},[c]),h.useEffect(()=>{if(g&&s&&e.window){let y=s,U=g.promise,V=e.window.document.startViewTransition(async()=>{a===!1?i(y):h.startTransition(()=>{a===!0&&u(te=>oa(te,y)),i(y)}),await U});V.finished.finally(()=>{w(void 0),R(void 0),f(void 0),p({isTransitioning:!1})}),R(V)}},[s,g,e.window,a,u]),h.useEffect(()=>{g&&s&&l.location.key===s.location.key&&g.resolve()},[g,b,l.location,s]),h.useEffect(()=>{!c.isTransitioning&&L&&(f(L.state),p({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}),D(void 0))},[c.isTransitioning,L]);let A=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:y=>e.navigate(y),push:(y,U,V)=>e.navigate(y,{state:U,preventScrollReset:V?.preventScrollReset}),replace:(y,U,V)=>e.navigate(y,{replace:!0,state:U,preventScrollReset:V?.preventScrollReset})}),[e]),j=e.basename||"/",G=h.useMemo(()=>({router:e,navigator:A,static:!1,basename:j,onError:r}),[e,A,j,r]);return h.createElement(h.Fragment,null,h.createElement(We.Provider,{value:G},h.createElement(qe.Provider,{value:l},h.createElement(Ia.Provider,{value:_.current},h.createElement(dr.Provider,{value:c},h.createElement(hi,{basename:j,location:l.location,navigationType:l.historyAction,navigator:A,unstable_useTransitions:a},h.createElement(di,{routes:e.routes,future:e.future,state:l,isStatic:!1,onError:r})))))),null)}function oa(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var di=h.memo(fi);function fi({routes:e,future:t,state:r,isStatic:a,onError:n}){return Go(e,void 0,{state:r,isStatic:a,onError:n})}function Rl(e){return Ko(e.context)}function hi({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,unstable_useTransitions:i}){O(!dt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:l,navigator:n,static:o,unstable_useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=_e(r));let{pathname:s="/",search:f="",hash:c="",state:p=null,key:g="default",unstable_mask:w}=r,b=h.useMemo(()=>{let R=pe(s,l);return R==null?null:{location:{pathname:R,search:f,hash:c,state:p,key:g,unstable_mask:w},navigationType:a}},[l,s,f,c,p,g,a,w]);return Q(b!=null,`<Router basename="${l}"> is not able to match the URL "${s}${f}${c}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:h.createElement(ce.Provider,{value:u},h.createElement(Ut.Provider,{children:t,value:b}))}function mi(){return{params:hr(),loaderData:yr(),actionData:vr(),matches:pr()}}function El({children:e}){const t=mi();return h.cloneElement(e,t)}function pi(){return{params:hr(),loaderData:yr(),actionData:vr()}}function bl({children:e}){const t=pi();return h.cloneElement(e,t)}function yi(){return{params:hr(),loaderData:yr(),actionData:vr(),error:Ua()}}function Sl({children:e}){const t=yi();return h.cloneElement(e,t)}var _t="get",Tt="application/x-www-form-urlencoded";function Nt(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function vi(e){return Nt(e)&&e.tagName.toLowerCase()==="button"}function gi(e){return Nt(e)&&e.tagName.toLowerCase()==="form"}function wi(e){return Nt(e)&&e.tagName.toLowerCase()==="input"}function Ri(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ei(e,t){return e.button===0&&(!t||t==="_self")&&!Ri(e)}var xt=null;function bi(){if(xt===null)try{new FormData(document.createElement("form"),0),xt=!1}catch{xt=!0}return xt}var Si=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xt(e){return e!=null&&!Si.has(e)?(Q(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tt}"`),null):e}function Li(e,t){let r,a,n,o,i;if(gi(e)){let l=e.getAttribute("action");a=l?pe(l,t):null,r=e.getAttribute("method")||_t,n=Xt(e.getAttribute("enctype"))||Tt,o=new FormData(e)}else if(vi(e)||wi(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(a=u?pe(u,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||_t,n=Xt(e.getAttribute("formenctype"))||Xt(l.getAttribute("enctype"))||Tt,o=new FormData(l,e),!bi()){let{name:s,type:f,value:c}=e;if(f==="image"){let p=s?`${s}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else s&&o.append(s,c)}}else{if(Nt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=_t,a=null,n=Tt,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");async function Di(e){let t={signal:e.signal};if(e.method!=="GET"){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}var xi={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Ci=/[&><\u2028\u2029]/g;function tr(e){return e.replace(Ci,t=>xi[t])}function pt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var za=class extends Error{},Mi=new Set([100,101,204,205]);function Pi(e,t,r,a,n,o,i=()=>!0){return async l=>{let{request:u,matches:s,fetcherKey:f}=l,c=e();return u.method!=="GET"?_i(l,r,n,o):(s.some(p=>{let{hasLoader:g,hasClientLoader:w}=t(p);return p.shouldCallHandler()&&g&&!w}),f?Ii(l,r,n,o):Ti(l,c,t,r,a,n,o,i))}}async function _i(e,t,r,a){let n=e.matches.find(l=>l.shouldCallHandler());pt(n,"No action match found");let o,i=await n.resolve(async l=>await l(async()=>{let{data:s,status:f}=await t(e,r,a,[n.route.id]);return o=f,Ot(s,n.route.id)}));return $t(i.result)||He(i.result)||er(i.result)?{[n.route.id]:i}:{[n.route.id]:{type:i.type,result:Qn(i.result,o)}}}async function Ti(e,t,r,a,n,o,i,l=()=>!0){let u=new Set,s=!1,f=e.matches.map(()=>ia()),c=ia(),p={},g=Promise.all(e.matches.map(async(b,R)=>b.resolve(async L=>{f[R].resolve();let D=b.route.id,{hasLoader:_,hasClientLoader:H,hasShouldRevalidate:A}=r(b),j=!b.shouldRevalidateArgs||b.shouldRevalidateArgs.actionStatus==null||b.shouldRevalidateArgs.actionStatus<400;if(!b.shouldCallHandler(j)){s||(s=b.shouldRevalidateArgs!=null&&_&&A===!0);return}if(l(b)&&H){_&&(s=!0);try{let y=await L(async()=>{let{data:U}=await a(e,o,i,[D]);return Ot(U,D)});p[D]={type:"data",result:y}}catch(y){p[D]={type:"error",result:y}}return}_&&u.add(D);try{let y=await L(async()=>{let U=await c.promise;return Ot(U,D)});p[D]={type:"data",result:y}}catch(y){p[D]={type:"error",result:y}}})));if(await Promise.all(f.map(b=>b.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||u.size===0)&&!window.__reactRouterHdrActive)c.resolve({routes:{}});else{let b=s&&u.size>0?[...u.keys()]:void 0;try{let R=await a(e,o,i,b);c.resolve(R.data)}catch(R){c.reject(R)}}return await g,await Fi(c.promise,e.matches,u,p),p}async function Fi(e,t,r,a){try{let n,o=await e;if("routes"in o){for(let i of t)if(i.route.id in o.routes){let l=o.routes[i.route.id];if("error"in l){n=l.error,a[i.route.id]?.result==null&&(a[i.route.id]={type:"error",result:n});break}}}n!==void 0&&Array.from(r.values()).forEach(i=>{a[i].result instanceof za&&(a[i].result=n)})}catch{}}async function Ii(e,t,r,a){let n=e.matches.find(l=>l.shouldCallHandler());pt(n,"No fetcher match found");let o=n.route.id,i=await n.resolve(async l=>l(async()=>{let{data:u}=await t(e,r,a,[o]);return Ot(u,o)}));return{[n.route.id]:i}}function Oi(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let a of t)a&&r.push(a);for(let a of r)e.searchParams.append("index",a);return e}function ja(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&pe(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${a}`,n}function Ot(e,t){if("redirect"in e){let{redirect:a,revalidate:n,reload:o,replace:i,status:l}=e.redirect;throw Zn(a,{status:l,headers:{...n?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...i?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new za(`No result found for routeId "${t}"`);if("error"in r)throw r.error;if("data"in r)return r.data;throw new Error(`Invalid response found for routeId "${t}"`)}function ia(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}async function Ai(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ki(e,t,r){let a=e.map(o=>{let i=t[o.route.id],l=r.routes[o.route.id];return[l&&l.css?l.css.map(u=>({rel:"stylesheet",href:u})):[],i?.links?.()||[]]}).flat(2),n=Ba(e,r);return Wa(a,n)}function Ha(e){return e!=null&&typeof e.page=="string"}function $i(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Ui(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await Ai(o,r);return i.links?i.links():[]}return[]}));return Wa(a.flat(1).filter($i).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function la(e,t,r,a,n,o){let i=(u,s)=>r[s]?u.route.id!==r[s].route.id:!0,l=(u,s)=>r[s].pathname!==u.pathname||r[s].route.path?.endsWith("*")&&r[s].params["*"]!==u.params["*"];return o==="assets"?t.filter((u,s)=>i(u,s)||l(u,s)):o==="data"?t.filter((u,s)=>{let f=a.routes[u.route.id];if(!f||!f.hasLoader)return!1;if(i(u,s)||l(u,s))return!0;if(u.route.shouldRevalidate){let c=u.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof c=="boolean")return c}return!0}):[]}function Ba(e,t,{includeHydrateFallback:r}={}){return Ni(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function Ni(e){return[...new Set(e)]}function zi(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Wa(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!Ha(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(zi(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}function ji(e,t){let r="an",a=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(a),new Be(405,"Method Not Allowed",new Error(a),!0)}function Va(e,t,r,a){return a&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}function Ya(){let e=h.useContext(We);return pt(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function gr(){let e=h.useContext(qe);return pt(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var yt=h.createContext(void 0);yt.displayName="FrameworkContext";function zt(){let e=h.useContext(yt);return pt(e,"You must render this element inside a <HydratedRouter> element"),e}function Hi(e,t){let r=h.useContext(yt),[a,n]=h.useState(!1),[o,i]=h.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:s,onMouseLeave:f,onTouchStart:c}=t,p=h.useRef(null);h.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let b=L=>{L.forEach(D=>{i(D.isIntersecting)})},R=new IntersectionObserver(b,{threshold:.5});return p.current&&R.observe(p.current),()=>{R.disconnect()}}},[e]),h.useEffect(()=>{if(a){let b=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(b)}}},[a]);let g=()=>{n(!0)},w=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,p,{}]:[o,p,{onFocus:nt(l,g),onBlur:nt(u,w),onMouseEnter:nt(s,g),onMouseLeave:nt(f,w),onTouchStart:nt(c,g)}]:[!1,p,{}]}function nt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Ja(e,t,r){if(r&&!Ga)return[e[0]];if(t){let a=e.findIndex(n=>t[n.route.id]!==void 0);return e.slice(0,a+1)}return e}var sa="data-react-router-critical-css";function Ll({nonce:e,crossOrigin:t}){let{isSpaMode:r,manifest:a,routeModules:n,criticalCss:o}=zt(),{errors:i,matches:l}=gr(),u=Ja(l,i,r),s=h.useMemo(()=>ki(u,n,a),[u,n,a]);return h.createElement(h.Fragment,null,typeof o=="string"?h.createElement("style",{[sa]:"",nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,typeof o=="object"?h.createElement("link",{[sa]:"",rel:"stylesheet",href:o.href,nonce:e,crossOrigin:t}):null,s.map(({key:f,link:c})=>Ha(c)?h.createElement(Ka,{key:f,nonce:e,...c,crossOrigin:c.crossOrigin??t}):h.createElement("link",{key:f,nonce:e,...c,crossOrigin:c.crossOrigin??t})))}function Ka({page:e,...t}){let{router:r}=Ya(),a=h.useMemo(()=>Pe(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?h.createElement(Wi,{page:e,matches:a,...t}):null}function Bi(e){let{manifest:t,routeModules:r}=zt(),[a,n]=h.useState([]);return h.useEffect(()=>{let o=!1;return Ui(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function Wi({page:e,matches:t,...r}){let a=Re(),{future:n,manifest:o,routeModules:i}=zt(),{basename:l}=Ya(),{loaderData:u,matches:s}=gr(),f=h.useMemo(()=>la(e,t,s,o,a,"data"),[e,t,s,o,a]),c=h.useMemo(()=>la(e,t,s,o,a,"assets"),[e,t,s,o,a]),p=h.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let b=new Set,R=!1;if(t.forEach(D=>{let _=o.routes[D.route.id];!_||!_.hasLoader||(!f.some(H=>H.route.id===D.route.id)&&D.route.id in u&&i[D.route.id]?.shouldRevalidate||_.hasClientLoader?R=!0:b.add(D.route.id))}),b.size===0)return[];let L=ja(e,l,n.unstable_trailingSlashAwareDataRequests,"data");return R&&b.size>0&&L.searchParams.set("_routes",t.filter(D=>b.has(D.route.id)).map(D=>D.route.id).join(",")),[L.pathname+L.search]},[l,n.unstable_trailingSlashAwareDataRequests,u,a,o,f,t,e,i]),g=h.useMemo(()=>Ba(c,o),[c,o]),w=Bi(c);return h.createElement(h.Fragment,null,p.map(b=>h.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),g.map(b=>h.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),w.map(({key:b,link:R})=>h.createElement("link",{key:b,nonce:r.nonce,...R,crossOrigin:R.crossOrigin??r.crossOrigin})))}function Dl(){let{isSpaMode:e,routeModules:t}=zt(),{errors:r,matches:a,loaderData:n}=gr(),o=Re(),i=Ja(a,r,e),l=null;r&&(l=r[i[i.length-1].route.id]);let u=[],s=null,f=[];for(let c=0;c<i.length;c++){let p=i[c],g=p.route.id,w=n[g],b=p.params,R=t[g],L=[],D={id:g,data:w,loaderData:w,meta:[],params:p.params,pathname:p.pathname,handle:p.route.handle,error:l};if(f[c]=D,R?.meta?L=typeof R.meta=="function"?R.meta({data:w,loaderData:w,params:b,location:o,matches:f,error:l}):Array.isArray(R.meta)?[...R.meta]:R.meta:s&&(L=[...s]),L=L||[],!Array.isArray(L))throw new Error("The route at "+p.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
@@ -1 +1 @@
1
- import{r as m,j as d,h as f}from"./react-H1IN5wR7.js";import{P as u}from"./index-C0ecV8RK.js";import{t as x}from"./index-DyfAV_di.js";var h="Separator",p="horizontal",N=["horizontal","vertical"],v=m.forwardRef((i,t)=>{const{decorative:a,orientation:o=p,...e}=i,r=E(o)?o:p,s=a?{role:"none"}:{"aria-orientation":r==="vertical"?r:void 0,role:"separator"};return d.jsx(u.div,{"data-orientation":r,...s,...e,ref:t})});v.displayName=h;function E(i){return N.includes(i)}var O=v;function S(i){const t=f.c(12);let a,o,e,r;t[0]!==i?({className:a,orientation:e,decorative:r,...o}=i,t[0]=i,t[1]=a,t[2]=o,t[3]=e,t[4]=r):(a=t[1],o=t[2],e=t[3],r=t[4]);const l=e===void 0?"horizontal":e,s=r===void 0?!0:r;let n;t[5]!==a?(n=x("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px",a),t[5]=a,t[6]=n):n=t[6];let c;return t[7]!==s||t[8]!==l||t[9]!==o||t[10]!==n?(c=d.jsx(O,{"data-slot":"separator",decorative:s,orientation:l,className:n,...o}),t[7]=s,t[8]=l,t[9]=o,t[10]=n,t[11]=c):c=t[11],c}export{S};
1
+ import{r as m,j as d,h as f}from"./react-Dk3PRQ9V.js";import{P as u}from"./index-BJkIIQzT.js";import{t as x}from"./index-BYgxF2sp.js";var h="Separator",p="horizontal",N=["horizontal","vertical"],v=m.forwardRef((i,t)=>{const{decorative:a,orientation:o=p,...e}=i,r=E(o)?o:p,s=a?{role:"none"}:{"aria-orientation":r==="vertical"?r:void 0,role:"separator"};return d.jsx(u.div,{"data-orientation":r,...s,...e,ref:t})});v.displayName=h;function E(i){return N.includes(i)}var O=v;function S(i){const t=f.c(12);let a,o,e,r;t[0]!==i?({className:a,orientation:e,decorative:r,...o}=i,t[0]=i,t[1]=a,t[2]=o,t[3]=e,t[4]=r):(a=t[1],o=t[2],e=t[3],r=t[4]);const l=e===void 0?"horizontal":e,s=r===void 0?!0:r;let n;t[5]!==a?(n=x("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px",a),t[5]=a,t[6]=n):n=t[6];let c;return t[7]!==s||t[8]!==l||t[9]!==o||t[10]!==n?(c=d.jsx(O,{"data-slot":"separator",decorative:s,orientation:l,className:n,...o}),t[7]=s,t[8]=l,t[9]=o,t[10]=n,t[11]=c):c=t[11],c}export{S};
@@ -1 +1 @@
1
- import{h as f,j as i}from"./react-H1IN5wR7.js";import{S as h}from"./separator-QmXXuyOl.js";import{f as p}from"./app-sidebar-DmZmaTFZ.js";import{e as x,B as d}from"./index-DyfAV_di.js";const u=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],b=x("panel-left",u);function _(m){const e=f.c(10),{children:n}=m,{open:c,setOpen:l}=p();let t;e[0]!==c||e[1]!==l?(t=()=>l(!c),e[0]=c,e[1]=l,e[2]=t):t=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(b,{}),e[3]=s):s=e[3];let o;e[4]!==t?(o=i.jsx(d,{className:"-mx-2",variant:"ghost",size:"icon",onClick:t,children:s}),e[4]=t,e[5]=o):o=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(h,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),e[6]=r):r=e[6];let a;return e[7]!==n||e[8]!==o?(a=i.jsxs("header",{className:"flex h-10 top-0 shrink-0 items-center gap-2 border-b sticky bg-background z-30 px-3",children:[o,r,n]}),e[7]=n,e[8]=o,e[9]=a):a=e[9],a}export{_ as S};
1
+ import{h as f,j as i}from"./react-Dk3PRQ9V.js";import{S as h}from"./separator-Sua3PhYj.js";import{f as p}from"./app-sidebar-pNmserEz.js";import{e as x,B as d}from"./index-BYgxF2sp.js";const u=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],b=x("panel-left",u);function _(m){const e=f.c(10),{children:n}=m,{open:c,setOpen:l}=p();let t;e[0]!==c||e[1]!==l?(t=()=>l(!c),e[0]=c,e[1]=l,e[2]=t):t=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(b,{}),e[3]=s):s=e[3];let o;e[4]!==t?(o=i.jsx(d,{className:"-mx-2",variant:"ghost",size:"icon",onClick:t,children:s}),e[4]=t,e[5]=o):o=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(h,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),e[6]=r):r=e[6];let a;return e[7]!==n||e[8]!==o?(a=i.jsxs("header",{className:"flex h-10 top-0 shrink-0 items-center gap-2 border-b sticky bg-background z-30 px-3",children:[o,r,n]}),e[7]=n,e[8]=o,e[9]=a):a=e[9],a}export{_ as S};
@@ -1 +1 @@
1
- import{h as i,j as l}from"./react-H1IN5wR7.js";import{e as c,t as n}from"./index-DyfAV_di.js";const p=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],m=c("loader-circle",p);function u(r){const e=i.c(8);let s,a;e[0]!==r?({className:s,...a}=r,e[0]=r,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let t;e[3]!==s?(t=n("size-4 animate-spin",s),e[3]=s,e[4]=t):t=e[4];let o;return e[5]!==a||e[6]!==t?(o=l.jsx(m,{role:"status","aria-label":"Loading",className:t,...a}),e[5]=a,e[6]=t,e[7]=o):o=e[7],o}export{m as L,u as S};
1
+ import{h as i,j as l}from"./react-Dk3PRQ9V.js";import{e as c,t as n}from"./index-BYgxF2sp.js";const p=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],m=c("loader-circle",p);function u(r){const e=i.c(8);let s,a;e[0]!==r?({className:s,...a}=r,e[0]=r,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let t;e[3]!==s?(t=n("size-4 animate-spin",s),e[3]=s,e[4]=t):t=e[4];let o;return e[5]!==a||e[6]!==t?(o=l.jsx(m,{role:"status","aria-label":"Loading",className:t,...a}),e[5]=a,e[6]=t,e[7]=o):o=e[7],o}export{m as L,u as S};
@@ -1 +1 @@
1
- import{r as te,j as O,h as ue,W as _}from"./react-H1IN5wR7.js";import{e as zt,cD as we,cF as Re,cK as Gt,cH as Kt,cE as Yt,ai as Jt,cG as Qt,t as fe,d7 as Xt,d0 as Zt,d8 as Ne,B as er}from"./index-DyfAV_di.js";import{R as tr,I as rr,c as gt}from"./index-DYGF1SVj.js";import{S as sr}from"./spinner-Cs2baDxX.js";const ir=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ar=zt("settings",ir);var Se="Tabs",[nr]=Qt(Se,[gt]),vt=gt(),[or,Ue]=nr(Se),bt=te.forwardRef((e,r)=>{const{__scopeTabs:t,value:i,onValueChange:a,defaultValue:n,orientation:u="horizontal",dir:c,activationMode:x="automatic",...S}=e,D=Kt(c),[v,V]=Yt({prop:i,onChange:a,defaultProp:n??"",caller:Se});return O.jsx(or,{scope:t,baseId:Jt(),value:v,onValueChange:V,orientation:u,dir:D,activationMode:x,children:O.jsx(we.div,{dir:D,"data-orientation":u,...S,ref:r})})});bt.displayName=Se;var ht="TabsList",mt=te.forwardRef((e,r)=>{const{__scopeTabs:t,loop:i=!0,...a}=e,n=Ue(ht,t),u=vt(t);return O.jsx(tr,{asChild:!0,...u,orientation:n.orientation,dir:n.dir,loop:i,children:O.jsx(we.div,{role:"tablist","aria-orientation":n.orientation,...a,ref:r})})});mt.displayName=ht;var _t="TabsTrigger",Vt=te.forwardRef((e,r)=>{const{__scopeTabs:t,value:i,disabled:a=!1,...n}=e,u=Ue(_t,t),c=vt(t),x=At(u.baseId,i),S=wt(u.baseId,i),D=i===u.value;return O.jsx(rr,{asChild:!0,...c,focusable:!a,active:D,children:O.jsx(we.button,{type:"button",role:"tab","aria-selected":D,"aria-controls":S,"data-state":D?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:x,...n,ref:r,onMouseDown:Re(e.onMouseDown,v=>{!a&&v.button===0&&v.ctrlKey===!1?u.onValueChange(i):v.preventDefault()}),onKeyDown:Re(e.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&u.onValueChange(i)}),onFocus:Re(e.onFocus,()=>{const v=u.activationMode!=="manual";!D&&!a&&v&&u.onValueChange(i)})})})});Vt.displayName=_t;var xt="TabsContent",Ft=te.forwardRef((e,r)=>{const{__scopeTabs:t,value:i,forceMount:a,children:n,...u}=e,c=Ue(xt,t),x=At(c.baseId,i),S=wt(c.baseId,i),D=i===c.value,v=te.useRef(D);return te.useEffect(()=>{const V=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(V)},[]),O.jsx(Gt,{present:a||D,children:({present:V})=>O.jsx(we.div,{"data-state":D?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":x,hidden:!V,id:S,tabIndex:0,...u,ref:r,style:{...e.style,animationDuration:v.current?"0s":void 0},children:V&&n})})});Ft.displayName=xt;function At(e,r){return`${e}-trigger-${r}`}function wt(e,r){return`${e}-content-${r}`}var lr=bt,ur=mt,cr=Vt,dr=Ft;function Pr(e){const r=ue.c(10);let t,i,a;r[0]!==e?({className:t,orientation:a,...i}=e,r[0]=e,r[1]=t,r[2]=i,r[3]=a):(t=r[1],i=r[2],a=r[3]);const n=a===void 0?"horizontal":a;let u;r[4]!==t?(u=fe("group/tabs flex gap-2 data-horizontal:flex-col",t),r[4]=t,r[5]=u):u=r[5];let c;return r[6]!==n||r[7]!==i||r[8]!==u?(c=O.jsx(lr,{"data-slot":"tabs","data-orientation":n,className:u,...i}),r[6]=n,r[7]=i,r[8]=u,r[9]=c):c=r[9],c}function jr(e){const r=ue.c(8);let t,i;r[0]!==e?({className:t,...i}=e,r[0]=e,r[1]=t,r[2]=i):(t=r[1],i=r[2]);let a;r[3]!==t?(a=fe("group/tabs-list bg-muted text-muted-foreground flex w-fit rounded-md border overflow-hidden group-data-horizontal/tabs:h-9 group-data-vertical/tabs:rounded-xl justify-center group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",t),r[3]=t,r[4]=a):a=r[4];let n;return r[5]!==i||r[6]!==a?(n=O.jsx(ur,{"data-slot":"tabs-list",className:a,...i}),r[5]=i,r[6]=a,r[7]=n):n=r[7],n}function Br(e){const r=ue.c(8);let t,i;r[0]!==e?({className:t,...i}=e,r[0]=e,r[1]=t,r[2]=i):(t=r[1],i=r[2]);let a;r[3]!==t?(a=fe("relative inline-flex flex-1 items-center justify-center border-b-2 border-transparent gap-1.5 whitespace-nowrap px-2 py-1 font-medium text-sm transition-colors focus-visible:outline-1 focus-visible:outline-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 hover:text-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0","data-active:border-brand data-active:text-accent-foreground",t),r[3]=t,r[4]=a):a=r[4];let n;return r[5]!==i||r[6]!==a?(n=O.jsx(cr,{"data-slot":"tabs-trigger",className:a,...i}),r[5]=i,r[6]=a,r[7]=n):n=r[7],n}function $r(e){const r=ue.c(8);let t,i;r[0]!==e?({className:t,...i}=e,r[0]=e,r[1]=t,r[2]=i):(t=r[1],i=r[2]);let a;r[3]!==t?(a=fe("flex-1 text-sm outline-none",t),r[3]=t,r[4]=a):a=r[4];let n;return r[5]!==i||r[6]!==a?(n=O.jsx(dr,{"data-slot":"tabs-content",className:a,...i}),r[5]=i,r[6]=a,r[7]=n):n=r[7],n}var _e=e=>e.type==="checkbox",le=e=>e instanceof Date,G=e=>e==null;const St=e=>typeof e=="object";var P=e=>!G(e)&&!Array.isArray(e)&&St(e)&&!le(e),Ct=e=>P(e)&&e.target?_e(e.target)?e.target.checked:e.target.value:e,fr=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,kt=(e,r)=>e.has(fr(r)),yr=e=>{const r=e.constructor&&e.constructor.prototype;return P(r)&&r.hasOwnProperty("isPrototypeOf")},Pe=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function L(e){if(e instanceof Date)return new Date(e);const r=typeof FileList<"u"&&e instanceof FileList;if(Pe&&(e instanceof Blob||r))return e;const t=Array.isArray(e);if(!t&&!(P(e)&&yr(e)))return e;const i=t?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(i[a]=L(e[a]));return i}var Ce=e=>/^\w*$/.test(e),N=e=>e===void 0,je=e=>Array.isArray(e)?e.filter(Boolean):[],Be=e=>je(e.replace(/["|']|\]/g,"").split(/\.|\[/)),y=(e,r,t)=>{if(!r||!P(e))return t;const i=(Ce(r)?[r]:Be(r)).reduce((a,n)=>G(a)?a:a[n],e);return N(i)||i===e?N(e[r])?t:e[r]:i},Y=e=>typeof e=="boolean",q=e=>typeof e=="function",p=(e,r,t)=>{let i=-1;const a=Ce(r)?[r]:Be(r),n=a.length,u=n-1;for(;++i<n;){const c=a[i];let x=t;if(i!==u){const S=e[c];x=P(S)||Array.isArray(S)?S:isNaN(+a[i+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=x,e=e[c]}};const xe={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Z={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ae={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Et=_.createContext(null);Et.displayName="HookFormControlContext";const $e=()=>_.useContext(Et);var Dt=(e,r,t,i=!0)=>{const a={defaultValues:r._defaultValues};for(const n in e)Object.defineProperty(a,n,{get:()=>{const u=n;return r._proxyFormState[u]!==Z.all&&(r._proxyFormState[u]=!i||Z.all),t&&(t[u]=!0),e[u]}});return a};const We=typeof window<"u"?_.useLayoutEffect:_.useEffect;function gr(e){const r=$e(),{control:t=r,disabled:i,name:a,exact:n}=e||{},[u,c]=_.useState(t._formState),x=_.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return We(()=>t._subscribe({name:a,formState:x.current,exact:n,callback:S=>{!i&&c({...t._formState,...S})}}),[a,i,n]),_.useEffect(()=>{x.current.isValid&&t._setValid(!0)},[t]),_.useMemo(()=>Dt(u,t,x.current,!1),[u,t])}var J=e=>typeof e=="string",Me=(e,r,t,i,a)=>J(e)?(i&&r.watch.add(e),y(t,e,a)):Array.isArray(e)?e.map(n=>(i&&r.watch.add(n),y(t,n))):(i&&(r.watchAll=!0),t),Oe=e=>G(e)||!St(e);function ee(e,r,t=new WeakSet){if(Oe(e)||Oe(r))return Object.is(e,r);if(le(e)&&le(r))return Object.is(e.getTime(),r.getTime());const i=Object.keys(e),a=Object.keys(r);if(i.length!==a.length)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);for(const n of i){const u=e[n];if(!a.includes(n))return!1;if(n!=="ref"){const c=r[n];if(le(u)&&le(c)||P(u)&&P(c)||Array.isArray(u)&&Array.isArray(c)?!ee(u,c,t):!Object.is(u,c))return!1}}return!0}function vr(e){const r=$e(),{control:t=r,name:i,defaultValue:a,disabled:n,exact:u,compute:c}=e||{},x=_.useRef(a),S=_.useRef(c),D=_.useRef(void 0),v=_.useRef(t),V=_.useRef(i);S.current=c;const[h,M]=_.useState(()=>{const F=t._getWatch(i,x.current);return S.current?S.current(F):F}),I=_.useCallback(F=>{const w=Me(i,t._names,F||t._formValues,!1,x.current);return S.current?S.current(w):w},[t._formValues,t._names,i]),T=_.useCallback(F=>{if(!n){const w=Me(i,t._names,F||t._formValues,!1,x.current);if(S.current){const z=S.current(w);ee(z,D.current)||(M(z),D.current=z)}else M(w)}},[t._formValues,t._names,n,i]);We(()=>((v.current!==t||!ee(V.current,i))&&(v.current=t,V.current=i,T()),t._subscribe({name:i,formState:{values:!0},exact:u,callback:F=>{T(F.values)}})),[t,u,i,T]),_.useEffect(()=>t._removeUnmounted());const R=v.current!==t,m=V.current,$=_.useMemo(()=>{if(n)return null;const F=!R&&!ee(m,i);return R||F?I():null},[n,R,i,m,I]);return $!==null?$:h}function br(e){const r=$e(),{name:t,disabled:i,control:a=r,shouldUnregister:n,defaultValue:u,exact:c=!0}=e,x=kt(a._names.array,t),S=_.useMemo(()=>y(a._formValues,t,y(a._defaultValues,t,u)),[a,t,u]),D=vr({control:a,name:t,defaultValue:S,exact:c}),v=gr({control:a,name:t,exact:c}),V=_.useRef(e),h=_.useRef(void 0),M=_.useRef(a.register(t,{...e.rules,value:D,...Y(e.disabled)?{disabled:e.disabled}:{}}));V.current=e;const I=_.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!y(v.errors,t)},isDirty:{enumerable:!0,get:()=>!!y(v.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!y(v.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!y(v.validatingFields,t)},error:{enumerable:!0,get:()=>y(v.errors,t)}}),[v,t]),T=_.useCallback(F=>M.current.onChange({target:{value:Ct(F),name:t},type:xe.CHANGE}),[t]),R=_.useCallback(()=>M.current.onBlur({target:{value:y(a._formValues,t),name:t},type:xe.BLUR}),[t,a._formValues]),m=_.useCallback(F=>{const w=y(a._fields,t);w&&w._f&&F&&(w._f.ref={focus:()=>q(F.focus)&&F.focus(),select:()=>q(F.select)&&F.select(),setCustomValidity:z=>q(F.setCustomValidity)&&F.setCustomValidity(z),reportValidity:()=>q(F.reportValidity)&&F.reportValidity()})},[a._fields,t]),$=_.useMemo(()=>({name:t,value:D,...Y(i)||v.disabled?{disabled:v.disabled||i}:{},onChange:T,onBlur:R,ref:m}),[t,i,v.disabled,T,R,m,D]);return _.useEffect(()=>{const F=a._options.shouldUnregister||n,w=h.current;w&&w!==t&&!x&&a.unregister(w),a.register(t,{...V.current.rules,...Y(V.current.disabled)?{disabled:V.current.disabled}:{}});const z=(se,ie)=>{const re=y(a._fields,se);re&&re._f&&(re._f.mount=ie)};if(z(t,!0),F){const se=L(y(a._options.defaultValues,t,V.current.defaultValue));p(a._defaultValues,t,se),N(y(a._formValues,t))&&p(a._formValues,t,se)}return!x&&a.register(t),h.current=t,()=>{(x?F&&!a._state.action:F)?a.unregister(t):z(t,!1)}},[t,a,x,n]),_.useEffect(()=>{a._setDisabledField({disabled:i,name:t})},[i,t,a]),_.useMemo(()=>({field:$,formState:v,fieldState:I}),[$,v,I])}const Wr=e=>e.render(br(e)),hr=_.createContext(null);hr.displayName="HookFormContext";var mr=(e,r,t,i,a)=>r?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:a||!0}}:{},he=e=>Array.isArray(e)?e:[e],st=()=>{let e=[];return{get observers(){return e},next:a=>{for(const n of e)n.next&&n.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(n=>n!==a)}}),unsubscribe:()=>{e=[]}}};function pt(e,r){const t={};for(const i in e)if(e.hasOwnProperty(i)){const a=e[i],n=r[i];if(a&&P(a)&&n){const u=pt(a,n);P(u)&&(t[i]=u)}else e[i]&&(t[i]=n)}return t}var H=e=>P(e)&&!Object.keys(e).length,He=e=>e.type==="file",Fe=e=>{if(!Pe)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Tt=e=>e.type==="select-multiple",qe=e=>e.type==="radio",_r=e=>qe(e)||_e(e),Ie=e=>Fe(e)&&e.isConnected;function Vr(e,r){const t=r.slice(0,-1).length;let i=0;for(;i<t;)e=N(e)?i++:e[r[i++]];return e}function xr(e){for(const r in e)if(e.hasOwnProperty(r)&&!N(e[r]))return!1;return!0}function U(e,r){const t=Array.isArray(r)?r:Ce(r)?[r]:Be(r),i=t.length===1?e:Vr(e,t),a=t.length-1,n=t[a];return i&&delete i[n],a!==0&&(P(i)&&H(i)||Array.isArray(i)&&xr(i))&&U(e,t.slice(0,-1)),e}var Fr=e=>{for(const r in e)if(q(e[r]))return!0;return!1};function Rt(e){return Array.isArray(e)||P(e)&&!Fr(e)}function Le(e,r={}){for(const t in e){const i=e[t];Rt(i)?(r[t]=Array.isArray(i)?[]:{},Le(i,r[t])):N(i)||(r[t]=!0)}return r}function de(e,r,t){t||(t=Le(r));for(const i in e){const a=e[i];if(Rt(a))N(r)||Oe(t[i])?t[i]=Le(a,Array.isArray(a)?[]:{}):de(a,G(r)?{}:r[i],t[i]);else{const n=r[i];t[i]=!ee(a,n)}}return t}const it={value:!1,isValid:!1},at={value:!0,isValid:!0};var Nt=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!N(e[0].attributes.value)?N(e[0].value)||e[0].value===""?at:{value:e[0].value,isValid:!0}:at:it}return it},It=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:i})=>N(e)?e:r?e===""?NaN:e&&+e:t&&J(e)?new Date(e):i?i(e):e;const nt={isValid:!1,value:null};var Mt=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,nt):nt;function ot(e){const r=e.ref;return He(r)?r.files:qe(r)?Mt(e.refs).value:Tt(r)?[...r.selectedOptions].map(({value:t})=>t):_e(r)?Nt(e.refs).value:It(N(r.value)?e.ref.value:r.value,e)}var Ar=(e,r,t,i)=>{const a={};for(const n of e){const u=y(r,n);u&&p(a,n,u._f)}return{criteriaMode:t,names:[...e],fields:a,shouldUseNativeValidation:i}},Ae=e=>e instanceof RegExp,be=e=>N(e)?e:Ae(e)?e.source:P(e)?Ae(e.value)?e.value.source:e.value:e,lt=e=>({isOnSubmit:!e||e===Z.onSubmit,isOnBlur:e===Z.onBlur,isOnChange:e===Z.onChange,isOnAll:e===Z.all,isOnTouch:e===Z.onTouched});const ut="AsyncFunction";var wr=e=>!!e&&!!e.validate&&!!(q(e.validate)&&e.validate.constructor.name===ut||P(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===ut)),Sr=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ct=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const me=(e,r,t,i)=>{for(const a of t||Object.keys(e)){const n=y(e,a);if(n){const{_f:u,...c}=n;if(u){if(u.refs&&u.refs[0]&&r(u.refs[0],a)&&!i)return!0;if(u.ref&&r(u.ref,u.name)&&!i)return!0;if(me(c,r))break}else if(P(c)&&me(c,r))break}}};function dt(e,r,t){const i=y(e,t);if(i||Ce(t))return{error:i,name:t};const a=t.split(".");for(;a.length;){const n=a.join("."),u=y(r,n),c=y(e,n);if(u&&!Array.isArray(u)&&t!==n)return{name:t};if(c&&c.type)return{name:n,error:c};if(c&&c.root&&c.root.type)return{name:`${n}.root`,error:c.root};a.pop()}return{name:t}}var Cr=(e,r,t,i)=>{t(e);const{name:a,...n}=e;return H(n)||Object.keys(n).length>=Object.keys(r).length||Object.keys(n).find(u=>r[u]===(!i||Z.all))},kr=(e,r,t)=>!e||!r||e===r||he(e).some(i=>i&&(t?i===r:i.startsWith(r)||r.startsWith(i))),Er=(e,r,t,i,a)=>a.isOnAll?!1:!t&&a.isOnTouch?!(r||e):(t?i.isOnBlur:a.isOnBlur)?!e:(t?i.isOnChange:a.isOnChange)?e:!0,Dr=(e,r)=>!je(y(e,r)).length&&U(e,r),pr=(e,r,t)=>{const i=he(y(e,t));return p(i,"root",r[t]),p(e,t,i),e};function ft(e,r,t="validate"){if(J(e)||Array.isArray(e)&&e.every(J)||Y(e)&&!e)return{type:t,message:J(e)?e:"",ref:r}}var ce=e=>P(e)&&!Ae(e)?e:{value:e,message:""},yt=async(e,r,t,i,a,n)=>{const{ref:u,refs:c,required:x,maxLength:S,minLength:D,min:v,max:V,pattern:h,validate:M,name:I,valueAsNumber:T,mount:R}=e._f,m=y(t,I);if(!R||r.has(I))return{};const $=c?c[0]:u,F=A=>{a&&$.reportValidity&&($.setCustomValidity(Y(A)?"":A||""),$.reportValidity())},w={},z=qe(u),se=_e(u),ie=z||se,re=(T||He(u))&&N(u.value)&&N(m)||Fe(u)&&u.value===""||m===""||Array.isArray(m)&&!m.length,Q=mr.bind(null,I,i,w),Ve=(A,C,j,B=ae.maxLength,X=ae.minLength)=>{const K=A?C:j;w[I]={type:A?B:X,message:K,ref:u,...Q(A?B:X,K)}};if(n?!Array.isArray(m)||!m.length:x&&(!ie&&(re||G(m))||Y(m)&&!m||se&&!Nt(c).isValid||z&&!Mt(c).isValid)){const{value:A,message:C}=J(x)?{value:!!x,message:x}:ce(x);if(A&&(w[I]={type:ae.required,message:C,ref:$,...Q(ae.required,C)},!i))return F(C),w}if(!re&&(!G(v)||!G(V))){let A,C;const j=ce(V),B=ce(v);if(!G(m)&&!isNaN(m)){const X=u.valueAsNumber||m&&+m;G(j.value)||(A=X>j.value),G(B.value)||(C=X<B.value)}else{const X=u.valueAsDate||new Date(m),K=ve=>new Date(new Date().toDateString()+" "+ve),ye=u.type=="time",ge=u.type=="week";J(j.value)&&m&&(A=ye?K(m)>K(j.value):ge?m>j.value:X>new Date(j.value)),J(B.value)&&m&&(C=ye?K(m)<K(B.value):ge?m<B.value:X<new Date(B.value))}if((A||C)&&(Ve(!!A,j.message,B.message,ae.max,ae.min),!i))return F(w[I].message),w}if((S||D)&&!re&&(J(m)||n&&Array.isArray(m))){const A=ce(S),C=ce(D),j=!G(A.value)&&m.length>+A.value,B=!G(C.value)&&m.length<+C.value;if((j||B)&&(Ve(j,A.message,C.message),!i))return F(w[I].message),w}if(h&&!re&&J(m)){const{value:A,message:C}=ce(h);if(Ae(A)&&!m.match(A)&&(w[I]={type:ae.pattern,message:C,ref:u,...Q(ae.pattern,C)},!i))return F(C),w}if(M){if(q(M)){const A=await M(m,t),C=ft(A,$);if(C&&(w[I]={...C,...Q(ae.validate,C.message)},!i))return F(C.message),w}else if(P(M)){let A={};for(const C in M){if(!H(A)&&!i)break;const j=ft(await M[C](m,t),$,C);j&&(A={...j,...Q(C,j.message)},F(j.message),i&&(w[I]=A))}if(!H(A)&&(w[I]={ref:$,...A},!i))return w}}return F(!0),w};const Tr={mode:Z.onSubmit,reValidateMode:Z.onChange,shouldFocusError:!0};function Rr(e={}){let r={...Tr,...e},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:q(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},i={},a=P(r.defaultValues)||P(r.values)?L(r.defaultValues||r.values)||{}:{},n=r.shouldUnregister?{}:L(a),u={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},x,S=0;const D={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={...D};let V={...v};const h={array:st(),state:st()},M=r.criteriaMode===Z.all,I=s=>o=>{clearTimeout(S),S=setTimeout(s,o)},T=async s=>{if(!u.keepIsValid&&!r.disabled&&(v.isValid||V.isValid||s)){let o;r.resolver?(o=H((await ie()).errors),R()):o=await Q(i,!0),o!==t.isValid&&h.state.next({isValid:o})}},R=(s,o)=>{!r.disabled&&(v.isValidating||v.validatingFields||V.isValidating||V.validatingFields)&&((s||Array.from(c.mount)).forEach(l=>{l&&(o?p(t.validatingFields,l,o):U(t.validatingFields,l))}),h.state.next({validatingFields:t.validatingFields,isValidating:!H(t.validatingFields)}))},m=(s,o=[],l,g,f=!0,d=!0)=>{if(g&&l&&!r.disabled){if(u.action=!0,d&&Array.isArray(y(i,s))){const b=l(y(i,s),g.argA,g.argB);f&&p(i,s,b)}if(d&&Array.isArray(y(t.errors,s))){const b=l(y(t.errors,s),g.argA,g.argB);f&&p(t.errors,s,b),Dr(t.errors,s)}if((v.touchedFields||V.touchedFields)&&d&&Array.isArray(y(t.touchedFields,s))){const b=l(y(t.touchedFields,s),g.argA,g.argB);f&&p(t.touchedFields,s,b)}(v.dirtyFields||V.dirtyFields)&&(t.dirtyFields=de(a,n)),h.state.next({name:s,isDirty:A(s,o),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else p(n,s,o)},$=(s,o)=>{p(t.errors,s,o),h.state.next({errors:t.errors})},F=s=>{t.errors=s,h.state.next({errors:t.errors,isValid:!1})},w=(s,o,l,g)=>{const f=y(i,s);if(f){const d=y(n,s,N(l)?y(a,s):l);N(d)||g&&g.defaultChecked||o?p(n,s,o?d:ot(f._f)):B(s,d),u.mount&&!u.action&&T()}},z=(s,o,l,g,f)=>{let d=!1,b=!1;const k={name:s};if(!r.disabled){if(!l||g){(v.isDirty||V.isDirty)&&(b=t.isDirty,t.isDirty=k.isDirty=A(),d=b!==k.isDirty);const E=ee(y(a,s),o);b=!!y(t.dirtyFields,s),E?U(t.dirtyFields,s):p(t.dirtyFields,s,!0),k.dirtyFields=t.dirtyFields,d=d||(v.dirtyFields||V.dirtyFields)&&b!==!E}if(l){const E=y(t.touchedFields,s);E||(p(t.touchedFields,s,l),k.touchedFields=t.touchedFields,d=d||(v.touchedFields||V.touchedFields)&&E!==l)}d&&f&&h.state.next(k)}return d?k:{}},se=(s,o,l,g)=>{const f=y(t.errors,s),d=(v.isValid||V.isValid)&&Y(o)&&t.isValid!==o;if(r.delayError&&l?(x=I(()=>$(s,l)),x(r.delayError)):(clearTimeout(S),x=null,l?p(t.errors,s,l):U(t.errors,s)),(l?!ee(f,l):f)||!H(g)||d){const b={...g,...d&&Y(o)?{isValid:o}:{},errors:t.errors,name:s};t={...t,...b},h.state.next(b)}},ie=async s=>(R(s,!0),await r.resolver(n,r.context,Ar(s||c.mount,i,r.criteriaMode,r.shouldUseNativeValidation))),re=async s=>{const{errors:o}=await ie(s);if(R(s),s)for(const l of s){const g=y(o,l);g?p(t.errors,l,g):U(t.errors,l)}else t.errors=o;return o},Q=async(s,o,l={valid:!0})=>{for(const g in s){const f=s[g];if(f){const{_f:d,...b}=f;if(d){const k=c.array.has(d.name),E=f._f&&wr(f._f);E&&v.validatingFields&&R([d.name],!0);const W=await yt(f,c.disabled,n,M,r.shouldUseNativeValidation&&!o,k);if(E&&v.validatingFields&&R([d.name]),W[d.name]&&(l.valid=!1,o||e.shouldUseNativeValidation))break;!o&&(y(W,d.name)?k?pr(t.errors,W,d.name):p(t.errors,d.name,W[d.name]):U(t.errors,d.name))}!H(b)&&await Q(b,o,l)}}return l.valid},Ve=()=>{for(const s of c.unMount){const o=y(i,s);o&&(o._f.refs?o._f.refs.every(l=>!Ie(l)):!Ie(o._f.ref))&&ke(s)}c.unMount=new Set},A=(s,o)=>!r.disabled&&(s&&o&&p(n,s,o),!ee(ze(),a)),C=(s,o,l)=>Me(s,c,{...u.mount?n:N(o)?a:J(s)?{[s]:o}:o},l,o),j=s=>je(y(u.mount?n:a,s,r.shouldUnregister?y(a,s,[]):[])),B=(s,o,l={})=>{const g=y(i,s);let f=o;if(g){const d=g._f;d&&(!d.disabled&&p(n,s,It(o,d)),f=Fe(d.ref)&&G(o)?"":o,Tt(d.ref)?[...d.ref.options].forEach(b=>b.selected=f.includes(b.value)):d.refs?_e(d.ref)?d.refs.forEach(b=>{(!b.defaultChecked||!b.disabled)&&(Array.isArray(f)?b.checked=!!f.find(k=>k===b.value):b.checked=f===b.value||!!f)}):d.refs.forEach(b=>b.checked=b.value===f):He(d.ref)?d.ref.value="":(d.ref.value=f,d.ref.type||h.state.next({name:s,values:L(n)})))}(l.shouldDirty||l.shouldTouch)&&z(s,f,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&ve(s)},X=(s,o,l)=>{for(const g in o){if(!o.hasOwnProperty(g))return;const f=o[g],d=s+"."+g,b=y(i,d);(c.array.has(s)||P(f)||b&&!b._f)&&!le(f)?X(d,f,l):B(d,f,l)}},K=(s,o,l={})=>{const g=y(i,s),f=c.array.has(s),d=L(o);p(n,s,d),f?(h.array.next({name:s,values:L(n)}),(v.isDirty||v.dirtyFields||V.isDirty||V.dirtyFields)&&l.shouldDirty&&h.state.next({name:s,dirtyFields:de(a,n),isDirty:A(s,d)})):g&&!g._f&&!G(d)?X(s,d,l):B(s,d,l),ct(s,c)?h.state.next({...t,name:s,values:L(n)}):h.state.next({name:u.mount?s:void 0,values:L(n)})},ye=async s=>{u.mount=!0;const o=s.target;let l=o.name,g=!0;const f=y(i,l),d=E=>{g=Number.isNaN(E)||le(E)&&isNaN(E.getTime())||ee(E,y(n,l,E))},b=lt(r.mode),k=lt(r.reValidateMode);if(f){let E,W;const oe=o.type?ot(f._f):Ct(s),ne=s.type===xe.BLUR||s.type===xe.FOCUS_OUT,Wt=!Sr(f._f)&&!r.resolver&&!y(t.errors,l)&&!f._f.deps||Er(ne,y(t.touchedFields,l),t.isSubmitted,k,b),pe=ct(l,c,ne);p(n,l,oe),ne?(!o||!o.readOnly)&&(f._f.onBlur&&f._f.onBlur(s),x&&x(0)):f._f.onChange&&f._f.onChange(s);const Te=z(l,oe,ne),Ht=!H(Te)||pe;if(!ne&&h.state.next({name:l,type:s.type,values:L(n)}),Wt)return(v.isValid||V.isValid)&&(r.mode==="onBlur"?ne&&T():ne||T()),Ht&&h.state.next({name:l,...pe?{}:Te});if(!ne&&pe&&h.state.next({...t}),r.resolver){const{errors:tt}=await ie([l]);if(R([l]),d(oe),g){const qt=dt(t.errors,i,l),rt=dt(tt,i,qt.name||l);E=rt.error,l=rt.name,W=H(tt)}}else R([l],!0),E=(await yt(f,c.disabled,n,M,r.shouldUseNativeValidation))[l],R([l]),d(oe),g&&(E?W=!1:(v.isValid||V.isValid)&&(W=await Q(i,!0)));g&&(f._f.deps&&(!Array.isArray(f._f.deps)||f._f.deps.length>0)&&ve(f._f.deps),se(l,W,E,Te))}},ge=(s,o)=>{if(y(t.errors,o)&&s.focus)return s.focus(),1},ve=async(s,o={})=>{let l,g;const f=he(s);if(r.resolver){const d=await re(N(s)?s:f);l=H(d),g=s?!f.some(b=>y(d,b)):l}else s?(g=(await Promise.all(f.map(async d=>{const b=y(i,d);return await Q(b&&b._f?{[d]:b}:b)}))).every(Boolean),!(!g&&!t.isValid)&&T()):g=l=await Q(i);return h.state.next({...!J(s)||(v.isValid||V.isValid)&&l!==t.isValid?{}:{name:s},...r.resolver||!s?{isValid:l}:{},errors:t.errors}),o.shouldFocus&&!g&&me(i,ge,s?f:c.mount),g},ze=(s,o)=>{let l={...u.mount?n:a};return o&&(l=pt(o.dirtyFields?t.dirtyFields:t.touchedFields,l)),N(s)?l:J(s)?y(l,s):s.map(g=>y(l,g))},Ge=(s,o)=>({invalid:!!y((o||t).errors,s),isDirty:!!y((o||t).dirtyFields,s),error:y((o||t).errors,s),isValidating:!!y(t.validatingFields,s),isTouched:!!y((o||t).touchedFields,s)}),Ot=s=>{const o=s?he(s):void 0;o?.forEach(l=>U(t.errors,l)),o?o.forEach(l=>{h.state.next({name:l,errors:t.errors})}):h.state.next({errors:{}})},Ke=(s,o,l)=>{const g=(y(i,s,{_f:{}})._f||{}).ref,f=y(t.errors,s)||{},{ref:d,message:b,type:k,...E}=f;p(t.errors,s,{...E,...o,ref:g}),h.state.next({name:s,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&g&&g.focus&&g.focus()},Lt=(s,o)=>q(s)?h.state.subscribe({next:l=>"values"in l&&s(C(void 0,o),l)}):C(s,o,!0),Ye=s=>h.state.subscribe({next:o=>{kr(s.name,o.name,s.exact)&&Cr(o,s.formState||v,$t,s.reRenderRoot)&&s.callback({values:{...n},...t,...o,defaultValues:a})}}).unsubscribe,Ut=s=>(u.mount=!0,V={...V,...s.formState},Ye({...s,formState:{...D,...s.formState}})),ke=(s,o={})=>{for(const l of s?he(s):c.mount)c.mount.delete(l),c.array.delete(l),o.keepValue||(U(i,l),U(n,l)),!o.keepError&&U(t.errors,l),!o.keepDirty&&U(t.dirtyFields,l),!o.keepTouched&&U(t.touchedFields,l),!o.keepIsValidating&&U(t.validatingFields,l),!r.shouldUnregister&&!o.keepDefaultValue&&U(a,l);h.state.next({values:L(n)}),h.state.next({...t,...o.keepDirty?{isDirty:A()}:{}}),!o.keepIsValid&&T()},Je=({disabled:s,name:o})=>{if(Y(s)&&u.mount||s||c.disabled.has(o)){const f=c.disabled.has(o)!==!!s;s?c.disabled.add(o):c.disabled.delete(o),f&&u.mount&&!u.action&&T()}},Ee=(s,o={})=>{let l=y(i,s);const g=Y(o.disabled)||Y(r.disabled);return p(i,s,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:s}},name:s,mount:!0,...o}}),c.mount.add(s),l?Je({disabled:Y(o.disabled)?o.disabled:r.disabled,name:s}):w(s,!0,o.value),{...g?{disabled:o.disabled||r.disabled}:{},...r.progressive?{required:!!o.required,min:be(o.min),max:be(o.max),minLength:be(o.minLength),maxLength:be(o.maxLength),pattern:be(o.pattern)}:{},name:s,onChange:ye,onBlur:ye,ref:f=>{if(f){Ee(s,o),l=y(i,s);const d=N(f.value)&&f.querySelectorAll&&f.querySelectorAll("input,select,textarea")[0]||f,b=_r(d),k=l._f.refs||[];if(b?k.find(E=>E===d):d===l._f.ref)return;p(i,s,{_f:{...l._f,...b?{refs:[...k.filter(Ie),d,...Array.isArray(y(a,s))?[{}]:[]],ref:{type:d.type,name:s}}:{ref:d}}}),w(s,!1,void 0,d)}else l=y(i,s,{}),l._f&&(l._f.mount=!1),(r.shouldUnregister||o.shouldUnregister)&&!(kt(c.array,s)&&u.action)&&c.unMount.add(s)}}},De=()=>r.shouldFocusError&&me(i,ge,c.mount),Pt=s=>{Y(s)&&(h.state.next({disabled:s}),me(i,(o,l)=>{const g=y(i,l);g&&(o.disabled=g._f.disabled||s,Array.isArray(g._f.refs)&&g._f.refs.forEach(f=>{f.disabled=g._f.disabled||s}))},0,!1))},Qe=(s,o)=>async l=>{let g;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let f=L(n);if(h.state.next({isSubmitting:!0}),r.resolver){const{errors:d,values:b}=await ie();R(),t.errors=d,f=L(b)}else await Q(i);if(c.disabled.size)for(const d of c.disabled)U(f,d);if(U(t.errors,"root"),H(t.errors)){h.state.next({errors:{}});try{await s(f,l)}catch(d){g=d}}else o&&await o({...t.errors},l),De(),setTimeout(De);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:H(t.errors)&&!g,submitCount:t.submitCount+1,errors:t.errors}),g)throw g},jt=(s,o={})=>{y(i,s)&&(N(o.defaultValue)?K(s,L(y(a,s))):(K(s,o.defaultValue),p(a,s,L(o.defaultValue))),o.keepTouched||U(t.touchedFields,s),o.keepDirty||(U(t.dirtyFields,s),t.isDirty=o.defaultValue?A(s,L(y(a,s))):A()),o.keepError||(U(t.errors,s),v.isValid&&T()),h.state.next({...t}))},Xe=(s,o={})=>{const l=s?L(s):a,g=L(l),f=H(s),d=f?a:g;if(o.keepDefaultValues||(a=l),!o.keepValues){if(o.keepDirtyValues){const b=new Set([...c.mount,...Object.keys(de(a,n))]);for(const k of Array.from(b)){const E=y(t.dirtyFields,k),W=y(n,k),oe=y(d,k);E&&!N(W)?p(d,k,W):!E&&!N(oe)&&K(k,oe)}}else{if(Pe&&N(s))for(const b of c.mount){const k=y(i,b);if(k&&k._f){const E=Array.isArray(k._f.refs)?k._f.refs[0]:k._f.ref;if(Fe(E)){const W=E.closest("form");if(W){W.reset();break}}}}if(o.keepFieldsRef)for(const b of c.mount)K(b,y(d,b));else i={}}n=r.shouldUnregister?o.keepDefaultValues?L(a):{}:L(d),h.array.next({values:{...d}}),h.state.next({values:{...d}})}c={mount:o.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},u.mount=!v.isValid||!!o.keepIsValid||!!o.keepDirtyValues||!r.shouldUnregister&&!H(d),u.watch=!!r.shouldUnregister,u.keepIsValid=!!o.keepIsValid,u.action=!1,o.keepErrors||(t.errors={}),h.state.next({submitCount:o.keepSubmitCount?t.submitCount:0,isDirty:f?!1:o.keepDirty?t.isDirty:!!(o.keepDefaultValues&&!ee(s,a)),isSubmitted:o.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:f?{}:o.keepDirtyValues?o.keepDefaultValues&&n?de(a,n):t.dirtyFields:o.keepDefaultValues&&s?de(a,s):o.keepDirty?t.dirtyFields:{},touchedFields:o.keepTouched?t.touchedFields:{},errors:o.keepErrors?t.errors:{},isSubmitSuccessful:o.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},Ze=(s,o)=>Xe(q(s)?s(n):s,{...r.resetOptions,...o}),Bt=(s,o={})=>{const l=y(i,s),g=l&&l._f;if(g){const f=g.refs?g.refs[0]:g.ref;f.focus&&setTimeout(()=>{f.focus(),o.shouldSelect&&q(f.select)&&f.select()})}},$t=s=>{t={...t,...s}},et={control:{register:Ee,unregister:ke,getFieldState:Ge,handleSubmit:Qe,setError:Ke,_subscribe:Ye,_runSchema:ie,_updateIsValidating:R,_focusError:De,_getWatch:C,_getDirty:A,_setValid:T,_setFieldArray:m,_setDisabledField:Je,_setErrors:F,_getFieldArray:j,_reset:Xe,_resetDefaultValues:()=>q(r.defaultValues)&&r.defaultValues().then(s=>{Ze(s,r.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:Ve,_disableForm:Pt,_subjects:h,_proxyFormState:v,get _fields(){return i},get _formValues(){return n},get _state(){return u},set _state(s){u=s},get _defaultValues(){return a},get _names(){return c},set _names(s){c=s},get _formState(){return t},get _options(){return r},set _options(s){r={...r,...s}}},subscribe:Ut,trigger:ve,register:Ee,handleSubmit:Qe,watch:Lt,setValue:K,getValues:ze,reset:Ze,resetField:jt,clearErrors:Ot,unregister:ke,setError:Ke,setFocus:Bt,getFieldState:Ge};return{...et,formControl:et}}function Hr(e={}){const r=_.useRef(void 0),t=_.useRef(void 0),[i,a]=_.useState({isDirty:!1,isValidating:!1,isLoading:q(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:q(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:i},e.defaultValues&&!q(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:u,...c}=Rr(e);r.current={...c,formState:i}}const n=r.current.control;return n._options=e,We(()=>{const u=n._subscribe({formState:n._proxyFormState,callback:()=>a({...n._formState}),reRenderRoot:!0});return a(c=>({...c,isReady:!0})),n._formState.isReady=!0,u},[n]),_.useEffect(()=>n._disableForm(e.disabled),[n,e.disabled]),_.useEffect(()=>{e.mode&&(n._options.mode=e.mode),e.reValidateMode&&(n._options.reValidateMode=e.reValidateMode)},[n,e.mode,e.reValidateMode]),_.useEffect(()=>{e.errors&&(n._setErrors(e.errors),n._focusError())},[n,e.errors]),_.useEffect(()=>{e.shouldUnregister&&n._subjects.state.next({values:n._getWatch()})},[n,e.shouldUnregister]),_.useEffect(()=>{if(n._proxyFormState.isDirty){const u=n._getDirty();u!==i.isDirty&&n._subjects.state.next({isDirty:u})}},[n,i.isDirty]),_.useEffect(()=>{var u;e.values&&!ee(e.values,t.current)?(n._reset(e.values,{keepFieldsRef:!0,...n._options.resetOptions}),!((u=n._options.resetOptions)===null||u===void 0)&&u.keepIsValid||n._setValid(),t.current=e.values,a(c=>({...c}))):n._resetDefaultValues()},[n,e.values]),_.useEffect(()=>{n._state.mount||(n._setValid(),n._state.mount=!0),n._state.watch&&(n._state.watch=!1,n._subjects.state.next({...n._formState})),n._removeUnmounted()}),r.current.formState=_.useMemo(()=>Dt(i,n),[n,i]),r.current}function qr(){const e=ue.c(18),r=Xt(),t=Zt(),[i,a]=te.useState(!0),n=te.useRef(null);let u;e[0]!==t.hasUnsyncedChanges?(u=()=>{n.current&&window.clearTimeout(n.current),n.current=window.setTimeout(()=>{a(!t.hasUnsyncedChanges)},100)},e[0]=t.hasUnsyncedChanges,e[1]=u):u=e[1];const c=te.useEffectEvent(u);let x;e[2]!==c||e[3]!==t?(x=()=>(t.on("unsyncedChanges",c),()=>{t.off("unsyncedChanges",c)}),e[2]=c,e[3]=t,e[4]=x):x=e[4];let S;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=[],e[5]=S):S=e[5],te.useEffect(x,S);const D=r===Ne.Connected&&"bg-green-400",v=r===Ne.Connecting&&"bg-orange-400",V=r===Ne.Disconnected&&"bg-red-400";let h;e[6]!==D||e[7]!==v||e[8]!==V?(h=fe("transition-colors size-2.5 rounded-full",D,v,V),e[6]=D,e[7]=v,e[8]=V,e[9]=h):h=e[9];let M;e[10]!==h?(M=O.jsx("div",{className:h}),e[10]=h,e[11]=M):M=e[11];const I=`${r} ⋅ ${i?"saved":"saving"}`;let T;e[12]!==M||e[13]!==I?(T=O.jsxs("div",{className:"flex min-w-44 items-center font-mono text-xs text-muted-foreground gap-1.5",children:[M,I]}),e[12]=M,e[13]=I,e[14]=T):T=e[14];let R;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=O.jsx(er,{variant:"ghost",size:"icon-sm",className:"my-auto text-muted-foreground -me-1.5","aria-label":"Settings",children:O.jsx(ar,{})}),e[15]=R):R=e[15];let m;return e[16]!==T?(m=O.jsxs("div",{className:"sticky mt-auto w-full bottom-0 bg-background border-t flex gap-2 px-4 justify-end h-10 z-20",children:[T,R]}),e[16]=T,e[17]=m):m=e[17],m}function zr(e){const r=ue.c(3),{children:t}=e;let i;r[0]===Symbol.for("react.memo_cache_sentinel")?(i=O.jsx(Nr,{}),r[0]=i):i=r[0];let a;return r[1]!==t?(a=O.jsx(te.Suspense,{fallback:i,children:t}),r[1]=t,r[2]=a):a=r[2],a}function Nr(e){const r=ue.c(6);let t;r[0]!==e.className?(t=fe("flex justify-center items-center gap-2 text-muted-foreground bg-muted border-y p-3 flex-1",e.className),r[0]=e.className,r[1]=t):t=r[1];let i;r[2]===Symbol.for("react.memo_cache_sentinel")?(i=O.jsx(sr,{}),r[2]=i):i=r[2];let a;return r[3]!==e||r[4]!==t?(a=O.jsxs("div",{...e,className:t,children:[i,"Loading Editor"]}),r[3]=e,r[4]=t,r[5]=a):a=r[5],a}export{Wr as C,zr as E,qr as S,jr as T,Br as a,$r as b,Pr as c,Nr as d,Hr as u};
1
+ import{r as te,j as O,h as ue,W as _}from"./react-Dk3PRQ9V.js";import{e as zt,cD as we,cF as Re,cK as Gt,cH as Kt,cE as Yt,ai as Jt,cG as Qt,t as fe,d7 as Xt,d0 as Zt,d8 as Ne,B as er}from"./index-BYgxF2sp.js";import{R as tr,I as rr,c as gt}from"./index-DaIko2JM.js";import{S as sr}from"./spinner-C1xi9J1T.js";const ir=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ar=zt("settings",ir);var Se="Tabs",[nr]=Qt(Se,[gt]),vt=gt(),[or,Ue]=nr(Se),bt=te.forwardRef((e,r)=>{const{__scopeTabs:t,value:i,onValueChange:a,defaultValue:n,orientation:u="horizontal",dir:c,activationMode:x="automatic",...S}=e,D=Kt(c),[v,V]=Yt({prop:i,onChange:a,defaultProp:n??"",caller:Se});return O.jsx(or,{scope:t,baseId:Jt(),value:v,onValueChange:V,orientation:u,dir:D,activationMode:x,children:O.jsx(we.div,{dir:D,"data-orientation":u,...S,ref:r})})});bt.displayName=Se;var ht="TabsList",mt=te.forwardRef((e,r)=>{const{__scopeTabs:t,loop:i=!0,...a}=e,n=Ue(ht,t),u=vt(t);return O.jsx(tr,{asChild:!0,...u,orientation:n.orientation,dir:n.dir,loop:i,children:O.jsx(we.div,{role:"tablist","aria-orientation":n.orientation,...a,ref:r})})});mt.displayName=ht;var _t="TabsTrigger",Vt=te.forwardRef((e,r)=>{const{__scopeTabs:t,value:i,disabled:a=!1,...n}=e,u=Ue(_t,t),c=vt(t),x=At(u.baseId,i),S=wt(u.baseId,i),D=i===u.value;return O.jsx(rr,{asChild:!0,...c,focusable:!a,active:D,children:O.jsx(we.button,{type:"button",role:"tab","aria-selected":D,"aria-controls":S,"data-state":D?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:x,...n,ref:r,onMouseDown:Re(e.onMouseDown,v=>{!a&&v.button===0&&v.ctrlKey===!1?u.onValueChange(i):v.preventDefault()}),onKeyDown:Re(e.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&u.onValueChange(i)}),onFocus:Re(e.onFocus,()=>{const v=u.activationMode!=="manual";!D&&!a&&v&&u.onValueChange(i)})})})});Vt.displayName=_t;var xt="TabsContent",Ft=te.forwardRef((e,r)=>{const{__scopeTabs:t,value:i,forceMount:a,children:n,...u}=e,c=Ue(xt,t),x=At(c.baseId,i),S=wt(c.baseId,i),D=i===c.value,v=te.useRef(D);return te.useEffect(()=>{const V=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(V)},[]),O.jsx(Gt,{present:a||D,children:({present:V})=>O.jsx(we.div,{"data-state":D?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":x,hidden:!V,id:S,tabIndex:0,...u,ref:r,style:{...e.style,animationDuration:v.current?"0s":void 0},children:V&&n})})});Ft.displayName=xt;function At(e,r){return`${e}-trigger-${r}`}function wt(e,r){return`${e}-content-${r}`}var lr=bt,ur=mt,cr=Vt,dr=Ft;function Pr(e){const r=ue.c(10);let t,i,a;r[0]!==e?({className:t,orientation:a,...i}=e,r[0]=e,r[1]=t,r[2]=i,r[3]=a):(t=r[1],i=r[2],a=r[3]);const n=a===void 0?"horizontal":a;let u;r[4]!==t?(u=fe("group/tabs flex gap-2 data-horizontal:flex-col",t),r[4]=t,r[5]=u):u=r[5];let c;return r[6]!==n||r[7]!==i||r[8]!==u?(c=O.jsx(lr,{"data-slot":"tabs","data-orientation":n,className:u,...i}),r[6]=n,r[7]=i,r[8]=u,r[9]=c):c=r[9],c}function jr(e){const r=ue.c(8);let t,i;r[0]!==e?({className:t,...i}=e,r[0]=e,r[1]=t,r[2]=i):(t=r[1],i=r[2]);let a;r[3]!==t?(a=fe("group/tabs-list bg-muted text-muted-foreground flex w-fit rounded-md border overflow-hidden group-data-horizontal/tabs:h-9 group-data-vertical/tabs:rounded-xl justify-center group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",t),r[3]=t,r[4]=a):a=r[4];let n;return r[5]!==i||r[6]!==a?(n=O.jsx(ur,{"data-slot":"tabs-list",className:a,...i}),r[5]=i,r[6]=a,r[7]=n):n=r[7],n}function Br(e){const r=ue.c(8);let t,i;r[0]!==e?({className:t,...i}=e,r[0]=e,r[1]=t,r[2]=i):(t=r[1],i=r[2]);let a;r[3]!==t?(a=fe("relative inline-flex flex-1 items-center justify-center border-b-2 border-transparent gap-1.5 whitespace-nowrap px-2 py-1 font-medium text-sm transition-colors focus-visible:outline-1 focus-visible:outline-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 hover:text-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0","data-active:border-brand data-active:text-accent-foreground",t),r[3]=t,r[4]=a):a=r[4];let n;return r[5]!==i||r[6]!==a?(n=O.jsx(cr,{"data-slot":"tabs-trigger",className:a,...i}),r[5]=i,r[6]=a,r[7]=n):n=r[7],n}function $r(e){const r=ue.c(8);let t,i;r[0]!==e?({className:t,...i}=e,r[0]=e,r[1]=t,r[2]=i):(t=r[1],i=r[2]);let a;r[3]!==t?(a=fe("flex-1 text-sm outline-none",t),r[3]=t,r[4]=a):a=r[4];let n;return r[5]!==i||r[6]!==a?(n=O.jsx(dr,{"data-slot":"tabs-content",className:a,...i}),r[5]=i,r[6]=a,r[7]=n):n=r[7],n}var _e=e=>e.type==="checkbox",le=e=>e instanceof Date,G=e=>e==null;const St=e=>typeof e=="object";var P=e=>!G(e)&&!Array.isArray(e)&&St(e)&&!le(e),Ct=e=>P(e)&&e.target?_e(e.target)?e.target.checked:e.target.value:e,fr=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,kt=(e,r)=>e.has(fr(r)),yr=e=>{const r=e.constructor&&e.constructor.prototype;return P(r)&&r.hasOwnProperty("isPrototypeOf")},Pe=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function L(e){if(e instanceof Date)return new Date(e);const r=typeof FileList<"u"&&e instanceof FileList;if(Pe&&(e instanceof Blob||r))return e;const t=Array.isArray(e);if(!t&&!(P(e)&&yr(e)))return e;const i=t?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(i[a]=L(e[a]));return i}var Ce=e=>/^\w*$/.test(e),N=e=>e===void 0,je=e=>Array.isArray(e)?e.filter(Boolean):[],Be=e=>je(e.replace(/["|']|\]/g,"").split(/\.|\[/)),y=(e,r,t)=>{if(!r||!P(e))return t;const i=(Ce(r)?[r]:Be(r)).reduce((a,n)=>G(a)?a:a[n],e);return N(i)||i===e?N(e[r])?t:e[r]:i},Y=e=>typeof e=="boolean",q=e=>typeof e=="function",p=(e,r,t)=>{let i=-1;const a=Ce(r)?[r]:Be(r),n=a.length,u=n-1;for(;++i<n;){const c=a[i];let x=t;if(i!==u){const S=e[c];x=P(S)||Array.isArray(S)?S:isNaN(+a[i+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=x,e=e[c]}};const xe={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Z={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ae={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Et=_.createContext(null);Et.displayName="HookFormControlContext";const $e=()=>_.useContext(Et);var Dt=(e,r,t,i=!0)=>{const a={defaultValues:r._defaultValues};for(const n in e)Object.defineProperty(a,n,{get:()=>{const u=n;return r._proxyFormState[u]!==Z.all&&(r._proxyFormState[u]=!i||Z.all),t&&(t[u]=!0),e[u]}});return a};const We=typeof window<"u"?_.useLayoutEffect:_.useEffect;function gr(e){const r=$e(),{control:t=r,disabled:i,name:a,exact:n}=e||{},[u,c]=_.useState(t._formState),x=_.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return We(()=>t._subscribe({name:a,formState:x.current,exact:n,callback:S=>{!i&&c({...t._formState,...S})}}),[a,i,n]),_.useEffect(()=>{x.current.isValid&&t._setValid(!0)},[t]),_.useMemo(()=>Dt(u,t,x.current,!1),[u,t])}var J=e=>typeof e=="string",Me=(e,r,t,i,a)=>J(e)?(i&&r.watch.add(e),y(t,e,a)):Array.isArray(e)?e.map(n=>(i&&r.watch.add(n),y(t,n))):(i&&(r.watchAll=!0),t),Oe=e=>G(e)||!St(e);function ee(e,r,t=new WeakSet){if(Oe(e)||Oe(r))return Object.is(e,r);if(le(e)&&le(r))return Object.is(e.getTime(),r.getTime());const i=Object.keys(e),a=Object.keys(r);if(i.length!==a.length)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);for(const n of i){const u=e[n];if(!a.includes(n))return!1;if(n!=="ref"){const c=r[n];if(le(u)&&le(c)||P(u)&&P(c)||Array.isArray(u)&&Array.isArray(c)?!ee(u,c,t):!Object.is(u,c))return!1}}return!0}function vr(e){const r=$e(),{control:t=r,name:i,defaultValue:a,disabled:n,exact:u,compute:c}=e||{},x=_.useRef(a),S=_.useRef(c),D=_.useRef(void 0),v=_.useRef(t),V=_.useRef(i);S.current=c;const[h,M]=_.useState(()=>{const F=t._getWatch(i,x.current);return S.current?S.current(F):F}),I=_.useCallback(F=>{const w=Me(i,t._names,F||t._formValues,!1,x.current);return S.current?S.current(w):w},[t._formValues,t._names,i]),T=_.useCallback(F=>{if(!n){const w=Me(i,t._names,F||t._formValues,!1,x.current);if(S.current){const z=S.current(w);ee(z,D.current)||(M(z),D.current=z)}else M(w)}},[t._formValues,t._names,n,i]);We(()=>((v.current!==t||!ee(V.current,i))&&(v.current=t,V.current=i,T()),t._subscribe({name:i,formState:{values:!0},exact:u,callback:F=>{T(F.values)}})),[t,u,i,T]),_.useEffect(()=>t._removeUnmounted());const R=v.current!==t,m=V.current,$=_.useMemo(()=>{if(n)return null;const F=!R&&!ee(m,i);return R||F?I():null},[n,R,i,m,I]);return $!==null?$:h}function br(e){const r=$e(),{name:t,disabled:i,control:a=r,shouldUnregister:n,defaultValue:u,exact:c=!0}=e,x=kt(a._names.array,t),S=_.useMemo(()=>y(a._formValues,t,y(a._defaultValues,t,u)),[a,t,u]),D=vr({control:a,name:t,defaultValue:S,exact:c}),v=gr({control:a,name:t,exact:c}),V=_.useRef(e),h=_.useRef(void 0),M=_.useRef(a.register(t,{...e.rules,value:D,...Y(e.disabled)?{disabled:e.disabled}:{}}));V.current=e;const I=_.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!y(v.errors,t)},isDirty:{enumerable:!0,get:()=>!!y(v.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!y(v.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!y(v.validatingFields,t)},error:{enumerable:!0,get:()=>y(v.errors,t)}}),[v,t]),T=_.useCallback(F=>M.current.onChange({target:{value:Ct(F),name:t},type:xe.CHANGE}),[t]),R=_.useCallback(()=>M.current.onBlur({target:{value:y(a._formValues,t),name:t},type:xe.BLUR}),[t,a._formValues]),m=_.useCallback(F=>{const w=y(a._fields,t);w&&w._f&&F&&(w._f.ref={focus:()=>q(F.focus)&&F.focus(),select:()=>q(F.select)&&F.select(),setCustomValidity:z=>q(F.setCustomValidity)&&F.setCustomValidity(z),reportValidity:()=>q(F.reportValidity)&&F.reportValidity()})},[a._fields,t]),$=_.useMemo(()=>({name:t,value:D,...Y(i)||v.disabled?{disabled:v.disabled||i}:{},onChange:T,onBlur:R,ref:m}),[t,i,v.disabled,T,R,m,D]);return _.useEffect(()=>{const F=a._options.shouldUnregister||n,w=h.current;w&&w!==t&&!x&&a.unregister(w),a.register(t,{...V.current.rules,...Y(V.current.disabled)?{disabled:V.current.disabled}:{}});const z=(se,ie)=>{const re=y(a._fields,se);re&&re._f&&(re._f.mount=ie)};if(z(t,!0),F){const se=L(y(a._options.defaultValues,t,V.current.defaultValue));p(a._defaultValues,t,se),N(y(a._formValues,t))&&p(a._formValues,t,se)}return!x&&a.register(t),h.current=t,()=>{(x?F&&!a._state.action:F)?a.unregister(t):z(t,!1)}},[t,a,x,n]),_.useEffect(()=>{a._setDisabledField({disabled:i,name:t})},[i,t,a]),_.useMemo(()=>({field:$,formState:v,fieldState:I}),[$,v,I])}const Wr=e=>e.render(br(e)),hr=_.createContext(null);hr.displayName="HookFormContext";var mr=(e,r,t,i,a)=>r?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:a||!0}}:{},he=e=>Array.isArray(e)?e:[e],st=()=>{let e=[];return{get observers(){return e},next:a=>{for(const n of e)n.next&&n.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(n=>n!==a)}}),unsubscribe:()=>{e=[]}}};function pt(e,r){const t={};for(const i in e)if(e.hasOwnProperty(i)){const a=e[i],n=r[i];if(a&&P(a)&&n){const u=pt(a,n);P(u)&&(t[i]=u)}else e[i]&&(t[i]=n)}return t}var H=e=>P(e)&&!Object.keys(e).length,He=e=>e.type==="file",Fe=e=>{if(!Pe)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Tt=e=>e.type==="select-multiple",qe=e=>e.type==="radio",_r=e=>qe(e)||_e(e),Ie=e=>Fe(e)&&e.isConnected;function Vr(e,r){const t=r.slice(0,-1).length;let i=0;for(;i<t;)e=N(e)?i++:e[r[i++]];return e}function xr(e){for(const r in e)if(e.hasOwnProperty(r)&&!N(e[r]))return!1;return!0}function U(e,r){const t=Array.isArray(r)?r:Ce(r)?[r]:Be(r),i=t.length===1?e:Vr(e,t),a=t.length-1,n=t[a];return i&&delete i[n],a!==0&&(P(i)&&H(i)||Array.isArray(i)&&xr(i))&&U(e,t.slice(0,-1)),e}var Fr=e=>{for(const r in e)if(q(e[r]))return!0;return!1};function Rt(e){return Array.isArray(e)||P(e)&&!Fr(e)}function Le(e,r={}){for(const t in e){const i=e[t];Rt(i)?(r[t]=Array.isArray(i)?[]:{},Le(i,r[t])):N(i)||(r[t]=!0)}return r}function de(e,r,t){t||(t=Le(r));for(const i in e){const a=e[i];if(Rt(a))N(r)||Oe(t[i])?t[i]=Le(a,Array.isArray(a)?[]:{}):de(a,G(r)?{}:r[i],t[i]);else{const n=r[i];t[i]=!ee(a,n)}}return t}const it={value:!1,isValid:!1},at={value:!0,isValid:!0};var Nt=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!N(e[0].attributes.value)?N(e[0].value)||e[0].value===""?at:{value:e[0].value,isValid:!0}:at:it}return it},It=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:i})=>N(e)?e:r?e===""?NaN:e&&+e:t&&J(e)?new Date(e):i?i(e):e;const nt={isValid:!1,value:null};var Mt=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,nt):nt;function ot(e){const r=e.ref;return He(r)?r.files:qe(r)?Mt(e.refs).value:Tt(r)?[...r.selectedOptions].map(({value:t})=>t):_e(r)?Nt(e.refs).value:It(N(r.value)?e.ref.value:r.value,e)}var Ar=(e,r,t,i)=>{const a={};for(const n of e){const u=y(r,n);u&&p(a,n,u._f)}return{criteriaMode:t,names:[...e],fields:a,shouldUseNativeValidation:i}},Ae=e=>e instanceof RegExp,be=e=>N(e)?e:Ae(e)?e.source:P(e)?Ae(e.value)?e.value.source:e.value:e,lt=e=>({isOnSubmit:!e||e===Z.onSubmit,isOnBlur:e===Z.onBlur,isOnChange:e===Z.onChange,isOnAll:e===Z.all,isOnTouch:e===Z.onTouched});const ut="AsyncFunction";var wr=e=>!!e&&!!e.validate&&!!(q(e.validate)&&e.validate.constructor.name===ut||P(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===ut)),Sr=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ct=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const me=(e,r,t,i)=>{for(const a of t||Object.keys(e)){const n=y(e,a);if(n){const{_f:u,...c}=n;if(u){if(u.refs&&u.refs[0]&&r(u.refs[0],a)&&!i)return!0;if(u.ref&&r(u.ref,u.name)&&!i)return!0;if(me(c,r))break}else if(P(c)&&me(c,r))break}}};function dt(e,r,t){const i=y(e,t);if(i||Ce(t))return{error:i,name:t};const a=t.split(".");for(;a.length;){const n=a.join("."),u=y(r,n),c=y(e,n);if(u&&!Array.isArray(u)&&t!==n)return{name:t};if(c&&c.type)return{name:n,error:c};if(c&&c.root&&c.root.type)return{name:`${n}.root`,error:c.root};a.pop()}return{name:t}}var Cr=(e,r,t,i)=>{t(e);const{name:a,...n}=e;return H(n)||Object.keys(n).length>=Object.keys(r).length||Object.keys(n).find(u=>r[u]===(!i||Z.all))},kr=(e,r,t)=>!e||!r||e===r||he(e).some(i=>i&&(t?i===r:i.startsWith(r)||r.startsWith(i))),Er=(e,r,t,i,a)=>a.isOnAll?!1:!t&&a.isOnTouch?!(r||e):(t?i.isOnBlur:a.isOnBlur)?!e:(t?i.isOnChange:a.isOnChange)?e:!0,Dr=(e,r)=>!je(y(e,r)).length&&U(e,r),pr=(e,r,t)=>{const i=he(y(e,t));return p(i,"root",r[t]),p(e,t,i),e};function ft(e,r,t="validate"){if(J(e)||Array.isArray(e)&&e.every(J)||Y(e)&&!e)return{type:t,message:J(e)?e:"",ref:r}}var ce=e=>P(e)&&!Ae(e)?e:{value:e,message:""},yt=async(e,r,t,i,a,n)=>{const{ref:u,refs:c,required:x,maxLength:S,minLength:D,min:v,max:V,pattern:h,validate:M,name:I,valueAsNumber:T,mount:R}=e._f,m=y(t,I);if(!R||r.has(I))return{};const $=c?c[0]:u,F=A=>{a&&$.reportValidity&&($.setCustomValidity(Y(A)?"":A||""),$.reportValidity())},w={},z=qe(u),se=_e(u),ie=z||se,re=(T||He(u))&&N(u.value)&&N(m)||Fe(u)&&u.value===""||m===""||Array.isArray(m)&&!m.length,Q=mr.bind(null,I,i,w),Ve=(A,C,j,B=ae.maxLength,X=ae.minLength)=>{const K=A?C:j;w[I]={type:A?B:X,message:K,ref:u,...Q(A?B:X,K)}};if(n?!Array.isArray(m)||!m.length:x&&(!ie&&(re||G(m))||Y(m)&&!m||se&&!Nt(c).isValid||z&&!Mt(c).isValid)){const{value:A,message:C}=J(x)?{value:!!x,message:x}:ce(x);if(A&&(w[I]={type:ae.required,message:C,ref:$,...Q(ae.required,C)},!i))return F(C),w}if(!re&&(!G(v)||!G(V))){let A,C;const j=ce(V),B=ce(v);if(!G(m)&&!isNaN(m)){const X=u.valueAsNumber||m&&+m;G(j.value)||(A=X>j.value),G(B.value)||(C=X<B.value)}else{const X=u.valueAsDate||new Date(m),K=ve=>new Date(new Date().toDateString()+" "+ve),ye=u.type=="time",ge=u.type=="week";J(j.value)&&m&&(A=ye?K(m)>K(j.value):ge?m>j.value:X>new Date(j.value)),J(B.value)&&m&&(C=ye?K(m)<K(B.value):ge?m<B.value:X<new Date(B.value))}if((A||C)&&(Ve(!!A,j.message,B.message,ae.max,ae.min),!i))return F(w[I].message),w}if((S||D)&&!re&&(J(m)||n&&Array.isArray(m))){const A=ce(S),C=ce(D),j=!G(A.value)&&m.length>+A.value,B=!G(C.value)&&m.length<+C.value;if((j||B)&&(Ve(j,A.message,C.message),!i))return F(w[I].message),w}if(h&&!re&&J(m)){const{value:A,message:C}=ce(h);if(Ae(A)&&!m.match(A)&&(w[I]={type:ae.pattern,message:C,ref:u,...Q(ae.pattern,C)},!i))return F(C),w}if(M){if(q(M)){const A=await M(m,t),C=ft(A,$);if(C&&(w[I]={...C,...Q(ae.validate,C.message)},!i))return F(C.message),w}else if(P(M)){let A={};for(const C in M){if(!H(A)&&!i)break;const j=ft(await M[C](m,t),$,C);j&&(A={...j,...Q(C,j.message)},F(j.message),i&&(w[I]=A))}if(!H(A)&&(w[I]={ref:$,...A},!i))return w}}return F(!0),w};const Tr={mode:Z.onSubmit,reValidateMode:Z.onChange,shouldFocusError:!0};function Rr(e={}){let r={...Tr,...e},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:q(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},i={},a=P(r.defaultValues)||P(r.values)?L(r.defaultValues||r.values)||{}:{},n=r.shouldUnregister?{}:L(a),u={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},x,S=0;const D={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={...D};let V={...v};const h={array:st(),state:st()},M=r.criteriaMode===Z.all,I=s=>o=>{clearTimeout(S),S=setTimeout(s,o)},T=async s=>{if(!u.keepIsValid&&!r.disabled&&(v.isValid||V.isValid||s)){let o;r.resolver?(o=H((await ie()).errors),R()):o=await Q(i,!0),o!==t.isValid&&h.state.next({isValid:o})}},R=(s,o)=>{!r.disabled&&(v.isValidating||v.validatingFields||V.isValidating||V.validatingFields)&&((s||Array.from(c.mount)).forEach(l=>{l&&(o?p(t.validatingFields,l,o):U(t.validatingFields,l))}),h.state.next({validatingFields:t.validatingFields,isValidating:!H(t.validatingFields)}))},m=(s,o=[],l,g,f=!0,d=!0)=>{if(g&&l&&!r.disabled){if(u.action=!0,d&&Array.isArray(y(i,s))){const b=l(y(i,s),g.argA,g.argB);f&&p(i,s,b)}if(d&&Array.isArray(y(t.errors,s))){const b=l(y(t.errors,s),g.argA,g.argB);f&&p(t.errors,s,b),Dr(t.errors,s)}if((v.touchedFields||V.touchedFields)&&d&&Array.isArray(y(t.touchedFields,s))){const b=l(y(t.touchedFields,s),g.argA,g.argB);f&&p(t.touchedFields,s,b)}(v.dirtyFields||V.dirtyFields)&&(t.dirtyFields=de(a,n)),h.state.next({name:s,isDirty:A(s,o),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else p(n,s,o)},$=(s,o)=>{p(t.errors,s,o),h.state.next({errors:t.errors})},F=s=>{t.errors=s,h.state.next({errors:t.errors,isValid:!1})},w=(s,o,l,g)=>{const f=y(i,s);if(f){const d=y(n,s,N(l)?y(a,s):l);N(d)||g&&g.defaultChecked||o?p(n,s,o?d:ot(f._f)):B(s,d),u.mount&&!u.action&&T()}},z=(s,o,l,g,f)=>{let d=!1,b=!1;const k={name:s};if(!r.disabled){if(!l||g){(v.isDirty||V.isDirty)&&(b=t.isDirty,t.isDirty=k.isDirty=A(),d=b!==k.isDirty);const E=ee(y(a,s),o);b=!!y(t.dirtyFields,s),E?U(t.dirtyFields,s):p(t.dirtyFields,s,!0),k.dirtyFields=t.dirtyFields,d=d||(v.dirtyFields||V.dirtyFields)&&b!==!E}if(l){const E=y(t.touchedFields,s);E||(p(t.touchedFields,s,l),k.touchedFields=t.touchedFields,d=d||(v.touchedFields||V.touchedFields)&&E!==l)}d&&f&&h.state.next(k)}return d?k:{}},se=(s,o,l,g)=>{const f=y(t.errors,s),d=(v.isValid||V.isValid)&&Y(o)&&t.isValid!==o;if(r.delayError&&l?(x=I(()=>$(s,l)),x(r.delayError)):(clearTimeout(S),x=null,l?p(t.errors,s,l):U(t.errors,s)),(l?!ee(f,l):f)||!H(g)||d){const b={...g,...d&&Y(o)?{isValid:o}:{},errors:t.errors,name:s};t={...t,...b},h.state.next(b)}},ie=async s=>(R(s,!0),await r.resolver(n,r.context,Ar(s||c.mount,i,r.criteriaMode,r.shouldUseNativeValidation))),re=async s=>{const{errors:o}=await ie(s);if(R(s),s)for(const l of s){const g=y(o,l);g?p(t.errors,l,g):U(t.errors,l)}else t.errors=o;return o},Q=async(s,o,l={valid:!0})=>{for(const g in s){const f=s[g];if(f){const{_f:d,...b}=f;if(d){const k=c.array.has(d.name),E=f._f&&wr(f._f);E&&v.validatingFields&&R([d.name],!0);const W=await yt(f,c.disabled,n,M,r.shouldUseNativeValidation&&!o,k);if(E&&v.validatingFields&&R([d.name]),W[d.name]&&(l.valid=!1,o||e.shouldUseNativeValidation))break;!o&&(y(W,d.name)?k?pr(t.errors,W,d.name):p(t.errors,d.name,W[d.name]):U(t.errors,d.name))}!H(b)&&await Q(b,o,l)}}return l.valid},Ve=()=>{for(const s of c.unMount){const o=y(i,s);o&&(o._f.refs?o._f.refs.every(l=>!Ie(l)):!Ie(o._f.ref))&&ke(s)}c.unMount=new Set},A=(s,o)=>!r.disabled&&(s&&o&&p(n,s,o),!ee(ze(),a)),C=(s,o,l)=>Me(s,c,{...u.mount?n:N(o)?a:J(s)?{[s]:o}:o},l,o),j=s=>je(y(u.mount?n:a,s,r.shouldUnregister?y(a,s,[]):[])),B=(s,o,l={})=>{const g=y(i,s);let f=o;if(g){const d=g._f;d&&(!d.disabled&&p(n,s,It(o,d)),f=Fe(d.ref)&&G(o)?"":o,Tt(d.ref)?[...d.ref.options].forEach(b=>b.selected=f.includes(b.value)):d.refs?_e(d.ref)?d.refs.forEach(b=>{(!b.defaultChecked||!b.disabled)&&(Array.isArray(f)?b.checked=!!f.find(k=>k===b.value):b.checked=f===b.value||!!f)}):d.refs.forEach(b=>b.checked=b.value===f):He(d.ref)?d.ref.value="":(d.ref.value=f,d.ref.type||h.state.next({name:s,values:L(n)})))}(l.shouldDirty||l.shouldTouch)&&z(s,f,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&ve(s)},X=(s,o,l)=>{for(const g in o){if(!o.hasOwnProperty(g))return;const f=o[g],d=s+"."+g,b=y(i,d);(c.array.has(s)||P(f)||b&&!b._f)&&!le(f)?X(d,f,l):B(d,f,l)}},K=(s,o,l={})=>{const g=y(i,s),f=c.array.has(s),d=L(o);p(n,s,d),f?(h.array.next({name:s,values:L(n)}),(v.isDirty||v.dirtyFields||V.isDirty||V.dirtyFields)&&l.shouldDirty&&h.state.next({name:s,dirtyFields:de(a,n),isDirty:A(s,d)})):g&&!g._f&&!G(d)?X(s,d,l):B(s,d,l),ct(s,c)?h.state.next({...t,name:s,values:L(n)}):h.state.next({name:u.mount?s:void 0,values:L(n)})},ye=async s=>{u.mount=!0;const o=s.target;let l=o.name,g=!0;const f=y(i,l),d=E=>{g=Number.isNaN(E)||le(E)&&isNaN(E.getTime())||ee(E,y(n,l,E))},b=lt(r.mode),k=lt(r.reValidateMode);if(f){let E,W;const oe=o.type?ot(f._f):Ct(s),ne=s.type===xe.BLUR||s.type===xe.FOCUS_OUT,Wt=!Sr(f._f)&&!r.resolver&&!y(t.errors,l)&&!f._f.deps||Er(ne,y(t.touchedFields,l),t.isSubmitted,k,b),pe=ct(l,c,ne);p(n,l,oe),ne?(!o||!o.readOnly)&&(f._f.onBlur&&f._f.onBlur(s),x&&x(0)):f._f.onChange&&f._f.onChange(s);const Te=z(l,oe,ne),Ht=!H(Te)||pe;if(!ne&&h.state.next({name:l,type:s.type,values:L(n)}),Wt)return(v.isValid||V.isValid)&&(r.mode==="onBlur"?ne&&T():ne||T()),Ht&&h.state.next({name:l,...pe?{}:Te});if(!ne&&pe&&h.state.next({...t}),r.resolver){const{errors:tt}=await ie([l]);if(R([l]),d(oe),g){const qt=dt(t.errors,i,l),rt=dt(tt,i,qt.name||l);E=rt.error,l=rt.name,W=H(tt)}}else R([l],!0),E=(await yt(f,c.disabled,n,M,r.shouldUseNativeValidation))[l],R([l]),d(oe),g&&(E?W=!1:(v.isValid||V.isValid)&&(W=await Q(i,!0)));g&&(f._f.deps&&(!Array.isArray(f._f.deps)||f._f.deps.length>0)&&ve(f._f.deps),se(l,W,E,Te))}},ge=(s,o)=>{if(y(t.errors,o)&&s.focus)return s.focus(),1},ve=async(s,o={})=>{let l,g;const f=he(s);if(r.resolver){const d=await re(N(s)?s:f);l=H(d),g=s?!f.some(b=>y(d,b)):l}else s?(g=(await Promise.all(f.map(async d=>{const b=y(i,d);return await Q(b&&b._f?{[d]:b}:b)}))).every(Boolean),!(!g&&!t.isValid)&&T()):g=l=await Q(i);return h.state.next({...!J(s)||(v.isValid||V.isValid)&&l!==t.isValid?{}:{name:s},...r.resolver||!s?{isValid:l}:{},errors:t.errors}),o.shouldFocus&&!g&&me(i,ge,s?f:c.mount),g},ze=(s,o)=>{let l={...u.mount?n:a};return o&&(l=pt(o.dirtyFields?t.dirtyFields:t.touchedFields,l)),N(s)?l:J(s)?y(l,s):s.map(g=>y(l,g))},Ge=(s,o)=>({invalid:!!y((o||t).errors,s),isDirty:!!y((o||t).dirtyFields,s),error:y((o||t).errors,s),isValidating:!!y(t.validatingFields,s),isTouched:!!y((o||t).touchedFields,s)}),Ot=s=>{const o=s?he(s):void 0;o?.forEach(l=>U(t.errors,l)),o?o.forEach(l=>{h.state.next({name:l,errors:t.errors})}):h.state.next({errors:{}})},Ke=(s,o,l)=>{const g=(y(i,s,{_f:{}})._f||{}).ref,f=y(t.errors,s)||{},{ref:d,message:b,type:k,...E}=f;p(t.errors,s,{...E,...o,ref:g}),h.state.next({name:s,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&g&&g.focus&&g.focus()},Lt=(s,o)=>q(s)?h.state.subscribe({next:l=>"values"in l&&s(C(void 0,o),l)}):C(s,o,!0),Ye=s=>h.state.subscribe({next:o=>{kr(s.name,o.name,s.exact)&&Cr(o,s.formState||v,$t,s.reRenderRoot)&&s.callback({values:{...n},...t,...o,defaultValues:a})}}).unsubscribe,Ut=s=>(u.mount=!0,V={...V,...s.formState},Ye({...s,formState:{...D,...s.formState}})),ke=(s,o={})=>{for(const l of s?he(s):c.mount)c.mount.delete(l),c.array.delete(l),o.keepValue||(U(i,l),U(n,l)),!o.keepError&&U(t.errors,l),!o.keepDirty&&U(t.dirtyFields,l),!o.keepTouched&&U(t.touchedFields,l),!o.keepIsValidating&&U(t.validatingFields,l),!r.shouldUnregister&&!o.keepDefaultValue&&U(a,l);h.state.next({values:L(n)}),h.state.next({...t,...o.keepDirty?{isDirty:A()}:{}}),!o.keepIsValid&&T()},Je=({disabled:s,name:o})=>{if(Y(s)&&u.mount||s||c.disabled.has(o)){const f=c.disabled.has(o)!==!!s;s?c.disabled.add(o):c.disabled.delete(o),f&&u.mount&&!u.action&&T()}},Ee=(s,o={})=>{let l=y(i,s);const g=Y(o.disabled)||Y(r.disabled);return p(i,s,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:s}},name:s,mount:!0,...o}}),c.mount.add(s),l?Je({disabled:Y(o.disabled)?o.disabled:r.disabled,name:s}):w(s,!0,o.value),{...g?{disabled:o.disabled||r.disabled}:{},...r.progressive?{required:!!o.required,min:be(o.min),max:be(o.max),minLength:be(o.minLength),maxLength:be(o.maxLength),pattern:be(o.pattern)}:{},name:s,onChange:ye,onBlur:ye,ref:f=>{if(f){Ee(s,o),l=y(i,s);const d=N(f.value)&&f.querySelectorAll&&f.querySelectorAll("input,select,textarea")[0]||f,b=_r(d),k=l._f.refs||[];if(b?k.find(E=>E===d):d===l._f.ref)return;p(i,s,{_f:{...l._f,...b?{refs:[...k.filter(Ie),d,...Array.isArray(y(a,s))?[{}]:[]],ref:{type:d.type,name:s}}:{ref:d}}}),w(s,!1,void 0,d)}else l=y(i,s,{}),l._f&&(l._f.mount=!1),(r.shouldUnregister||o.shouldUnregister)&&!(kt(c.array,s)&&u.action)&&c.unMount.add(s)}}},De=()=>r.shouldFocusError&&me(i,ge,c.mount),Pt=s=>{Y(s)&&(h.state.next({disabled:s}),me(i,(o,l)=>{const g=y(i,l);g&&(o.disabled=g._f.disabled||s,Array.isArray(g._f.refs)&&g._f.refs.forEach(f=>{f.disabled=g._f.disabled||s}))},0,!1))},Qe=(s,o)=>async l=>{let g;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let f=L(n);if(h.state.next({isSubmitting:!0}),r.resolver){const{errors:d,values:b}=await ie();R(),t.errors=d,f=L(b)}else await Q(i);if(c.disabled.size)for(const d of c.disabled)U(f,d);if(U(t.errors,"root"),H(t.errors)){h.state.next({errors:{}});try{await s(f,l)}catch(d){g=d}}else o&&await o({...t.errors},l),De(),setTimeout(De);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:H(t.errors)&&!g,submitCount:t.submitCount+1,errors:t.errors}),g)throw g},jt=(s,o={})=>{y(i,s)&&(N(o.defaultValue)?K(s,L(y(a,s))):(K(s,o.defaultValue),p(a,s,L(o.defaultValue))),o.keepTouched||U(t.touchedFields,s),o.keepDirty||(U(t.dirtyFields,s),t.isDirty=o.defaultValue?A(s,L(y(a,s))):A()),o.keepError||(U(t.errors,s),v.isValid&&T()),h.state.next({...t}))},Xe=(s,o={})=>{const l=s?L(s):a,g=L(l),f=H(s),d=f?a:g;if(o.keepDefaultValues||(a=l),!o.keepValues){if(o.keepDirtyValues){const b=new Set([...c.mount,...Object.keys(de(a,n))]);for(const k of Array.from(b)){const E=y(t.dirtyFields,k),W=y(n,k),oe=y(d,k);E&&!N(W)?p(d,k,W):!E&&!N(oe)&&K(k,oe)}}else{if(Pe&&N(s))for(const b of c.mount){const k=y(i,b);if(k&&k._f){const E=Array.isArray(k._f.refs)?k._f.refs[0]:k._f.ref;if(Fe(E)){const W=E.closest("form");if(W){W.reset();break}}}}if(o.keepFieldsRef)for(const b of c.mount)K(b,y(d,b));else i={}}n=r.shouldUnregister?o.keepDefaultValues?L(a):{}:L(d),h.array.next({values:{...d}}),h.state.next({values:{...d}})}c={mount:o.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},u.mount=!v.isValid||!!o.keepIsValid||!!o.keepDirtyValues||!r.shouldUnregister&&!H(d),u.watch=!!r.shouldUnregister,u.keepIsValid=!!o.keepIsValid,u.action=!1,o.keepErrors||(t.errors={}),h.state.next({submitCount:o.keepSubmitCount?t.submitCount:0,isDirty:f?!1:o.keepDirty?t.isDirty:!!(o.keepDefaultValues&&!ee(s,a)),isSubmitted:o.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:f?{}:o.keepDirtyValues?o.keepDefaultValues&&n?de(a,n):t.dirtyFields:o.keepDefaultValues&&s?de(a,s):o.keepDirty?t.dirtyFields:{},touchedFields:o.keepTouched?t.touchedFields:{},errors:o.keepErrors?t.errors:{},isSubmitSuccessful:o.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},Ze=(s,o)=>Xe(q(s)?s(n):s,{...r.resetOptions,...o}),Bt=(s,o={})=>{const l=y(i,s),g=l&&l._f;if(g){const f=g.refs?g.refs[0]:g.ref;f.focus&&setTimeout(()=>{f.focus(),o.shouldSelect&&q(f.select)&&f.select()})}},$t=s=>{t={...t,...s}},et={control:{register:Ee,unregister:ke,getFieldState:Ge,handleSubmit:Qe,setError:Ke,_subscribe:Ye,_runSchema:ie,_updateIsValidating:R,_focusError:De,_getWatch:C,_getDirty:A,_setValid:T,_setFieldArray:m,_setDisabledField:Je,_setErrors:F,_getFieldArray:j,_reset:Xe,_resetDefaultValues:()=>q(r.defaultValues)&&r.defaultValues().then(s=>{Ze(s,r.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:Ve,_disableForm:Pt,_subjects:h,_proxyFormState:v,get _fields(){return i},get _formValues(){return n},get _state(){return u},set _state(s){u=s},get _defaultValues(){return a},get _names(){return c},set _names(s){c=s},get _formState(){return t},get _options(){return r},set _options(s){r={...r,...s}}},subscribe:Ut,trigger:ve,register:Ee,handleSubmit:Qe,watch:Lt,setValue:K,getValues:ze,reset:Ze,resetField:jt,clearErrors:Ot,unregister:ke,setError:Ke,setFocus:Bt,getFieldState:Ge};return{...et,formControl:et}}function Hr(e={}){const r=_.useRef(void 0),t=_.useRef(void 0),[i,a]=_.useState({isDirty:!1,isValidating:!1,isLoading:q(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:q(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:i},e.defaultValues&&!q(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:u,...c}=Rr(e);r.current={...c,formState:i}}const n=r.current.control;return n._options=e,We(()=>{const u=n._subscribe({formState:n._proxyFormState,callback:()=>a({...n._formState}),reRenderRoot:!0});return a(c=>({...c,isReady:!0})),n._formState.isReady=!0,u},[n]),_.useEffect(()=>n._disableForm(e.disabled),[n,e.disabled]),_.useEffect(()=>{e.mode&&(n._options.mode=e.mode),e.reValidateMode&&(n._options.reValidateMode=e.reValidateMode)},[n,e.mode,e.reValidateMode]),_.useEffect(()=>{e.errors&&(n._setErrors(e.errors),n._focusError())},[n,e.errors]),_.useEffect(()=>{e.shouldUnregister&&n._subjects.state.next({values:n._getWatch()})},[n,e.shouldUnregister]),_.useEffect(()=>{if(n._proxyFormState.isDirty){const u=n._getDirty();u!==i.isDirty&&n._subjects.state.next({isDirty:u})}},[n,i.isDirty]),_.useEffect(()=>{var u;e.values&&!ee(e.values,t.current)?(n._reset(e.values,{keepFieldsRef:!0,...n._options.resetOptions}),!((u=n._options.resetOptions)===null||u===void 0)&&u.keepIsValid||n._setValid(),t.current=e.values,a(c=>({...c}))):n._resetDefaultValues()},[n,e.values]),_.useEffect(()=>{n._state.mount||(n._setValid(),n._state.mount=!0),n._state.watch&&(n._state.watch=!1,n._subjects.state.next({...n._formState})),n._removeUnmounted()}),r.current.formState=_.useMemo(()=>Dt(i,n),[n,i]),r.current}function qr(){const e=ue.c(18),r=Xt(),t=Zt(),[i,a]=te.useState(!0),n=te.useRef(null);let u;e[0]!==t.hasUnsyncedChanges?(u=()=>{n.current&&window.clearTimeout(n.current),n.current=window.setTimeout(()=>{a(!t.hasUnsyncedChanges)},100)},e[0]=t.hasUnsyncedChanges,e[1]=u):u=e[1];const c=te.useEffectEvent(u);let x;e[2]!==c||e[3]!==t?(x=()=>(t.on("unsyncedChanges",c),()=>{t.off("unsyncedChanges",c)}),e[2]=c,e[3]=t,e[4]=x):x=e[4];let S;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=[],e[5]=S):S=e[5],te.useEffect(x,S);const D=r===Ne.Connected&&"bg-green-400",v=r===Ne.Connecting&&"bg-orange-400",V=r===Ne.Disconnected&&"bg-red-400";let h;e[6]!==D||e[7]!==v||e[8]!==V?(h=fe("transition-colors size-2.5 rounded-full",D,v,V),e[6]=D,e[7]=v,e[8]=V,e[9]=h):h=e[9];let M;e[10]!==h?(M=O.jsx("div",{className:h}),e[10]=h,e[11]=M):M=e[11];const I=`${r} ⋅ ${i?"saved":"saving"}`;let T;e[12]!==M||e[13]!==I?(T=O.jsxs("div",{className:"flex min-w-44 items-center font-mono text-xs text-muted-foreground gap-1.5",children:[M,I]}),e[12]=M,e[13]=I,e[14]=T):T=e[14];let R;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=O.jsx(er,{variant:"ghost",size:"icon-sm",className:"my-auto text-muted-foreground -me-1.5","aria-label":"Settings",children:O.jsx(ar,{})}),e[15]=R):R=e[15];let m;return e[16]!==T?(m=O.jsxs("div",{className:"sticky mt-auto w-full bottom-0 bg-background border-t flex gap-2 px-4 justify-end h-10 z-20",children:[T,R]}),e[16]=T,e[17]=m):m=e[17],m}function zr(e){const r=ue.c(3),{children:t}=e;let i;r[0]===Symbol.for("react.memo_cache_sentinel")?(i=O.jsx(Nr,{}),r[0]=i):i=r[0];let a;return r[1]!==t?(a=O.jsx(te.Suspense,{fallback:i,children:t}),r[1]=t,r[2]=a):a=r[2],a}function Nr(e){const r=ue.c(6);let t;r[0]!==e.className?(t=fe("flex justify-center items-center gap-2 text-muted-foreground bg-muted border-y p-3 flex-1",e.className),r[0]=e.className,r[1]=t):t=r[1];let i;r[2]===Symbol.for("react.memo_cache_sentinel")?(i=O.jsx(sr,{}),r[2]=i):i=r[2];let a;return r[3]!==e||r[4]!==t?(a=O.jsxs("div",{...e,className:t,children:[i,"Loading Editor"]}),r[3]=e,r[4]=t,r[5]=a):a=r[5],a}export{Wr as C,zr as E,qr as S,jr as T,Br as a,$r as b,Pr as c,Nr as d,Hr as u};