@isardsat/editorial-admin 6.0.2 → 6.0.4

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 (40) hide show
  1. package/build/client/assets/{authSlice-KDhecIDl.js → authSlice-B3Tyl-Nw.js} +1 -1
  2. package/build/client/assets/button-Da66T3Bb.js +1 -0
  3. package/build/client/assets/chevron-down-8tTu7uK2.js +6 -0
  4. package/build/client/assets/chunk-KNED5TY2-DAA_sFzt.js +51 -0
  5. package/build/client/assets/{createLucideIcon-TQsNVzYU.js → createLucideIcon-R2-3a7hN.js} +1 -1
  6. package/build/client/assets/dashboard-BTu7-8Ba.js +1 -0
  7. package/build/client/assets/{dashboard._collection-DCypgAsP.js → dashboard._collection-MtSHvYYW.js} +4 -4
  8. package/build/client/assets/dashboard._collection._document-CRkC98aa.js +1 -0
  9. package/build/client/assets/dashboard._collection.new-BFe8yV0Z.js +1 -0
  10. package/build/client/assets/{dashboard._layout-BdJ3SrSw.js → dashboard._layout-fM4SW8Or.js} +2 -2
  11. package/build/client/assets/{dashboard.files-DVCxRHOl.js → dashboard.files-ieQA7EmW.js} +3 -3
  12. package/build/client/assets/editorialApi-fQchmMa9.js +1 -0
  13. package/build/client/assets/entry.client-BGu2H8xv.js +34 -0
  14. package/build/client/assets/home-oYP3wzz9.js +36 -0
  15. package/build/client/assets/{index-C-iH5ItK.js → index-Bd1u2_LZ.js} +1 -1
  16. package/build/client/assets/{index-B_FOxFgA.js → index-BvKqmqc2.js} +1 -1
  17. package/build/client/assets/index-C-vcF2DZ.js +9 -0
  18. package/build/client/assets/{index-DrhM6FV9.js → index-DeO5nu0f.js} +1 -1
  19. package/build/client/assets/{input-BH49oaMa.js → input-BmmdOdbj.js} +1 -1
  20. package/build/client/assets/itemForm-DlRBjBsd.js +90 -0
  21. package/build/client/assets/manifest-9974ee04.js +1 -0
  22. package/build/client/assets/react-redux-kbMjYGuQ.js +9 -0
  23. package/build/client/assets/root-wKvfXBjk.js +1 -0
  24. package/build/client/assets/{trash-B3lfbu-5.js → trash-wq_ppIxP.js} +1 -1
  25. package/build/client/index.html +4 -4
  26. package/package.json +11 -9
  27. package/build/client/assets/button-O0EDocjF.js +0 -1
  28. package/build/client/assets/chevron-down-BMtosYlL.js +0 -6
  29. package/build/client/assets/chunk-KNED5TY2-CXj9yqcQ.js +0 -51
  30. package/build/client/assets/dashboard-Binq3-uL.js +0 -1
  31. package/build/client/assets/dashboard._collection._document-B9dEIw39.js +0 -1
  32. package/build/client/assets/dashboard._collection.new-QbdwRouF.js +0 -1
  33. package/build/client/assets/editorialApi-DCnC5eM9.js +0 -1
  34. package/build/client/assets/entry.client-B5Ca3clj.js +0 -34
  35. package/build/client/assets/home-wnsWYgD_.js +0 -11
  36. package/build/client/assets/index-B7e3fQ32.js +0 -9
  37. package/build/client/assets/index-G-cqIhgh.js +0 -9
  38. package/build/client/assets/itemForm-dtoqbEoC.js +0 -90
  39. package/build/client/assets/manifest-a309df9e.js +0 -1
  40. package/build/client/assets/root-DHDQPxhg.js +0 -1
@@ -1,4 +1,4 @@
1
- import{_ as pi}from"./tslib.es6-CDuPK5Eb.js";import{u as Da,b as Ma,d as La,e as xa,f as Fa}from"./index-G-cqIhgh.js";/**
1
+ import{_ as pi}from"./tslib.es6-CDuPK5Eb.js";import{u as Da,b as Ma,d as La,e as xa,f as Fa}from"./react-redux-kbMjYGuQ.js";/**
2
2
  * @license
3
3
  * Copyright 2025 Google LLC
4
4
  *
@@ -0,0 +1 @@
1
+ import{a,n as p}from"./chunk-KNED5TY2-DAA_sFzt.js";import{a as V,c as E}from"./utils-DslUJpbf.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),v=l.find(R);if(v){const s=v.props.children,c=l.map(d=>d===v?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)=>{o(...l),r(...l)}: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 f=y(c)||y(d);return r[s][f]}),l=t&&Object.entries(t).reduce((s,c)=>{let[d,f]=c;return f===void 0||(s[d]=f),s},{}),v=n==null||(i=n.compoundVariants)===null||i===void 0?void 0:i.reduce((s,c)=>{let{class:d,className:f,...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,f]:s},[]);return h(e,u,v,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};
@@ -0,0 +1,6 @@
1
+ import{c as o}from"./createLucideIcon-R2-3a7hN.js";const e={EDITORIAL_API_URL:"/"};/**
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 n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],t=o("chevron-down",n);export{t as C,e as c};
@@ -0,0 +1,51 @@
1
+ var pa=Object.defineProperty;var ya=(e,t,r)=>t in e?pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var wt=(e,t,r)=>ya(e,typeof t!="symbol"?t+"":t,r);function va(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 cl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ga(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bt={exports:{}},Ze={};/**
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 Ir;function wa(){if(Ir)return Ze;Ir=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 Ze.Fragment=t,Ze.jsx=r,Ze.jsxs=r,Ze}var Fr;function Ea(){return Fr||(Fr=1,Bt.exports=wa()),Bt.exports}var dl=Ea(),Yt={exports:{}},B={};/**
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 jr;function Ra(){if(jr)return B;jr=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"),d=Symbol.for("react.lazy"),m=Symbol.iterator;function p(y){return y===null||typeof y!="object"?null:(y=m&&y[m]||y["@@iterator"],typeof y=="function"?y:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,b={};function E(y,x,I){this.props=y,this.context=x,this.refs=b,this.updater=I||g}E.prototype.isReactComponent={},E.prototype.setState=function(y,x){if(typeof y!="object"&&typeof y!="function"&&y!=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,y,x,"setState")},E.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function S(){}S.prototype=E.prototype;function C(y,x,I){this.props=y,this.context=x,this.refs=b,this.updater=I||g}var P=C.prototype=new S;P.constructor=C,w(P,E.prototype),P.isPureReactComponent=!0;var T=Array.isArray,c={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function k(y,x,I,F,W,q){return I=q.ref,{$$typeof:e,type:y,key:x,ref:I!==void 0?I:null,props:q}}function O(y,x){return k(y.type,x,void 0,void 0,void 0,y.props)}function z(y){return typeof y=="object"&&y!==null&&y.$$typeof===e}function J(y){var x={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(I){return x[I]})}var Q=/\/+/g;function ie(y,x){return typeof y=="object"&&y!==null&&y.key!=null?J(""+y.key):x.toString(36)}function le(){}function Se(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(le,le):(y.status="pending",y.then(function(x){y.status==="pending"&&(y.status="fulfilled",y.value=x)},function(x){y.status==="pending"&&(y.status="rejected",y.reason=x)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function K(y,x,I,F,W){var q=typeof y;(q==="undefined"||q==="boolean")&&(y=null);var V=!1;if(y===null)V=!0;else switch(q){case"bigint":case"string":case"number":V=!0;break;case"object":switch(y.$$typeof){case e:case t:V=!0;break;case d:return V=y._init,K(V(y._payload),x,I,F,W)}}if(V)return W=W(y),V=F===""?"."+ie(y,0):F,T(W)?(I="",V!=null&&(I=V.replace(Q,"$&/")+"/"),K(W,x,I,"",function(se){return se})):W!=null&&(z(W)&&(W=O(W,I+(W.key==null||y&&y.key===W.key?"":(""+W.key).replace(Q,"$&/")+"/")+V)),x.push(W)),1;V=0;var we=F===""?".":F+":";if(T(y))for(var te=0;te<y.length;te++)F=y[te],q=we+ie(F,te),V+=K(F,x,I,q,W);else if(te=p(y),typeof te=="function")for(y=te.call(y),te=0;!(F=y.next()).done;)F=F.value,q=we+ie(F,te++),V+=K(F,x,I,q,W);else if(q==="object"){if(typeof y.then=="function")return K(Se(y),x,I,F,W);throw x=String(y),Error("Objects are not valid as a React child (found: "+(x==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":x)+"). If you meant to render a collection of children, use an array instead.")}return V}function xe(y,x,I){if(y==null)return y;var F=[],W=0;return K(y,F,"","",function(q){return x.call(I,q,W++)}),F}function Ne(y){if(y._status===-1){var x=y._result;x=x(),x.then(function(I){(y._status===0||y._status===-1)&&(y._status=1,y._result=I)},function(I){(y._status===0||y._status===-1)&&(y._status=2,y._result=I)}),y._status===-1&&(y._status=0,y._result=x)}if(y._status===1)return y._result.default;throw y._result}var Le=typeof reportError=="function"?reportError:function(y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var x=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof y=="object"&&y!==null&&typeof y.message=="string"?String(y.message):String(y),error:y});if(!window.dispatchEvent(x))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",y);return}console.error(y)};function ye(){}return B.Children={map:xe,forEach:function(y,x,I){xe(y,function(){x.apply(this,arguments)},I)},count:function(y){var x=0;return xe(y,function(){x++}),x},toArray:function(y){return xe(y,function(x){return x})||[]},only:function(y){if(!z(y))throw Error("React.Children.only expected to receive a single React element child.");return y}},B.Component=E,B.Fragment=r,B.Profiler=n,B.PureComponent=C,B.StrictMode=a,B.Suspense=i,B.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,B.act=function(){throw Error("act(...) is not supported in production builds of React.")},B.cache=function(y){return function(){return y.apply(null,arguments)}},B.cloneElement=function(y,x,I){if(y==null)throw Error("The argument must be a React element, but you passed "+y+".");var F=w({},y.props),W=y.key,q=void 0;if(x!=null)for(V in x.ref!==void 0&&(q=void 0),x.key!==void 0&&(W=""+x.key),x)!M.call(x,V)||V==="key"||V==="__self"||V==="__source"||V==="ref"&&x.ref===void 0||(F[V]=x[V]);var V=arguments.length-2;if(V===1)F.children=I;else if(1<V){for(var we=Array(V),te=0;te<V;te++)we[te]=arguments[te+2];F.children=we}return k(y.type,W,void 0,void 0,q,F)},B.createContext=function(y){return y={$$typeof:l,_currentValue:y,_currentValue2:y,_threadCount:0,Provider:null,Consumer:null},y.Provider=y,y.Consumer={$$typeof:o,_context:y},y},B.createElement=function(y,x,I){var F,W={},q=null;if(x!=null)for(F in x.key!==void 0&&(q=""+x.key),x)M.call(x,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(W[F]=x[F]);var V=arguments.length-2;if(V===1)W.children=I;else if(1<V){for(var we=Array(V),te=0;te<V;te++)we[te]=arguments[te+2];W.children=we}if(y&&y.defaultProps)for(F in V=y.defaultProps,V)W[F]===void 0&&(W[F]=V[F]);return k(y,q,void 0,void 0,null,W)},B.createRef=function(){return{current:null}},B.forwardRef=function(y){return{$$typeof:s,render:y}},B.isValidElement=z,B.lazy=function(y){return{$$typeof:d,_payload:{_status:-1,_result:y},_init:Ne}},B.memo=function(y,x){return{$$typeof:u,type:y,compare:x===void 0?null:x}},B.startTransition=function(y){var x=c.T,I={};c.T=I;try{var F=y(),W=c.S;W!==null&&W(I,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(ye,Le)}catch(q){Le(q)}finally{c.T=x}},B.unstable_useCacheRefresh=function(){return c.H.useCacheRefresh()},B.use=function(y){return c.H.use(y)},B.useActionState=function(y,x,I){return c.H.useActionState(y,x,I)},B.useCallback=function(y,x){return c.H.useCallback(y,x)},B.useContext=function(y){return c.H.useContext(y)},B.useDebugValue=function(){},B.useDeferredValue=function(y,x){return c.H.useDeferredValue(y,x)},B.useEffect=function(y,x){return c.H.useEffect(y,x)},B.useId=function(){return c.H.useId()},B.useImperativeHandle=function(y,x,I){return c.H.useImperativeHandle(y,x,I)},B.useInsertionEffect=function(y,x){return c.H.useInsertionEffect(y,x)},B.useLayoutEffect=function(y,x){return c.H.useLayoutEffect(y,x)},B.useMemo=function(y,x){return c.H.useMemo(y,x)},B.useOptimistic=function(y,x){return c.H.useOptimistic(y,x)},B.useReducer=function(y,x,I){return c.H.useReducer(y,x,I)},B.useRef=function(y){return c.H.useRef(y)},B.useState=function(y){return c.H.useState(y)},B.useSyncExternalStore=function(y,x,I){return c.H.useSyncExternalStore(y,x,I)},B.useTransition=function(){return c.H.useTransition()},B.version="19.0.0",B}var Ur;function ba(){return Ur||(Ur=1,Yt.exports=Ra()),Yt.exports}var h=ba();const Sa=ga(h),fl=va({__proto__:null,default:Sa},[h]);var xa=-1,La=-2,Ca=-3,Pa=-4,Ta=-5,Ma=-6,_a=-7,Da="B",Oa="D",vn="E",ka="M",Aa="N",gn="P",Na="R",$a="S",Ia="Y",Fa="U",ja="Z",wn=class{constructor(){wt(this,"promise");wt(this,"resolve");wt(this,"reject");this.promise=new Promise((t,r)=>{this.resolve=t,this.reject=r})}};function Ua(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,a){const n=e.decode(r,{stream:!0}),o=(t+n).split(`
18
+ `);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 Wt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function Zt(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return Hr.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,Hr.call(this,a)}function Hr(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 _a:u(void 0);continue;case Ta:u(null);continue;case La:u(NaN);continue;case Ma:u(1/0);continue;case Ca:u(-1/0);continue;case Pa:u(-0);continue}if(t[i]){u(t[i]);continue}const d=r[i];if(!d||typeof d!="object"){t[i]=d,u(d);continue}if(Array.isArray(d))if(typeof d[0]=="string"){const[m,p,g]=d;switch(m){case Oa:u(t[i]=new Date(p));continue;case Fa:u(t[i]=new URL(p));continue;case Da:u(t[i]=BigInt(p));continue;case Na:u(t[i]=new RegExp(p,g));continue;case Ia:u(t[i]=Symbol.for(p));continue;case $a:const w=new Set;t[i]=w;for(let T=1;T<d.length;T++)l.push([d[T],c=>{w.add(c)}]);u(w);continue;case ka:const b=new Map;t[i]=b;for(let T=1;T<d.length;T+=2){const c=[];l.push([d[T+1],M=>{c[1]=M}]),l.push([d[T],M=>{c[0]=M}]),s.push(()=>{b.set(c[0],c[1])})}u(b);continue;case Aa:const E=Object.create(null);t[i]=E;for(const T of Object.keys(p).reverse()){const c=[];l.push([p[T],M=>{c[1]=M}]),l.push([Number(T.slice(1)),M=>{c[0]=M}]),s.push(()=>{E[c[0]]=c[1]})}u(E);continue;case gn:if(t[p])u(t[i]=t[p]);else{const T=new wn;a[p]=T,u(t[i]=T.promise)}continue;case vn:const[,S,C]=d;let P=C&&Wt&&Wt[C]?new Wt[C](S):new Error(S);t[i]=P,u(P);continue;case ja:u(t[i]=t[p]);continue;default:if(Array.isArray(n)){const T=[],c=d.slice(1);for(let M=0;M<c.length;M++){const k=c[M];l.push([k,O=>{T[M]=O}])}s.push(()=>{for(const M of n){const k=M(d[0],...T);if(k){u(t[i]=k.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const m=[];t[i]=m;for(let p=0;p<d.length;p++){const g=d[p];g!==xa&&l.push([g,w=>{m[p]=w}])}u(m);continue}else{const m={};t[i]=m;for(const p of Object.keys(d).reverse()){const g=[];l.push([d[p],w=>{g[1]=w}]),l.push([Number(p.slice(1)),w=>{g[0]=w}]),s.push(()=>{m[g[0]]=g[1]})}u(m);continue}}for(;s.length>0;)s.pop()();return o}async function Ha(e,t){const{plugins:r}=t??{},a=new wn,n=e.pipeThrough(Ua()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},l=await za.call(o,n);let s=a.promise;return l.done?a.resolve():s=Ba.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 za(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:Zt.call(this,r)}}async function Ba(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case gn:{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=Zt.call(this,s);o.resolve(i);break}case vn:{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=Zt.call(this,s);o.reject(i);break}default:throw new SyntaxError}t=await e.read()}}var et={},zr;function Ya(){if(zr)return et;zr=1,Object.defineProperty(et,"__esModule",{value:!0}),et.parse=l,et.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 p=function(){};return p.prototype=Object.create(null),p})();function l(p,g){const w=new o,b=p.length;if(b<2)return w;const E=(g==null?void 0:g.decode)||d;let S=0;do{const C=p.indexOf("=",S);if(C===-1)break;const P=p.indexOf(";",S),T=P===-1?b:P;if(C>T){S=p.lastIndexOf(";",C-1)+1;continue}const c=s(p,S,C),M=i(p,C,c),k=p.slice(c,M);if(w[k]===void 0){let O=s(p,C+1,T),z=i(p,T,O);const J=E(p.slice(O,z));w[k]=J}S=T+1}while(S<b);return w}function s(p,g,w){do{const b=p.charCodeAt(g);if(b!==32&&b!==9)return g}while(++g<w);return w}function i(p,g,w){for(;g>w;){const b=p.charCodeAt(--g);if(b!==32&&b!==9)return g+1}return w}function u(p,g,w){const b=(w==null?void 0:w.encode)||encodeURIComponent;if(!e.test(p))throw new TypeError(`argument name is invalid: ${p}`);const E=b(g);if(!t.test(E))throw new TypeError(`argument val is invalid: ${g}`);let S=p+"="+E;if(!w)return S;if(w.maxAge!==void 0){if(!Number.isInteger(w.maxAge))throw new TypeError(`option maxAge is invalid: ${w.maxAge}`);S+="; Max-Age="+w.maxAge}if(w.domain){if(!r.test(w.domain))throw new TypeError(`option domain is invalid: ${w.domain}`);S+="; Domain="+w.domain}if(w.path){if(!a.test(w.path))throw new TypeError(`option path is invalid: ${w.path}`);S+="; Path="+w.path}if(w.expires){if(!m(w.expires)||!Number.isFinite(w.expires.valueOf()))throw new TypeError(`option expires is invalid: ${w.expires}`);S+="; Expires="+w.expires.toUTCString()}if(w.httpOnly&&(S+="; HttpOnly"),w.secure&&(S+="; Secure"),w.partitioned&&(S+="; Partitioned"),w.priority)switch(typeof w.priority=="string"?w.priority.toLowerCase():void 0){case"low":S+="; Priority=Low";break;case"medium":S+="; Priority=Medium";break;case"high":S+="; 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":S+="; SameSite=Strict";break;case"lax":S+="; SameSite=Lax";break;case"none":S+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${w.sameSite}`)}return S}function d(p){if(p.indexOf("%")===-1)return p;try{return decodeURIComponent(p)}catch{return p}}function m(p){return n.call(p)==="[object Date]"}return et}Ya();/**
19
+ * react-router v7.5.0
20
+ *
21
+ * Copyright (c) Remix Software Inc.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE.md file in the root directory of this source tree.
25
+ *
26
+ * @license MIT
27
+ */var En=e=>{throw TypeError(e)},Wa=(e,t,r)=>t.has(e)||En("Cannot "+r),Vt=(e,t,r)=>(Wa(e,t,"read from private field"),r?r.call(e):t.get(e)),Va=(e,t,r)=>t.has(e)?En("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Br="popstate";function ml(e={}){function t(a,n){let{pathname:o,search:l,hash:s}=a.location;return lt("",{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:Oe(n)}return Ga(t,r,null,e)}function Y(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function re(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ja(){return Math.random().toString(36).substring(2,10)}function Yr(e,t){return{usr:e.state,key:e.key,idx:t}}function lt(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ae(t):t,state:r,key:t&&t.key||a||Ja()}}function Oe({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 Ae(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 Ga(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,l=n.history,s="POP",i=null,u=d();u==null&&(u=0,l.replaceState({...l.state,idx:u},""));function d(){return(l.state||{idx:null}).idx}function m(){s="POP";let E=d(),S=E==null?null:E-u;u=E,i&&i({action:s,location:b.location,delta:S})}function p(E,S){s="PUSH";let C=lt(b.location,E,S);u=d()+1;let P=Yr(C,u),T=b.createHref(C);try{l.pushState(P,"",T)}catch(c){if(c instanceof DOMException&&c.name==="DataCloneError")throw c;n.location.assign(T)}o&&i&&i({action:s,location:b.location,delta:1})}function g(E,S){s="REPLACE";let C=lt(b.location,E,S);u=d();let P=Yr(C,u),T=b.createHref(C);l.replaceState(P,"",T),o&&i&&i({action:s,location:b.location,delta:0})}function w(E){let S=n.location.origin!=="null"?n.location.origin:n.location.href,C=typeof E=="string"?E:Oe(E);return C=C.replace(/ $/,"%20"),Y(S,`No window.location.(origin|href) available to create URL for href: ${C}`),new URL(C,S)}let b={get action(){return s},get location(){return e(n,l)},listen(E){if(i)throw new Error("A history only accepts one active listener");return n.addEventListener(Br,m),i=E,()=>{n.removeEventListener(Br,m),i=null}},createHref(E){return t(n,E)},createURL:w,encodeLocation(E){let S=w(E);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:g,go(E){return l.go(E)}};return b}var at,Wr=class{constructor(e){if(Va(this,at,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Vt(this,at).has(e))return Vt(this,at).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Vt(this,at).set(e,t)}};at=new WeakMap;var Ka=new Set(["lazy","caseSensitive","path","id","index","children"]);function qa(e){return Ka.has(e)}var Xa=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function Qa(e){return Xa.has(e)}function Za(e){return e.index===!0}function Dt(e,t,r=[],a={}){return e.map((n,o)=>{let l=[...r,String(o)],s=typeof n.id=="string"?n.id:l.join("-");if(Y(n.index!==!0||!n.children,"Cannot specify children on an index route"),Y(!a[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Za(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=Dt(n.children,t,l,a)),i}})}function Te(e,t,r="/"){return Ct(e,t,r,!1)}function Ct(e,t,r,a){let n=typeof t=="string"?Ae(t):t,o=he(n.pathname||"/",r);if(o==null)return null;let l=bn(e);eo(l);let s=null;for(let i=0;s==null&&i<l.length;++i){let u=fo(o);s=uo(l[i],u,a)}return s}function Rn(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 bn(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("/")&&(Y(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=Re([a,i.relativePath]),d=r.concat(i);o.children&&o.children.length>0&&(Y(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),bn(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:lo(u,o.index),routesMeta:d})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))n(o,l);else for(let i of Sn(o.path))n(o,l,i)}),t}function Sn(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=Sn(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 eo(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:so(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var to=/^:[\w-]+$/,ro=3,no=2,ao=1,oo=10,io=-2,Vr=e=>e==="*";function lo(e,t){let r=e.split("/"),a=r.length;return r.some(Vr)&&(a+=io),t&&(a+=no),r.filter(n=>!Vr(n)).reduce((n,o)=>n+(to.test(o)?ro:o===""?ao:oo),a)}function so(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 uo(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,d=o==="/"?t:t.slice(o.length)||"/",m=Ot({path:i.relativePath,caseSensitive:i.caseSensitive,end:u},d),p=i.route;if(!m&&u&&r&&!a[a.length-1].route.index&&(m=Ot({path:i.relativePath,caseSensitive:i.caseSensitive,end:!1},d)),!m)return null;Object.assign(n,m.params),l.push({params:n,pathname:Re([o,m.pathname]),pathnameBase:po(Re([o,m.pathnameBase])),route:p}),m.pathnameBase!=="/"&&(o=Re([o,m.pathnameBase]))}return l}function Ot(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=co(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:d,isOptional:m},p)=>{if(d==="*"){let w=s[p]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const g=s[p];return m&&!g?u[d]=void 0:u[d]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function co(e,t=!1,r=!0){re(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 fo(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return re(!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 he(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 ho(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Ae(e):e;return{pathname:r?r.startsWith("/")?r:mo(r,t):t,search:yo(a),hash:vo(n)}}function mo(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 Jt(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 xn(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function lr(e){let t=xn(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function sr(e,t,r,a=!1){let n;typeof e=="string"?n=Ae(e):(n={...e},Y(!n.pathname||!n.pathname.includes("?"),Jt("?","pathname","search",n)),Y(!n.pathname||!n.pathname.includes("#"),Jt("#","pathname","hash",n)),Y(!n.search||!n.search.includes("#"),Jt("#","search","hash",n)));let o=e===""||n.pathname==="",l=o?"/":n.pathname,s;if(l==null)s=r;else{let m=t.length-1;if(!a&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),m-=1;n.pathname=p.join("/")}s=m>=0?t[m]:"/"}let i=ho(n,s),u=l&&l!=="/"&&l.endsWith("/"),d=(o||l===".")&&r.endsWith("/");return!i.pathname.endsWith("/")&&(u||d)&&(i.pathname+="/"),i}var Re=e=>e.join("/").replace(/\/\/+/g,"/"),po=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),yo=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vo=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,go=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function wo(e,t){return new go(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})},ke=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function He(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Ln=["POST","PUT","PATCH","DELETE"],Ro=new Set(Ln),bo=["GET",...Ln],So=new Set(bo),xo=new Set([301,302,303,307,308]),Lo=new Set([307,308]),Gt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Co={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ur=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Po=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Cn="remix-router-transitions",Pn=Symbol("ResetLoaderData");function pl(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";Y(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.mapRouteProperties||Po,n={},o=Dt(e.routes,a,void 0,n),l,s=e.basename||"/",i=e.dataStrategy||ko,u={unstable_middleware:!1,...e.future},d=null,m=new Set,p=null,g=null,w=null,b=e.hydrationData!=null,E=Te(o,e.history.location,s),S=!1,C=null;if(E==null&&!e.patchRoutesOnNavigation){let f=me(404,{pathname:e.history.location.pathname}),{matches:v,route:R}=ln(o);E=v,C={[R.id]:f}}E&&!e.hydrationData&&mt(E,o,e.history.location.pathname).active&&(E=null);let P;if(E)if(E.some(f=>f.route.lazy))P=!1;else if(!E.some(f=>f.route.loader))P=!0;else{let f=e.hydrationData?e.hydrationData.loaderData:null,v=e.hydrationData?e.hydrationData.errors:null;if(v){let R=E.findIndex(L=>v[L.route.id]!==void 0);P=E.slice(0,R+1).every(L=>!tr(L.route,f,v))}else P=E.every(R=>!tr(R.route,f,v))}else{P=!1,E=[];let f=mt(null,o,e.history.location.pathname);f.active&&f.matches&&(S=!0,E=f.matches)}let T,c={historyAction:e.history.action,location:e.history.location,matches:E,initialized:P,navigation:Gt,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||C,fetchers:new Map,blockers:new Map},M="POP",k=!1,O,z=!1,J=new Map,Q=null,ie=!1,le=!1,Se=new Set,K=new Map,xe=0,Ne=-1,Le=new Map,ye=new Set,y=new Map,x=new Map,I=new Set,F=new Map,W,q=null;function V(){if(d=e.history.listen(({action:f,location:v,delta:R})=>{if(W){W(),W=void 0;return}re(F.size===0||R!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let L=kr({currentLocation:c.location,nextLocation:v,historyAction:f});if(L&&R!=null){let _=new Promise(U=>{W=U});e.history.go(R*-1),ht(L,{state:"blocked",location:v,proceed(){ht(L,{state:"proceeding",proceed:void 0,reset:void 0,location:v}),_.then(()=>e.history.go(R))},reset(){let U=new Map(c.blockers);U.set(L,tt),se({blockers:U})}});return}return $e(f,v)}),r){Yo(t,J);let f=()=>Wo(t,J);t.addEventListener("pagehide",f),Q=()=>t.removeEventListener("pagehide",f)}return c.initialized||$e("POP",c.location,{initialHydration:!0}),T}function we(){d&&d(),Q&&Q(),m.clear(),O&&O.abort(),c.fetchers.forEach((f,v)=>Ut(v)),c.blockers.forEach((f,v)=>Or(v))}function te(f){return m.add(f),()=>m.delete(f)}function se(f,v={}){c={...c,...f};let R=[],L=[];c.fetchers.forEach((_,U)=>{_.state==="idle"&&(I.has(U)?R.push(U):L.push(U))}),I.forEach(_=>{!c.fetchers.has(_)&&!K.has(_)&&R.push(_)}),[...m].forEach(_=>_(c,{deletedFetchers:R,viewTransitionOpts:v.viewTransitionOpts,flushSync:v.flushSync===!0})),R.forEach(_=>Ut(_)),L.forEach(_=>c.fetchers.delete(_))}function Be(f,v,{flushSync:R}={}){var D,N;let L=c.actionData!=null&&c.navigation.formMethod!=null&&ve(c.navigation.formMethod)&&c.navigation.state==="loading"&&((D=f.state)==null?void 0:D._isRedirect)!==!0,_;v.actionData?Object.keys(v.actionData).length>0?_=v.actionData:_=null:L?_=c.actionData:_=null;let U=v.loaderData?an(c.loaderData,v.loaderData,v.matches||[],v.errors):c.loaderData,j=c.blockers;j.size>0&&(j=new Map(j),j.forEach((H,G)=>j.set(G,tt)));let A=k===!0||c.navigation.formMethod!=null&&ve(c.navigation.formMethod)&&((N=f.state)==null?void 0:N._isRedirect)!==!0;l&&(o=l,l=void 0),ie||M==="POP"||(M==="PUSH"?e.history.push(f,f.state):M==="REPLACE"&&e.history.replace(f,f.state));let $;if(M==="POP"){let H=J.get(c.location.pathname);H&&H.has(f.pathname)?$={currentLocation:c.location,nextLocation:f}:J.has(f.pathname)&&($={currentLocation:f,nextLocation:c.location})}else if(z){let H=J.get(c.location.pathname);H?H.add(f.pathname):(H=new Set([f.pathname]),J.set(c.location.pathname,H)),$={currentLocation:c.location,nextLocation:f}}se({...v,actionData:_,loaderData:U,historyAction:M,location:f,initialized:!0,navigation:Gt,revalidation:"idle",restoreScrollPosition:Nr(f,v.matches||c.matches),preventScrollReset:A,blockers:j},{viewTransitionOpts:$,flushSync:R===!0}),M="POP",k=!1,z=!1,ie=!1,le=!1,q==null||q.resolve(),q=null}async function Lr(f,v){if(typeof f=="number"){e.history.go(f);return}let R=er(c.location,c.matches,s,f,v==null?void 0:v.fromRouteId,v==null?void 0:v.relative),{path:L,submission:_,error:U}=Jr(!1,R,v),j=c.location,A=lt(c.location,L,v&&v.state);A={...A,...e.history.encodeLocation(A)};let $=v&&v.replace!=null?v.replace:void 0,D="PUSH";$===!0?D="REPLACE":$===!1||_!=null&&ve(_.formMethod)&&_.formAction===c.location.pathname+c.location.search&&(D="REPLACE");let N=v&&"preventScrollReset"in v?v.preventScrollReset===!0:void 0,H=(v&&v.flushSync)===!0,G=kr({currentLocation:j,nextLocation:A,historyAction:D});if(G){ht(G,{state:"blocked",location:A,proceed(){ht(G,{state:"proceeding",proceed:void 0,reset:void 0,location:A}),Lr(f,v)},reset(){let Z=new Map(c.blockers);Z.set(G,tt),se({blockers:Z})}});return}await $e(D,A,{submission:_,pendingError:U,preventScrollReset:N,replace:v&&v.replace,enableViewTransition:v&&v.viewTransition,flushSync:H})}function ta(){q||(q=Vo()),jt(),se({revalidation:"loading"});let f=q.promise;return c.navigation.state==="submitting"?f:c.navigation.state==="idle"?($e(c.historyAction,c.location,{startUninterruptedRevalidation:!0}),f):($e(M||c.historyAction,c.navigation.location,{overrideNavigation:c.navigation,enableViewTransition:z===!0}),f)}async function $e(f,v,R){O&&O.abort(),O=null,M=f,ie=(R&&R.startUninterruptedRevalidation)===!0,da(c.location,c.matches),k=(R&&R.preventScrollReset)===!0,z=(R&&R.enableViewTransition)===!0;let L=l||o,_=R&&R.overrideNavigation,U=R!=null&&R.initialHydration&&c.matches&&c.matches.length>0&&!S?c.matches:Te(L,v,s),j=(R&&R.flushSync)===!0;if(U&&c.initialized&&!le&&jo(c.location,v)&&!(R&&R.submission&&ve(R.submission.formMethod))){Be(v,{matches:U},{flushSync:j});return}let A=mt(U,L,v.pathname);if(A.active&&A.matches&&(U=A.matches),!U){let{error:ne,notFoundMatches:ee,route:oe}=Ht(v.pathname);Be(v,{matches:ee,loaderData:{},errors:{[oe.id]:ne}},{flushSync:j});return}O=new AbortController;let $=Ve(e.history,v,O.signal,R&&R.submission),D=new Wr(e.unstable_getContext?await e.unstable_getContext():void 0),N;if(R&&R.pendingError)N=[je(U).route.id,{type:"error",error:R.pendingError}];else if(R&&R.submission&&ve(R.submission.formMethod)){let ne=await ra($,v,R.submission,U,D,A.active,{replace:R.replace,flushSync:j});if(ne.shortCircuited)return;if(ne.pendingActionResult){let[ee,oe]=ne.pendingActionResult;if(de(oe)&&He(oe.error)&&oe.error.status===404){O=null,Be(v,{matches:ne.matches,loaderData:{},errors:{[ee]:oe.error}});return}}U=ne.matches||U,N=ne.pendingActionResult,_=Kt(v,R.submission),j=!1,A.active=!1,$=Ve(e.history,$.url,$.signal)}let{shortCircuited:H,matches:G,loaderData:Z,errors:ue}=await na($,v,U,D,A.active,_,R&&R.submission,R&&R.fetcherSubmission,R&&R.replace,R&&R.initialHydration===!0,j,N);H||(O=null,Be(v,{matches:G||U,...on(N),loaderData:Z,errors:ue}))}async function ra(f,v,R,L,_,U,j={}){jt();let A=zo(v,R);if(se({navigation:A},{flushSync:j.flushSync===!0}),U){let N=await pt(L,v.pathname,f.signal);if(N.type==="aborted")return{shortCircuited:!0};if(N.type==="error"){let H=je(N.partialMatches).route.id;return{matches:N.partialMatches,pendingActionResult:[H,{type:"error",error:N.error}]}}else if(N.matches)L=N.matches;else{let{notFoundMatches:H,error:G,route:Z}=Ht(v.pathname);return{matches:H,pendingActionResult:[Z.id,{type:"error",error:G}]}}}let $,D=it(L,v);if(!D.route.action&&!D.route.lazy)$={type:"error",error:me(405,{method:f.method,pathname:v.pathname,routeId:D.route.id})};else{let N=await Ke("action",f,[D],L,_,null);if($=N[D.route.id],!$){for(let H of L)if(N[H.route.id]){$=N[H.route.id];break}}if(f.signal.aborted)return{shortCircuited:!0}}if(Ue($)){let N;return j&&j.replace!=null?N=j.replace:N=tn($.response.headers.get("Location"),new URL(f.url),s)===c.location.pathname+c.location.search,await Ie(f,$,!0,{submission:R,replace:N}),{shortCircuited:!0}}if(de($)){let N=je(L,D.route.id);return(j&&j.replace)!==!0&&(M="PUSH"),{matches:L,pendingActionResult:[N.route.id,$]}}return{matches:L,pendingActionResult:[D.route.id,$]}}async function na(f,v,R,L,_,U,j,A,$,D,N,H){let G=U||Kt(v,j),Z=j||A||un(G),ue=!ie&&!D;if(_){if(ue){let ce=Cr(H);se({navigation:G,...ce!==void 0?{actionData:ce}:{}},{flushSync:N})}let X=await pt(R,v.pathname,f.signal);if(X.type==="aborted")return{shortCircuited:!0};if(X.type==="error"){let ce=je(X.partialMatches).route.id;return{matches:X.partialMatches,loaderData:{},errors:{[ce]:X.error}}}else if(X.matches)R=X.matches;else{let{error:ce,notFoundMatches:gt,route:Qe}=Ht(v.pathname);return{matches:gt,loaderData:{},errors:{[Qe.id]:ce}}}}let ne=l||o,[ee,oe]=Kr(e.history,c,R,Z,v,D===!0,le,Se,I,y,ye,ne,s,H);if(Ne=++xe,ee.length===0&&oe.length===0){let X=_r();return Be(v,{matches:R,loaderData:{},errors:H&&de(H[1])?{[H[0]]:H[1].error}:null,...on(H),...X?{fetchers:new Map(c.fetchers)}:{}},{flushSync:N}),{shortCircuited:!0}}if(ue){let X={};if(!_){X.navigation=G;let ce=Cr(H);ce!==void 0&&(X.actionData=ce)}oe.length>0&&(X.fetchers=aa(oe)),se(X,{flushSync:N})}oe.forEach(X=>{_e(X.key),X.controller&&K.set(X.key,X.controller)});let Ye=()=>oe.forEach(X=>_e(X.key));O&&O.signal.addEventListener("abort",Ye);let{loaderResults:qe,fetcherResults:Pe}=await Pr(R,ee,oe,f,L);if(f.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",Ye),oe.forEach(X=>K.delete(X.key));let Ee=Et(qe);if(Ee)return await Ie(f,Ee.result,!0,{replace:$}),{shortCircuited:!0};if(Ee=Et(Pe),Ee)return ye.add(Ee.key),await Ie(f,Ee.result,!0,{replace:$}),{shortCircuited:!0};let{loaderData:zt,errors:Xe}=nn(c,R,qe,H,oe,Pe);D&&c.errors&&(Xe={...c.errors,...Xe});let Fe=_r(),yt=Dr(Ne),vt=Fe||yt||oe.length>0;return{matches:R,loaderData:zt,errors:Xe,...vt?{fetchers:new Map(c.fetchers)}:{}}}function Cr(f){if(f&&!de(f[1]))return{[f[0]]:f[1].data};if(c.actionData)return Object.keys(c.actionData).length===0?null:c.actionData}function aa(f){return f.forEach(v=>{let R=c.fetchers.get(v.key),L=rt(void 0,R?R.data:void 0);c.fetchers.set(v.key,L)}),new Map(c.fetchers)}async function oa(f,v,R,L){_e(f);let _=(L&&L.flushSync)===!0,U=l||o,j=er(c.location,c.matches,s,R,v,L==null?void 0:L.relative),A=Te(U,j,s),$=mt(A,U,j);if($.active&&$.matches&&(A=$.matches),!A){Ce(f,v,me(404,{pathname:j}),{flushSync:_});return}let{path:D,submission:N,error:H}=Jr(!0,j,L);if(H){Ce(f,v,H,{flushSync:_});return}let G=it(A,D),Z=new Wr(e.unstable_getContext?await e.unstable_getContext():void 0),ue=(L&&L.preventScrollReset)===!0;if(N&&ve(N.formMethod)){await ia(f,v,D,G,A,Z,$.active,_,ue,N);return}y.set(f,{routeId:v,path:D}),await la(f,v,D,G,A,Z,$.active,_,ue,N)}async function ia(f,v,R,L,_,U,j,A,$,D){jt(),y.delete(f);function N(ae){if(!ae.route.action&&!ae.route.lazy){let We=me(405,{method:D.formMethod,pathname:R,routeId:v});return Ce(f,v,We,{flushSync:A}),!0}return!1}if(!j&&N(L))return;let H=c.fetchers.get(f);Me(f,Bo(D,H),{flushSync:A});let G=new AbortController,Z=Ve(e.history,R,G.signal,D);if(j){let ae=await pt(_,R,Z.signal,f);if(ae.type==="aborted")return;if(ae.type==="error"){Ce(f,v,ae.error,{flushSync:A});return}else if(ae.matches){if(_=ae.matches,L=it(_,R),N(L))return}else{Ce(f,v,me(404,{pathname:R}),{flushSync:A});return}}K.set(f,G);let ue=xe,ee=(await Ke("action",Z,[L],_,U,f))[L.route.id];if(Z.signal.aborted){K.get(f)===G&&K.delete(f);return}if(I.has(f)){if(Ue(ee)||de(ee)){Me(f,De(void 0));return}}else{if(Ue(ee))if(K.delete(f),Ne>ue){Me(f,De(void 0));return}else return ye.add(f),Me(f,rt(D)),Ie(Z,ee,!1,{fetcherSubmission:D,preventScrollReset:$});if(de(ee)){Ce(f,v,ee.error);return}}let oe=c.navigation.location||c.location,Ye=Ve(e.history,oe,G.signal),qe=l||o,Pe=c.navigation.state!=="idle"?Te(qe,c.navigation.location,s):c.matches;Y(Pe,"Didn't find any matches after fetcher action");let Ee=++xe;Le.set(f,Ee);let zt=rt(D,ee.data);c.fetchers.set(f,zt);let[Xe,Fe]=Kr(e.history,c,Pe,D,oe,!1,le,Se,I,y,ye,qe,s,[L.route.id,ee]);Fe.filter(ae=>ae.key!==f).forEach(ae=>{let We=ae.key,$r=c.fetchers.get(We),ma=rt(void 0,$r?$r.data:void 0);c.fetchers.set(We,ma),_e(We),ae.controller&&K.set(We,ae.controller)}),se({fetchers:new Map(c.fetchers)});let yt=()=>Fe.forEach(ae=>_e(ae.key));G.signal.addEventListener("abort",yt);let{loaderResults:vt,fetcherResults:X}=await Pr(Pe,Xe,Fe,Ye,U);if(G.signal.aborted)return;G.signal.removeEventListener("abort",yt),Le.delete(f),K.delete(f),Fe.forEach(ae=>K.delete(ae.key));let ce=Et(vt);if(ce)return Ie(Ye,ce.result,!1,{preventScrollReset:$});if(ce=Et(X),ce)return ye.add(ce.key),Ie(Ye,ce.result,!1,{preventScrollReset:$});let{loaderData:gt,errors:Qe}=nn(c,Pe,vt,void 0,Fe,X);if(c.fetchers.has(f)){let ae=De(ee.data);c.fetchers.set(f,ae)}Dr(Ee),c.navigation.state==="loading"&&Ee>Ne?(Y(M,"Expected pending action"),O&&O.abort(),Be(c.navigation.location,{matches:Pe,loaderData:gt,errors:Qe,fetchers:new Map(c.fetchers)})):(se({errors:Qe,loaderData:an(c.loaderData,gt,Pe,Qe),fetchers:new Map(c.fetchers)}),le=!1)}async function la(f,v,R,L,_,U,j,A,$,D){let N=c.fetchers.get(f);Me(f,rt(D,N?N.data:void 0),{flushSync:A});let H=new AbortController,G=Ve(e.history,R,H.signal);if(j){let ee=await pt(_,R,G.signal,f);if(ee.type==="aborted")return;if(ee.type==="error"){Ce(f,v,ee.error,{flushSync:A});return}else if(ee.matches)_=ee.matches,L=it(_,R);else{Ce(f,v,me(404,{pathname:R}),{flushSync:A});return}}K.set(f,H);let Z=xe,ne=(await Ke("loader",G,[L],_,U,f))[L.route.id];if(K.get(f)===H&&K.delete(f),!G.signal.aborted){if(I.has(f)){Me(f,De(void 0));return}if(Ue(ne))if(Ne>Z){Me(f,De(void 0));return}else{ye.add(f),await Ie(G,ne,!1,{preventScrollReset:$});return}if(de(ne)){Ce(f,v,ne.error);return}Me(f,De(ne.data))}}async function Ie(f,v,R,{submission:L,fetcherSubmission:_,preventScrollReset:U,replace:j}={}){v.response.headers.has("X-Remix-Revalidate")&&(le=!0);let A=v.response.headers.get("Location");Y(A,"Expected a Location header on the redirect Response"),A=tn(A,new URL(f.url),s);let $=lt(c.location,A,{_isRedirect:!0});if(r){let ue=!1;if(v.response.headers.has("X-Remix-Reload-Document"))ue=!0;else if(ur.test(A)){const ne=e.history.createURL(A);ue=ne.origin!==t.location.origin||he(ne.pathname,s)==null}if(ue){j?t.location.replace(A):t.location.assign(A);return}}O=null;let D=j===!0||v.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:N,formAction:H,formEncType:G}=c.navigation;!L&&!_&&N&&H&&G&&(L=un(c.navigation));let Z=L||_;if(Lo.has(v.response.status)&&Z&&ve(Z.formMethod))await $e(D,$,{submission:{...Z,formAction:A},preventScrollReset:U||k,enableViewTransition:R?z:void 0});else{let ue=Kt($,L);await $e(D,$,{overrideNavigation:ue,fetcherSubmission:_,preventScrollReset:U||k,enableViewTransition:R?z:void 0})}}async function Ke(f,v,R,L,_,U){let j,A={};try{j=await Ao(i,f,v,R,L,U,n,a,_)}catch($){return R.forEach(D=>{A[D.route.id]={type:"error",error:$}}),A}for(let[$,D]of Object.entries(j))if(Uo(D)){let N=D.result;A[$]={type:"redirect",response:Io(N,v,$,L,s)}}else A[$]=await $o(D);return A}async function Pr(f,v,R,L,_){let U=Ke("loader",L,v,f,_,null),j=Promise.all(R.map(async D=>{if(D.matches&&D.match&&D.controller){let H=(await Ke("loader",Ve(e.history,D.path,D.controller.signal),[D.match],D.matches,_,D.key))[D.match.route.id];return{[D.key]:H}}else return Promise.resolve({[D.key]:{type:"error",error:me(404,{pathname:D.path})}})})),A=await U,$=(await j).reduce((D,N)=>Object.assign(D,N),{});return{loaderResults:A,fetcherResults:$}}function jt(){le=!0,y.forEach((f,v)=>{K.has(v)&&Se.add(v),_e(v)})}function Me(f,v,R={}){c.fetchers.set(f,v),se({fetchers:new Map(c.fetchers)},{flushSync:(R&&R.flushSync)===!0})}function Ce(f,v,R,L={}){let _=je(c.matches,v);Ut(f),se({errors:{[_.route.id]:R},fetchers:new Map(c.fetchers)},{flushSync:(L&&L.flushSync)===!0})}function Tr(f){return x.set(f,(x.get(f)||0)+1),I.has(f)&&I.delete(f),c.fetchers.get(f)||Co}function Ut(f){let v=c.fetchers.get(f);K.has(f)&&!(v&&v.state==="loading"&&Le.has(f))&&_e(f),y.delete(f),Le.delete(f),ye.delete(f),I.delete(f),Se.delete(f),c.fetchers.delete(f)}function sa(f){let v=(x.get(f)||0)-1;v<=0?(x.delete(f),I.add(f)):x.set(f,v),se({fetchers:new Map(c.fetchers)})}function _e(f){let v=K.get(f);v&&(v.abort(),K.delete(f))}function Mr(f){for(let v of f){let R=Tr(v),L=De(R.data);c.fetchers.set(v,L)}}function _r(){let f=[],v=!1;for(let R of ye){let L=c.fetchers.get(R);Y(L,`Expected fetcher: ${R}`),L.state==="loading"&&(ye.delete(R),f.push(R),v=!0)}return Mr(f),v}function Dr(f){let v=[];for(let[R,L]of Le)if(L<f){let _=c.fetchers.get(R);Y(_,`Expected fetcher: ${R}`),_.state==="loading"&&(_e(R),Le.delete(R),v.push(R))}return Mr(v),v.length>0}function ua(f,v){let R=c.blockers.get(f)||tt;return F.get(f)!==v&&F.set(f,v),R}function Or(f){c.blockers.delete(f),F.delete(f)}function ht(f,v){let R=c.blockers.get(f)||tt;Y(R.state==="unblocked"&&v.state==="blocked"||R.state==="blocked"&&v.state==="blocked"||R.state==="blocked"&&v.state==="proceeding"||R.state==="blocked"&&v.state==="unblocked"||R.state==="proceeding"&&v.state==="unblocked",`Invalid blocker state transition: ${R.state} -> ${v.state}`);let L=new Map(c.blockers);L.set(f,v),se({blockers:L})}function kr({currentLocation:f,nextLocation:v,historyAction:R}){if(F.size===0)return;F.size>1&&re(!1,"A router only supports one blocker at a time");let L=Array.from(F.entries()),[_,U]=L[L.length-1],j=c.blockers.get(_);if(!(j&&j.state==="proceeding")&&U({currentLocation:f,nextLocation:v,historyAction:R}))return _}function Ht(f){let v=me(404,{pathname:f}),R=l||o,{matches:L,route:_}=ln(R);return{notFoundMatches:L,route:_,error:v}}function ca(f,v,R){if(p=f,w=v,g=R||null,!b&&c.navigation===Gt){b=!0;let L=Nr(c.location,c.matches);L!=null&&se({restoreScrollPosition:L})}return()=>{p=null,w=null,g=null}}function Ar(f,v){return g&&g(f,v.map(L=>Rn(L,c.loaderData)))||f.key}function da(f,v){if(p&&w){let R=Ar(f,v);p[R]=w()}}function Nr(f,v){if(p){let R=Ar(f,v),L=p[R];if(typeof L=="number")return L}return null}function mt(f,v,R){if(e.patchRoutesOnNavigation)if(f){if(Object.keys(f[0].params).length>0)return{active:!0,matches:Ct(v,R,s,!0)}}else return{active:!0,matches:Ct(v,R,s,!0)||[]};return{active:!1,matches:null}}async function pt(f,v,R,L){if(!e.patchRoutesOnNavigation)return{type:"success",matches:f};let _=f;for(;;){let U=l==null,j=l||o,A=n;try{await e.patchRoutesOnNavigation({signal:R,path:v,matches:_,fetcherKey:L,patch:(N,H)=>{R.aborted||Xr(N,H,j,A,a)}})}catch(N){return{type:"error",error:N,partialMatches:_}}finally{U&&!R.aborted&&(o=[...o])}if(R.aborted)return{type:"aborted"};let $=Te(j,v,s);if($)return{type:"success",matches:$};let D=Ct(j,v,s,!0);if(!D||_.length===D.length&&_.every((N,H)=>N.route.id===D[H].route.id))return{type:"success",matches:null};_=D}}function fa(f){n={},l=Dt(f,a,void 0,n)}function ha(f,v){let R=l==null;Xr(f,v,l||o,n,a),R&&(o=[...o],se({}))}return T={get basename(){return s},get future(){return u},get state(){return c},get routes(){return o},get window(){return t},initialize:V,subscribe:te,enableScrollRestoration:ca,navigate:Lr,fetch:oa,revalidate:ta,createHref:f=>e.history.createHref(f),encodeLocation:f=>e.history.encodeLocation(f),getFetcher:Tr,deleteFetcher:sa,dispose:we,getBlocker:ua,deleteBlocker:Or,patchRoutes:ha,_internalFetchControllers:K,_internalSetRoutes:fa},T}function To(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function er(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=sr(a||".",lr(l),he(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=dr(i.search);if(s.route.index&&!u)i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let d=new URLSearchParams(i.search),m=d.getAll("index");d.delete("index"),m.filter(g=>g).forEach(g=>d.append("index",g));let p=d.toString();i.search=p?`?${p}`:""}}return r!=="/"&&(i.pathname=i.pathname==="/"?r:Re([r,i.pathname])),Oe(i)}function Jr(e,t,r){if(!r||!To(r))return{path:t};if(r.formMethod&&!Ho(r.formMethod))return{path:t,error:me(405,{method:r.formMethod})};let a=()=>({path:t,error:me(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),l=On(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ve(o))return a();let m=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,[g,w])=>`${p}${g}=${w}
28
+ `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:m}}}else if(r.formEncType==="application/json"){if(!ve(o))return a();try{let m=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:m,text:void 0}}}catch{return a()}}}Y(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=rn(s);else if(r.body==null)s=new URLSearchParams,i=new FormData;else try{s=new URLSearchParams(r.body),i=rn(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 d=Ae(t);return e&&d.search&&dr(d.search)&&s.append("index",""),d.search=`?${s}`,{path:Oe(d),submission:u}}function Gr(e,t,r=!1){let a=e.findIndex(n=>n.route.id===t);return a>=0?e.slice(0,r?a+1:a):e}function Kr(e,t,r,a,n,o,l,s,i,u,d,m,p,g){let w=g?de(g[1])?g[1].error:g[1].data:void 0,b=e.createURL(t.location),E=e.createURL(n),S=r;o&&t.errors?S=Gr(r,Object.keys(t.errors)[0],!0):g&&de(g[1])&&(S=Gr(r,g[0]));let C=g?g[1].statusCode:void 0,P=C&&C>=400,T=S.filter((M,k)=>{let{route:O}=M;if(O.lazy)return!0;if(O.loader==null)return!1;if(o)return tr(O,t.loaderData,t.errors);if(Mo(t.loaderData,t.matches[k],M))return!0;let z=t.matches[k],J=M;return qr(M,{currentUrl:b,currentParams:z.params,nextUrl:E,nextParams:J.params,...a,actionResult:w,actionStatus:C,defaultShouldRevalidate:P?!1:l||b.pathname+b.search===E.pathname+E.search||b.search!==E.search||_o(z,J)})}),c=[];return u.forEach((M,k)=>{if(o||!r.some(ie=>ie.route.id===M.routeId)||i.has(k))return;let O=Te(m,M.path,p);if(!O){c.push({key:k,routeId:M.routeId,path:M.path,matches:null,match:null,controller:null});return}let z=t.fetchers.get(k),J=it(O,M.path),Q=!1;d.has(k)?Q=!1:s.has(k)?(s.delete(k),Q=!0):z&&z.state!=="idle"&&z.data===void 0?Q=l:Q=qr(J,{currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:E,nextParams:r[r.length-1].params,...a,actionResult:w,actionStatus:C,defaultShouldRevalidate:P?!1:l}),Q&&c.push({key:k,routeId:M.routeId,path:M.path,matches:O,match:J,controller:new AbortController})}),[T,c]}function tr(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let a=t!=null&&t[e.id]!==void 0,n=r!=null&&r[e.id]!==void 0;return!a&&n?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!n}function Mo(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function _o(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function qr(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];Y(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=>Tn(i,u))),s=Dt(l,n,[e||"_","patch",String((o==null?void 0:o.length)||"0")],a);o.push(...s)}function Tn(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=>Tn(r,o))}):!1}var Qr=new WeakMap,Mn=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];if(Y(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=qa(e),m=n[e]!==void 0&&e!=="hasErrorBoundary";if(u)re(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(m)re(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let p=await o();p!=null&&(Object.assign(n,{[e]:p}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(p=>p===void 0)&&(n.lazy=void 0))})();return l[e]=i,i},Zr=new WeakMap;function Do(e,t,r,a){let n=r[e.id];if(Y(n,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let u=Zr.get(n);if(u)return{lazyRoutePromise:u,lazyHandlerPromise:u};let d=(async()=>{Y(typeof e.lazy=="function","No lazy route function found");let m=await e.lazy(),p={};for(let g in m){let w=m[g];if(w===void 0)continue;let b=Qa(g),S=n[g]!==void 0&&g!=="hasErrorBoundary";b?re(!b,"Route property "+g+" is not a supported property to be returned from a lazy route function. This property will be ignored."):S?re(!S,`Route "${n.id}" has a static property "${g}" defined but its lazy function is also returning a value for this property. The lazy route property "${g}" will be ignored.`):p[g]=w}Object.assign(n,p),Object.assign(n,{...a(n),lazy:void 0})})();return Zr.set(n,d),{lazyRoutePromise:d,lazyHandlerPromise:d}}let o=Object.keys(e.lazy),l=[],s;for(let u of o){let d=Mn({key:u,route:e,manifest:r,mapRouteProperties:a});d&&(l.push(d),u===t&&(s=d))}return{lazyRoutePromise:Promise.all(l).then(()=>{}),lazyHandlerPromise:s}}function _n(e){return e!==void 0}function Oo(e,t,r){let a=e.map(({route:n})=>{if(!(typeof n.lazy!="object"||!n.lazy.unstable_middleware))return Mn({key:"unstable_middleware",route:n,manifest:t,mapRouteProperties:r})}).filter(_n);return a.length>0?Promise.all(a):void 0}async function en(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 ko(e){return e.matches.some(t=>t.route.unstable_middleware)?ot(e,!1,()=>en(e),(t,r)=>({[r]:{type:"error",result:t}})):en(e)}async function ot(e,t,r,a){let{matches:n,request:o,params:l,context:s}=e,i={handlerResult:void 0};try{let u=n.flatMap(m=>m.route.unstable_middleware?m.route.unstable_middleware.map(p=>[m.route.id,p]):[]),d=await Dn({request:o,params:l,context:s},u,t,i,r);return t?d:i.handlerResult}catch(u){if(!i.middlewareError)throw u;let d=await a(i.middlewareError.error,i.middlewareError.routeId);return i.handlerResult?Object.assign(i.handlerResult,d):d}}async function Dn(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,d=!1,m,p=async()=>{if(d)throw new Error("You may only call `next()` once per middleware");d=!0,await Dn(e,t,r,a,n,o+1)};try{let g=await u({request:e.request,params:e.params,context:e.context},p);return d?g===void 0?m:g:p()}catch(g){throw a.middlewareError?a.middlewareError.error!==g&&(a.middlewareError={routeId:i,error:g}):a.middlewareError={routeId:i,error:g},g}}async function Ao(e,t,r,a,n,o,l,s,i){let u=Oo(n,l,s),d=n.map(w=>Do(w.route,t,l,s));u&&await u;let m=n.map((w,b)=>{let{lazyRoutePromise:E,lazyHandlerPromise:S}=d[b],C=a.some(T=>T.route.id===w.route.id);return{...w,shouldLoad:C,resolve:async T=>(T&&r.method==="GET"&&(w.route.lazy||w.route.loader)&&(C=!0),C?No({type:t,request:r,match:w,lazyHandlerPromise:S,lazyRoutePromise:E,handlerOverride:T,scopedContext:i}):Promise.resolve({type:"data",result:void 0}))}}),p=await e({matches:m,request:r,params:n[0].params,fetcherKey:o,context:i}),g=d.flatMap(w=>Object.values(w).filter(_n));try{await Promise.all(g)}catch{}return p}async function No({type:e,request:t,match:r,lazyHandlerPromise:a,lazyRoutePromise:n,handlerOverride:o,scopedContext:l}){let s,i,u=d=>{let m,p=new Promise((b,E)=>m=E);i=()=>m(),t.signal.addEventListener("abort",i);let g=b=>typeof d!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${e}" [routeId: ${r.route.id}]`)):d({request:t,params:r.params,context:l},...b!==void 0?[b]:[]),w=(async()=>{try{return{type:"data",result:await(o?o(E=>g(E)):g())}}catch(b){return{type:"error",result:b}}})();return Promise.race([w,p])};try{let d=r.route[e];if(a||n)if(d){let m,[p]=await Promise.all([u(d).catch(g=>{m=g}),a,n]);if(m!==void 0)throw m;s=p}else if(await a,d=r.route[e],d)[s]=await Promise.all([u(d),n]);else if(e==="action"){let m=new URL(t.url),p=m.pathname+m.search;throw me(405,{method:t.method,pathname:p,routeId:r.route.id})}else return{type:"data",result:void 0};else if(d)s=await u(d);else{let m=new URL(t.url),p=m.pathname+m.search;throw me(404,{pathname:p})}}catch(d){return{type:"error",result:d}}finally{i&&t.signal.removeEventListener("abort",i)}return s}async function $o(e){var a,n,o,l,s,i;let{result:t,type:r}=e;if(cr(t)){let u;try{let d=t.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(d){return{type:"error",error:d}}return r==="error"?{type:"error",error:new ke(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:"data",data:u,statusCode:t.status,headers:t.headers}}return r==="error"?sn(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 ke(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:He(t)?t.status:void 0,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:He(t)?t.status:void 0}:sn(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 Io(e,t,r,a,n){let o=e.headers.get("Location");if(Y(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!ur.test(o)){let l=a.slice(0,a.findIndex(s=>s.route.id===r)+1);o=er(new URL(t.url),l,n,o),e.headers.set("Location",o)}return e}function tn(e,t,r){if(ur.test(e)){let a=e,n=a.startsWith("//")?new URL(t.protocol+a):new URL(a),o=he(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(On(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 rn(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function Fo(e,t,r,a=!1,n=!1){let o={},l=null,s,i=!1,u={},d=r&&de(r[1])?r[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let p=m.route.id,g=t[p];if(Y(!Ue(g),"Cannot handle redirect results in processLoaderData"),de(g)){let w=g.error;if(d!==void 0&&(w=d,d=void 0),l=l||{},n)l[p]=w;else{let b=je(e,p);l[b.route.id]==null&&(l[b.route.id]=w)}a||(o[p]=Pn),i||(i=!0,s=He(g.error)?g.error.status:500),g.headers&&(u[p]=g.headers)}else o[p]=g.data,g.statusCode&&g.statusCode!==200&&!i&&(s=g.statusCode),g.headers&&(u[p]=g.headers)}),d!==void 0&&r&&(l={[r[0]]:d},o[r[0]]=void 0),{loaderData:o,errors:l,statusCode:s||200,loaderHeaders:u}}function nn(e,t,r,a,n,o){let{loaderData:l,errors:s}=Fo(t,r,a);return n.forEach(i=>{let{key:u,match:d,controller:m}=i,p=o[u];if(Y(p,"Did not find corresponding fetcher result"),!(m&&m.signal.aborted))if(de(p)){let g=je(e.matches,d==null?void 0:d.route.id);s&&s[g.route.id]||(s={...s,[g.route.id]:p.error}),e.fetchers.delete(u)}else if(Ue(p))Y(!1,"Unhandled fetcher revalidation redirect");else{let g=De(p.data);e.fetchers.set(u,g)}}),{loaderData:l,errors:s}}function an(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==Pn).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 on(e){return e?de(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function je(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 ln(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 me(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 ke(e||500,l,new Error(s),!0)}function Et(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 On(e){let t=typeof e=="string"?Ae(e):e;return Oe({...t,hash:""})}function jo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Uo(e){return cr(e.result)&&xo.has(e.result.status)}function de(e){return e.type==="error"}function Ue(e){return(e&&e.type)==="redirect"}function sn(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function cr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Ho(e){return So.has(e.toUpperCase())}function ve(e){return Ro.has(e.toUpperCase())}function dr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function it(e,t){let r=typeof t=="string"?Ae(t).search:t.search;if(e[e.length-1].route.index&&dr(r||""))return e[e.length-1];let a=xn(e);return a[a.length-1]}function un(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 Kt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function zo(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 rt(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 Bo(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 De(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 Yo(e,t){try{let r=e.sessionStorage.getItem(Cn);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 Wo(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(Cn,JSON.stringify(r))}catch(a){re(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function Vo(){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 ze=h.createContext(null);ze.displayName="DataRouter";var Je=h.createContext(null);Je.displayName="DataRouterState";var fr=h.createContext({isTransitioning:!1});fr.displayName="ViewTransition";var kn=h.createContext(new Map);kn.displayName="Fetchers";var Jo=h.createContext(null);Jo.displayName="Await";var pe=h.createContext(null);pe.displayName="Navigation";var At=h.createContext(null);At.displayName="Location";var ge=h.createContext({outlet:null,matches:[],isDataRoute:!1});ge.displayName="Route";var hr=h.createContext(null);hr.displayName="RouteError";function Go(e,{relative:t}={}){Y(st(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=h.useContext(pe),{hash:n,pathname:o,search:l}=ut(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:Re([r,o])),a.createHref({pathname:s,search:l,hash:n})}function st(){return h.useContext(At)!=null}function be(){return Y(st(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(At).location}var An="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Nn(e){h.useContext(pe).static||h.useLayoutEffect(e)}function Ko(){let{isDataRoute:e}=h.useContext(ge);return e?ui():qo()}function qo(){Y(st(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(ze),{basename:t,navigator:r}=h.useContext(pe),{matches:a}=h.useContext(ge),{pathname:n}=be(),o=JSON.stringify(lr(a)),l=h.useRef(!1);return Nn(()=>{l.current=!0}),h.useCallback((i,u={})=>{if(re(l.current,An),!l.current)return;if(typeof i=="number"){r.go(i);return}let d=sr(i,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Re([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,o,n,e])}var Xo=h.createContext(null);function Qo(e){let t=h.useContext(ge).outlet;return t&&h.createElement(Xo.Provider,{value:e},t)}function yl(){let{matches:e}=h.useContext(ge),t=e[e.length-1];return t?t.params:{}}function ut(e,{relative:t}={}){let{matches:r}=h.useContext(ge),{pathname:a}=be(),n=JSON.stringify(lr(r));return h.useMemo(()=>sr(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Zo(e,t,r,a){Y(st(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n,static:o}=h.useContext(pe),{matches:l}=h.useContext(ge),s=l[l.length-1],i=s?s.params:{},u=s?s.pathname:"/",d=s?s.pathnameBase:"/",m=s&&s.route;{let C=m&&m.path||"";Fn(u,!m||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${C}">) 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.
29
+
30
+ Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let p=be(),g;g=p;let w=g.pathname||"/",b=w;if(d!=="/"){let C=d.replace(/^\//,"").split("/");b="/"+w.replace(/^\//,"").split("/").slice(C.length).join("/")}let E=!o&&r&&r.matches&&r.matches.length>0?r.matches:Te(e,{pathname:b});return re(m||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),re(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.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.`),ai(E&&E.map(C=>Object.assign({},C,{params:Object.assign({},i,C.params),pathname:Re([d,n.encodeLocation?n.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?d:Re([d,n.encodeLocation?n.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),l,r,a)}function ei(){let e=In(),t=He(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},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 ti=h.createElement(ei,null),ri=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(ge.Provider,{value:this.props.routeContext},h.createElement(hr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ni({routeContext:e,match:t,children:r}){let a=h.useContext(ze);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(ge.Provider,{value:e},r)}function ai(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);Y(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:d,errors:m}=r,p=u.route.loader&&!d.hasOwnProperty(u.route.id)&&(!m||m[u.route.id]===void 0);if(u.route.lazy||p){l=!0,s>=0?n=n.slice(0,s+1):n=[n[0]];break}}}return n.reduceRight((i,u,d)=>{let m,p=!1,g=null,w=null;r&&(m=o&&u.route.id?o[u.route.id]:void 0,g=u.route.errorElement||ti,l&&(s<0&&d===0?(Fn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,w=null):s===d&&(p=!0,w=u.route.hydrateFallbackElement||null)));let b=t.concat(n.slice(0,d+1)),E=()=>{let S;return m?S=g:p?S=w:u.route.Component?S=h.createElement(u.route.Component,null):u.route.element?S=u.route.element:S=i,h.createElement(ni,{match:u,routeContext:{outlet:i,matches:b,isDataRoute:r!=null},children:S})};return r&&(u.route.ErrorBoundary||u.route.errorElement||d===0)?h.createElement(ri,{location:r.location,revalidation:r.revalidation,component:g,error:m,children:E(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):E()},null)}function mr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function oi(e){let t=h.useContext(ze);return Y(t,mr(e)),t}function ct(e){let t=h.useContext(Je);return Y(t,mr(e)),t}function ii(e){let t=h.useContext(ge);return Y(t,mr(e)),t}function dt(e){let t=ii(e),r=t.matches[t.matches.length-1];return Y(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function li(){return dt("useRouteId")}function si(){return ct("useNavigation").navigation}function $n(){let{matches:e,loaderData:t}=ct("useMatches");return h.useMemo(()=>e.map(r=>Rn(r,t)),[e,t])}function vl(){let e=ct("useLoaderData"),t=dt("useLoaderData");return e.loaderData[t]}function gl(){let e=ct("useActionData"),t=dt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function In(){var a;let e=h.useContext(hr),t=ct("useRouteError"),r=dt("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[r]}function ui(){let{router:e}=oi("useNavigate"),t=dt("useNavigate"),r=h.useRef(!1);return Nn(()=>{r.current=!0}),h.useCallback(async(n,o={})=>{re(r.current,An),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var cn={};function Fn(e,t,r){!t&&!cn[e]&&(cn[e]=!0,re(!1,r))}var dn={};function fn(e,t){!e&&!dn[t]&&(dn[t]=!0,console.warn(t))}function wl(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&re(!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&&re(!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&&re(!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 ci=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 El({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(),[d,m]=h.useState(),[p,g]=h.useState(),w=h.useRef(new Map),b=h.useCallback((P,{deletedFetchers:T,flushSync:c,viewTransitionOpts:M})=>{P.fetchers.forEach((O,z)=>{O.data!==void 0&&w.current.set(z,O.data)}),T.forEach(O=>w.current.delete(O)),fn(c===!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 k=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(fn(M==null||k,"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."),!M||!k){t&&c?t(()=>a(P)):h.startTransition(()=>a(P));return}if(t&&c){t(()=>{d&&(i&&i.resolve(),d.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let O=e.window.document.startViewTransition(()=>{t(()=>a(P))});O.finished.finally(()=>{t(()=>{u(void 0),m(void 0),o(void 0),s({isTransitioning:!1})})}),t(()=>m(O));return}d?(i&&i.resolve(),d.skipTransition(),g({state:P,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(o(P),s({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[e.window,t,d,i]);h.useLayoutEffect(()=>e.subscribe(b),[e,b]),h.useEffect(()=>{l.isTransitioning&&!l.flushSync&&u(new ci)},[l]),h.useEffect(()=>{if(i&&n&&e.window){let P=n,T=i.promise,c=e.window.document.startViewTransition(async()=>{h.startTransition(()=>a(P)),await T});c.finished.finally(()=>{u(void 0),m(void 0),o(void 0),s({isTransitioning:!1})}),m(c)}},[n,i,e.window]),h.useEffect(()=>{i&&n&&r.location.key===n.location.key&&i.resolve()},[i,d,r.location,n]),h.useEffect(()=>{!l.isTransitioning&&p&&(o(p.state),s({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),g(void 0))},[l.isTransitioning,p]);let E=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,T,c)=>e.navigate(P,{state:T,preventScrollReset:c==null?void 0:c.preventScrollReset}),replace:(P,T,c)=>e.navigate(P,{replace:!0,state:T,preventScrollReset:c==null?void 0:c.preventScrollReset})}),[e]),S=e.basename||"/",C=h.useMemo(()=>({router:e,navigator:E,static:!1,basename:S}),[e,E,S]);return h.createElement(h.Fragment,null,h.createElement(ze.Provider,{value:C},h.createElement(Je.Provider,{value:r},h.createElement(kn.Provider,{value:w.current},h.createElement(fr.Provider,{value:l},h.createElement(hi,{basename:S,location:r.location,navigationType:r.historyAction,navigator:E},h.createElement(di,{routes:e.routes,future:e.future,state:r})))))),null)}var di=h.memo(fi);function fi({routes:e,future:t,state:r}){return Zo(e,void 0,r,t)}function Rl(e){return Qo(e.context)}function hi({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){Y(!st(),"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=Ae(r));let{pathname:i="/",search:u="",hash:d="",state:m=null,key:p="default"}=r,g=h.useMemo(()=>{let w=he(i,l);return w==null?null:{location:{pathname:w,search:u,hash:d,state:m,key:p},navigationType:a}},[l,i,u,d,m,p,a]);return re(g!=null,`<Router basename="${l}"> is not able to match the URL "${i}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:h.createElement(pe.Provider,{value:s},h.createElement(At.Provider,{children:t,value:g}))}var Pt="get",Tt="application/x-www-form-urlencoded";function Nt(e){return e!=null&&typeof e.tagName=="string"}function mi(e){return Nt(e)&&e.tagName.toLowerCase()==="button"}function pi(e){return Nt(e)&&e.tagName.toLowerCase()==="form"}function yi(e){return Nt(e)&&e.tagName.toLowerCase()==="input"}function vi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function gi(e,t){return e.button===0&&(!t||t==="_self")&&!vi(e)}var Rt=null;function wi(){if(Rt===null)try{new FormData(document.createElement("form"),0),Rt=!1}catch{Rt=!0}return Rt}var Ei=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function qt(e){return e!=null&&!Ei.has(e)?(re(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tt}"`),null):e}function Ri(e,t){let r,a,n,o,l;if(pi(e)){let s=e.getAttribute("action");a=s?he(s,t):null,r=e.getAttribute("method")||Pt,n=qt(e.getAttribute("enctype"))||Tt,o=new FormData(e)}else if(mi(e)||yi(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?he(i,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Pt,n=qt(e.getAttribute("formenctype"))||qt(s.getAttribute("enctype"))||Tt,o=new FormData(s,e),!wi()){let{name:u,type:d,value:m}=e;if(d==="image"){let p=u?`${u}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else u&&o.append(u,m)}}else{if(Nt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Pt,a=null,n=Tt,l=e}return o&&n==="text/plain"&&(l=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:l}}function fe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function jn(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 bi(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=yr(e,r);return Bn(a,n)}function Un(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function Si(e){if(!e.css)return;let t=Un(e);await Promise.all(t.map(zn))}async function Hn(e,t){if(!e.css&&!t.links||!Ti())return;let r=[];if(e.css&&r.push(...Un(e)),t.links&&r.push(...t.links()),r.length===0)return;let a=[];for(let n of r)!pr(n)&&n.rel==="stylesheet"&&a.push({...n,rel:"preload",as:"style"});await Promise.all(a.map(zn))}async function zn(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 pr(e){return e!=null&&typeof e.page=="string"}function xi(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 Li(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let l=await jn(o,r);return l.links?l.links():[]}return[]}));return Bn(a.flat(1).filter(xi).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function hn(e,t,r,a,n,o){let l=(i,u)=>r[u]?i.route.id!==r[u].route.id:!0,s=(i,u)=>{var d;return r[u].pathname!==i.pathname||((d=r[u].route.path)==null?void 0:d.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 m;let d=a.routes[i.route.id];if(!d||!d.hasLoader)return!1;if(l(i,u)||s(i,u))return!0;if(i.route.shouldRevalidate){let p=i.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:((m=r[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:i.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function yr(e,t,{includeHydrateFallback:r}={}){return Ci(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 Ci(e){return[...new Set(e)]}function Pi(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Bn(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!pr(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let s=JSON.stringify(Pi(o));return r.has(s)||(r.add(s),n.push({key:s,link:o})),n},[])}var bt;function Ti(){if(bt!==void 0)return bt;let e=document.createElement("link");return bt=e.relList.supports("preload"),e=null,bt}function mn(e){return{__html:e}}async function $t(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 Yn=Symbol("SingleFetchRedirect");function St(e,t){return{[t]:{type:"error",result:e}}}function bl(e,t,r,a,n){return async o=>{let{request:l,matches:s,fetcherKey:i}=o;return l.method!=="GET"?ot(o,!1,()=>Mi(l,s,a),St):!r&&!s.some(d=>{var m,p;return d.shouldLoad&&((m=e.routes[d.route.id])==null?void 0:m.hasLoader)&&!((p=e.routes[d.route.id])!=null&&p.hasClientLoader)})?ot(o,!1,()=>_i(e,l,s,a),St):i?ot(o,!1,()=>Oi(l,s,a),St):ot(o,!1,()=>Di(e,t,r,n(),l,s,a),St)}}async function Mi(e,t,r){let a=t.find(l=>l.shouldLoad);fe(a,"No action match found");let n,o=await a.resolve(async l=>await l(async()=>{let i=ft(e.url,r),u=await $t(e),{data:d,status:m}=await wr(i,u);return n=m,nr(d,a.route.id)}));return cr(o.result)||He(o.result)?{[a.route.id]:o}:{[a.route.id]:{type:o.type,result:wo(o.result,n)}}}async function _i(e,t,r,a){let n=r.filter(i=>i.shouldLoad),o=gr(ft(t.url,a)),l=await $t(t),s={};return await Promise.all(n.map(i=>i.resolve(async u=>{var d;try{let m=(d=e.routes[i.route.id])!=null&&d.hasClientLoader?await vr(u,o,l,i.route.id):await u();s[i.route.id]={type:"data",result:m}}catch(m){s[i.route.id]={type:"error",result:m}}}))),s}async function Di(e,t,r,a,n,o,l){let s=new Set,i=!1,u=o.map(()=>pn()),d=Promise.all(u.map(E=>E.promise)),m=pn(),p=gr(ft(n.url,l)),g=await $t(n),w={},b=Promise.all(o.map(async(E,S)=>E.resolve(async C=>{u[S].resolve();let P=e.routes[E.route.id];if(!E.shouldLoad){if(!a.state.initialized)return;if(E.route.id in a.state.loaderData&&P&&E.route.shouldRevalidate){P.hasLoader&&(i=!0);return}}if(P&&P.hasClientLoader){P.hasLoader&&(i=!0);try{let T=await vr(C,p,g,E.route.id);w[E.route.id]={type:"data",result:T}}catch(T){w[E.route.id]={type:"error",result:T}}return}P&&P.hasLoader&&s.add(E.route.id);try{let T=await C(async()=>{let c=await m.promise;return Wn(c,E.route.id)});w[E.route.id]={type:"data",result:T}}catch(T){w[E.route.id]={type:"error",result:T}}})));if(await d,(!a.state.initialized||s.size===0)&&!window.__reactRouterHdrActive)m.resolve({});else try{r&&i&&s.size>0&&p.searchParams.set("_routes",o.filter(S=>s.has(S.route.id)).map(S=>S.route.id).join(","));let E=await wr(p,g);m.resolve(E.data)}catch(E){m.reject(E)}return await b,w}async function Oi(e,t,r){let a=t.find(o=>o.shouldLoad);fe(a,"No fetcher match found");let n=await a.resolve(async o=>{let l=gr(ft(e.url,r)),s=await $t(e);return vr(o,l,s,a.route.id)});return{[a.route.id]:n}}function vr(e,t,r,a){return e(async()=>{let n=new URL(t);n.searchParams.set("_routes",a);let{data:o}=await wr(n,r);return Wn(o,a)})}function gr(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 ft(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&&he(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}async function wr(e,t){let r=await fetch(e,t);if(r.status===404&&!r.headers.has("X-Remix-Response"))throw new ke(404,"Not Found",!0);if(new Set([100,101,204,205]).has(r.status))return!t.method||t.method==="GET"?{status:r.status,data:{}}:{status:r.status,data:{data:void 0}};fe(r.body,"No response body to decode");try{let n=await ki(r.body,window);return{status:r.status,data:n.value}}catch{throw new Error("Unable to decode turbo-stream response")}}function ki(e,t){return Ha(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 ke(o,l,n)}}if(r==="SingleFetchRedirect")return{value:{[Yn]:a[0]}};if(r==="SingleFetchClassInstance")return{value:a[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function Wn(e,t){let r=e[Yn];return r?nr(r,t):e[t]!==void 0?nr(e[t],t):null}function nr(e,t){if("error"in e)throw e.error;if("redirect"in e){let r={};throw e.revalidate&&(r["X-Remix-Revalidate"]="yes"),e.reload&&(r["X-Remix-Reload-Document"]="yes"),e.replace&&(r["X-Remix-Replace"]="yes"),Eo(e.redirect,{status:e.status,headers:r})}else{if("data"in e)return e.data;throw new Error(`No response found for routeId "${t}"`)}}function pn(){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 Sl=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(Vn,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Vn({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://remix.run/guides/errors for more information."
33
+ );
34
+ `}});if(He(e))return h.createElement(ar,{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(ar,{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 ar({title:e,renderScripts:t,isOutsideRemixApp:r,children:a}){var o;let{routeModules:n}=Ge();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(Gi,null):null)))}function Ai(){return h.createElement(ar,{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://remix.run/route/hydrate-fallback " +
39
+ "for more information."
40
+ );
41
+ `}}))}function Jn(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 Ni(e,t,r){let a=Gn(t),n=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Ai:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>h.createElement(Vn,{error:In()}):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 xl(e,t,r,a,n,o){return Er(t,r,a,n,o,"",Jn(t),e)}function xt(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 ke(400,"Bad Request",new Error(a),!0)}}function Xt(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 ke(405,"Method Not Allowed",new Error(a),!0)}function Er(e,t,r,a,n,o="",l=Jn(e),s){return(l[o]||[]).map(i=>{var C,P,T;let u=t[i.id];function d(c){return fe(typeof c=="function","No single fetch function available for route handler"),c()}function m(c){return i.hasLoader?d(c):Promise.resolve(null)}function p(c){if(!i.hasAction)throw Xt("action",i.id);return d(c)}function g(c){import(c)}function w(c){c.clientActionModule&&g(c.clientActionModule),c.clientLoaderModule&&g(c.clientLoaderModule)}async function b(c){let M=t[i.id],k=M?Hn(i,M):Promise.resolve();try{return c()}finally{await k}}let E={id:i.id,index:i.index,path:i.path};if(u){Object.assign(E,{...E,...Ni(i,u,n),unstable_middleware:u.unstable_clientMiddleware,handle:u.handle,shouldRevalidate:yn(u,i,a,s)});let c=r&&r.loaderData&&i.id in r.loaderData,M=c?(C=r==null?void 0:r.loaderData)==null?void 0:C[i.id]:void 0,k=r&&r.errors&&i.id in r.errors,O=k?(P=r==null?void 0:r.errors)==null?void 0:P[i.id]:void 0,z=s==null&&(((T=u.clientLoader)==null?void 0:T.hydrate)===!0||!i.hasLoader);E.loader=async({request:J,params:Q,context:ie},le)=>{try{return await b(async()=>(fe(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:J,params:Q,context:ie,async serverLoader(){if(xt("loader",i),z){if(c)return M;if(k)throw O}return m(le)}}):m(le)))}finally{z=!1}},E.loader.hydrate=Fi(i,u,n),E.action=({request:J,params:Q,context:ie},le)=>b(async()=>{if(fe(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(n)throw Xt("clientAction",i.id);return p(le)}return u.clientAction({request:J,params:Q,context:ie,async serverAction(){return xt("action",i),p(le)}})})}else{i.hasClientLoader||(E.loader=(k,O)=>b(()=>m(O))),i.hasClientAction||(E.action=(k,O)=>b(()=>{if(n)throw Xt("clientAction",i.id);return p(O)}));let c;async function M(){return c?await c:(c=(async()=>{(i.clientLoaderModule||i.clientActionModule)&&await new Promise(O=>setTimeout(O,0));let k=Ii(i,t);return w(i),await k})(),await c)}E.lazy={loader:i.hasClientLoader?async()=>{let{clientLoader:k}=i.clientLoaderModule?await import(i.clientLoaderModule):await M();return fe(k,"No `clientLoader` export found"),(O,z)=>k({...O,async serverLoader(){return xt("loader",i),m(z)}})}:void 0,action:i.hasClientAction?async()=>{let k=i.clientActionModule?import(i.clientActionModule):M();w(i);let{clientAction:O}=await k;return fe(O,"No `clientAction` export found"),(z,J)=>O({...z,async serverAction(){return xt("action",i),p(J)}})}:void 0,unstable_middleware:i.hasClientMiddleware?async()=>{let{unstable_clientMiddleware:k}=i.clientMiddlewareModule?await import(i.clientMiddlewareModule):await M();return fe(k,"No `unstable_clientMiddleware` export found"),k}:void 0,shouldRevalidate:async()=>{let k=await M();return yn(k,i,a,s)},handle:async()=>(await M()).handle,Component:async()=>(await M()).Component,ErrorBoundary:i.hasErrorBoundary?async()=>(await M()).ErrorBoundary:void 0}}let S=Er(e,t,r,a,n,i.id,l,s);return S.length>0&&(E.children=S),E})}function yn(e,t,r,a){if(a)return $i(t.id,e.shouldRevalidate,a);if(!r&&t.hasLoader&&!t.hasClientLoader)if(e.shouldRevalidate){let n=e.shouldRevalidate;return o=>n({...o,defaultShouldRevalidate:!1})}else return()=>!1;if(r&&e.shouldRevalidate){let n=e.shouldRevalidate;return o=>n({...o,defaultShouldRevalidate:!0})}return e.shouldRevalidate}function $i(e,t,r){let a=!1;return n=>a?t?t(n):n.defaultShouldRevalidate:(a=!0,r.has(e))}async function Ii(e,t){let r=jn(e,t),a=Si(e),n=await r;return await Promise.all([a,Hn(e,n)]),{Component:Gn(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 Gn(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Fi(e,t,r){return r&&e.id!=="root"||t.clientLoader!=null&&(t.clientLoader.hydrate===!0||e.hasLoader!==!0)}var Mt=new Set,ji=1e3,kt=new Set,Ui=7680;function Rr(e){return e===!0}function Hi({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=Te(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 Ll(e,t,r,a,n){if(Rr(r))return async({path:o,patch:l,signal:s,fetcherKey:i})=>{kt.has(o)||await Kn([o],i?window.location.href:o,e,t,r,a,n,l,s)}}function Cl(e,t,r,a,n){h.useEffect(()=>{var u;if(!Rr(a)||((u=navigator.connection)==null?void 0:u.saveData)===!0)return;function o(d){let m=d.tagName==="FORM"?d.getAttribute("action"):d.getAttribute("href");if(!m)return;let p=d.tagName==="A"?d.pathname:new URL(m,window.location.origin).pathname;kt.has(p)||Mt.add(p)}async function l(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(o);let d=Array.from(Mt.keys()).filter(m=>kt.has(m)?(Mt.delete(m),!1):!0);if(d.length!==0)try{await Kn(d,null,t,r,a,n,e.basename,e.patchRoutes)}catch(m){console.error("Failed to fetch manifest patches",m)}}let s=Bi(l,100);l();let i=new MutationObserver(()=>s());return i.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>i.disconnect()},[a,n,t,r,e])}var Qt="react-router-manifest-version";async function Kn(e,t,r,a,n,o,l,s,i){let u=`${l??"/"}/__manifest`.replace(/\/+/g,"/"),d=new URL(u,window.location.origin);if(e.sort().forEach(b=>d.searchParams.append("p",b)),d.searchParams.set("version",r.version),d.toString().length>Ui){Mt.clear();return}let m;try{let b=await fetch(d,{signal:i});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}throw sessionStorage.setItem(Qt,r.version),window.location.href=t,new Error("Detected manifest version mismatch, reloading...")}else if(b.status>=400)throw new Error(await b.text())}else throw new Error(`${b.status} ${b.statusText}`);sessionStorage.removeItem(Qt),m=await b.json()}catch(b){if(i!=null&&i.aborted)return;throw b}let p=new Set(Object.keys(r.routes)),g=Object.values(m).reduce((b,E)=>(E&&!p.has(E.id)&&(b[E.id]=E),b),{});Object.assign(r.routes,g),e.forEach(b=>zi(b,kt));let w=new Set;Object.values(g).forEach(b=>{b&&(!b.parentId||!g[b.parentId])&&w.add(b.parentId)}),w.forEach(b=>s(b||null,Er(g,a,null,n,o,b)))}function zi(e,t){if(t.size>=ji){let r=t.values().next().value;t.delete(r)}t.add(e)}function Bi(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),t)}}function br(){let e=h.useContext(ze);return fe(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function It(){let e=h.useContext(Je);return fe(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ft=h.createContext(void 0);Ft.displayName="FrameworkContext";function Ge(){let e=h.useContext(Ft);return fe(e,"You must render this element inside a <HydratedRouter> element"),e}function Yi(e,t){let r=h.useContext(Ft),[a,n]=h.useState(!1),[o,l]=h.useState(!1),{onFocus:s,onBlur:i,onMouseEnter:u,onMouseLeave:d,onTouchStart:m}=t,p=h.useRef(null);h.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let b=S=>{S.forEach(C=>{l(C.isIntersecting)})},E=new IntersectionObserver(b,{threshold:.5});return p.current&&E.observe(p.current),()=>{E.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,p,{}]:[o,p,{onFocus:nt(s,g),onBlur:nt(i,w),onMouseEnter:nt(u,g),onMouseLeave:nt(d,w),onTouchStart:nt(m,g)}]:[!1,p,{}]}function nt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Sr(e,t,r){if(r&&!_t)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 Pl(){let{isSpaMode:e,manifest:t,routeModules:r,criticalCss:a}=Ge(),{errors:n,matches:o}=It(),l=Sr(o,n,e),s=h.useMemo(()=>bi(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})=>pr(u)?h.createElement(qn,{key:i,...u}):h.createElement("link",{key:i,...u})))}function qn({page:e,...t}){let{router:r}=br(),a=h.useMemo(()=>Te(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?h.createElement(Vi,{page:e,matches:a,...t}):null}function Wi(e){let{manifest:t,routeModules:r}=Ge(),[a,n]=h.useState([]);return h.useEffect(()=>{let o=!1;return Li(e,t,r).then(l=>{o||n(l)}),()=>{o=!0}},[e,t,r]),a}function Vi({page:e,matches:t,...r}){let a=be(),{manifest:n,routeModules:o}=Ge(),{basename:l}=br(),{loaderData:s,matches:i}=It(),u=h.useMemo(()=>hn(e,t,i,n,a,"data"),[e,t,i,n,a]),d=h.useMemo(()=>hn(e,t,i,n,a,"assets"),[e,t,i,n,a]),m=h.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let w=new Set,b=!1;if(t.forEach(S=>{var P;let C=n.routes[S.route.id];!C||!C.hasLoader||(!u.some(T=>T.route.id===S.route.id)&&S.route.id in s&&((P=o[S.route.id])!=null&&P.shouldRevalidate)||C.hasClientLoader?b=!0:w.add(S.route.id))}),w.size===0)return[];let E=ft(e,l);return b&&w.size>0&&E.searchParams.set("_routes",t.filter(S=>w.has(S.route.id)).map(S=>S.route.id).join(",")),[E.pathname+E.search]},[l,s,a,n,u,t,e,o]),p=h.useMemo(()=>yr(d,n),[d,n]),g=Wi(d);return h.createElement(h.Fragment,null,m.map(w=>h.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),p.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 Tl(){let{isSpaMode:e,routeModules:t}=Ge(),{errors:r,matches:a,loaderData:n}=It(),o=be(),l=Sr(a,r,e),s=null;r&&(s=r[l[l.length-1].route.id]);let i=[],u=null,d=[];for(let m=0;m<l.length;m++){let p=l[m],g=p.route.id,w=n[g],b=p.params,E=t[g],S=[],C={id:g,data:w,meta:[],params:p.params,pathname:p.pathname,handle:p.route.handle,error:s};if(d[m]=C,E!=null&&E.meta?S=typeof E.meta=="function"?E.meta({data:w,params:b,location:o,matches:d,error:s}):Array.isArray(E.meta)?[...E.meta]:E.meta:u&&(S=[...u]),S=S||[],!Array.isArray(S))throw new Error("The route at "+p.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`);C.meta=S,d[m]=C,i=[...S],u=i}return h.createElement(h.Fragment,null,i.flat().map(m=>{if(!m)return null;if("tagName"in m){let{tagName:p,...g}=m;if(!Ji(p))return console.warn(`A meta object uses an invalid tagName: ${p}. Expected either 'link' or 'meta'`),null;let w=p;return h.createElement(w,{key:JSON.stringify(g),...g})}if("title"in m)return h.createElement("title",{key:"title"},String(m.title));if("charset"in m&&(m.charSet??(m.charSet=m.charset),delete m.charset),"charSet"in m&&m.charSet!=null)return typeof m.charSet=="string"?h.createElement("meta",{key:"charSet",charSet:m.charSet}):null;if("script:ld+json"in m)try{let p=JSON.stringify(m["script:ld+json"]);return h.createElement("script",{key:`script:ld+json:${p}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:p}})}catch{return null}return h.createElement("meta",{key:JSON.stringify(m),...m})}))}function Ji(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var _t=!1;function Gi(e){let{manifest:t,serverHandoffString:r,isSpaMode:a,ssr:n,renderMeta:o}=Ge(),{router:l,static:s,staticContext:i}=br(),{matches:u}=It(),d=Rr(n);o&&(o.didRenderScripts=!0);let m=Sr(u,null,a);h.useEffect(()=>{_t=!0},[]);let p=h.useMemo(()=>{var C;let E=i?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",S=s?`${(C=t.hmr)!=null&&C.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${d?"":`import ${JSON.stringify(t.url)}`};
44
+ ${m.map((P,T)=>{let c=`route${T}`,M=t.routes[P.route.id];fe(M,`Route ${P.route.id} not found in manifest`);let{clientActionModule:k,clientLoaderModule:O,clientMiddlewareModule:z,hydrateFallbackModule:J,module:Q}=M,ie=[...k?[{module:k,varName:`${c}_clientAction`}]:[],...O?[{module:O,varName:`${c}_clientLoader`}]:[],...z?[{module:z,varName:`${c}_clientMiddleware`}]:[],...J?[{module:J,varName:`${c}_HydrateFallback`}]:[],{module:Q,varName:`${c}_main`}];if(ie.length===1)return`import * as ${c} from ${JSON.stringify(Q)};`;let le=ie.map(K=>`import * as ${K.varName} from "${K.module}";`).join(`
45
+ `),Se=`const ${c} = {${ie.map(K=>`...${K.varName}`).join(",")}};`;return[le,Se].join(`
46
+ `)}).join(`
47
+ `)}
48
+ ${d?`window.__reactRouterManifest = ${JSON.stringify(Hi(t,l),null,2)};`:""}
49
+ window.__reactRouterRouteModules = {${m.map((P,T)=>`${JSON.stringify(P.route.id)}:route${T}`).join(",")}};
50
+
51
+ import(${JSON.stringify(t.entry.module)});`:" ";return h.createElement(h.Fragment,null,h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:mn(E),type:void 0}),h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:mn(S),type:"module",async:!0}))},[]),g=_t?[]:Ki(t.entry.imports.concat(yr(m,t,{includeHydrateFallback:!0}))),w=typeof t.sri=="object"?t.sri:{};return _t?null:h.createElement(h.Fragment,null,typeof t.sri=="object"?h.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:w})}}):null,d?null:h.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:w[t.url],suppressHydrationWarning:!0}),h.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:w[t.entry.module],suppressHydrationWarning:!0}),g.map(b=>h.createElement("link",{key:b,rel:"modulepreload",href:b,crossOrigin:e.crossOrigin,integrity:w[b],suppressHydrationWarning:!0})),p)}function Ki(e){return[...new Set(e)]}function qi(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Xn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Xn&&(window.__reactRouterVersion="7.5.0")}catch{}var Qn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Zn=h.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:l,state:s,target:i,to:u,preventScrollReset:d,viewTransition:m,...p},g){let{basename:w}=h.useContext(pe),b=typeof u=="string"&&Qn.test(u),E,S=!1;if(typeof u=="string"&&b&&(E=u,Xn))try{let z=new URL(window.location.href),J=u.startsWith("//")?new URL(z.protocol+u):new URL(u),Q=he(J.pathname,w);J.origin===z.origin&&Q!=null?u=Q+J.search+J.hash:S=!0}catch{re(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let C=Go(u,{relative:n}),[P,T,c]=Yi(a,p),M=tl(u,{replace:l,state:s,target:i,preventScrollReset:d,relative:n,viewTransition:m});function k(z){t&&t(z),z.defaultPrevented||M(z)}let O=h.createElement("a",{...p,...c,href:E||C,onClick:S||o?t:k,ref:qi(g,T),target:i,"data-discover":!b&&r==="render"?"true":void 0});return P&&!b?h.createElement(h.Fragment,null,O,h.createElement(qn,{page:C})):O});Zn.displayName="Link";var Xi=h.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:l,viewTransition:s,children:i,...u},d){let m=ut(l,{relative:u.relative}),p=be(),g=h.useContext(Je),{navigator:w,basename:b}=h.useContext(pe),E=g!=null&&sl(m)&&s===!0,S=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,C=p.pathname,P=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(C=C.toLowerCase(),P=P?P.toLowerCase():null,S=S.toLowerCase()),P&&b&&(P=he(P,b)||P);const T=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let c=C===S||!n&&C.startsWith(S)&&C.charAt(T)==="/",M=P!=null&&(P===S||!n&&P.startsWith(S)&&P.charAt(S.length)==="/"),k={isActive:c,isPending:M,isTransitioning:E},O=c?t:void 0,z;typeof a=="function"?z=a(k):z=[a,c?"active":null,M?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let J=typeof o=="function"?o(k):o;return h.createElement(Zn,{...u,"aria-current":O,className:z,ref:d,style:J,to:l,viewTransition:s},typeof i=="function"?i(k):i)});Xi.displayName="NavLink";var Qi=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:l=Pt,action:s,onSubmit:i,relative:u,preventScrollReset:d,viewTransition:m,...p},g)=>{let w=al(),b=ol(s,{relative:u}),E=l.toLowerCase()==="get"?"get":"post",S=typeof s=="string"&&Qn.test(s),C=P=>{if(i&&i(P),P.defaultPrevented)return;P.preventDefault();let T=P.nativeEvent.submitter,c=(T==null?void 0:T.getAttribute("formmethod"))||l;w(T||P.currentTarget,{fetcherKey:t,method:c,navigate:r,replace:n,state:o,relative:u,preventScrollReset:d,viewTransition:m})};return h.createElement("form",{ref:g,method:E,action:b,onSubmit:a?i:C,...p,"data-discover":!S&&e==="render"?"true":void 0})});Qi.displayName="Form";function Zi({getKey:e,storageKey:t,...r}){let a=h.useContext(Ft),{basename:n}=h.useContext(pe),o=be(),l=$n();il({getKey:e,storageKey:t});let s=h.useMemo(()=>{if(!a||!e)return null;let u=ir(o,l,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let i=((u,d)=>{if(!window.history.state||!window.history.state.key){let m=Math.random().toString(32).slice(2);window.history.replaceState({key:m},"")}try{let p=JSON.parse(sessionStorage.getItem(u)||"{}")[d||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}catch(m){console.error(m),sessionStorage.removeItem(u)}}).toString();return h.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${i})(${JSON.stringify(t||or)}, ${JSON.stringify(s)})`}})}Zi.displayName="ScrollRestoration";function ea(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xr(e){let t=h.useContext(ze);return Y(t,ea(e)),t}function el(e){let t=h.useContext(Je);return Y(t,ea(e)),t}function tl(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:l}={}){let s=Ko(),i=be(),u=ut(e,{relative:o});return h.useCallback(d=>{if(gi(d,t)){d.preventDefault();let m=r!==void 0?r:Oe(i)===Oe(u);s(e,{replace:m,state:a,preventScrollReset:n,relative:o,viewTransition:l})}},[i,s,u,r,a,t,e,n,o,l])}var rl=0,nl=()=>`__${String(++rl)}__`;function al(){let{router:e}=xr("useSubmit"),{basename:t}=h.useContext(pe),r=li();return h.useCallback(async(a,n={})=>{let{action:o,method:l,encType:s,formData:i,body:u}=Ri(a,t);if(n.navigate===!1){let d=n.fetcherKey||nl();await e.fetch(d,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 ol(e,{relative:t}={}){let{basename:r}=h.useContext(pe),a=h.useContext(ge);Y(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...ut(e||".",{relative:t})},l=be();if(e==null){o.search=l.search;let s=new URLSearchParams(o.search),i=s.getAll("index");if(i.some(d=>d==="")){s.delete("index"),i.filter(m=>m).forEach(m=>s.append("index",m));let d=s.toString();o.search=d?`?${d}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Re([r,o.pathname])),Oe(o)}var or="react-router-scroll-positions",Lt={};function ir(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:he(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function il({getKey:e,storageKey:t}={}){let{router:r}=xr("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=el("useScrollRestoration"),{basename:o}=h.useContext(pe),l=be(),s=$n(),i=si();h.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),ll(h.useCallback(()=>{if(i.state==="idle"){let u=ir(l,s,o,e);Lt[u]=window.scrollY}try{sessionStorage.setItem(t||or,JSON.stringify(Lt))}catch(u){re(!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||or);u&&(Lt=JSON.parse(u))}catch{}},[t]),h.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(Lt,()=>window.scrollY,e?(d,m)=>ir(d,m,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 ll(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 sl(e,t={}){let r=h.useContext(fr);Y(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=xr("useViewTransitionState"),n=ut(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=he(r.currentLocation.pathname,a)||r.currentLocation.pathname,l=he(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Ot(n.pathname,l)!=null||Ot(n.pathname,o)!=null}new TextEncoder;function Ml(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 ke(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}export{$n as A,gl as B,vl as C,yl as D,In as E,Ft as F,Pl as L,Tl as M,Xi as N,Rl as O,Sl as R,Zi as S,h as a,El as b,Er as c,ki as d,Ml as e,pl as f,Ll as g,bl as h,Y as i,ml as j,xl as k,wl as l,Te as m,dl as n,Gi as o,He as p,Ko as q,ba as r,Fi as s,Zn as t,Cl as u,be as v,Sa as w,ga as x,fl as y,cl as z};
@@ -1,4 +1,4 @@
1
- import{r as s}from"./chunk-KNED5TY2-CXj9yqcQ.js";/**
1
+ import{a as s}from"./chunk-KNED5TY2-DAA_sFzt.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{w as h}from"./react-redux-kbMjYGuQ.js";import{n as e,a as j,t as b}from"./chunk-KNED5TY2-DAA_sFzt.js";import{c as m}from"./utils-DslUJpbf.js";import{a as w,u as C,f as N,g as v}from"./editorialApi-fQchmMa9.js";import{c as T,u as y,T as D,a as L,b as u,d as R,f as x,e as A,g as k,h as H}from"./index-DeO5nu0f.js";function I({className:a,...s}){return e.jsx("div",{"data-slot":"skeleton",className:m("bg-accent animate-pulse rounded-md",a),...s})}function p({className:a,title:s,value:o,isLoading:n,...t}){return e.jsxs("div",{className:m("border border-border rounded-xl p-6",a),...t,children:[e.jsx("h3",{className:"text-xs text-muted-foreground",children:s}),n?e.jsx(I,{className:"h-[2.25rem] w-16"}):e.jsx("p",{className:"text-lg sm:text-3xl font-bold leading-none",children:o})]})}const c=T(),i=[c.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(a){const s=a.getValue();return e.jsx("span",{title:s,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:s})}}),c.accessor("createdAt",{header:"Created At",cell(a){return new Date(a.getValue()).toLocaleString()}}),c.accessor("updatedAt",{header:"Updated At",cell(a){return new Date(a.getValue()).toLocaleString()}})];function S(){const{data:a}=w(),{data:s}=C(),o=j.useMemo(()=>!a||!s?[]:Object.entries(a).filter(([r])=>r in s).reduce((r,[d,f])=>r.concat(Object.values(f).map(g=>({...g,type:d}))),[]).toSorted((r,d)=>r.updatedAt>d.updatedAt?-1:1).slice(0,6),[a,s]),n=y({data:o,columns:i,getCoreRowModel:H()});return e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(D,{children:[e.jsx(L,{children:n.getHeaderGroups().map(t=>e.jsx(u,{className:"grid",style:{gridTemplateColumns:`repeat(${i.length}, minmax(200px, 1fr))`},children:t.headers.map(l=>e.jsx(R,{children:l.isPlaceholder?null:x(l.column.columnDef.header,l.getContext())},l.id))},t.id))}),e.jsx(A,{children:n.getRowModel().rows.map(t=>e.jsx(b,{to:`/admin/dashboard/${t.original.type}/${t.original.id}`,children:e.jsx(u,{className:"grid",style:{gridTemplateColumns:`repeat(${i.length}, minmax(200px, 1fr))`},children:t.getVisibleCells().map(l=>e.jsx(k,{className:m("p-2"),children:x(l.column.columnDef.cell,l.getContext())},l.id))},t.id)}))})]})})}const E=h(function(){const{data:s,isLoading:o}=N(),{data:n,isLoading:t}=v();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(p,{className:"w-full sm:w-44",title:"Items",value:s,isLoading:o}),e.jsx(p,{className:"w-full sm:w-44",title:"Files",value:n,isLoading:t})]}),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:"Recent Collections"}),e.jsx(S,{})]})]})})});export{E as default};
@@ -1,16 +1,16 @@
1
- import{w as C}from"./index-G-cqIhgh.js";import{l as e,p as v,r as m,q as N}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{B as k}from"./button-O0EDocjF.js";import{i as b,a as T,j as M}from"./editorialApi-DCnC5eM9.js";import{c as D,u as $,T as z,a as R,b as f,d as _,f as g,e as V,g as H,h as S}from"./index-DrhM6FV9.js";import{c as I}from"./utils-DslUJpbf.js";import{T as L}from"./trash-B3lfbu-5.js";import{c as x}from"./createLucideIcon-TQsNVzYU.js";/**
1
+ import{w as C}from"./react-redux-kbMjYGuQ.js";import{n as e,q as v,a as m,t as N}from"./chunk-KNED5TY2-DAA_sFzt.js";import{B as k}from"./button-Da66T3Bb.js";import{h as b,a as T,i as M}from"./editorialApi-fQchmMa9.js";import{c as D,u as $,T as z,a as R,b as f,d as _,f as g,e as V,g as H,h as S}from"./index-DeO5nu0f.js";import{c as I}from"./utils-DslUJpbf.js";import{T as L}from"./trash-wq_ppIxP.js";import{c as h}from"./createLucideIcon-R2-3a7hN.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const P=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],B=x("circle-check",P);/**
6
+ */const P=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],B=h("circle-check",P);/**
7
7
  * @license lucide-react v0.487.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],O=x("circle",E);/**
11
+ */const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],O=h("circle",E);/**
12
12
  * @license lucide-react v0.487.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const F=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],G=x("plus",F),u=D(),j=[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 Q({itemType:l}){v();const{data:t}=b(l),{data:c}=T(),[n]=M(),r=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(),n({type:l,id:a.row.original.id})},children:[e.jsx(L,{size:16,className:"group-hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"Delete entry"})]})})}}),[l,n]),i=m.useMemo(()=>{if(!t)return j;const a=Object.entries(t.fields);return[...j,...a.filter(([,s])=>s.showInSummary).map(([s,d])=>u.accessor(o=>o[s],{id:s,header:d.displayName,cell(o){switch(d.type){case"boolean":return o.getValue()?e.jsx(B,{className:"text-green-600 mx-auto",size:14}):e.jsx(O,{className:"text-gray-300 mx-auto",size:14});case"date":const y=new Date(o.getValue());return e.jsx("span",{className:"text-nowrap",children:y.toLocaleDateString()});case"markdown":case"string":const p=o.getValue();return e.jsx("span",{title:p,className:"block w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:p});default:return o.getValue()}}})),r]},[r,t]),w=m.useMemo(()=>c?Object.values(c[l]):[],[l,c]),h=$({data:w,columns:i,getCoreRowModel:S()});return!t||!c?null:e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(z,{children:[e.jsx(R,{className:"sticky top-0 z-50",children:h.getHeaderGroups().map(a=>e.jsx(f,{className:"grid",style:{gridTemplateColumns:`repeat(${i.length}, minmax(200px, 1fr))`},children:a.headers.map(s=>e.jsx(_,{className:"bg-background",children:s.isPlaceholder?null:g(s.column.columnDef.header,s.getContext())},s.id))},a.id))}),e.jsx(V,{children:h.getRowModel().rows.map(a=>e.jsx(N,{to:`/admin/dashboard/${l}/${a.original.id}`,children:e.jsx(f,{className:"grid",style:{gridTemplateColumns:`repeat(${i.length}, minmax(200px, 1fr))`},children:a.getVisibleCells().map((s,d)=>e.jsx(H,{className:I("h-10",{"w-full":d==i.length-1}),children:g(s.column.columnDef.cell,s.getContext())},s.id))},a.id)}))})]})})}const Z=C(function({params:t}){const{collectionId:c}=t,{data:n,isFetching:r}=b(c);return r||!n?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:n.displayName,children:n.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(G,{}),"Create"]})})]}),e.jsx(Q,{itemType:c},c)]})})})});export{Z as default};
16
+ */const F=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],G=h("plus",F),u=D(),j=[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 Q({itemType:l}){v();const{data:t}=b(l),{data:c}=T(),[n]=M(),r=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(),n({type:l,id:a.row.original.id})},children:[e.jsx(L,{size:16,className:"group-hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"Delete entry"})]})})}}),[l,n]),i=m.useMemo(()=>{if(!t)return j;const a=Object.entries(t.fields);return[...j,...a.filter(([,s])=>s.showInSummary).map(([s,d])=>u.accessor(o=>o[s],{id:s,header:d.displayName,cell(o){switch(d.type){case"boolean":return o.getValue()?e.jsx(B,{className:"text-green-600 mx-auto",size:14}):e.jsx(O,{className:"text-gray-300 mx-auto",size:14});case"date":const y=new Date(o.getValue());return e.jsx("span",{className:"text-nowrap",children:y.toLocaleDateString()});case"markdown":case"string":const p=o.getValue();return e.jsx("span",{title:p,className:"block w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:p});default:return o.getValue()}}})),r]},[r,t]),w=m.useMemo(()=>c?Object.values(c[l]):[],[l,c]),x=$({data:w,columns:i,getCoreRowModel:S()});return!t||!c?null:e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(z,{children:[e.jsx(R,{className:"sticky top-0 z-50",children:x.getHeaderGroups().map(a=>e.jsx(f,{className:"grid",style:{gridTemplateColumns:`repeat(${i.length}, minmax(200px, 1fr))`},children:a.headers.map(s=>e.jsx(_,{className:"bg-background",children:s.isPlaceholder?null:g(s.column.columnDef.header,s.getContext())},s.id))},a.id))}),e.jsx(V,{children:x.getRowModel().rows.map(a=>e.jsx(N,{to:`/admin/dashboard/${l}/${a.original.id}`,children:e.jsx(f,{className:"grid",style:{gridTemplateColumns:`repeat(${i.length}, minmax(200px, 1fr))`},children:a.getVisibleCells().map((s,d)=>e.jsx(H,{className:I("h-10",{"w-full":d==i.length-1}),children:g(s.column.columnDef.cell,s.getContext())},s.id))},a.id)}))})]})})}const Z=C(function({params:t}){const{collectionId:c}=t,{data:n,isFetching:r}=b(c);return r||!n?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:n.displayName,children:n.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(G,{}),"Create"]})})]}),e.jsx(Q,{itemType:c},c)]})})})});export{Z as default};
@@ -0,0 +1 @@
1
+ import{w as a}from"./react-redux-kbMjYGuQ.js";import{n as o}from"./chunk-KNED5TY2-DAA_sFzt.js";import{I as s}from"./itemForm-DlRBjBsd.js";import{h as p,j as n}from"./editorialApi-fQchmMa9.js";import"./button-Da66T3Bb.js";import"./utils-DslUJpbf.js";import"./input-BmmdOdbj.js";import"./index-BvKqmqc2.js";import"./index-C-vcF2DZ.js";import"./createLucideIcon-R2-3a7hN.js";import"./index-Bd1u2_LZ.js";import"./tslib.es6-CDuPK5Eb.js";const b=a(function({params:r}){const{collectionId:t,documentId:i}=r,{data:e}=p(t),{data:m}=n({itemType:t,id:i});return!e||!m?null:o.jsx("div",{className:"overflow-auto",children:o.jsx("div",{className:"flex p-4 gap-4",children:o.jsx(s,{itemType:t,fields:e.fields,data:m})})})});export{b as default};
@@ -0,0 +1 @@
1
+ import{w as i}from"./react-redux-kbMjYGuQ.js";import{n as o}from"./chunk-KNED5TY2-DAA_sFzt.js";import{I as m}from"./itemForm-DlRBjBsd.js";import{h as s}from"./editorialApi-fQchmMa9.js";import"./button-Da66T3Bb.js";import"./utils-DslUJpbf.js";import"./input-BmmdOdbj.js";import"./index-BvKqmqc2.js";import"./index-C-vcF2DZ.js";import"./createLucideIcon-R2-3a7hN.js";import"./index-Bd1u2_LZ.js";import"./tslib.es6-CDuPK5Eb.js";const y=i(function({params:e}){const{collectionId:t}=e,{data:r}=s(t);return r?o.jsx("div",{className:"overflow-auto",children:o.jsx("div",{className:"flex p-4 gap-4",children:o.jsx(m,{itemType:t,fields:r.fields,isNew:!0})})}):null});export{y as default};
@@ -1,4 +1,4 @@
1
- import{w as ce}from"./index-G-cqIhgh.js";import{l as e,r as d,q as N,N as ue,p as he,t as pe,v as xe,O as fe}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{c as K,u as W,a as be,b as ge,d as me,f as je}from"./editorialApi-DCnC5eM9.js";import{u as ve,d as E,e as we}from"./authSlice-KDhecIDl.js";import{R as Q,C as X,a as Z,T as Y,D as J,P as ee,O as te,b as ye,c as Ne,d as Ce,e as _e,f as Se,A as ke,u as Me}from"./index-C-iH5ItK.js";import{c as r}from"./utils-DslUJpbf.js";import{c as x}from"./createLucideIcon-TQsNVzYU.js";import{B as O,S as R,c as Ee,u as Oe}from"./button-O0EDocjF.js";import{P as k,u as Re,c as Ae,a as ze,b as De,d as Pe}from"./index-B_FOxFgA.js";import{C as L}from"./chevron-down-BMtosYlL.js";import"./tslib.es6-CDuPK5Eb.js";import"./index-B7e3fQ32.js";/**
1
+ import{w as ce}from"./react-redux-kbMjYGuQ.js";import{n as e,a as d,t as N,N as ue,q as he,v as pe,w as xe,O as fe}from"./chunk-KNED5TY2-DAA_sFzt.js";import{c as K,C as L}from"./chevron-down-8tTu7uK2.js";import{u as be,d as E,e as ge}from"./authSlice-B3Tyl-Nw.js";import{u as W,a as me,b as je,c as ve,d as we}from"./editorialApi-fQchmMa9.js";import{R as Q,C as X,a as Z,T as Y,D as J,P as ee,O as te,b as ye,c as Ne,d as Ce,e as _e,f as Se,A as ke,u as Me}from"./index-Bd1u2_LZ.js";import{c as r}from"./utils-DslUJpbf.js";import{c as x}from"./createLucideIcon-R2-3a7hN.js";import{B as O,S as R,c as Ee,u as Oe}from"./button-Da66T3Bb.js";import{P as k,u as Re,c as Ae,a as ze,b as De,d as Pe}from"./index-BvKqmqc2.js";import"./tslib.es6-CDuPK5Eb.js";import"./index-C-vcF2DZ.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -63,4 +63,4 @@ import{w as ce}from"./index-G-cqIhgh.js";import{l as e,r as d,q as N,N as ue,p a
63
63
  *
64
64
  * This source code is licensed under the ISC license.
65
65
  * See the LICENSE file in the root directory of this source tree.
66
- */const it=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ae=x("x",it);function rt({...t}){return e.jsx(Q,{"data-slot":"dialog",...t})}function dt({...t}){return e.jsx(ee,{"data-slot":"dialog-portal",...t})}function lt({className:t,...a}){return e.jsx(te,{"data-slot":"dialog-overlay",className:r("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 ct({className:t,children:a,...n}){return e.jsxs(dt,{"data-slot":"dialog-portal",children:[e.jsx(lt,{}),e.jsxs(X,{"data-slot":"dialog-content",className:r("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(Z,{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(ae,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ut({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2 text-center sm:text-left",t),...a})}function ht({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function pt({className:t,...a}){return e.jsx(Y,{"data-slot":"dialog-title",className:r("text-lg leading-none font-semibold",t),...a})}function xt({className:t,...a}){return e.jsx(J,{"data-slot":"dialog-description",className:r("text-muted-foreground text-sm",t),...a})}const ft="#181717",bt=d.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=ft),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...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"})]})}),gt="#85EA2D",mt=d.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=gt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...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 jt({isOpen:t,setOpen:a}){return e.jsx(rt,{open:t,onOpenChange:n=>a(n),children:e.jsxs(ct,{children:[e.jsxs(ut,{children:[e.jsx(pt,{children:"Editorial"}),e.jsx(xt,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(O,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:new URL("/doc",K.EDITORIAL_API_URL).href,children:[e.jsx(mt,{size:14}),"Swagger API UI"]})}),e.jsx(O,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(bt,{size:14}),"GitHub repository"]})})]}),e.jsx(ht,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(Ze,{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"})]})})]})})}var vt="Separator",$="horizontal",wt=["horizontal","vertical"],se=d.forwardRef((t,a)=>{const{decorative:n,orientation:s=$,...o}=t,i=yt(s)?s:$,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return e.jsx(k.div,{"data-orientation":i,...u,...o,ref:a})});se.displayName=vt;function yt(t){return wt.includes(t)}var Nt=se;function Ct({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(Nt,{"data-slot":"separator-root",decorative:n,orientation:a,className:r("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 _t({...t}){return e.jsx(Q,{"data-slot":"sheet",...t})}function St({...t}){return e.jsx(ee,{"data-slot":"sheet-portal",...t})}function kt({className:t,...a}){return e.jsx(te,{"data-slot":"sheet-overlay",className:r("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 Mt({className:t,children:a,side:n="right",...s}){return e.jsxs(St,{children:[e.jsx(kt,{}),e.jsxs(X,{"data-slot":"sheet-content",className:r("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(Z,{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(ae,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Et({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:r("flex flex-col gap-1.5 p-4",t),...a})}function Ot({className:t,...a}){return e.jsx(Y,{"data-slot":"sheet-title",className:r("text-foreground font-semibold",t),...a})}function Rt({className:t,...a}){return e.jsx(J,{"data-slot":"sheet-description",className:r("text-muted-foreground text-sm",t),...a})}function ne({delayDuration:t=0,...a}){return e.jsx(ye,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function At({...t}){return e.jsx(ne,{children:e.jsx(Ne,{"data-slot":"tooltip",...t})})}function zt({...t}){return e.jsx(Ce,{"data-slot":"tooltip-trigger",...t})}function Dt({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(_e,{children:e.jsxs(Se,{"data-slot":"tooltip-content",sideOffset:a,className:r("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 Pt(){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 It="sidebar_state",Tt=60*60*24*7,Lt="16rem",$t="18rem",Bt="3rem",Ht="b",oe=d.createContext(null);function A(){const t=d.useContext(oe);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Gt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...c}){const u=Pt(),[f,p]=d.useState(!1),[g,C]=d.useState(t),m=a??g,j=d.useCallback(h=>{const l=typeof h=="function"?h(m):h;n?n(l):C(l),document.cookie=`${It}=${l}; path=/; max-age=${Tt}`},[n,m]),v=d.useCallback(()=>u?p(h=>!h):j(h=>!h),[u,j,p]);d.useEffect(()=>{const h=l=>{l.key===Ht&&(l.metaKey||l.ctrlKey)&&(l.preventDefault(),v())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[v]);const y=m?"expanded":"collapsed",_=d.useMemo(()=>({state:y,open:m,setOpen:j,isMobile:u,openMobile:f,setOpenMobile:p,toggleSidebar:v}),[y,m,j,u,f,p,v]);return e.jsx(oe.Provider,{value:_,children:e.jsx(ne,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Lt,"--sidebar-width-icon":Bt,...o},className:r("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...c,children:i})})})}function qt({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...i}){const{isMobile:c,state:u,openMobile:f,setOpenMobile:p}=A();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:r("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...i,children:o}):c?e.jsx(_t,{open:f,onOpenChange:p,...i,children:e.jsxs(Mt,{"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":$t},side:t,children:[e.jsxs(Et,{className:"sr-only",children:[e.jsx(Ot,{children:"Sidebar"}),e.jsx(Rt,{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":u,"data-collapsible":u==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:r("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:r("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),...i,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 Ft({className:t,onClick:a,...n}){const{toggleSidebar:s}=A();return e.jsxs(O,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:r("size-7",t),onClick:o=>{a==null||a(o),s()},...n,children:[e.jsx(tt,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Vt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r("flex flex-col gap-2 p-2",t),...a})}function Ut({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r("flex flex-col gap-2 p-2",t),...a})}function Kt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function S({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r("relative flex w-full min-w-0 flex-col p-2",t),...a})}function B({className:t,asChild:a=!1,...n}){const s=a?R:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:r("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 H({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r("w-full text-sm",t),...a})}function G({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r("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:r("group/menu-item relative",t),...a})}const Wt=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:i,...c}){const u=t?R:"button",{isMobile:f,state:p}=A(),g=e.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:r(Wt({variant:n,size:s}),i),...c});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(At,{children:[e.jsx(zt,{asChild:!0,children:g}),e.jsx(Dt,{side:"right",align:"center",hidden:p!=="collapsed"||f,...o})]})):g}function Qt({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:r("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 Xt({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const i=t?R:"a";return e.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:r("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 q({singleton:t}){const{data:a}=W(),{data:n}=be();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(ue,{to:t?`/admin/dashboard/${s}/default`:`/admin/dashboard/${s}`,className:({isActive:i,isPending:c})=>c?"pending":i?"active":"",children:({isActive:i})=>e.jsxs(Xt,{isActive:i,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 z="Collapsible",[Zt,ba]=Ae(z),[Yt,D]=Zt(z),ie=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:c,...u}=t,[f=!1,p]=Re({prop:s,defaultProp:o,onChange:c});return e.jsx(Yt,{scope:n,disabled:i,contentId:Me(),open:f,onOpenToggle:d.useCallback(()=>p(g=>!g),[p]),children:e.jsx(k.div,{"data-state":I(f),"data-disabled":i?"":void 0,...u,ref:a})})});ie.displayName=z;var re="CollapsibleTrigger",de=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=D(re,n);return e.jsx(k.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:ze(t.onClick,o.onOpenToggle)})});de.displayName=re;var P="CollapsibleContent",le=d.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=D(P,t.__scopeCollapsible);return e.jsx(De,{present:n||o.open,children:({present:i})=>e.jsx(Jt,{...s,ref:a,present:i})})});le.displayName=P;var Jt=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=t,c=D(P,n),[u,f]=d.useState(s),p=d.useRef(null),g=Oe(a,p),C=d.useRef(0),m=C.current,j=d.useRef(0),v=j.current,y=c.open||u,_=d.useRef(y),h=d.useRef(void 0);return d.useEffect(()=>{const l=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(l)},[]),Pe(()=>{const l=p.current;if(l){h.current=h.current||{transitionDuration:l.style.transitionDuration,animationName:l.style.animationName},l.style.transitionDuration="0s",l.style.animationName="none";const T=l.getBoundingClientRect();C.current=T.height,j.current=T.width,_.current||(l.style.transitionDuration=h.current.transitionDuration,l.style.animationName=h.current.animationName),f(s)}},[c.open,s]),e.jsx(k.div,{"data-state":I(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!y,...i,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 ea=ie;function F({...t}){return e.jsx(ea,{"data-slot":"collapsible",...t})}function V({...t}){return e.jsx(de,{"data-slot":"collapsible-trigger",...t})}function U({...t}){return e.jsx(le,{"data-slot":"collapsible-content",...t})}function ta(){const t=ve(),[a,n]=d.useState(!1),[s]=ge(),[o]=me(),[i]=je(),c=E(u=>u.auth.role);return e.jsxs(qt,{className:"z-50",children:[e.jsx(jt,{isOpen:a,setOpen:n}),e.jsx(Vt,{className:"h-14 justify-center",children:e.jsx(S,{children:e.jsx(N,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:"WEkEO"})})}),e.jsxs(Kt,{children:[e.jsxs(S,{children:[e.jsx(B,{children:"Content"}),e.jsx(H,{children:e.jsxs(G,{children:[e.jsx(F,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(Qe,{}),e.jsx("span",{children:"Collections"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(U,{children:e.jsx(q,{})})]})}),e.jsx(F,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(st,{}),e.jsx("span",{children:"Singles"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(U,{children:e.jsx(q,{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(S,{children:[e.jsx(B,{children:"Actions"}),e.jsx(H,{children:e.jsxs(G,{children:[c==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(b,{onClick:()=>o(),children:[e.jsx(Te,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(b,{onClick:()=>i(),children:[e.jsx($e,{}),e.jsx("span",{children:"Push to repo"})]})})]}),e.jsx(w,{children:e.jsxs(b,{onClick:()=>s(),children:[e.jsx(ot,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(S,{})]}),e.jsxs(Ut,{children:[e.jsx(b,{asChild:!0,children:e.jsxs(N,{to:K.PREVIEW_URL,children:["Preview",e.jsx(Ve,{className:"ml-auto"})]})}),e.jsx(b,{onClick:()=>n(!0),children:"About"}),e.jsxs(b,{onClick:()=>t(we()),children:[e.jsx(Je,{}),"Log out"]})]})]})}function aa({children:t}){const a=he(),n=E(o=>o.auth.user),s=E(o=>o.auth.isLoading);return d.useEffect(()=>{!s&&!n&&a("/")},[s,a,n]),s||!n?null:t}function sa(){const{pathname:t}=pe(),{data:a}=W(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,i)=>e.jsxs(xe.Fragment,{children:[i.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 ga=ce(function(){return e.jsx(aa,{children:e.jsxs(Gt,{className:"flex h-full",children:[e.jsx(ta,{}),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(Ft,{}),e.jsx(Ct,{orientation:"vertical",className:"h-4"}),e.jsx(sa,{})]})}),e.jsx(fe,{})]})]})})});export{ga as default};
66
+ */const it=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ae=x("x",it);function rt({...t}){return e.jsx(Q,{"data-slot":"dialog",...t})}function dt({...t}){return e.jsx(ee,{"data-slot":"dialog-portal",...t})}function lt({className:t,...a}){return e.jsx(te,{"data-slot":"dialog-overlay",className:r("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 ct({className:t,children:a,...n}){return e.jsxs(dt,{"data-slot":"dialog-portal",children:[e.jsx(lt,{}),e.jsxs(X,{"data-slot":"dialog-content",className:r("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(Z,{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(ae,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ut({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2 text-center sm:text-left",t),...a})}function ht({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function pt({className:t,...a}){return e.jsx(Y,{"data-slot":"dialog-title",className:r("text-lg leading-none font-semibold",t),...a})}function xt({className:t,...a}){return e.jsx(J,{"data-slot":"dialog-description",className:r("text-muted-foreground text-sm",t),...a})}const ft="#181717",bt=d.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=ft),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...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"})]})}),gt="#85EA2D",mt=d.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=gt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...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 jt({isOpen:t,setOpen:a}){return e.jsx(rt,{open:t,onOpenChange:n=>a(n),children:e.jsxs(ct,{children:[e.jsxs(ut,{children:[e.jsx(pt,{children:"Editorial"}),e.jsx(xt,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(O,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:new URL("/doc",K.EDITORIAL_API_URL).href,children:[e.jsx(mt,{size:14}),"Swagger API UI"]})}),e.jsx(O,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(bt,{size:14}),"GitHub repository"]})})]}),e.jsx(ht,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(Ze,{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"})]})})]})})}var vt="Separator",$="horizontal",wt=["horizontal","vertical"],se=d.forwardRef((t,a)=>{const{decorative:n,orientation:s=$,...o}=t,i=yt(s)?s:$,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return e.jsx(k.div,{"data-orientation":i,...u,...o,ref:a})});se.displayName=vt;function yt(t){return wt.includes(t)}var Nt=se;function Ct({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(Nt,{"data-slot":"separator-root",decorative:n,orientation:a,className:r("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 _t({...t}){return e.jsx(Q,{"data-slot":"sheet",...t})}function St({...t}){return e.jsx(ee,{"data-slot":"sheet-portal",...t})}function kt({className:t,...a}){return e.jsx(te,{"data-slot":"sheet-overlay",className:r("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 Mt({className:t,children:a,side:n="right",...s}){return e.jsxs(St,{children:[e.jsx(kt,{}),e.jsxs(X,{"data-slot":"sheet-content",className:r("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(Z,{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(ae,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Et({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:r("flex flex-col gap-1.5 p-4",t),...a})}function Ot({className:t,...a}){return e.jsx(Y,{"data-slot":"sheet-title",className:r("text-foreground font-semibold",t),...a})}function Rt({className:t,...a}){return e.jsx(J,{"data-slot":"sheet-description",className:r("text-muted-foreground text-sm",t),...a})}function ne({delayDuration:t=0,...a}){return e.jsx(ye,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function At({...t}){return e.jsx(ne,{children:e.jsx(Ne,{"data-slot":"tooltip",...t})})}function zt({...t}){return e.jsx(Ce,{"data-slot":"tooltip-trigger",...t})}function Dt({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(_e,{children:e.jsxs(Se,{"data-slot":"tooltip-content",sideOffset:a,className:r("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 Pt(){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 It="sidebar_state",Tt=60*60*24*7,Lt="16rem",$t="18rem",Bt="3rem",Ht="b",oe=d.createContext(null);function A(){const t=d.useContext(oe);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Gt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...c}){const u=Pt(),[f,p]=d.useState(!1),[g,C]=d.useState(t),m=a??g,j=d.useCallback(h=>{const l=typeof h=="function"?h(m):h;n?n(l):C(l),document.cookie=`${It}=${l}; path=/; max-age=${Tt}`},[n,m]),v=d.useCallback(()=>u?p(h=>!h):j(h=>!h),[u,j,p]);d.useEffect(()=>{const h=l=>{l.key===Ht&&(l.metaKey||l.ctrlKey)&&(l.preventDefault(),v())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[v]);const y=m?"expanded":"collapsed",_=d.useMemo(()=>({state:y,open:m,setOpen:j,isMobile:u,openMobile:f,setOpenMobile:p,toggleSidebar:v}),[y,m,j,u,f,p,v]);return e.jsx(oe.Provider,{value:_,children:e.jsx(ne,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Lt,"--sidebar-width-icon":Bt,...o},className:r("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...c,children:i})})})}function qt({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...i}){const{isMobile:c,state:u,openMobile:f,setOpenMobile:p}=A();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:r("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...i,children:o}):c?e.jsx(_t,{open:f,onOpenChange:p,...i,children:e.jsxs(Mt,{"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":$t},side:t,children:[e.jsxs(Et,{className:"sr-only",children:[e.jsx(Ot,{children:"Sidebar"}),e.jsx(Rt,{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":u,"data-collapsible":u==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:r("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:r("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),...i,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 Ft({className:t,onClick:a,...n}){const{toggleSidebar:s}=A();return e.jsxs(O,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:r("size-7",t),onClick:o=>{a==null||a(o),s()},...n,children:[e.jsx(tt,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Vt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r("flex flex-col gap-2 p-2",t),...a})}function Ut({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r("flex flex-col gap-2 p-2",t),...a})}function Kt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function S({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r("relative flex w-full min-w-0 flex-col p-2",t),...a})}function B({className:t,asChild:a=!1,...n}){const s=a?R:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:r("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 H({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r("w-full text-sm",t),...a})}function G({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r("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:r("group/menu-item relative",t),...a})}const Wt=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:i,...c}){const u=t?R:"button",{isMobile:f,state:p}=A(),g=e.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:r(Wt({variant:n,size:s}),i),...c});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(At,{children:[e.jsx(zt,{asChild:!0,children:g}),e.jsx(Dt,{side:"right",align:"center",hidden:p!=="collapsed"||f,...o})]})):g}function Qt({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:r("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 Xt({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const i=t?R:"a";return e.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:r("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 q({singleton:t}){const{data:a}=W(),{data:n}=me();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(ue,{to:t?`/admin/dashboard/${s}/default`:`/admin/dashboard/${s}`,className:({isActive:i,isPending:c})=>c?"pending":i?"active":"",children:({isActive:i})=>e.jsxs(Xt,{isActive:i,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 z="Collapsible",[Zt,ba]=Ae(z),[Yt,D]=Zt(z),ie=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:c,...u}=t,[f=!1,p]=Re({prop:s,defaultProp:o,onChange:c});return e.jsx(Yt,{scope:n,disabled:i,contentId:Me(),open:f,onOpenToggle:d.useCallback(()=>p(g=>!g),[p]),children:e.jsx(k.div,{"data-state":I(f),"data-disabled":i?"":void 0,...u,ref:a})})});ie.displayName=z;var re="CollapsibleTrigger",de=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=D(re,n);return e.jsx(k.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:ze(t.onClick,o.onOpenToggle)})});de.displayName=re;var P="CollapsibleContent",le=d.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=D(P,t.__scopeCollapsible);return e.jsx(De,{present:n||o.open,children:({present:i})=>e.jsx(Jt,{...s,ref:a,present:i})})});le.displayName=P;var Jt=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=t,c=D(P,n),[u,f]=d.useState(s),p=d.useRef(null),g=Oe(a,p),C=d.useRef(0),m=C.current,j=d.useRef(0),v=j.current,y=c.open||u,_=d.useRef(y),h=d.useRef(void 0);return d.useEffect(()=>{const l=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(l)},[]),Pe(()=>{const l=p.current;if(l){h.current=h.current||{transitionDuration:l.style.transitionDuration,animationName:l.style.animationName},l.style.transitionDuration="0s",l.style.animationName="none";const T=l.getBoundingClientRect();C.current=T.height,j.current=T.width,_.current||(l.style.transitionDuration=h.current.transitionDuration,l.style.animationName=h.current.animationName),f(s)}},[c.open,s]),e.jsx(k.div,{"data-state":I(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!y,...i,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 ea=ie;function F({...t}){return e.jsx(ea,{"data-slot":"collapsible",...t})}function V({...t}){return e.jsx(de,{"data-slot":"collapsible-trigger",...t})}function U({...t}){return e.jsx(le,{"data-slot":"collapsible-content",...t})}function ta(){const t=be(),[a,n]=d.useState(!1),[s]=je(),[o]=ve(),[i]=we(),c=E(u=>u.auth.role);return e.jsxs(qt,{className:"z-50",children:[e.jsx(jt,{isOpen:a,setOpen:n}),e.jsx(Vt,{className:"h-14 justify-center",children:e.jsx(S,{children:e.jsx(N,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:"WEkEO"})})}),e.jsxs(Kt,{children:[e.jsxs(S,{children:[e.jsx(B,{children:"Content"}),e.jsx(H,{children:e.jsxs(G,{children:[e.jsx(F,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(Qe,{}),e.jsx("span",{children:"Collections"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(U,{children:e.jsx(q,{})})]})}),e.jsx(F,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(st,{}),e.jsx("span",{children:"Singles"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(U,{children:e.jsx(q,{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(S,{children:[e.jsx(B,{children:"Actions"}),e.jsx(H,{children:e.jsxs(G,{children:[c==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(b,{onClick:()=>o(),children:[e.jsx(Te,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(b,{onClick:()=>i(),children:[e.jsx($e,{}),e.jsx("span",{children:"Push to repo"})]})})]}),e.jsx(w,{children:e.jsxs(b,{onClick:()=>s(),children:[e.jsx(ot,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(S,{})]}),e.jsxs(Ut,{children:[e.jsx(b,{asChild:!0,children:e.jsxs(N,{to:K.PREVIEW_URL,children:["Preview",e.jsx(Ve,{className:"ml-auto"})]})}),e.jsx(b,{onClick:()=>n(!0),children:"About"}),e.jsxs(b,{onClick:()=>t(ge()),children:[e.jsx(Je,{}),"Log out"]})]})]})}function aa({children:t}){const a=he(),n=E(o=>o.auth.user),s=E(o=>o.auth.isLoading);return d.useEffect(()=>{!s&&!n&&a("/")},[s,a,n]),s||!n?null:t}function sa(){const{pathname:t}=pe(),{data:a}=W(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,i)=>e.jsxs(xe.Fragment,{children:[i.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 ga=ce(function(){return e.jsx(aa,{children:e.jsxs(Gt,{className:"flex h-full",children:[e.jsx(ta,{}),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(Ft,{}),e.jsx(Ct,{orientation:"vertical",className:"h-4"}),e.jsx(sa,{})]})}),e.jsx(fe,{})]})]})})});export{ga as default};