@isardsat/editorial-admin 6.0.0-canary-001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/build/client/assets/authSlice-KDhecIDl.js +2734 -0
- package/build/client/assets/button-O0EDocjF.js +1 -0
- package/build/client/assets/chevron-down-BMtosYlL.js +6 -0
- package/build/client/assets/chunk-KNED5TY2-CXj9yqcQ.js +51 -0
- package/build/client/assets/createLucideIcon-TQsNVzYU.js +21 -0
- package/build/client/assets/dashboard-Binq3-uL.js +1 -0
- package/build/client/assets/dashboard._collection-DCypgAsP.js +16 -0
- package/build/client/assets/dashboard._collection._document-B9dEIw39.js +1 -0
- package/build/client/assets/dashboard._collection.new-QbdwRouF.js +1 -0
- package/build/client/assets/dashboard._layout-DYXkFYBf.js +66 -0
- package/build/client/assets/dashboard.files-DVCxRHOl.js +36 -0
- package/build/client/assets/editorialApi-DCnC5eM9.js +1 -0
- package/build/client/assets/entry.client-B5Ca3clj.js +34 -0
- package/build/client/assets/home-wnsWYgD_.js +11 -0
- package/build/client/assets/index-B7e3fQ32.js +9 -0
- package/build/client/assets/index-B_FOxFgA.js +1 -0
- package/build/client/assets/index-C-iH5ItK.js +45 -0
- package/build/client/assets/index-DrhM6FV9.js +22 -0
- package/build/client/assets/index-G-cqIhgh.js +9 -0
- package/build/client/assets/input-BH49oaMa.js +6 -0
- package/build/client/assets/itemForm-CDbHkFXh.css +1 -0
- package/build/client/assets/itemForm-dtoqbEoC.js +90 -0
- package/build/client/assets/manifest-a0c3ecb0.js +1 -0
- package/build/client/assets/root-DHDQPxhg.js +1 -0
- package/build/client/assets/root-DS7N36v7.css +1 -0
- package/build/client/assets/trash-B3lfbu-5.js +6 -0
- package/build/client/assets/tslib.es6-CDuPK5Eb.js +1 -0
- package/build/client/assets/utils-DslUJpbf.js +1 -0
- package/build/client/favicon.ico +0 -0
- package/build/client/index.html +13 -0
- package/package.json +101 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,l as p}from"./chunk-KNED5TY2-CXj9yqcQ.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-TQsNVzYU.js";/**
|
|
2
|
+
* @license lucide-react v0.487.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],e=o("chevron-down",n);export{e as C};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var Aa=Object.defineProperty;var Na=(e,t,r)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var vt=(e,t,r)=>Na(e,typeof t!="symbol"?t+"":t,r);function $a(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 ql=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ia(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xn={exports:{}},kt={};/**
|
|
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 Fa=Symbol.for("react.transitional.element"),ja=Symbol.for("react.fragment");function Ln(e,t,r){var a=null;if(r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),"key"in t){r={};for(var n in t)n!=="key"&&(r[n]=t[n])}else r=t;return t=r.ref,{$$typeof:Fa,type:e,key:a,ref:t!==void 0?t:null,props:r}}kt.Fragment=ja;kt.jsx=Ln;kt.jsxs=Ln;xn.exports=kt;var Ql=xn.exports,Cn={exports:{}},F={};/**
|
|
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 ir=Symbol.for("react.transitional.element"),Ua=Symbol.for("react.portal"),Ha=Symbol.for("react.fragment"),za=Symbol.for("react.strict_mode"),Ba=Symbol.for("react.profiler"),Ya=Symbol.for("react.consumer"),Wa=Symbol.for("react.context"),Va=Symbol.for("react.forward_ref"),Ja=Symbol.for("react.suspense"),Ga=Symbol.for("react.memo"),Pn=Symbol.for("react.lazy"),zr=Symbol.iterator;function Ka(e){return e===null||typeof e!="object"?null:(e=zr&&e[zr]||e["@@iterator"],typeof e=="function"?e:null)}var Tn={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Mn=Object.assign,_n={};function ze(e,t,r){this.props=e,this.context=t,this.refs=_n,this.updater=r||Tn}ze.prototype.isReactComponent={};ze.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};ze.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Dn(){}Dn.prototype=ze.prototype;function lr(e,t,r){this.props=e,this.context=t,this.refs=_n,this.updater=r||Tn}var sr=lr.prototype=new Dn;sr.constructor=lr;Mn(sr,ze.prototype);sr.isPureReactComponent=!0;var Br=Array.isArray,W={H:null,A:null,T:null,S:null},On=Object.prototype.hasOwnProperty;function ur(e,t,r,a,n,o){return r=o.ref,{$$typeof:ir,type:e,key:t,ref:r!==void 0?r:null,props:o}}function Xa(e,t){return ur(e.type,t,void 0,void 0,void 0,e.props)}function cr(e){return typeof e=="object"&&e!==null&&e.$$typeof===ir}function qa(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Yr=/\/+/g;function Bt(e,t){return typeof e=="object"&&e!==null&&e.key!=null?qa(""+e.key):t.toString(36)}function Wr(){}function Qa(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Wr,Wr):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function He(e,t,r,a,n){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(o){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case ir:case Ua:l=!0;break;case Pn:return l=e._init,He(l(e._payload),t,r,a,n)}}if(l)return n=n(e),l=a===""?"."+Bt(e,0):a,Br(n)?(r="",l!=null&&(r=l.replace(Yr,"$&/")+"/"),He(n,t,r,"",function(u){return u})):n!=null&&(cr(n)&&(n=Xa(n,r+(n.key==null||e&&e.key===n.key?"":(""+n.key).replace(Yr,"$&/")+"/")+l)),t.push(n)),1;l=0;var s=a===""?".":a+":";if(Br(e))for(var i=0;i<e.length;i++)a=e[i],o=s+Bt(a,i),l+=He(a,t,r,o,n);else if(i=Ka(e),typeof i=="function")for(e=i.call(e),i=0;!(a=e.next()).done;)a=a.value,o=s+Bt(a,i++),l+=He(a,t,r,o,n);else if(o==="object"){if(typeof e.then=="function")return He(Qa(e),t,r,a,n);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function gt(e,t,r){if(e==null)return e;var a=[],n=0;return He(e,a,"","",function(o){return t.call(r,o,n++)}),a}function Za(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Vr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function eo(){}F.Children={map:gt,forEach:function(e,t,r){gt(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return gt(e,function(){t++}),t},toArray:function(e){return gt(e,function(t){return t})||[]},only:function(e){if(!cr(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};F.Component=ze;F.Fragment=Ha;F.Profiler=Ba;F.PureComponent=lr;F.StrictMode=za;F.Suspense=Ja;F.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W;F.act=function(){throw Error("act(...) is not supported in production builds of React.")};F.cache=function(e){return function(){return e.apply(null,arguments)}};F.cloneElement=function(e,t,r){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var a=Mn({},e.props),n=e.key,o=void 0;if(t!=null)for(l in t.ref!==void 0&&(o=void 0),t.key!==void 0&&(n=""+t.key),t)!On.call(t,l)||l==="key"||l==="__self"||l==="__source"||l==="ref"&&t.ref===void 0||(a[l]=t[l]);var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){for(var s=Array(l),i=0;i<l;i++)s[i]=arguments[i+2];a.children=s}return ur(e.type,n,void 0,void 0,o,a)};F.createContext=function(e){return e={$$typeof:Wa,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Ya,_context:e},e};F.createElement=function(e,t,r){var a,n={},o=null;if(t!=null)for(a in t.key!==void 0&&(o=""+t.key),t)On.call(t,a)&&a!=="key"&&a!=="__self"&&a!=="__source"&&(n[a]=t[a]);var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){for(var s=Array(l),i=0;i<l;i++)s[i]=arguments[i+2];n.children=s}if(e&&e.defaultProps)for(a in l=e.defaultProps,l)n[a]===void 0&&(n[a]=l[a]);return ur(e,o,void 0,void 0,null,n)};F.createRef=function(){return{current:null}};F.forwardRef=function(e){return{$$typeof:Va,render:e}};F.isValidElement=cr;F.lazy=function(e){return{$$typeof:Pn,_payload:{_status:-1,_result:e},_init:Za}};F.memo=function(e,t){return{$$typeof:Ga,type:e,compare:t===void 0?null:t}};F.startTransition=function(e){var t=W.T,r={};W.T=r;try{var a=e(),n=W.S;n!==null&&n(r,a),typeof a=="object"&&a!==null&&typeof a.then=="function"&&a.then(eo,Vr)}catch(o){Vr(o)}finally{W.T=t}};F.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()};F.use=function(e){return W.H.use(e)};F.useActionState=function(e,t,r){return W.H.useActionState(e,t,r)};F.useCallback=function(e,t){return W.H.useCallback(e,t)};F.useContext=function(e){return W.H.useContext(e)};F.useDebugValue=function(){};F.useDeferredValue=function(e,t){return W.H.useDeferredValue(e,t)};F.useEffect=function(e,t){return W.H.useEffect(e,t)};F.useId=function(){return W.H.useId()};F.useImperativeHandle=function(e,t,r){return W.H.useImperativeHandle(e,t,r)};F.useInsertionEffect=function(e,t){return W.H.useInsertionEffect(e,t)};F.useLayoutEffect=function(e,t){return W.H.useLayoutEffect(e,t)};F.useMemo=function(e,t){return W.H.useMemo(e,t)};F.useOptimistic=function(e,t){return W.H.useOptimistic(e,t)};F.useReducer=function(e,t,r){return W.H.useReducer(e,t,r)};F.useRef=function(e){return W.H.useRef(e)};F.useState=function(e){return W.H.useState(e)};F.useSyncExternalStore=function(e,t,r){return W.H.useSyncExternalStore(e,t,r)};F.useTransition=function(){return W.H.useTransition()};F.version="19.0.0";Cn.exports=F;var f=Cn.exports;const to=Ia(f),Zl=$a({__proto__:null,default:to},[f]);var ro=-1,no=-2,ao=-3,oo=-4,io=-5,lo=-6,so=-7,uo="B",co="D",kn="E",fo="M",ho="N",An="P",mo="R",po="S",yo="Y",vo="U",go="Z",Nn=class{constructor(){vt(this,"promise");vt(this,"resolve");vt(this,"reject");this.promise=new Promise((t,r)=>{this.resolve=t,this.reject=r})}};function wo(){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 Yt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function Qt(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return Jr.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,Jr.call(this,a)}function Jr(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 so:u(void 0);continue;case io:u(null);continue;case no:u(NaN);continue;case lo:u(1/0);continue;case ao:u(-1/0);continue;case oo: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,y,g]=d;switch(m){case co:u(t[i]=new Date(y));continue;case vo:u(t[i]=new URL(y));continue;case uo:u(t[i]=BigInt(y));continue;case mo:u(t[i]=new RegExp(y,g));continue;case yo:u(t[i]=Symbol.for(y));continue;case po:const E=new Set;t[i]=E;for(let T=1;T<d.length;T++)l.push([d[T],h=>{E.add(h)}]);u(E);continue;case fo:const R=new Map;t[i]=R;for(let T=1;T<d.length;T+=2){const h=[];l.push([d[T+1],P=>{h[1]=P}]),l.push([d[T],P=>{h[0]=P}]),s.push(()=>{R.set(h[0],h[1])})}u(R);continue;case ho:const w=Object.create(null);t[i]=w;for(const T of Object.keys(y).reverse()){const h=[];l.push([y[T],P=>{h[1]=P}]),l.push([Number(T.slice(1)),P=>{h[0]=P}]),s.push(()=>{w[h[0]]=h[1]})}u(w);continue;case An:if(t[y])u(t[i]=t[y]);else{const T=new Nn;a[y]=T,u(t[i]=T.promise)}continue;case kn:const[,S,x]=d;let L=x&&Yt&&Yt[x]?new Yt[x](S):new Error(S);t[i]=L,u(L);continue;case go:u(t[i]=t[y]);continue;default:if(Array.isArray(n)){const T=[],h=d.slice(1);for(let P=0;P<h.length;P++){const A=h[P];l.push([A,D=>{T[P]=D}])}s.push(()=>{for(const P of n){const A=P(d[0],...T);if(A){u(t[i]=A.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const m=[];t[i]=m;for(let y=0;y<d.length;y++){const g=d[y];g!==ro&&l.push([g,E=>{m[y]=E}])}u(m);continue}else{const m={};t[i]=m;for(const y of Object.keys(d).reverse()){const g=[];l.push([d[y],E=>{g[1]=E}]),l.push([Number(y.slice(1)),E=>{g[0]=E}]),s.push(()=>{m[g[0]]=g[1]})}u(m);continue}}for(;s.length>0;)s.pop()();return o}async function Eo(e,t){const{plugins:r}=t??{},a=new Nn,n=e.pipeThrough(wo()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},l=await Ro.call(o,n);let s=a.promise;return l.done?a.resolve():s=bo.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 Ro(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:Qt.call(this,r)}}async function bo(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case An:{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=Qt.call(this,s);o.resolve(i);break}case kn:{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=Qt.call(this,s);o.reject(i);break}default:throw new SyntaxError}t=await e.read()}}var dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.parse=Mo;dr.serialize=_o;const So=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,xo=/^[\u0021-\u003A\u003C-\u007E]*$/,Lo=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Co=/^[\u0020-\u003A\u003D-\u007E]*$/,Po=Object.prototype.toString,To=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function Mo(e,t){const r=new To,a=e.length;if(a<2)return r;const n=(t==null?void 0:t.decode)||Do;let o=0;do{const l=e.indexOf("=",o);if(l===-1)break;const s=e.indexOf(";",o),i=s===-1?a:s;if(l>i){o=e.lastIndexOf(";",l-1)+1;continue}const u=Gr(e,o,l),d=Kr(e,l,u),m=e.slice(u,d);if(r[m]===void 0){let y=Gr(e,l+1,i),g=Kr(e,i,y);const E=n(e.slice(y,g));r[m]=E}o=i+1}while(o<a);return r}function Gr(e,t,r){do{const a=e.charCodeAt(t);if(a!==32&&a!==9)return t}while(++t<r);return r}function Kr(e,t,r){for(;t>r;){const a=e.charCodeAt(--t);if(a!==32&&a!==9)return t+1}return r}function _o(e,t,r){const a=(r==null?void 0:r.encode)||encodeURIComponent;if(!So.test(e))throw new TypeError(`argument name is invalid: ${e}`);const n=a(t);if(!xo.test(n))throw new TypeError(`argument val is invalid: ${t}`);let o=e+"="+n;if(!r)return o;if(r.maxAge!==void 0){if(!Number.isInteger(r.maxAge))throw new TypeError(`option maxAge is invalid: ${r.maxAge}`);o+="; Max-Age="+r.maxAge}if(r.domain){if(!Lo.test(r.domain))throw new TypeError(`option domain is invalid: ${r.domain}`);o+="; Domain="+r.domain}if(r.path){if(!Co.test(r.path))throw new TypeError(`option path is invalid: ${r.path}`);o+="; Path="+r.path}if(r.expires){if(!Oo(r.expires)||!Number.isFinite(r.expires.valueOf()))throw new TypeError(`option expires is invalid: ${r.expires}`);o+="; Expires="+r.expires.toUTCString()}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.partitioned&&(o+="; Partitioned"),r.priority)switch(typeof r.priority=="string"?r.priority.toLowerCase():void 0){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${r.priority}`)}if(r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:case"strict":o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"none":o+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${r.sameSite}`)}return o}function Do(e){if(e.indexOf("%")===-1)return e;try{return decodeURIComponent(e)}catch{return e}}function Oo(e){return Po.call(e)==="[object Date]"}/**
|
|
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 $n=e=>{throw TypeError(e)},ko=(e,t,r)=>t.has(e)||$n("Cannot "+r),Wt=(e,t,r)=>(ko(e,t,"read from private field"),r?r.call(e):t.get(e)),Ao=(e,t,r)=>t.has(e)?$n("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Xr="popstate";function ts(e={}){function t(a,n){let{pathname:o,search:l,hash:s}=a.location;return nt("",{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:be(n)}return $o(t,r,null,e)}function j(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function G(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function No(){return Math.random().toString(36).substring(2,10)}function qr(e,t){return{usr:e.state,key:e.key,idx:t}}function nt(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?xe(t):t,state:r,key:t&&t.key||a||No()}}function be({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 xe(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 $o(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 w=d(),S=w==null?null:w-u;u=w,i&&i({action:s,location:R.location,delta:S})}function y(w,S){s="PUSH";let x=nt(R.location,w,S);u=d()+1;let L=qr(x,u),T=R.createHref(x);try{l.pushState(L,"",T)}catch(h){if(h instanceof DOMException&&h.name==="DataCloneError")throw h;n.location.assign(T)}o&&i&&i({action:s,location:R.location,delta:1})}function g(w,S){s="REPLACE";let x=nt(R.location,w,S);u=d();let L=qr(x,u),T=R.createHref(x);l.replaceState(L,"",T),o&&i&&i({action:s,location:R.location,delta:0})}function E(w){let S=n.location.origin!=="null"?n.location.origin:n.location.href,x=typeof w=="string"?w:be(w);return x=x.replace(/ $/,"%20"),j(S,`No window.location.(origin|href) available to create URL for href: ${x}`),new URL(x,S)}let R={get action(){return s},get location(){return e(n,l)},listen(w){if(i)throw new Error("A history only accepts one active listener");return n.addEventListener(Xr,m),i=w,()=>{n.removeEventListener(Xr,m),i=null}},createHref(w){return t(n,w)},createURL:E,encodeLocation(w){let S=E(w);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:g,go(w){return l.go(w)}};return R}var et,Qr=class{constructor(e){if(Ao(this,et,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Wt(this,et).has(e))return Wt(this,et).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Wt(this,et).set(e,t)}};et=new WeakMap;var Io=new Set(["lazy","caseSensitive","path","id","index","children"]);function Fo(e){return Io.has(e)}var jo=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function Uo(e){return jo.has(e)}function Ho(e){return e.index===!0}function _t(e,t,r=[],a={}){return e.map((n,o)=>{let l=[...r,String(o)],s=typeof n.id=="string"?n.id:l.join("-");if(j(n.index!==!0||!n.children,"Cannot specify children on an index route"),j(!a[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Ho(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=_t(n.children,t,l,a)),i}})}function ge(e,t,r="/"){return Lt(e,t,r,!1)}function Lt(e,t,r,a){let n=typeof t=="string"?xe(t):t,o=ie(n.pathname||"/",r);if(o==null)return null;let l=Fn(e);zo(l);let s=null;for(let i=0;s==null&&i<l.length;++i){let u=Zo(o);s=qo(l[i],u,a)}return s}function In(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 Fn(e,t=[],r=[],a=""){let n=(o,l,s)=>{let i={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};i.relativePath.startsWith("/")&&(j(i.relativePath.startsWith(a),`Absolute route path "${i.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),i.relativePath=i.relativePath.slice(a.length));let u=he([a,i.relativePath]),d=r.concat(i);o.children&&o.children.length>0&&(j(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),Fn(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:Ko(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 jn(o.path))n(o,l,i)}),t}function jn(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=jn(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 zo(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Xo(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Bo=/^:[\w-]+$/,Yo=3,Wo=2,Vo=1,Jo=10,Go=-2,Zr=e=>e==="*";function Ko(e,t){let r=e.split("/"),a=r.length;return r.some(Zr)&&(a+=Go),t&&(a+=Wo),r.filter(n=>!Zr(n)).reduce((n,o)=>n+(Bo.test(o)?Yo:o===""?Vo:Jo),a)}function Xo(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 qo(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=Dt({path:i.relativePath,caseSensitive:i.caseSensitive,end:u},d),y=i.route;if(!m&&u&&r&&!a[a.length-1].route.index&&(m=Dt({path:i.relativePath,caseSensitive:i.caseSensitive,end:!1},d)),!m)return null;Object.assign(n,m.params),l.push({params:n,pathname:he([o,m.pathname]),pathnameBase:ri(he([o,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(o=he([o,m.pathnameBase]))}return l}function Dt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Qo(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},y)=>{if(d==="*"){let E=s[y]||"";l=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const g=s[y];return m&&!g?u[d]=void 0:u[d]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function Qo(e,t=!1,r=!0){G(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 Zo(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return G(!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 ie(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 ei(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?xe(e):e;return{pathname:r?r.startsWith("/")?r:ti(r,t):t,search:ni(a),hash:ai(n)}}function ti(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Vt(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Un(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function fr(e){let t=Un(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function hr(e,t,r,a=!1){let n;typeof e=="string"?n=xe(e):(n={...e},j(!n.pathname||!n.pathname.includes("?"),Vt("?","pathname","search",n)),j(!n.pathname||!n.pathname.includes("#"),Vt("#","pathname","hash",n)),j(!n.search||!n.search.includes("#"),Vt("#","search","hash",n)));let o=e===""||n.pathname==="",l=o?"/":n.pathname,s;if(l==null)s=r;else{let m=t.length-1;if(!a&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),m-=1;n.pathname=y.join("/")}s=m>=0?t[m]:"/"}let i=ei(n,s),u=l&&l!=="/"&&l.endsWith("/"),d=(o||l===".")&&r.endsWith("/");return!i.pathname.endsWith("/")&&(u||d)&&(i.pathname+="/"),i}var he=e=>e.join("/").replace(/\/\/+/g,"/"),ri=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ni=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ai=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,oi=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function ii(e,t){return new oi(e,typeof t=="number"?{status:t}:t)}var li=(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})},Se=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 ke(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Hn=["POST","PUT","PATCH","DELETE"],si=new Set(Hn),ui=["GET",...Hn],ci=new Set(ui),di=new Set([301,302,303,307,308]),fi=new Set([307,308]),Jt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},hi={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},qe={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},mr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mi=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),zn="remix-router-transitions",Bn=Symbol("ResetLoaderData");function rs(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";j(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.mapRouteProperties||mi,n={},o=_t(e.routes,a,void 0,n),l,s=e.basename||"/",i=e.dataStrategy||Ei,u={unstable_middleware:!1,...e.future},d=null,m=new Set,y=null,g=null,E=null,R=e.hydrationData!=null,w=ge(o,e.history.location,s),S=!1,x=null;if(w==null&&!e.patchRoutesOnNavigation){let c=le(404,{pathname:e.history.location.pathname}),{matches:p,route:v}=mn(o);w=p,x={[v.id]:c}}w&&!e.hydrationData&&ft(w,o,e.history.location.pathname).active&&(w=null);let L;if(w)if(w.some(c=>c.route.lazy))L=!1;else if(!w.some(c=>c.route.loader))L=!0;else{let c=e.hydrationData?e.hydrationData.loaderData:null,p=e.hydrationData?e.hydrationData.errors:null;if(p){let v=w.findIndex(b=>p[b.route.id]!==void 0);L=w.slice(0,v+1).every(b=>!er(b.route,c,p))}else L=w.every(v=>!er(v.route,c,p))}else{L=!1,w=[];let c=ft(null,o,e.history.location.pathname);c.active&&c.matches&&(S=!0,w=c.matches)}let T,h={historyAction:e.history.action,location:e.history.location,matches:w,initialized:L,navigation:Jt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},P="POP",A=!1,D,U=!1,z=new Map,q=null,ne=!1,te=!1,Le=new Set,Y=new Map,ut=0,We=-1,Ne=new Map,pe=new Set,$e=new Map,Ve=new Map,de=new Set,Ce=new Map,ct,Pe=null;function va(){if(d=e.history.listen(({action:c,location:p,delta:v})=>{if(ct){ct(),ct=void 0;return}G(Ce.size===0||v!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let b=Fr({currentLocation:h.location,nextLocation:p,historyAction:c});if(b&&v!=null){let C=new Promise($=>{ct=$});e.history.go(v*-1),dt(b,{state:"blocked",location:p,proceed(){dt(b,{state:"proceeding",proceed:void 0,reset:void 0,location:p}),C.then(()=>e.history.go(v))},reset(){let $=new Map(h.blockers);$.set(b,qe),re({blockers:$})}});return}return Te(c,p)}),r){Di(t,z);let c=()=>Oi(t,z);t.addEventListener("pagehide",c),q=()=>t.removeEventListener("pagehide",c)}return h.initialized||Te("POP",h.location,{initialHydration:!0}),T}function ga(){d&&d(),q&&q(),m.clear(),D&&D.abort(),h.fetchers.forEach((c,p)=>Ut(p)),h.blockers.forEach((c,p)=>Ir(p))}function wa(c){return m.add(c),()=>m.delete(c)}function re(c,p={}){h={...h,...c};let v=[],b=[];h.fetchers.forEach((C,$)=>{C.state==="idle"&&(de.has($)?v.push($):b.push($))}),de.forEach(C=>{!h.fetchers.has(C)&&!Y.has(C)&&v.push(C)}),[...m].forEach(C=>C(h,{deletedFetchers:v,viewTransitionOpts:p.viewTransitionOpts,flushSync:p.flushSync===!0})),v.forEach(C=>Ut(C)),b.forEach(C=>h.fetchers.delete(C))}function Ie(c,p,{flushSync:v}={}){var M,O;let b=h.actionData!=null&&h.navigation.formMethod!=null&&ue(h.navigation.formMethod)&&h.navigation.state==="loading"&&((M=c.state)==null?void 0:M._isRedirect)!==!0,C;p.actionData?Object.keys(p.actionData).length>0?C=p.actionData:C=null:b?C=h.actionData:C=null;let $=p.loaderData?fn(h.loaderData,p.loaderData,p.matches||[],p.errors):h.loaderData,N=h.blockers;N.size>0&&(N=new Map(N),N.forEach((I,H)=>N.set(H,qe)));let _=A===!0||h.navigation.formMethod!=null&&ue(h.navigation.formMethod)&&((O=c.state)==null?void 0:O._isRedirect)!==!0;l&&(o=l,l=void 0),ne||P==="POP"||(P==="PUSH"?e.history.push(c,c.state):P==="REPLACE"&&e.history.replace(c,c.state));let k;if(P==="POP"){let I=z.get(h.location.pathname);I&&I.has(c.pathname)?k={currentLocation:h.location,nextLocation:c}:z.has(c.pathname)&&(k={currentLocation:c,nextLocation:h.location})}else if(U){let I=z.get(h.location.pathname);I?I.add(c.pathname):(I=new Set([c.pathname]),z.set(h.location.pathname,I)),k={currentLocation:h.location,nextLocation:c}}re({...p,actionData:C,loaderData:$,historyAction:P,location:c,initialized:!0,navigation:Jt,revalidation:"idle",restoreScrollPosition:Ur(c,p.matches||h.matches),preventScrollReset:_,blockers:N},{viewTransitionOpts:k,flushSync:v===!0}),P="POP",A=!1,U=!1,ne=!1,te=!1,Pe==null||Pe.resolve(),Pe=null}async function _r(c,p){if(typeof c=="number"){e.history.go(c);return}let v=Zt(h.location,h.matches,s,c,p==null?void 0:p.fromRouteId,p==null?void 0:p.relative),{path:b,submission:C,error:$}=en(!1,v,p),N=h.location,_=nt(h.location,b,p&&p.state);_={..._,...e.history.encodeLocation(_)};let k=p&&p.replace!=null?p.replace:void 0,M="PUSH";k===!0?M="REPLACE":k===!1||C!=null&&ue(C.formMethod)&&C.formAction===h.location.pathname+h.location.search&&(M="REPLACE");let O=p&&"preventScrollReset"in p?p.preventScrollReset===!0:void 0,I=(p&&p.flushSync)===!0,H=Fr({currentLocation:N,nextLocation:_,historyAction:M});if(H){dt(H,{state:"blocked",location:_,proceed(){dt(H,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),_r(c,p)},reset(){let V=new Map(h.blockers);V.set(H,qe),re({blockers:V})}});return}await Te(M,_,{submission:C,pendingError:$,preventScrollReset:O,replace:p&&p.replace,enableViewTransition:p&&p.viewTransition,flushSync:I})}function Ea(){Pe||(Pe=ki()),jt(),re({revalidation:"loading"});let c=Pe.promise;return h.navigation.state==="submitting"?c:h.navigation.state==="idle"?(Te(h.historyAction,h.location,{startUninterruptedRevalidation:!0}),c):(Te(P||h.historyAction,h.navigation.location,{overrideNavigation:h.navigation,enableViewTransition:U===!0}),c)}async function Te(c,p,v){D&&D.abort(),D=null,P=c,ne=(v&&v.startUninterruptedRevalidation)===!0,_a(h.location,h.matches),A=(v&&v.preventScrollReset)===!0,U=(v&&v.enableViewTransition)===!0;let b=l||o,C=v&&v.overrideNavigation,$=v!=null&&v.initialHydration&&h.matches&&h.matches.length>0&&!S?h.matches:ge(b,p,s),N=(v&&v.flushSync)===!0;if($&&h.initialized&&!te&&Ci(h.location,p)&&!(v&&v.submission&&ue(v.submission.formMethod))){Ie(p,{matches:$},{flushSync:N});return}let _=ft($,b,p.pathname);if(_.active&&_.matches&&($=_.matches),!$){let{error:K,notFoundMatches:J,route:Q}=Ht(p.pathname);Ie(p,{matches:J,loaderData:{},errors:{[Q.id]:K}},{flushSync:N});return}D=new AbortController;let k=Ue(e.history,p,D.signal,v&&v.submission),M=new Qr(e.unstable_getContext?await e.unstable_getContext():void 0),O;if(v&&v.pendingError)O=[De($).route.id,{type:"error",error:v.pendingError}];else if(v&&v.submission&&ue(v.submission.formMethod)){let K=await Ra(k,p,v.submission,$,M,_.active,{replace:v.replace,flushSync:N});if(K.shortCircuited)return;if(K.pendingActionResult){let[J,Q]=K.pendingActionResult;if(ae(Q)&&ke(Q.error)&&Q.error.status===404){D=null,Ie(p,{matches:K.matches,loaderData:{},errors:{[J]:Q.error}});return}}$=K.matches||$,O=K.pendingActionResult,C=Gt(p,v.submission),N=!1,_.active=!1,k=Ue(e.history,k.url,k.signal)}let{shortCircuited:I,matches:H,loaderData:V,errors:Z}=await ba(k,p,$,M,_.active,C,v&&v.submission,v&&v.fetcherSubmission,v&&v.replace,v&&v.initialHydration===!0,N,O);I||(D=null,Ie(p,{matches:H||$,...hn(O),loaderData:V,errors:Z}))}async function Ra(c,p,v,b,C,$,N={}){jt();let _=Mi(p,v);if(re({navigation:_},{flushSync:N.flushSync===!0}),$){let O=await ht(b,p.pathname,c.signal);if(O.type==="aborted")return{shortCircuited:!0};if(O.type==="error"){let I=De(O.partialMatches).route.id;return{matches:O.partialMatches,pendingActionResult:[I,{type:"error",error:O.error}]}}else if(O.matches)b=O.matches;else{let{notFoundMatches:I,error:H,route:V}=Ht(p.pathname);return{matches:I,pendingActionResult:[V.id,{type:"error",error:H}]}}}let k,M=rt(b,p);if(!M.route.action&&!M.route.lazy)k={type:"error",error:le(405,{method:c.method,pathname:p.pathname,routeId:M.route.id})};else{let O=await Je("action",c,[M],b,C,null);if(k=O[M.route.id],!k){for(let I of b)if(O[I.route.id]){k=O[I.route.id];break}}if(c.signal.aborted)return{shortCircuited:!0}}if(Oe(k)){let O;return N&&N.replace!=null?O=N.replace:O=un(k.response.headers.get("Location"),new URL(c.url),s)===h.location.pathname+h.location.search,await Me(c,k,!0,{submission:v,replace:O}),{shortCircuited:!0}}if(ae(k)){let O=De(b,M.route.id);return(N&&N.replace)!==!0&&(P="PUSH"),{matches:b,pendingActionResult:[O.route.id,k]}}return{matches:b,pendingActionResult:[M.route.id,k]}}async function ba(c,p,v,b,C,$,N,_,k,M,O,I){let H=$||Gt(p,N),V=N||_||yn(H),Z=!ne&&!M;if(C){if(Z){let ee=Dr(I);re({navigation:H,...ee!==void 0?{actionData:ee}:{}},{flushSync:O})}let B=await ht(v,p.pathname,c.signal);if(B.type==="aborted")return{shortCircuited:!0};if(B.type==="error"){let ee=De(B.partialMatches).route.id;return{matches:B.partialMatches,loaderData:{},errors:{[ee]:B.error}}}else if(B.matches)v=B.matches;else{let{error:ee,notFoundMatches:yt,route:Xe}=Ht(p.pathname);return{matches:yt,loaderData:{},errors:{[Xe.id]:ee}}}}let K=l||o,[J,Q]=rn(e.history,h,v,V,p,M===!0,te,Le,de,$e,pe,K,s,I);if(We=++ut,J.length===0&&Q.length===0){let B=Nr();return Ie(p,{matches:v,loaderData:{},errors:I&&ae(I[1])?{[I[0]]:I[1].error}:null,...hn(I),...B?{fetchers:new Map(h.fetchers)}:{}},{flushSync:O}),{shortCircuited:!0}}if(Z){let B={};if(!C){B.navigation=H;let ee=Dr(I);ee!==void 0&&(B.actionData=ee)}Q.length>0&&(B.fetchers=Sa(Q)),re(B,{flushSync:O})}Q.forEach(B=>{Ee(B.key),B.controller&&Y.set(B.key,B.controller)});let Fe=()=>Q.forEach(B=>Ee(B.key));D&&D.signal.addEventListener("abort",Fe);let{loaderResults:Ge,fetcherResults:ve}=await Or(v,J,Q,c,b);if(c.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",Fe),Q.forEach(B=>Y.delete(B.key));let fe=wt(Ge);if(fe)return await Me(c,fe.result,!0,{replace:k}),{shortCircuited:!0};if(fe=wt(ve),fe)return pe.add(fe.key),await Me(c,fe.result,!0,{replace:k}),{shortCircuited:!0};let{loaderData:zt,errors:Ke}=dn(h,v,Ge,I,Q,ve);M&&h.errors&&(Ke={...h.errors,...Ke});let _e=Nr(),mt=$r(We),pt=_e||mt||Q.length>0;return{matches:v,loaderData:zt,errors:Ke,...pt?{fetchers:new Map(h.fetchers)}:{}}}function Dr(c){if(c&&!ae(c[1]))return{[c[0]]:c[1].data};if(h.actionData)return Object.keys(h.actionData).length===0?null:h.actionData}function Sa(c){return c.forEach(p=>{let v=h.fetchers.get(p.key),b=Qe(void 0,v?v.data:void 0);h.fetchers.set(p.key,b)}),new Map(h.fetchers)}async function xa(c,p,v,b){Ee(c);let C=(b&&b.flushSync)===!0,$=l||o,N=Zt(h.location,h.matches,s,v,p,b==null?void 0:b.relative),_=ge($,N,s),k=ft(_,$,N);if(k.active&&k.matches&&(_=k.matches),!_){ye(c,p,le(404,{pathname:N}),{flushSync:C});return}let{path:M,submission:O,error:I}=en(!0,N,b);if(I){ye(c,p,I,{flushSync:C});return}let H=rt(_,M),V=new Qr(e.unstable_getContext?await e.unstable_getContext():void 0),Z=(b&&b.preventScrollReset)===!0;if(O&&ue(O.formMethod)){await La(c,p,M,H,_,V,k.active,C,Z,O);return}$e.set(c,{routeId:p,path:M}),await Ca(c,p,M,H,_,V,k.active,C,Z,O)}async function La(c,p,v,b,C,$,N,_,k,M){jt(),$e.delete(c);function O(X){if(!X.route.action&&!X.route.lazy){let je=le(405,{method:M.formMethod,pathname:v,routeId:p});return ye(c,p,je,{flushSync:_}),!0}return!1}if(!N&&O(b))return;let I=h.fetchers.get(c);we(c,_i(M,I),{flushSync:_});let H=new AbortController,V=Ue(e.history,v,H.signal,M);if(N){let X=await ht(C,v,V.signal,c);if(X.type==="aborted")return;if(X.type==="error"){ye(c,p,X.error,{flushSync:_});return}else if(X.matches){if(C=X.matches,b=rt(C,v),O(b))return}else{ye(c,p,le(404,{pathname:v}),{flushSync:_});return}}Y.set(c,H);let Z=ut,J=(await Je("action",V,[b],C,$,c))[b.route.id];if(V.signal.aborted){Y.get(c)===H&&Y.delete(c);return}if(de.has(c)){if(Oe(J)||ae(J)){we(c,Re(void 0));return}}else{if(Oe(J))if(Y.delete(c),We>Z){we(c,Re(void 0));return}else return pe.add(c),we(c,Qe(M)),Me(V,J,!1,{fetcherSubmission:M,preventScrollReset:k});if(ae(J)){ye(c,p,J.error);return}}let Q=h.navigation.location||h.location,Fe=Ue(e.history,Q,H.signal),Ge=l||o,ve=h.navigation.state!=="idle"?ge(Ge,h.navigation.location,s):h.matches;j(ve,"Didn't find any matches after fetcher action");let fe=++ut;Ne.set(c,fe);let zt=Qe(M,J.data);h.fetchers.set(c,zt);let[Ke,_e]=rn(e.history,h,ve,M,Q,!1,te,Le,de,$e,pe,Ge,s,[b.route.id,J]);_e.filter(X=>X.key!==c).forEach(X=>{let je=X.key,Hr=h.fetchers.get(je),ka=Qe(void 0,Hr?Hr.data:void 0);h.fetchers.set(je,ka),Ee(je),X.controller&&Y.set(je,X.controller)}),re({fetchers:new Map(h.fetchers)});let mt=()=>_e.forEach(X=>Ee(X.key));H.signal.addEventListener("abort",mt);let{loaderResults:pt,fetcherResults:B}=await Or(ve,Ke,_e,Fe,$);if(H.signal.aborted)return;H.signal.removeEventListener("abort",mt),Ne.delete(c),Y.delete(c),_e.forEach(X=>Y.delete(X.key));let ee=wt(pt);if(ee)return Me(Fe,ee.result,!1,{preventScrollReset:k});if(ee=wt(B),ee)return pe.add(ee.key),Me(Fe,ee.result,!1,{preventScrollReset:k});let{loaderData:yt,errors:Xe}=dn(h,ve,pt,void 0,_e,B);if(h.fetchers.has(c)){let X=Re(J.data);h.fetchers.set(c,X)}$r(fe),h.navigation.state==="loading"&&fe>We?(j(P,"Expected pending action"),D&&D.abort(),Ie(h.navigation.location,{matches:ve,loaderData:yt,errors:Xe,fetchers:new Map(h.fetchers)})):(re({errors:Xe,loaderData:fn(h.loaderData,yt,ve,Xe),fetchers:new Map(h.fetchers)}),te=!1)}async function Ca(c,p,v,b,C,$,N,_,k,M){let O=h.fetchers.get(c);we(c,Qe(M,O?O.data:void 0),{flushSync:_});let I=new AbortController,H=Ue(e.history,v,I.signal);if(N){let J=await ht(C,v,H.signal,c);if(J.type==="aborted")return;if(J.type==="error"){ye(c,p,J.error,{flushSync:_});return}else if(J.matches)C=J.matches,b=rt(C,v);else{ye(c,p,le(404,{pathname:v}),{flushSync:_});return}}Y.set(c,I);let V=ut,K=(await Je("loader",H,[b],C,$,c))[b.route.id];if(Y.get(c)===I&&Y.delete(c),!H.signal.aborted){if(de.has(c)){we(c,Re(void 0));return}if(Oe(K))if(We>V){we(c,Re(void 0));return}else{pe.add(c),await Me(H,K,!1,{preventScrollReset:k});return}if(ae(K)){ye(c,p,K.error);return}we(c,Re(K.data))}}async function Me(c,p,v,{submission:b,fetcherSubmission:C,preventScrollReset:$,replace:N}={}){p.response.headers.has("X-Remix-Revalidate")&&(te=!0);let _=p.response.headers.get("Location");j(_,"Expected a Location header on the redirect Response"),_=un(_,new URL(c.url),s);let k=nt(h.location,_,{_isRedirect:!0});if(r){let Z=!1;if(p.response.headers.has("X-Remix-Reload-Document"))Z=!0;else if(mr.test(_)){const K=e.history.createURL(_);Z=K.origin!==t.location.origin||ie(K.pathname,s)==null}if(Z){N?t.location.replace(_):t.location.assign(_);return}}D=null;let M=N===!0||p.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:O,formAction:I,formEncType:H}=h.navigation;!b&&!C&&O&&I&&H&&(b=yn(h.navigation));let V=b||C;if(fi.has(p.response.status)&&V&&ue(V.formMethod))await Te(M,k,{submission:{...V,formAction:_},preventScrollReset:$||A,enableViewTransition:v?U:void 0});else{let Z=Gt(k,b);await Te(M,k,{overrideNavigation:Z,fetcherSubmission:C,preventScrollReset:$||A,enableViewTransition:v?U:void 0})}}async function Je(c,p,v,b,C,$){let N,_={};try{N=await Ri(i,c,p,v,b,$,n,a,C)}catch(k){return v.forEach(M=>{_[M.route.id]={type:"error",error:k}}),_}for(let[k,M]of Object.entries(N))if(Pi(M)){let O=M.result;_[k]={type:"redirect",response:xi(O,p,k,b,s)}}else _[k]=await Si(M);return _}async function Or(c,p,v,b,C){let $=Je("loader",b,p,c,C,null),N=Promise.all(v.map(async M=>{if(M.matches&&M.match&&M.controller){let I=(await Je("loader",Ue(e.history,M.path,M.controller.signal),[M.match],M.matches,C,M.key))[M.match.route.id];return{[M.key]:I}}else return Promise.resolve({[M.key]:{type:"error",error:le(404,{pathname:M.path})}})})),_=await $,k=(await N).reduce((M,O)=>Object.assign(M,O),{});return{loaderResults:_,fetcherResults:k}}function jt(){te=!0,$e.forEach((c,p)=>{Y.has(p)&&Le.add(p),Ee(p)})}function we(c,p,v={}){h.fetchers.set(c,p),re({fetchers:new Map(h.fetchers)},{flushSync:(v&&v.flushSync)===!0})}function ye(c,p,v,b={}){let C=De(h.matches,p);Ut(c),re({errors:{[C.route.id]:v},fetchers:new Map(h.fetchers)},{flushSync:(b&&b.flushSync)===!0})}function kr(c){return Ve.set(c,(Ve.get(c)||0)+1),de.has(c)&&de.delete(c),h.fetchers.get(c)||hi}function Ut(c){let p=h.fetchers.get(c);Y.has(c)&&!(p&&p.state==="loading"&&Ne.has(c))&&Ee(c),$e.delete(c),Ne.delete(c),pe.delete(c),de.delete(c),Le.delete(c),h.fetchers.delete(c)}function Pa(c){let p=(Ve.get(c)||0)-1;p<=0?(Ve.delete(c),de.add(c)):Ve.set(c,p),re({fetchers:new Map(h.fetchers)})}function Ee(c){let p=Y.get(c);p&&(p.abort(),Y.delete(c))}function Ar(c){for(let p of c){let v=kr(p),b=Re(v.data);h.fetchers.set(p,b)}}function Nr(){let c=[],p=!1;for(let v of pe){let b=h.fetchers.get(v);j(b,`Expected fetcher: ${v}`),b.state==="loading"&&(pe.delete(v),c.push(v),p=!0)}return Ar(c),p}function $r(c){let p=[];for(let[v,b]of Ne)if(b<c){let C=h.fetchers.get(v);j(C,`Expected fetcher: ${v}`),C.state==="loading"&&(Ee(v),Ne.delete(v),p.push(v))}return Ar(p),p.length>0}function Ta(c,p){let v=h.blockers.get(c)||qe;return Ce.get(c)!==p&&Ce.set(c,p),v}function Ir(c){h.blockers.delete(c),Ce.delete(c)}function dt(c,p){let v=h.blockers.get(c)||qe;j(v.state==="unblocked"&&p.state==="blocked"||v.state==="blocked"&&p.state==="blocked"||v.state==="blocked"&&p.state==="proceeding"||v.state==="blocked"&&p.state==="unblocked"||v.state==="proceeding"&&p.state==="unblocked",`Invalid blocker state transition: ${v.state} -> ${p.state}`);let b=new Map(h.blockers);b.set(c,p),re({blockers:b})}function Fr({currentLocation:c,nextLocation:p,historyAction:v}){if(Ce.size===0)return;Ce.size>1&&G(!1,"A router only supports one blocker at a time");let b=Array.from(Ce.entries()),[C,$]=b[b.length-1],N=h.blockers.get(C);if(!(N&&N.state==="proceeding")&&$({currentLocation:c,nextLocation:p,historyAction:v}))return C}function Ht(c){let p=le(404,{pathname:c}),v=l||o,{matches:b,route:C}=mn(v);return{notFoundMatches:b,route:C,error:p}}function Ma(c,p,v){if(y=c,E=p,g=v||null,!R&&h.navigation===Jt){R=!0;let b=Ur(h.location,h.matches);b!=null&&re({restoreScrollPosition:b})}return()=>{y=null,E=null,g=null}}function jr(c,p){return g&&g(c,p.map(b=>In(b,h.loaderData)))||c.key}function _a(c,p){if(y&&E){let v=jr(c,p);y[v]=E()}}function Ur(c,p){if(y){let v=jr(c,p),b=y[v];if(typeof b=="number")return b}return null}function ft(c,p,v){if(e.patchRoutesOnNavigation)if(c){if(Object.keys(c[0].params).length>0)return{active:!0,matches:Lt(p,v,s,!0)}}else return{active:!0,matches:Lt(p,v,s,!0)||[]};return{active:!1,matches:null}}async function ht(c,p,v,b){if(!e.patchRoutesOnNavigation)return{type:"success",matches:c};let C=c;for(;;){let $=l==null,N=l||o,_=n;try{await e.patchRoutesOnNavigation({signal:v,path:p,matches:C,fetcherKey:b,patch:(O,I)=>{v.aborted||an(O,I,N,_,a)}})}catch(O){return{type:"error",error:O,partialMatches:C}}finally{$&&!v.aborted&&(o=[...o])}if(v.aborted)return{type:"aborted"};let k=ge(N,p,s);if(k)return{type:"success",matches:k};let M=Lt(N,p,s,!0);if(!M||C.length===M.length&&C.every((O,I)=>O.route.id===M[I].route.id))return{type:"success",matches:null};C=M}}function Da(c){n={},l=_t(c,a,void 0,n)}function Oa(c,p){let v=l==null;an(c,p,l||o,n,a),v&&(o=[...o],re({}))}return T={get basename(){return s},get future(){return u},get state(){return h},get routes(){return o},get window(){return t},initialize:va,subscribe:wa,enableScrollRestoration:Ma,navigate:_r,fetch:xa,revalidate:Ea,createHref:c=>e.history.createHref(c),encodeLocation:c=>e.history.encodeLocation(c),getFetcher:kr,deleteFetcher:Pa,dispose:ga,getBlocker:Ta,deleteBlocker:Ir,patchRoutes:Oa,_internalFetchControllers:Y,_internalSetRoutes:Da},T}function pi(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Zt(e,t,r,a,n,o){let l,s;if(n){l=[];for(let u of t)if(l.push(u),u.route.id===n){s=u;break}}else l=t,s=t[t.length-1];let i=hr(a||".",fr(l),ie(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=yr(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 y=d.toString();i.search=y?`?${y}`:""}}return r!=="/"&&(i.pathname=i.pathname==="/"?r:he([r,i.pathname])),be(i)}function en(e,t,r){if(!r||!pi(r))return{path:t};if(r.formMethod&&!Ti(r.formMethod))return{path:t,error:le(405,{method:r.formMethod})};let a=()=>({path:t,error:le(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),l=Gn(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ue(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((y,[g,E])=>`${y}${g}=${E}
|
|
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(!ue(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()}}}j(typeof FormData=="function","FormData is not available in this environment");let s,i;if(r.formData)s=tr(r.formData),i=r.formData;else if(r.body instanceof FormData)s=tr(r.body),i=r.body;else if(r.body instanceof URLSearchParams)s=r.body,i=cn(s);else if(r.body==null)s=new URLSearchParams,i=new FormData;else try{s=new URLSearchParams(r.body),i=cn(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(ue(u.formMethod))return{path:t,submission:u};let d=xe(t);return e&&d.search&&yr(d.search)&&s.append("index",""),d.search=`?${s}`,{path:be(d),submission:u}}function tn(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 rn(e,t,r,a,n,o,l,s,i,u,d,m,y,g){let E=g?ae(g[1])?g[1].error:g[1].data:void 0,R=e.createURL(t.location),w=e.createURL(n),S=r;o&&t.errors?S=tn(r,Object.keys(t.errors)[0],!0):g&&ae(g[1])&&(S=tn(r,g[0]));let x=g?g[1].statusCode:void 0,L=x&&x>=400,T=S.filter((P,A)=>{let{route:D}=P;if(D.lazy)return!0;if(D.loader==null)return!1;if(o)return er(D,t.loaderData,t.errors);if(yi(t.loaderData,t.matches[A],P))return!0;let U=t.matches[A],z=P;return nn(P,{currentUrl:R,currentParams:U.params,nextUrl:w,nextParams:z.params,...a,actionResult:E,actionStatus:x,defaultShouldRevalidate:L?!1:l||R.pathname+R.search===w.pathname+w.search||R.search!==w.search||vi(U,z)})}),h=[];return u.forEach((P,A)=>{if(o||!r.some(ne=>ne.route.id===P.routeId)||i.has(A))return;let D=ge(m,P.path,y);if(!D){h.push({key:A,routeId:P.routeId,path:P.path,matches:null,match:null,controller:null});return}let U=t.fetchers.get(A),z=rt(D,P.path),q=!1;d.has(A)?q=!1:s.has(A)?(s.delete(A),q=!0):U&&U.state!=="idle"&&U.data===void 0?q=l:q=nn(z,{currentUrl:R,currentParams:t.matches[t.matches.length-1].params,nextUrl:w,nextParams:r[r.length-1].params,...a,actionResult:E,actionStatus:x,defaultShouldRevalidate:L?!1:l}),q&&h.push({key:A,routeId:P.routeId,path:P.path,matches:D,match:z,controller:new AbortController})}),[T,h]}function er(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 yi(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function vi(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function nn(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function an(e,t,r,a,n){let o;if(e){let i=a[e];j(i,`No route found to patch children into: routeId = ${e}`),i.children||(i.children=[]),o=i.children}else o=r;let l=t.filter(i=>!o.some(u=>Yn(i,u))),s=_t(l,n,[e||"_","patch",String((o==null?void 0:o.length)||"0")],a);o.push(...s)}function Yn(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=>Yn(r,o))}):!1}var on=new WeakMap,Wn=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];if(j(n,"No route found in manifest"),!n.lazy||typeof n.lazy!="object")return;let o=n.lazy[e];if(!o)return;let l=on.get(n);l||(l={},on.set(n,l));let s=l[e];if(s)return s;let i=(async()=>{let u=Fo(e),m=n[e]!==void 0&&e!=="hasErrorBoundary";if(u)G(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(m)G(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await o();y!=null&&(Object.assign(n,{[e]:y}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(y=>y===void 0)&&(n.lazy=void 0))})();return l[e]=i,i},ln=new WeakMap;function gi(e,t,r,a){let n=r[e.id];if(j(n,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let u=ln.get(n);if(u)return{lazyRoutePromise:u,lazyHandlerPromise:u};let d=(async()=>{j(typeof e.lazy=="function","No lazy route function found");let m=await e.lazy(),y={};for(let g in m){let E=m[g];if(E===void 0)continue;let R=Uo(g),S=n[g]!==void 0&&g!=="hasErrorBoundary";R?G(!R,"Route property "+g+" is not a supported property to be returned from a lazy route function. This property will be ignored."):S?G(!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.`):y[g]=E}Object.assign(n,y),Object.assign(n,{...a(n),lazy:void 0})})();return ln.set(n,d),{lazyRoutePromise:d,lazyHandlerPromise:d}}let o=Object.keys(e.lazy),l=[],s;for(let u of o){let d=Wn({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 Vn(e){return e!==void 0}function wi(e,t,r){let a=e.map(({route:n})=>{if(!(typeof n.lazy!="object"||!n.lazy.unstable_middleware))return Wn({key:"unstable_middleware",route:n,manifest:t,mapRouteProperties:r})}).filter(Vn);return a.length>0?Promise.all(a):void 0}async function sn(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 Ei(e){return e.matches.some(t=>t.route.unstable_middleware)?tt(e,!1,()=>sn(e),(t,r)=>({[r]:{type:"error",result:t}})):sn(e)}async function tt(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(y=>[m.route.id,y]):[]),d=await Jn({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 Jn(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,y=async()=>{if(d)throw new Error("You may only call `next()` once per middleware");d=!0,await Jn(e,t,r,a,n,o+1)};try{let g=await u({request:e.request,params:e.params,context:e.context},y);return d?g===void 0?m:g:y()}catch(g){throw a.middlewareError?a.middlewareError.error!==g&&(a.middlewareError={routeId:i,error:g}):a.middlewareError={routeId:i,error:g},g}}async function Ri(e,t,r,a,n,o,l,s,i){let u=wi(n,l,s),d=n.map(E=>gi(E.route,t,l,s));u&&await u;let m=n.map((E,R)=>{let{lazyRoutePromise:w,lazyHandlerPromise:S}=d[R],x=a.some(T=>T.route.id===E.route.id);return{...E,shouldLoad:x,resolve:async T=>(T&&r.method==="GET"&&(E.route.lazy||E.route.loader)&&(x=!0),x?bi({type:t,request:r,match:E,lazyHandlerPromise:S,lazyRoutePromise:w,handlerOverride:T,scopedContext:i}):Promise.resolve({type:"data",result:void 0}))}}),y=await e({matches:m,request:r,params:n[0].params,fetcherKey:o,context:i}),g=d.flatMap(E=>Object.values(E).filter(Vn));try{await Promise.all(g)}catch{}return y}async function bi({type:e,request:t,match:r,lazyHandlerPromise:a,lazyRoutePromise:n,handlerOverride:o,scopedContext:l}){let s,i,u=d=>{let m,y=new Promise((R,w)=>m=w);i=()=>m(),t.signal.addEventListener("abort",i);let g=R=>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},...R!==void 0?[R]:[]),E=(async()=>{try{return{type:"data",result:await(o?o(w=>g(w)):g())}}catch(R){return{type:"error",result:R}}})();return Promise.race([E,y])};try{let d=r.route[e];if(a||n)if(d){let m,[y]=await Promise.all([u(d).catch(g=>{m=g}),a,n]);if(m!==void 0)throw m;s=y}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),y=m.pathname+m.search;throw le(405,{method:t.method,pathname:y,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),y=m.pathname+m.search;throw le(404,{pathname:y})}}catch(d){return{type:"error",result:d}}finally{i&&t.signal.removeEventListener("abort",i)}return s}async function Si(e){var a,n,o,l,s,i;let{result:t,type:r}=e;if(pr(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 Se(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:"data",data:u,statusCode:t.status,headers:t.headers}}return r==="error"?pn(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 Se(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:ke(t)?t.status:void 0,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ke(t)?t.status:void 0}:pn(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 xi(e,t,r,a,n){let o=e.headers.get("Location");if(j(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!mr.test(o)){let l=a.slice(0,a.findIndex(s=>s.route.id===r)+1);o=Zt(new URL(t.url),l,n,o),e.headers.set("Location",o)}return e}function un(e,t,r){if(mr.test(e)){let a=e,n=a.startsWith("//")?new URL(t.protocol+a):new URL(a),o=ie(n.pathname,r)!=null;if(n.origin===t.origin&&o)return n.pathname+n.search+n.hash}return e}function Ue(e,t,r,a){let n=e.createURL(Gn(t)).toString(),o={signal:r};if(a&&ue(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=tr(a.formData):o.body=a.formData}return new Request(n,o)}function tr(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function cn(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function Li(e,t,r,a=!1,n=!1){let o={},l=null,s,i=!1,u={},d=r&&ae(r[1])?r[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let y=m.route.id,g=t[y];if(j(!Oe(g),"Cannot handle redirect results in processLoaderData"),ae(g)){let E=g.error;if(d!==void 0&&(E=d,d=void 0),l=l||{},n)l[y]=E;else{let R=De(e,y);l[R.route.id]==null&&(l[R.route.id]=E)}a||(o[y]=Bn),i||(i=!0,s=ke(g.error)?g.error.status:500),g.headers&&(u[y]=g.headers)}else o[y]=g.data,g.statusCode&&g.statusCode!==200&&!i&&(s=g.statusCode),g.headers&&(u[y]=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 dn(e,t,r,a,n,o){let{loaderData:l,errors:s}=Li(t,r,a);return n.forEach(i=>{let{key:u,match:d,controller:m}=i,y=o[u];if(j(y,"Did not find corresponding fetcher result"),!(m&&m.signal.aborted))if(ae(y)){let g=De(e.matches,d==null?void 0:d.route.id);s&&s[g.route.id]||(s={...s,[g.route.id]:y.error}),e.fetchers.delete(u)}else if(Oe(y))j(!1,"Unhandled fetcher revalidation redirect");else{let g=Re(y.data);e.fetchers.set(u,g)}}),{loaderData:l,errors:s}}function fn(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==Bn).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 hn(e){return e?ae(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function De(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 mn(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 le(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 Se(e||500,l,new Error(s),!0)}function wt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(Oe(n))return{key:a,result:n}}}function Gn(e){let t=typeof e=="string"?xe(e):e;return be({...t,hash:""})}function Ci(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Pi(e){return pr(e.result)&&di.has(e.result.status)}function ae(e){return e.type==="error"}function Oe(e){return(e&&e.type)==="redirect"}function pn(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function pr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Ti(e){return ci.has(e.toUpperCase())}function ue(e){return si.has(e.toUpperCase())}function yr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function rt(e,t){let r=typeof t=="string"?xe(t).search:t.search;if(e[e.length-1].route.index&&yr(r||""))return e[e.length-1];let a=Un(e);return a[a.length-1]}function yn(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:l}=e;if(!(!t||!r||!a)){if(n!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:n};if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:l,text:void 0}}}function Gt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Mi(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 Qe(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 _i(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 Re(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 Di(e,t){try{let r=e.sessionStorage.getItem(zn);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 Oi(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(zn,JSON.stringify(r))}catch(a){G(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function ki(){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 Ae=f.createContext(null);Ae.displayName="DataRouter";var Be=f.createContext(null);Be.displayName="DataRouterState";var vr=f.createContext({isTransitioning:!1});vr.displayName="ViewTransition";var Kn=f.createContext(new Map);Kn.displayName="Fetchers";var Ai=f.createContext(null);Ai.displayName="Await";var se=f.createContext(null);se.displayName="Navigation";var At=f.createContext(null);At.displayName="Location";var ce=f.createContext({outlet:null,matches:[],isDataRoute:!1});ce.displayName="Route";var gr=f.createContext(null);gr.displayName="RouteError";function Ni(e,{relative:t}={}){j(at(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=f.useContext(se),{hash:n,pathname:o,search:l}=ot(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:he([r,o])),a.createHref({pathname:s,search:l,hash:n})}function at(){return f.useContext(At)!=null}function me(){return j(at(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(At).location}var Xn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qn(e){f.useContext(se).static||f.useLayoutEffect(e)}function $i(){let{isDataRoute:e}=f.useContext(ce);return e?Xi():Ii()}function Ii(){j(at(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(Ae),{basename:t,navigator:r}=f.useContext(se),{matches:a}=f.useContext(ce),{pathname:n}=me(),o=JSON.stringify(fr(a)),l=f.useRef(!1);return qn(()=>{l.current=!0}),f.useCallback((i,u={})=>{if(G(l.current,Xn),!l.current)return;if(typeof i=="number"){r.go(i);return}let d=hr(i,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:he([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,o,n,e])}var Fi=f.createContext(null);function ji(e){let t=f.useContext(ce).outlet;return t&&f.createElement(Fi.Provider,{value:e},t)}function ns(){let{matches:e}=f.useContext(ce),t=e[e.length-1];return t?t.params:{}}function ot(e,{relative:t}={}){let{matches:r}=f.useContext(ce),{pathname:a}=me(),n=JSON.stringify(fr(r));return f.useMemo(()=>hr(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Ui(e,t,r,a){j(at(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n,static:o}=f.useContext(se),{matches:l}=f.useContext(ce),s=l[l.length-1],i=s?s.params:{},u=s?s.pathname:"/",d=s?s.pathnameBase:"/",m=s&&s.route;{let x=m&&m.path||"";ea(u,!m||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${x}">) 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="${x}"> to <Route path="${x==="/"?"*":`${x}/*`}">.`)}let y=me(),g;g=y;let E=g.pathname||"/",R=E;if(d!=="/"){let x=d.replace(/^\//,"").split("/");R="/"+E.replace(/^\//,"").split("/").slice(x.length).join("/")}let w=!o&&r&&r.matches&&r.matches.length>0?r.matches:ge(e,{pathname:R});return G(m||w!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),G(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${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.`),Wi(w&&w.map(x=>Object.assign({},x,{params:Object.assign({},i,x.params),pathname:he([d,n.encodeLocation?n.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?d:he([d,n.encodeLocation?n.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),l,r,a)}function Hi(){let e=Zn(),t=ke(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=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:o},"ErrorBoundary")," or"," ",f.createElement("code",{style:o},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:n},r):null,l)}var zi=f.createElement(Hi,null),Bi=class extends f.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?f.createElement(ce.Provider,{value:this.props.routeContext},f.createElement(gr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Yi({routeContext:e,match:t,children:r}){let a=f.useContext(Ae);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(ce.Provider,{value:e},r)}function Wi(e,t=[],r=null,a=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let n=e,o=r==null?void 0:r.errors;if(o!=null){let i=n.findIndex(u=>u.route.id&&(o==null?void 0:o[u.route.id])!==void 0);j(i>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,i+1))}let l=!1,s=-1;if(r)for(let i=0;i<n.length;i++){let u=n[i];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(s=i),u.route.id){let{loaderData:d,errors:m}=r,y=u.route.loader&&!d.hasOwnProperty(u.route.id)&&(!m||m[u.route.id]===void 0);if(u.route.lazy||y){l=!0,s>=0?n=n.slice(0,s+1):n=[n[0]];break}}}return n.reduceRight((i,u,d)=>{let m,y=!1,g=null,E=null;r&&(m=o&&u.route.id?o[u.route.id]:void 0,g=u.route.errorElement||zi,l&&(s<0&&d===0?(ea("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,E=null):s===d&&(y=!0,E=u.route.hydrateFallbackElement||null)));let R=t.concat(n.slice(0,d+1)),w=()=>{let S;return m?S=g:y?S=E:u.route.Component?S=f.createElement(u.route.Component,null):u.route.element?S=u.route.element:S=i,f.createElement(Yi,{match:u,routeContext:{outlet:i,matches:R,isDataRoute:r!=null},children:S})};return r&&(u.route.ErrorBoundary||u.route.errorElement||d===0)?f.createElement(Bi,{location:r.location,revalidation:r.revalidation,component:g,error:m,children:w(),routeContext:{outlet:null,matches:R,isDataRoute:!0}}):w()},null)}function wr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vi(e){let t=f.useContext(Ae);return j(t,wr(e)),t}function it(e){let t=f.useContext(Be);return j(t,wr(e)),t}function Ji(e){let t=f.useContext(ce);return j(t,wr(e)),t}function lt(e){let t=Ji(e),r=t.matches[t.matches.length-1];return j(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Gi(){return lt("useRouteId")}function Ki(){return it("useNavigation").navigation}function Qn(){let{matches:e,loaderData:t}=it("useMatches");return f.useMemo(()=>e.map(r=>In(r,t)),[e,t])}function as(){let e=it("useLoaderData"),t=lt("useLoaderData");return e.loaderData[t]}function os(){let e=it("useActionData"),t=lt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Zn(){var a;let e=f.useContext(gr),t=it("useRouteError"),r=lt("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[r]}function Xi(){let{router:e}=Vi("useNavigate"),t=lt("useNavigate"),r=f.useRef(!1);return qn(()=>{r.current=!0}),f.useCallback(async(n,o={})=>{G(r.current,Xn),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var vn={};function ea(e,t,r){!t&&!vn[e]&&(vn[e]=!0,G(!1,r))}var gn={};function wn(e,t){!e&&!gn[t]&&(gn[t]=!0,console.warn(t))}function is(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&G(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:f.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&G(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:f.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&G(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var qi=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 ls({router:e,flushSync:t}){let[r,a]=f.useState(e.state),[n,o]=f.useState(),[l,s]=f.useState({isTransitioning:!1}),[i,u]=f.useState(),[d,m]=f.useState(),[y,g]=f.useState(),E=f.useRef(new Map),R=f.useCallback((L,{deletedFetchers:T,flushSync:h,viewTransitionOpts:P})=>{L.fetchers.forEach((D,U)=>{D.data!==void 0&&E.current.set(U,D.data)}),T.forEach(D=>E.current.delete(D)),wn(h===!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 A=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(wn(P==null||A,"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."),!P||!A){t&&h?t(()=>a(L)):f.startTransition(()=>a(L));return}if(t&&h){t(()=>{d&&(i&&i.resolve(),d.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:P.currentLocation,nextLocation:P.nextLocation})});let D=e.window.document.startViewTransition(()=>{t(()=>a(L))});D.finished.finally(()=>{t(()=>{u(void 0),m(void 0),o(void 0),s({isTransitioning:!1})})}),t(()=>m(D));return}d?(i&&i.resolve(),d.skipTransition(),g({state:L,currentLocation:P.currentLocation,nextLocation:P.nextLocation})):(o(L),s({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}))},[e.window,t,d,i]);f.useLayoutEffect(()=>e.subscribe(R),[e,R]),f.useEffect(()=>{l.isTransitioning&&!l.flushSync&&u(new qi)},[l]),f.useEffect(()=>{if(i&&n&&e.window){let L=n,T=i.promise,h=e.window.document.startViewTransition(async()=>{f.startTransition(()=>a(L)),await T});h.finished.finally(()=>{u(void 0),m(void 0),o(void 0),s({isTransitioning:!1})}),m(h)}},[n,i,e.window]),f.useEffect(()=>{i&&n&&r.location.key===n.location.key&&i.resolve()},[i,d,r.location,n]),f.useEffect(()=>{!l.isTransitioning&&y&&(o(y.state),s({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),g(void 0))},[l.isTransitioning,y]);let w=f.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:L=>e.navigate(L),push:(L,T,h)=>e.navigate(L,{state:T,preventScrollReset:h==null?void 0:h.preventScrollReset}),replace:(L,T,h)=>e.navigate(L,{replace:!0,state:T,preventScrollReset:h==null?void 0:h.preventScrollReset})}),[e]),S=e.basename||"/",x=f.useMemo(()=>({router:e,navigator:w,static:!1,basename:S}),[e,w,S]);return f.createElement(f.Fragment,null,f.createElement(Ae.Provider,{value:x},f.createElement(Be.Provider,{value:r},f.createElement(Kn.Provider,{value:E.current},f.createElement(vr.Provider,{value:l},f.createElement(el,{basename:S,location:r.location,navigationType:r.historyAction,navigator:w},f.createElement(Qi,{routes:e.routes,future:e.future,state:r})))))),null)}var Qi=f.memo(Zi);function Zi({routes:e,future:t,state:r}){return Ui(e,void 0,r,t)}function ss(e){return ji(e.context)}function el({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){j(!at(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=f.useMemo(()=>({basename:l,navigator:n,static:o,future:{}}),[l,n,o]);typeof r=="string"&&(r=xe(r));let{pathname:i="/",search:u="",hash:d="",state:m=null,key:y="default"}=r,g=f.useMemo(()=>{let E=ie(i,l);return E==null?null:{location:{pathname:E,search:u,hash:d,state:m,key:y},navigationType:a}},[l,i,u,d,m,y,a]);return G(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:f.createElement(se.Provider,{value:s},f.createElement(At.Provider,{children:t,value:g}))}var Ct="get",Pt="application/x-www-form-urlencoded";function Nt(e){return e!=null&&typeof e.tagName=="string"}function tl(e){return Nt(e)&&e.tagName.toLowerCase()==="button"}function rl(e){return Nt(e)&&e.tagName.toLowerCase()==="form"}function nl(e){return Nt(e)&&e.tagName.toLowerCase()==="input"}function al(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ol(e,t){return e.button===0&&(!t||t==="_self")&&!al(e)}var Et=null;function il(){if(Et===null)try{new FormData(document.createElement("form"),0),Et=!1}catch{Et=!0}return Et}var ll=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Kt(e){return e!=null&&!ll.has(e)?(G(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pt}"`),null):e}function sl(e,t){let r,a,n,o,l;if(rl(e)){let s=e.getAttribute("action");a=s?ie(s,t):null,r=e.getAttribute("method")||Ct,n=Kt(e.getAttribute("enctype"))||Pt,o=new FormData(e)}else if(tl(e)||nl(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?ie(i,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Ct,n=Kt(e.getAttribute("formenctype"))||Kt(s.getAttribute("enctype"))||Pt,o=new FormData(s,e),!il()){let{name:u,type:d,value:m}=e;if(d==="image"){let y=u?`${u}.`:"";o.append(`${y}x`,"0"),o.append(`${y}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=Ct,a=null,n=Pt,l=e}return o&&n==="text/plain"&&(l=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:l}}function oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function ta(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 ul(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=Rr(e,r);return oa(a,n)}function ra(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function cl(e){if(!e.css)return;let t=ra(e);await Promise.all(t.map(aa))}async function na(e,t){if(!e.css&&!t.links||!pl())return;let r=[];if(e.css&&r.push(...ra(e)),t.links&&r.push(...t.links()),r.length===0)return;let a=[];for(let n of r)!Er(n)&&n.rel==="stylesheet"&&a.push({...n,rel:"preload",as:"style"});await Promise.all(a.map(aa))}async function aa(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 Er(e){return e!=null&&typeof e.page=="string"}function dl(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 fl(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let l=await ta(o,r);return l.links?l.links():[]}return[]}));return oa(a.flat(1).filter(dl).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function En(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 y=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 y=="boolean")return y}return!0}):[]}function Rr(e,t,{includeHydrateFallback:r}={}){return hl(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 hl(e){return[...new Set(e)]}function ml(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function oa(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!Er(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let s=JSON.stringify(ml(o));return r.has(s)||(r.add(s),n.push({key:s,link:o})),n},[])}var Rt;function pl(){if(Rt!==void 0)return Rt;let e=document.createElement("link");return Rt=e.relList.supports("preload"),e=null,Rt}function Rn(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 ia=Symbol("SingleFetchRedirect");function bt(e,t){return{[t]:{type:"error",result:e}}}function us(e,t,r,a,n){return async o=>{let{request:l,matches:s,fetcherKey:i}=o;return l.method!=="GET"?tt(o,!1,()=>yl(l,s,a),bt):!r&&!s.some(d=>{var m,y;return d.shouldLoad&&((m=e.routes[d.route.id])==null?void 0:m.hasLoader)&&!((y=e.routes[d.route.id])!=null&&y.hasClientLoader)})?tt(o,!1,()=>vl(e,l,s,a),bt):i?tt(o,!1,()=>wl(l,s,a),bt):tt(o,!1,()=>gl(e,t,r,n(),l,s,a),bt)}}async function yl(e,t,r){let a=t.find(l=>l.shouldLoad);oe(a,"No action match found");let n,o=await a.resolve(async l=>await l(async()=>{let i=st(e.url,r),u=await $t(e),{data:d,status:m}=await xr(i,u);return n=m,rr(d,a.route.id)}));return pr(o.result)||ke(o.result)?{[a.route.id]:o}:{[a.route.id]:{type:o.type,result:ii(o.result,n)}}}async function vl(e,t,r,a){let n=r.filter(i=>i.shouldLoad),o=Sr(st(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 br(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 gl(e,t,r,a,n,o,l){let s=new Set,i=!1,u=o.map(()=>bn()),d=Promise.all(u.map(w=>w.promise)),m=bn(),y=Sr(st(n.url,l)),g=await $t(n),E={},R=Promise.all(o.map(async(w,S)=>w.resolve(async x=>{u[S].resolve();let L=e.routes[w.route.id];if(!w.shouldLoad){if(!a.state.initialized)return;if(w.route.id in a.state.loaderData&&L&&w.route.shouldRevalidate){L.hasLoader&&(i=!0);return}}if(L&&L.hasClientLoader){L.hasLoader&&(i=!0);try{let T=await br(x,y,g,w.route.id);E[w.route.id]={type:"data",result:T}}catch(T){E[w.route.id]={type:"error",result:T}}return}L&&L.hasLoader&&s.add(w.route.id);try{let T=await x(async()=>{let h=await m.promise;return la(h,w.route.id)});E[w.route.id]={type:"data",result:T}}catch(T){E[w.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&&y.searchParams.set("_routes",o.filter(S=>s.has(S.route.id)).map(S=>S.route.id).join(","));let w=await xr(y,g);m.resolve(w.data)}catch(w){m.reject(w)}return await R,E}async function wl(e,t,r){let a=t.find(o=>o.shouldLoad);oe(a,"No fetcher match found");let n=await a.resolve(async o=>{let l=Sr(st(e.url,r)),s=await $t(e);return br(o,l,s,a.route.id)});return{[a.route.id]:n}}function br(e,t,r,a){return e(async()=>{let n=new URL(t);n.searchParams.set("_routes",a);let{data:o}=await xr(n,r);return la(o,a)})}function Sr(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 st(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&&ie(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}async function xr(e,t){let r=await fetch(e,t);if(r.status===404&&!r.headers.has("X-Remix-Response"))throw new Se(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}};oe(r.body,"No response body to decode");try{let n=await El(r.body,window);return{status:r.status,data:n.value}}catch{throw new Error("Unable to decode turbo-stream response")}}function El(e,t){return Eo(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 Se(o,l,n)}}if(r==="SingleFetchRedirect")return{value:{[ia]:a[0]}};if(r==="SingleFetchClassInstance")return{value:a[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function la(e,t){let r=e[ia];return r?rr(r,t):e[t]!==void 0?rr(e[t],t):null}function rr(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"),li(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 bn(){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 cs=class extends f.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?f.createElement(sa,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function sa({error:e,isOutsideRemixApp:t}){console.error(e);let r=f.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(ke(e))return f.createElement(nr,{title:"Unhandled Thrown Response!"},f.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 f.createElement(nr,{title:"Application Error!",isOutsideRemixApp:t},f.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),f.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},a.stack),r)}function nr({title:e,renderScripts:t,isOutsideRemixApp:r,children:a}){var o;let{routeModules:n}=Ye();return(o=n.root)!=null&&o.Layout&&!r?a:f.createElement("html",{lang:"en"},f.createElement("head",null,f.createElement("meta",{charSet:"utf-8"}),f.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),f.createElement("title",null,e)),f.createElement("body",null,f.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},a,t?f.createElement(Nl,null):null)))}function Rl(){return f.createElement(nr,{title:"Loading...",renderScripts:!0},f.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 ua(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 bl(e,t,r){let a=ca(t),n=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Rl:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>f.createElement(sa,{error:Zn()}):void 0;return e.id==="root"&&t.Layout?{...a?{element:f.createElement(t.Layout,null,f.createElement(a,null))}:{Component:a},...o?{errorElement:f.createElement(t.Layout,null,f.createElement(o,null))}:{ErrorBoundary:o},...n?{hydrateFallbackElement:f.createElement(t.Layout,null,f.createElement(n,null))}:{HydrateFallback:n}}:{Component:a,ErrorBoundary:o,HydrateFallback:n}}function ds(e,t,r,a,n,o){return Lr(t,r,a,n,o,"",ua(t),e)}function St(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 Se(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 Se(405,"Method Not Allowed",new Error(a),!0)}function Lr(e,t,r,a,n,o="",l=ua(e),s){return(l[o]||[]).map(i=>{var x,L,T;let u=t[i.id];function d(h){return oe(typeof h=="function","No single fetch function available for route handler"),h()}function m(h){return i.hasLoader?d(h):Promise.resolve(null)}function y(h){if(!i.hasAction)throw Xt("action",i.id);return d(h)}function g(h){import(h)}function E(h){h.clientActionModule&&g(h.clientActionModule),h.clientLoaderModule&&g(h.clientLoaderModule)}async function R(h){let P=t[i.id],A=P?na(i,P):Promise.resolve();try{return h()}finally{await A}}let w={id:i.id,index:i.index,path:i.path};if(u){Object.assign(w,{...w,...bl(i,u,n),unstable_middleware:u.unstable_clientMiddleware,handle:u.handle,shouldRevalidate:Sn(u,i,a,s)});let h=r&&r.loaderData&&i.id in r.loaderData,P=h?(x=r==null?void 0:r.loaderData)==null?void 0:x[i.id]:void 0,A=r&&r.errors&&i.id in r.errors,D=A?(L=r==null?void 0:r.errors)==null?void 0:L[i.id]:void 0,U=s==null&&(((T=u.clientLoader)==null?void 0:T.hydrate)===!0||!i.hasLoader);w.loader=async({request:z,params:q,context:ne},te)=>{try{return await R(async()=>(oe(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:z,params:q,context:ne,async serverLoader(){if(St("loader",i),U){if(h)return P;if(A)throw D}return m(te)}}):m(te)))}finally{U=!1}},w.loader.hydrate=Ll(i,u,n),w.action=({request:z,params:q,context:ne},te)=>R(async()=>{if(oe(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(n)throw Xt("clientAction",i.id);return y(te)}return u.clientAction({request:z,params:q,context:ne,async serverAction(){return St("action",i),y(te)}})})}else{i.hasClientLoader||(w.loader=(A,D)=>R(()=>m(D))),i.hasClientAction||(w.action=(A,D)=>R(()=>{if(n)throw Xt("clientAction",i.id);return y(D)}));let h;async function P(){return h?await h:(h=(async()=>{(i.clientLoaderModule||i.clientActionModule)&&await new Promise(D=>setTimeout(D,0));let A=xl(i,t);return E(i),await A})(),await h)}w.lazy={loader:i.hasClientLoader?async()=>{let{clientLoader:A}=i.clientLoaderModule?await import(i.clientLoaderModule):await P();return oe(A,"No `clientLoader` export found"),(D,U)=>A({...D,async serverLoader(){return St("loader",i),m(U)}})}:void 0,action:i.hasClientAction?async()=>{let A=i.clientActionModule?import(i.clientActionModule):P();E(i);let{clientAction:D}=await A;return oe(D,"No `clientAction` export found"),(U,z)=>D({...U,async serverAction(){return St("action",i),y(z)}})}:void 0,unstable_middleware:i.hasClientMiddleware?async()=>{let{unstable_clientMiddleware:A}=i.clientMiddlewareModule?await import(i.clientMiddlewareModule):await P();return oe(A,"No `unstable_clientMiddleware` export found"),A}:void 0,shouldRevalidate:async()=>{let A=await P();return Sn(A,i,a,s)},handle:async()=>(await P()).handle,Component:async()=>(await P()).Component,ErrorBoundary:i.hasErrorBoundary?async()=>(await P()).ErrorBoundary:void 0}}let S=Lr(e,t,r,a,n,i.id,l,s);return S.length>0&&(w.children=S),w})}function Sn(e,t,r,a){if(a)return Sl(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 Sl(e,t,r){let a=!1;return n=>a?t?t(n):n.defaultShouldRevalidate:(a=!0,r.has(e))}async function xl(e,t){let r=ta(e,t),a=cl(e),n=await r;return await Promise.all([a,na(e,n)]),{Component:ca(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 ca(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Ll(e,t,r){return r&&e.id!=="root"||t.clientLoader!=null&&(t.clientLoader.hydrate===!0||e.hasLoader!==!0)}var Tt=new Set,Cl=1e3,Ot=new Set,Pl=7680;function Cr(e){return e===!0}function Tl({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=ge(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 fs(e,t,r,a,n){if(Cr(r))return async({path:o,patch:l,signal:s,fetcherKey:i})=>{Ot.has(o)||await da([o],i?window.location.href:o,e,t,r,a,n,l,s)}}function hs(e,t,r,a,n){f.useEffect(()=>{var u;if(!Cr(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 y=d.tagName==="A"?d.pathname:new URL(m,window.location.origin).pathname;Ot.has(y)||Tt.add(y)}async function l(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(o);let d=Array.from(Tt.keys()).filter(m=>Ot.has(m)?(Tt.delete(m),!1):!0);if(d.length!==0)try{await da(d,null,t,r,a,n,e.basename,e.patchRoutes)}catch(m){console.error("Failed to fetch manifest patches",m)}}let s=_l(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 da(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(R=>d.searchParams.append("p",R)),d.searchParams.set("version",r.version),d.toString().length>Pl){Tt.clear();return}let m;try{let R=await fetch(d,{signal:i});if(R.ok){if(R.status===204&&R.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(R.status>=400)throw new Error(await R.text())}else throw new Error(`${R.status} ${R.statusText}`);sessionStorage.removeItem(qt),m=await R.json()}catch(R){if(i!=null&&i.aborted)return;throw R}let y=new Set(Object.keys(r.routes)),g=Object.values(m).reduce((R,w)=>(w&&!y.has(w.id)&&(R[w.id]=w),R),{});Object.assign(r.routes,g),e.forEach(R=>Ml(R,Ot));let E=new Set;Object.values(g).forEach(R=>{R&&(!R.parentId||!g[R.parentId])&&E.add(R.parentId)}),E.forEach(R=>s(R||null,Lr(g,a,null,n,o,R)))}function Ml(e,t){if(t.size>=Cl){let r=t.values().next().value;t.delete(r)}t.add(e)}function _l(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),t)}}function Pr(){let e=f.useContext(Ae);return oe(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function It(){let e=f.useContext(Be);return oe(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ft=f.createContext(void 0);Ft.displayName="FrameworkContext";function Ye(){let e=f.useContext(Ft);return oe(e,"You must render this element inside a <HydratedRouter> element"),e}function Dl(e,t){let r=f.useContext(Ft),[a,n]=f.useState(!1),[o,l]=f.useState(!1),{onFocus:s,onBlur:i,onMouseEnter:u,onMouseLeave:d,onTouchStart:m}=t,y=f.useRef(null);f.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let R=S=>{S.forEach(x=>{l(x.isIntersecting)})},w=new IntersectionObserver(R,{threshold:.5});return y.current&&w.observe(y.current),()=>{w.disconnect()}}},[e]),f.useEffect(()=>{if(a){let R=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(R)}}},[a]);let g=()=>{n(!0)},E=()=>{n(!1),l(!1)};return r?e!=="intent"?[o,y,{}]:[o,y,{onFocus:Ze(s,g),onBlur:Ze(i,E),onMouseEnter:Ze(u,g),onMouseLeave:Ze(d,E),onTouchStart:Ze(m,g)}]:[!1,y,{}]}function Ze(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Tr(e,t,r){if(r&&!Mt)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 ms(){let{isSpaMode:e,manifest:t,routeModules:r,criticalCss:a}=Ye(),{errors:n,matches:o}=It(),l=Tr(o,n,e),s=f.useMemo(()=>ul(l,r,t),[l,r,t]);return f.createElement(f.Fragment,null,typeof a=="string"?f.createElement("style",{dangerouslySetInnerHTML:{__html:a}}):null,typeof a=="object"?f.createElement("link",{rel:"stylesheet",href:a.href}):null,s.map(({key:i,link:u})=>Er(u)?f.createElement(fa,{key:i,...u}):f.createElement("link",{key:i,...u})))}function fa({page:e,...t}){let{router:r}=Pr(),a=f.useMemo(()=>ge(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?f.createElement(kl,{page:e,matches:a,...t}):null}function Ol(e){let{manifest:t,routeModules:r}=Ye(),[a,n]=f.useState([]);return f.useEffect(()=>{let o=!1;return fl(e,t,r).then(l=>{o||n(l)}),()=>{o=!0}},[e,t,r]),a}function kl({page:e,matches:t,...r}){let a=me(),{manifest:n,routeModules:o}=Ye(),{basename:l}=Pr(),{loaderData:s,matches:i}=It(),u=f.useMemo(()=>En(e,t,i,n,a,"data"),[e,t,i,n,a]),d=f.useMemo(()=>En(e,t,i,n,a,"assets"),[e,t,i,n,a]),m=f.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let E=new Set,R=!1;if(t.forEach(S=>{var L;let x=n.routes[S.route.id];!x||!x.hasLoader||(!u.some(T=>T.route.id===S.route.id)&&S.route.id in s&&((L=o[S.route.id])!=null&&L.shouldRevalidate)||x.hasClientLoader?R=!0:E.add(S.route.id))}),E.size===0)return[];let w=st(e,l);return R&&E.size>0&&w.searchParams.set("_routes",t.filter(S=>E.has(S.route.id)).map(S=>S.route.id).join(",")),[w.pathname+w.search]},[l,s,a,n,u,t,e,o]),y=f.useMemo(()=>Rr(d,n),[d,n]),g=Ol(d);return f.createElement(f.Fragment,null,m.map(E=>f.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),y.map(E=>f.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),g.map(({key:E,link:R})=>f.createElement("link",{key:E,...R})))}function ps(){let{isSpaMode:e,routeModules:t}=Ye(),{errors:r,matches:a,loaderData:n}=It(),o=me(),l=Tr(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 y=l[m],g=y.route.id,E=n[g],R=y.params,w=t[g],S=[],x={id:g,data:E,meta:[],params:y.params,pathname:y.pathname,handle:y.route.handle,error:s};if(d[m]=x,w!=null&&w.meta?S=typeof w.meta=="function"?w.meta({data:E,params:R,location:o,matches:d,error:s}):Array.isArray(w.meta)?[...w.meta]:w.meta:u&&(S=[...u]),S=S||[],!Array.isArray(S))throw new Error("The route at "+y.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`);x.meta=S,d[m]=x,i=[...S],u=i}return f.createElement(f.Fragment,null,i.flat().map(m=>{if(!m)return null;if("tagName"in m){let{tagName:y,...g}=m;if(!Al(y))return console.warn(`A meta object uses an invalid tagName: ${y}. Expected either 'link' or 'meta'`),null;let E=y;return f.createElement(E,{key:JSON.stringify(g),...g})}if("title"in m)return f.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"?f.createElement("meta",{key:"charSet",charSet:m.charSet}):null;if("script:ld+json"in m)try{let y=JSON.stringify(m["script:ld+json"]);return f.createElement("script",{key:`script:ld+json:${y}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:y}})}catch{return null}return f.createElement("meta",{key:JSON.stringify(m),...m})}))}function Al(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var Mt=!1;function Nl(e){let{manifest:t,serverHandoffString:r,isSpaMode:a,ssr:n,renderMeta:o}=Ye(),{router:l,static:s,staticContext:i}=Pr(),{matches:u}=It(),d=Cr(n);o&&(o.didRenderScripts=!0);let m=Tr(u,null,a);f.useEffect(()=>{Mt=!0},[]);let y=f.useMemo(()=>{var x;let w=i?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",S=s?`${(x=t.hmr)!=null&&x.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${d?"":`import ${JSON.stringify(t.url)}`};
|
|
44
|
+
${m.map((L,T)=>{let h=`route${T}`,P=t.routes[L.route.id];oe(P,`Route ${L.route.id} not found in manifest`);let{clientActionModule:A,clientLoaderModule:D,clientMiddlewareModule:U,hydrateFallbackModule:z,module:q}=P,ne=[...A?[{module:A,varName:`${h}_clientAction`}]:[],...D?[{module:D,varName:`${h}_clientLoader`}]:[],...U?[{module:U,varName:`${h}_clientMiddleware`}]:[],...z?[{module:z,varName:`${h}_HydrateFallback`}]:[],{module:q,varName:`${h}_main`}];if(ne.length===1)return`import * as ${h} from ${JSON.stringify(q)};`;let te=ne.map(Y=>`import * as ${Y.varName} from "${Y.module}";`).join(`
|
|
45
|
+
`),Le=`const ${h} = {${ne.map(Y=>`...${Y.varName}`).join(",")}};`;return[te,Le].join(`
|
|
46
|
+
`)}).join(`
|
|
47
|
+
`)}
|
|
48
|
+
${d?`window.__reactRouterManifest = ${JSON.stringify(Tl(t,l),null,2)};`:""}
|
|
49
|
+
window.__reactRouterRouteModules = {${m.map((L,T)=>`${JSON.stringify(L.route.id)}:route${T}`).join(",")}};
|
|
50
|
+
|
|
51
|
+
import(${JSON.stringify(t.entry.module)});`:" ";return f.createElement(f.Fragment,null,f.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:Rn(w),type:void 0}),f.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:Rn(S),type:"module",async:!0}))},[]),g=Mt?[]:$l(t.entry.imports.concat(Rr(m,t,{includeHydrateFallback:!0}))),E=typeof t.sri=="object"?t.sri:{};return Mt?null:f.createElement(f.Fragment,null,typeof t.sri=="object"?f.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:E})}}):null,d?null:f.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:E[t.url],suppressHydrationWarning:!0}),f.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:E[t.entry.module],suppressHydrationWarning:!0}),g.map(R=>f.createElement("link",{key:R,rel:"modulepreload",href:R,crossOrigin:e.crossOrigin,integrity:E[R],suppressHydrationWarning:!0})),y)}function $l(e){return[...new Set(e)]}function Il(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var ha=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ha&&(window.__reactRouterVersion="7.5.0")}catch{}var ma=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pa=f.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,...y},g){let{basename:E}=f.useContext(se),R=typeof u=="string"&&ma.test(u),w,S=!1;if(typeof u=="string"&&R&&(w=u,ha))try{let U=new URL(window.location.href),z=u.startsWith("//")?new URL(U.protocol+u):new URL(u),q=ie(z.pathname,E);z.origin===U.origin&&q!=null?u=q+z.search+z.hash:S=!0}catch{G(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let x=Ni(u,{relative:n}),[L,T,h]=Dl(a,y),P=zl(u,{replace:l,state:s,target:i,preventScrollReset:d,relative:n,viewTransition:m});function A(U){t&&t(U),U.defaultPrevented||P(U)}let D=f.createElement("a",{...y,...h,href:w||x,onClick:S||o?t:A,ref:Il(g,T),target:i,"data-discover":!R&&r==="render"?"true":void 0});return L&&!R?f.createElement(f.Fragment,null,D,f.createElement(fa,{page:x})):D});pa.displayName="Link";var Fl=f.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=ot(l,{relative:u.relative}),y=me(),g=f.useContext(Be),{navigator:E,basename:R}=f.useContext(se),w=g!=null&&Kl(m)&&s===!0,S=E.encodeLocation?E.encodeLocation(m).pathname:m.pathname,x=y.pathname,L=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(x=x.toLowerCase(),L=L?L.toLowerCase():null,S=S.toLowerCase()),L&&R&&(L=ie(L,R)||L);const T=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let h=x===S||!n&&x.startsWith(S)&&x.charAt(T)==="/",P=L!=null&&(L===S||!n&&L.startsWith(S)&&L.charAt(S.length)==="/"),A={isActive:h,isPending:P,isTransitioning:w},D=h?t:void 0,U;typeof a=="function"?U=a(A):U=[a,h?"active":null,P?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let z=typeof o=="function"?o(A):o;return f.createElement(pa,{...u,"aria-current":D,className:U,ref:d,style:z,to:l,viewTransition:s},typeof i=="function"?i(A):i)});Fl.displayName="NavLink";var jl=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:l=Ct,action:s,onSubmit:i,relative:u,preventScrollReset:d,viewTransition:m,...y},g)=>{let E=Wl(),R=Vl(s,{relative:u}),w=l.toLowerCase()==="get"?"get":"post",S=typeof s=="string"&&ma.test(s),x=L=>{if(i&&i(L),L.defaultPrevented)return;L.preventDefault();let T=L.nativeEvent.submitter,h=(T==null?void 0:T.getAttribute("formmethod"))||l;E(T||L.currentTarget,{fetcherKey:t,method:h,navigate:r,replace:n,state:o,relative:u,preventScrollReset:d,viewTransition:m})};return f.createElement("form",{ref:g,method:w,action:R,onSubmit:a?i:x,...y,"data-discover":!S&&e==="render"?"true":void 0})});jl.displayName="Form";function Ul({getKey:e,storageKey:t,...r}){let a=f.useContext(Ft),{basename:n}=f.useContext(se),o=me(),l=Qn();Jl({getKey:e,storageKey:t});let s=f.useMemo(()=>{if(!a||!e)return null;let u=or(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 y=JSON.parse(sessionStorage.getItem(u)||"{}")[d||window.history.state.key];typeof y=="number"&&window.scrollTo(0,y)}catch(m){console.error(m),sessionStorage.removeItem(u)}}).toString();return f.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${i})(${JSON.stringify(t||ar)}, ${JSON.stringify(s)})`}})}Ul.displayName="ScrollRestoration";function ya(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mr(e){let t=f.useContext(Ae);return j(t,ya(e)),t}function Hl(e){let t=f.useContext(Be);return j(t,ya(e)),t}function zl(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:l}={}){let s=$i(),i=me(),u=ot(e,{relative:o});return f.useCallback(d=>{if(ol(d,t)){d.preventDefault();let m=r!==void 0?r:be(i)===be(u);s(e,{replace:m,state:a,preventScrollReset:n,relative:o,viewTransition:l})}},[i,s,u,r,a,t,e,n,o,l])}var Bl=0,Yl=()=>`__${String(++Bl)}__`;function Wl(){let{router:e}=Mr("useSubmit"),{basename:t}=f.useContext(se),r=Gi();return f.useCallback(async(a,n={})=>{let{action:o,method:l,encType:s,formData:i,body:u}=sl(a,t);if(n.navigate===!1){let d=n.fetcherKey||Yl();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 Vl(e,{relative:t}={}){let{basename:r}=f.useContext(se),a=f.useContext(ce);j(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...ot(e||".",{relative:t})},l=me();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:he([r,o.pathname])),be(o)}var ar="react-router-scroll-positions",xt={};function or(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:ie(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function Jl({getKey:e,storageKey:t}={}){let{router:r}=Mr("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=Hl("useScrollRestoration"),{basename:o}=f.useContext(se),l=me(),s=Qn(),i=Ki();f.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Gl(f.useCallback(()=>{if(i.state==="idle"){let u=or(l,s,o,e);xt[u]=window.scrollY}try{sessionStorage.setItem(t||ar,JSON.stringify(xt))}catch(u){G(!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"&&(f.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||ar);u&&(xt=JSON.parse(u))}catch{}},[t]),f.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(xt,()=>window.scrollY,e?(d,m)=>or(d,m,o,e):void 0);return()=>u&&u()},[r,o,e]),f.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 Gl(e,t){let{capture:r}={};f.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function Kl(e,t={}){let r=f.useContext(vr);j(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Mr("useViewTransitionState"),n=ot(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=ie(r.currentLocation.pathname,a)||r.currentLocation.pathname,l=ie(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Dt(n.pathname,l)!=null||Dt(n.pathname,o)!=null}new TextEncoder;function ys(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 Se(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{os as A,as as B,ns as C,Zn as D,Ft as F,ms as L,ps as M,Fl as N,ss as O,cs as R,Ul as S,ls as a,ys as b,Lr as c,El as d,rs as e,us as f,fs as g,ts as h,j as i,ds as j,is as k,Ql as l,ge as m,Nl as n,ke as o,$i as p,pa as q,f as r,Ll as s,me as t,hs as u,to as v,Ia as w,Zl as x,ql as y,Qn as z};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{r as s}from"./chunk-KNED5TY2-CXj9yqcQ.js";/**
|
|
2
|
+
* @license lucide-react v0.487.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const d=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),w=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,o)=>o?o.toUpperCase():r.toLowerCase()),c=e=>{const t=w(e);return t.charAt(0).toUpperCase()+t.slice(1)},l=(...e)=>e.filter((t,r,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===r).join(" ").trim();/**
|
|
7
|
+
* @license lucide-react v0.487.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/var f={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
12
|
+
* @license lucide-react v0.487.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const g=s.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:a,iconNode:i,...u},m)=>s.createElement("svg",{ref:m,...f,width:t,height:t,stroke:e,strokeWidth:o?Number(r)*24/Number(t):r,className:l("lucide",n),...u},[...i.map(([p,C])=>s.createElement(p,C)),...Array.isArray(a)?a:[a]]));/**
|
|
17
|
+
* @license lucide-react v0.487.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const A=(e,t)=>{const r=s.forwardRef(({className:o,...n},a)=>s.createElement(g,{ref:a,iconNode:t,className:l(`lucide-${d(c(e))}`,`lucide-${e}`,o),...n}));return r.displayName=c(e),r};export{A as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as h}from"./index-G-cqIhgh.js";import{l as e,r as j,q as b}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{c as m}from"./utils-DslUJpbf.js";import{a as w,u as C,g as N,h as v}from"./editorialApi-DCnC5eM9.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-DrhM6FV9.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};
|
|
@@ -0,0 +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";/**
|
|
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 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);/**
|
|
7
|
+
* @license lucide-react v0.487.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],O=x("circle",E);/**
|
|
12
|
+
* @license lucide-react v0.487.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const 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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as a}from"./index-G-cqIhgh.js";import{l as o}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{I as s}from"./itemForm-dtoqbEoC.js";import{i as p,k as c}from"./editorialApi-DCnC5eM9.js";import"./button-O0EDocjF.js";import"./utils-DslUJpbf.js";import"./input-BH49oaMa.js";import"./index-B_FOxFgA.js";import"./index-B7e3fQ32.js";import"./createLucideIcon-TQsNVzYU.js";import"./index-C-iH5ItK.js";import"./tslib.es6-CDuPK5Eb.js";const b=a(function({params:m}){const{collectionId:t,documentId:r}=m,{data:e}=p(t),{data:i}=c({itemType:t,id:r});return!e||!i?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:i})})})});export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as i}from"./index-G-cqIhgh.js";import{l as o}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{I as m}from"./itemForm-dtoqbEoC.js";import{i as s}from"./editorialApi-DCnC5eM9.js";import"./button-O0EDocjF.js";import"./utils-DslUJpbf.js";import"./input-BH49oaMa.js";import"./index-B_FOxFgA.js";import"./index-B7e3fQ32.js";import"./createLucideIcon-TQsNVzYU.js";import"./index-C-iH5ItK.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};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import{w as ue}from"./index-G-cqIhgh.js";import{l as e,r as d,q as N,N as he,t as K,p as pe,v as xe,O as fe}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{c as W,u as Q,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 X,C as Z,a as Y,T as J,D as ee,P as te,O as ae,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 f}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";/**
|
|
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 Ie=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Te=f("arrow-down",Ie);/**
|
|
7
|
+
* @license lucide-react v0.487.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Le=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],$e=f("arrow-up",Le);/**
|
|
12
|
+
* @license lucide-react v0.487.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Be=[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]],He=f("blocks",Be);/**
|
|
17
|
+
* @license lucide-react v0.487.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Ge=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qe=f("chevron-right",Ge);/**
|
|
22
|
+
* @license lucide-react v0.487.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const Fe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Ve=f("external-link",Fe);/**
|
|
27
|
+
* @license lucide-react v0.487.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const Ue=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],Ke=f("files",Ue);/**
|
|
32
|
+
* @license lucide-react v0.487.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const We=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Qe=f("grid-3x3",We);/**
|
|
37
|
+
* @license lucide-react v0.487.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const Xe=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]],Ze=f("heart",Xe);/**
|
|
42
|
+
* @license lucide-react v0.487.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const Ye=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],Je=f("log-out",Ye);/**
|
|
47
|
+
* @license lucide-react v0.487.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const et=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],tt=f("panel-left",et);/**
|
|
52
|
+
* @license lucide-react v0.487.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const at=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],st=f("square",at);/**
|
|
57
|
+
* @license lucide-react v0.487.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const nt=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],ot=f("upload",nt);/**
|
|
62
|
+
* @license lucide-react v0.487.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
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"}]],se=f("x",it);function rt({...t}){return e.jsx(X,{"data-slot":"dialog",...t})}function dt({...t}){return e.jsx(te,{"data-slot":"dialog-portal",...t})}function lt({className:t,...a}){return e.jsx(ae,{"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(Z,{"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(Y,{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(se,{}),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(J,{"data-slot":"dialog-title",className:r("text-lg leading-none font-semibold",t),...a})}function xt({className:t,...a}){return e.jsx(ee,{"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",W.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"],ne=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})});ne.displayName=vt;function yt(t){return wt.includes(t)}var Nt=ne;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(X,{"data-slot":"sheet",...t})}function St({...t}){return e.jsx(te,{"data-slot":"sheet-portal",...t})}function kt({className:t,...a}){return e.jsx(ae,{"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(Z,{"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(Y,{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(se,{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(J,{"data-slot":"sheet-title",className:r("text-foreground font-semibold",t),...a})}function Rt({className:t,...a}){return e.jsx(ee,{"data-slot":"sheet-description",className:r("text-muted-foreground text-sm",t),...a})}function oe({delayDuration:t=0,...a}){return e.jsx(ye,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function At({...t}){return e.jsx(oe,{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",ie=d.createContext(null);function A(){const t=d.useContext(ie);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(),[x,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:x,setOpenMobile:p,toggleSidebar:v}),[y,m,j,u,x,p,v]);return e.jsx(ie.Provider,{value:_,children:e.jsx(oe,{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:x,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:x,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:x,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"||x,...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}=Q(),{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(he,{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),re=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:c,...u}=t,[x=!1,p]=Re({prop:s,defaultProp:o,onChange:c});return e.jsx(Yt,{scope:n,disabled:i,contentId:Me(),open:x,onOpenToggle:d.useCallback(()=>p(g=>!g),[p]),children:e.jsx(k.div,{"data-state":I(x),"data-disabled":i?"":void 0,...u,ref:a})})});re.displayName=z;var de="CollapsibleTrigger",le=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=D(de,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)})});le.displayName=de;var P="CollapsibleContent",ce=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})})});ce.displayName=P;var Jt=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=t,c=D(P,n),[u,x]=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),x(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=re;function F({...t}){return e.jsx(ea,{"data-slot":"collapsible",...t})}function V({...t}){return e.jsx(le,{"data-slot":"collapsible-trigger",...t})}function U({...t}){return e.jsx(ce,{"data-slot":"collapsible-content",...t})}function ta(){const t=ve(),{pathname:a}=K(),[n,s]=d.useState(!1),[o]=ge(),[i]=me(),[c]=je(),u=E(x=>x.auth.role);return e.jsxs(qt,{className:"z-50",children:[e.jsx(jt,{isOpen:n,setOpen:s}),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:[u==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(b,{onClick:()=>i(),children:[e.jsx(Te,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(b,{onClick:()=>c(),children:[e.jsx($e,{}),e.jsx("span",{children:"Push to repo"})]})})]}),e.jsx(w,{children:e.jsxs(b,{onClick:()=>o(),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:W.PREVIEW_URL,children:["Preview",e.jsx(Ve,{className:"ml-auto"})]})}),e.jsx(b,{onClick:()=>s(!0),children:"About"}),e.jsxs(b,{onClick:()=>t(we()),children:[e.jsx(Je,{}),"Log out"]})]})]})}function aa({children:t}){const a=pe(),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}=K(),{data:a}=Q(),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=ue(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};
|