@isardsat/editorial-admin 6.0.6 → 6.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/build/client/assets/{authSlice-B3Tyl-Nw.js → authSlice-C1VgtCUs.js} +211 -182
  2. package/build/client/assets/button-D7P-1kQx.js +1 -0
  3. package/build/client/assets/{chevron-down-D_Gla76b.js → chevron-down-DTegokyb.js} +1 -1
  4. package/build/client/assets/chunk-QMGIS6GS-BoPxQm7X.js +51 -0
  5. package/build/client/assets/{createLucideIcon-R2-3a7hN.js → createLucideIcon-CEJSFbyG.js} +1 -1
  6. package/build/client/assets/dashboard-z6MevYdb.js +1 -0
  7. package/build/client/assets/dashboard._collection-BInenL6o.js +16 -0
  8. package/build/client/assets/dashboard._collection._document-CThHIpx7.js +1 -0
  9. package/build/client/assets/dashboard._collection.new-I4A2SBlr.js +1 -0
  10. package/build/client/assets/dashboard._layout-BcFSiUec.js +61 -0
  11. package/build/client/assets/dashboard.files-DKvKXV6U.js +36 -0
  12. package/build/client/assets/editorialApi-Dg2JizYW.js +1 -0
  13. package/build/client/assets/entry.client-B2XAvOmi.js +34 -0
  14. package/build/client/assets/home-C_M0Cqq5.js +11 -0
  15. package/build/client/assets/index-C4BMMXbp.js +1 -0
  16. package/build/client/assets/{index-C-vcF2DZ.js → index-CvFp8wi_.js} +2 -2
  17. package/build/client/assets/index-DWY8ISpx.js +50 -0
  18. package/build/client/assets/index-ofqdEjlP.js +22 -0
  19. package/build/client/assets/input-BScD3Ruq.js +6 -0
  20. package/build/client/assets/itemForm-BCRilPzX.js +95 -0
  21. package/build/client/assets/itemForm-BVtnhZqg.css +1 -0
  22. package/build/client/assets/manifest-94cf7c47.js +1 -0
  23. package/build/client/assets/react-redux-CRJHAKt_.js +9 -0
  24. package/build/client/assets/root-CJsg41xt.js +1 -0
  25. package/build/client/assets/root-DGV68qoS.css +1 -0
  26. package/build/client/assets/{trash-wq_ppIxP.js → trash-DN4yNrfZ.js} +1 -1
  27. package/build/client/assets/{tslib.es6-CDuPK5Eb.js → tslib.es6-De9GV7Vy.js} +1 -1
  28. package/build/client/assets/utils-BSDwSRl3.js +1 -0
  29. package/build/client/index.html +5 -5
  30. package/package.json +3 -4
  31. package/build/client/assets/button-Da66T3Bb.js +0 -1
  32. package/build/client/assets/chunk-KNED5TY2-DAA_sFzt.js +0 -51
  33. package/build/client/assets/dashboard-BTu7-8Ba.js +0 -1
  34. package/build/client/assets/dashboard._collection-MtSHvYYW.js +0 -16
  35. package/build/client/assets/dashboard._collection._document-CRkC98aa.js +0 -1
  36. package/build/client/assets/dashboard._collection.new-BFe8yV0Z.js +0 -1
  37. package/build/client/assets/dashboard._layout-BjRnQPQr.js +0 -66
  38. package/build/client/assets/dashboard.files-DKh39mcB.js +0 -36
  39. package/build/client/assets/editorialApi-fQchmMa9.js +0 -1
  40. package/build/client/assets/entry.client-BGu2H8xv.js +0 -34
  41. package/build/client/assets/home-C2nWtN4c.js +0 -11
  42. package/build/client/assets/index-Bd1u2_LZ.js +0 -45
  43. package/build/client/assets/index-BvKqmqc2.js +0 -1
  44. package/build/client/assets/index-DeO5nu0f.js +0 -22
  45. package/build/client/assets/input-BmmdOdbj.js +0 -6
  46. package/build/client/assets/itemForm-CDbHkFXh.css +0 -1
  47. package/build/client/assets/itemForm-DlRBjBsd.js +0 -90
  48. package/build/client/assets/manifest-2ff77582.js +0 -1
  49. package/build/client/assets/react-redux-kbMjYGuQ.js +0 -9
  50. package/build/client/assets/root-DS7N36v7.css +0 -1
  51. package/build/client/assets/root-wKvfXBjk.js +0 -1
  52. package/build/client/assets/utils-DslUJpbf.js +0 -1
@@ -0,0 +1 @@
1
+ import{a,o as p}from"./chunk-QMGIS6GS-BoPxQm7X.js";import{a as V,c as E}from"./utils-BSDwSRl3.js";function b(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function x(...e){return n=>{let t=!1;const i=e.map(r=>{const o=b(r,n);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let r=0;r<i.length;r++){const o=i[r];typeof o=="function"?o():b(e[r],null)}}}}function z(...e){return a.useCallback(x(...e),e)}function j(e){const n=_(e),t=a.forwardRef((i,r)=>{const{children:o,...u}=i,l=a.Children.toArray(o),f=l.find(R);if(f){const s=f.props.children,c=l.map(d=>d===f?a.Children.count(s)>1?a.Children.only(null):a.isValidElement(s)?s.props.children:null:d);return p.jsx(n,{...u,ref:r,children:a.isValidElement(s)?a.cloneElement(s,void 0,c):null})}return p.jsx(n,{...u,ref:r,children:o})});return t.displayName=`${e}.Slot`,t}var N=j("Slot");function _(e){const n=a.forwardRef((t,i)=>{const{children:r,...o}=t;if(a.isValidElement(r)){const u=O(r),l=w(o,r.props);return r.type!==a.Fragment&&(l.ref=i?x(i,u):u),a.cloneElement(r,l)}return a.Children.count(r)>1?a.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var C=Symbol("radix.slottable");function B(e){const n=({children:t})=>p.jsx(p.Fragment,{children:t});return n.displayName=`${e}.Slottable`,n.__radixId=C,n}function R(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===C}function w(e,n){const t={...n};for(const i in n){const r=e[i],o=n[i];/^on[A-Z]/.test(i)?r&&o?t[i]=(...l)=>{const f=o(...l);return r(...l),f}:r&&(t[i]=r):i==="style"?t[i]={...r,...o}:i==="className"&&(t[i]=[r,o].filter(Boolean).join(" "))}return{...e,...t}}function O(e){var i,r;let n=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}const y=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,h=V,P=(e,n)=>t=>{var i;if((n==null?void 0:n.variants)==null)return h(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:r,defaultVariants:o}=n,u=Object.keys(r).map(s=>{const c=t==null?void 0:t[s],d=o==null?void 0:o[s];if(c===null)return null;const v=y(c)||y(d);return r[s][v]}),l=t&&Object.entries(t).reduce((s,c)=>{let[d,v]=c;return v===void 0||(s[d]=v),s},{}),f=n==null||(i=n.compoundVariants)===null||i===void 0?void 0:i.reduce((s,c)=>{let{class:d,className:v,...S}=c;return Object.entries(S).every(k=>{let[m,g]=k;return Array.isArray(g)?g.includes({...o,...l}[m]):{...o,...l}[m]===g})?[...s,d,v]:s},[]);return h(e,u,f,t==null?void 0:t.class,t==null?void 0:t.className)},A=P("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function T({className:e,variant:n,size:t,asChild:i=!1,...r}){const o=i?N:"button";return p.jsx(o,{"data-slot":"button",className:E(A({variant:n,size:t,className:e})),...r})}export{T as B,N as S,j as a,B as b,P as c,z as u};
@@ -1,4 +1,4 @@
1
- import{c as o}from"./createLucideIcon-R2-3a7hN.js";/**
1
+ import{c as o}from"./createLucideIcon-CEJSFbyG.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,51 @@
1
+ function wa(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const o=Object.getOwnPropertyDescriptor(a,n);o&&Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var pl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ea(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bt={exports:{}},tt={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Fr;function Ra(){if(Fr)return tt;Fr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,n,o){var l=null;if(o!==void 0&&(l=""+o),n.key!==void 0&&(l=""+n.key),"key"in n){o={};for(var s in n)s!=="key"&&(o[s]=n[s])}else o=n;return n=o.ref,{$$typeof:e,type:a,key:l,ref:n!==void 0?n:null,props:o}}return tt.Fragment=t,tt.jsx=r,tt.jsxs=r,tt}var jr;function ba(){return jr||(jr=1,Bt.exports=Ra()),Bt.exports}var yl=ba(),Wt={exports:{}},W={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Hr;function Sa(){if(Hr)return W;Hr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),p=Symbol.iterator;function f(m){return m===null||typeof m!="object"?null:(m=p&&m[p]||m["@@iterator"],typeof m=="function"?m:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,b={};function S(m,L,A){this.props=m,this.context=L,this.refs=b,this.updater=A||g}S.prototype.isReactComponent={},S.prototype.setState=function(m,L){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,L,"setState")},S.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function R(){}R.prototype=S.prototype;function O(m,L,A){this.props=m,this.context=L,this.refs=b,this.updater=A||g}var T=O.prototype=new R;T.constructor=O,w(T,S.prototype),T.isPureReactComponent=!0;var M=Array.isArray,x={H:null,A:null,T:null,S:null,V:null},y=Object.prototype.hasOwnProperty;function D(m,L,A,k,Y,ee){return A=ee.ref,{$$typeof:e,type:m,key:L,ref:A!==void 0?A:null,props:ee}}function U(m,L){return D(m.type,L,void 0,void 0,void 0,m.props)}function j(m){return typeof m=="object"&&m!==null&&m.$$typeof===e}function K(m){var L={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(A){return L[A]})}var re=/\/+/g;function se(m,L){return typeof m=="object"&&m!==null&&m.key!=null?K(""+m.key):L.toString(36)}function oe(){}function X(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(oe,oe):(m.status="pending",m.then(function(L){m.status==="pending"&&(m.status="fulfilled",m.value=L)},function(L){m.status==="pending"&&(m.status="rejected",m.reason=L)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function Q(m,L,A,k,Y){var ee=typeof m;(ee==="undefined"||ee==="boolean")&&(m=null);var z=!1;if(m===null)z=!0;else switch(ee){case"bigint":case"string":case"number":z=!0;break;case"object":switch(m.$$typeof){case e:case t:z=!0;break;case c:return z=m._init,Q(z(m._payload),L,A,k,Y)}}if(z)return Y=Y(m),z=k===""?"."+se(m,0):k,M(Y)?(A="",z!=null&&(A=z.replace(re,"$&/")+"/"),Q(Y,L,A,"",function($t){return $t})):Y!=null&&(j(Y)&&(Y=U(Y,A+(Y.key==null||m&&m.key===Y.key?"":(""+Y.key).replace(re,"$&/")+"/")+z)),L.push(Y)),1;z=0;var xe=k===""?".":k+":";if(M(m))for(var ne=0;ne<m.length;ne++)k=m[ne],ee=xe+se(k,ne),z+=Q(k,L,A,ee,Y);else if(ne=f(m),typeof ne=="function")for(m=ne.call(m),ne=0;!(k=m.next()).done;)k=k.value,ee=xe+se(k,ne++),z+=Q(k,L,A,ee,Y);else if(ee==="object"){if(typeof m.then=="function")return Q(X(m),L,A,k,Y);throw L=String(m),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return z}function G(m,L,A){if(m==null)return m;var k=[],Y=0;return Q(m,k,"","",function(ee){return L.call(A,ee,Y++)}),k}function ue(m){if(m._status===-1){var L=m._result;L=L(),L.then(function(A){(m._status===0||m._status===-1)&&(m._status=1,m._result=A)},function(A){(m._status===0||m._status===-1)&&(m._status=2,m._result=A)}),m._status===-1&&(m._status=0,m._result=L)}if(m._status===1)return m._result.default;throw m._result}var de=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)};function ce(){}return W.Children={map:G,forEach:function(m,L,A){G(m,function(){L.apply(this,arguments)},A)},count:function(m){var L=0;return G(m,function(){L++}),L},toArray:function(m){return G(m,function(L){return L})||[]},only:function(m){if(!j(m))throw Error("React.Children.only expected to receive a single React element child.");return m}},W.Component=S,W.Fragment=r,W.Profiler=n,W.PureComponent=O,W.StrictMode=a,W.Suspense=i,W.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,W.__COMPILER_RUNTIME={__proto__:null,c:function(m){return x.H.useMemoCache(m)}},W.cache=function(m){return function(){return m.apply(null,arguments)}},W.cloneElement=function(m,L,A){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var k=w({},m.props),Y=m.key,ee=void 0;if(L!=null)for(z in L.ref!==void 0&&(ee=void 0),L.key!==void 0&&(Y=""+L.key),L)!y.call(L,z)||z==="key"||z==="__self"||z==="__source"||z==="ref"&&L.ref===void 0||(k[z]=L[z]);var z=arguments.length-2;if(z===1)k.children=A;else if(1<z){for(var xe=Array(z),ne=0;ne<z;ne++)xe[ne]=arguments[ne+2];k.children=xe}return D(m.type,Y,void 0,void 0,ee,k)},W.createContext=function(m){return m={$$typeof:l,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:o,_context:m},m},W.createElement=function(m,L,A){var k,Y={},ee=null;if(L!=null)for(k in L.key!==void 0&&(ee=""+L.key),L)y.call(L,k)&&k!=="key"&&k!=="__self"&&k!=="__source"&&(Y[k]=L[k]);var z=arguments.length-2;if(z===1)Y.children=A;else if(1<z){for(var xe=Array(z),ne=0;ne<z;ne++)xe[ne]=arguments[ne+2];Y.children=xe}if(m&&m.defaultProps)for(k in z=m.defaultProps,z)Y[k]===void 0&&(Y[k]=z[k]);return D(m,ee,void 0,void 0,null,Y)},W.createRef=function(){return{current:null}},W.forwardRef=function(m){return{$$typeof:s,render:m}},W.isValidElement=j,W.lazy=function(m){return{$$typeof:c,_payload:{_status:-1,_result:m},_init:ue}},W.memo=function(m,L){return{$$typeof:u,type:m,compare:L===void 0?null:L}},W.startTransition=function(m){var L=x.T,A={};x.T=A;try{var k=m(),Y=x.S;Y!==null&&Y(A,k),typeof k=="object"&&k!==null&&typeof k.then=="function"&&k.then(ce,de)}catch(ee){de(ee)}finally{x.T=L}},W.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},W.use=function(m){return x.H.use(m)},W.useActionState=function(m,L,A){return x.H.useActionState(m,L,A)},W.useCallback=function(m,L){return x.H.useCallback(m,L)},W.useContext=function(m){return x.H.useContext(m)},W.useDebugValue=function(){},W.useDeferredValue=function(m,L){return x.H.useDeferredValue(m,L)},W.useEffect=function(m,L,A){var k=x.H;if(typeof A=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return k.useEffect(m,L)},W.useId=function(){return x.H.useId()},W.useImperativeHandle=function(m,L,A){return x.H.useImperativeHandle(m,L,A)},W.useInsertionEffect=function(m,L){return x.H.useInsertionEffect(m,L)},W.useLayoutEffect=function(m,L){return x.H.useLayoutEffect(m,L)},W.useMemo=function(m,L){return x.H.useMemo(m,L)},W.useOptimistic=function(m,L){return x.H.useOptimistic(m,L)},W.useReducer=function(m,L,A){return x.H.useReducer(m,L,A)},W.useRef=function(m){return x.H.useRef(m)},W.useState=function(m){return x.H.useState(m)},W.useSyncExternalStore=function(m,L,A){return x.H.useSyncExternalStore(m,L,A)},W.useTransition=function(){return x.H.useTransition()},W.version="19.1.0",W}var Ur;function xa(){return Ur||(Ur=1,Wt.exports=Sa()),Wt.exports}var h=xa();const La=Ea(h),vl=wa({__proto__:null,default:La},[h]);var rt={},zr;function Ca(){if(zr)return rt;zr=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.parse=l,rt.serialize=u;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,n=Object.prototype.toString,o=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function l(f,g){const w=new o,b=f.length;if(b<2)return w;const S=(g==null?void 0:g.decode)||c;let R=0;do{const O=f.indexOf("=",R);if(O===-1)break;const T=f.indexOf(";",R),M=T===-1?b:T;if(O>M){R=f.lastIndexOf(";",O-1)+1;continue}const x=s(f,R,O),y=i(f,O,x),D=f.slice(x,y);if(w[D]===void 0){let U=s(f,O+1,M),j=i(f,M,U);const K=S(f.slice(U,j));w[D]=K}R=M+1}while(R<b);return w}function s(f,g,w){do{const b=f.charCodeAt(g);if(b!==32&&b!==9)return g}while(++g<w);return w}function i(f,g,w){for(;g>w;){const b=f.charCodeAt(--g);if(b!==32&&b!==9)return g+1}return w}function u(f,g,w){const b=(w==null?void 0:w.encode)||encodeURIComponent;if(!e.test(f))throw new TypeError(`argument name is invalid: ${f}`);const S=b(g);if(!t.test(S))throw new TypeError(`argument val is invalid: ${g}`);let R=f+"="+S;if(!w)return R;if(w.maxAge!==void 0){if(!Number.isInteger(w.maxAge))throw new TypeError(`option maxAge is invalid: ${w.maxAge}`);R+="; Max-Age="+w.maxAge}if(w.domain){if(!r.test(w.domain))throw new TypeError(`option domain is invalid: ${w.domain}`);R+="; Domain="+w.domain}if(w.path){if(!a.test(w.path))throw new TypeError(`option path is invalid: ${w.path}`);R+="; Path="+w.path}if(w.expires){if(!p(w.expires)||!Number.isFinite(w.expires.valueOf()))throw new TypeError(`option expires is invalid: ${w.expires}`);R+="; Expires="+w.expires.toUTCString()}if(w.httpOnly&&(R+="; HttpOnly"),w.secure&&(R+="; Secure"),w.partitioned&&(R+="; Partitioned"),w.priority)switch(typeof w.priority=="string"?w.priority.toLowerCase():void 0){case"low":R+="; Priority=Low";break;case"medium":R+="; Priority=Medium";break;case"high":R+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${w.priority}`)}if(w.sameSite)switch(typeof w.sameSite=="string"?w.sameSite.toLowerCase():w.sameSite){case!0:case"strict":R+="; SameSite=Strict";break;case"lax":R+="; SameSite=Lax";break;case"none":R+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${w.sameSite}`)}return R}function c(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function p(f){return n.call(f)==="[object Date]"}return rt}Ca();/**
18
+ * react-router v7.6.3
19
+ *
20
+ * Copyright (c) Remix Software Inc.
21
+ *
22
+ * This source code is licensed under the MIT license found in the
23
+ * LICENSE.md file in the root directory of this source tree.
24
+ *
25
+ * @license MIT
26
+ */var pn=e=>{throw TypeError(e)},Pa=(e,t,r)=>t.has(e)||pn("Cannot "+r),Yt=(e,t,r)=>(Pa(e,t,"read from private field"),r?r.call(e):t.get(e)),Ta=(e,t,r)=>t.has(e)?pn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Br="popstate";function gl(e={}){function t(a,n){let{pathname:o,search:l,hash:s}=a.location;return st("",{pathname:o,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(a,n){return typeof n=="string"?n:ke(n)}return _a(t,r,null,e)}function J(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ae(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ma(){return Math.random().toString(36).substring(2,10)}function Wr(e,t){return{usr:e.state,key:e.key,idx:t}}function st(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ne(t):t,state:r,key:t&&t.key||a||Ma()}}function ke({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 Ne(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 _a(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,l=n.history,s="POP",i=null,u=c();u==null&&(u=0,l.replaceState({...l.state,idx:u},""));function c(){return(l.state||{idx:null}).idx}function p(){s="POP";let S=c(),R=S==null?null:S-u;u=S,i&&i({action:s,location:b.location,delta:R})}function f(S,R){s="PUSH";let O=st(b.location,S,R);u=c()+1;let T=Wr(O,u),M=b.createHref(O);try{l.pushState(T,"",M)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;n.location.assign(M)}o&&i&&i({action:s,location:b.location,delta:1})}function g(S,R){s="REPLACE";let O=st(b.location,S,R);u=c();let T=Wr(O,u),M=b.createHref(O);l.replaceState(T,"",M),o&&i&&i({action:s,location:b.location,delta:0})}function w(S){return yn(S)}let b={get action(){return s},get location(){return e(n,l)},listen(S){if(i)throw new Error("A history only accepts one active listener");return n.addEventListener(Br,p),i=S,()=>{n.removeEventListener(Br,p),i=null}},createHref(S){return t(n,S)},createURL:w,encodeLocation(S){let R=w(S);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:f,replace:g,go(S){return l.go(S)}};return b}function yn(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),J(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:ke(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}var it,Yr=class{constructor(e){if(Ta(this,it,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Yt(this,it).has(e))return Yt(this,it).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Yt(this,it).set(e,t)}};it=new WeakMap;var Da=new Set(["lazy","caseSensitive","path","id","index","children"]);function Oa(e){return Da.has(e)}var ka=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function Aa(e){return ka.has(e)}function Na(e){return e.index===!0}function Mt(e,t,r=[],a={}){return e.map((n,o)=>{let l=[...r,String(o)],s=typeof n.id=="string"?n.id:l.join("-");if(J(n.index!==!0||!n.children,"Cannot specify children on an index route"),J(!a[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Na(n)){let i={...n,...t(n),id:s};return a[s]=i,i}else{let i={...n,...t(n),id:s,children:void 0};return a[s]=i,n.children&&(i.children=Mt(n.children,t,l,a)),i}})}function Le(e,t,r="/"){return xt(e,t,r,!1)}function xt(e,t,r,a){let n=typeof t=="string"?Ne(t):t,o=ge(n.pathname||"/",r);if(o==null)return null;let l=gn(e);Ia(l);let s=null;for(let i=0;s==null&&i<l.length;++i){let u=Va(o);s=Ya(l[i],u,a)}return s}function vn(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],handle:r.handle}}function gn(e,t=[],r=[],a=""){let n=(o,l,s)=>{let i={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};i.relativePath.startsWith("/")&&(J(i.relativePath.startsWith(a),`Absolute route path "${i.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),i.relativePath=i.relativePath.slice(a.length));let u=Ce([a,i.relativePath]),c=r.concat(i);o.children&&o.children.length>0&&(J(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),gn(o.children,t,c,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:Ba(u,o.index),routesMeta:c})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))n(o,l);else for(let i of wn(o.path))n(o,l,i)}),t}function wn(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 l=wn(a.join("/")),s=[];return s.push(...l.map(i=>i===""?o:[o,i].join("/"))),n&&s.push(...l),s.map(i=>e.startsWith("/")&&i===""?"/":i)}function Ia(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Wa(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var $a=/^:[\w-]+$/,Fa=3,ja=2,Ha=1,Ua=10,za=-2,Vr=e=>e==="*";function Ba(e,t){let r=e.split("/"),a=r.length;return r.some(Vr)&&(a+=za),t&&(a+=ja),r.filter(n=>!Vr(n)).reduce((n,o)=>n+($a.test(o)?Fa:o===""?Ha:Ua),a)}function Wa(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 Ya(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",l=[];for(let s=0;s<a.length;++s){let i=a[s],u=s===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",p=_t({path:i.relativePath,caseSensitive:i.caseSensitive,end:u},c),f=i.route;if(!p&&u&&r&&!a[a.length-1].route.index&&(p=_t({path:i.relativePath,caseSensitive:i.caseSensitive,end:!1},c)),!p)return null;Object.assign(n,p.params),l.push({params:n,pathname:Ce([o,p.pathname]),pathnameBase:Xa(Ce([o,p.pathnameBase])),route:f}),p.pathnameBase!=="/"&&(o=Ce([o,p.pathnameBase]))}return l}function _t(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=En(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],l=o.replace(/(.)\/+$/,"$1"),s=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:p},f)=>{if(c==="*"){let w=s[f]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const g=s[f];return p&&!g?u[c]=void 0:u[c]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function En(e,t=!1,r=!0){ae(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,(l,s,i)=>(a.push({paramName:s,isOptional:i!=null}),i?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Va(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ae(!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 ge(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 Ja(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Ne(e):e;return{pathname:r?r.startsWith("/")?r:Ga(r,t):t,search:qa(a),hash:Ka(n)}}function Ga(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 Vt(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 Rn(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function ur(e){let t=Rn(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function cr(e,t,r,a=!1){let n;typeof e=="string"?n=Ne(e):(n={...e},J(!n.pathname||!n.pathname.includes("?"),Vt("?","pathname","search",n)),J(!n.pathname||!n.pathname.includes("#"),Vt("#","pathname","hash",n)),J(!n.search||!n.search.includes("#"),Vt("#","search","hash",n)));let o=e===""||n.pathname==="",l=o?"/":n.pathname,s;if(l==null)s=r;else{let p=t.length-1;if(!a&&l.startsWith("..")){let f=l.split("/");for(;f[0]==="..";)f.shift(),p-=1;n.pathname=f.join("/")}s=p>=0?t[p]:"/"}let i=Ja(n,s),u=l&&l!=="/"&&l.endsWith("/"),c=(o||l===".")&&r.endsWith("/");return!i.pathname.endsWith("/")&&(u||c)&&(i.pathname+="/"),i}var Ce=e=>e.join("/").replace(/\/\/+/g,"/"),Xa=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qa=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ka=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Qa=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function Za(e,t){return new Qa(e,typeof t=="number"?{status:t}:t)}var eo=(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})},Ae=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 ze(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var bn=["POST","PUT","PATCH","DELETE"],to=new Set(bn),ro=["GET",...bn],no=new Set(ro),ao=new Set([301,302,303,307,308]),oo=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},io={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},dr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lo=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Sn="remix-router-transitions",xn=Symbol("ResetLoaderData");function wl(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";J(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||lo,o={},l=Mt(e.routes,n,void 0,o),s,i=e.basename||"/",u=e.dataStrategy||ho,c={unstable_middleware:!1,...e.future},p=null,f=new Set,g=null,w=null,b=null,S=e.hydrationData!=null,R=Le(l,e.history.location,i),O=!1,T=null,M;if(R==null&&!e.patchRoutesOnNavigation){let d=Re(404,{pathname:e.history.location.pathname}),{matches:v,route:E}=an(l);M=!0,R=v,T={[E.id]:d}}else if(R&&!e.hydrationData&&pt(R,l,e.history.location.pathname).active&&(R=null),R)if(R.some(d=>d.route.lazy))M=!1;else if(!R.some(d=>d.route.loader))M=!0;else{let d=e.hydrationData?e.hydrationData.loaderData:null,v=e.hydrationData?e.hydrationData.errors:null;if(v){let E=R.findIndex(C=>v[C.route.id]!==void 0);M=R.slice(0,E+1).every(C=>!er(C.route,d,v))}else M=R.every(E=>!er(E.route,d,v))}else{M=!1,R=[];let d=pt(null,l,e.history.location.pathname);d.active&&d.matches&&(O=!0,R=d.matches)}let x,y={historyAction:e.history.action,location:e.history.location,matches:R,initialized:M,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||T,fetchers:new Map,blockers:new Map},D="POP",U=!1,j,K=!1,re=new Map,se=null,oe=!1,X=!1,Q=new Set,G=new Map,ue=0,de=-1,ce=new Map,m=new Set,L=new Map,A=new Map,k=new Set,Y=new Map,ee,z=null;function xe(){if(p=e.history.listen(({action:d,location:v,delta:E})=>{if(ee){ee(),ee=void 0;return}ae(Y.size===0||E!=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 C=Ar({currentLocation:y.location,nextLocation:v,historyAction:d});if(C&&E!=null){let P=new Promise(N=>{ee=N});e.history.go(E*-1),mt(C,{state:"blocked",location:v,proceed(){mt(C,{state:"proceeding",proceed:void 0,reset:void 0,location:v}),P.then(()=>e.history.go(E))},reset(){let N=new Map(y.blockers);N.set(C,nt),he({blockers:N})}});return}return Ie(d,v)}),r){xo(t,re);let d=()=>Lo(t,re);t.addEventListener("pagehide",d),se=()=>t.removeEventListener("pagehide",d)}return y.initialized||Ie("POP",y.location,{initialHydration:!0}),x}function ne(){p&&p(),se&&se(),f.clear(),j&&j.abort(),y.fetchers.forEach((d,v)=>jt(v)),y.blockers.forEach((d,v)=>kr(v))}function $t(d){return f.add(d),()=>f.delete(d)}function he(d,v={}){y={...y,...d};let E=[],C=[];y.fetchers.forEach((P,N)=>{P.state==="idle"&&(k.has(N)?E.push(N):C.push(N))}),k.forEach(P=>{!y.fetchers.has(P)&&!G.has(P)&&E.push(P)}),[...f].forEach(P=>P(y,{deletedFetchers:E,viewTransitionOpts:v.viewTransitionOpts,flushSync:v.flushSync===!0})),E.forEach(P=>jt(P)),C.forEach(P=>y.fetchers.delete(P))}function We(d,v,{flushSync:E}={}){var F,B;let C=y.actionData!=null&&y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&y.navigation.state==="loading"&&((F=d.state)==null?void 0:F._isRedirect)!==!0,P;v.actionData?Object.keys(v.actionData).length>0?P=v.actionData:P=null:C?P=y.actionData:P=null;let N=v.loaderData?rn(y.loaderData,v.loaderData,v.matches||[],v.errors):y.loaderData,H=y.blockers;H.size>0&&(H=new Map(H),H.forEach(($,V)=>H.set(V,nt)));let _=U===!0||y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&((B=d.state)==null?void 0:B._isRedirect)!==!0;s&&(l=s,s=void 0),oe||D==="POP"||(D==="PUSH"?e.history.push(d,d.state):D==="REPLACE"&&e.history.replace(d,d.state));let I;if(D==="POP"){let $=re.get(y.location.pathname);$&&$.has(d.pathname)?I={currentLocation:y.location,nextLocation:d}:re.has(d.pathname)&&(I={currentLocation:d,nextLocation:y.location})}else if(K){let $=re.get(y.location.pathname);$?$.add(d.pathname):($=new Set([d.pathname]),re.set(y.location.pathname,$)),I={currentLocation:y.location,nextLocation:d}}he({...v,actionData:P,loaderData:N,historyAction:D,location:d,initialized:!0,navigation:Jt,revalidation:"idle",restoreScrollPosition:Ir(d,v.matches||y.matches),preventScrollReset:_,blockers:H},{viewTransitionOpts:I,flushSync:E===!0}),D="POP",U=!1,K=!1,oe=!1,X=!1,z==null||z.resolve(),z=null}async function Cr(d,v){if(typeof d=="number"){e.history.go(d);return}let E=Zt(y.location,y.matches,i,d,v==null?void 0:v.fromRouteId,v==null?void 0:v.relative),{path:C,submission:P,error:N}=Jr(!1,E,v),H=y.location,_=st(y.location,C,v&&v.state);_={..._,...e.history.encodeLocation(_)};let I=v&&v.replace!=null?v.replace:void 0,F="PUSH";I===!0?F="REPLACE":I===!1||P!=null&&ve(P.formMethod)&&P.formAction===y.location.pathname+y.location.search&&(F="REPLACE");let B=v&&"preventScrollReset"in v?v.preventScrollReset===!0:void 0,$=(v&&v.flushSync)===!0,V=Ar({currentLocation:H,nextLocation:_,historyAction:F});if(V){mt(V,{state:"blocked",location:_,proceed(){mt(V,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),Cr(d,v)},reset(){let te=new Map(y.blockers);te.set(V,nt),he({blockers:te})}});return}await Ie(F,_,{submission:P,pendingError:N,preventScrollReset:B,replace:v&&v.replace,enableViewTransition:v&&v.viewTransition,flushSync:$})}function oa(){z||(z=Co()),Ft(),he({revalidation:"loading"});let d=z.promise;return y.navigation.state==="submitting"?d:y.navigation.state==="idle"?(Ie(y.historyAction,y.location,{startUninterruptedRevalidation:!0}),d):(Ie(D||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:K===!0}),d)}async function Ie(d,v,E){j&&j.abort(),j=null,D=d,oe=(E&&E.startUninterruptedRevalidation)===!0,pa(y.location,y.matches),U=(E&&E.preventScrollReset)===!0,K=(E&&E.enableViewTransition)===!0;let C=s||l,P=E&&E.overrideNavigation,N=E!=null&&E.initialHydration&&y.matches&&y.matches.length>0&&!O?y.matches:Le(C,v,i),H=(E&&E.flushSync)===!0;if(N&&y.initialized&&!X&&wo(y.location,v)&&!(E&&E.submission&&ve(E.submission.formMethod))){We(v,{matches:N},{flushSync:H});return}let _=pt(N,C,v.pathname);if(_.active&&_.matches&&(N=_.matches),!N){let{error:fe,notFoundMatches:pe,route:q}=Ht(v.pathname);We(v,{matches:pe,loaderData:{},errors:{[q.id]:fe}},{flushSync:H});return}j=new AbortController;let I=Ve(e.history,v,j.signal,E&&E.submission),F=new Yr(e.unstable_getContext?await e.unstable_getContext():void 0),B;if(E&&E.pendingError)B=[He(N).route.id,{type:"error",error:E.pendingError}];else if(E&&E.submission&&ve(E.submission.formMethod)){let fe=await ia(I,v,E.submission,N,F,_.active,E&&E.initialHydration===!0,{replace:E.replace,flushSync:H});if(fe.shortCircuited)return;if(fe.pendingActionResult){let[pe,q]=fe.pendingActionResult;if(ye(q)&&ze(q.error)&&q.error.status===404){j=null,We(v,{matches:fe.matches,loaderData:{},errors:{[pe]:q.error}});return}}N=fe.matches||N,B=fe.pendingActionResult,P=Gt(v,E.submission),H=!1,_.active=!1,I=Ve(e.history,I.url,I.signal)}let{shortCircuited:$,matches:V,loaderData:te,errors:le}=await la(I,v,N,F,_.active,P,E&&E.submission,E&&E.fetcherSubmission,E&&E.replace,E&&E.initialHydration===!0,H,B);$||(j=null,We(v,{matches:V||N,...nn(B),loaderData:te,errors:le}))}async function ia(d,v,E,C,P,N,H,_={}){Ft();let I=bo(v,E);if(he({navigation:I},{flushSync:_.flushSync===!0}),N){let $=await yt(C,v.pathname,d.signal);if($.type==="aborted")return{shortCircuited:!0};if($.type==="error"){let V=He($.partialMatches).route.id;return{matches:$.partialMatches,pendingActionResult:[V,{type:"error",error:$.error}]}}else if($.matches)C=$.matches;else{let{notFoundMatches:V,error:te,route:le}=Ht(v.pathname);return{matches:V,pendingActionResult:[le.id,{type:"error",error:te}]}}}let F,B=lt(C,v);if(!B.route.action&&!B.route.lazy)F={type:"error",error:Re(405,{method:d.method,pathname:v.pathname,routeId:B.route.id})};else{let $=Je(n,o,d,C,B,H?[]:a,P),V=await qe(d,$,P,null);if(F=V[B.route.id],!F){for(let te of C)if(V[te.route.id]){F=V[te.route.id];break}}if(d.signal.aborted)return{shortCircuited:!0}}if(Ue(F)){let $;return _&&_.replace!=null?$=_.replace:$=Zr(F.response.headers.get("Location"),new URL(d.url),i)===y.location.pathname+y.location.search,await $e(d,F,!0,{submission:E,replace:$}),{shortCircuited:!0}}if(ye(F)){let $=He(C,B.route.id);return(_&&_.replace)!==!0&&(D="PUSH"),{matches:C,pendingActionResult:[$.route.id,F,B.route.id]}}return{matches:C,pendingActionResult:[B.route.id,F]}}async function la(d,v,E,C,P,N,H,_,I,F,B,$){let V=N||Gt(v,H),te=H||_||on(V),le=!oe&&!F;if(P){if(le){let Ee=Pr($);he({navigation:V,...Ee!==void 0?{actionData:Ee}:{}},{flushSync:B})}let Z=await yt(E,v.pathname,d.signal);if(Z.type==="aborted")return{shortCircuited:!0};if(Z.type==="error"){let Ee=He(Z.partialMatches).route.id;return{matches:Z.partialMatches,loaderData:{},errors:{[Ee]:Z.error}}}else if(Z.matches)E=Z.matches;else{let{error:Ee,notFoundMatches:De,route:gt}=Ht(v.pathname);return{matches:De,loaderData:{},errors:{[gt.id]:Ee}}}}let fe=s||l,{dsMatches:pe,revalidatingFetchers:q}=Gr(d,C,n,o,e.history,y,E,te,v,F?[]:a,F===!0,X,Q,k,L,m,fe,i,e.patchRoutesOnNavigation!=null,$);if(de=++ue,!e.dataStrategy&&!pe.some(Z=>Z.shouldLoad)&&q.length===0){let Z=Dr();return We(v,{matches:E,loaderData:{},errors:$&&ye($[1])?{[$[0]]:$[1].error}:null,...nn($),...Z?{fetchers:new Map(y.fetchers)}:{}},{flushSync:B}),{shortCircuited:!0}}if(le){let Z={};if(!P){Z.navigation=V;let Ee=Pr($);Ee!==void 0&&(Z.actionData=Ee)}q.length>0&&(Z.fetchers=sa(q)),he(Z,{flushSync:B})}q.forEach(Z=>{_e(Z.key),Z.controller&&G.set(Z.key,Z.controller)});let Ke=()=>q.forEach(Z=>_e(Z.key));j&&j.signal.addEventListener("abort",Ke);let{loaderResults:Fe,fetcherResults:Qe}=await Tr(pe,q,d,C);if(d.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener("abort",Ke),q.forEach(Z=>G.delete(Z.key));let we=wt(Fe);if(we)return await $e(d,we.result,!0,{replace:I}),{shortCircuited:!0};if(we=wt(Qe),we)return m.add(we.key),await $e(d,we.result,!0,{replace:I}),{shortCircuited:!0};let{loaderData:Ze,errors:et}=tn(y,E,Fe,$,q,Qe);F&&y.errors&&(et={...y.errors,...et});let Ut=Dr(),je=Or(de),vt=Ut||je||q.length>0;return{matches:E,loaderData:Ze,errors:et,...vt?{fetchers:new Map(y.fetchers)}:{}}}function Pr(d){if(d&&!ye(d[1]))return{[d[0]]:d[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function sa(d){return d.forEach(v=>{let E=y.fetchers.get(v.key),C=at(void 0,E?E.data:void 0);y.fetchers.set(v.key,C)}),new Map(y.fetchers)}async function ua(d,v,E,C){_e(d);let P=(C&&C.flushSync)===!0,N=s||l,H=Zt(y.location,y.matches,i,E,v,C==null?void 0:C.relative),_=Le(N,H,i),I=pt(_,N,H);if(I.active&&I.matches&&(_=I.matches),!_){Te(d,v,Re(404,{pathname:H}),{flushSync:P});return}let{path:F,submission:B,error:$}=Jr(!0,H,C);if($){Te(d,v,$,{flushSync:P});return}let V=lt(_,F),te=new Yr(e.unstable_getContext?await e.unstable_getContext():void 0),le=(C&&C.preventScrollReset)===!0;if(B&&ve(B.formMethod)){await ca(d,v,F,V,_,te,I.active,P,le,B);return}L.set(d,{routeId:v,path:F}),await da(d,v,F,V,_,te,I.active,P,le,B)}async function ca(d,v,E,C,P,N,H,_,I,F){Ft(),L.delete(d);function B(ie){if(!ie.route.action&&!ie.route.lazy){let Ye=Re(405,{method:F.formMethod,pathname:E,routeId:v});return Te(d,v,Ye,{flushSync:_}),!0}return!1}if(!H&&B(C))return;let $=y.fetchers.get(d);Me(d,So(F,$),{flushSync:_});let V=new AbortController,te=Ve(e.history,E,V.signal,F);if(H){let ie=await yt(P,E,te.signal,d);if(ie.type==="aborted")return;if(ie.type==="error"){Te(d,v,ie.error,{flushSync:_});return}else if(ie.matches){if(P=ie.matches,C=lt(P,E),B(C))return}else{Te(d,v,Re(404,{pathname:E}),{flushSync:_});return}}G.set(d,V);let le=ue,fe=Je(n,o,te,P,C,a,N),q=(await qe(te,fe,N,d))[C.route.id];if(te.signal.aborted){G.get(d)===V&&G.delete(d);return}if(k.has(d)){if(Ue(q)||ye(q)){Me(d,Oe(void 0));return}}else{if(Ue(q))if(G.delete(d),de>le){Me(d,Oe(void 0));return}else return m.add(d),Me(d,at(F)),$e(te,q,!1,{fetcherSubmission:F,preventScrollReset:I});if(ye(q)){Te(d,v,q.error);return}}let Ke=y.navigation.location||y.location,Fe=Ve(e.history,Ke,V.signal),Qe=s||l,we=y.navigation.state!=="idle"?Le(Qe,y.navigation.location,i):y.matches;J(we,"Didn't find any matches after fetcher action");let Ze=++ue;ce.set(d,Ze);let et=at(F,q.data);y.fetchers.set(d,et);let{dsMatches:Ut,revalidatingFetchers:je}=Gr(Fe,N,n,o,e.history,y,we,F,Ke,a,!1,X,Q,k,L,m,Qe,i,e.patchRoutesOnNavigation!=null,[C.route.id,q]);je.filter(ie=>ie.key!==d).forEach(ie=>{let Ye=ie.key,$r=y.fetchers.get(Ye),ga=at(void 0,$r?$r.data:void 0);y.fetchers.set(Ye,ga),_e(Ye),ie.controller&&G.set(Ye,ie.controller)}),he({fetchers:new Map(y.fetchers)});let vt=()=>je.forEach(ie=>_e(ie.key));V.signal.addEventListener("abort",vt);let{loaderResults:Z,fetcherResults:Ee}=await Tr(Ut,je,Fe,N);if(V.signal.aborted)return;if(V.signal.removeEventListener("abort",vt),ce.delete(d),G.delete(d),je.forEach(ie=>G.delete(ie.key)),y.fetchers.has(d)){let ie=Oe(q.data);y.fetchers.set(d,ie)}let De=wt(Z);if(De)return $e(Fe,De.result,!1,{preventScrollReset:I});if(De=wt(Ee),De)return m.add(De.key),$e(Fe,De.result,!1,{preventScrollReset:I});let{loaderData:gt,errors:zt}=tn(y,we,Z,void 0,je,Ee);Or(Ze),y.navigation.state==="loading"&&Ze>de?(J(D,"Expected pending action"),j&&j.abort(),We(y.navigation.location,{matches:we,loaderData:gt,errors:zt,fetchers:new Map(y.fetchers)})):(he({errors:zt,loaderData:rn(y.loaderData,gt,we,zt),fetchers:new Map(y.fetchers)}),X=!1)}async function da(d,v,E,C,P,N,H,_,I,F){let B=y.fetchers.get(d);Me(d,at(F,B?B.data:void 0),{flushSync:_});let $=new AbortController,V=Ve(e.history,E,$.signal);if(H){let q=await yt(P,E,V.signal,d);if(q.type==="aborted")return;if(q.type==="error"){Te(d,v,q.error,{flushSync:_});return}else if(q.matches)P=q.matches,C=lt(P,E);else{Te(d,v,Re(404,{pathname:E}),{flushSync:_});return}}G.set(d,$);let te=ue,le=Je(n,o,V,P,C,a,N),pe=(await qe(V,le,N,d))[C.route.id];if(G.get(d)===$&&G.delete(d),!V.signal.aborted){if(k.has(d)){Me(d,Oe(void 0));return}if(Ue(pe))if(de>te){Me(d,Oe(void 0));return}else{m.add(d),await $e(V,pe,!1,{preventScrollReset:I});return}if(ye(pe)){Te(d,v,pe.error);return}Me(d,Oe(pe.data))}}async function $e(d,v,E,{submission:C,fetcherSubmission:P,preventScrollReset:N,replace:H}={}){v.response.headers.has("X-Remix-Revalidate")&&(X=!0);let _=v.response.headers.get("Location");J(_,"Expected a Location header on the redirect Response"),_=Zr(_,new URL(d.url),i);let I=st(y.location,_,{_isRedirect:!0});if(r){let le=!1;if(v.response.headers.has("X-Remix-Reload-Document"))le=!0;else if(dr.test(_)){const fe=yn(_,!0);le=fe.origin!==t.location.origin||ge(fe.pathname,i)==null}if(le){H?t.location.replace(_):t.location.assign(_);return}}j=null;let F=H===!0||v.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:B,formAction:$,formEncType:V}=y.navigation;!C&&!P&&B&&$&&V&&(C=on(y.navigation));let te=C||P;if(oo.has(v.response.status)&&te&&ve(te.formMethod))await Ie(F,I,{submission:{...te,formAction:_},preventScrollReset:N||U,enableViewTransition:E?K:void 0});else{let le=Gt(I,C);await Ie(F,I,{overrideNavigation:le,fetcherSubmission:P,preventScrollReset:N||U,enableViewTransition:E?K:void 0})}}async function qe(d,v,E,C){let P,N={};try{P=await mo(u,d,v,C,E,!1)}catch(H){return v.filter(_=>_.shouldLoad).forEach(_=>{N[_.route.id]={type:"error",error:H}}),N}if(d.signal.aborted)return N;for(let[H,_]of Object.entries(P))if(Eo(_)){let I=_.result;N[H]={type:"redirect",response:vo(I,d,H,v,i)}}else N[H]=await yo(_);return N}async function Tr(d,v,E,C){let P=qe(E,d,C,null),N=Promise.all(v.map(async I=>{if(I.matches&&I.match&&I.request&&I.controller){let B=(await qe(I.request,I.matches,C,I.key))[I.match.route.id];return{[I.key]:B}}else return Promise.resolve({[I.key]:{type:"error",error:Re(404,{pathname:I.path})}})})),H=await P,_=(await N).reduce((I,F)=>Object.assign(I,F),{});return{loaderResults:H,fetcherResults:_}}function Ft(){X=!0,L.forEach((d,v)=>{G.has(v)&&Q.add(v),_e(v)})}function Me(d,v,E={}){y.fetchers.set(d,v),he({fetchers:new Map(y.fetchers)},{flushSync:(E&&E.flushSync)===!0})}function Te(d,v,E,C={}){let P=He(y.matches,v);jt(d),he({errors:{[P.route.id]:E},fetchers:new Map(y.fetchers)},{flushSync:(C&&C.flushSync)===!0})}function Mr(d){return A.set(d,(A.get(d)||0)+1),k.has(d)&&k.delete(d),y.fetchers.get(d)||io}function jt(d){let v=y.fetchers.get(d);G.has(d)&&!(v&&v.state==="loading"&&ce.has(d))&&_e(d),L.delete(d),ce.delete(d),m.delete(d),k.delete(d),Q.delete(d),y.fetchers.delete(d)}function fa(d){let v=(A.get(d)||0)-1;v<=0?(A.delete(d),k.add(d)):A.set(d,v),he({fetchers:new Map(y.fetchers)})}function _e(d){let v=G.get(d);v&&(v.abort(),G.delete(d))}function _r(d){for(let v of d){let E=Mr(v),C=Oe(E.data);y.fetchers.set(v,C)}}function Dr(){let d=[],v=!1;for(let E of m){let C=y.fetchers.get(E);J(C,`Expected fetcher: ${E}`),C.state==="loading"&&(m.delete(E),d.push(E),v=!0)}return _r(d),v}function Or(d){let v=[];for(let[E,C]of ce)if(C<d){let P=y.fetchers.get(E);J(P,`Expected fetcher: ${E}`),P.state==="loading"&&(_e(E),ce.delete(E),v.push(E))}return _r(v),v.length>0}function ha(d,v){let E=y.blockers.get(d)||nt;return Y.get(d)!==v&&Y.set(d,v),E}function kr(d){y.blockers.delete(d),Y.delete(d)}function mt(d,v){let E=y.blockers.get(d)||nt;J(E.state==="unblocked"&&v.state==="blocked"||E.state==="blocked"&&v.state==="blocked"||E.state==="blocked"&&v.state==="proceeding"||E.state==="blocked"&&v.state==="unblocked"||E.state==="proceeding"&&v.state==="unblocked",`Invalid blocker state transition: ${E.state} -> ${v.state}`);let C=new Map(y.blockers);C.set(d,v),he({blockers:C})}function Ar({currentLocation:d,nextLocation:v,historyAction:E}){if(Y.size===0)return;Y.size>1&&ae(!1,"A router only supports one blocker at a time");let C=Array.from(Y.entries()),[P,N]=C[C.length-1],H=y.blockers.get(P);if(!(H&&H.state==="proceeding")&&N({currentLocation:d,nextLocation:v,historyAction:E}))return P}function Ht(d){let v=Re(404,{pathname:d}),E=s||l,{matches:C,route:P}=an(E);return{notFoundMatches:C,route:P,error:v}}function ma(d,v,E){if(g=d,b=v,w=E||null,!S&&y.navigation===Jt){S=!0;let C=Ir(y.location,y.matches);C!=null&&he({restoreScrollPosition:C})}return()=>{g=null,b=null,w=null}}function Nr(d,v){return w&&w(d,v.map(C=>vn(C,y.loaderData)))||d.key}function pa(d,v){if(g&&b){let E=Nr(d,v);g[E]=b()}}function Ir(d,v){if(g){let E=Nr(d,v),C=g[E];if(typeof C=="number")return C}return null}function pt(d,v,E){if(e.patchRoutesOnNavigation)if(d){if(Object.keys(d[0].params).length>0)return{active:!0,matches:xt(v,E,i,!0)}}else return{active:!0,matches:xt(v,E,i,!0)||[]};return{active:!1,matches:null}}async function yt(d,v,E,C){if(!e.patchRoutesOnNavigation)return{type:"success",matches:d};let P=d;for(;;){let N=s==null,H=s||l,_=o;try{await e.patchRoutesOnNavigation({signal:E,path:v,matches:P,fetcherKey:C,patch:(B,$)=>{E.aborted||Xr(B,$,H,_,n)}})}catch(B){return{type:"error",error:B,partialMatches:P}}finally{N&&!E.aborted&&(l=[...l])}if(E.aborted)return{type:"aborted"};let I=Le(H,v,i);if(I)return{type:"success",matches:I};let F=xt(H,v,i,!0);if(!F||P.length===F.length&&P.every((B,$)=>B.route.id===F[$].route.id))return{type:"success",matches:null};P=F}}function ya(d){o={},s=Mt(d,n,void 0,o)}function va(d,v){let E=s==null;Xr(d,v,s||l,o,n),E&&(l=[...l],he({}))}return x={get basename(){return i},get future(){return c},get state(){return y},get routes(){return l},get window(){return t},initialize:xe,subscribe:$t,enableScrollRestoration:ma,navigate:Cr,fetch:ua,revalidate:oa,createHref:d=>e.history.createHref(d),encodeLocation:d=>e.history.encodeLocation(d),getFetcher:Mr,deleteFetcher:fa,dispose:ne,getBlocker:ha,deleteBlocker:kr,patchRoutes:va,_internalFetchControllers:G,_internalSetRoutes:ya},x}function so(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Zt(e,t,r,a,n,o){let l,s;if(n){l=[];for(let u of t)if(l.push(u),u.route.id===n){s=u;break}}else l=t,s=t[t.length-1];let i=cr(a||".",ur(l),ge(e.pathname,r)||e.pathname,o==="path");if(a==null&&(i.search=e.search,i.hash=e.hash),(a==null||a===""||a===".")&&s){let u=hr(i.search);if(s.route.index&&!u)i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let c=new URLSearchParams(i.search),p=c.getAll("index");c.delete("index"),p.filter(g=>g).forEach(g=>c.append("index",g));let f=c.toString();i.search=f?`?${f}`:""}}return r!=="/"&&(i.pathname=i.pathname==="/"?r:Ce([r,i.pathname])),ke(i)}function Jr(e,t,r){if(!r||!so(r))return{path:t};if(r.formMethod&&!Ro(r.formMethod))return{path:t,error:Re(405,{method:r.formMethod})};let a=()=>({path:t,error:Re(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),l=_n(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ve(o))return a();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((f,[g,w])=>`${f}${g}=${w}
27
+ `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!ve(o))return a();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return a()}}}J(typeof FormData=="function","FormData is not available in this environment");let s,i;if(r.formData)s=rr(r.formData),i=r.formData;else if(r.body instanceof FormData)s=rr(r.body),i=r.body;else if(r.body instanceof URLSearchParams)s=r.body,i=en(s);else if(r.body==null)s=new URLSearchParams,i=new FormData;else try{s=new URLSearchParams(r.body),i=en(s)}catch{return a()}let u={formMethod:o,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(ve(u.formMethod))return{path:t,submission:u};let c=Ne(t);return e&&c.search&&hr(c.search)&&s.append("index",""),c.search=`?${s}`,{path:ke(c),submission:u}}function Gr(e,t,r,a,n,o,l,s,i,u,c,p,f,g,w,b,S,R,O,T){var oe;let M=T?ye(T[1])?T[1].error:T[1].data:void 0,x=n.createURL(o.location),y=n.createURL(i),D;if(c&&o.errors){let X=Object.keys(o.errors)[0];D=l.findIndex(Q=>Q.route.id===X)}else if(T&&ye(T[1])){let X=T[0];D=l.findIndex(Q=>Q.route.id===X)-1}let U=T?T[1].statusCode:void 0,j=U&&U>=400,K={currentUrl:x,currentParams:((oe=o.matches[0])==null?void 0:oe.params)||{},nextUrl:y,nextParams:l[0].params,...s,actionResult:M,actionStatus:U},re=l.map((X,Q)=>{let{route:G}=X,ue=null;if(D!=null&&Q>D?ue=!1:G.lazy?ue=!0:G.loader==null?ue=!1:c?ue=er(G,o.loaderData,o.errors):uo(o.loaderData,o.matches[Q],X)&&(ue=!0),ue!==null)return tr(r,a,e,X,u,t,ue);let de=j?!1:p||x.pathname+x.search===y.pathname+y.search||x.search!==y.search||co(o.matches[Q],X),ce={...K,defaultShouldRevalidate:de},m=Dt(X,ce);return tr(r,a,e,X,u,t,m,ce)}),se=[];return w.forEach((X,Q)=>{if(c||!l.some(k=>k.route.id===X.routeId)||g.has(Q))return;let G=o.fetchers.get(Q),ue=G&&G.state!=="idle"&&G.data===void 0,de=Le(S,X.path,R);if(!de){if(O&&ue)return;se.push({key:Q,routeId:X.routeId,path:X.path,matches:null,match:null,request:null,controller:null});return}if(b.has(Q))return;let ce=lt(de,X.path),m=new AbortController,L=Ve(n,X.path,m.signal),A=null;if(f.has(Q))f.delete(Q),A=Je(r,a,L,de,ce,u,t);else if(ue)p&&(A=Je(r,a,L,de,ce,u,t));else{let k={...K,defaultShouldRevalidate:j?!1:p};Dt(ce,k)&&(A=Je(r,a,L,de,ce,u,t,k))}A&&se.push({key:Q,routeId:X.routeId,path:X.path,matches:A,match:ce,request:L,controller:m})}),{dsMatches:re,revalidatingFetchers:se}}function er(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let a=t!=null&&e.id in t,n=r!=null&&r[e.id]!==void 0;return!a&&n?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!n}function uo(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function co(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Dt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Xr(e,t,r,a,n){let o;if(e){let i=a[e];J(i,`No route found to patch children into: routeId = ${e}`),i.children||(i.children=[]),o=i.children}else o=r;let l=t.filter(i=>!o.some(u=>Ln(i,u))),s=Mt(l,n,[e||"_","patch",String((o==null?void 0:o.length)||"0")],a);o.push(...s)}function Ln(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)=>{var n;return(n=t.children)==null?void 0:n.some(o=>Ln(r,o))}):!1}var qr=new WeakMap,Cn=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];if(J(n,"No route found in manifest"),!n.lazy||typeof n.lazy!="object")return;let o=n.lazy[e];if(!o)return;let l=qr.get(n);l||(l={},qr.set(n,l));let s=l[e];if(s)return s;let i=(async()=>{let u=Oa(e),p=n[e]!==void 0&&e!=="hasErrorBoundary";if(u)ae(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(p)ae(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let f=await o();f!=null&&(Object.assign(n,{[e]:f}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(f=>f===void 0)&&(n.lazy=void 0))})();return l[e]=i,i},Kr=new WeakMap;function fo(e,t,r,a,n){let o=r[e.id];if(J(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let c=Kr.get(o);if(c)return{lazyRoutePromise:c,lazyHandlerPromise:c};let p=(async()=>{J(typeof e.lazy=="function","No lazy route function found");let f=await e.lazy(),g={};for(let w in f){let b=f[w];if(b===void 0)continue;let S=Aa(w),O=o[w]!==void 0&&w!=="hasErrorBoundary";S?ae(!S,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):O?ae(!O,`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 Kr.set(o,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let l=Object.keys(e.lazy),s=[],i;for(let c of l){if(n&&n.includes(c))continue;let p=Cn({key:c,route:e,manifest:r,mapRouteProperties:a});p&&(s.push(p),c===t&&(i=p))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u==null||u.catch(()=>{}),i==null||i.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:i}}async function Qr(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 ho(e){return e.matches.some(t=>t.route.unstable_middleware)?Pn(e,!1,()=>Qr(e),(t,r)=>({[r]:{type:"error",result:t}})):Qr(e)}async function Pn(e,t,r,a){let{matches:n,request:o,params:l,context:s}=e,i={handlerResult:void 0};try{let u=n.flatMap(p=>p.route.unstable_middleware?p.route.unstable_middleware.map(f=>[p.route.id,f]):[]),c=await Tn({request:o,params:l,context:s},u,t,i,r);return t?c:i.handlerResult}catch(u){if(!i.middlewareError)throw u;let c=await a(i.middlewareError.error,i.middlewareError.routeId);return i.handlerResult?Object.assign(i.handlerResult,c):c}}async function Tn(e,t,r,a,n,o=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason?l.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${l.method} ${l.url}`);let s=t[o];if(!s)return a.handlerResult=await n(),a.handlerResult;let[i,u]=s,c=!1,p,f=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");c=!0,await Tn(e,t,r,a,n,o+1)};try{let g=await u({request:e.request,params:e.params,context:e.context},f);return c?g===void 0?p:g:f()}catch(g){throw a.middlewareError?a.middlewareError.error!==g&&(a.middlewareError={routeId:i,error:g}):a.middlewareError={routeId:i,error:g},g}}function Mn(e,t,r,a,n){let o=Cn({key:"unstable_middleware",route:a.route,manifest:t,mapRouteProperties:e}),l=fo(a.route,ve(r.method)?"action":"loader",t,e,n);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function tr(e,t,r,a,n,o,l,s=null){let i=!1,u=Mn(e,t,r,a,n);return{...a,_lazyPromises:u,shouldLoad:l,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler(c){return i=!0,s?typeof c=="boolean"?Dt(a,{...s,defaultShouldRevalidate:c}):Dt(a,s):l},resolve(c){return i||l||c&&r.method==="GET"&&(a.route.lazy||a.route.loader)?po({request:r,match:a,lazyHandlerPromise:u==null?void 0:u.handler,lazyRoutePromise:u==null?void 0:u.route,handlerOverride:c,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function Je(e,t,r,a,n,o,l,s=null){return a.map(i=>i.route.id!==n.route.id?{...i,shouldLoad:!1,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:()=>!1,_lazyPromises:Mn(e,t,r,i,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:tr(e,t,r,i,o,l,!0,s))}async function mo(e,t,r,a,n,o){r.some(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware})&&await Promise.all(r.map(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware}));let l={request:t,params:r[0].params,context:n,matches:r},i=await e({...l,fetcherKey:a,unstable_runClientMiddleware:u=>{let c=l;return Pn(c,!1,()=>u({...c,fetcherKey:a,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(p,f)=>({[f]:{type:"error",result:p}}))}});try{await Promise.all(r.flatMap(u=>{var c,p;return[(c=u._lazyPromises)==null?void 0:c.handler,(p=u._lazyPromises)==null?void 0:p.route]}))}catch{}return i}async function po({request:e,match:t,lazyHandlerPromise:r,lazyRoutePromise:a,handlerOverride:n,scopedContext:o}){let l,s,i=ve(e.method),u=i?"action":"loader",c=p=>{let f,g=new Promise((S,R)=>f=R);s=()=>f(),e.signal.addEventListener("abort",s);let w=S=>typeof p!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):p({request:e,params:t.params,context:o},...S!==void 0?[S]:[]),b=(async()=>{try{return{type:"data",result:await(n?n(R=>w(R)):w())}}catch(S){return{type:"error",result:S}}})();return Promise.race([b,g])};try{let p=i?t.route.action:t.route.loader;if(r||a)if(p){let f,[g]=await Promise.all([c(p).catch(w=>{f=w}),r,a]);if(f!==void 0)throw f;l=g}else{await r;let f=i?t.route.action:t.route.loader;if(f)[l]=await Promise.all([c(f),a]);else if(u==="action"){let g=new URL(e.url),w=g.pathname+g.search;throw Re(405,{method:e.method,pathname:w,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(p)l=await c(p);else{let f=new URL(e.url),g=f.pathname+f.search;throw Re(404,{pathname:g})}}catch(p){return{type:"error",result:p}}finally{s&&e.signal.removeEventListener("abort",s)}return l}async function yo(e){var a,n,o,l,s,i;let{result:t,type:r}=e;if(fr(t)){let u;try{let c=t.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(c){return{type:"error",error:c}}return r==="error"?{type:"error",error:new Ae(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:"data",data:u,statusCode:t.status,headers:t.headers}}return r==="error"?nr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(n=t.init)!=null&&n.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new Ae(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:ze(t)?t.status:void 0,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ze(t)?t.status:void 0}:nr(t)?{type:"data",data:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function vo(e,t,r,a,n){let o=e.headers.get("Location");if(J(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!dr.test(o)){let l=a.slice(0,a.findIndex(s=>s.route.id===r)+1);o=Zt(new URL(t.url),l,n,o),e.headers.set("Location",o)}return e}function Zr(e,t,r){if(dr.test(e)){let a=e,n=a.startsWith("//")?new URL(t.protocol+a):new URL(a),o=ge(n.pathname,r)!=null;if(n.origin===t.origin&&o)return n.pathname+n.search+n.hash}return e}function Ve(e,t,r,a){let n=e.createURL(_n(t)).toString(),o={signal:r};if(a&&ve(a.formMethod)){let{formMethod:l,formEncType:s}=a;o.method=l.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(a.json)):s==="text/plain"?o.body=a.text:s==="application/x-www-form-urlencoded"&&a.formData?o.body=rr(a.formData):o.body=a.formData}return new Request(n,o)}function rr(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function en(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function go(e,t,r,a=!1,n=!1){let o={},l=null,s,i=!1,u={},c=r&&ye(r[1])?r[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let f=p.route.id,g=t[f];if(J(!Ue(g),"Cannot handle redirect results in processLoaderData"),ye(g)){let w=g.error;if(c!==void 0&&(w=c,c=void 0),l=l||{},n)l[f]=w;else{let b=He(e,f);l[b.route.id]==null&&(l[b.route.id]=w)}a||(o[f]=xn),i||(i=!0,s=ze(g.error)?g.error.status:500),g.headers&&(u[f]=g.headers)}else o[f]=g.data,g.statusCode&&g.statusCode!==200&&!i&&(s=g.statusCode),g.headers&&(u[f]=g.headers)}),c!==void 0&&r&&(l={[r[0]]:c},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:l,statusCode:s||200,loaderHeaders:u}}function tn(e,t,r,a,n,o){let{loaderData:l,errors:s}=go(t,r,a);return n.filter(i=>!i.matches||i.matches.some(u=>u.shouldLoad)).forEach(i=>{let{key:u,match:c,controller:p}=i,f=o[u];if(J(f,"Did not find corresponding fetcher result"),!(p&&p.signal.aborted))if(ye(f)){let g=He(e.matches,c==null?void 0:c.route.id);s&&s[g.route.id]||(s={...s,[g.route.id]:f.error}),e.fetchers.delete(u)}else if(Ue(f))J(!1,"Unhandled fetcher revalidation redirect");else{let g=Oe(f.data);e.fetchers.set(u,g)}}),{loaderData:l,errors:s}}function rn(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==xn).reduce((o,[l,s])=>(o[l]=s,o),{});for(let o of r){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(n[l]=e[l]),a&&a.hasOwnProperty(l))break}return n}function nn(e){return e?ye(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function He(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 an(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 Re(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let l="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(l="Bad Request",a&&t&&r?s=`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"&&(s="Unable to encode submission body")):e===403?(l="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(l="Not Found",s=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",a&&t&&r?s=`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&&(s=`Invalid request method "${a.toUpperCase()}"`)),new Ae(e||500,l,new Error(s),!0)}function wt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(Ue(n))return{key:a,result:n}}}function _n(e){let t=typeof e=="string"?Ne(e):e;return ke({...t,hash:""})}function wo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Eo(e){return fr(e.result)&&ao.has(e.result.status)}function ye(e){return e.type==="error"}function Ue(e){return(e&&e.type)==="redirect"}function nr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function fr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Ro(e){return no.has(e.toUpperCase())}function ve(e){return to.has(e.toUpperCase())}function hr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function lt(e,t){let r=typeof t=="string"?Ne(t).search:t.search;if(e[e.length-1].route.index&&hr(r||""))return e[e.length-1];let a=Rn(e);return a[a.length-1]}function on(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:l}=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(l!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:l,text:void 0}}}function Gt(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 bo(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 So(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 Oe(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 xo(e,t){try{let r=e.sessionStorage.getItem(Sn);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 Lo(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(Sn,JSON.stringify(r))}catch(a){ae(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function Co(){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 Be=h.createContext(null);Be.displayName="DataRouter";var Ge=h.createContext(null);Ge.displayName="DataRouterState";var mr=h.createContext({isTransitioning:!1});mr.displayName="ViewTransition";var Dn=h.createContext(new Map);Dn.displayName="Fetchers";var Po=h.createContext(null);Po.displayName="Await";var be=h.createContext(null);be.displayName="Navigation";var kt=h.createContext(null);kt.displayName="Location";var Se=h.createContext({outlet:null,matches:[],isDataRoute:!1});Se.displayName="Route";var pr=h.createContext(null);pr.displayName="RouteError";function To(e,{relative:t}={}){J(ct(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=h.useContext(be),{hash:n,pathname:o,search:l}=dt(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:Ce([r,o])),a.createHref({pathname:s,search:l,hash:n})}function ct(){return h.useContext(kt)!=null}function Pe(){return J(ct(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(kt).location}var On="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function kn(e){h.useContext(be).static||h.useLayoutEffect(e)}function Mo(){let{isDataRoute:e}=h.useContext(Se);return e?Bo():_o()}function _o(){J(ct(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(Be),{basename:t,navigator:r}=h.useContext(be),{matches:a}=h.useContext(Se),{pathname:n}=Pe(),o=JSON.stringify(ur(a)),l=h.useRef(!1);return kn(()=>{l.current=!0}),h.useCallback((i,u={})=>{if(ae(l.current,On),!l.current)return;if(typeof i=="number"){r.go(i);return}let c=cr(i,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Ce([t,c.pathname])),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var Do=h.createContext(null);function Oo(e){let t=h.useContext(Se).outlet;return t&&h.createElement(Do.Provider,{value:e},t)}function An(){let{matches:e}=h.useContext(Se),t=e[e.length-1];return t?t.params:{}}function dt(e,{relative:t}={}){let{matches:r}=h.useContext(Se),{pathname:a}=Pe(),n=JSON.stringify(ur(r));return h.useMemo(()=>cr(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function ko(e,t,r,a){J(ct(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=h.useContext(be),{matches:o}=h.useContext(Se),l=o[o.length-1],s=l?l.params:{},i=l?l.pathname:"/",u=l?l.pathnameBase:"/",c=l&&l.route;{let R=c&&c.path||"";$n(i,!c||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${i}" (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.
28
+
29
+ Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let p=Pe(),f;f=p;let g=f.pathname||"/",w=g;if(u!=="/"){let R=u.replace(/^\//,"").split("/");w="/"+g.replace(/^\//,"").split("/").slice(R.length).join("/")}let b=Le(e,{pathname:w});return ae(c||b!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),ae(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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.`),Fo(b&&b.map(R=>Object.assign({},R,{params:Object.assign({},s,R.params),pathname:Ce([u,n.encodeLocation?n.encodeLocation(R.pathname).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?u:Ce([u,n.encodeLocation?n.encodeLocation(R.pathnameBase).pathname:R.pathnameBase])})),o,r,a)}function Ao(){let e=gr(),t=ze(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},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=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,l)}var No=h.createElement(Ao,null),Io=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){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?h.createElement(Se.Provider,{value:this.props.routeContext},h.createElement(pr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function $o({routeContext:e,match:t,children:r}){let a=h.useContext(Be);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(Se.Provider,{value:e},r)}function Fo(e,t=[],r=null,a=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let n=e,o=r==null?void 0:r.errors;if(o!=null){let i=n.findIndex(u=>u.route.id&&(o==null?void 0:o[u.route.id])!==void 0);J(i>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,i+1))}let l=!1,s=-1;if(r)for(let i=0;i<n.length;i++){let u=n[i];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(s=i),u.route.id){let{loaderData:c,errors:p}=r,f=u.route.loader&&!c.hasOwnProperty(u.route.id)&&(!p||p[u.route.id]===void 0);if(u.route.lazy||f){l=!0,s>=0?n=n.slice(0,s+1):n=[n[0]];break}}}return n.reduceRight((i,u,c)=>{let p,f=!1,g=null,w=null;r&&(p=o&&u.route.id?o[u.route.id]:void 0,g=u.route.errorElement||No,l&&(s<0&&c===0?($n("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,w=null):s===c&&(f=!0,w=u.route.hydrateFallbackElement||null)));let b=t.concat(n.slice(0,c+1)),S=()=>{let R;return p?R=g:f?R=w:u.route.Component?R=h.createElement(u.route.Component,null):u.route.element?R=u.route.element:R=i,h.createElement($o,{match:u,routeContext:{outlet:i,matches:b,isDataRoute:r!=null},children:R})};return r&&(u.route.ErrorBoundary||u.route.errorElement||c===0)?h.createElement(Io,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:S(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):S()},null)}function yr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jo(e){let t=h.useContext(Be);return J(t,yr(e)),t}function ft(e){let t=h.useContext(Ge);return J(t,yr(e)),t}function Ho(e){let t=h.useContext(Se);return J(t,yr(e)),t}function ht(e){let t=Ho(e),r=t.matches[t.matches.length-1];return J(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Uo(){return ht("useRouteId")}function zo(){return ft("useNavigation").navigation}function vr(){let{matches:e,loaderData:t}=ft("useMatches");return h.useMemo(()=>e.map(r=>vn(r,t)),[e,t])}function Nn(){let e=ft("useLoaderData"),t=ht("useLoaderData");return e.loaderData[t]}function In(){let e=ft("useActionData"),t=ht("useLoaderData");return e.actionData?e.actionData[t]:void 0}function gr(){var a;let e=h.useContext(pr),t=ft("useRouteError"),r=ht("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[r]}function Bo(){let{router:e}=jo("useNavigate"),t=ht("useNavigate"),r=h.useRef(!1);return kn(()=>{r.current=!0}),h.useCallback(async(n,o={})=>{ae(r.current,On),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var ln={};function $n(e,t,r){!t&&!ln[e]&&(ln[e]=!0,ae(!1,r))}var sn={};function un(e,t){!e&&!sn[t]&&(sn[t]=!0,console.warn(t))}function El(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&ae(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&ae(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&ae(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Rl=["HydrateFallback","hydrateFallbackElement"],Wo=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 bl({router:e,flushSync:t}){let[r,a]=h.useState(e.state),[n,o]=h.useState(),[l,s]=h.useState({isTransitioning:!1}),[i,u]=h.useState(),[c,p]=h.useState(),[f,g]=h.useState(),w=h.useRef(new Map),b=h.useCallback((T,{deletedFetchers:M,flushSync:x,viewTransitionOpts:y})=>{T.fetchers.forEach((U,j)=>{U.data!==void 0&&w.current.set(j,U.data)}),M.forEach(U=>w.current.delete(U)),un(x===!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 D=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(un(y==null||D,"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."),!y||!D){t&&x?t(()=>a(T)):h.startTransition(()=>a(T));return}if(t&&x){t(()=>{c&&(i&&i.resolve(),c.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:y.currentLocation,nextLocation:y.nextLocation})});let U=e.window.document.startViewTransition(()=>{t(()=>a(T))});U.finished.finally(()=>{t(()=>{u(void 0),p(void 0),o(void 0),s({isTransitioning:!1})})}),t(()=>p(U));return}c?(i&&i.resolve(),c.skipTransition(),g({state:T,currentLocation:y.currentLocation,nextLocation:y.nextLocation})):(o(T),s({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}))},[e.window,t,c,i]);h.useLayoutEffect(()=>e.subscribe(b),[e,b]),h.useEffect(()=>{l.isTransitioning&&!l.flushSync&&u(new Wo)},[l]),h.useEffect(()=>{if(i&&n&&e.window){let T=n,M=i.promise,x=e.window.document.startViewTransition(async()=>{h.startTransition(()=>a(T)),await M});x.finished.finally(()=>{u(void 0),p(void 0),o(void 0),s({isTransitioning:!1})}),p(x)}},[n,i,e.window]),h.useEffect(()=>{i&&n&&r.location.key===n.location.key&&i.resolve()},[i,c,r.location,n]),h.useEffect(()=>{!l.isTransitioning&&f&&(o(f.state),s({isTransitioning:!0,flushSync:!1,currentLocation:f.currentLocation,nextLocation:f.nextLocation}),g(void 0))},[l.isTransitioning,f]);let S=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,M,x)=>e.navigate(T,{state:M,preventScrollReset:x==null?void 0:x.preventScrollReset}),replace:(T,M,x)=>e.navigate(T,{replace:!0,state:M,preventScrollReset:x==null?void 0:x.preventScrollReset})}),[e]),R=e.basename||"/",O=h.useMemo(()=>({router:e,navigator:S,static:!1,basename:R}),[e,S,R]);return h.createElement(h.Fragment,null,h.createElement(Be.Provider,{value:O},h.createElement(Ge.Provider,{value:r},h.createElement(Dn.Provider,{value:w.current},h.createElement(mr.Provider,{value:l},h.createElement(Jo,{basename:R,location:r.location,navigationType:r.historyAction,navigator:S},h.createElement(Yo,{routes:e.routes,future:e.future,state:r})))))),null)}var Yo=h.memo(Vo);function Vo({routes:e,future:t,state:r}){return ko(e,void 0,r,t)}function Sl(e){return Oo(e.context)}function Jo({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){J(!ct(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=h.useMemo(()=>({basename:l,navigator:n,static:o,future:{}}),[l,n,o]);typeof r=="string"&&(r=Ne(r));let{pathname:i="/",search:u="",hash:c="",state:p=null,key:f="default"}=r,g=h.useMemo(()=>{let w=ge(i,l);return w==null?null:{location:{pathname:w,search:u,hash:c,state:p,key:f},navigationType:a}},[l,i,u,c,p,f,a]);return ae(g!=null,`<Router basename="${l}"> is not able to match the URL "${i}${u}${c}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:h.createElement(be.Provider,{value:s},h.createElement(kt.Provider,{children:t,value:g}))}function xl(e){return function(){const r={params:An(),loaderData:Nn(),actionData:In(),matches:vr()};return h.createElement(e,r)}}function Ll(e){return function(){const r={params:An(),loaderData:Nn(),actionData:In(),error:gr()};return h.createElement(e,r)}}var Lt="get",Ct="application/x-www-form-urlencoded";function At(e){return e!=null&&typeof e.tagName=="string"}function Go(e){return At(e)&&e.tagName.toLowerCase()==="button"}function Xo(e){return At(e)&&e.tagName.toLowerCase()==="form"}function qo(e){return At(e)&&e.tagName.toLowerCase()==="input"}function Ko(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Qo(e,t){return e.button===0&&(!t||t==="_self")&&!Ko(e)}var Et=null;function Zo(){if(Et===null)try{new FormData(document.createElement("form"),0),Et=!1}catch{Et=!0}return Et}var ei=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xt(e){return e!=null&&!ei.has(e)?(ae(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ct}"`),null):e}function ti(e,t){let r,a,n,o,l;if(Xo(e)){let s=e.getAttribute("action");a=s?ge(s,t):null,r=e.getAttribute("method")||Lt,n=Xt(e.getAttribute("enctype"))||Ct,o=new FormData(e)}else if(Go(e)||qo(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let i=e.getAttribute("formaction")||s.getAttribute("action");if(a=i?ge(i,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Lt,n=Xt(e.getAttribute("formenctype"))||Xt(s.getAttribute("enctype"))||Ct,o=new FormData(s,e),!Zo()){let{name:u,type:c,value:p}=e;if(c==="image"){let f=u?`${u}.`:"";o.append(`${f}x`,"0"),o.append(`${f}y`,"0")}else u&&o.append(u,p)}}else{if(At(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Lt,a=null,n=Ct,l=e}return o&&n==="text/plain"&&(l=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:l}}function me(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function Fn(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 ri(e,t,r){let a=e.map(o=>{var i;let l=t[o.route.id],s=r.routes[o.route.id];return[s&&s.css?s.css.map(u=>({rel:"stylesheet",href:u})):[],((i=l==null?void 0:l.links)==null?void 0:i.call(l))||[]]}).flat(2),n=Er(e,r);return zn(a,n)}function jn(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function ni(e){if(!e.css)return;let t=jn(e);await Promise.all(t.map(Un))}async function Hn(e,t){if(!e.css&&!t.links||!si())return;let r=[];if(e.css&&r.push(...jn(e)),t.links&&r.push(...t.links()),r.length===0)return;let a=[];for(let n of r)!wr(n)&&n.rel==="stylesheet"&&a.push({...n,rel:"preload",as:"style"});await Promise.all(a.map(Un))}async function Un(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let r=document.createElement("link");Object.assign(r,e);function a(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{a(),t()},r.onerror=()=>{a(),t()},document.head.appendChild(r)})}function wr(e){return e!=null&&typeof e.page=="string"}function ai(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 oi(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let l=await Fn(o,r);return l.links?l.links():[]}return[]}));return zn(a.flat(1).filter(ai).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function cn(e,t,r,a,n,o){let l=(i,u)=>r[u]?i.route.id!==r[u].route.id:!0,s=(i,u)=>{var c;return r[u].pathname!==i.pathname||((c=r[u].route.path)==null?void 0:c.endsWith("*"))&&r[u].params["*"]!==i.params["*"]};return o==="assets"?t.filter((i,u)=>l(i,u)||s(i,u)):o==="data"?t.filter((i,u)=>{var p;let c=a.routes[i.route.id];if(!c||!c.hasLoader)return!1;if(l(i,u)||s(i,u))return!0;if(i.route.shouldRevalidate){let f=i.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:((p=r[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:i.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function Er(e,t,{includeHydrateFallback:r}={}){return ii(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 ii(e){return[...new Set(e)]}function li(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function zn(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!wr(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let s=JSON.stringify(li(o));return r.has(s)||(r.add(s),n.push({key:s,link:o})),n},[])}var Rt;function si(){if(Rt!==void 0)return Rt;let e=document.createElement("link");return Rt=e.relList.supports("preload"),e=null,Rt}function dn(e){return{__html:e}}var ui=-1,ci=-2,di=-3,fi=-4,hi=-5,mi=-6,pi=-7,yi="B",vi="D",Bn="E",gi="M",wi="N",Wn="P",Ei="R",Ri="S",bi="Y",Si="U",xi="Z",Yn=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function Li(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,a){const n=e.decode(r,{stream:!0}),o=(t+n).split(`
30
+ `);t=o.pop()||"";for(const l of o)a.enqueue(l)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var qt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function ar(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return fn.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const a=r.length;for(const n of e)r.push(n);return t.length=r.length,fn.call(this,a)}function fn(e){const{hydrated:t,values:r,deferred:a,plugins:n}=this;let o;const l=[[e,i=>{o=i}]];let s=[];for(;l.length>0;){const[i,u]=l.pop();switch(i){case pi:u(void 0);continue;case hi:u(null);continue;case ci:u(NaN);continue;case mi:u(1/0);continue;case di:u(-1/0);continue;case fi:u(-0);continue}if(t[i]){u(t[i]);continue}const c=r[i];if(!c||typeof c!="object"){t[i]=c,u(c);continue}if(Array.isArray(c))if(typeof c[0]=="string"){const[p,f,g]=c;switch(p){case vi:u(t[i]=new Date(f));continue;case Si:u(t[i]=new URL(f));continue;case yi:u(t[i]=BigInt(f));continue;case Ei:u(t[i]=new RegExp(f,g));continue;case bi:u(t[i]=Symbol.for(f));continue;case Ri:const w=new Set;t[i]=w;for(let M=c.length-1;M>0;M--)l.push([c[M],x=>{w.add(x)}]);u(w);continue;case gi:const b=new Map;t[i]=b;for(let M=c.length-2;M>0;M-=2){const x=[];l.push([c[M+1],y=>{x[1]=y}]),l.push([c[M],y=>{x[0]=y}]),s.push(()=>{b.set(x[0],x[1])})}u(b);continue;case wi:const S=Object.create(null);t[i]=S;for(const M of Object.keys(f).reverse()){const x=[];l.push([f[M],y=>{x[1]=y}]),l.push([Number(M.slice(1)),y=>{x[0]=y}]),s.push(()=>{S[x[0]]=x[1]})}u(S);continue;case Wn:if(t[f])u(t[i]=t[f]);else{const M=new Yn;a[f]=M,u(t[i]=M.promise)}continue;case Bn:const[,R,O]=c;let T=O&&qt&&qt[O]?new qt[O](R):new Error(R);t[i]=T,u(T);continue;case xi:u(t[i]=t[f]);continue;default:if(Array.isArray(n)){const M=[],x=c.slice(1);for(let y=0;y<x.length;y++){const D=x[y];l.push([D,U=>{M[y]=U}])}s.push(()=>{for(const y of n){const D=y(c[0],...M);if(D){u(t[i]=D.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const p=[];t[i]=p;for(let f=0;f<c.length;f++){const g=c[f];g!==ui&&l.push([g,w=>{p[f]=w}])}u(p);continue}else{const p={};t[i]=p;for(const f of Object.keys(c).reverse()){const g=[];l.push([c[f],w=>{g[1]=w}]),l.push([Number(f.slice(1)),w=>{g[0]=w}]),s.push(()=>{p[g[0]]=g[1]})}u(p);continue}}for(;s.length>0;)s.pop()();return o}async function Ci(e,t){const{plugins:r}=t??{},a=new Yn,n=e.pipeThrough(Li()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},l=await Pi.call(o,n);let s=a.promise;return l.done?a.resolve():s=Ti.call(o,n).then(a.resolve).catch(i=>{for(const u of Object.values(o.deferred))u.reject(i);a.reject(i)}),{done:s.then(()=>n.closed),value:l.value}}async function Pi(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch{throw new SyntaxError}return{done:t.done,value:ar.call(this,r)}}async function Ti(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case Wn:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const l=r.slice(a+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=ar.call(this,s);o.resolve(i);break}case Bn:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const l=r.slice(a+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=ar.call(this,s);o.reject(i);break}default:throw new SyntaxError}t=await e.read()}}async function Mi(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 or=Symbol("SingleFetchRedirect"),Vn=class extends Error{},_i=202,Jn=new Set([100,101,204,205]);function Cl(e,t,r,a,n){let o=Di(e,l=>{let s=t.routes[l.route.id];me(s,"Route not found in manifest");let i=r[l.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!(i!=null&&i.shouldRevalidate)}},Fi,a,n);return async l=>l.unstable_runClientMiddleware(o)}function Di(e,t,r,a,n){return async o=>{let{request:l,matches:s,fetcherKey:i}=o,u=e();if(l.method!=="GET")return Oi(o,r,n);let c=s.some(p=>{let{hasLoader:f,hasClientLoader:g}=t(p);return p.unstable_shouldCallHandler()&&f&&!g});return!a&&!c?ki(o,t,r,n):i?Ii(o,r,n):Ai(o,u,t,r,a,n)}}async function Oi(e,t,r){let a=e.matches.find(l=>l.unstable_shouldCallHandler());me(a,"No action match found");let n,o=await a.resolve(async l=>await l(async()=>{let{data:i,status:u}=await t(e,r,[a.route.id]);return n=u,ut(i,a.route.id)}));return fr(o.result)||ze(o.result)||nr(o.result)?{[a.route.id]:o}:{[a.route.id]:{type:o.type,result:Za(o.result,n)}}}async function ki(e,t,r,a){let n=e.matches.filter(l=>l.unstable_shouldCallHandler()),o={};return await Promise.all(n.map(l=>l.resolve(async s=>{try{let{hasClientLoader:i}=t(l),u=l.route.id,c=i?await s(async()=>{let{data:p}=await r(e,a,[u]);return ut(p,u)}):await s();o[l.route.id]={type:"data",result:c}}catch(i){o[l.route.id]={type:"error",result:i}}}))),o}async function Ai(e,t,r,a,n,o){let l=new Set,s=!1,i=e.matches.map(()=>hn()),u=hn(),c={},p=Promise.all(e.matches.map(async(g,w)=>g.resolve(async b=>{i[w].resolve();let S=g.route.id,{hasLoader:R,hasClientLoader:O,hasShouldRevalidate:T}=r(g),M=!g.unstable_shouldRevalidateArgs||g.unstable_shouldRevalidateArgs.actionStatus==null||g.unstable_shouldRevalidateArgs.actionStatus<400;if(!g.unstable_shouldCallHandler(M)){s||(s=g.unstable_shouldRevalidateArgs!=null&&R&&T===!0);return}if(O){R&&(s=!0);try{let y=await b(async()=>{let{data:D}=await a(e,o,[S]);return ut(D,S)});c[S]={type:"data",result:y}}catch(y){c[S]={type:"error",result:y}}return}R&&l.add(S);try{let y=await b(async()=>{let D=await u.promise;return ut(D,S)});c[S]={type:"data",result:y}}catch(y){c[S]={type:"error",result:y}}})));if(await Promise.all(i.map(g=>g.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||l.size===0)&&!window.__reactRouterHdrActive)u.resolve({routes:{}});else{let g=n&&s&&l.size>0?[...l.keys()]:void 0;try{let w=await a(e,o,g);u.resolve(w.data)}catch(w){u.reject(w)}}return await p,await Ni(u.promise,e.matches,l,c),c}async function Ni(e,t,r,a){try{let n,o=await e;if("routes"in o){for(let l of t)if(l.route.id in o.routes){let s=o.routes[l.route.id];if("error"in s){n=s.error;break}}}n!==void 0&&Array.from(r.values()).forEach(l=>{a[l].result instanceof Vn&&(a[l].result=n)})}catch{}}async function Ii(e,t,r){let a=e.matches.find(l=>l.unstable_shouldCallHandler());me(a,"No fetcher match found");let n=a.route.id,o=await a.resolve(async l=>l(async()=>{let{data:s}=await t(e,r,[n]);return ut(s,n)}));return{[a.route.id]:o}}function $i(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 Gn(e,t){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname="_root.data":t&&ge(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}async function Fi(e,t,r){let{request:a}=e,n=Gn(a.url,t);a.method==="GET"&&(n=$i(n),r&&n.searchParams.set("_routes",r.join(",")));let o=await fetch(n,await Mi(a));if(o.status===404&&!o.headers.has("X-Remix-Response"))throw new Ae(404,"Not Found",!0);if(o.status===204&&o.headers.has("X-Remix-Redirect"))return{status:_i,data:{redirect:{redirect:o.headers.get("X-Remix-Redirect"),status:Number(o.headers.get("X-Remix-Status")||"302"),revalidate:o.headers.get("X-Remix-Revalidate")==="true",reload:o.headers.get("X-Remix-Reload-Document")==="true",replace:o.headers.get("X-Remix-Replace")==="true"}}};if(Jn.has(o.status)){let l={};return r&&a.method!=="GET"&&(l[r[0]]={data:void 0}),{status:o.status,data:{routes:l}}}me(o.body,"No response body to decode");try{let l=await ji(o.body,window),s;if(a.method==="GET"){let i=l.value;or in i?s={redirect:i[or]}:s={routes:i}}else{let i=l.value,u=r==null?void 0:r[0];me(u,"No routeId found for single fetch call decoding"),"redirect"in i?s={redirect:i}:s={routes:{[u]:i}}}return{status:o.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function ji(e,t){return Ci(e,{plugins:[(r,...a)=>{if(r==="SanitizedError"){let[n,o,l]=a,s=Error;n&&n in t&&typeof t[n]=="function"&&(s=t[n]);let i=new s(o);return i.stack=l,{value:i}}if(r==="ErrorResponse"){let[n,o,l]=a;return{value:new Ae(o,l,n)}}if(r==="SingleFetchRedirect")return{value:{[or]:a[0]}};if(r==="SingleFetchClassInstance")return{value:a[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function ut(e,t){if("redirect"in e){let{redirect:a,revalidate:n,reload:o,replace:l,status:s}=e.redirect;throw eo(a,{status:s,headers:{...n?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...l?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new Vn(`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 hn(){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 Pl=class extends h.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?h.createElement(Xn,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Xn({error:e,isOutsideRemixApp:t}){console.error(e);let r=h.createElement("script",{dangerouslySetInnerHTML:{__html:`
31
+ console.log(
32
+ "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
33
+ );
34
+ `}});if(ze(e))return h.createElement(ir,{title:"Unhandled Thrown Response!"},h.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let a;if(e instanceof Error)a=e;else{let n=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);a=new Error(n)}return h.createElement(ir,{title:"Application Error!",isOutsideRemixApp:t},h.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),h.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},a.stack),r)}function ir({title:e,renderScripts:t,isOutsideRemixApp:r,children:a}){var o;let{routeModules:n}=Xe();return(o=n.root)!=null&&o.Layout&&!r?a:h.createElement("html",{lang:"en"},h.createElement("head",null,h.createElement("meta",{charSet:"utf-8"}),h.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),h.createElement("title",null,e)),h.createElement("body",null,h.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},a,t?h.createElement(el,null):null)))}function Hi(){return h.createElement(ir,{title:"Loading...",renderScripts:!0},h.createElement("script",{dangerouslySetInnerHTML:{__html:`
35
+ console.log(
36
+ "💿 Hey developer 👋. You can provide a way better UX than this " +
37
+ "when your app is loading JS modules and/or running \`clientLoader\` " +
38
+ "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
39
+ "for more information."
40
+ );
41
+ `}}))}function qn(e){let t={};return Object.values(e).forEach(r=>{if(r){let a=r.parentId||"";t[a]||(t[a]=[]),t[a].push(r)}}),t}function Ui(e,t,r){let a=Kn(t),n=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Hi:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>h.createElement(Xn,{error:gr()}):void 0;return e.id==="root"&&t.Layout?{...a?{element:h.createElement(t.Layout,null,h.createElement(a,null))}:{Component:a},...o?{errorElement:h.createElement(t.Layout,null,h.createElement(o,null))}:{ErrorBoundary:o},...n?{hydrateFallbackElement:h.createElement(t.Layout,null,h.createElement(n,null))}:{HydrateFallback:n}}:{Component:a,ErrorBoundary:o,HydrateFallback:n}}function Tl(e,t,r,a,n,o){return Rr(t,r,a,n,o,"",qn(t),e)}function bt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let a=`You are trying to call ${e==="action"?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(a),new Ae(400,"Bad Request",new Error(a),!0)}}function Kt(e,t){let r=e==="clientAction"?"a":"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 Ae(405,"Method Not Allowed",new Error(a),!0)}function Rr(e,t,r,a,n,o="",l=qn(e),s){return(l[o]||[]).map(i=>{var O,T,M;let u=t[i.id];function c(x){return me(typeof x=="function","No single fetch function available for route handler"),x()}function p(x){return i.hasLoader?c(x):Promise.resolve(null)}function f(x){if(!i.hasAction)throw Kt("action",i.id);return c(x)}function g(x){import(x)}function w(x){x.clientActionModule&&g(x.clientActionModule),x.clientLoaderModule&&g(x.clientLoaderModule)}async function b(x){let y=t[i.id],D=y?Hn(i,y):Promise.resolve();try{return x()}finally{await D}}let S={id:i.id,index:i.index,path:i.path};if(u){Object.assign(S,{...S,...Ui(i,u,n),unstable_middleware:u.unstable_clientMiddleware,handle:u.handle,shouldRevalidate:mn(S.path,u,i,a,s)});let x=r&&r.loaderData&&i.id in r.loaderData,y=x?(O=r==null?void 0:r.loaderData)==null?void 0:O[i.id]:void 0,D=r&&r.errors&&i.id in r.errors,U=D?(T=r==null?void 0:r.errors)==null?void 0:T[i.id]:void 0,j=s==null&&(((M=u.clientLoader)==null?void 0:M.hydrate)===!0||!i.hasLoader);S.loader=async({request:K,params:re,context:se},oe)=>{try{return await b(async()=>(me(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:K,params:re,context:se,async serverLoader(){if(bt("loader",i),j){if(x)return y;if(D)throw U}return p(oe)}}):p(oe)))}finally{j=!1}},S.loader.hydrate=Qn(i.id,u.clientLoader,i.hasLoader,n),S.action=({request:K,params:re,context:se},oe)=>b(async()=>{if(me(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(n)throw Kt("clientAction",i.id);return f(oe)}return u.clientAction({request:K,params:re,context:se,async serverAction(){return bt("action",i),f(oe)}})})}else{i.hasClientLoader||(S.loader=(D,U)=>b(()=>p(U))),i.hasClientAction||(S.action=(D,U)=>b(()=>{if(n)throw Kt("clientAction",i.id);return f(U)}));let x;async function y(){return x?await x:(x=(async()=>{(i.clientLoaderModule||i.clientActionModule)&&await new Promise(U=>setTimeout(U,0));let D=Bi(i,t);return w(i),await D})(),await x)}S.lazy={loader:i.hasClientLoader?async()=>{let{clientLoader:D}=i.clientLoaderModule?await import(i.clientLoaderModule):await y();return me(D,"No `clientLoader` export found"),(U,j)=>D({...U,async serverLoader(){return bt("loader",i),p(j)}})}:void 0,action:i.hasClientAction?async()=>{let D=i.clientActionModule?import(i.clientActionModule):y();w(i);let{clientAction:U}=await D;return me(U,"No `clientAction` export found"),(j,K)=>U({...j,async serverAction(){return bt("action",i),f(K)}})}:void 0,unstable_middleware:i.hasClientMiddleware?async()=>{let{unstable_clientMiddleware:D}=i.clientMiddlewareModule?await import(i.clientMiddlewareModule):await y();return me(D,"No `unstable_clientMiddleware` export found"),D}:void 0,shouldRevalidate:async()=>{let D=await y();return mn(S.path,D,i,a,s)},handle:async()=>(await y()).handle,Component:async()=>(await y()).Component,ErrorBoundary:i.hasErrorBoundary?async()=>(await y()).ErrorBoundary:void 0}}let R=Rr(e,t,r,a,n,i.id,l,s);return R.length>0&&(S.children=R),S})}function mn(e,t,r,a,n){if(n)return zi(r.id,t.shouldRevalidate,n);if(!a&&r.hasLoader&&!r.hasClientLoader){let o=e?En(e)[1].map(s=>s.paramName):[];const l=s=>o.some(i=>s.currentParams[i]!==s.nextParams[i]);if(t.shouldRevalidate){let s=t.shouldRevalidate;return i=>s({...i,defaultShouldRevalidate:l(i)})}else return s=>l(s)}if(a&&t.shouldRevalidate){let o=t.shouldRevalidate;return l=>o({...l,defaultShouldRevalidate:!0})}return t.shouldRevalidate}function zi(e,t,r){let a=!1;return n=>a?t?t(n):n.defaultShouldRevalidate:(a=!0,r.has(e))}async function Bi(e,t){let r=Fn(e,t),a=ni(e),n=await r;return await Promise.all([a,Hn(e,n)]),{Component:Kn(n),ErrorBoundary:n.ErrorBoundary,unstable_clientMiddleware:n.unstable_clientMiddleware,clientAction:n.clientAction,clientLoader:n.clientLoader,handle:n.handle,links:n.links,meta:n.meta,shouldRevalidate:n.shouldRevalidate}}function Kn(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Qn(e,t,r,a){return a&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var Pt=new Set,Wi=1e3,Ot=new Set,Yi=7680;function br(e,t){return e.mode==="lazy"&&t===!0}function Vi({sri:e,...t},r){let a=new Set(r.state.matches.map(s=>s.route.id)),n=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(n.pop();n.length>0;)o.push(`/${n.join("/")}`),n.pop();o.forEach(s=>{let i=Le(r.routes,s,r.basename);i&&i.forEach(u=>a.add(u.route.id))});let l=[...a].reduce((s,i)=>Object.assign(s,{[i]:t.routes[i]}),{});return{...t,routes:l,sri:e?!0:void 0}}function Ml(e,t,r,a,n,o){if(br(a,r))return async({path:l,patch:s,signal:i,fetcherKey:u})=>{Ot.has(l)||await Zn([l],u?window.location.href:l,e,t,r,n,o,a.manifestPath,s,i)}}function _l(e,t,r,a,n,o){h.useEffect(()=>{var c,p;if(!br(n,a)||((p=(c=window.navigator)==null?void 0:c.connection)==null?void 0:p.saveData)===!0)return;function l(f){let g=f.tagName==="FORM"?f.getAttribute("action"):f.getAttribute("href");if(!g)return;let w=f.tagName==="A"?f.pathname:new URL(g,window.location.origin).pathname;Ot.has(w)||Pt.add(w)}async function s(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(l);let f=Array.from(Pt.keys()).filter(g=>Ot.has(g)?(Pt.delete(g),!1):!0);if(f.length!==0)try{await Zn(f,null,t,r,a,o,e.basename,n.manifestPath,e.patchRoutes)}catch(g){console.error("Failed to fetch manifest patches",g)}}let i=Xi(s,100);s();let u=new MutationObserver(()=>i());return u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>u.disconnect()},[a,o,t,r,e,n])}function Ji(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var Qt="react-router-manifest-version";async function Zn(e,t,r,a,n,o,l,s,i,u){let c=new URL(Ji(s,l),window.location.origin);if(e.sort().forEach(b=>c.searchParams.append("p",b)),c.searchParams.set("version",r.version),c.toString().length>Yi){Pt.clear();return}let p;try{let b=await fetch(c,{signal:u});if(b.ok){if(b.status===204&&b.headers.has("X-Remix-Reload-Document")){if(!t){console.warn("Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a new document navigation to sync up with the latest manifest.");return}if(sessionStorage.getItem(Qt)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(Qt,r.version),window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(b.status>=400)throw new Error(await b.text())}else throw new Error(`${b.status} ${b.statusText}`);sessionStorage.removeItem(Qt),p=await b.json()}catch(b){if(u!=null&&u.aborted)return;throw b}let f=new Set(Object.keys(r.routes)),g=Object.values(p).reduce((b,S)=>(S&&!f.has(S.id)&&(b[S.id]=S),b),{});Object.assign(r.routes,g),e.forEach(b=>Gi(b,Ot));let w=new Set;Object.values(g).forEach(b=>{b&&(!b.parentId||!g[b.parentId])&&w.add(b.parentId)}),w.forEach(b=>i(b||null,Rr(g,a,null,n,o,b)))}function Gi(e,t){if(t.size>=Wi){let r=t.values().next().value;t.delete(r)}t.add(e)}function Xi(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),t)}}function Sr(){let e=h.useContext(Be);return me(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Nt(){let e=h.useContext(Ge);return me(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var It=h.createContext(void 0);It.displayName="FrameworkContext";function Xe(){let e=h.useContext(It);return me(e,"You must render this element inside a <HydratedRouter> element"),e}function qi(e,t){let r=h.useContext(It),[a,n]=h.useState(!1),[o,l]=h.useState(!1),{onFocus:s,onBlur:i,onMouseEnter:u,onMouseLeave:c,onTouchStart:p}=t,f=h.useRef(null);h.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let b=R=>{R.forEach(O=>{l(O.isIntersecting)})},S=new IntersectionObserver(b,{threshold:.5});return f.current&&S.observe(f.current),()=>{S.disconnect()}}},[e]),h.useEffect(()=>{if(a){let b=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(b)}}},[a]);let g=()=>{n(!0)},w=()=>{n(!1),l(!1)};return r?e!=="intent"?[o,f,{}]:[o,f,{onFocus:ot(s,g),onBlur:ot(i,w),onMouseEnter:ot(u,g),onMouseLeave:ot(c,w),onTouchStart:ot(p,g)}]:[!1,f,{}]}function ot(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function xr(e,t,r){if(r&&!Tt)return[e[0]];if(t){let a=e.findIndex(n=>t[n.route.id]!==void 0);return e.slice(0,a+1)}return e}function Dl(){let{isSpaMode:e,manifest:t,routeModules:r,criticalCss:a}=Xe(),{errors:n,matches:o}=Nt(),l=xr(o,n,e),s=h.useMemo(()=>ri(l,r,t),[l,r,t]);return h.createElement(h.Fragment,null,typeof a=="string"?h.createElement("style",{dangerouslySetInnerHTML:{__html:a}}):null,typeof a=="object"?h.createElement("link",{rel:"stylesheet",href:a.href}):null,s.map(({key:i,link:u})=>wr(u)?h.createElement(ea,{key:i,...u}):h.createElement("link",{key:i,...u})))}function ea({page:e,...t}){let{router:r}=Sr(),a=h.useMemo(()=>Le(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?h.createElement(Qi,{page:e,matches:a,...t}):null}function Ki(e){let{manifest:t,routeModules:r}=Xe(),[a,n]=h.useState([]);return h.useEffect(()=>{let o=!1;return oi(e,t,r).then(l=>{o||n(l)}),()=>{o=!0}},[e,t,r]),a}function Qi({page:e,matches:t,...r}){let a=Pe(),{manifest:n,routeModules:o}=Xe(),{basename:l}=Sr(),{loaderData:s,matches:i}=Nt(),u=h.useMemo(()=>cn(e,t,i,n,a,"data"),[e,t,i,n,a]),c=h.useMemo(()=>cn(e,t,i,n,a,"assets"),[e,t,i,n,a]),p=h.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let w=new Set,b=!1;if(t.forEach(R=>{var T;let O=n.routes[R.route.id];!O||!O.hasLoader||(!u.some(M=>M.route.id===R.route.id)&&R.route.id in s&&((T=o[R.route.id])!=null&&T.shouldRevalidate)||O.hasClientLoader?b=!0:w.add(R.route.id))}),w.size===0)return[];let S=Gn(e,l);return b&&w.size>0&&S.searchParams.set("_routes",t.filter(R=>w.has(R.route.id)).map(R=>R.route.id).join(",")),[S.pathname+S.search]},[l,s,a,n,u,t,e,o]),f=h.useMemo(()=>Er(c,n),[c,n]),g=Ki(c);return h.createElement(h.Fragment,null,p.map(w=>h.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),f.map(w=>h.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),g.map(({key:w,link:b})=>h.createElement("link",{key:w,...b})))}function Ol(){let{isSpaMode:e,routeModules:t}=Xe(),{errors:r,matches:a,loaderData:n}=Nt(),o=Pe(),l=xr(a,r,e),s=null;r&&(s=r[l[l.length-1].route.id]);let i=[],u=null,c=[];for(let p=0;p<l.length;p++){let f=l[p],g=f.route.id,w=n[g],b=f.params,S=t[g],R=[],O={id:g,data:w,meta:[],params:f.params,pathname:f.pathname,handle:f.route.handle,error:s};if(c[p]=O,S!=null&&S.meta?R=typeof S.meta=="function"?S.meta({data:w,params:b,location:o,matches:c,error:s}):Array.isArray(S.meta)?[...S.meta]:S.meta:u&&(R=[...u]),R=R||[],!Array.isArray(R))throw new Error("The route at "+f.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
42
+
43
+ To reference the meta function API, see https://remix.run/route/meta`);O.meta=R,c[p]=O,i=[...R],u=i}return h.createElement(h.Fragment,null,i.flat().map(p=>{if(!p)return null;if("tagName"in p){let{tagName:f,...g}=p;if(!Zi(f))return console.warn(`A meta object uses an invalid tagName: ${f}. Expected either 'link' or 'meta'`),null;let w=f;return h.createElement(w,{key:JSON.stringify(g),...g})}if("title"in p)return h.createElement("title",{key:"title"},String(p.title));if("charset"in p&&(p.charSet??(p.charSet=p.charset),delete p.charset),"charSet"in p&&p.charSet!=null)return typeof p.charSet=="string"?h.createElement("meta",{key:"charSet",charSet:p.charSet}):null;if("script:ld+json"in p)try{let f=JSON.stringify(p["script:ld+json"]);return h.createElement("script",{key:`script:ld+json:${f}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:f}})}catch{return null}return h.createElement("meta",{key:JSON.stringify(p),...p})}))}function Zi(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var Tt=!1;function el(e){let{manifest:t,serverHandoffString:r,isSpaMode:a,renderMeta:n,routeDiscovery:o,ssr:l}=Xe(),{router:s,static:i,staticContext:u}=Sr(),{matches:c}=Nt(),p=br(o,l);n&&(n.didRenderScripts=!0);let f=xr(c,null,a);h.useEffect(()=>{Tt=!0},[]);let g=h.useMemo(()=>{var T;let R=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",O=i?`${(T=t.hmr)!=null&&T.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${p?"":`import ${JSON.stringify(t.url)}`};
44
+ ${f.map((M,x)=>{let y=`route${x}`,D=t.routes[M.route.id];me(D,`Route ${M.route.id} not found in manifest`);let{clientActionModule:U,clientLoaderModule:j,clientMiddlewareModule:K,hydrateFallbackModule:re,module:se}=D,oe=[...U?[{module:U,varName:`${y}_clientAction`}]:[],...j?[{module:j,varName:`${y}_clientLoader`}]:[],...K?[{module:K,varName:`${y}_clientMiddleware`}]:[],...re?[{module:re,varName:`${y}_HydrateFallback`}]:[],{module:se,varName:`${y}_main`}];if(oe.length===1)return`import * as ${y} from ${JSON.stringify(se)};`;let X=oe.map(G=>`import * as ${G.varName} from "${G.module}";`).join(`
45
+ `),Q=`const ${y} = {${oe.map(G=>`...${G.varName}`).join(",")}};`;return[X,Q].join(`
46
+ `)}).join(`
47
+ `)}
48
+ ${p?`window.__reactRouterManifest = ${JSON.stringify(Vi(t,s),null,2)};`:""}
49
+ window.__reactRouterRouteModules = {${f.map((M,x)=>`${JSON.stringify(M.route.id)}:route${x}`).join(",")}};
50
+
51
+ import(${JSON.stringify(t.entry.module)});`:" ";return h.createElement(h.Fragment,null,h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:dn(R),type:void 0}),h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:dn(O),type:"module",async:!0}))},[]),w=Tt?[]:tl(t.entry.imports.concat(Er(f,t,{includeHydrateFallback:!0}))),b=typeof t.sri=="object"?t.sri:{};return Tt?null:h.createElement(h.Fragment,null,typeof t.sri=="object"?h.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:b})}}):null,p?null:h.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:b[t.url],suppressHydrationWarning:!0}),h.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:b[t.entry.module],suppressHydrationWarning:!0}),w.map(S=>h.createElement("link",{key:S,rel:"modulepreload",href:S,crossOrigin:e.crossOrigin,integrity:b[S],suppressHydrationWarning:!0})),g)}function tl(e){return[...new Set(e)]}function rl(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var ta=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ta&&(window.__reactRouterVersion="7.6.3")}catch{}var ra=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,na=h.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:l,state:s,target:i,to:u,preventScrollReset:c,viewTransition:p,...f},g){let{basename:w}=h.useContext(be),b=typeof u=="string"&&ra.test(u),S,R=!1;if(typeof u=="string"&&b&&(S=u,ta))try{let j=new URL(window.location.href),K=u.startsWith("//")?new URL(j.protocol+u):new URL(u),re=ge(K.pathname,w);K.origin===j.origin&&re!=null?u=re+K.search+K.hash:R=!0}catch{ae(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let O=To(u,{relative:n}),[T,M,x]=qi(a,f),y=ll(u,{replace:l,state:s,target:i,preventScrollReset:c,relative:n,viewTransition:p});function D(j){t&&t(j),j.defaultPrevented||y(j)}let U=h.createElement("a",{...f,...x,href:S||O,onClick:R||o?t:D,ref:rl(g,M),target:i,"data-discover":!b&&r==="render"?"true":void 0});return T&&!b?h.createElement(h.Fragment,null,U,h.createElement(ea,{page:O})):U});na.displayName="Link";var nl=h.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:l,viewTransition:s,children:i,...u},c){let p=dt(l,{relative:u.relative}),f=Pe(),g=h.useContext(Ge),{navigator:w,basename:b}=h.useContext(be),S=g!=null&&ml(p)&&s===!0,R=w.encodeLocation?w.encodeLocation(p).pathname:p.pathname,O=f.pathname,T=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(O=O.toLowerCase(),T=T?T.toLowerCase():null,R=R.toLowerCase()),T&&b&&(T=ge(T,b)||T);const M=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let x=O===R||!n&&O.startsWith(R)&&O.charAt(M)==="/",y=T!=null&&(T===R||!n&&T.startsWith(R)&&T.charAt(R.length)==="/"),D={isActive:x,isPending:y,isTransitioning:S},U=x?t:void 0,j;typeof a=="function"?j=a(D):j=[a,x?"active":null,y?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let K=typeof o=="function"?o(D):o;return h.createElement(na,{...u,"aria-current":U,className:j,ref:c,style:K,to:l,viewTransition:s},typeof i=="function"?i(D):i)});nl.displayName="NavLink";var al=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:l=Lt,action:s,onSubmit:i,relative:u,preventScrollReset:c,viewTransition:p,...f},g)=>{let w=cl(),b=dl(s,{relative:u}),S=l.toLowerCase()==="get"?"get":"post",R=typeof s=="string"&&ra.test(s),O=T=>{if(i&&i(T),T.defaultPrevented)return;T.preventDefault();let M=T.nativeEvent.submitter,x=(M==null?void 0:M.getAttribute("formmethod"))||l;w(M||T.currentTarget,{fetcherKey:t,method:x,navigate:r,replace:n,state:o,relative:u,preventScrollReset:c,viewTransition:p})};return h.createElement("form",{ref:g,method:S,action:b,onSubmit:a?i:O,...f,"data-discover":!R&&e==="render"?"true":void 0})});al.displayName="Form";function ol({getKey:e,storageKey:t,...r}){let a=h.useContext(It),{basename:n}=h.useContext(be),o=Pe(),l=vr();fl({getKey:e,storageKey:t});let s=h.useMemo(()=>{if(!a||!e)return null;let u=sr(o,l,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let i=((u,c)=>{if(!window.history.state||!window.history.state.key){let p=Math.random().toString(32).slice(2);window.history.replaceState({key:p},"")}try{let f=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof f=="number"&&window.scrollTo(0,f)}catch(p){console.error(p),sessionStorage.removeItem(u)}}).toString();return h.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${i})(${JSON.stringify(t||lr)}, ${JSON.stringify(s)})`}})}ol.displayName="ScrollRestoration";function aa(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lr(e){let t=h.useContext(Be);return J(t,aa(e)),t}function il(e){let t=h.useContext(Ge);return J(t,aa(e)),t}function ll(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:l}={}){let s=Mo(),i=Pe(),u=dt(e,{relative:o});return h.useCallback(c=>{if(Qo(c,t)){c.preventDefault();let p=r!==void 0?r:ke(i)===ke(u);s(e,{replace:p,state:a,preventScrollReset:n,relative:o,viewTransition:l})}},[i,s,u,r,a,t,e,n,o,l])}var sl=0,ul=()=>`__${String(++sl)}__`;function cl(){let{router:e}=Lr("useSubmit"),{basename:t}=h.useContext(be),r=Uo();return h.useCallback(async(a,n={})=>{let{action:o,method:l,encType:s,formData:i,body:u}=ti(a,t);if(n.navigate===!1){let c=n.fetcherKey||ul();await e.fetch(c,r,n.action||o,{preventScrollReset:n.preventScrollReset,formData:i,body:u,formMethod:n.method||l,formEncType:n.encType||s,flushSync:n.flushSync})}else await e.navigate(n.action||o,{preventScrollReset:n.preventScrollReset,formData:i,body:u,formMethod:n.method||l,formEncType:n.encType||s,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[e,t,r])}function dl(e,{relative:t}={}){let{basename:r}=h.useContext(be),a=h.useContext(Se);J(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...dt(e||".",{relative:t})},l=Pe();if(e==null){o.search=l.search;let s=new URLSearchParams(o.search),i=s.getAll("index");if(i.some(c=>c==="")){s.delete("index"),i.filter(p=>p).forEach(p=>s.append("index",p));let c=s.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Ce([r,o.pathname])),ke(o)}var lr="react-router-scroll-positions",St={};function sr(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:ge(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function fl({getKey:e,storageKey:t}={}){let{router:r}=Lr("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=il("useScrollRestoration"),{basename:o}=h.useContext(be),l=Pe(),s=vr(),i=zo();h.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),hl(h.useCallback(()=>{if(i.state==="idle"){let u=sr(l,s,o,e);St[u]=window.scrollY}try{sessionStorage.setItem(t||lr,JSON.stringify(St))}catch(u){ae(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[i.state,e,o,l,s,t])),typeof document<"u"&&(h.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||lr);u&&(St=JSON.parse(u))}catch{}},[t]),h.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(St,()=>window.scrollY,e?(c,p)=>sr(c,p,o,e):void 0);return()=>u&&u()},[r,o,e]),h.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}if(l.hash){let u=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(u){u.scrollIntoView();return}}n!==!0&&window.scrollTo(0,0)}},[l,a,n]))}function hl(e,t){let{capture:r}={};h.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function ml(e,t={}){let r=h.useContext(mr);J(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Lr("useViewTransitionState"),n=dt(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=ge(r.currentLocation.pathname,a)||r.currentLocation.pathname,l=ge(r.nextLocation.pathname,a)||r.nextLocation.pathname;return _t(n.pathname,l)!=null||_t(n.pathname,o)!=null}[...Jn];function kl(e){if(!e)return null;let t=Object.entries(e),r={};for(let[a,n]of t)if(n&&n.__type==="RouteErrorResponse")r[a]=new Ae(n.status,n.statusText,n.data,n.internal===!0);else if(n&&n.__type==="Error"){if(n.__subType){let o=window[n.__subType];if(typeof o=="function")try{let l=new o(n.message);l.stack=n.stack,r[a]=l}catch{}}if(r[a]==null){let o=new Error(n.message);o.stack=n.stack,r[a]=o}}else r[a]=n;return r}function Al(e,t,r,a,n,o){let l={...e,loaderData:{...e.loaderData}},s=Le(t,a,n);if(s)for(let i of s){let u=i.route.id,c=r(u);Qn(u,c.clientLoader,c.hasLoader,o)&&(c.hasHydrateFallback||!c.hasLoader)?delete l.loaderData[u]:c.hasLoader||(l.loaderData[u]=null)}return l}export{pl as A,vl as B,It as F,Dl as L,Ol as M,nl as N,Sl as O,Pl as R,ol as S,h as a,bl as b,Rr as c,ji as d,kl as e,wl as f,Al as g,Ml as h,J as i,Cl as j,gl as k,Tl as l,El as m,Rl as n,yl as o,Ll as p,el as q,xa as r,ze as s,Mo as t,_l as u,na as v,xl as w,Pe as x,La as y,Ea as z};
@@ -1,4 +1,4 @@
1
- import{a as s}from"./chunk-KNED5TY2-DAA_sFzt.js";/**
1
+ import{a as s}from"./chunk-QMGIS6GS-BoPxQm7X.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{o as e,a as j,v as b,w}from"./chunk-QMGIS6GS-BoPxQm7X.js";import{c as m,f as u}from"./utils-BSDwSRl3.js";import{a as C,u as N,h as v,i as T}from"./editorialApi-Dg2JizYW.js";import{c as y,u as D,T as R,a as L,b as x,d as k,f as p,e as A,g as H,h as I}from"./index-ofqdEjlP.js";import"./react-redux-CRJHAKt_.js";function G({className:a,...t}){return e.jsx("div",{"data-slot":"skeleton",className:m("bg-accent animate-pulse rounded-md",a),...t})}function f({className:a,title:t,value:r,isLoading:n,...s}){return e.jsxs("div",{className:m("border border-border rounded-xl p-6",a),...s,children:[e.jsx("h3",{className:"text-xs text-muted-foreground",children:t}),n?e.jsx(G,{className:"h-[2.25rem] w-16"}):e.jsx("p",{className:"text-lg sm:text-3xl font-bold leading-none",children:r})]})}const i=y(),c=[i.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(a){const t=a.getValue();return e.jsx("span",{title:t,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:t})}}),i.accessor("createdAt",{header:"Created",cell(a){return u(new Date(a.getValue()))}}),i.accessor("updatedAt",{header:"Updated",cell(a){return u(new Date(a.getValue()))}})];function M(){const{data:a}=C(),{data:t}=N(),r=j.useMemo(()=>!a||!t?[]:Object.entries(a).filter(([o])=>o in t).reduce((o,[d,h])=>o.concat(Object.values(h).map(g=>({...g,type:d}))),[]).toSorted((o,d)=>o.updatedAt>d.updatedAt?-1:1).slice(0,6),[a,t]),n=D({data:r,columns:c,getCoreRowModel:I()});return e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(R,{children:[e.jsx(L,{children:n.getHeaderGroups().map(s=>e.jsx(x,{className:"grid",style:{gridTemplateColumns:`repeat(${c.length}, minmax(200px, 1fr))`},children:s.headers.map(l=>e.jsx(k,{children:l.isPlaceholder?null:p(l.column.columnDef.header,l.getContext())},l.id))},s.id))}),e.jsx(A,{children:n.getRowModel().rows.map(s=>e.jsx(b,{to:`/admin/dashboard/${s.original.type}/${s.original.id}`,children:e.jsx(x,{className:"grid",style:{gridTemplateColumns:`repeat(${c.length}, minmax(200px, 1fr))`},children:s.getVisibleCells().map(l=>e.jsx(H,{className:m("p-2"),children:p(l.column.columnDef.cell,l.getContext())},l.id))},s.id)},s.original.id))})]})})}const F=w(function(){const{data:t,isLoading:r}=v(),{data:n,isLoading:s}=T();return e.jsx("div",{className:"flex flex-1 h-full p-4 gap-4",children:e.jsxs("div",{className:"flex flex-col overflow-hidden flex-1 gap-4",children:[e.jsxs("div",{className:"flex flex-row gap-2 grid-cols-12",children:[e.jsx(f,{className:"w-full sm:w-44",title:"Items",value:t,isLoading:r}),e.jsx(f,{className:"w-full sm:w-44",title:"Files",value:n,isLoading:s})]}),e.jsxs("div",{className:"flex flex-col gap-4 last:mb-20",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",children:"Recently Updated"}),e.jsx(M,{})]})]})})});export{F as default};
@@ -0,0 +1,16 @@
1
+ import{o as e,a as m,v as N,w as v}from"./chunk-QMGIS6GS-BoPxQm7X.js";import{B as k}from"./button-D7P-1kQx.js";import{j as w,a as T,k as M}from"./editorialApi-Dg2JizYW.js";import{c as $,u as D,T as R,a as V,b as g,d as _,f as j,e as z,g as H,h as I}from"./index-ofqdEjlP.js";import{f as P,a as S,c as B}from"./utils-BSDwSRl3.js";import{T as E}from"./trash-DN4yNrfZ.js";import{c as x}from"./createLucideIcon-CEJSFbyG.js";import"./react-redux-CRJHAKt_.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],O=x("circle-check",L);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const F=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],G=x("circle",F);/**
12
+ * @license lucide-react v0.487.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Q=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],q=x("plus",Q),u=$(),b=[u.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(l){const t=l.getValue();return e.jsx("span",{title:t,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:t})}})];function A({itemType:l}){const{data:t}=w(l),{data:c}=T(),[r]=M(),o=m.useMemo(()=>u.display({id:"actions",header:()=>e.jsx("span",{className:"flex justify-end ml-auto"}),cell(a){return e.jsx("div",{className:"flex gap-2 justify-end",children:e.jsxs("button",{className:"hover:text-red-500 p-1 hover:bg-muted rounded-sm",onClick:s=>{s.stopPropagation(),r({type:l,id:a.row.original.id})},children:[e.jsx(E,{size:16,className:"group-hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"Delete entry"})]})})}}),[l,r]),i=m.useMemo(()=>{if(!t)return b;const a=Object.entries(t.fields);return[...b,...a.filter(([,s])=>s.showInSummary).map(([s,d])=>u.accessor(n=>n[s],{id:s,header:d.displayName,cell(n){switch(d.type){case"boolean":const C=n.getValue()?O:G;return e.jsx("span",{className:"flex justify-center items-center h-full text-nowrap",children:e.jsx(C,{className:S("mx-auto",n.getValue()?"text-green-600":"text-gray-300"),size:14})});case"date":const p=n.getValue();return p?e.jsx("span",{className:"text-nowrap",children:P(new Date(p))}):"--";case"markdown":case"string":const f=n.getValue();return e.jsx("span",{title:f,className:"block w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:f});default:return n.getValue()}}})),o]},[o,t]),y=m.useMemo(()=>c?Object.values(c[l]):[],[l,c]),h=D({data:y,columns:i,getCoreRowModel:I()});return!t||!c?null:e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(R,{children:[e.jsx(V,{className:"sticky top-0 z-50",children:h.getHeaderGroups().map(a=>e.jsx(g,{className:"grid",style:{gridTemplateColumns:`repeat(${i.length}, minmax(200px, 1fr))`},children:a.headers.map(s=>e.jsx(_,{className:"bg-background",children:s.isPlaceholder?null:j(s.column.columnDef.header,s.getContext())},s.id))},a.id))}),e.jsx(z,{children:h.getRowModel().rows.map(a=>e.jsx(N,{to:`/admin/dashboard/${l}/${a.original.id}`,children:e.jsx(g,{className:"grid",style:{gridTemplateColumns:`repeat(${i.length}, minmax(200px, 1fr))`},children:a.getVisibleCells().map((s,d)=>e.jsx(H,{className:B("h-10",{"w-full":d==i.length-1}),children:j(s.column.columnDef.cell,s.getContext())},s.id))})},a.id))})]})})}const se=v(function({params:t}){const{collectionId:c}=t,{data:r,isFetching:o}=w(c);return o||!r?null:e.jsx("div",{className:"overflow-hidden flex flex-1 p-4 gap-4",children:e.jsx("div",{className:"flex flex-col overflow-hidden flex-1 gap-8",children:e.jsxs("div",{className:"flex flex-col h-full gap-4 last:mb-20",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",id:r.displayName,children:r.displayName}),e.jsx(k,{asChild:!0,variant:"default",size:"sm",className:"ml-auto",children:e.jsxs(N,{to:`/admin/dashboard/${c}/new`,children:[e.jsx(q,{}),"Create"]})})]}),e.jsx(A,{itemType:c},c)]})})})});export{se as default};
@@ -0,0 +1 @@
1
+ import{w as c,o as e}from"./chunk-QMGIS6GS-BoPxQm7X.js";import{I as n}from"./itemForm-BCRilPzX.js";import{j as p,l}from"./editorialApi-Dg2JizYW.js";import"./button-D7P-1kQx.js";import"./utils-BSDwSRl3.js";import"./input-BScD3Ruq.js";import"./index-C4BMMXbp.js";import"./index-CvFp8wi_.js";import"./createLucideIcon-CEJSFbyG.js";import"./index-DWY8ISpx.js";import"./tslib.es6-De9GV7Vy.js";import"./react-redux-CRJHAKt_.js";const T=c(function({params:m}){const{collectionId:t,documentId:i}=m,{data:o,isFetching:a}=p(t),{data:s,isFetching:r}=l({itemType:t,id:i});return!o||!s||(a||r)?null:e.jsx("div",{className:"overflow-auto",children:e.jsx("div",{className:"flex p-4 gap-4",children:e.jsx(n,{itemType:t,fields:o.fields,data:s},`${t}-${i}`)})})});export{T as default};
@@ -0,0 +1 @@
1
+ import{w as i,o}from"./chunk-QMGIS6GS-BoPxQm7X.js";import{I as m}from"./itemForm-BCRilPzX.js";import{j as s}from"./editorialApi-Dg2JizYW.js";import"./button-D7P-1kQx.js";import"./utils-BSDwSRl3.js";import"./input-BScD3Ruq.js";import"./index-C4BMMXbp.js";import"./index-CvFp8wi_.js";import"./createLucideIcon-CEJSFbyG.js";import"./index-DWY8ISpx.js";import"./tslib.es6-De9GV7Vy.js";import"./react-redux-CRJHAKt_.js";const y=i(function({params:r}){const{collectionId:t}=r,{data:e}=s(t);return e?o.jsx("div",{className:"overflow-auto",children:o.jsx("div",{className:"flex p-4 gap-4",children:o.jsx(m,{itemType:t,fields:e.fields,isNew:!0})})}):null});export{y as default};
@@ -0,0 +1,61 @@
1
+ import{o as e,a as d,v as N,N as re,t as de,x as le,y as ce,w as ue,O as he}from"./chunk-QMGIS6GS-BoPxQm7X.js";import{u as pe,h as z,i as xe}from"./authSlice-C1VgtCUs.js";import{u as K,a as fe,b as be,c as ge,d as me,f as je,g as ve}from"./editorialApi-Dg2JizYW.js";import{R as U,C as W,a as Q,T as X,D as Z,P as Y,O as J,b as we,c as ye,d as Ne,e as Ce,f as Se,g as _e,A as ke,u as Me,E as ze}from"./index-DWY8ISpx.js";import{c as i}from"./utils-BSDwSRl3.js";import{c as f}from"./createLucideIcon-CEJSFbyG.js";import{B as E,S as D,c as Ee,u as De}from"./button-D7P-1kQx.js";import{u as Oe,c as Re,P as O,a as Ae,b as Pe,d as Ie}from"./index-C4BMMXbp.js";import{C as $}from"./chevron-down-DTegokyb.js";import"./tslib.es6-De9GV7Vy.js";import"./react-redux-CRJHAKt_.js";import"./index-CvFp8wi_.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Te=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],$e=f("arrow-down",Te);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Le=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Be=f("arrow-up",Le);/**
12
+ * @license lucide-react v0.487.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Ge=[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]],He=f("blocks",Ge);/**
17
+ * @license lucide-react v0.487.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Fe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qe=f("chevron-right",Fe);/**
22
+ * @license lucide-react v0.487.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Ve=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],Ke=f("files",Ve);/**
27
+ * @license lucide-react v0.487.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Ue=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],We=f("grid-3x3",Ue);/**
32
+ * @license lucide-react v0.487.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const Qe=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]],Xe=f("heart",Qe);/**
37
+ * @license lucide-react v0.487.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const Ze=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],Ye=f("log-out",Ze);/**
42
+ * @license lucide-react v0.487.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const Je=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],et=f("panel-left",Je);/**
47
+ * @license lucide-react v0.487.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const tt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],at=f("square",tt);/**
52
+ * @license lucide-react v0.487.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const st=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],nt=f("upload",st);/**
57
+ * @license lucide-react v0.487.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const ot=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ee=f("x",ot);function it({...t}){return e.jsx(U,{"data-slot":"dialog",...t})}function rt({...t}){return e.jsx(Y,{"data-slot":"dialog-portal",...t})}function dt({className:t,...a}){return e.jsx(J,{"data-slot":"dialog-overlay",className:i("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function lt({className:t,children:a,...n}){return e.jsxs(rt,{"data-slot":"dialog-portal",children:[e.jsx(dt,{}),e.jsxs(W,{"data-slot":"dialog-content",className:i("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...n,children:[a,e.jsxs(Q,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(ee,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ct({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:i("flex flex-col gap-2 text-center sm:text-left",t),...a})}function ut({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:i("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function ht({className:t,...a}){return e.jsx(X,{"data-slot":"dialog-title",className:i("text-lg leading-none font-semibold",t),...a})}function pt({className:t,...a}){return e.jsx(Z,{"data-slot":"dialog-description",className:i("text-muted-foreground text-sm",t),...a})}const xt="#181717",ft=d.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},r){return n==="default"&&(n=xt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:r,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})}),bt="#85EA2D",gt=d.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},r){return n==="default"&&(n=bt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:r,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"})]})});function mt({isOpen:t,setOpen:a}){return e.jsx(it,{open:t,onOpenChange:n=>a(n),children:e.jsxs(lt,{children:[e.jsxs(ct,{children:[e.jsx(ht,{children:"Editorial"}),e.jsx(pt,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(E,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"/doc",children:[e.jsx(gt,{size:14}),"Swagger API UI"]})}),e.jsx(E,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(ft,{size:14}),"GitHub repository"]})})]}),e.jsx(ut,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(Xe,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",e.jsx(N,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}function jt({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(we,{"data-slot":"separator-root",decorative:n,orientation:a,className:i("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...s})}function vt({...t}){return e.jsx(U,{"data-slot":"sheet",...t})}function wt({...t}){return e.jsx(Y,{"data-slot":"sheet-portal",...t})}function yt({className:t,...a}){return e.jsx(J,{"data-slot":"sheet-overlay",className:i("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function Nt({className:t,children:a,side:n="right",...s}){return e.jsxs(wt,{children:[e.jsx(yt,{}),e.jsxs(W,{"data-slot":"sheet-content",className:i("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,e.jsxs(Q,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(ee,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ct({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:i("flex flex-col gap-1.5 p-4",t),...a})}function St({className:t,...a}){return e.jsx(X,{"data-slot":"sheet-title",className:i("text-foreground font-semibold",t),...a})}function _t({className:t,...a}){return e.jsx(Z,{"data-slot":"sheet-description",className:i("text-muted-foreground text-sm",t),...a})}function te({delayDuration:t=0,...a}){return e.jsx(ye,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function kt({...t}){return e.jsx(te,{children:e.jsx(Ne,{"data-slot":"tooltip",...t})})}function Mt({...t}){return e.jsx(Ce,{"data-slot":"tooltip-trigger",...t})}function zt({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(Se,{children:e.jsxs(_e,{"data-slot":"tooltip-content",sideOffset:a,className:i("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...s,children:[n,e.jsx(ke,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const M=768;function Et(){const[t,a]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${M-1}px)`),s=()=>{a(window.innerWidth<M)};return n.addEventListener("change",s),a(window.innerWidth<M),()=>n.removeEventListener("change",s)},[]),!!t}const Dt="sidebar_state",Ot=60*60*24*7,Rt="16rem",At="18rem",Pt="3rem",It="b",ae=d.createContext(null);function R(){const t=d.useContext(ae);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Tt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:r,...l}){const p=Et(),[x,u]=d.useState(!1),[g,C]=d.useState(t),m=a??g,j=d.useCallback(h=>{const c=typeof h=="function"?h(m):h;n?n(c):C(c),document.cookie=`${Dt}=${c}; path=/; max-age=${Ot}`},[n,m]),v=d.useCallback(()=>p?u(h=>!h):j(h=>!h),[p,j,u]);d.useEffect(()=>{const h=c=>{c.key===It&&(c.metaKey||c.ctrlKey)&&(c.preventDefault(),v())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[v]);const y=m?"expanded":"collapsed",S=d.useMemo(()=>({state:y,open:m,setOpen:j,isMobile:p,openMobile:x,setOpenMobile:u,toggleSidebar:v}),[y,m,j,p,x,u,v]);return e.jsx(ae.Provider,{value:S,children:e.jsx(te,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Rt,"--sidebar-width-icon":Pt,...o},className:i("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...l,children:r})})})}function $t({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...r}){const{isMobile:l,state:p,openMobile:x,setOpenMobile:u}=R();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:i("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...r,children:o}):l?e.jsx(vt,{open:x,onOpenChange:u,...r,children:e.jsxs(Nt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":At},side:t,children:[e.jsxs(Ct,{className:"sr-only",children:[e.jsx(St,{children:"Sidebar"}),e.jsx(_t,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":p,"data-collapsible":p==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:i("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:i("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...r,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function Lt({className:t,onClick:a,...n}){const{toggleSidebar:s}=R();return e.jsxs(E,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:i("size-7",t),onClick:o=>{a==null||a(o),s()},...n,children:[e.jsx(et,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Bt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:i("flex flex-col gap-2 p-2",t),...a})}function Gt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i("flex flex-col gap-2 p-2",t),...a})}function Ht({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function _({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i("relative flex w-full min-w-0 flex-col p-2",t),...a})}function L({className:t,asChild:a=!1,...n}){const s=a?D:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:i("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function B({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i("w-full text-sm",t),...a})}function G({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i("flex w-full min-w-0 flex-col gap-1",t),...a})}function w({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i("group/menu-item relative",t),...a})}const Ft=Ee("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function b({asChild:t=!1,isActive:a=!1,variant:n="default",size:s="default",tooltip:o,className:r,...l}){const p=t?D:"button",{isMobile:x,state:u}=R(),g=e.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:i(Ft({variant:n,size:s}),r),...l});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(kt,{children:[e.jsx(Mt,{asChild:!0,children:g}),e.jsx(zt,{side:"right",align:"center",hidden:u!=="collapsed"||x,...o})]})):g}function qt({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:i("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Vt({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const r=t?D:"a";return e.jsx(r,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:i("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...o})}function H({singleton:t}){const{data:a}=K(),{data:n}=fe();return a?e.jsx(e.Fragment,{children:Object.entries(a).filter(([,s])=>t?s.singleton:!s.singleton).map(([s,o])=>e.jsx(qt,{children:e.jsx(re,{to:t?`/admin/dashboard/${s}/default`:`/admin/dashboard/${s}`,className:({isActive:r,isPending:l})=>l?"pending":r?"active":"",children:({isActive:r})=>e.jsx(Vt,{isActive:r,asChild:!0,children:e.jsxs("div",{children:[e.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap w-full",children:o.displayName}),!t&&n&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1",children:Object.keys(n[s]).length})]})})})},o.displayName))}):null}var k="Collapsible",[Kt,ua]=Re(k),[Ut,A]=Kt(k),se=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:r,onOpenChange:l,...p}=t,[x,u]=Oe({prop:s,defaultProp:o??!1,onChange:l,caller:k});return e.jsx(Ut,{scope:n,disabled:r,contentId:Me(),open:x,onOpenToggle:d.useCallback(()=>u(g=>!g),[u]),children:e.jsx(O.div,{"data-state":I(x),"data-disabled":r?"":void 0,...p,ref:a})})});se.displayName=k;var ne="CollapsibleTrigger",oe=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=A(ne,n);return e.jsx(O.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":I(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:a,onClick:Ae(t.onClick,o.onOpenToggle)})});oe.displayName=ne;var P="CollapsibleContent",ie=d.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=A(P,t.__scopeCollapsible);return e.jsx(Pe,{present:n||o.open,children:({present:r})=>e.jsx(Wt,{...s,ref:a,present:r})})});ie.displayName=P;var Wt=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...r}=t,l=A(P,n),[p,x]=d.useState(s),u=d.useRef(null),g=De(a,u),C=d.useRef(0),m=C.current,j=d.useRef(0),v=j.current,y=l.open||p,S=d.useRef(y),h=d.useRef(void 0);return d.useEffect(()=>{const c=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(c)},[]),Ie(()=>{const c=u.current;if(c){h.current=h.current||{transitionDuration:c.style.transitionDuration,animationName:c.style.animationName},c.style.transitionDuration="0s",c.style.animationName="none";const T=c.getBoundingClientRect();C.current=T.height,j.current=T.width,S.current||(c.style.transitionDuration=h.current.transitionDuration,c.style.animationName=h.current.animationName),x(s)}},[l.open,s]),e.jsx(O.div,{"data-state":I(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!y,...r,ref:g,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:y&&o})});function I(t){return t?"open":"closed"}var Qt=se;function F({...t}){return e.jsx(Qt,{"data-slot":"collapsible",...t})}function q({...t}){return e.jsx(oe,{"data-slot":"collapsible-trigger",...t})}function V({...t}){return e.jsx(ie,{"data-slot":"collapsible-content",...t})}function Xt(){const t=pe(),[a,n]=d.useState(!1),[s]=be(),[o]=ge(),[r]=me(),{data:l}=je(),{data:p}=ve(),x=z(u=>u.auth.role);return e.jsxs($t,{className:"z-50",children:[e.jsx(mt,{isOpen:a,setOpen:n}),e.jsx(Bt,{className:"h-14 justify-center",children:e.jsx(_,{children:e.jsx(N,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:l==null?void 0:l.name})})}),e.jsxs(Ht,{children:[e.jsxs(_,{children:[e.jsx(L,{children:"Content"}),e.jsx(B,{children:e.jsxs(G,{children:[e.jsx(F,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(q,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(We,{}),e.jsx("span",{children:"Collections"}),e.jsx($,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(V,{children:e.jsx(H,{})})]})}),e.jsx(F,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(q,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(at,{}),e.jsx("span",{children:"Singles"}),e.jsx($,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(V,{children:e.jsx(H,{singleton:!0})})]})}),e.jsx(w,{children:e.jsx(b,{asChild:!0,children:e.jsxs(N,{to:"/admin/dashboard/files",children:[e.jsx(Ke,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(w,{children:e.jsxs(b,{disabled:!0,children:[e.jsx(He,{}),e.jsx("span",{children:"Components"})]})})]})})]}),e.jsxs(_,{children:[e.jsx(L,{children:"Actions"}),e.jsx(B,{children:e.jsxs(G,{children:[x==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(b,{className:"cursor-pointer",onClick:()=>o(),children:[e.jsx($e,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(b,{className:"cursor-pointer",onClick:()=>r(),children:[e.jsx(Be,{}),e.jsx("span",{children:"Push to repo"})]})})]}),e.jsx(w,{children:e.jsxs(b,{className:"cursor-pointer",onClick:()=>s(),children:[e.jsx(nt,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(_,{})]}),e.jsxs(Gt,{children:[e.jsx(b,{asChild:!0,children:e.jsxs(N,{to:l==null?void 0:l.previewUrl,children:["Preview",e.jsx(ze,{className:"ml-auto"})]})}),e.jsx(b,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(b,{className:"cursor-pointer",onClick:()=>t(xe()),children:[e.jsx(Ye,{}),"Log out"]})]})]})}function Zt({children:t}){const a=de(),n=z(o=>o.auth.user),s=z(o=>o.auth.isLoading);return d.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?null:t}function Yt(){const{pathname:t}=le(),{data:a}=K(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,r)=>e.jsxs(ce.Fragment,{children:[r.length>1&&o>=1&&e.jsx(qe,{size:12,className:"text-gray-500 pt-[1px]"}),e.jsx("p",{className:"text-sm leading-none tracking-tight capitalize text-gray-500 last:text-foreground",children:a[s]?a[s].displayName:s},s)]},o))}):null}const ha=ue(function(){return e.jsx(Zt,{children:e.jsxs(Tt,{className:"flex h-full",children:[e.jsx(Xt,{}),e.jsxs("main",{className:"flex flex-col flex-1 h-full w-0",children:[e.jsx("header",{className:"flex sticky bg-sidebar dark:bg-sidebar z-40 top-0 h-14 shrink-0 items-center gap-2 border-b",children:e.jsxs("div",{className:"flex items-center gap-2 px-3",children:[e.jsx(Lt,{}),e.jsx(jt,{orientation:"vertical",className:"h-4"}),e.jsx(Yt,{})]})}),e.jsx(he,{})]})]})})});export{ha as default};