@isardsat/editorial-admin 6.5.0 → 6.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/build/client/assets/FilePicker-CWQ8ELBw.js +1 -0
  2. package/build/client/assets/Loading-BiO3HJmZ.js +11 -0
  3. package/build/client/assets/URLInput-CFnU0U1n.js +1 -0
  4. package/build/client/assets/{authSlice-DXFkOZ5W.js → authSlice-O1tz7SK1.js} +167 -167
  5. package/build/client/assets/{button-DYtHJlPL.js → button-494fplqA.js} +1 -1
  6. package/build/client/assets/{calendar-6ih_JEvR.js → calendar-DVBBYeOW.js} +1 -1
  7. package/build/client/assets/chevron-down-CtNmiOMb.js +6 -0
  8. package/build/client/assets/chevron-right-haBQNeuE.js +6 -0
  9. package/build/client/assets/{chunk-EF7DTUVF-MlADC7xe.js → chunk-EF7DTUVF-CaKisB5m.js} +1 -1
  10. package/build/client/assets/{createLucideIcon-BJQzFwzJ.js → createLucideIcon-BweVylaW.js} +1 -1
  11. package/build/client/assets/dashboard-DqU-WlEe.js +1 -0
  12. package/build/client/assets/dashboard._collection-LAkj-iO9.js +26 -0
  13. package/build/client/assets/dashboard._collection._document-Cqsuu-0-.js +1 -0
  14. package/build/client/assets/dashboard._collection.new-SI3Dkpds.js +1 -0
  15. package/build/client/assets/dashboard._layout-BUGw8Wsg.js +46 -0
  16. package/build/client/assets/dashboard.files-YptTPTFT.js +1 -0
  17. package/build/client/assets/date-picker-D7MFHjcF.js +1 -0
  18. package/build/client/assets/datetime-picker-DzApRNz_.js +1 -0
  19. package/build/client/assets/{entry.client-BI4QA1ti.js → entry.client-Be049MAC.js} +1 -1
  20. package/build/client/assets/{external-link-D1If5twJ.js → external-link-LWykkN17.js} +1 -1
  21. package/build/client/assets/files-DrzVVLDE.js +26 -0
  22. package/build/client/assets/home-BtNh5JTT.js +1 -0
  23. package/build/client/assets/hooks-BA9LC00C.js +1 -0
  24. package/build/client/assets/{index-xBXWoUIa.js → index-BJ-ODQ_I.js} +1 -1
  25. package/build/client/assets/index-BNiwB2Xo.js +1 -0
  26. package/build/client/assets/index-Blx_6p83.js +1 -0
  27. package/build/client/assets/index-CQ2mjYJl.js +1 -0
  28. package/build/client/assets/index-CqaffZUS.js +1 -0
  29. package/build/client/assets/{index-BCGL68Qt.js → index-DgN6jnv0.js} +1 -1
  30. package/build/client/assets/index-N8jzdZDg.js +45 -0
  31. package/build/client/assets/{index-Dycitln2.js → index-gfXi4hAm.js} +1 -1
  32. package/build/client/assets/itemForm-BcDnRX3X.js +13 -0
  33. package/build/client/assets/manifest-384b5d21.js +1 -0
  34. package/build/client/assets/{itemForm-ya4bvPWM.css → markdownEditor-D2iPtBtk.css} +1 -1
  35. package/build/client/assets/markdownEditor-DQtQQZeo.js +128 -0
  36. package/build/client/assets/popover-DDQEIzon.js +6 -0
  37. package/build/client/assets/root-BctYpWwq.css +1 -0
  38. package/build/client/assets/root-DtBI39a7.js +1 -0
  39. package/build/client/assets/{trash-CN5HT_ZJ.js → trash-BPu8wmdf.js} +1 -1
  40. package/build/client/assets/tslib.es6-De9GV7Vy.js +1 -0
  41. package/build/client/assets/types-qmeOZPBc.js +6 -0
  42. package/build/client/assets/upload-C84AIRF5.js +6 -0
  43. package/build/client/assets/{utils-BdGM_Id-.js → utils-5cV-49hI.js} +2 -2
  44. package/build/client/assets/x-BI8YVnoZ.js +6 -0
  45. package/build/client/index.html +3 -3
  46. package/package.json +2 -2
  47. package/build/client/assets/dashboard-eLqz7BO7.js +0 -1
  48. package/build/client/assets/dashboard._collection-BBg-A9Sj.js +0 -26
  49. package/build/client/assets/dashboard._collection._document-B0ZbqsBo.js +0 -1
  50. package/build/client/assets/dashboard._collection.new-mErjJpgV.js +0 -1
  51. package/build/client/assets/dashboard._layout-124HIuKq.js +0 -46
  52. package/build/client/assets/dashboard.files-BgTiS3Ze.js +0 -1
  53. package/build/client/assets/files-rJZM0-f6.js +0 -26
  54. package/build/client/assets/home-l-obs5PE.js +0 -1
  55. package/build/client/assets/index-BhhxCYB_.js +0 -1
  56. package/build/client/assets/index-Cl368BLL.js +0 -55
  57. package/build/client/assets/itemForm-D7gNDu4Q.js +0 -106
  58. package/build/client/assets/manifest-e71b8e01.js +0 -1
  59. package/build/client/assets/root-DVVVBPEK.css +0 -1
  60. package/build/client/assets/root-vSnuIdRx.js +0 -1
  61. package/build/client/assets/spinner-C3uu_C2V.js +0 -11
  62. package/build/client/assets/types-BFhFSnS8.js +0 -6
  63. package/build/client/assets/upload-CopmcV94.js +0 -11
@@ -1,6 +1,6 @@
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"/><link rel="modulepreload" href="/assets/manifest-e71b8e01.js"/><link rel="modulepreload" href="/assets/entry.client-BI4QA1ti.js"/><link rel="modulepreload" href="/assets/chunk-EF7DTUVF-MlADC7xe.js"/><link rel="modulepreload" href="/assets/index-xBXWoUIa.js"/><link rel="modulepreload" href="/assets/root-vSnuIdRx.js"/><link rel="modulepreload" href="/assets/authSlice-DXFkOZ5W.js"/><link rel="modulepreload" href="/assets/utils-BdGM_Id-.js"/><link rel="modulepreload" href="/assets/spinner-C3uu_C2V.js"/><link rel="modulepreload" href="/assets/createLucideIcon-BJQzFwzJ.js"/><title>Editorial Admin</title><link rel="stylesheet" href="/assets/root-DVVVBPEK.css"/></head><body class="h-full min-h-screen bg-background font-sans antialiased"><div class="flex gap-1 items-center justify-center min-h-screen"><svg xmlns="http://www.w3.org/2000/svg" width="28px" height="28px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader-circle animate-spin"><path d="M21 12a9 9 0 1 1-6.219-8.56"></path></svg><p class="text-gray-600">Loading Editorial...</p></div><script>window.__reactRouterContext = {"basename":"/","future":{"unstable_middleware":false,"unstable_optimizeDeps":false,"unstable_splitRouteModules":false,"unstable_subResourceIntegrity":false,"unstable_viteEnvironmentApi":false},"routeDiscovery":{"mode":"initial"},"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-e71b8e01.js";
2
- import * as route0 from "/assets/root-vSnuIdRx.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"/><link rel="modulepreload" href="/assets/manifest-384b5d21.js"/><link rel="modulepreload" href="/assets/entry.client-Be049MAC.js"/><link rel="modulepreload" href="/assets/chunk-EF7DTUVF-CaKisB5m.js"/><link rel="modulepreload" href="/assets/index-BJ-ODQ_I.js"/><link rel="modulepreload" href="/assets/root-DtBI39a7.js"/><link rel="modulepreload" href="/assets/authSlice-O1tz7SK1.js"/><link rel="modulepreload" href="/assets/hooks-BA9LC00C.js"/><link rel="modulepreload" href="/assets/utils-5cV-49hI.js"/><link rel="modulepreload" href="/assets/Loading-BiO3HJmZ.js"/><link rel="modulepreload" href="/assets/tslib.es6-De9GV7Vy.js"/><link rel="modulepreload" href="/assets/createLucideIcon-BweVylaW.js"/><title>Editorial Admin</title><meta name="robots" content="noindex"/><link rel="stylesheet" href="/assets/root-BctYpWwq.css"/></head><body class="h-full min-h-screen bg-background font-sans antialiased"><div class="flex gap-1 items-center justify-center min-h-screen"><svg xmlns="http://www.w3.org/2000/svg" width="28px" height="28px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader-circle animate-spin"><path d="M21 12a9 9 0 1 1-6.219-8.56"></path></svg><p class="text-gray-600">Loading Editorial...</p></div><script>window.__reactRouterContext = {"basename":"/","future":{"unstable_middleware":false,"unstable_optimizeDeps":false,"unstable_splitRouteModules":false,"unstable_subResourceIntegrity":false,"unstable_viteEnvironmentApi":false},"routeDiscovery":{"mode":"initial"},"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-384b5d21.js";
2
+ import * as route0 from "/assets/root-DtBI39a7.js";
3
3
 
4
4
  window.__reactRouterRouteModules = {"root":route0};
5
5
 
6
- import("/assets/entry.client-BI4QA1ti.js");</script><!--$--><script>window.__reactRouterContext.streamController.enqueue("[{\"_1\":2,\"_3\":-5,\"_4\":-5},\"loaderData\",{},\"actionData\",\"errors\"]\n");</script><!--$--><script>window.__reactRouterContext.streamController.close();</script><!--/$--><!--/$--></body></html>
6
+ import("/assets/entry.client-Be049MAC.js");</script><!--$--><script>window.__reactRouterContext.streamController.enqueue("[{\"_1\":2,\"_3\":-5,\"_4\":-5},\"loaderData\",{},\"actionData\",\"errors\"]\n");</script><!--$--><script>window.__reactRouterContext.streamController.close();</script><!--/$--><!--/$--></body></html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isardsat/editorial-admin",
3
- "version": "6.5.0",
3
+ "version": "6.6.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -78,7 +78,7 @@
78
78
  "tailwindcss-animate": "^1.0.7",
79
79
  "vaul": "^1.1.2",
80
80
  "zod": "^3",
81
- "@isardsat/editorial-common": "^6.5.0"
81
+ "@isardsat/editorial-common": "^6.6.0"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@react-router/dev": "^7.7.0",
@@ -1 +0,0 @@
1
- import{p as e,a as j,x as b,w}from"./chunk-EF7DTUVF-MlADC7xe.js";import{a as m,j as u,d as C,b as N,k as v,l as T}from"./utils-BdGM_Id-.js";import{c as y,u as D,T as R,a as L,b as x,d as k,f as p,e as A,g as H,h as I}from"./index-Dycitln2.js";function G({className:a,...t}){return e.jsx("div",{"data-slot":"skeleton",className:m("bg-accent animate-pulse rounded-md",a),...t})}function f({className:a,title:t,value:r,isLoading:n,...s}){return e.jsxs("div",{className:m("border border-border rounded-xl p-6",a),...s,children:[e.jsx("h3",{className:"text-xs text-muted-foreground",children:t}),n?e.jsx(G,{className:"h-[2.25rem] w-16"}):e.jsx("p",{className:"text-lg sm:text-3xl font-bold leading-none",children:r})]})}const i=y(),c=[i.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(a){const t=a.getValue();return e.jsx("span",{title:t,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:t})}}),i.accessor("createdAt",{header:"Created",cell(a){return u(new Date(a.getValue()))}}),i.accessor("updatedAt",{header:"Updated",cell(a){return u(new Date(a.getValue()))}})];function M(){const{data:a}=C(),{data:t}=N(),r=j.useMemo(()=>!a||!t?[]:Object.entries(a).filter(([o])=>o in t).reduce((o,[d,h])=>o.concat(Object.values(h).map(g=>({...g,type:d}))),[]).toSorted((o,d)=>o.updatedAt>d.updatedAt?-1:1).slice(0,6),[a,t]),n=D({data:r,columns:c,getCoreRowModel:I()});return e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(R,{children:[e.jsx(L,{children:n.getHeaderGroups().map(s=>e.jsx(x,{className:"grid",style:{gridTemplateColumns:`repeat(${c.length}, minmax(200px, 1fr))`},children:s.headers.map(l=>e.jsx(k,{children:l.isPlaceholder?null:p(l.column.columnDef.header,l.getContext())},l.id))},s.id))}),e.jsx(A,{children:n.getRowModel().rows.map(s=>e.jsx(b,{to:`/admin/dashboard/${s.original.type}/${s.original.id}`,children:e.jsx(x,{className:"grid",style:{gridTemplateColumns:`repeat(${c.length}, minmax(200px, 1fr))`},children:s.getVisibleCells().map(l=>e.jsx(H,{className:m("p-2"),children:p(l.column.columnDef.cell,l.getContext())},l.id))},s.id)},s.original.id))})]})})}const S=w(function(){const{data:t,isLoading:r}=v(),{data:n,isLoading:s}=T();return e.jsx("div",{className:"flex flex-1 h-full p-4 gap-4",children:e.jsxs("div",{className:"flex flex-col overflow-hidden flex-1 gap-4",children:[e.jsxs("div",{className:"flex flex-row gap-2 grid-cols-12",children:[e.jsx(f,{className:"w-full sm:w-44",title:"Items",value:t,isLoading:r}),e.jsx(f,{className:"w-full sm:w-44",title:"Files",value:n,isLoading:s})]}),e.jsxs("div",{className:"flex flex-col gap-4 last:mb-20",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",children:"Recently Updated"}),e.jsx(M,{})]})]})})});export{S as default};
@@ -1,26 +0,0 @@
1
- import{p as e,a as u,x as p,R as V,w as $}from"./chunk-EF7DTUVF-MlADC7xe.js";import{B as L}from"./button-DYtHJlPL.js";import{j as C,m as v,d as R,n as D,o as F,a as I}from"./utils-BdGM_Id-.js";import{c as E,u as H,T as P,a as S,b as N,d as B,f as b,e as O,g as G,h as Q}from"./index-Dycitln2.js";import{c as o}from"./createLucideIcon-BJQzFwzJ.js";import{C as f}from"./calendar-6ih_JEvR.js";import{T as q,F as A}from"./trash-CN5HT_ZJ.js";import{E as U}from"./external-link-D1If5twJ.js";import"./index-BCGL68Qt.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 J=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],M=o("circle-check",J);/**
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 K=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],T=o("circle",K);/**
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 W=[["path",{d:"M15 12h6",key:"upa0zy"}],["path",{d:"M15 6h6",key:"1jlkvy"}],["path",{d:"m3 13 3.553-7.724a.5.5 0 0 1 .894 0L11 13",key:"blevx4"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M4 11h6",key:"olkgv1"}]],k=o("letter-text",W);/**
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 X=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],Y=o("list",X);/**
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 Z=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ee=o("plus",Z),ae={boolean:M,date:f,datetime:f,markdown:k,select:Y,string:k,url:U},m=E(),w=[m.accessor("id",{header(){return e.jsxs("span",{className:"flex items-center w-48 max-w-48",children:[e.jsx(T,{className:"text-gray-500 h-4"})," ID"]})},cell(s){const n=s.getValue();return e.jsx("span",{title:n,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:n})}})],se=[m.accessor("updatedAt",{header(){return e.jsxs("div",{className:"flex items-center w-48 max-w-48",children:[e.jsx(f,{className:"text-gray-500 h-4"})," Last updated"]})},cell(s){return C(new Date(s.getValue()))}})];function te({itemType:s}){const{data:n}=v(s),{data:c}=R(),[r]=D(),i=u.useMemo(()=>m.display({id:"actions",header:()=>e.jsx("span",{className:"flex justify-end ml-auto"}),cell(t){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:a=>{a.stopPropagation(),r({type:s,id:t.row.original.id})},children:[e.jsx(q,{size:16,className:"group-hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"Delete entry"})]})})}}),[s,r]),h=u.useMemo(()=>{if(!n)return w;const t=Object.entries(n.fields);return[...w,...t.filter(([,a])=>a.showInSummary).map(([a,d])=>m.accessor(l=>l[a],{id:a,header(){const l=d.isUploadedFile?A:ae[d.type]??V.Fragment;return e.jsxs("div",{className:"flex items-center",children:[e.jsx(l,{className:"text-gray-500 h-4"}),d.displayName]})},cell(l){const x=l.getValue();switch(d.type){case"boolean":const _=l.getValue()?M:T;return e.jsx("span",{className:"flex justify-center items-center h-full text-nowrap",children:e.jsx(_,{className:F("mx-auto",l.getValue()?"text-green-600":"text-gray-300"),size:14})});case"url":return x?e.jsx(p,{to:x,className:"flex items-center hover:text-blue-500",children:x}):"--";case"datetime":case"date":const j=l.getValue();return j?e.jsx("span",{className:"text-nowrap",children:C(new Date(j))}):"--";case"markdown":case"string":const y=l.getValue();return e.jsx("span",{title:y,className:"block w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:y});default:return l.getValue()}}})),...se,i]},[i,n]),z=u.useMemo(()=>c?.[s]?Object.values(c[s]):[],[s,c]),g=H({data:z,columns:h,getCoreRowModel:Q()});return!n||!c?null:e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(P,{children:[e.jsx(S,{className:"sticky top-0 z-50",children:g.getHeaderGroups().map(t=>e.jsx(N,{className:"grid",style:{gridTemplateColumns:`repeat(${h.length}, minmax(200px, 1fr))`},children:t.headers.map(a=>e.jsx(B,{className:"bg-background",children:a.isPlaceholder?null:b(a.column.columnDef.header,a.getContext())},a.id))},t.id))}),e.jsx(O,{children:g.getRowModel().rows.map(t=>e.jsx(p,{to:`/admin/dashboard/${s}/${t.original.id}`,children:e.jsx(N,{className:"grid",style:{gridTemplateColumns:`repeat(${h.length}, minmax(200px, 1fr))`},children:t.getVisibleCells().map(a=>e.jsx(G,{className:I("h-10"),children:b(a.column.columnDef.cell,a.getContext())},a.id))})},t.id))})]})})}const xe=$(function({params:n}){const{collectionId:c}=n,{data:r,isFetching:i}=v(c);return i||!r?null:e.jsx("div",{className:"overflow-hidden flex flex-1 p-4 gap-4",children:e.jsx("div",{className:"flex flex-col overflow-hidden flex-1 gap-8",children:e.jsxs("div",{className:"flex flex-col h-full gap-4 last:mb-20",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",id:r.displayName,children:r.displayName}),e.jsx(L,{asChild:!0,variant:"default",size:"sm",className:"ml-auto",children:e.jsxs(p,{to:`/admin/dashboard/${c}/new`,children:[e.jsx(ee,{}),"Create"]})})]}),e.jsx(te,{itemType:c},c)]})})})});export{xe as default};
@@ -1 +0,0 @@
1
- import{w as c,p as e}from"./chunk-EF7DTUVF-MlADC7xe.js";import{I as p}from"./itemForm-D7gNDu4Q.js";import{m as n,p as l}from"./utils-BdGM_Id-.js";import"./button-DYtHJlPL.js";import"./index-BCGL68Qt.js";import"./types-BFhFSnS8.js";import"./index-BhhxCYB_.js";import"./index-xBXWoUIa.js";import"./createLucideIcon-BJQzFwzJ.js";import"./index-Cl368BLL.js";import"./authSlice-DXFkOZ5W.js";import"./upload-CopmcV94.js";import"./calendar-6ih_JEvR.js";import"./files-rJZM0-f6.js";import"./trash-CN5HT_ZJ.js";import"./external-link-D1If5twJ.js";const N=c(function({params:r}){const{collectionId:t,documentId:i}=r,{data:o,isFetching:s}=n(t),{data:m,isFetching:a}=l({itemType:t,id:i});return!o||!m||(s||a)?null:e.jsx("div",{className:"overflow-auto scrollbar-stable",children:e.jsx("div",{className:"flex p-4 gap-4",children:e.jsx(p,{itemType:t,fields:o.fields,data:m},`${t}-${i}`)})})});export{N as default};
@@ -1 +0,0 @@
1
- import{w as e,p as o}from"./chunk-EF7DTUVF-MlADC7xe.js";import{I as m}from"./itemForm-D7gNDu4Q.js";import{m as p}from"./utils-BdGM_Id-.js";import"./button-DYtHJlPL.js";import"./index-BCGL68Qt.js";import"./types-BFhFSnS8.js";import"./index-BhhxCYB_.js";import"./index-xBXWoUIa.js";import"./createLucideIcon-BJQzFwzJ.js";import"./index-Cl368BLL.js";import"./authSlice-DXFkOZ5W.js";import"./upload-CopmcV94.js";import"./calendar-6ih_JEvR.js";import"./files-rJZM0-f6.js";import"./trash-CN5HT_ZJ.js";import"./external-link-D1If5twJ.js";const P=e(function({params:i}){const{collectionId:t}=i,{data:r}=p(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{P as default};
@@ -1,46 +0,0 @@
1
- import{p as e,a as d,x as y,y as U,v as le,z as ce,R as ue,w as he,O as pe}from"./chunk-EF7DTUVF-MlADC7xe.js";import{u as xe,e as D,h as fe}from"./authSlice-DXFkOZ5W.js";import{a as r,b as W,d as be,f as ge,g as me,h as je,u as ve,i as we}from"./utils-BdGM_Id-.js";import{R as Q,C as X,a as Z,X as Y,T as J,D as ee,P as te,O as ae,b as ye,c as Ne,d as Ce,e as Se,f as ke,g as _e,A as Me,u as ze,h as De}from"./index-Cl368BLL.js";import{B as _}from"./button-DYtHJlPL.js";import{c as b}from"./createLucideIcon-BJQzFwzJ.js";import{S as E,c as Ee,u as Oe}from"./index-BCGL68Qt.js";import{u as Re,c as Ae,P as O,a as Pe,b as Ie,d as Te}from"./index-BhhxCYB_.js";import{C as L,U as Le}from"./upload-CopmcV94.js";import{E as $e}from"./external-link-D1If5twJ.js";import"./index-xBXWoUIa.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 Be=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Ge=b("arrow-down",Be);/**
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 He=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Fe=b("arrow-up",He);/**
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 qe=[["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"}]],Ve=b("blocks",qe);/**
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 Ke=[["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"}]],Ue=b("files",Ke);/**
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 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=b("grid-3x3",We);/**
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 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=b("heart",Xe);/**
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 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=b("log-out",Ye);/**
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 et=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],tt=b("panel-left",et);/**
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 at=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],st=b("square",at);function nt({...t}){return e.jsx(Q,{"data-slot":"dialog",...t})}function ot({...t}){return e.jsx(te,{"data-slot":"dialog-portal",...t})}function it({className:t,...a}){return e.jsx(ae,{"data-slot":"dialog-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function rt({className:t,children:a,...n}){return e.jsxs(ot,{"data-slot":"dialog-portal",children:[e.jsx(it,{}),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(Y,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function dt({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 lt({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 ct({className:t,...a}){return e.jsx(J,{"data-slot":"dialog-title",className:r("text-lg leading-none font-semibold",t),...a})}function ut({className:t,...a}){return e.jsx(ee,{"data-slot":"dialog-description",className:r("text-muted-foreground text-sm",t),...a})}const ht="#181717",pt=d.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=ht),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"})]})}),xt="#85EA2D",$=d.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=xt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref: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 ft({isOpen:t,setOpen:a}){return e.jsx(nt,{open:t,onOpenChange:n=>a(n),children:e.jsxs(rt,{children:[e.jsxs(dt,{children:[e.jsx(ct,{children:"Editorial"}),e.jsx(ut,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://lobelia-earth.github.io/editorial/",children:[e.jsx($,{size:14}),"Documentation"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"/doc",children:[e.jsx($,{size:14}),"Swagger API UI"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(pt,{size:14}),"GitHub repository"]})})]}),e.jsx(lt,{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(y,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}function bt({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(ye,{"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 gt({...t}){return e.jsx(Q,{"data-slot":"sheet",...t})}function mt({...t}){return e.jsx(te,{"data-slot":"sheet-portal",...t})}function jt({className:t,...a}){return e.jsx(ae,{"data-slot":"sheet-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function vt({className:t,children:a,side:n="right",...s}){return e.jsxs(mt,{children:[e.jsx(jt,{}),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(Y,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function wt({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:r("flex flex-col gap-1.5 p-4",t),...a})}function yt({className:t,...a}){return e.jsx(J,{"data-slot":"sheet-title",className:r("text-foreground font-semibold",t),...a})}function Nt({className:t,...a}){return e.jsx(ee,{"data-slot":"sheet-description",className:r("text-muted-foreground text-sm",t),...a})}function se({delayDuration:t=0,...a}){return e.jsx(Ne,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function Ct({...t}){return e.jsx(se,{children:e.jsx(Ce,{"data-slot":"tooltip",...t})})}function St({...t}){return e.jsx(Se,{"data-slot":"tooltip-trigger",...t})}function kt({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(ke,{children:e.jsxs(_e,{"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(Me,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const z=768;function _t(){const[t,a]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${z-1}px)`),s=()=>{a(window.innerWidth<z)};return n.addEventListener("change",s),a(window.innerWidth<z),()=>n.removeEventListener("change",s)},[]),!!t}const Mt="sidebar_state",zt=3600*24*7,Dt="16rem",Et="18rem",Ot="3rem",Rt="b",ne=d.createContext(null);function R(){const t=d.useContext(ne);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function At({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...l}){const u=_t(),[x,h]=d.useState(!1),[g,C]=d.useState(t),m=a??g,j=d.useCallback(p=>{const c=typeof p=="function"?p(m):p;n?n(c):C(c),document.cookie=`${Mt}=${c}; path=/; max-age=${zt}`},[n,m]),v=d.useCallback(()=>u?h(p=>!p):j(p=>!p),[u,j,h]);d.useEffect(()=>{const p=c=>{c.key===Rt&&(c.metaKey||c.ctrlKey)&&(c.preventDefault(),v())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[v]);const N=m?"expanded":"collapsed",S=d.useMemo(()=>({state:N,open:m,setOpen:j,isMobile:u,openMobile:x,setOpenMobile:h,toggleSidebar:v}),[N,m,j,u,x,h,v]);return e.jsx(ne.Provider,{value:S,children:e.jsx(se,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Dt,"--sidebar-width-icon":Ot,...o},className:r("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...l,children:i})})})}function Pt({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...i}){const{isMobile:l,state:u,openMobile:x,setOpenMobile:h}=R();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}):l?e.jsx(gt,{open:x,onOpenChange:h,...i,children:e.jsxs(vt,{"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":Et},side:t,children:[e.jsxs(wt,{className:"sr-only",children:[e.jsx(yt,{children:"Sidebar"}),e.jsx(Nt,{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 It({className:t,onClick:a,...n}){const{toggleSidebar:s}=R();return e.jsxs(_,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:r("size-7",t),onClick:o=>{a?.(o),s()},...n,children:[e.jsx(tt,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Tt({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 Lt({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 $t({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 k({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?E:"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 G({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 H({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 Bt=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 f({asChild:t=!1,isActive:a=!1,variant:n="default",size:s="default",tooltip:o,className:i,...l}){const u=t?E:"button",{isMobile:x,state:h}=R(),g=e.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:r(Bt({variant:n,size:s}),i),...l});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(Ct,{children:[e.jsx(St,{asChild:!0,children:g}),e.jsx(kt,{side:"right",align:"center",hidden:h!=="collapsed"||x,...o})]})):g}function Gt({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 Ht({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const i=t?E:"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 F({singleton:t}){const{data:a}=W(),{data:n}=be();return a?(d.useMemo(()=>Object.entries(a).filter(([,s])=>t?s.singleton:!s.singleton),[a]),e.jsx(e.Fragment,{children:Object.entries(a).filter(([,s])=>t?s.singleton:!s.singleton).map(([s,o])=>e.jsx(Gt,{children:e.jsx(U,{to:t?`/admin/dashboard/${s}/default`:`/admin/dashboard/${s}`,className:({isActive:i,isPending:l})=>l?"pending":i?"active":"",children:({isActive:i})=>e.jsx(Ht,{isActive:i,asChild:!0,children:e.jsxs("div",{children:[e.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap",children:o.displayName}),!t&&n?.[s]&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1 min-w-[25px] text-right",children:Object.keys(n[s]).length})]})})})},o.displayName))})):null}var M="Collapsible",[Ft,ra]=Ae(M),[qt,A]=Ft(M),oe=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:l,...u}=t,[x,h]=Re({prop:s,defaultProp:o??!1,onChange:l,caller:M});return e.jsx(qt,{scope:n,disabled:i,contentId:ze(),open:x,onOpenToggle:d.useCallback(()=>h(g=>!g),[h]),children:e.jsx(O.div,{"data-state":I(x),"data-disabled":i?"":void 0,...u,ref:a})})});oe.displayName=M;var ie="CollapsibleTrigger",re=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=A(ie,n);return e.jsx(O.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":I(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:a,onClick:Pe(t.onClick,o.onOpenToggle)})});re.displayName=ie;var P="CollapsibleContent",de=d.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=A(P,t.__scopeCollapsible);return e.jsx(Ie,{present:n||o.open,children:({present:i})=>e.jsx(Vt,{...s,ref:a,present:i})})});de.displayName=P;var Vt=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=t,l=A(P,n),[u,x]=d.useState(s),h=d.useRef(null),g=Oe(a,h),C=d.useRef(0),m=C.current,j=d.useRef(0),v=j.current,N=l.open||u,S=d.useRef(N),p=d.useRef(void 0);return d.useEffect(()=>{const c=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(c)},[]),Te(()=>{const c=h.current;if(c){p.current=p.current||{transitionDuration:c.style.transitionDuration,animationName:c.style.animationName},c.style.transitionDuration="0s",c.style.animationName="none";const T=c.getBoundingClientRect();C.current=T.height,j.current=T.width,S.current||(c.style.transitionDuration=p.current.transitionDuration,c.style.animationName=p.current.animationName),x(s)}},[l.open,s]),e.jsx(O.div,{"data-state":I(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!N,...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:N&&o})});function I(t){return t?"open":"closed"}var Kt=oe;function q({...t}){return e.jsx(Kt,{"data-slot":"collapsible",...t})}function V({...t}){return e.jsx(re,{"data-slot":"collapsible-trigger",...t})}function K({...t}){return e.jsx(de,{"data-slot":"collapsible-content",...t})}function Ut(){const t=xe(),[a,n]=d.useState(!1),[s]=ge(),[o]=me(),[i]=je(),{data:l}=ve(),{data:u}=we(),x=D(h=>h.auth.role);return e.jsxs(Pt,{className:"z-50",children:[e.jsx(ft,{isOpen:a,setOpen:n}),e.jsx(Tt,{className:"h-14 justify-center",children:e.jsx(k,{children:e.jsx(y,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:l?.name})})}),e.jsxs($t,{children:[e.jsxs(k,{children:[e.jsx(B,{children:"Content"}),e.jsx(G,{children:e.jsxs(H,{children:[e.jsx(q,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(f,{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(K,{children:e.jsx(F,{})})]})}),e.jsx(q,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(f,{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(K,{children:e.jsx(F,{singleton:!0})})]})}),e.jsx(w,{children:e.jsx(f,{asChild:!0,children:e.jsxs(y,{to:"/admin/dashboard/files",children:[e.jsx(Ue,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(w,{children:e.jsxs(f,{disabled:!0,children:[e.jsx(Ve,{}),e.jsx("span",{children:"Components"})]})})]})})]}),e.jsxs(k,{children:[e.jsx(B,{children:"Actions"}),e.jsx(G,{children:e.jsxs(H,{children:[x==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>o(),children:[e.jsx(Ge,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>i(),children:[e.jsx(Fe,{}),e.jsx("span",{children:"Push to repo"})]})})]}),e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>s(),children:[e.jsx(Le,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(k,{})]}),e.jsxs(Lt,{children:[e.jsx(f,{asChild:!0,children:e.jsxs(y,{to:l?.previewUrl,children:["Preview",e.jsx($e,{className:"ml-auto"})]})}),e.jsx(f,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(f,{className:"cursor-pointer",onClick:()=>t(fe()),children:[e.jsx(Je,{}),"Log out"]})]})]})}function Wt({children:t}){const a=le(),n=D(o=>o.auth.user),s=D(o=>o.auth.isLoading);return d.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?null:t}function Qt(){const{pathname:t}=ce(),{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(ue.Fragment,{children:[i.length>1&&o>=1&&e.jsx(De,{size:12,className:"text-gray-500 pt-[1px]"}),e.jsxs("p",{className:"text-sm leading-none tracking-tight capitalize text-gray-500 last:text-foreground",children:[o<i.length-1&&a[s]&&a[s].singleton&&(a[s]?a[s].displayName:s),o<i.length-1&&a[s]&&!a[s].singleton&&e.jsx(U,{to:`/admin/dashboard/${s}`,className:({isActive:l,isPending:u})=>u?"pending":l?"active":"",children:a[s]?a[s].displayName:s}),o===i.length-1&&(a[s]?a[s].displayName:s)]},s)]},o))}):null}const da=he(function(){return e.jsx(Wt,{children:e.jsxs(At,{className:"flex h-full",children:[e.jsx(Ut,{}),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(It,{}),e.jsx(bt,{orientation:"vertical",className:"h-4"}),e.jsx(Qt,{})]})}),e.jsx(pe,{})]})]})})});export{da as default};
@@ -1 +0,0 @@
1
- import{w as e,p as o}from"./chunk-EF7DTUVF-MlADC7xe.js";import{F as r}from"./files-rJZM0-f6.js";import"./authSlice-DXFkOZ5W.js";import"./utils-BdGM_Id-.js";import"./index-BCGL68Qt.js";import"./upload-CopmcV94.js";import"./createLucideIcon-BJQzFwzJ.js";import"./trash-CN5HT_ZJ.js";const n=e(function(){return o.jsx("div",{className:"overflow-auto flex flex-1 p-4 gap-4",children:o.jsx("div",{className:"flex flex-col flex-1 gap-8",children:o.jsx(r,{})})})});export{n as default};
@@ -1,26 +0,0 @@
1
- import{p as e,a as v,x as z}from"./chunk-EF7DTUVF-MlADC7xe.js";import{e as y,m as j}from"./authSlice-DXFkOZ5W.js";import{a as b,q as C,v as $,w as M,x as D,u as U,y as _,o as H}from"./utils-BdGM_Id-.js";import{S as L,c as S}from"./index-BCGL68Qt.js";import{U as N,C as T}from"./upload-CopmcV94.js";import{F as I,T as V}from"./trash-CN5HT_ZJ.js";import{c as m}from"./createLucideIcon-BJQzFwzJ.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=[["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"}]],q=m("copy",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=[["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"}]],R=m("file-text",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 Z=[["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"}]],G=m("file",Z);/**
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 Q=[["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"}]],W=m("folder-open",Q);/**
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 B=[["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"}]],O=m("folder",B),A=S("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function J({className:s,variant:i,asChild:l=!1,...o}){const n=l?L:"span";return e.jsx(n,{"data-slot":"badge",className:b(A({variant:i}),s),...o})}const K=["txt","md","html","pdf"],X=["svg","webp","png","jpeg","jpg"],Y=[{Icon:I,test:s=>X.some(i=>s.name.endsWith(i))},{Icon:R,test:s=>K.some(i=>s.name.endsWith(i))}],ee={Icon:G},w=({node:s,level:i=0,onDelete:l,onChange:o,disableActions:n,onUpload:p,onCreateFolder:u})=>{const[d,f]=v.useState(!1),{data:h}=U(),g=y(j),a=Y.find(r=>r.test(s))??ee,t=s.type==="directory",c=t||o?"div":z,k=()=>{t&&f(!d)},F=r=>{const x=r.target.files;x&&p&&p(s.path,x)};return e.jsxs("div",{className:"select-none",children:[e.jsxs(c,{to:`/${s.relativePath}`,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:t?k:o?()=>o(s.isLarge?`${h?.largeFilesUrl}/${s.relativePath}`:s.relativePath):void 0,children:[t?e.jsx(T,{size:16,className:b("transition-transform",{"rotate-180":d})}):e.jsx("div",{className:"w-4"}),e.jsxs("div",{className:"flex flex-grow w-24 items-center gap-2 ml-2",children:[t?d?e.jsx(W,{size:16,className:"text-yellow-500"}):e.jsx(O,{size:16,className:"text-yellow-500"}):e.jsx(a.Icon,{size:16,className:" text-gray-500"}),e.jsxs("span",{className:"flex gap-2 items-center text-sm whitespace-nowrap text-ellipsis overflow-hidden w-full",children:[!t&&s.isLarge&&e.jsx(J,{variant:"outline",children:"Large"}),s.name]})]}),e.jsx("div",{className:"flex w-24 justify-end gap-2",children:e.jsx("span",{className:"text-sm text-gray-500",children:t?"--":_(s.size)})}),g==="developer"&&!n&&e.jsxs("div",{className:"flex items-center gap-1 ml-4 group-hover:visible invisible z-50",children:[t&&e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"file",multiple:!0,onChange:F,className:"hidden",id:`dir-upload-${s.name}-${i}`}),e.jsxs("label",{htmlFor:`dir-upload-${s.name}-${i}`,className:"hover:text-blue-500 p-1 hover:bg-muted rounded-sm cursor-pointer",onClick:r=>{r.stopPropagation()},children:[e.jsx(N,{size:16}),e.jsx("span",{className:"sr-only",children:"Upload files to this folder"})]})]}),e.jsxs("button",{className:H("hover:text-yellow-500 p-1 hover:bg-muted rounded-sm",t&&"hidden"),onClick:r=>{r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(s.path)},children:[e.jsx(q,{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:r=>{r.preventDefault(),r.stopPropagation(),l(s.path)},children:[e.jsx(V,{size:16}),e.jsxs("span",{className:"sr-only",children:["Delete this ",t?"folder":"file"]})]})]})]}),t&&d&&s.children&&e.jsx("div",{children:s.children.map((r,x)=>e.jsx(w,{node:r,level:i+1,onDelete:l,onChange:o,disableActions:n,onUpload:p,onCreateFolder:u},`${r.name}-${x}`))})]})};function ne({disableActions:s,onChange:i}){const{data:l}=C(),[o]=$(),[n]=M(),[p]=D(),u=y(j),d=async a=>{const t=a.target.files;if(t)try{await n({files:t}).unwrap()}catch(c){console.error("Upload failed:",c)}},f=async(a,t)=>{try{await n({files:t,path:a}).unwrap()}catch(c){console.error("Upload failed:",c)}},h=async(a,t)=>{try{await p({name:t,path:a}).unwrap()}catch(c){console.error("Create folder failed:",c)}},g=v.useMemo(()=>l?.toSorted((a,t)=>a.type==="directory"&&t.type!=="directory"?-1:a.type!=="directory"&&t.type==="directory"?1:a.name.localeCompare(t.name)).map(a=>e.jsx(w,{node:a,onDelete:o,onChange:i,disableActions:s,onUpload:f,onCreateFolder:h},a.name)),[l,s,i]);return 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"})}),u==="developer"&&!s&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"file",multiple:!0,onChange:d,className:"hidden",id:"file-upload"}),e.jsxs("label",{htmlFor:"file-upload",className:"hover:text-blue-500 p-1 hover:bg-muted rounded-sm cursor-pointer",children:[e.jsx(N,{size:16}),e.jsx("span",{className:"sr-only",children:"Upload files"})]})]})]}),g]})}export{ne as F};
@@ -1 +0,0 @@
1
- import{a as p,p as e,w as f,v as b}from"./chunk-EF7DTUVF-MlADC7xe.js";import{B as g}from"./button-DYtHJlPL.js";import{o as N,b as y,s as d,u as w,F,a as n,c as t,d as x,e as i,I as u,f as m,C as v,t as C}from"./types-BFhFSnS8.js";import{S as L}from"./spinner-C3uu_C2V.js";import{u as S,e as c,l as E}from"./authSlice-DXFkOZ5W.js";import"./index-BCGL68Qt.js";import"./utils-BdGM_Id-.js";import"./index-BhhxCYB_.js";import"./index-xBXWoUIa.js";import"./createLucideIcon-BJQzFwzJ.js";const k=N({email:d().nonempty("Please enter your email").email(),password:d().nonempty("Please enter your password"),remember:y()});function P(){"use no memo";const o=S(),r=c(s=>s.auth.isLoading),a=w({resolver:C(k),disabled:r,defaultValues:{email:"",password:"",remember:!1}}),l=p.useCallback(({email:s,password:h,remember:j})=>{o(E({email:s,password:h,remember:j}))},[o]);return e.jsx("div",{className:"flex flex-col",children:e.jsx(F,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[e.jsx(n,{control:a.control,name:"email",rules:{required:!0},render:({field:s})=>e.jsxs(t,{children:[e.jsx(x,{className:"flex gap-1 items-baseline",children:"Email"}),e.jsx(i,{children:e.jsx(u,{placeholder:"callasmaria@example.com",...s})}),e.jsx(m,{})]})}),e.jsx(n,{name:"password",control:a.control,rules:{required:!0},render:({field:s})=>e.jsxs(t,{children:[e.jsx(x,{className:"flex gap-1 items-baseline",children:"Password"}),e.jsx(i,{children:e.jsx(u,{type:"password",...s})}),e.jsx(m,{})]})}),e.jsx(n,{name:"remember",control:a.control,render:({field:s})=>e.jsxs(t,{children:[e.jsx(i,{children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(v,{id:"remember",checked:s.value,onCheckedChange:s.onChange}),e.jsx("label",{htmlFor:"remember",className:"text-sm leading-none",children:"Remember me"})]})}),e.jsx(m,{})]})}),e.jsx(g,{type:"submit",disabled:!a.formState.isValid||r,className:"w-full",children:r?e.jsx(L,{className:"absolute"}):"Login"})]})})})}const z=f(function(){const r=b(),a=c(s=>s.auth.user),l=c(s=>s.auth.isLoading);return p.useEffect(()=>{a&&r("/admin/dashboard")},[r,a]),l||a?null:e.jsx("div",{className:"flex w-full h-full",children:e.jsxs("div",{className:"self-center space-y-8 w-72 mx-auto",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight leading-none",children:"Editorial Admin"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your details below to login"})]}),e.jsx(P,{})]})})});export{z as default};
@@ -1 +0,0 @@
1
- import{a as c,p as x,D as y}from"./chunk-EF7DTUVF-MlADC7xe.js";import{u as E,a as w}from"./index-BCGL68Qt.js";import{a as b}from"./index-xBXWoUIa.js";function _(e,t){const n=c.createContext(t),r=i=>{const{children:u,...s}=i,a=c.useMemo(()=>s,Object.values(s));return x.jsx(n.Provider,{value:a,children:u})};r.displayName=e+"Provider";function o(i){const u=c.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function j(e,t=[]){let n=[];function r(i,u){const s=c.createContext(u),a=n.length;n=[...n,u];const f=d=>{const{scope:p,children:m,...v}=d,S=p?.[e]?.[a]||s,g=c.useMemo(()=>v,Object.values(v));return x.jsx(S.Provider,{value:g,children:m})};f.displayName=i+"Provider";function l(d,p){const m=p?.[e]?.[a]||s,v=c.useContext(m);if(v)return v;if(u!==void 0)return u;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[f,l]}const o=()=>{const i=n.map(u=>c.createContext(u));return function(s){const a=s?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,P(o,...t)]}function P(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const u=r.reduce((s,{useScope:a,scopeName:f})=>{const d=a(i)[`__scope${f}`];return{...s,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}function L(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var N=globalThis?.document?c.useLayoutEffect:()=>{},C=y[" useInsertionEffect ".trim().toString()]||N;function W({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,u]=A({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:o;{const l=c.useRef(e!==void 0);c.useEffect(()=>{const d=l.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),l.current=s},[s,r])}const f=c.useCallback(l=>{if(s){const d=R(l)?l(e):l;d!==e&&u.current?.(d)}else i(l)},[s,e,i,u]);return[a,f]}function A({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return C(()=>{i.current=t},[t]),c.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function R(e){return typeof e=="function"}function F(e){const[t,n]=c.useState(void 0);return N(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let u,s;if("borderBoxSize"in i){const a=i.borderBoxSize,f=Array.isArray(a)?a[0]:a;u=f.inlineSize,s=f.blockSize}else u=e.offsetWidth,s=e.offsetHeight;n({width:u,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function M(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var O=e=>{const{present:t,children:n}=e,r=T(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),i=E(r.ref,I(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:i}):null};O.displayName="Presence";function T(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),i=c.useRef("none"),u=e?"mounted":"unmounted",[s,a]=M(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const f=h(r.current);i.current=s==="mounted"?f:"none"},[s]),N(()=>{const f=r.current,l=o.current;if(l!==e){const p=i.current,m=h(f);e?a("MOUNT"):m==="none"||f?.display==="none"?a("UNMOUNT"):a(l&&p!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),N(()=>{if(t){let f;const l=t.ownerDocument.defaultView??window,d=m=>{const S=h(r.current).includes(m.animationName);if(m.target===t&&S&&(a("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",f=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=m=>{m.target===t&&(i.current=h(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{l.clearTimeout(f),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function h(e){return e?.animationName||"none"}function I(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var U=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],k=U.reduce((e,t)=>{const n=w(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:u,...s}=o,a=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function H(e,t){e&&b.flushSync(()=>e.dispatchEvent(t))}export{k as P,L as a,O as b,j as c,N as d,F as e,H as f,_ as g,W as u};
@@ -1,55 +0,0 @@
1
- import{c as Kt}from"./createLucideIcon-BJQzFwzJ.js";import{a as c,D as vr,p as C}from"./chunk-EF7DTUVF-MlADC7xe.js";import{d as Ne,P as F,a as j,f as mr,c as at,g as gr,u as qt,b as we,e as yr}from"./index-BhhxCYB_.js";import{u as K,a as wr,b as xr}from"./index-BCGL68Qt.js";import{_ as ee,j as Zt,k as br}from"./authSlice-DXFkOZ5W.js";import{R as Er,a as Cr}from"./index-xBXWoUIa.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 Rr=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ks=Kt("chevron-right",Rr);/**
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 Pr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Is=Kt("x",Pr);var Ar=vr[" useId ".trim().toString()]||(()=>{}),Sr=0;function Te(e){const[t,n]=c.useState(Ar());return Ne(()=>{n(r=>r??String(Sr++))},[e]),e||(t?`radix-${t}`:"")}function ue(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}function Tr(e,t=globalThis?.document){const n=ue(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Or="DismissableLayer",et="dismissableLayer.update",Dr="dismissableLayer.pointerDownOutside",Lr="dismissableLayer.focusOutside",At,Qt=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ct=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=c.useContext(Qt),[f,p]=c.useState(null),v=f?.ownerDocument??globalThis?.document,[,h]=c.useState({}),g=K(t,R=>p(R)),d=Array.from(u.layers),[m]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=d.indexOf(m),w=f?d.indexOf(f):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=w>=y,E=_r(R=>{const S=R.target,D=[...u.branches].some(T=>T.contains(S));!x||D||(o?.(R),s?.(R),R.defaultPrevented||a?.())},v),P=kr(R=>{const S=R.target;[...u.branches].some(T=>T.contains(S))||(i?.(R),s?.(R),R.defaultPrevented||a?.())},v);return Tr(R=>{w===u.layers.size-1&&(r?.(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},v),c.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(At=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),St(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=At)}},[f,v,n,u]),c.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),St())},[f,u]),c.useEffect(()=>{const R=()=>h({});return document.addEventListener(et,R),()=>document.removeEventListener(et,R)},[]),C.jsx(F.div,{...l,ref:g,style:{pointerEvents:b?x?"auto":"none":void 0,...e.style},onFocusCapture:j(e.onFocusCapture,P.onFocusCapture),onBlurCapture:j(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:j(e.onPointerDownCapture,E.onPointerDownCapture)})});ct.displayName=Or;var Nr="DismissableLayerBranch",Mr=c.forwardRef((e,t)=>{const n=c.useContext(Qt),r=c.useRef(null),o=K(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),C.jsx(F.div,{...e,ref:o})});Mr.displayName=Nr;function _r(e,t=globalThis?.document){const n=ue(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Jt(Dr,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kr(e,t=globalThis?.document){const n=ue(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&Jt(Lr,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function St(){const e=new CustomEvent(et);document.dispatchEvent(e)}function Jt(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mr(o,i):o.dispatchEvent(i)}var Ue="focusScope.autoFocusOnMount",Ye="focusScope.autoFocusOnUnmount",Tt={bubbles:!1,cancelable:!0},Ir="FocusScope",en=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=c.useState(null),u=ue(o),f=ue(i),p=c.useRef(null),v=K(t,d=>l(d)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let d=function(b){if(h.paused||!a)return;const x=b.target;a.contains(x)?p.current=x:J(p.current,{select:!0})},m=function(b){if(h.paused||!a)return;const x=b.relatedTarget;x!==null&&(a.contains(x)||J(p.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const E of b)E.removedNodes.length>0&&J(a)};document.addEventListener("focusin",d),document.addEventListener("focusout",m);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",d),document.removeEventListener("focusout",m),w.disconnect()}}},[r,a,h.paused]),c.useEffect(()=>{if(a){Dt.add(h);const d=document.activeElement;if(!a.contains(d)){const y=new CustomEvent(Ue,Tt);a.addEventListener(Ue,u),a.dispatchEvent(y),y.defaultPrevented||(Fr(Hr(tn(a)),{select:!0}),document.activeElement===d&&J(a))}return()=>{a.removeEventListener(Ue,u),setTimeout(()=>{const y=new CustomEvent(Ye,Tt);a.addEventListener(Ye,f),a.dispatchEvent(y),y.defaultPrevented||J(d??document.body,{select:!0}),a.removeEventListener(Ye,f),Dt.remove(h)},0)}}},[a,u,f,h]);const g=c.useCallback(d=>{if(!n&&!r||h.paused)return;const m=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,y=document.activeElement;if(m&&y){const w=d.currentTarget,[b,x]=jr(w);b&&x?!d.shiftKey&&y===x?(d.preventDefault(),n&&J(b,{select:!0})):d.shiftKey&&y===b&&(d.preventDefault(),n&&J(x,{select:!0})):y===w&&d.preventDefault()}},[n,r,h.paused]);return C.jsx(F.div,{tabIndex:-1,...s,ref:v,onKeyDown:g})});en.displayName=Ir;function Fr(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(J(r,{select:t}),document.activeElement!==n)return}function jr(e){const t=tn(e),n=Ot(t,e),r=Ot(t.reverse(),e);return[n,r]}function tn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ot(e,t){for(const n of e)if(!Wr(n,{upTo:t}))return n}function Wr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function $r(e){return e instanceof HTMLInputElement&&"select"in e}function J(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&$r(e)&&t&&e.select()}}var Dt=Br();function Br(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Lt(e,t),e.unshift(t)},remove(t){e=Lt(e,t),e[0]?.resume()}}}function Lt(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Hr(e){return e.filter(t=>t.tagName!=="A")}var Vr="Portal",lt=c.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=c.useState(!1);Ne(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?Er.createPortal(C.jsx(F.div,{...r,ref:t}),s):null});lt.displayName=Vr;var Xe=0;function zr(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Nt()),document.body.insertAdjacentElement("beforeend",e[1]??Nt()),Xe++,()=>{Xe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xe--}},[])}function Nt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Oe="right-scroll-bar-position",De="width-before-scroll-bar",Ur="with-scroll-bars-hidden",Yr="--removed-body-scroll-bar-size";function Ge(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Xr(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Gr=typeof window<"u"?c.useLayoutEffect:c.useEffect,Mt=new WeakMap;function Kr(e,t){var n=Xr(null,function(r){return e.forEach(function(o){return Ge(o,r)})});return Gr(function(){var r=Mt.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||Ge(a,null)}),i.forEach(function(a){o.has(a)||Ge(a,s)})}Mt.set(n,e)},[e]),n}function qr(e){return e}function Zr(e,t){t===void 0&&(t=qr);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var f=s;s=[],f.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),n}}}};return o}function Qr(e){e===void 0&&(e={});var t=Zr(null);return t.options=ee({async:!0,ssr:!1},e),t}var nn=function(e){var t=e.sideCar,n=Zt(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,ee({},n))};nn.isSideCarExport=!0;function Jr(e,t){return e.useMedium(t),nn}var rn=Qr(),Ke=function(){},je=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Ke,onWheelCapture:Ke,onTouchMoveCapture:Ke}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,p=e.shards,v=e.sideCar,h=e.noRelative,g=e.noIsolation,d=e.inert,m=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,b=e.gapMode,x=Zt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=v,P=Kr([n,t]),R=ee(ee({},x),o);return c.createElement(c.Fragment,null,f&&c.createElement(E,{sideCar:rn,removeScrollBar:u,shards:p,noRelative:h,noIsolation:g,inert:d,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),s?c.cloneElement(c.Children.only(a),ee(ee({},R),{ref:P})):c.createElement(w,ee({},R,{className:l,ref:P}),a))});je.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};je.classNames={fullWidth:De,zeroRight:Oe};var eo=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function to(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=eo();return t&&e.setAttribute("nonce",t),e}function no(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ro(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var oo=function(){var e=0,t=null;return{add:function(n){e==0&&(t=to())&&(no(t,n),ro(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},io=function(){var e=oo();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},on=function(){var e=io(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},so={left:0,top:0,right:0,gap:0},qe=function(e){return parseInt(e||"",10)||0},ao=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[qe(n),qe(r),qe(o)]},co=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return so;var t=ao(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},lo=on(),ce="data-scroll-locked",uo=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
12
- .`.concat(Ur,` {
13
- overflow: hidden `).concat(r,`;
14
- padding-right: `).concat(a,"px ").concat(r,`;
15
- }
16
- body[`).concat(ce,`] {
17
- overflow: hidden `).concat(r,`;
18
- overscroll-behavior: contain;
19
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
20
- padding-left: `.concat(o,`px;
21
- padding-top: `).concat(i,`px;
22
- padding-right: `).concat(s,`px;
23
- margin-left:0;
24
- margin-top:0;
25
- margin-right: `).concat(a,"px ").concat(r,`;
26
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
27
- }
28
-
29
- .`).concat(Oe,` {
30
- right: `).concat(a,"px ").concat(r,`;
31
- }
32
-
33
- .`).concat(De,` {
34
- margin-right: `).concat(a,"px ").concat(r,`;
35
- }
36
-
37
- .`).concat(Oe," .").concat(Oe,` {
38
- right: 0 `).concat(r,`;
39
- }
40
-
41
- .`).concat(De," .").concat(De,` {
42
- margin-right: 0 `).concat(r,`;
43
- }
44
-
45
- body[`).concat(ce,`] {
46
- `).concat(Yr,": ").concat(a,`px;
47
- }
48
- `)},_t=function(){var e=parseInt(document.body.getAttribute(ce)||"0",10);return isFinite(e)?e:0},fo=function(){c.useEffect(function(){return document.body.setAttribute(ce,(_t()+1).toString()),function(){var e=_t()-1;e<=0?document.body.removeAttribute(ce):document.body.setAttribute(ce,e.toString())}},[])},po=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;fo();var i=c.useMemo(function(){return co(o)},[o]);return c.createElement(lo,{styles:uo(i,!t,o,n?"":"!important")})},tt=!1;if(typeof window<"u")try{var Ce=Object.defineProperty({},"passive",{get:function(){return tt=!0,!0}});window.addEventListener("test",Ce,Ce),window.removeEventListener("test",Ce,Ce)}catch{tt=!1}var ie=tt?{passive:!1}:!1,ho=function(e){return e.tagName==="TEXTAREA"},sn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ho(e)&&n[t]==="visible")},vo=function(e){return sn(e,"overflowY")},mo=function(e){return sn(e,"overflowX")},kt=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=an(e,r);if(o){var i=cn(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},go=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},yo=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},an=function(e,t){return e==="v"?vo(t):mo(t)},cn=function(e,t){return e==="v"?go(t):yo(t)},wo=function(e,t){return e==="h"&&t==="rtl"?-1:1},xo=function(e,t,n,r,o){var i=wo(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,f=s>0,p=0,v=0;do{if(!a)break;var h=cn(e,a),g=h[0],d=h[1],m=h[2],y=d-m-i*g;(g||y)&&an(e,a)&&(p+=y,v+=g);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(p)<1||!f&&Math.abs(v)<1)&&(u=!0),u},Re=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},It=function(e){return[e.deltaX,e.deltaY]},Ft=function(e){return e&&"current"in e?e.current:e},bo=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Eo=function(e){return`
49
- .block-interactivity-`.concat(e,` {pointer-events: none;}
50
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
51
- `)},Co=0,se=[];function Ro(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(Co++)[0],i=c.useState(on)[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var d=br([e.lockRef.current],(e.shards||[]).map(Ft),!0).filter(Boolean);return d.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),d.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(d,m){if("touches"in d&&d.touches.length===2||d.type==="wheel"&&d.ctrlKey)return!s.current.allowPinchZoom;var y=Re(d),w=n.current,b="deltaX"in d?d.deltaX:w[0]-y[0],x="deltaY"in d?d.deltaY:w[1]-y[1],E,P=d.target,R=Math.abs(b)>Math.abs(x)?"h":"v";if("touches"in d&&R==="h"&&P.type==="range")return!1;var S=kt(R,P);if(!S)return!0;if(S?E=R:(E=R==="v"?"h":"v",S=kt(R,P)),!S)return!1;if(!r.current&&"changedTouches"in d&&(b||x)&&(r.current=E),!E)return!0;var D=r.current||E;return xo(D,m,d,D==="h"?b:x)},[]),l=c.useCallback(function(d){var m=d;if(!(!se.length||se[se.length-1]!==i)){var y="deltaY"in m?It(m):Re(m),w=t.current.filter(function(E){return E.name===m.type&&(E.target===m.target||m.target===E.shadowParent)&&bo(E.delta,y)})[0];if(w&&w.should){m.cancelable&&m.preventDefault();return}if(!w){var b=(s.current.shards||[]).map(Ft).filter(Boolean).filter(function(E){return E.contains(m.target)}),x=b.length>0?a(m,b[0]):!s.current.noIsolation;x&&m.cancelable&&m.preventDefault()}}},[]),u=c.useCallback(function(d,m,y,w){var b={name:d,delta:m,target:y,should:w,shadowParent:Po(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(x){return x!==b})},1)},[]),f=c.useCallback(function(d){n.current=Re(d),r.current=void 0},[]),p=c.useCallback(function(d){u(d.type,It(d),d.target,a(d,e.lockRef.current))},[]),v=c.useCallback(function(d){u(d.type,Re(d),d.target,a(d,e.lockRef.current))},[]);c.useEffect(function(){return se.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",l,ie),document.addEventListener("touchmove",l,ie),document.addEventListener("touchstart",f,ie),function(){se=se.filter(function(d){return d!==i}),document.removeEventListener("wheel",l,ie),document.removeEventListener("touchmove",l,ie),document.removeEventListener("touchstart",f,ie)}},[]);var h=e.removeScrollBar,g=e.inert;return c.createElement(c.Fragment,null,g?c.createElement(i,{styles:Eo(o)}):null,h?c.createElement(po,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Po(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ao=Jr(rn,Ro);var ln=c.forwardRef(function(e,t){return c.createElement(je,ee({},e,{ref:t,sideCar:Ao}))});ln.classNames=je.classNames;var So=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ae=new WeakMap,Pe=new WeakMap,Ae={},Ze=0,un=function(e){return e&&(e.host||un(e.parentNode))},To=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=un(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Oo=function(e,t,n,r){var o=To(t,Array.isArray(e)?e:[e]);Ae[n]||(Ae[n]=new WeakMap);var i=Ae[n],s=[],a=new Set,l=new Set(o),u=function(p){!p||a.has(p)||(a.add(p),u(p.parentNode))};o.forEach(u);var f=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(v){if(a.has(v))f(v);else try{var h=v.getAttribute(r),g=h!==null&&h!=="false",d=(ae.get(v)||0)+1,m=(i.get(v)||0)+1;ae.set(v,d),i.set(v,m),s.push(v),d===1&&g&&Pe.set(v,!0),m===1&&v.setAttribute(n,"true"),g||v.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",v,y)}})};return f(t),a.clear(),Ze++,function(){s.forEach(function(p){var v=ae.get(p)-1,h=i.get(p)-1;ae.set(p,v),i.set(p,h),v||(Pe.has(p)||p.removeAttribute(r),Pe.delete(p)),h||p.removeAttribute(n)}),Ze--,Ze||(ae=new WeakMap,ae=new WeakMap,Pe=new WeakMap,Ae={})}},Do=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=So(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Oo(r,o,n,"aria-hidden")):function(){return null}},We="Dialog",[fn,Fs]=at(We),[Lo,z]=fn(We),dn=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=c.useRef(null),l=c.useRef(null),[u,f]=qt({prop:r,defaultProp:o??!1,onChange:i,caller:We});return C.jsx(Lo,{scope:t,triggerRef:a,contentRef:l,contentId:Te(),titleId:Te(),descriptionId:Te(),open:u,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(p=>!p),[f]),modal:s,children:n})};dn.displayName=We;var pn="DialogTrigger",hn=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(pn,n),i=K(t,o.triggerRef);return C.jsx(F.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":dt(o.open),...r,ref:i,onClick:j(e.onClick,o.onOpenToggle)})});hn.displayName=pn;var ut="DialogPortal",[No,vn]=fn(ut,{forceMount:void 0}),mn=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=z(ut,t);return C.jsx(No,{scope:t,forceMount:n,children:c.Children.map(r,s=>C.jsx(we,{present:n||i.open,children:C.jsx(lt,{asChild:!0,container:o,children:s})}))})};mn.displayName=ut;var Me="DialogOverlay",gn=c.forwardRef((e,t)=>{const n=vn(Me,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=z(Me,e.__scopeDialog);return i.modal?C.jsx(we,{present:r||i.open,children:C.jsx(_o,{...o,ref:t})}):null});gn.displayName=Me;var Mo=wr("DialogOverlay.RemoveScroll"),_o=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(Me,n);return C.jsx(ln,{as:Mo,allowPinchZoom:!0,shards:[o.contentRef],children:C.jsx(F.div,{"data-state":dt(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),re="DialogContent",yn=c.forwardRef((e,t)=>{const n=vn(re,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=z(re,e.__scopeDialog);return C.jsx(we,{present:r||i.open,children:i.modal?C.jsx(ko,{...o,ref:t}):C.jsx(Io,{...o,ref:t})})});yn.displayName=re;var ko=c.forwardRef((e,t)=>{const n=z(re,e.__scopeDialog),r=c.useRef(null),o=K(t,n.contentRef,r);return c.useEffect(()=>{const i=r.current;if(i)return Do(i)},[]),C.jsx(wn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:j(e.onFocusOutside,i=>i.preventDefault())})}),Io=c.forwardRef((e,t)=>{const n=z(re,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return C.jsx(wn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;n.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),wn=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=z(re,n),l=c.useRef(null),u=K(t,l);return zr(),C.jsxs(C.Fragment,{children:[C.jsx(en,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:C.jsx(ct,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":dt(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),C.jsxs(C.Fragment,{children:[C.jsx(Fo,{titleId:a.titleId}),C.jsx(Wo,{contentRef:l,descriptionId:a.descriptionId})]})]})}),ft="DialogTitle",xn=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(ft,n);return C.jsx(F.h2,{id:o.titleId,...r,ref:t})});xn.displayName=ft;var bn="DialogDescription",En=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(bn,n);return C.jsx(F.p,{id:o.descriptionId,...r,ref:t})});En.displayName=bn;var Cn="DialogClose",Rn=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(Cn,n);return C.jsx(F.button,{type:"button",...r,ref:t,onClick:j(e.onClick,()=>o.onOpenChange(!1))})});Rn.displayName=Cn;function dt(e){return e?"open":"closed"}var Pn="DialogTitleWarning",[js,An]=gr(Pn,{contentName:re,titleName:ft,docsSlug:"dialog"}),Fo=({titleId:e})=>{const t=An(Pn),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
52
-
53
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
54
-
55
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jo="DialogDescriptionWarning",Wo=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${An(jo).contentName}}.`;return c.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ws=dn,$s=hn,Bs=mn,Hs=gn,Vs=yn,zs=xn,Us=En,Ys=Rn,$o="Separator",jt="horizontal",Bo=["horizontal","vertical"],Sn=c.forwardRef((e,t)=>{const{decorative:n,orientation:r=jt,...o}=e,i=Ho(r)?r:jt,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return C.jsx(F.div,{"data-orientation":i,...a,...o,ref:t})});Sn.displayName=$o;function Ho(e){return Bo.includes(e)}var Xs=Sn;const Vo=["top","right","bottom","left"],te=Math.min,$=Math.max,_e=Math.round,Se=Math.floor,X=e=>({x:e,y:e}),zo={left:"right",right:"left",bottom:"top",top:"bottom"},Uo={start:"end",end:"start"};function nt(e,t,n){return $(e,te(t,n))}function Z(e,t){return typeof e=="function"?e(t):e}function Q(e){return e.split("-")[0]}function pe(e){return e.split("-")[1]}function pt(e){return e==="x"?"y":"x"}function ht(e){return e==="y"?"height":"width"}const Yo=new Set(["top","bottom"]);function Y(e){return Yo.has(Q(e))?"y":"x"}function vt(e){return pt(Y(e))}function Xo(e,t,n){n===void 0&&(n=!1);const r=pe(e),o=vt(e),i=ht(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ke(s)),[s,ke(s)]}function Go(e){const t=ke(e);return[rt(e),t,rt(t)]}function rt(e){return e.replace(/start|end/g,t=>Uo[t])}const Wt=["left","right"],$t=["right","left"],Ko=["top","bottom"],qo=["bottom","top"];function Zo(e,t,n){switch(e){case"top":case"bottom":return n?t?$t:Wt:t?Wt:$t;case"left":case"right":return t?Ko:qo;default:return[]}}function Qo(e,t,n,r){const o=pe(e);let i=Zo(Q(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(rt)))),i}function ke(e){return e.replace(/left|right|bottom|top/g,t=>zo[t])}function Jo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tn(e){return typeof e!="number"?Jo(e):{top:e,right:e,bottom:e,left:e}}function Ie(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Bt(e,t,n){let{reference:r,floating:o}=e;const i=Y(t),s=vt(t),a=ht(s),l=Q(t),u=i==="y",f=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,v=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:f,y:r.y-o.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:p};break;case"left":h={x:r.x-o.width,y:p};break;default:h={x:r.x,y:r.y}}switch(pe(t)){case"start":h[s]-=v*(n&&u?-1:1);break;case"end":h[s]+=v*(n&&u?-1:1);break}return h}const ei=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=Bt(u,r,l),v=r,h={},g=0;for(let d=0;d<a.length;d++){const{name:m,fn:y}=a[d],{x:w,y:b,data:x,reset:E}=await y({x:f,y:p,initialPlacement:r,placement:v,strategy:o,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});f=w??f,p=b??p,h={...h,[m]:{...h[m],...x}},E&&g<=50&&(g++,typeof E=="object"&&(E.placement&&(v=E.placement),E.rects&&(u=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:f,y:p}=Bt(u,v,l)),d=-1)}return{x:f,y:p,placement:v,strategy:o,middlewareData:h}};async function me(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:v=!1,padding:h=0}=Z(t,e),g=Tn(h),m=a[v?p==="floating"?"reference":"floating":p],y=Ie(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),w=p==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},E=Ie(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:l}):w);return{top:(y.top-E.top+g.top)/x.y,bottom:(E.bottom-y.bottom+g.bottom)/x.y,left:(y.left-E.left+g.left)/x.x,right:(E.right-y.right+g.right)/x.x}}const ti=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=Z(e,t)||{};if(u==null)return{};const p=Tn(f),v={x:n,y:r},h=vt(o),g=ht(h),d=await s.getDimensions(u),m=h==="y",y=m?"top":"left",w=m?"bottom":"right",b=m?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[h]-v[h]-i.floating[g],E=v[h]-i.reference[h],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let R=P?P[b]:0;(!R||!await(s.isElement==null?void 0:s.isElement(P)))&&(R=a.floating[b]||i.floating[g]);const S=x/2-E/2,D=R/2-d[g]/2-1,T=te(p[y],D),k=te(p[w],D),I=T,L=R-d[g]-k,O=R/2-d[g]/2+S,W=nt(I,O,L),N=!l.arrow&&pe(o)!=null&&O!==W&&i.reference[g]/2-(O<I?T:k)-d[g]/2<0,M=N?O<I?O-I:O-L:0;return{[h]:v[h]+M,data:{[h]:W,centerOffset:O-W-M,...N&&{alignmentOffset:M}},reset:N}}}),ni=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:d=!0,...m}=Z(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Q(o),w=Y(a),b=Q(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=v||(b||!d?[ke(a)]:Go(a)),P=g!=="none";!v&&P&&E.push(...Qo(a,d,g,x));const R=[a,...E],S=await me(t,m),D=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&D.push(S[y]),p){const O=Xo(o,s,x);D.push(S[O[0]],S[O[1]])}if(T=[...T,{placement:o,overflows:D}],!D.every(O=>O<=0)){var k,I;const O=(((k=i.flip)==null?void 0:k.index)||0)+1,W=R[O];if(W&&(!(p==="alignment"?w!==Y(W):!1)||T.every(A=>A.overflows[0]>0&&Y(A.placement)===w)))return{data:{index:O,overflows:T},reset:{placement:W}};let N=(I=T.filter(M=>M.overflows[0]<=0).sort((M,A)=>M.overflows[1]-A.overflows[1])[0])==null?void 0:I.placement;if(!N)switch(h){case"bestFit":{var L;const M=(L=T.filter(A=>{if(P){const _=Y(A.placement);return _===w||_==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(_=>_>0).reduce((_,U)=>_+U,0)]).sort((A,_)=>A[1]-_[1])[0])==null?void 0:L[0];M&&(N=M);break}case"initialPlacement":N=a;break}if(o!==N)return{reset:{placement:N}}}return{}}}};function Ht(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vt(e){return Vo.some(t=>e[t]>=0)}const ri=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Z(e,t);switch(r){case"referenceHidden":{const i=await me(t,{...o,elementContext:"reference"}),s=Ht(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Vt(s)}}}case"escaped":{const i=await me(t,{...o,altBoundary:!0}),s=Ht(i,n.floating);return{data:{escapedOffsets:s,escaped:Vt(s)}}}default:return{}}}}},On=new Set(["left","top"]);async function oi(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Q(n),a=pe(n),l=Y(n)==="y",u=On.has(s)?-1:1,f=i&&l?-1:1,p=Z(t,e);let{mainAxis:v,crossAxis:h,alignmentAxis:g}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*f,y:v*u}:{x:v*u,y:h*f}}const ii=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await oi(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},si=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:y,y:w}=m;return{x:y,y:w}}},...l}=Z(e,t),u={x:n,y:r},f=await me(t,l),p=Y(Q(o)),v=pt(p);let h=u[v],g=u[p];if(i){const m=v==="y"?"top":"left",y=v==="y"?"bottom":"right",w=h+f[m],b=h-f[y];h=nt(w,h,b)}if(s){const m=p==="y"?"top":"left",y=p==="y"?"bottom":"right",w=g+f[m],b=g-f[y];g=nt(w,g,b)}const d=a.fn({...t,[v]:h,[p]:g});return{...d,data:{x:d.x-n,y:d.y-r,enabled:{[v]:i,[p]:s}}}}}},ai=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Z(e,t),f={x:n,y:r},p=Y(o),v=pt(p);let h=f[v],g=f[p];const d=Z(a,t),m=typeof d=="number"?{mainAxis:d,crossAxis:0}:{mainAxis:0,crossAxis:0,...d};if(l){const b=v==="y"?"height":"width",x=i.reference[v]-i.floating[b]+m.mainAxis,E=i.reference[v]+i.reference[b]-m.mainAxis;h<x?h=x:h>E&&(h=E)}if(u){var y,w;const b=v==="y"?"width":"height",x=On.has(Q(o)),E=i.reference[p]-i.floating[b]+(x&&((y=s.offset)==null?void 0:y[p])||0)+(x?0:m.crossAxis),P=i.reference[p]+i.reference[b]+(x?0:((w=s.offset)==null?void 0:w[p])||0)-(x?m.crossAxis:0);g<E?g=E:g>P&&(g=P)}return{[v]:h,[p]:g}}}},ci=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=Z(e,t),f=await me(t,u),p=Q(o),v=pe(o),h=Y(o)==="y",{width:g,height:d}=i.floating;let m,y;p==="top"||p==="bottom"?(m=p,y=v===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=p,m=v==="end"?"top":"bottom");const w=d-f.top-f.bottom,b=g-f.left-f.right,x=te(d-f[m],w),E=te(g-f[y],b),P=!t.middlewareData.shift;let R=x,S=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=w),P&&!v){const T=$(f.left,0),k=$(f.right,0),I=$(f.top,0),L=$(f.bottom,0);h?S=g-2*(T!==0||k!==0?T+k:$(f.left,f.right)):R=d-2*(I!==0||L!==0?I+L:$(f.top,f.bottom))}await l({...t,availableWidth:S,availableHeight:R});const D=await s.getDimensions(a.floating);return g!==D.width||d!==D.height?{reset:{rects:!0}}:{}}}};function $e(){return typeof window<"u"}function he(e){return Dn(e)?(e.nodeName||"").toLowerCase():"#document"}function B(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){var t;return(t=(Dn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Dn(e){return $e()?e instanceof Node||e instanceof B(e).Node:!1}function H(e){return $e()?e instanceof Element||e instanceof B(e).Element:!1}function G(e){return $e()?e instanceof HTMLElement||e instanceof B(e).HTMLElement:!1}function zt(e){return!$e()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof B(e).ShadowRoot}const li=new Set(["inline","contents"]);function xe(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=V(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!li.has(o)}const ui=new Set(["table","td","th"]);function fi(e){return ui.has(he(e))}const di=[":popover-open",":modal"];function Be(e){return di.some(t=>{try{return e.matches(t)}catch{return!1}})}const pi=["transform","translate","scale","rotate","perspective"],hi=["transform","translate","scale","rotate","perspective","filter"],vi=["paint","layout","strict","content"];function mt(e){const t=gt(),n=H(e)?V(e):e;return pi.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||hi.some(r=>(n.willChange||"").includes(r))||vi.some(r=>(n.contain||"").includes(r))}function mi(e){let t=ne(e);for(;G(t)&&!fe(t);){if(mt(t))return t;if(Be(t))return null;t=ne(t)}return null}function gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gi=new Set(["html","body","#document"]);function fe(e){return gi.has(he(e))}function V(e){return B(e).getComputedStyle(e)}function He(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ne(e){if(he(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zt(e)&&e.host||q(e);return zt(t)?t.host:t}function Ln(e){const t=ne(e);return fe(t)?e.ownerDocument?e.ownerDocument.body:e.body:G(t)&&xe(t)?t:Ln(t)}function ge(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ln(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=B(o);if(i){const a=ot(s);return t.concat(s,s.visualViewport||[],xe(o)?o:[],a&&n?ge(a):[])}return t.concat(o,ge(o,[],n))}function ot(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nn(e){const t=V(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=G(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=_e(n)!==i||_e(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function yt(e){return H(e)?e:e.contextElement}function le(e){const t=yt(e);if(!G(t))return X(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Nn(t);let s=(i?_e(n.width):n.width)/r,a=(i?_e(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const yi=X(0);function Mn(e){const t=B(e);return!gt()||!t.visualViewport?yi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==B(e)?!1:t}function oe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=yt(e);let s=X(1);t&&(r?H(r)&&(s=le(r)):s=le(e));const a=wi(i,n,r)?Mn(i):X(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,f=o.width/s.x,p=o.height/s.y;if(i){const v=B(i),h=r&&H(r)?B(r):r;let g=v,d=ot(g);for(;d&&r&&h!==g;){const m=le(d),y=d.getBoundingClientRect(),w=V(d),b=y.left+(d.clientLeft+parseFloat(w.paddingLeft))*m.x,x=y.top+(d.clientTop+parseFloat(w.paddingTop))*m.y;l*=m.x,u*=m.y,f*=m.x,p*=m.y,l+=b,u+=x,g=B(d),d=ot(g)}}return Ie({width:f,height:p,x:l,y:u})}function wt(e,t){const n=He(e).scrollLeft;return t?t.left+n:oe(q(e)).left+n}function _n(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:wt(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function xi(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=q(r),a=t?Be(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=X(1);const f=X(0),p=G(r);if((p||!p&&!i)&&((he(r)!=="body"||xe(s))&&(l=He(r)),G(r))){const h=oe(r);u=le(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const v=s&&!p&&!i?_n(s,l,!0):X(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+v.x,y:n.y*u.y-l.scrollTop*u.y+f.y+v.y}}function bi(e){return Array.from(e.getClientRects())}function Ei(e){const t=q(e),n=He(e),r=e.ownerDocument.body,o=$(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=$(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+wt(e);const a=-n.scrollTop;return V(r).direction==="rtl"&&(s+=$(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Ci(e,t){const n=B(e),r=q(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=gt();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}const Ri=new Set(["absolute","fixed"]);function Pi(e,t){const n=oe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=G(e)?le(e):X(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function Ut(e,t,n){let r;if(t==="viewport")r=Ci(e,n);else if(t==="document")r=Ei(q(e));else if(H(t))r=Pi(t,n);else{const o=Mn(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ie(r)}function kn(e,t){const n=ne(e);return n===t||!H(n)||fe(n)?!1:V(n).position==="fixed"||kn(n,t)}function Ai(e,t){const n=t.get(e);if(n)return n;let r=ge(e,[],!1).filter(a=>H(a)&&he(a)!=="body"),o=null;const i=V(e).position==="fixed";let s=i?ne(e):e;for(;H(s)&&!fe(s);){const a=V(s),l=mt(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&Ri.has(o.position)||xe(s)&&!l&&kn(e,s))?r=r.filter(f=>f!==s):o=a,s=ne(s)}return t.set(e,r),r}function Si(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Be(t)?[]:Ai(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const p=Ut(t,f,o);return u.top=$(p.top,u.top),u.right=te(p.right,u.right),u.bottom=te(p.bottom,u.bottom),u.left=$(p.left,u.left),u},Ut(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ti(e){const{width:t,height:n}=Nn(e);return{width:t,height:n}}function Oi(e,t,n){const r=G(t),o=q(t),i=n==="fixed",s=oe(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=X(0);function u(){l.x=wt(o)}if(r||!r&&!i)if((he(t)!=="body"||xe(o))&&(a=He(t)),r){const h=oe(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&u();i&&!r&&o&&u();const f=o&&!r&&!i?_n(o,a):X(0),p=s.left+a.scrollLeft-l.x-f.x,v=s.top+a.scrollTop-l.y-f.y;return{x:p,y:v,width:s.width,height:s.height}}function Qe(e){return V(e).position==="static"}function Yt(e,t){if(!G(e)||V(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function In(e,t){const n=B(e);if(Be(e))return n;if(!G(e)){let o=ne(e);for(;o&&!fe(o);){if(H(o)&&!Qe(o))return o;o=ne(o)}return n}let r=Yt(e,t);for(;r&&fi(r)&&Qe(r);)r=Yt(r,t);return r&&fe(r)&&Qe(r)&&!mt(r)?n:r||mi(e)||n}const Di=async function(e){const t=this.getOffsetParent||In,n=this.getDimensions,r=await n(e.floating);return{reference:Oi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Li(e){return V(e).direction==="rtl"}const Ni={convertOffsetParentRelativeRectToViewportRelativeRect:xi,getDocumentElement:q,getClippingRect:Si,getOffsetParent:In,getElementRects:Di,getClientRects:bi,getDimensions:Ti,getScale:le,isElement:H,isRTL:Li};function Fn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mi(e,t){let n=null,r;const o=q(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:f,top:p,width:v,height:h}=u;if(a||t(),!v||!h)return;const g=Se(p),d=Se(o.clientWidth-(f+v)),m=Se(o.clientHeight-(p+h)),y=Se(f),b={rootMargin:-g+"px "+-d+"px "+-m+"px "+-y+"px",threshold:$(0,te(1,l))||1};let x=!0;function E(P){const R=P[0].intersectionRatio;if(R!==l){if(!x)return s();R?s(!1,R):r=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!Fn(u,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return s(!0),i}function _i(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=yt(e),f=o||i?[...u?ge(u):[],...ge(t)]:[];f.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const p=u&&a?Mi(u,n):null;let v=-1,h=null;s&&(h=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,d=l?oe(e):null;l&&m();function m(){const y=oe(e);d&&!Fn(d,y)&&n(),d=y,g=requestAnimationFrame(m)}return n(),()=>{var y;f.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),p?.(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const ki=ii,Ii=si,Fi=ni,ji=ci,Wi=ri,Xt=ti,$i=ai,Bi=(e,t,n)=>{const r=new Map,o={platform:Ni,...n},i={...o.platform,_c:r};return ei(e,t,{...o,platform:i})};var Hi=typeof document<"u",Vi=function(){},Le=Hi?c.useLayoutEffect:Vi;function Fe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fe(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Fe(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function jn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gt(e,t){const n=jn(e);return Math.round(t*n)/n}function Je(e){const t=c.useRef(e);return Le(()=>{t.current=e}),t}function zi(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,p]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,h]=c.useState(r);Fe(v,r)||h(r);const[g,d]=c.useState(null),[m,y]=c.useState(null),w=c.useCallback(A=>{A!==P.current&&(P.current=A,d(A))},[]),b=c.useCallback(A=>{A!==R.current&&(R.current=A,y(A))},[]),x=i||g,E=s||m,P=c.useRef(null),R=c.useRef(null),S=c.useRef(f),D=l!=null,T=Je(l),k=Je(o),I=Je(u),L=c.useCallback(()=>{if(!P.current||!R.current)return;const A={placement:t,strategy:n,middleware:v};k.current&&(A.platform=k.current),Bi(P.current,R.current,A).then(_=>{const U={..._,isPositioned:I.current!==!1};O.current&&!Fe(S.current,U)&&(S.current=U,Cr.flushSync(()=>{p(U)}))})},[v,t,n,k,I]);Le(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,p(A=>({...A,isPositioned:!1})))},[u]);const O=c.useRef(!1);Le(()=>(O.current=!0,()=>{O.current=!1}),[]),Le(()=>{if(x&&(P.current=x),E&&(R.current=E),x&&E){if(T.current)return T.current(x,E,L);L()}},[x,E,L,T,D]);const W=c.useMemo(()=>({reference:P,floating:R,setReference:w,setFloating:b}),[w,b]),N=c.useMemo(()=>({reference:x,floating:E}),[x,E]),M=c.useMemo(()=>{const A={position:n,left:0,top:0};if(!N.floating)return A;const _=Gt(N.floating,f.x),U=Gt(N.floating,f.y);return a?{...A,transform:"translate("+_+"px, "+U+"px)",...jn(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:U}},[n,a,N.floating,f.x,f.y]);return c.useMemo(()=>({...f,update:L,refs:W,elements:N,floatingStyles:M}),[f,L,W,N,M])}const Ui=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Xt({element:r.current,padding:o}).fn(n):{}:r?Xt({element:r,padding:o}).fn(n):{}}}},Yi=(e,t)=>({...ki(e),options:[e,t]}),Xi=(e,t)=>({...Ii(e),options:[e,t]}),Gi=(e,t)=>({...$i(e),options:[e,t]}),Ki=(e,t)=>({...Fi(e),options:[e,t]}),qi=(e,t)=>({...ji(e),options:[e,t]}),Zi=(e,t)=>({...Wi(e),options:[e,t]}),Qi=(e,t)=>({...Ui(e),options:[e,t]});var Ji="Arrow",Wn=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return C.jsx(F.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:C.jsx("polygon",{points:"0,0 30,0 15,10"})})});Wn.displayName=Ji;var es=Wn,xt="Popper",[$n,Bn]=at(xt),[ts,Hn]=$n(xt),Vn=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return C.jsx(ts,{scope:t,anchor:r,onAnchorChange:o,children:n})};Vn.displayName=xt;var zn="PopperAnchor",Un=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Hn(zn,n),s=c.useRef(null),a=K(t,s);return c.useEffect(()=>{i.onAnchorChange(r?.current||s.current)}),r?null:C.jsx(F.div,{...o,ref:a})});Un.displayName=zn;var bt="PopperContent",[ns,rs]=$n(bt),Yn=c.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:h="optimized",onPlaced:g,...d}=e,m=Hn(bt,n),[y,w]=c.useState(null),b=K(t,ve=>w(ve)),[x,E]=c.useState(null),P=yr(x),R=P?.width??0,S=P?.height??0,D=r+(i!=="center"?"-"+i:""),T=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(u)?u:[u],I=k.length>0,L={padding:T,boundary:k.filter(is),altBoundary:I},{refs:O,floatingStyles:W,placement:N,isPositioned:M,middlewareData:A}=zi({strategy:"fixed",placement:D,whileElementsMounted:(...ve)=>_i(...ve,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[Yi({mainAxis:o+S,alignmentAxis:s}),l&&Xi({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Gi():void 0,...L}),l&&Ki({...L}),qi({...L,apply:({elements:ve,rects:Pt,availableWidth:fr,availableHeight:dr})=>{const{width:pr,height:hr}=Pt.reference,Ee=ve.floating.style;Ee.setProperty("--radix-popper-available-width",`${fr}px`),Ee.setProperty("--radix-popper-available-height",`${dr}px`),Ee.setProperty("--radix-popper-anchor-width",`${pr}px`),Ee.setProperty("--radix-popper-anchor-height",`${hr}px`)}}),x&&Qi({element:x,padding:a}),ss({arrowWidth:R,arrowHeight:S}),v&&Zi({strategy:"referenceHidden",...L})]}),[_,U]=Kn(N),Rt=ue(g);Ne(()=>{M&&Rt?.()},[M,Rt]);const sr=A.arrow?.x,ar=A.arrow?.y,cr=A.arrow?.centerOffset!==0,[lr,ur]=c.useState();return Ne(()=>{y&&ur(window.getComputedStyle(y).zIndex)},[y]),C.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:M?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:lr,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:C.jsx(ns,{scope:n,placedSide:_,onArrowChange:E,arrowX:sr,arrowY:ar,shouldHideArrow:cr,children:C.jsx(F.div,{"data-side":_,"data-align":U,...d,ref:b,style:{...d.style,animation:M?void 0:"none"}})})})});Yn.displayName=bt;var Xn="PopperArrow",os={top:"bottom",right:"left",bottom:"top",left:"right"},Gn=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=rs(Xn,r),s=os[i.placedSide];return C.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:C.jsx(es,{...o,ref:n,style:{...o.style,display:"block"}})})});Gn.displayName=Xn;function is(e){return e!==null}var ss=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,f]=Kn(n),p={start:"0%",center:"50%",end:"100%"}[f],v=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+l/2;let g="",d="";return u==="bottom"?(g=s?p:`${v}px`,d=`${-l}px`):u==="top"?(g=s?p:`${v}px`,d=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,d=s?p:`${h}px`):u==="left"&&(g=`${r.floating.width+l}px`,d=s?p:`${h}px`),{data:{x:g,y:d}}}});function Kn(e){const[t,n="center"]=e.split("-");return[t,n]}var as=Vn,cs=Un,ls=Yn,us=Gn,fs=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ds="VisuallyHidden",qn=c.forwardRef((e,t)=>C.jsx(F.span,{...e,ref:t,style:{...fs,...e.style}}));qn.displayName=ds;var ps=qn,[Ve,Gs]=at("Tooltip",[Bn]),ze=Bn(),Zn="TooltipProvider",hs=700,it="tooltip.open",[vs,Et]=Ve(Zn),Qn=e=>{const{__scopeTooltip:t,delayDuration:n=hs,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=c.useRef(!0),a=c.useRef(!1),l=c.useRef(0);return c.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),C.jsx(vs,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:c.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:c.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:c.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};Qn.displayName=Zn;var ye="Tooltip",[ms,be]=Ve(ye),Jn=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Et(ye,e.__scopeTooltip),u=ze(t),[f,p]=c.useState(null),v=Te(),h=c.useRef(0),g=s??l.disableHoverableContent,d=a??l.delayDuration,m=c.useRef(!1),[y,w]=qt({prop:r,defaultProp:o??!1,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(it))):l.onClose(),i?.(R)},caller:ye}),b=c.useMemo(()=>y?m.current?"delayed-open":"instant-open":"closed",[y]),x=c.useCallback(()=>{window.clearTimeout(h.current),h.current=0,m.current=!1,w(!0)},[w]),E=c.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),P=c.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{m.current=!0,w(!0),h.current=0},d)},[d,w]);return c.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),C.jsx(as,{...u,children:C.jsx(ms,{scope:t,contentId:v,open:y,stateAttribute:b,trigger:f,onTriggerChange:p,onTriggerEnter:c.useCallback(()=>{l.isOpenDelayedRef.current?P():x()},[l.isOpenDelayedRef,P,x]),onTriggerLeave:c.useCallback(()=>{g?E():(window.clearTimeout(h.current),h.current=0)},[E,g]),onOpen:x,onClose:E,disableHoverableContent:g,children:n})})};Jn.displayName=ye;var st="TooltipTrigger",er=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=be(st,n),i=Et(st,n),s=ze(n),a=c.useRef(null),l=K(t,a,o.onTriggerChange),u=c.useRef(!1),f=c.useRef(!1),p=c.useCallback(()=>u.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),C.jsx(cs,{asChild:!0,...s,children:C.jsx(F.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:j(e.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:j(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:j(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:j(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:j(e.onBlur,o.onClose),onClick:j(e.onClick,o.onClose)})})});er.displayName=st;var Ct="TooltipPortal",[gs,ys]=Ve(Ct,{forceMount:void 0}),tr=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=be(Ct,t);return C.jsx(gs,{scope:t,forceMount:n,children:C.jsx(we,{present:n||i.open,children:C.jsx(lt,{asChild:!0,container:o,children:r})})})};tr.displayName=Ct;var de="TooltipContent",nr=c.forwardRef((e,t)=>{const n=ys(de,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=be(de,e.__scopeTooltip);return C.jsx(we,{present:r||s.open,children:s.disableHoverableContent?C.jsx(rr,{side:o,...i,ref:t}):C.jsx(ws,{side:o,...i,ref:t})})}),ws=c.forwardRef((e,t)=>{const n=be(de,e.__scopeTooltip),r=Et(de,e.__scopeTooltip),o=c.useRef(null),i=K(t,o),[s,a]=c.useState(null),{trigger:l,onClose:u}=n,f=o.current,{onPointerInTransitChange:p}=r,v=c.useCallback(()=>{a(null),p(!1)},[p]),h=c.useCallback((g,d)=>{const m=g.currentTarget,y={x:g.clientX,y:g.clientY},w=Cs(y,m.getBoundingClientRect()),b=Rs(y,w),x=Ps(d.getBoundingClientRect()),E=Ss([...b,...x]);a(E),p(!0)},[p]);return c.useEffect(()=>()=>v(),[v]),c.useEffect(()=>{if(l&&f){const g=m=>h(m,f),d=m=>h(m,l);return l.addEventListener("pointerleave",g),f.addEventListener("pointerleave",d),()=>{l.removeEventListener("pointerleave",g),f.removeEventListener("pointerleave",d)}}},[l,f,h,v]),c.useEffect(()=>{if(s){const g=d=>{const m=d.target,y={x:d.clientX,y:d.clientY},w=l?.contains(m)||f?.contains(m),b=!As(y,s);w?v():b&&(v(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,f,s,u,v]),C.jsx(rr,{...e,ref:i})}),[xs,bs]=Ve(ye,{isInside:!1}),Es=xr("TooltipContent"),rr=c.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=be(de,n),u=ze(n),{onClose:f}=l;return c.useEffect(()=>(document.addEventListener(it,f),()=>document.removeEventListener(it,f)),[f]),c.useEffect(()=>{if(l.trigger){const p=v=>{v.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[l.trigger,f]),C.jsx(ct,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:C.jsxs(ls,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[C.jsx(Es,{children:r}),C.jsx(xs,{scope:n,isInside:!0,children:C.jsx(ps,{id:l.contentId,role:"tooltip",children:o||r})})]})})});nr.displayName=de;var or="TooltipArrow",ir=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ze(n);return bs(or,n).isInside?null:C.jsx(us,{...o,...r,ref:t})});ir.displayName=or;function Cs(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Rs(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ps(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function As(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],u=a.x,f=a.y,p=l.x,v=l.y;f>r!=v>r&&n<(p-u)*(r-f)/(v-f)+u&&(o=!o)}return o}function Ss(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Ts(t)}function Ts(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ks=Qn,qs=Jn,Zs=er,Qs=tr,Js=nr,ea=ir;export{ea as A,Vs as C,Us as D,en as F,Hs as O,Bs as P,Ws as R,zs as T,fs as V,js as W,Is as X,Ys as a,Xs as b,Ks as c,qs as d,Zs as e,Qs as f,Js as g,ks as h,Bn as i,as as j,cs as k,lt as l,us as m,Do as n,ln as o,zr as p,ct as q,ls as r,Fs as s,$s as t,Te as u,ue as v};