@isardsat/editorial-admin 6.0.1 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/build/client/__spa-fallback.html +13 -0
  2. package/build/client/admin/index.html +22 -0
  3. package/build/client/assets/{authSlice-KDhecIDl.js → authSlice-5XZo_yNS.js} +181 -181
  4. package/build/client/assets/{button-O0EDocjF.js → button-V-1j5t4f.js} +1 -1
  5. package/build/client/assets/dashboard-Be6nTcTN.js +1 -0
  6. package/build/client/assets/dashboard._collection-DppEZSog.js +16 -0
  7. package/build/client/assets/dashboard._collection._document-DX_V-XK4.js +1 -0
  8. package/build/client/assets/dashboard._collection.new-CocdSIiG.js +1 -0
  9. package/build/client/assets/dashboard._layout-Df-C65Il.js +65 -0
  10. package/build/client/assets/dashboard.files-Doq5nv7_.js +36 -0
  11. package/build/client/assets/editorialApi-CykQGjTu.js +1 -0
  12. package/build/client/assets/{home-wnsWYgD_.js → home-ZtJfV8P0.js} +2 -2
  13. package/build/client/assets/index-CMEgjExU.js +46 -0
  14. package/build/client/assets/{index-B_FOxFgA.js → index-D4Mj6Lef.js} +1 -1
  15. package/build/client/assets/{index-DrhM6FV9.js → index-DZxX-xes.js} +2 -2
  16. package/build/client/assets/{input-BH49oaMa.js → input-D-kT9R-x.js} +2 -2
  17. package/build/client/assets/itemForm-CcPfHU2b.css +1 -0
  18. package/build/client/assets/itemForm-ChV6tjGl.js +99 -0
  19. package/build/client/assets/manifest-a1ca6f8e.js +1 -0
  20. package/build/client/assets/react-redux-D9l7ZD4q.js +9 -0
  21. package/build/client/assets/root-BvXgIVX7.js +1 -0
  22. package/build/client/assets/root-DhulzpWQ.css +1 -0
  23. package/build/client/assets/{tslib.es6-CDuPK5Eb.js → tslib.es6-De9GV7Vy.js} +1 -1
  24. package/build/client/assets/utils-BJX_0rcU.js +1 -0
  25. package/build/client/index.html +18 -10
  26. package/package.json +4 -4
  27. package/build/client/assets/dashboard-Binq3-uL.js +0 -1
  28. package/build/client/assets/dashboard._collection-DCypgAsP.js +0 -16
  29. package/build/client/assets/dashboard._collection._document-B9dEIw39.js +0 -1
  30. package/build/client/assets/dashboard._collection.new-QbdwRouF.js +0 -1
  31. package/build/client/assets/dashboard._layout-BdJ3SrSw.js +0 -66
  32. package/build/client/assets/dashboard.files-DVCxRHOl.js +0 -36
  33. package/build/client/assets/editorialApi-DCnC5eM9.js +0 -1
  34. package/build/client/assets/index-C-iH5ItK.js +0 -45
  35. package/build/client/assets/index-G-cqIhgh.js +0 -9
  36. package/build/client/assets/itemForm-CDbHkFXh.css +0 -1
  37. package/build/client/assets/itemForm-dtoqbEoC.js +0 -90
  38. package/build/client/assets/manifest-a309df9e.js +0 -1
  39. package/build/client/assets/root-DHDQPxhg.js +0 -1
  40. package/build/client/assets/root-DS7N36v7.css +0 -1
  41. package/build/client/assets/utils-DslUJpbf.js +0 -1
@@ -1,13 +1,21 @@
1
- <!DOCTYPE html><html lang="en" class="min-h-screen"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Editorial Admin</title><link rel="modulepreload" href="/assets/manifest-a309df9e.js"/><link rel="modulepreload" href="/assets/entry.client-B5Ca3clj.js"/><link rel="modulepreload" href="/assets/chunk-KNED5TY2-CXj9yqcQ.js"/><link rel="modulepreload" href="/assets/index-B7e3fQ32.js"/><link rel="modulepreload" href="/assets/root-DHDQPxhg.js"/><link rel="modulepreload" href="/assets/index-G-cqIhgh.js"/><link rel="modulepreload" href="/assets/authSlice-KDhecIDl.js"/><link rel="modulepreload" href="/assets/editorialApi-DCnC5eM9.js"/><link rel="modulepreload" href="/assets/tslib.es6-CDuPK5Eb.js"/><link rel="stylesheet" href="/assets/root-DS7N36v7.css"/></head><body class="h-full min-h-screen bg-background font-sans antialiased"><script>
2
- console.log(
3
- "💿 Hey developer 👋. You can provide a way better UX than this " +
4
- "when your app is loading JS modules and/or running `clientLoader` " +
5
- "functions. Check out https://remix.run/route/hydrate-fallback " +
6
- "for more information."
7
- );
8
- </script><script>window.__reactRouterContext = {"basename":"/","future":{"unstable_middleware":false,"unstable_optimizeDeps":false,"unstable_splitRouteModules":false,"unstable_subResourceIntegrity":false,"unstable_viteEnvironmentApi":false},"ssr":false,"isSpaMode":true};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());</script><script type="module" async="">import "/assets/manifest-a309df9e.js";
9
- import * as route0 from "/assets/root-DHDQPxhg.js";
1
+ <!DOCTYPE html><html lang="en" class="min-h-screen"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Editorial Admin</title><link rel="modulepreload" href="/assets/manifest-a1ca6f8e.js"/><link rel="modulepreload" href="/assets/entry.client-B5Ca3clj.js"/><link rel="modulepreload" href="/assets/chunk-KNED5TY2-CXj9yqcQ.js"/><link rel="modulepreload" href="/assets/index-B7e3fQ32.js"/><link rel="modulepreload" href="/assets/root-BvXgIVX7.js"/><link rel="modulepreload" href="/assets/react-redux-D9l7ZD4q.js"/><link rel="modulepreload" href="/assets/authSlice-5XZo_yNS.js"/><link rel="modulepreload" href="/assets/editorialApi-CykQGjTu.js"/><link rel="modulepreload" href="/assets/tslib.es6-De9GV7Vy.js"/><link rel="stylesheet" href="/assets/root-DhulzpWQ.css"/></head><body class="h-full min-h-screen bg-background font-sans antialiased"><script>((storageKey2, restoreKey) => {
2
+ if (!window.history.state || !window.history.state.key) {
3
+ let key = Math.random().toString(32).slice(2);
4
+ window.history.replaceState({ key }, "");
5
+ }
6
+ try {
7
+ let positions = JSON.parse(sessionStorage.getItem(storageKey2) || "{}");
8
+ let storedY = positions[restoreKey || window.history.state.key];
9
+ if (typeof storedY === "number") {
10
+ window.scrollTo(0, storedY);
11
+ }
12
+ } catch (error) {
13
+ console.error(error);
14
+ sessionStorage.removeItem(storageKey2);
15
+ }
16
+ })("react-router-scroll-positions", null)</script><script>window.__reactRouterContext = {"basename":"/","future":{"unstable_middleware":false,"unstable_optimizeDeps":false,"unstable_splitRouteModules":false,"unstable_subResourceIntegrity":false,"unstable_viteEnvironmentApi":false},"ssr":false,"isSpaMode":false};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());</script><script type="module" async="">import "/assets/manifest-a1ca6f8e.js";
17
+ import * as route0 from "/assets/root-BvXgIVX7.js";
10
18
 
11
19
  window.__reactRouterRouteModules = {"root":route0};
12
20
 
13
- import("/assets/entry.client-B5Ca3clj.js");</script><!--$--><script>window.__reactRouterContext.streamController.enqueue("[{\"_1\":2,\"_4\":-5,\"_5\":-5},\"loaderData\",{\"_3\":-5},\"root\",\"actionData\",\"errors\"]\n");</script><!--$--><script>window.__reactRouterContext.streamController.close();</script><!--/$--><!--/$--></body></html>
21
+ import("/assets/entry.client-B5Ca3clj.js");</script><!--$?--><template id="B:0"></template><!--/$--><div hidden id="S:0"><script>window.__reactRouterContext.streamController.enqueue("[{\"_1\":2,\"_4\":-5,\"_5\":-5},\"loaderData\",{\"_3\":-5},\"root\",\"actionData\",\"errors\"]\n");</script><!--$?--><template id="B:1"></template><!--/$--></div><script>$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RC("B:0","S:0")</script><div hidden id="S:1"><script>window.__reactRouterContext.streamController.close();</script></div><script>$RC("B:1","S:1")</script></body></html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isardsat/editorial-admin",
3
- "version": "6.0.1",
3
+ "version": "6.0.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@hookform/resolvers": "^3.10.0",
18
18
  "@icons-pack/react-simple-icons": "^11.2.0",
19
- "@mdxeditor/editor": "^3.21.3",
19
+ "@mdxeditor/editor": "=3.36.0",
20
20
  "@radix-ui/react-accordion": "^1.2.4",
21
21
  "@radix-ui/react-alert-dialog": "^1.1.7",
22
22
  "@radix-ui/react-aspect-ratio": "^1.1.3",
@@ -43,7 +43,6 @@
43
43
  "@radix-ui/react-toggle": "^1.1.3",
44
44
  "@radix-ui/react-toggle-group": "^1.1.3",
45
45
  "@radix-ui/react-tooltip": "^1.2.0",
46
- "@react-router/dev": "^7.5.0",
47
46
  "@react-router/node": "^7.5.0",
48
47
  "@react-router/serve": "^7.5.0",
49
48
  "@reduxjs/toolkit": "^2.5.1",
@@ -80,9 +79,10 @@
80
79
  "vaul": "^1.1.2",
81
80
  "vite-plugin-babel": "^1.3.0",
82
81
  "zod": "^3.24.1",
83
- "@isardsat/editorial-common": "^6.0.1"
82
+ "@isardsat/editorial-common": "^6.0.3"
84
83
  },
85
84
  "devDependencies": {
85
+ "@react-router/dev": "^7.5.0",
86
86
  "@types/node": "^20",
87
87
  "@types/react": "^19.0.1",
88
88
  "@types/react-dom": "^19.0.1",
@@ -1 +0,0 @@
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};
@@ -1,16 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1,66 +0,0 @@
1
- import{w as ce}from"./index-G-cqIhgh.js";import{l as e,r as d,q as N,N as ue,p as he,t as pe,v as xe,O as fe}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{c as K,u as W,a as be,b as ge,d as me,f as je}from"./editorialApi-DCnC5eM9.js";import{u as ve,d as E,e as we}from"./authSlice-KDhecIDl.js";import{R as Q,C as X,a as Z,T as Y,D as J,P as ee,O as te,b as ye,c as Ne,d as Ce,e as _e,f as Se,A as ke,u as Me}from"./index-C-iH5ItK.js";import{c as r}from"./utils-DslUJpbf.js";import{c as x}from"./createLucideIcon-TQsNVzYU.js";import{B as O,S as R,c as Ee,u as Oe}from"./button-O0EDocjF.js";import{P as k,u as Re,c as Ae,a as ze,b as De,d as Pe}from"./index-B_FOxFgA.js";import{C as L}from"./chevron-down-BMtosYlL.js";import"./tslib.es6-CDuPK5Eb.js";import"./index-B7e3fQ32.js";/**
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=x("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=x("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=x("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=x("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=x("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=x("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=x("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=x("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=x("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=x("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=x("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=x("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"}]],ae=x("x",it);function rt({...t}){return e.jsx(Q,{"data-slot":"dialog",...t})}function dt({...t}){return e.jsx(ee,{"data-slot":"dialog-portal",...t})}function lt({className:t,...a}){return e.jsx(te,{"data-slot":"dialog-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function ct({className:t,children:a,...n}){return e.jsxs(dt,{"data-slot":"dialog-portal",children:[e.jsx(lt,{}),e.jsxs(X,{"data-slot":"dialog-content",className:r("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...n,children:[a,e.jsxs(Z,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(ae,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ut({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2 text-center sm:text-left",t),...a})}function ht({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function pt({className:t,...a}){return e.jsx(Y,{"data-slot":"dialog-title",className:r("text-lg leading-none font-semibold",t),...a})}function xt({className:t,...a}){return e.jsx(J,{"data-slot":"dialog-description",className:r("text-muted-foreground text-sm",t),...a})}const ft="#181717",bt=d.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=ft),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})}),gt="#85EA2D",mt=d.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=gt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"})]})});function jt({isOpen:t,setOpen:a}){return e.jsx(rt,{open:t,onOpenChange:n=>a(n),children:e.jsxs(ct,{children:[e.jsxs(ut,{children:[e.jsx(pt,{children:"Editorial"}),e.jsx(xt,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(O,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:new URL("/doc",K.EDITORIAL_API_URL).href,children:[e.jsx(mt,{size:14}),"Swagger API UI"]})}),e.jsx(O,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(bt,{size:14}),"GitHub repository"]})})]}),e.jsx(ht,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(Ze,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",e.jsx(N,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}var vt="Separator",$="horizontal",wt=["horizontal","vertical"],se=d.forwardRef((t,a)=>{const{decorative:n,orientation:s=$,...o}=t,i=yt(s)?s:$,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return e.jsx(k.div,{"data-orientation":i,...u,...o,ref:a})});se.displayName=vt;function yt(t){return wt.includes(t)}var Nt=se;function Ct({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(Nt,{"data-slot":"separator-root",decorative:n,orientation:a,className:r("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...s})}function _t({...t}){return e.jsx(Q,{"data-slot":"sheet",...t})}function St({...t}){return e.jsx(ee,{"data-slot":"sheet-portal",...t})}function kt({className:t,...a}){return e.jsx(te,{"data-slot":"sheet-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function Mt({className:t,children:a,side:n="right",...s}){return e.jsxs(St,{children:[e.jsx(kt,{}),e.jsxs(X,{"data-slot":"sheet-content",className:r("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,e.jsxs(Z,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(ae,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Et({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:r("flex flex-col gap-1.5 p-4",t),...a})}function Ot({className:t,...a}){return e.jsx(Y,{"data-slot":"sheet-title",className:r("text-foreground font-semibold",t),...a})}function Rt({className:t,...a}){return e.jsx(J,{"data-slot":"sheet-description",className:r("text-muted-foreground text-sm",t),...a})}function ne({delayDuration:t=0,...a}){return e.jsx(ye,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function At({...t}){return e.jsx(ne,{children:e.jsx(Ne,{"data-slot":"tooltip",...t})})}function zt({...t}){return e.jsx(Ce,{"data-slot":"tooltip-trigger",...t})}function Dt({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(_e,{children:e.jsxs(Se,{"data-slot":"tooltip-content",sideOffset:a,className:r("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...s,children:[n,e.jsx(ke,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const M=768;function Pt(){const[t,a]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${M-1}px)`),s=()=>{a(window.innerWidth<M)};return n.addEventListener("change",s),a(window.innerWidth<M),()=>n.removeEventListener("change",s)},[]),!!t}const It="sidebar_state",Tt=60*60*24*7,Lt="16rem",$t="18rem",Bt="3rem",Ht="b",oe=d.createContext(null);function A(){const t=d.useContext(oe);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Gt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...c}){const u=Pt(),[f,p]=d.useState(!1),[g,C]=d.useState(t),m=a??g,j=d.useCallback(h=>{const l=typeof h=="function"?h(m):h;n?n(l):C(l),document.cookie=`${It}=${l}; path=/; max-age=${Tt}`},[n,m]),v=d.useCallback(()=>u?p(h=>!h):j(h=>!h),[u,j,p]);d.useEffect(()=>{const h=l=>{l.key===Ht&&(l.metaKey||l.ctrlKey)&&(l.preventDefault(),v())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[v]);const y=m?"expanded":"collapsed",_=d.useMemo(()=>({state:y,open:m,setOpen:j,isMobile:u,openMobile:f,setOpenMobile:p,toggleSidebar:v}),[y,m,j,u,f,p,v]);return e.jsx(oe.Provider,{value:_,children:e.jsx(ne,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Lt,"--sidebar-width-icon":Bt,...o},className:r("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...c,children:i})})})}function qt({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...i}){const{isMobile:c,state:u,openMobile:f,setOpenMobile:p}=A();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:r("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...i,children:o}):c?e.jsx(_t,{open:f,onOpenChange:p,...i,children:e.jsxs(Mt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":$t},side:t,children:[e.jsxs(Et,{className:"sr-only",children:[e.jsx(Ot,{children:"Sidebar"}),e.jsx(Rt,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:r("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:r("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...i,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function Ft({className:t,onClick:a,...n}){const{toggleSidebar:s}=A();return e.jsxs(O,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:r("size-7",t),onClick:o=>{a==null||a(o),s()},...n,children:[e.jsx(tt,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Vt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r("flex flex-col gap-2 p-2",t),...a})}function Ut({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r("flex flex-col gap-2 p-2",t),...a})}function Kt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function S({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r("relative flex w-full min-w-0 flex-col p-2",t),...a})}function B({className:t,asChild:a=!1,...n}){const s=a?R:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:r("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function H({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r("w-full text-sm",t),...a})}function G({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r("flex w-full min-w-0 flex-col gap-1",t),...a})}function w({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:r("group/menu-item relative",t),...a})}const Wt=Ee("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function b({asChild:t=!1,isActive:a=!1,variant:n="default",size:s="default",tooltip:o,className:i,...c}){const u=t?R:"button",{isMobile:f,state:p}=A(),g=e.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:r(Wt({variant:n,size:s}),i),...c});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(At,{children:[e.jsx(zt,{asChild:!0,children:g}),e.jsx(Dt,{side:"right",align:"center",hidden:p!=="collapsed"||f,...o})]})):g}function Qt({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:r("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Xt({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const i=t?R:"a";return e.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:r("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...o})}function q({singleton:t}){const{data:a}=W(),{data:n}=be();return a?e.jsx(e.Fragment,{children:Object.entries(a).filter(([,s])=>t?s.singleton:!s.singleton).map(([s,o])=>e.jsx(Qt,{children:e.jsx(ue,{to:t?`/admin/dashboard/${s}/default`:`/admin/dashboard/${s}`,className:({isActive:i,isPending:c})=>c?"pending":i?"active":"",children:({isActive:i})=>e.jsxs(Xt,{isActive:i,children:[e.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap w-full",children:o.displayName}),!t&&n&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1",children:Object.keys(n[s]).length})]})})},o.displayName))}):null}var z="Collapsible",[Zt,ba]=Ae(z),[Yt,D]=Zt(z),ie=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:c,...u}=t,[f=!1,p]=Re({prop:s,defaultProp:o,onChange:c});return e.jsx(Yt,{scope:n,disabled:i,contentId:Me(),open:f,onOpenToggle:d.useCallback(()=>p(g=>!g),[p]),children:e.jsx(k.div,{"data-state":I(f),"data-disabled":i?"":void 0,...u,ref:a})})});ie.displayName=z;var re="CollapsibleTrigger",de=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=D(re,n);return e.jsx(k.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":I(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:a,onClick:ze(t.onClick,o.onOpenToggle)})});de.displayName=re;var P="CollapsibleContent",le=d.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=D(P,t.__scopeCollapsible);return e.jsx(De,{present:n||o.open,children:({present:i})=>e.jsx(Jt,{...s,ref:a,present:i})})});le.displayName=P;var Jt=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=t,c=D(P,n),[u,f]=d.useState(s),p=d.useRef(null),g=Oe(a,p),C=d.useRef(0),m=C.current,j=d.useRef(0),v=j.current,y=c.open||u,_=d.useRef(y),h=d.useRef(void 0);return d.useEffect(()=>{const l=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(l)},[]),Pe(()=>{const l=p.current;if(l){h.current=h.current||{transitionDuration:l.style.transitionDuration,animationName:l.style.animationName},l.style.transitionDuration="0s",l.style.animationName="none";const T=l.getBoundingClientRect();C.current=T.height,j.current=T.width,_.current||(l.style.transitionDuration=h.current.transitionDuration,l.style.animationName=h.current.animationName),f(s)}},[c.open,s]),e.jsx(k.div,{"data-state":I(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!y,...i,ref:g,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:y&&o})});function I(t){return t?"open":"closed"}var ea=ie;function F({...t}){return e.jsx(ea,{"data-slot":"collapsible",...t})}function V({...t}){return e.jsx(de,{"data-slot":"collapsible-trigger",...t})}function U({...t}){return e.jsx(le,{"data-slot":"collapsible-content",...t})}function ta(){const t=ve(),[a,n]=d.useState(!1),[s]=ge(),[o]=me(),[i]=je(),c=E(u=>u.auth.role);return e.jsxs(qt,{className:"z-50",children:[e.jsx(jt,{isOpen:a,setOpen:n}),e.jsx(Vt,{className:"h-14 justify-center",children:e.jsx(S,{children:e.jsx(N,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:"WEkEO"})})}),e.jsxs(Kt,{children:[e.jsxs(S,{children:[e.jsx(B,{children:"Content"}),e.jsx(H,{children:e.jsxs(G,{children:[e.jsx(F,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(Qe,{}),e.jsx("span",{children:"Collections"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(U,{children:e.jsx(q,{})})]})}),e.jsx(F,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(st,{}),e.jsx("span",{children:"Singles"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(U,{children:e.jsx(q,{singleton:!0})})]})}),e.jsx(w,{children:e.jsx(b,{asChild:!0,children:e.jsxs(N,{to:"/admin/dashboard/files",children:[e.jsx(Ke,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(w,{children:e.jsxs(b,{disabled:!0,children:[e.jsx(He,{}),e.jsx("span",{children:"Components"})]})})]})})]}),e.jsxs(S,{children:[e.jsx(B,{children:"Actions"}),e.jsx(H,{children:e.jsxs(G,{children:[c==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(b,{onClick:()=>o(),children:[e.jsx(Te,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(b,{onClick:()=>i(),children:[e.jsx($e,{}),e.jsx("span",{children:"Push to repo"})]})})]}),e.jsx(w,{children:e.jsxs(b,{onClick:()=>s(),children:[e.jsx(ot,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(S,{})]}),e.jsxs(Ut,{children:[e.jsx(b,{asChild:!0,children:e.jsxs(N,{to:K.PREVIEW_URL,children:["Preview",e.jsx(Ve,{className:"ml-auto"})]})}),e.jsx(b,{onClick:()=>n(!0),children:"About"}),e.jsxs(b,{onClick:()=>t(we()),children:[e.jsx(Je,{}),"Log out"]})]})]})}function aa({children:t}){const a=he(),n=E(o=>o.auth.user),s=E(o=>o.auth.isLoading);return d.useEffect(()=>{!s&&!n&&a("/")},[s,a,n]),s||!n?null:t}function sa(){const{pathname:t}=pe(),{data:a}=W(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,i)=>e.jsxs(xe.Fragment,{children:[i.length>1&&o>=1&&e.jsx(qe,{size:12,className:"text-gray-500 pt-[1px]"}),e.jsx("p",{className:"text-sm leading-none tracking-tight capitalize text-gray-500 last:text-foreground",children:a[s]?a[s].displayName:s},s)]},o))}):null}const ga=ce(function(){return e.jsx(aa,{children:e.jsxs(Gt,{className:"flex h-full",children:[e.jsx(ta,{}),e.jsxs("main",{className:"flex flex-col flex-1 h-full w-0",children:[e.jsx("header",{className:"flex sticky bg-sidebar dark:bg-sidebar z-40 top-0 h-14 shrink-0 items-center gap-2 border-b",children:e.jsxs("div",{className:"flex items-center gap-2 px-3",children:[e.jsx(Ft,{}),e.jsx(Ct,{orientation:"vertical",className:"h-4"}),e.jsx(sa,{})]})}),e.jsx(fe,{})]})]})})});export{ga as default};
@@ -1,36 +0,0 @@
1
- import{w as y}from"./index-G-cqIhgh.js";import{l as e,r as j,q as g}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{n as u,o as v,c as N}from"./editorialApi-DCnC5eM9.js";import{c as w,f as k}from"./utils-DslUJpbf.js";import{c}from"./createLucideIcon-TQsNVzYU.js";import{C as b}from"./chevron-down-BMtosYlL.js";import{T as n}from"./trash-B3lfbu-5.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 z=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],r=c("copy",z);/**
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 _=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],F=c("ellipsis",_);/**
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 M=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],H=c("file-image",M);/**
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 I=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],L=c("file-text",I);/**
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 C=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],T=c("file",C);/**
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 $=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],E=c("folder-open",$);/**
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 q=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],D=c("folder",q),S=["txt","md","html","pdf"],V=["svg","webp","png","jpeg","jpg"],P=[{Icon:H,test:s=>V.some(i=>s.name.endsWith(i))},{Icon:L,test:s=>S.some(i=>s.name.endsWith(i))}],R={Icon:T},d=({node:s,level:i=0,onDelete:o})=>{const[a,p]=j.useState(!1),m=P.find(t=>t.test(s))??R,l=s.type==="directory",x=l?"div":g,h=()=>{l&&p(!a)};return e.jsxs("div",{className:"select-none",children:[e.jsxs(x,{to:new URL(s.path,N.EDITORIAL_API_URL),target:"_blank",className:"flex items-center gap-2 h-10 p-2 group hover:bg-muted/50 cursor-pointer",style:{paddingLeft:`calc(0.5rem + ${i*20}px)`},onClick:h,children:[l?e.jsx(b,{size:16,className:w("transition-transform",{"rotate-180":a})}):e.jsx("div",{className:"w-4"}),e.jsxs("div",{className:"flex flex-grow w-24 items-center gap-2 ml-2",children:[l?a?e.jsx(E,{size:16,className:"text-yellow-500"}):e.jsx(D,{size:16,className:"text-yellow-500"}):e.jsx(m.Icon,{size:16,className:" text-gray-500"}),e.jsx("span",{className:"text-sm whitespace-nowrap text-ellipsis overflow-hidden w-full",children:s.name})]}),e.jsx("div",{className:"flex w-24 justify-end gap-2",children:e.jsx("span",{className:"text-sm text-gray-500",children:l?"--":k(s.size)})}),e.jsxs("div",{className:"flex items-center gap-1 ml-4 group-hover:visible invisible z-20",children:[l?e.jsx(r,{className:"invisible",size:16}):e.jsxs("button",{className:"hover:text-yellow-500 p-1 hover:bg-muted rounded-sm",onClick:t=>{t.preventDefault(),t.stopPropagation(),navigator.clipboard.writeText(s.path)},children:[e.jsx(r,{size:16}),e.jsx("span",{className:"sr-only",children:"Copy file URL"})]}),e.jsxs("button",{className:"hover:text-red-500 p-1 hover:bg-muted rounded-sm",onClick:t=>{t.preventDefault(),t.stopPropagation(),o(s.path)},children:[e.jsx(n,{size:16}),e.jsx("span",{className:"sr-only",children:"Delete this file"})]})]})]}),l&&a&&s.children&&e.jsx("div",{children:s.children.map((t,f)=>e.jsx(d,{node:t,level:i+1,onDelete:o},`${t.name}-${f}`))})]})};function A(){const{data:s,isLoading:i}=u(),[o]=v();return!s||i?null:s.toSorted(a=>a.type==="directory"?-1:1).map(a=>e.jsx(d,{node:a,onDelete:o},a.name))}const J=y(function(){return e.jsx("div",{className:"overflow-auto flex flex-1 p-4 gap-4",children:e.jsx("div",{className:"flex flex-col flex-1 gap-8",children:e.jsxs("div",{className:"overflow-auto h-full max-w-[800px] rounded-xl border",children:[e.jsxs("div",{className:"sticky top-0 bg-white flex items-center gap-2 py-1 px-2 border-b group",children:[e.jsx("div",{className:"w-4"}),e.jsx("div",{className:"flex flex-grow items-center gap-2 ml-2",children:e.jsx("span",{className:"text-sm font-semibold",children:"Name"})}),e.jsx("div",{className:"flex w-24 items-center gap-2 ml-2",children:e.jsx("span",{className:"text-sm font-semibold",children:"Size"})}),e.jsxs("div",{className:"flex items-center gap-1 invisible",children:[e.jsx(r,{size:14}),e.jsx(n,{size:14}),e.jsx(F,{size:14})]})]}),e.jsx(A,{})]})})})});export{J as default};
@@ -1 +0,0 @@
1
- import{i as K,n as Ke,g as We,h as nt,j as Y,e as Me,S as ee,f as V,p as X,k as ue,l as Se,m as W,o as Te,q as rt,r as Re,s as fe,t as qe,v as Ve,x as st,y as Be,A as it,B as we,C as ot,D as ut,z as pe,E as ct,d as at,b as lt,u as dt,F as te}from"./index-G-cqIhgh.js";import{r as C}from"./chunk-KNED5TY2-CXj9yqcQ.js";function ft(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function pt(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function yt(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(l=>typeof l=="function")){const l=e.map(m=>typeof m=="function"?`function ${m.name||"unnamed"}()`:typeof m).join(", ");throw new TypeError(`${t}[${l}]`)}}var Qe=e=>Array.isArray(e)?e:[e];function gt(e){const t=Array.isArray(e[0])?e[0]:e;return yt(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ht(e,t){const l=[],{length:m}=e;for(let p=0;p<m;p++)l.push(e[p].apply(null,t));return l}var mt=class{constructor(e){this.value=e}deref(){return this.value}},vt=typeof WeakRef<"u"?WeakRef:mt,bt=0,De=1;function se(){return{s:bt,v:void 0,o:null,p:null}}function ce(e,t={}){let l=se();const{resultEqualityCheck:m}=t;let p,R=0;function b(){var E;let A=l;const{length:w}=arguments;for(let f=0,i=w;f<i;f++){const a=arguments[f];if(typeof a=="function"||typeof a=="object"&&a!==null){let r=A.o;r===null&&(A.o=r=new WeakMap);const d=r.get(a);d===void 0?(A=se(),r.set(a,A)):A=d}else{let r=A.p;r===null&&(A.p=r=new Map);const d=r.get(a);d===void 0?(A=se(),r.set(a,A)):A=d}}const O=A;let M;if(A.s===De)M=A.v;else if(M=e.apply(null,arguments),R++,m){const f=((E=p==null?void 0:p.deref)==null?void 0:E.call(p))??p;f!=null&&m(f,M)&&(M=f,R!==0&&R--),p=typeof M=="object"&&M!==null||typeof M=="function"?new vt(M):M}return O.s=De,O.v=M,M}return b.clearCache=()=>{l=se(),b.resetResultsCount()},b.resultsCount=()=>R,b.resetResultsCount=()=>{R=0},b}function St(e,...t){const l=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,m=(...p)=>{let R=0,b=0,A,w={},O=p.pop();typeof O=="object"&&(w=O,O=p.pop()),ft(O,`createSelector expects an output function after the inputs, but received: [${typeof O}]`);const M={...l,...w},{memoize:E,memoizeOptions:f=[],argsMemoize:i=ce,argsMemoizeOptions:a=[]}=M,r=Qe(f),d=Qe(a),q=gt(p),n=E(function(){return R++,O.apply(null,arguments)},...r),s=i(function(){b++;const S=ht(q,arguments);return A=n.apply(null,S),A},...d);return Object.assign(s,{resultFunc:O,memoizedResultFunc:n,dependencies:q,dependencyRecomputations:()=>b,resetDependencyRecomputations:()=>{b=0},lastResult:()=>A,recomputations:()=>R,resetRecomputations:()=>{R=0},memoize:E,argsMemoize:i})};return Object.assign(m,{withTypes:()=>m}),m}var Oe=St(ce),Rt=Object.assign((e,t=Oe)=>{pt(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const l=Object.keys(e),m=l.map(R=>e[R]);return t(m,(...R)=>R.reduce((b,A,w)=>(b[l[w]]=A,b),{}))},{withTypes:()=>Rt}),Je=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Je||{});function qt(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Ce=K;function Ge(e,t){if(e===t||!(Ce(e)&&Ce(t)||Array.isArray(e)&&Array.isArray(t)))return t;const l=Object.keys(t),m=Object.keys(e);let p=l.length===m.length;const R=Array.isArray(t)?[]:{};for(const b of l)R[b]=Ge(e[b],t[b]),p&&(p=e[b]===R[b]);return p?e:R}function G(e){let t=0;for(const l in e)t++;return t}var je=e=>[].concat(...e);function Ot(e){return new RegExp("(^|:)//").test(e)}function Et(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function ae(e){return e!=null}function At(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var It=e=>e.replace(/\/$/,""),Mt=e=>e.replace(/^\//,"");function Tt(e,t){if(!e)return t;if(!t)return e;if(Ot(t))return t;const l=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=It(e),t=Mt(t),`${e}${l}${t}`}function wt(e,t,l){return e.has(t)?e.get(t):e.set(t,l).get(t)}var ke=(...e)=>fetch(...e),Qt=e=>e.status>=200&&e.status<=299,Dt=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Pe(e){if(!K(e))return e;const t={...e};for(const[l,m]of Object.entries(t))m===void 0&&delete t[l];return t}function Ct({baseUrl:e,prepareHeaders:t=E=>E,fetchFn:l=ke,paramsSerializer:m,isJsonContentType:p=Dt,jsonContentType:R="application/json",jsonReplacer:b,timeout:A,responseHandler:w,validateStatus:O,...M}={}){return typeof fetch>"u"&&l===ke&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(f,i,a)=>{const{getState:r,extra:d,endpoint:q,forced:n,type:s}=i;let u,{url:S,headers:g=new Headers(M.headers),params:o=void 0,responseHandler:y=w??"json",validateStatus:h=O??Qt,timeout:c=A,...v}=typeof f=="string"?{url:f}:f,I,T=i.signal;c&&(I=new AbortController,i.signal.addEventListener("abort",I.abort),T=I.signal);let Q={...M,signal:T,...v};g=new Headers(Pe(g)),Q.headers=await t(g,{getState:r,arg:f,extra:d,endpoint:q,forced:n,type:s,extraOptions:a})||g;const D=z=>typeof z=="object"&&(K(z)||Array.isArray(z)||typeof z.toJSON=="function");if(!Q.headers.has("content-type")&&D(Q.body)&&Q.headers.set("content-type",R),D(Q.body)&&p(Q.headers)&&(Q.body=JSON.stringify(Q.body,b)),o){const z=~S.indexOf("?")?"&":"?",H=m?m(o):new URLSearchParams(Pe(o));S+=z+H}S=Tt(e,S);const P=new Request(S,Q);u={request:new Request(S,Q)};let j,_=!1,k=I&&setTimeout(()=>{_=!0,I.abort()},c);try{j=await l(P)}catch(z){return{error:{status:_?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(z)},meta:u}}finally{k&&clearTimeout(k),I==null||I.signal.removeEventListener("abort",I.abort)}const F=j.clone();u.response=F;let $,U="";try{let z;if(await Promise.all([E(j,y).then(H=>$=H,H=>z=H),F.text().then(H=>U=H,()=>{})]),z)throw z}catch(z){return{error:{status:"PARSING_ERROR",originalStatus:j.status,data:U,error:String(z)},meta:u}}return h(j,$)?{data:$,meta:u}:{error:{status:j.status,data:$},meta:u}};async function E(f,i){if(typeof i=="function")return i(f);if(i==="content-type"&&(i=p(f.headers)?"json":"text"),i==="json"){const a=await f.text();return a.length?JSON.parse(a):null}return f.text()}}var Le=class{constructor(e,t=void 0){this.value=e,this.meta=t}},le=Y("__rtkq/focused"),Ee=Y("__rtkq/unfocused"),de=Y("__rtkq/online"),Ae=Y("__rtkq/offline"),ye=!1;function vn(e,t){function l(){const m=()=>e(le()),p=()=>e(Ee()),R=()=>e(de()),b=()=>e(Ae()),A=()=>{window.document.visibilityState==="visible"?m():p()};return ye||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",A,!1),window.addEventListener("focus",m,!1),window.addEventListener("online",R,!1),window.addEventListener("offline",b,!1),ye=!0),()=>{window.removeEventListener("focus",m),window.removeEventListener("visibilitychange",A),window.removeEventListener("online",R),window.removeEventListener("offline",b),ye=!1}}return l()}function Ye(e){return e.type==="query"}function jt(e){return e.type==="mutation"}function Ie(e,t,l,m,p,R){return kt(e)?e(t,l,m,p).filter(ae).map(ve).map(R):Array.isArray(e)?e.map(ve).map(R):[]}function kt(e){return typeof e=="function"}function ve(e){return typeof e=="string"?{type:e}:e}function Pt(e,t){return e.catch(t)}var ne=Symbol("forceQueryFn"),be=e=>typeof e[ne]=="function";function Lt({serializeQueryArgs:e,queryThunk:t,mutationThunk:l,api:m,context:p}){const R=new Map,b=new Map,{unsubscribeQueryResult:A,removeMutationResult:w,updateSubscriptionOptions:O}=m.internalActions;return{buildInitiateQuery:a,buildInitiateMutation:r,getRunningQueryThunk:M,getRunningMutationThunk:E,getRunningQueriesThunk:f,getRunningMutationsThunk:i};function M(d,q){return n=>{var S;const s=p.endpointDefinitions[d],u=e({queryArgs:q,endpointDefinition:s,endpointName:d});return(S=R.get(n))==null?void 0:S[u]}}function E(d,q){return n=>{var s;return(s=b.get(n))==null?void 0:s[q]}}function f(){return d=>Object.values(R.get(d)||{}).filter(ae)}function i(){return d=>Object.values(b.get(d)||{}).filter(ae)}function a(d,q){const n=(s,{subscribe:u=!0,forceRefetch:S,subscriptionOptions:g,[ne]:o,...y}={})=>(h,c)=>{var $;const v=e({queryArgs:s,endpointDefinition:q,endpointName:d}),I=t({...y,type:"query",subscribe:u,forceRefetch:S,subscriptionOptions:g,endpointName:d,originalArgs:s,queryCacheKey:v,[ne]:o}),T=m.endpoints[d].select(s),Q=h(I),D=T(c()),{requestId:P,abort:L}=Q,j=D.requestId!==P,_=($=R.get(h))==null?void 0:$[v],k=()=>T(c()),F=Object.assign(o?Q.then(k):j&&!_?Promise.resolve(D):Promise.all([_,Q]).then(k),{arg:s,requestId:P,subscriptionOptions:g,queryCacheKey:v,abort:L,async unwrap(){const U=await F;if(U.isError)throw U.error;return U.data},refetch:()=>h(n(s,{subscribe:!1,forceRefetch:!0})),unsubscribe(){u&&h(A({queryCacheKey:v,requestId:P}))},updateSubscriptionOptions(U){F.subscriptionOptions=U,h(O({endpointName:d,requestId:P,queryCacheKey:v,options:U}))}});if(!_&&!j&&!o){const U=wt(R,h,{});U[v]=F,F.then(()=>{delete U[v],G(U)||R.delete(h)})}return F};return n}function r(d){return(q,{track:n=!0,fixedCacheKey:s}={})=>(u,S)=>{const g=l({type:"mutation",endpointName:d,originalArgs:q,track:n,fixedCacheKey:s}),o=u(g),{requestId:y,abort:h,unwrap:c}=o,v=Pt(o.unwrap().then(D=>({data:D})),D=>({error:D})),I=()=>{u(w({requestId:y,fixedCacheKey:s}))},T=Object.assign(v,{arg:o.arg,requestId:y,abort:h,unwrap:c,reset:I}),Q=b.get(u)||{};return b.set(u,Q),Q[y]=T,T.then(()=>{delete Q[y],G(Q)||b.delete(u)}),s&&(Q[s]=T,T.then(()=>{Q[s]===T&&(delete Q[s],G(Q)||b.delete(u))})),T}}}function _e(e){return e}function _t({reducerPath:e,baseQuery:t,context:{endpointDefinitions:l},serializeQueryArgs:m,api:p,assertTagType:R}){const b=(n,s,u,S)=>(g,o)=>{const y=l[n],h=m({queryArgs:s,endpointDefinition:y,endpointName:n});if(g(p.internalActions.queryResultPatched({queryCacheKey:h,patches:u})),!S)return;const c=p.endpoints[n].select(s)(o()),v=Ie(y.providesTags,c.data,void 0,s,{},R);g(p.internalActions.updateProvidedBy({queryCacheKey:h,providedTags:v}))},A=(n,s,u,S=!0)=>(g,o)=>{const h=p.endpoints[n].select(s)(o()),c={patches:[],inversePatches:[],undo:()=>g(p.util.patchQueryData(n,s,c.inversePatches,S))};if(h.status==="uninitialized")return c;let v;if("data"in h)if(st(h.data)){const[I,T,Q]=Be(h.data,u);c.patches.push(...T),c.inversePatches.push(...Q),v=I}else v=u(h.data),c.patches.push({op:"replace",path:[],value:v}),c.inversePatches.push({op:"replace",path:[],value:h.data});return c.patches.length===0||g(p.util.patchQueryData(n,s,c.patches,S)),c},w=(n,s,u)=>S=>S(p.endpoints[n].initiate(s,{subscribe:!1,forceRefetch:!0,[ne]:()=>({data:u})})),O=async(n,{signal:s,abort:u,rejectWithValue:S,fulfillWithValue:g,dispatch:o,getState:y,extra:h})=>{const c=l[n.endpointName];try{let v=_e,I;const T={signal:s,abort:u,dispatch:o,getState:y,extra:h,endpoint:n.endpointName,type:n.type,forced:n.type==="query"?M(n,y()):void 0,queryCacheKey:n.type==="query"?n.queryCacheKey:void 0},Q=n.type==="query"?n[ne]:void 0;if(Q?I=Q():c.query?(I=await t(c.query(n.originalArgs),T,c.extraOptions),c.transformResponse&&(v=c.transformResponse)):I=await c.queryFn(n.originalArgs,T,c.extraOptions,D=>t(D,T,c.extraOptions)),typeof process<"u",I.error)throw new Le(I.error,I.meta);return g(await v(I.data,I.meta,n.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:I.meta,[ee]:!0})}catch(v){let I=v;if(I instanceof Le){let T=_e;c.query&&c.transformErrorResponse&&(T=c.transformErrorResponse);try{return S(await T(I.value,I.meta,n.originalArgs),{baseQueryMeta:I.meta,[ee]:!0})}catch(Q){I=Q}}throw console.error(I),I}};function M(n,s){var y,h,c;const u=(h=(y=s[e])==null?void 0:y.queries)==null?void 0:h[n.queryCacheKey],S=(c=s[e])==null?void 0:c.config.refetchOnMountOrArgChange,g=u==null?void 0:u.fulfilledTimeStamp,o=n.forceRefetch??(n.subscribe&&S);return o?o===!0||(Number(new Date)-Number(g))/1e3>=o:!1}const E=Me(`${e}/executeQuery`,O,{getPendingMeta(){return{startedTimeStamp:Date.now(),[ee]:!0}},condition(n,{getState:s}){var c,v,I;const u=s(),S=(v=(c=u[e])==null?void 0:c.queries)==null?void 0:v[n.queryCacheKey],g=S==null?void 0:S.fulfilledTimeStamp,o=n.originalArgs,y=S==null?void 0:S.originalArgs,h=l[n.endpointName];return be(n)?!0:(S==null?void 0:S.status)==="pending"?!1:M(n,u)||Ye(h)&&((I=h==null?void 0:h.forceRefetch)!=null&&I.call(h,{currentArg:o,previousArg:y,endpointState:S,state:u}))?!0:!g},dispatchConditionRejection:!0}),f=Me(`${e}/executeMutation`,O,{getPendingMeta(){return{startedTimeStamp:Date.now(),[ee]:!0}}}),i=n=>"force"in n,a=n=>"ifOlderThan"in n,r=(n,s,u)=>(S,g)=>{const o=i(u)&&u.force,y=a(u)&&u.ifOlderThan,h=(v=!0)=>{const I={forceRefetch:v,isPrefetch:!0};return p.endpoints[n].initiate(s,I)},c=p.endpoints[n].select(s)(g());if(o)S(h());else if(y){const v=c==null?void 0:c.fulfilledTimeStamp;if(!v){S(h());return}(Number(new Date)-Number(new Date(v)))/1e3>=y&&S(h())}else S(h(!1))};function d(n){return s=>{var u,S;return((S=(u=s==null?void 0:s.meta)==null?void 0:u.arg)==null?void 0:S.endpointName)===n}}function q(n,s){return{matchPending:fe(Ve(n),d(s)),matchFulfilled:fe(W(n),d(s)),matchRejected:fe(qe(n),d(s))}}return{queryThunk:E,mutationThunk:f,prefetch:r,updateQueryData:A,upsertQueryData:w,patchQueryData:b,buildMatchThunkActions:q}}function Xe(e,t,l,m){return Ie(l[e.meta.arg.endpointName][t],W(e)?e.payload:void 0,Se(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,m)}function ie(e,t,l){const m=e[t];m&&l(m)}function re(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Fe(e,t,l){const m=e[re(t)];m&&l(m)}var Z={};function Ft({reducerPath:e,queryThunk:t,mutationThunk:l,serializeQueryArgs:m,context:{endpointDefinitions:p,apiUid:R,extractRehydrationInfo:b,hasRehydrationInfo:A},assertTagType:w,config:O}){const M=Y(`${e}/resetApiState`);function E(g,o,y,h){var c;g[c=o.queryCacheKey]??(g[c]={status:"uninitialized",endpointName:o.endpointName}),ie(g,o.queryCacheKey,v=>{v.status="pending",v.requestId=y&&v.requestId?v.requestId:h.requestId,o.originalArgs!==void 0&&(v.originalArgs=o.originalArgs),v.startedTimeStamp=h.startedTimeStamp})}function f(g,o,y,h){ie(g,o.arg.queryCacheKey,c=>{if(c.requestId!==o.requestId&&!h)return;const{merge:v}=p[o.arg.endpointName];if(c.status="fulfilled",v)if(c.data!==void 0){const{fulfilledTimeStamp:I,arg:T,baseQueryMeta:Q,requestId:D}=o;let P=Re(c.data,L=>v(L,y,{arg:T.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:I,requestId:D}));c.data=P}else c.data=y;else c.data=p[o.arg.endpointName].structuralSharing??!0?Ge(ot(c.data)?ut(c.data):c.data,y):y;delete c.error,c.fulfilledTimeStamp=o.fulfilledTimeStamp})}const i=V({name:`${e}/queries`,initialState:Z,reducers:{removeQueryResult:{reducer(g,{payload:{queryCacheKey:o}}){delete g[o]},prepare:X()},cacheEntriesUpserted:{reducer(g,o){for(const y of o.payload){const{queryDescription:h,value:c}=y;E(g,h,!0,{requestId:o.meta.requestId,startedTimeStamp:o.meta.timestamp}),f(g,{arg:h,requestId:o.meta.requestId,fulfilledTimeStamp:o.meta.timestamp,baseQueryMeta:{}},c,!0)}},prepare:g=>({payload:g.map(h=>{const{endpointName:c,arg:v,value:I}=h,T=p[c];return{queryDescription:{type:"query",endpointName:c,originalArgs:h.arg,queryCacheKey:m({queryArgs:v,endpointDefinition:T,endpointName:c})},value:I}}),meta:{[ee]:!0,requestId:Ke(),timestamp:Date.now()}})},queryResultPatched:{reducer(g,{payload:{queryCacheKey:o,patches:y}}){ie(g,o,h=>{h.data=Te(h.data,y.concat())})},prepare:X()}},extraReducers(g){g.addCase(t.pending,(o,{meta:y,meta:{arg:h}})=>{const c=be(h);E(o,h,c,y)}).addCase(t.fulfilled,(o,{meta:y,payload:h})=>{const c=be(y.arg);f(o,y,h,c)}).addCase(t.rejected,(o,{meta:{condition:y,arg:h,requestId:c},error:v,payload:I})=>{ie(o,h.queryCacheKey,T=>{if(!y){if(T.requestId!==c)return;T.status="rejected",T.error=I??v}})}).addMatcher(A,(o,y)=>{const{queries:h}=b(y);for(const[c,v]of Object.entries(h))((v==null?void 0:v.status)==="fulfilled"||(v==null?void 0:v.status)==="rejected")&&(o[c]=v)})}}),a=V({name:`${e}/mutations`,initialState:Z,reducers:{removeMutationResult:{reducer(g,{payload:o}){const y=re(o);y in g&&delete g[y]},prepare:X()}},extraReducers(g){g.addCase(l.pending,(o,{meta:y,meta:{requestId:h,arg:c,startedTimeStamp:v}})=>{c.track&&(o[re(y)]={requestId:h,status:"pending",endpointName:c.endpointName,startedTimeStamp:v})}).addCase(l.fulfilled,(o,{payload:y,meta:h})=>{h.arg.track&&Fe(o,h,c=>{c.requestId===h.requestId&&(c.status="fulfilled",c.data=y,c.fulfilledTimeStamp=h.fulfilledTimeStamp)})}).addCase(l.rejected,(o,{payload:y,error:h,meta:c})=>{c.arg.track&&Fe(o,c,v=>{v.requestId===c.requestId&&(v.status="rejected",v.error=y??h)})}).addMatcher(A,(o,y)=>{const{mutations:h}=b(y);for(const[c,v]of Object.entries(h))((v==null?void 0:v.status)==="fulfilled"||(v==null?void 0:v.status)==="rejected")&&c!==(v==null?void 0:v.requestId)&&(o[c]=v)})}}),r=V({name:`${e}/invalidation`,initialState:Z,reducers:{updateProvidedBy:{reducer(g,o){var c,v;const{queryCacheKey:y,providedTags:h}=o.payload;for(const I of Object.values(g))for(const T of Object.values(I)){const Q=T.indexOf(y);Q!==-1&&T.splice(Q,1)}for(const{type:I,id:T}of h){const Q=(c=g[I]??(g[I]={}))[v=T||"__internal_without_id"]??(c[v]=[]);Q.includes(y)||Q.push(y)}},prepare:X()}},extraReducers(g){g.addCase(i.actions.removeQueryResult,(o,{payload:{queryCacheKey:y}})=>{for(const h of Object.values(o))for(const c of Object.values(h)){const v=c.indexOf(y);v!==-1&&c.splice(v,1)}}).addMatcher(A,(o,y)=>{var c,v;const{provided:h}=b(y);for(const[I,T]of Object.entries(h))for(const[Q,D]of Object.entries(T)){const P=(c=o[I]??(o[I]={}))[v=Q||"__internal_without_id"]??(c[v]=[]);for(const L of D)P.includes(L)||P.push(L)}}).addMatcher(ue(W(t),Se(t)),(o,y)=>{const h=Xe(y,"providesTags",p,w),{queryCacheKey:c}=y.meta.arg;r.caseReducers.updateProvidedBy(o,r.actions.updateProvidedBy({queryCacheKey:c,providedTags:h}))})}}),d=V({name:`${e}/subscriptions`,initialState:Z,reducers:{updateSubscriptionOptions(g,o){},unsubscribeQueryResult(g,o){},internal_getRTKQSubscriptions(){}}}),q=V({name:`${e}/internalSubscriptions`,initialState:Z,reducers:{subscriptionsUpdated:{reducer(g,o){return Te(g,o.payload)},prepare:X()}}}),n=V({name:`${e}/config`,initialState:{online:At(),focused:Et(),middlewareRegistered:!1,...O},reducers:{middlewareRegistered(g,{payload:o}){g.middlewareRegistered=g.middlewareRegistered==="conflict"||R!==o?"conflict":!0}},extraReducers:g=>{g.addCase(de,o=>{o.online=!0}).addCase(Ae,o=>{o.online=!1}).addCase(le,o=>{o.focused=!0}).addCase(Ee,o=>{o.focused=!1}).addMatcher(A,o=>({...o}))}}),s=rt({queries:i.reducer,mutations:a.reducer,provided:r.reducer,subscriptions:q.reducer,config:n.reducer}),u=(g,o)=>s(M.match(o)?void 0:g,o),S={...n.actions,...i.actions,...d.actions,...q.actions,...a.actions,...r.actions,resetApiState:M};return{reducer:u,actions:S}}var x=Symbol.for("RTKQ/skipToken"),Ze={status:"uninitialized"},Ue=Re(Ze,()=>{}),ze=Re(Ze,()=>{});function Ut({serializeQueryArgs:e,reducerPath:t,createSelector:l}){const m=E=>Ue,p=E=>ze;return{buildQuerySelector:A,buildMutationSelector:w,selectInvalidatedBy:O,selectCachedArgsForQuery:M};function R(E){return{...E,...qt(E.status)}}function b(E){return E[t]}function A(E,f){return i=>{if(i===x)return l(m,R);const a=e({queryArgs:i,endpointDefinition:f,endpointName:E});return l(d=>{var q,n;return((n=(q=b(d))==null?void 0:q.queries)==null?void 0:n[a])??Ue},R)}}function w(){return E=>{let f;return typeof E=="object"?f=re(E)??x:f=E,l(f===x?p:r=>{var d,q;return((q=(d=b(r))==null?void 0:d.mutations)==null?void 0:q[f])??ze},R)}}function O(E,f){const i=E[t],a=new Set;for(const r of f.filter(ae).map(ve)){const d=i.provided[r.type];if(!d)continue;let q=(r.id!==void 0?d[r.id]:je(Object.values(d)))??[];for(const n of q)a.add(n)}return je(Array.from(a.values()).map(r=>{const d=i.queries[r];return d?[{queryCacheKey:r,endpointName:d.endpointName,originalArgs:d.originalArgs}]:[]}))}function M(E,f){return Object.values(E[t].queries).filter(i=>(i==null?void 0:i.endpointName)===f&&i.status!=="uninitialized").map(i=>i.originalArgs)}}var B=WeakMap?new WeakMap:void 0,$e=({endpointName:e,queryArgs:t})=>{let l="";const m=B==null?void 0:B.get(t);if(typeof m=="string")l=m;else{const p=JSON.stringify(t,(R,b)=>(b=typeof b=="bigint"?{$bigint:b.toString()}:b,b=K(b)?Object.keys(b).sort().reduce((A,w)=>(A[w]=b[w],A),{}):b,b));K(t)&&(B==null||B.set(t,p)),l=p}return`${e}(${l})`};function et(...e){return function(l){const m=ce(O=>{var M;return(M=l.extractRehydrationInfo)==null?void 0:M.call(l,O,{reducerPath:l.reducerPath??"api"})}),p={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...l,extractRehydrationInfo:m,serializeQueryArgs(O){let M=$e;if("serializeQueryArgs"in O.endpointDefinition){const E=O.endpointDefinition.serializeQueryArgs;M=f=>{const i=E(f);return typeof i=="string"?i:$e({...f,queryArgs:i})}}else l.serializeQueryArgs&&(M=l.serializeQueryArgs);return M(O)},tagTypes:[...l.tagTypes||[]]},R={endpointDefinitions:{},batch(O){O()},apiUid:Ke(),extractRehydrationInfo:m,hasRehydrationInfo:ce(O=>m(O)!=null)},b={injectEndpoints:w,enhanceEndpoints({addTagTypes:O,endpoints:M}){if(O)for(const E of O)p.tagTypes.includes(E)||p.tagTypes.push(E);if(M)for(const[E,f]of Object.entries(M))typeof f=="function"?f(R.endpointDefinitions[E]):Object.assign(R.endpointDefinitions[E]||{},f);return b}},A=e.map(O=>O.init(b,p,R));function w(O){const M=O.endpoints({query:E=>({...E,type:"query"}),mutation:E=>({...E,type:"mutation"})});for(const[E,f]of Object.entries(M)){if(O.overrideExisting!==!0&&E in R.endpointDefinitions){if(O.overrideExisting==="throw")throw new Error(We(39));continue}R.endpointDefinitions[E]=f;for(const i of A)i.injectEndpoint(E,f)}return b}return b.injectEndpoints({endpoints:l.endpoints})}}function N(e,...t){return Object.assign(e,...t)}var zt=({api:e,queryThunk:t,internalState:l})=>{const m=`${e.reducerPath}/subscriptions`;let p=null,R=null;const{updateSubscriptionOptions:b,unsubscribeQueryResult:A}=e.internalActions,w=(i,a)=>{var d,q,n;if(b.match(a)){const{queryCacheKey:s,requestId:u,options:S}=a.payload;return(d=i==null?void 0:i[s])!=null&&d[u]&&(i[s][u]=S),!0}if(A.match(a)){const{queryCacheKey:s,requestId:u}=a.payload;return i[s]&&delete i[s][u],!0}if(e.internalActions.removeQueryResult.match(a))return delete i[a.payload.queryCacheKey],!0;if(t.pending.match(a)){const{meta:{arg:s,requestId:u}}=a,S=i[q=s.queryCacheKey]??(i[q]={});return S[`${u}_running`]={},s.subscribe&&(S[u]=s.subscriptionOptions??S[u]??{}),!0}let r=!1;if(t.fulfilled.match(a)||t.rejected.match(a)){const s=i[a.meta.arg.queryCacheKey]||{},u=`${a.meta.requestId}_running`;r||(r=!!s[u]),delete s[u]}if(t.rejected.match(a)){const{meta:{condition:s,arg:u,requestId:S}}=a;if(s&&u.subscribe){const g=i[n=u.queryCacheKey]??(i[n]={});g[S]=u.subscriptionOptions??g[S]??{},r=!0}}return r},O=()=>l.currentSubscriptions,f={getSubscriptions:O,getSubscriptionCount:i=>{const r=O()[i]??{};return G(r)},isRequestSubscribed:(i,a)=>{var d;const r=O();return!!((d=r==null?void 0:r[i])!=null&&d[a])}};return(i,a)=>{if(p||(p=JSON.parse(JSON.stringify(l.currentSubscriptions))),e.util.resetApiState.match(i))return p=l.currentSubscriptions={},R=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(i))return[!1,f];const r=w(l.currentSubscriptions,i);let d=!0;if(r){R||(R=setTimeout(()=>{const s=JSON.parse(JSON.stringify(l.currentSubscriptions)),[,u]=Be(p,()=>s);a.next(e.internalActions.subscriptionsUpdated(u)),p=s,R=null},500));const q=typeof i.type=="string"&&!!i.type.startsWith(m),n=t.rejected.match(i)&&i.meta.condition&&!!i.meta.arg.subscribe;d=!q&&!n}return[d,!1]}};function $t(e){for(const t in e)return!1;return!0}var Nt=2147483647/1e3-1,xt=({reducerPath:e,api:t,queryThunk:l,context:m,internalState:p})=>{const{removeQueryResult:R,unsubscribeQueryResult:b,cacheEntriesUpserted:A}=t.internalActions,w=ue(b.match,l.fulfilled,l.rejected,A.match);function O(i){const a=p.currentSubscriptions[i];return!!a&&!$t(a)}const M={},E=(i,a,r)=>{var d;if(w(i)){const q=a.getState()[e];let n;if(A.match(i))n=i.payload.map(s=>s.queryDescription.queryCacheKey);else{const{queryCacheKey:s}=b.match(i)?i.payload:i.meta.arg;n=[s]}for(const s of n)f(s,(d=q.queries[s])==null?void 0:d.endpointName,a,q.config)}if(t.util.resetApiState.match(i))for(const[q,n]of Object.entries(M))n&&clearTimeout(n),delete M[q];if(m.hasRehydrationInfo(i)){const q=a.getState()[e],{queries:n}=m.extractRehydrationInfo(i);for(const[s,u]of Object.entries(n))f(s,u==null?void 0:u.endpointName,a,q.config)}};function f(i,a,r,d){const q=m.endpointDefinitions[a],n=(q==null?void 0:q.keepUnusedDataFor)??d.keepUnusedDataFor;if(n===1/0)return;const s=Math.max(0,Math.min(n,Nt));if(!O(i)){const u=M[i];u&&clearTimeout(u),M[i]=setTimeout(()=>{O(i)||r.dispatch(R({queryCacheKey:i})),delete M[i]},s*1e3)}}return E},Ne=new Error("Promise never resolved before cacheEntryRemoved."),Ht=({api:e,reducerPath:t,context:l,queryThunk:m,mutationThunk:p,internalState:R})=>{const b=we(m),A=we(p),w=W(m,p),O={};function M(r,d,q){const n=O[r];n!=null&&n.valueResolved&&(n.valueResolved({data:d,meta:q}),delete n.valueResolved)}function E(r){const d=O[r];d&&(delete O[r],d.cacheEntryRemoved())}const f=(r,d,q)=>{const n=i(r);function s(u,S,g,o){const y=q[t].queries[S],h=d.getState()[t].queries[S];!y&&h&&a(u,o,S,d,g)}if(m.pending.match(r))s(r.meta.arg.endpointName,n,r.meta.requestId,r.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(r))for(const{queryDescription:u,value:S}of r.payload){const{endpointName:g,originalArgs:o,queryCacheKey:y}=u;s(g,y,r.meta.requestId,o),M(y,S,{})}else if(p.pending.match(r))d.getState()[t].mutations[n]&&a(r.meta.arg.endpointName,r.meta.arg.originalArgs,n,d,r.meta.requestId);else if(w(r))M(n,r.payload,r.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(r)||e.internalActions.removeMutationResult.match(r))E(n);else if(e.util.resetApiState.match(r))for(const u of Object.keys(O))E(u)};function i(r){return b(r)?r.meta.arg.queryCacheKey:A(r)?r.meta.arg.fixedCacheKey??r.meta.requestId:e.internalActions.removeQueryResult.match(r)?r.payload.queryCacheKey:e.internalActions.removeMutationResult.match(r)?re(r.payload):""}function a(r,d,q,n,s){const u=l.endpointDefinitions[r],S=u==null?void 0:u.onCacheEntryAdded;if(!S)return;const g={},o=new Promise(T=>{g.cacheEntryRemoved=T}),y=Promise.race([new Promise(T=>{g.valueResolved=T}),o.then(()=>{throw Ne})]);y.catch(()=>{}),O[q]=g;const h=e.endpoints[r].select(u.type==="query"?d:q),c=n.dispatch((T,Q,D)=>D),v={...n,getCacheEntry:()=>h(n.getState()),requestId:s,extra:c,updateCachedData:u.type==="query"?T=>n.dispatch(e.util.updateQueryData(r,d,T)):void 0,cacheDataLoaded:y,cacheEntryRemoved:o},I=S(d,v);Promise.resolve(I).catch(T=>{if(T!==Ne)throw T})}return f},Kt=({api:e,context:{apiUid:t},reducerPath:l})=>(m,p)=>{e.util.resetApiState.match(m)&&p.dispatch(e.internalActions.middlewareRegistered(t))},Wt=({reducerPath:e,context:t,context:{endpointDefinitions:l},mutationThunk:m,queryThunk:p,api:R,assertTagType:b,refetchQuery:A,internalState:w})=>{const{removeQueryResult:O}=R.internalActions,M=ue(W(m),Se(m)),E=ue(W(m,p),qe(m,p));let f=[];const i=(d,q)=>{M(d)?r(Xe(d,"invalidatesTags",l,b),q):E(d)?r([],q):R.util.invalidateTags.match(d)&&r(Ie(d.payload,void 0,void 0,void 0,void 0,b),q)};function a(d){var q,n;for(const s in d.queries)if(((q=d.queries[s])==null?void 0:q.status)==="pending")return!0;for(const s in d.mutations)if(((n=d.mutations[s])==null?void 0:n.status)==="pending")return!0;return!1}function r(d,q){const n=q.getState(),s=n[e];if(f.push(...d),s.config.invalidationBehavior==="delayed"&&a(s))return;const u=f;if(f=[],u.length===0)return;const S=R.util.selectInvalidatedBy(n,u);t.batch(()=>{const g=Array.from(S.values());for(const{queryCacheKey:o}of g){const y=s.queries[o],h=w.currentSubscriptions[o]??{};y&&(G(h)===0?q.dispatch(O({queryCacheKey:o})):y.status!=="uninitialized"&&q.dispatch(A(y)))}})}return i},Vt=({reducerPath:e,queryThunk:t,api:l,refetchQuery:m,internalState:p})=>{const R={},b=(f,i)=>{(l.internalActions.updateSubscriptionOptions.match(f)||l.internalActions.unsubscribeQueryResult.match(f))&&w(f.payload,i),(t.pending.match(f)||t.rejected.match(f)&&f.meta.condition)&&w(f.meta.arg,i),(t.fulfilled.match(f)||t.rejected.match(f)&&!f.meta.condition)&&A(f.meta.arg,i),l.util.resetApiState.match(f)&&M()};function A({queryCacheKey:f},i){const a=i.getState()[e],r=a.queries[f],d=p.currentSubscriptions[f];if(!r||r.status==="uninitialized")return;const{lowestPollingInterval:q,skipPollingIfUnfocused:n}=E(d);if(!Number.isFinite(q))return;const s=R[f];s!=null&&s.timeout&&(clearTimeout(s.timeout),s.timeout=void 0);const u=Date.now()+q;R[f]={nextPollTimestamp:u,pollingInterval:q,timeout:setTimeout(()=>{(a.config.focused||!n)&&i.dispatch(m(r)),A({queryCacheKey:f},i)},q)}}function w({queryCacheKey:f},i){const r=i.getState()[e].queries[f],d=p.currentSubscriptions[f];if(!r||r.status==="uninitialized")return;const{lowestPollingInterval:q}=E(d);if(!Number.isFinite(q)){O(f);return}const n=R[f],s=Date.now()+q;(!n||s<n.nextPollTimestamp)&&A({queryCacheKey:f},i)}function O(f){const i=R[f];i!=null&&i.timeout&&clearTimeout(i.timeout),delete R[f]}function M(){for(const f of Object.keys(R))O(f)}function E(f={}){let i=!1,a=Number.POSITIVE_INFINITY;for(let r in f)f[r].pollingInterval&&(a=Math.min(f[r].pollingInterval,a),i=f[r].skipPollingIfUnfocused||i);return{lowestPollingInterval:a,skipPollingIfUnfocused:i}}return b},Bt=({api:e,context:t,queryThunk:l,mutationThunk:m})=>{const p=Ve(l,m),R=qe(l,m),b=W(l,m),A={};return(O,M)=>{var E,f;if(p(O)){const{requestId:i,arg:{endpointName:a,originalArgs:r}}=O.meta,d=t.endpointDefinitions[a],q=d==null?void 0:d.onQueryStarted;if(q){const n={},s=new Promise((o,y)=>{n.resolve=o,n.reject=y});s.catch(()=>{}),A[i]=n;const u=e.endpoints[a].select(d.type==="query"?r:i),S=M.dispatch((o,y,h)=>h),g={...M,getCacheEntry:()=>u(M.getState()),requestId:i,extra:S,updateCachedData:d.type==="query"?o=>M.dispatch(e.util.updateQueryData(a,r,o)):void 0,queryFulfilled:s};q(r,g)}}else if(b(O)){const{requestId:i,baseQueryMeta:a}=O.meta;(E=A[i])==null||E.resolve({data:O.payload,meta:a}),delete A[i]}else if(R(O)){const{requestId:i,rejectedWithValue:a,baseQueryMeta:r}=O.meta;(f=A[i])==null||f.reject({error:O.payload??O.error,isUnhandledError:!a,meta:r}),delete A[i]}}},Jt=({reducerPath:e,context:t,api:l,refetchQuery:m,internalState:p})=>{const{removeQueryResult:R}=l.internalActions,b=(w,O)=>{le.match(w)&&A(O,"refetchOnFocus"),de.match(w)&&A(O,"refetchOnReconnect")};function A(w,O){const M=w.getState()[e],E=M.queries,f=p.currentSubscriptions;t.batch(()=>{for(const i of Object.keys(f)){const a=E[i],r=f[i];if(!r||!a)continue;(Object.values(r).some(q=>q[O]===!0)||Object.values(r).every(q=>q[O]===void 0)&&M.config[O])&&(G(r)===0?w.dispatch(R({queryCacheKey:i})):a.status!=="uninitialized"&&w.dispatch(m(a)))}})}return b};function Gt(e){const{reducerPath:t,queryThunk:l,api:m,context:p}=e,{apiUid:R}=p,b={invalidateTags:Y(`${t}/invalidateTags`)},A=E=>E.type.startsWith(`${t}/`),w=[Kt,xt,Wt,Vt,Ht,Bt];return{middleware:E=>{let f=!1;const a={...e,internalState:{currentSubscriptions:{}},refetchQuery:M,isThisApiSliceAction:A},r=w.map(n=>n(a)),d=zt(a),q=Jt(a);return n=>s=>{if(!it(s))return n(s);f||(f=!0,E.dispatch(m.internalActions.middlewareRegistered(R)));const u={...E,next:n},S=E.getState(),[g,o]=d(s,u,S);let y;if(g?y=n(s):y=o,E.getState()[t]&&(q(s,u,S),A(s)||p.hasRehydrationInfo(s)))for(const h of r)h(s,u,S);return y}},actions:b};function M(E){return e.api.endpoints[E.endpointName].initiate(E.originalArgs,{subscribe:!1,forceRefetch:!0})}}var xe=Symbol(),tt=({createSelector:e=Oe}={})=>({name:xe,init(t,{baseQuery:l,tagTypes:m,reducerPath:p,serializeQueryArgs:R,keepUnusedDataFor:b,refetchOnMountOrArgChange:A,refetchOnFocus:w,refetchOnReconnect:O,invalidationBehavior:M},E){nt();const f=j=>j;Object.assign(t,{reducerPath:p,endpoints:{},internalActions:{onOnline:de,onOffline:Ae,onFocus:le,onFocusLost:Ee},util:{}});const{queryThunk:i,mutationThunk:a,patchQueryData:r,updateQueryData:d,upsertQueryData:q,prefetch:n,buildMatchThunkActions:s}=_t({baseQuery:l,reducerPath:p,context:E,api:t,serializeQueryArgs:R,assertTagType:f}),{reducer:u,actions:S}=Ft({context:E,queryThunk:i,mutationThunk:a,serializeQueryArgs:R,reducerPath:p,assertTagType:f,config:{refetchOnFocus:w,refetchOnReconnect:O,refetchOnMountOrArgChange:A,keepUnusedDataFor:b,reducerPath:p,invalidationBehavior:M}});N(t.util,{patchQueryData:r,updateQueryData:d,upsertQueryData:q,prefetch:n,resetApiState:S.resetApiState,upsertQueryEntries:S.cacheEntriesUpserted}),N(t.internalActions,S);const{middleware:g,actions:o}=Gt({reducerPath:p,context:E,queryThunk:i,mutationThunk:a,api:t,assertTagType:f});N(t.util,o),N(t,{reducer:u,middleware:g});const{buildQuerySelector:y,buildMutationSelector:h,selectInvalidatedBy:c,selectCachedArgsForQuery:v}=Ut({serializeQueryArgs:R,reducerPath:p,createSelector:e});N(t.util,{selectInvalidatedBy:c,selectCachedArgsForQuery:v});const{buildInitiateQuery:I,buildInitiateMutation:T,getRunningMutationThunk:Q,getRunningMutationsThunk:D,getRunningQueriesThunk:P,getRunningQueryThunk:L}=Lt({queryThunk:i,mutationThunk:a,api:t,serializeQueryArgs:R,context:E});return N(t.util,{getRunningMutationThunk:Q,getRunningMutationsThunk:D,getRunningQueryThunk:L,getRunningQueriesThunk:P}),{name:xe,injectEndpoint(j,_){var F;const k=t;(F=k.endpoints)[j]??(F[j]={}),Ye(_)?N(k.endpoints[j],{name:j,select:y(j,_),initiate:I(j,_)},s(i,j)):jt(_)&&N(k.endpoints[j],{name:j,select:h(),initiate:T(j)},s(a,j))}}}});tt();const Yt=pe.object({EDITORIAL_API_URL:pe.string().url(),PREVIEW_URL:pe.string().url()}).strict(),Xt=Yt.parse({EDITORIAL_API_URL:"http://localhost:3001/",PREVIEW_URL:"http://localhost:3000/api/preview"});function ge(e){return e.replace(e[0],e[0].toUpperCase())}function Zt(e){return e.type==="query"}function en(e){return e.type==="mutation"}function oe(e,...t){return Object.assign(e,...t)}var J=WeakMap?new WeakMap:void 0,tn=({endpointName:e,queryArgs:t})=>{let l="";const m=J==null?void 0:J.get(t);if(typeof m=="string")l=m;else{const p=JSON.stringify(t,(R,b)=>(b=typeof b=="bigint"?{$bigint:b.toString()}:b,b=K(b)?Object.keys(b).sort().reduce((A,w)=>(A[w]=b[w],A),{}):b,b));K(t)&&(J==null||J.set(t,p)),l=p}return`${e}(${l})`},he=Symbol();function He(e,t,l,m){const p=C.useMemo(()=>({queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:l,endpointName:m}):e}),[e,t,l,m]),R=C.useRef(p);return C.useEffect(()=>{R.current.serialized!==p.serialized&&(R.current=p)},[p]),R.current.serialized===p.serialized?R.current.queryArgs:e}function me(e){const t=C.useRef(e);return C.useEffect(()=>{te(t.current,e)||(t.current=e)},[e]),te(t.current,e)?t.current:e}var nn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rn=nn(),sn=()=>typeof navigator<"u"&&navigator.product==="ReactNative",on=sn(),un=()=>rn||on?C.useLayoutEffect:C.useEffect,cn=un(),an=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Je.pending}:e;function ln({api:e,moduleOptions:{batch:t,hooks:{useDispatch:l,useSelector:m,useStore:p},unstable__sideEffectsInRender:R,createSelector:b},serializeQueryArgs:A,context:w}){const O=R?a=>a():C.useEffect;return{buildQueryHooks:f,buildMutationHook:i,usePrefetch:E};function M(a,r,d){if(r!=null&&r.endpointName&&a.isUninitialized){const{endpointName:g}=r,o=w.endpointDefinitions[g];d!==x&&A({queryArgs:r.originalArgs,endpointDefinition:o,endpointName:g})===A({queryArgs:d,endpointDefinition:o,endpointName:g})&&(r=void 0)}let q=a.isSuccess?a.data:r==null?void 0:r.data;q===void 0&&(q=a.data);const n=q!==void 0,s=a.isLoading,u=(!r||r.isLoading||r.isUninitialized)&&!n&&s,S=a.isSuccess||n&&(s&&!(r!=null&&r.isError)||a.isUninitialized);return{...a,data:q,currentData:a.data,isFetching:s,isLoading:u,isSuccess:S}}function E(a,r){const d=l(),q=me(r);return C.useCallback((n,s)=>d(e.util.prefetch(a,n,{...q,...s})),[a,d,q])}function f(a){const r=(n,{refetchOnReconnect:s,refetchOnFocus:u,refetchOnMountOrArgChange:S,skip:g=!1,pollingInterval:o=0,skipPollingIfUnfocused:y=!1}={})=>{const{initiate:h}=e.endpoints[a],c=l(),v=C.useRef(void 0);if(!v.current){const k=c(e.internalActions.internal_getRTKQSubscriptions());v.current=k}const I=He(g?x:n,tn,w.endpointDefinitions[a],a),T=me({refetchOnReconnect:s,refetchOnFocus:u,pollingInterval:o,skipPollingIfUnfocused:y}),Q=C.useRef(!1),D=C.useRef(void 0);let{queryCacheKey:P,requestId:L}=D.current||{},j=!1;P&&L&&(j=v.current.isRequestSubscribed(P,L));const _=!j&&Q.current;return O(()=>{Q.current=j}),O(()=>{_&&(D.current=void 0)},[_]),O(()=>{var $;const k=D.current;if(I===x){k==null||k.unsubscribe(),D.current=void 0;return}const F=($=D.current)==null?void 0:$.subscriptionOptions;if(!k||k.arg!==I){k==null||k.unsubscribe();const U=c(h(I,{subscriptionOptions:T,forceRefetch:S}));D.current=U}else T!==F&&k.updateSubscriptionOptions(T)},[c,h,S,I,T,_]),C.useEffect(()=>()=>{var k;(k=D.current)==null||k.unsubscribe(),D.current=void 0},[]),C.useMemo(()=>({refetch:()=>{var k;if(!D.current)throw new Error(We(38));return(k=D.current)==null?void 0:k.refetch()}}),[])},d=({refetchOnReconnect:n,refetchOnFocus:s,pollingInterval:u=0,skipPollingIfUnfocused:S=!1}={})=>{const{initiate:g}=e.endpoints[a],o=l(),[y,h]=C.useState(he),c=C.useRef(void 0),v=me({refetchOnReconnect:n,refetchOnFocus:s,pollingInterval:u,skipPollingIfUnfocused:S});O(()=>{var P,L;const D=(P=c.current)==null?void 0:P.subscriptionOptions;v!==D&&((L=c.current)==null||L.updateSubscriptionOptions(v))},[v]);const I=C.useRef(v);O(()=>{I.current=v},[v]);const T=C.useCallback(function(D,P=!1){let L;return t(()=>{var j;(j=c.current)==null||j.unsubscribe(),c.current=L=o(g(D,{subscriptionOptions:I.current,forceRefetch:!P})),h(D)}),L},[o,g]),Q=C.useCallback(()=>{var D,P;(D=c.current)!=null&&D.queryCacheKey&&o(e.internalActions.removeQueryResult({queryCacheKey:(P=c.current)==null?void 0:P.queryCacheKey}))},[o]);return C.useEffect(()=>()=>{var D;(D=c==null?void 0:c.current)==null||D.unsubscribe()},[]),C.useEffect(()=>{y!==he&&!c.current&&T(y,!0)},[y,T]),C.useMemo(()=>[T,y,{reset:Q}],[T,y,Q])},q=(n,{skip:s=!1,selectFromResult:u}={})=>{const{select:S}=e.endpoints[a],g=He(s?x:n,A,w.endpointDefinitions[a],a),o=C.useRef(void 0),y=C.useMemo(()=>b([S(g),(T,Q)=>Q,T=>g],M,{memoizeOptions:{resultEqualityCheck:te}}),[S,g]),h=C.useMemo(()=>u?b([y],u,{devModeChecks:{identityFunctionCheck:"never"}}):y,[y,u]),c=m(T=>h(T,o.current),te),v=p(),I=y(v.getState(),o.current);return cn(()=>{o.current=I},[I]),c};return{useQueryState:q,useQuerySubscription:r,useLazyQuerySubscription:d,useLazyQuery(n){const[s,u,{reset:S}]=d(n),g=q(u,{...n,skip:u===he}),o=C.useMemo(()=>({lastArg:u}),[u]);return C.useMemo(()=>[s,{...g,reset:S},o],[s,g,S,o])},useQuery(n,s){const u=r(n,s),S=q(n,{selectFromResult:n===x||s!=null&&s.skip?void 0:an,...s}),{data:g,status:o,isLoading:y,isSuccess:h,isError:c,error:v}=S;return C.useDebugValue({data:g,status:o,isLoading:y,isSuccess:h,isError:c,error:v}),C.useMemo(()=>({...S,...u}),[S,u])}}}function i(a){return({selectFromResult:r,fixedCacheKey:d}={})=>{const{select:q,initiate:n}=e.endpoints[a],s=l(),[u,S]=C.useState();C.useEffect(()=>()=>{u!=null&&u.arg.fixedCacheKey||u==null||u.reset()},[u]);const g=C.useCallback(function(F){const $=s(n(F,{fixedCacheKey:d}));return S($),$},[s,n,d]),{requestId:o}=u||{},y=C.useMemo(()=>q({fixedCacheKey:d,requestId:u==null?void 0:u.requestId}),[d,u,q]),h=C.useMemo(()=>r?b([y],r):y,[r,y]),c=m(h,te),v=d==null?u==null?void 0:u.arg.originalArgs:void 0,I=C.useCallback(()=>{t(()=>{u&&S(void 0),d&&s(e.internalActions.removeMutationResult({requestId:o,fixedCacheKey:d}))})},[s,d,u,o]),{endpointName:T,data:Q,status:D,isLoading:P,isSuccess:L,isError:j,error:_}=c;C.useDebugValue({endpointName:T,data:Q,status:D,isLoading:P,isSuccess:L,isError:j,error:_});const k=C.useMemo(()=>({...c,originalArgs:v,reset:I}),[c,v,I]);return C.useMemo(()=>[g,k],[g,k])}}}var dn=Symbol(),fn=({batch:e=ct,hooks:t={useDispatch:dt,useSelector:lt,useStore:at},createSelector:l=Oe,unstable__sideEffectsInRender:m=!1,...p}={})=>({name:dn,init(R,{serializeQueryArgs:b},A){const w=R,{buildQueryHooks:O,buildMutationHook:M,usePrefetch:E}=ln({api:R,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:m,createSelector:l},serializeQueryArgs:b,context:A});return oe(w,{usePrefetch:E}),oe(A,{batch:e}),{injectEndpoint(f,i){if(Zt(i)){const{useQuery:a,useLazyQuery:r,useLazyQuerySubscription:d,useQueryState:q,useQuerySubscription:n}=O(f);oe(w.endpoints[f],{useQuery:a,useLazyQuery:r,useLazyQuerySubscription:d,useQueryState:q,useQuerySubscription:n}),R[`use${ge(f)}Query`]=a,R[`useLazy${ge(f)}Query`]=r}else if(en(i)){const a=M(f);oe(w.endpoints[f],{useMutation:a}),R[`use${ge(f)}Mutation`]=a}}}}}),pn=et(tt(),fn());const yn=Ct({baseUrl:new URL("/api/v1",Xt.EDITORIAL_API_URL).href}),gn=pn({reducerPath:"editorialApi",baseQuery:yn,tagTypes:["schema","data","files"],endpoints:e=>({pull:e.mutation({query:()=>({url:"/pull",method:"POST"})}),push:e.mutation({query:()=>({url:"/push",method:"POST"})}),publish:e.mutation({query:()=>({url:"/publish",method:"POST"})}),getSchema:e.query({query:()=>"/schema",providesTags:[{type:"schema"}]}),getSchemaType:e.query({query:()=>"/schema",transformResponse:(t,l,m)=>t[m]||null,providesTags:[{type:"schema"}]}),getData:e.query({query:()=>"/data",providesTags:()=>[{type:"data"}]}),getDataCount:e.query({query:()=>"/data",transformResponse(t){return Object.values(t).reduce((m,p)=>m+Object.keys(p).length,0)}}),getDataObject:e.query({query:()=>"/data",transformResponse:(t,l,{itemType:m,id:p})=>t[m][p]||null,providesTags:()=>[{type:"data"}]}),getFiles:e.query({query:()=>"/files",providesTags:()=>[{type:"files"}]}),getFileCount:e.query({query:()=>"/files",transformResponse:t=>{function l(p){let R=p.type==="file"?1:0;return p.children&&p.children.length>0&&(R+=p.children.reduce((b,A)=>b+l(A),0)),R}function m(p){return p.reduce((R,b)=>R+l(b),0)}return m(t)}}),deleteFile:e.mutation({query:t=>({url:"/files",method:"DELETE",body:{path:t}}),invalidatesTags:()=>[{type:"files"}]}),updateObject:e.mutation({query:({id:t,type:l,...m})=>({url:`/data/${l}/${t}`,method:"PATCH",body:{id:t,type:l,...m}}),invalidatesTags:()=>[{type:"data"}]}),createObject:e.mutation({query:({id:t,type:l,...m})=>({url:`/data/${l}/${t}`,method:"PUT",body:{id:t,type:l,...m}}),invalidatesTags:()=>[{type:"data"}]}),deleteObject:e.mutation({query:({id:t,type:l})=>({url:`/data/${l}/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"data"}]})})}),{useCreateObjectMutation:bn,useDeleteFileMutation:Sn,useDeleteObjectMutation:Rn,useGetDataCountQuery:qn,useGetDataObjectQuery:On,useGetDataQuery:En,useGetFileCountQuery:An,useGetFilesQuery:In,useGetSchemaQuery:Mn,useGetSchemaTypeQuery:Tn,usePublishMutation:wn,usePullMutation:Qn,usePushMutation:Dn,useUpdateObjectMutation:Cn}=gn;export{En as a,wn as b,Xt as c,Qn as d,gn as e,Dn as f,qn as g,An as h,Tn as i,Rn as j,On as k,bn as l,Cn as m,In as n,Sn as o,vn as s,Mn as u};