@isardsat/editorial-admin 6.18.2 → 6.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/assets/{dashboard-DOB6LY1b.js → dashboard-Dpm8zjXn.js} +1 -1
- package/build/client/assets/dashboard._collection-WrdG5htb.js +1 -0
- package/build/client/assets/dashboard._collection._document-jlBNC0sw.js +1 -0
- package/build/client/assets/dashboard._collection.new-BGBlbXgX.js +1 -0
- package/build/client/assets/dashboard._layout-BVHPyiAo.js +1 -0
- package/build/client/assets/itemForm-D65KUxgZ.js +2 -0
- package/build/client/assets/{manifest-6f70b5eb.js → manifest-a5f7d74e.js} +1 -1
- package/build/client/assets/{markdownEditor-DfaF8kYY.js → markdownEditor-Wu371MZi.js} +2 -2
- package/build/client/assets/{schemas-CsWpUuhN.js → schemas-MhAKMGOb.js} +1 -1
- package/build/client/index.html +1 -1
- package/package.json +2 -2
- package/build/client/assets/dashboard._collection-sb0M--Ej.js +0 -1
- package/build/client/assets/dashboard._collection._document-B29gnD6-.js +0 -1
- package/build/client/assets/dashboard._collection.new-BAgCKtvj.js +0 -1
- package/build/client/assets/dashboard._layout-DF619pFj.js +0 -1
- package/build/client/assets/itemForm-BR_x2kdj.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,a as w,x as C,w as k}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{b as c,m as j,h as H,d as N,n as L,p as M,q as S,t as I}from"./utils-CCKKso3e.js";import{c as v,u as D,T as y,a as A,b as m,d as T,f as p,e as $,g as R,h as V}from"./index-pxU98Is7.js";import{B as G}from"./badge-gLcN3Bjg.js";import"./schemas-
|
|
1
|
+
import{p as e,a as w,x as C,w as k}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{b as c,m as j,h as H,d as N,n as L,p as M,q as S,t as I}from"./utils-CCKKso3e.js";import{c as v,u as D,T as y,a as A,b as m,d as T,f as p,e as $,g as R,h as V}from"./index-pxU98Is7.js";import{B as G}from"./badge-gLcN3Bjg.js";import"./schemas-MhAKMGOb.js";import"./index-CtLWaleL.js";import"./schemas-CPJfa6mm.js";function Q({className:s,...a}){return e.jsx("div",{"data-slot":"skeleton",className:c("bg-accent animate-pulse rounded-md",s),...a})}function b({className:s,title:a,value:i,isLoading:o,...d}){return e.jsxs("div",{className:c("border border-border rounded-xl p-6",s),...d,children:[e.jsx("h3",{className:"text-xs text-muted-foreground",children:a}),o?e.jsx(Q,{className:"h-[2.25rem] w-16"}):e.jsx("p",{className:"text-lg sm:text-3xl font-bold leading-none",children:i})]})}const f=v(),h=[f.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(s){const a=s.getValue();return e.jsx("span",{title:a,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:a})}}),f.accessor("createdAt",{header:"Created",cell(s){return j(new Date(s.getValue()))}}),f.accessor("updatedAt",{header:"Updated",cell(s){return j(new Date(s.getValue()))}})];function z(){const{data:s}=H(),{data:a}=N(),i=w.useMemo(()=>!s||!a?[]:Object.entries(s).reduce((l,[n,r])=>l.concat(Object.values(r).filter(x=>x.isDraft).map(x=>({...x,type:n}))),[]).toSorted((l,n)=>l.updatedAt>n.updatedAt?-1:1).slice(0,6),[s,a]),o=D({data:i,columns:h,getCoreRowModel:V()});return o.getRowCount()===0?null: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:"Drafts"}),e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(y,{children:[e.jsx(A,{children:o.getHeaderGroups().map(d=>e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${h.length}, minmax(200px, 1fr))`},children:d.headers.map(t=>e.jsx(T,{children:t.isPlaceholder?null:p(t.column.columnDef.header,t.getContext())},t.id))},d.id))}),e.jsx($,{children:o.getRowModel().rows.map(d=>e.jsx(C,{to:`/admin/dashboard/${d.original.type}/${d.original.id}`,children:e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${h.length}, minmax(200px, 1fr))`},children:d.getVisibleCells().map(t=>e.jsx(R,{className:c("p-2"),children:p(t.column.columnDef.cell,t.getContext())},t.id))},d.id)},d.original.id))})]})})]})}const u=v(),g=[u.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(s){const a=s.getValue();return e.jsx("span",{title:a,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:a})}}),u.accessor("type",{header:"Type",cell(s){return e.jsx("span",{className:"capitalize",children:s.getValue()})}}),u.accessor("status",{header:"Status",cell(s){const a=s.getValue();return e.jsx(G,{className:c("capitalize",L[a]),children:a})}}),u.accessor("updatedAt",{header:"Updated",cell(s){const a=s.getValue();return a?j(new Date(a)):"-"}})];function O(){const{data:s}=M(),{data:a}=N(),i=w.useMemo(()=>{if(!s||!a)return[];const t=[];for(const[l,n]of Object.entries(s.collections)){for(const r of n.added)t.push({id:r.id,type:l,status:"added",updatedAt:r.updatedAt});for(const r of n.modified)t.push({id:r.id,type:l,status:"modified",updatedAt:r.updatedAt});for(const r of n.deleted)t.push({id:r.id,type:l,status:"deleted",updatedAt:void 0})}for(const[l,n]of Object.entries(s.singles))t.push({id:n.preview?.id||n.production?.id||l,type:l,status:n.status,updatedAt:n.updatedAt});return t.toSorted((l,n)=>l.updatedAt?n.updatedAt?l.updatedAt>n.updatedAt?-1:1:-1:1)},[s,a]),o=D({data:i,columns:g,getCoreRowModel:V()});if(o.getRowCount()===0)return null;const d=t=>{const l=t.original.status==="deleted",n=e.jsx(m,{className:c("grid"),style:{gridTemplateColumns:`repeat(${g.length}, minmax(150px, 1fr))`},children:t.getVisibleCells().map(r=>e.jsx(R,{className:c("p-2"),children:p(r.column.columnDef.cell,r.getContext())},r.id))},t.id);return l?e.jsx("div",{children:n},`${t.original.type}-${t.original.id}`):e.jsx(C,{to:`/admin/dashboard/${t.original.type}/${t.original.id}`,children:n},`${t.original.type}-${t.original.id}`)};return 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:"Unpublished Changes"}),e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(y,{children:[e.jsx(A,{children:o.getHeaderGroups().map(t=>e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${g.length}, minmax(150px, 1fr))`},children:t.headers.map(l=>e.jsx(T,{children:l.isPlaceholder?null:p(l.column.columnDef.header,l.getContext())},l.id))},t.id))}),e.jsx($,{className:"max-h-96 overflow-y-scroll",children:o.getRowModel().rows.map(d)})]})})]})}const K=k(function(){const{data:a,isLoading:i}=S(),{data:o,isLoading:d}=I();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(b,{className:"w-full sm:w-44",title:"Items",value:a,isLoading:i}),e.jsx(b,{className:"w-full sm:w-44",title:"Files",value:o,isLoading:d})]}),e.jsx(O,{}),e.jsx(z,{})]})})});export{K as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,a as h,x as f,R as H,w as E}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{B as O}from"./index-BhARCKRr.js";import{m as M,v as A,h as P,w as U,x as N,b}from"./utils-CCKKso3e.js";import{I as q}from"./input-Bk91TMQj.js";import{c as G,u as Q,T as J,a as K,b as k,d as W,f as C,e as X,g as Y,i as Z,j as ee,h as te}from"./index-pxU98Is7.js";import{A as se,a as ae,b as le,c as re,d as ne,e as ie,f as oe,g as ce,h as de}from"./alert-dialog-CN-uuUVp.js";import{c as d}from"./createLucideIcon-BvSqmaUO.js";import{C as j}from"./calendar-Frbsxn98.js";import{T as me,F as he}from"./trash-UKLAaALv.js";import{E as S}from"./external-link-ERgO2SVI.js";import{C as F}from"./circle-check-C6CxUIig.js";import{a as pe,A as xe}from"./arrow-up-C0I0e1Jt.js";import"./index-CtLWaleL.js";import"./index-DLIEpuwL.js";import"./index-cCny74f5.js";const ue=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],ge=d("arrow-up-down",ue);const fe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],T=d("circle",fe);const je=[["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"}]],v=d("letter-text",je);const we=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],ye=d("list-checks",we);const Ne=[["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"}]],be=d("list",Ne);const ke=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ce=d("plus",ke),ve={boolean:F,date:j,datetime:j,markdown:v,select:be,multiselect:ye,string:v,url:S},u=G(),R=(r,a,n)=>{const i=r.getValue(n),o=a.getValue(n);return!i&&!o?0:i?o?new Date(i).getTime()-new Date(o).getTime():-1:1},D=[u.accessor("id",{header(){return e.jsxs("span",{className:"flex items-center max-w-48",children:[e.jsx(T,{className:"text-gray-500 h-4"})," ID"]})},cell(r){const a=r.getValue();return e.jsx("span",{title:a,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:a})}})],De=[u.accessor("updatedAt",{header(){return e.jsxs("div",{className:"flex items-center max-w-48",children:[e.jsx(j,{className:"text-gray-500 h-4"})," Last updated"]})},sortingFn:R,cell(r){return M(new Date(r.getValue()))}})];function Me({itemType:r}){const{data:a}=A(r),{data:n}=P(),[i,o]=h.useState([]),[_,$]=h.useState([{id:"updatedAt",desc:!0}]),[w]=U(),y=h.useMemo(()=>u.display({id:"actions",header:()=>e.jsx("span",{className:"flex justify-end ml-auto"}),cell(l){return e.jsx("div",{className:"flex gap-2 justify-end",onClick:s=>{s.preventDefault(),s.stopPropagation()},children:e.jsxs(se,{children:[e.jsx(ae,{asChild:!0,children:e.jsxs("button",{className:"hover:text-red-500 p-1 hover:bg-muted rounded-sm",title:"Delete entry",children:[e.jsx(me,{size:16}),e.jsx("span",{className:"sr-only",children:"Delete entry"})]})}),e.jsxs(le,{children:[e.jsxs(re,{children:[e.jsxs(ne,{children:["Delete ",e.jsx("i",{children:l.row.original.id}),"?"]}),e.jsx(ie,{children:"This action cannot be undone. This will permanently delete this object."})]}),e.jsxs(oe,{children:[e.jsx(ce,{className:"cursor-pointer",children:"Cancel"}),e.jsx(de,{className:"bg-red-600 hover:bg-red-700 cursor-pointer",onClick:()=>w({type:r,id:l.row.original.id}),children:"Delete"})]})]})]})})},enableSorting:!1}),[r,w]),g=h.useMemo(()=>{if(!a)return D;const l=Object.entries(a.fields);return[...D,...l.filter(([,s])=>s.showInSummary).map(([s,c])=>u.accessor(m=>m[s],{id:s,sortingFn:c.type==="date"||c.type==="datetime"?R:"alphanumeric",header(){const m=c.isUploadedFile?he:ve[c.type]??H.Fragment;return e.jsxs("div",{className:"flex items-center ",children:[e.jsx(m,{className:"text-gray-500 h-4 flex-shrink-0"}),c.displayName]})},cell(m){const t=m.getValue();switch(c.type){case"boolean":const I=t?F:T;return e.jsx("span",{className:"flex justify-center items-center h-full text-nowrap",children:e.jsx(I,{className:N("mx-auto",t?"text-green-600":"text-gray-300"),size:14})});case"url":return t?e.jsx(f,{to:t,className:"flex items-center w-48 hover:text-blue-500 overflow-hidden text-ellipsis whitespace-nowrap",title:t,children:t}):"--";case"datetime":return t?e.jsx("span",{className:" text-nowrap",title:t,children:new Date(t).toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:void 0})}):"--";case"date":return t?e.jsx("span",{className:"text-nowrap",title:t,children:M(new Date(t))}):"--";case"select":return t?e.jsx("span",{title:t,className:"inline-flex items-center px-2 py-0.5 font-medium max-w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:t}):"--";case"multiselect":if(!t||Array.isArray(t)&&t.length===0)return"--";const x=Array.isArray(t)?t:[t],L=x.join(", ");return e.jsxs("span",{title:L,className:"flex items-center gap-1 w-48 overflow-hidden",children:[x.slice(0,3).map((V,B)=>e.jsx("span",{className:"inline-flex items-center px-0.5 py-0.5 font-medium whitespace-nowrap",children:V},B)),x.length>3&&e.jsxs("span",{className:"text-xs text-gray-500 whitespace-nowrap",children:["+",x.length-3]})]});case"markdown":case"string":return c.isUploadedFile?e.jsxs("span",{title:t,className:"flex items-center w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:[e.jsx(S,{className:"h-4 shrink-0"})," ",t]}):e.jsx("span",{title:t,className:"block w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:t});default:return Array.isArray(t)?t.join(", "):t}}})),...De,y]},[y,a]),z=h.useMemo(()=>n?.[r]?Object.values(n[r]):[],[r,n]),p=Q({data:z,columns:g,getCoreRowModel:te(),onColumnFiltersChange:o,getFilteredRowModel:ee(),onSortingChange:$,getSortedRowModel:Z(),state:{sorting:_,columnFilters:i}});return!a||!n?null:e.jsxs("div",{className:"rounded-sm border overflow-auto",children:[a.filterBy&&Object.entries(a.fields).find(([l])=>l===a.filterBy)&&e.jsx("div",{className:"flex items-center py-2 pl-2 ",children:e.jsx(q,{placeholder:`Filter ${a.filterBy}...`,value:p.getColumn(a.filterBy)?.getFilterValue()??"",onChange:l=>p.getColumn(a.filterBy||"")?.setFilterValue(l.target.value),className:"max-w-sm rounded-sm"})}),e.jsxs(J,{children:[e.jsx(K,{className:"sticky top-0 z-50",children:p.getHeaderGroups().map(l=>e.jsx(k,{className:"grid",style:{gridTemplateColumns:`repeat(${g.length}, minmax(200px, 1fr))`},children:l.headers.map(s=>e.jsx(W,{className:N("bg-background transition-colors",s.column.getCanSort()&&"hover:bg-gray-100 cursor-default"),onClick:()=>{console.log("sorting",s.column.getIsSorted()),s.column.toggleSorting(s.column.getIsSorted()==="asc")},children:e.jsxs("div",{className:"flex items-center w-full overflow-hidden",children:[e.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap",title:s.column.columnDef.header?.toString?.()??"",children:s.isPlaceholder?null:C(s.column.columnDef.header,s.getContext())}),s.column.getCanSort()&&(s.column.getIsSorted()==="asc"?e.jsx(pe,{className:"ml-2 h-4 w-4 text-foreground"}):s.column.getIsSorted()==="desc"?e.jsx(xe,{className:"ml-2 h-4 w-4 text-foreground"}):e.jsx(ge,{className:"ml-2 h-4 w-4 text-gray-400"}))]})},s.id))},l.id))}),e.jsx(X,{children:p.getRowModel().rows.map(l=>e.jsx(f,{to:`/admin/dashboard/${r}/${l.original.id}`,children:e.jsx(k,{className:b("grid",l.original.isDraft&&"bg-orange-50 hover:bg-orange-100"),style:{gridTemplateColumns:`repeat(${g.length}, minmax(200px, 1fr))`},children:l.getVisibleCells().map(s=>e.jsx(Y,{className:b("h-10"),children:C(s.column.columnDef.cell,s.getContext())},s.id))})},l.id))})]})]})}const Pe=E(function({params:a}){const{collectionId:n}=a,{data:i,isFetching:o}=A(n);return o||!i?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:i.displayName,children:i.displayName}),e.jsx(O,{asChild:!0,variant:"default",size:"sm",className:"ml-auto",children:e.jsxs(f,{to:`/admin/dashboard/${n}/new`,children:[e.jsx(Ce,{}),"Create"]})})]}),e.jsx(Me,{itemType:n},n)]})})})});export{Pe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as F,a as c,p as d}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{I as x}from"./itemForm-D65KUxgZ.js";import{v as y,y as I,p as j}from"./utils-CCKKso3e.js";import"./badge-gLcN3Bjg.js";import"./index-CtLWaleL.js";import"./index-BhARCKRr.js";import"./index-DLIEpuwL.js";import"./zod-BFfp0fV9.js";import"./index-CHzEoQKp.js";import"./check-DF0ucE8d.js";import"./createLucideIcon-BvSqmaUO.js";import"./schemas-CPJfa6mm.js";import"./input-Bk91TMQj.js";import"./index-cCny74f5.js";import"./index-B2dzkZu5.js";import"./x-BVtfHpQX.js";import"./alert-dialog-CN-uuUVp.js";import"./schemas-MhAKMGOb.js";import"./index-CZSVchcX.js";import"./loader-circle-BDUbeTTe.js";const H=F(function({params:p}){const{collectionId:t,documentId:e}=p,[l,o]=c.useState(void 0),{data:s,isFetching:u}=y(t),{data:f,isFetching:h}=I({itemType:t,id:e}),{data:i}=j(),g=c.useMemo(()=>{if(!i)return[];const r=i.singles[t];if(r?.changedFields)return o(r.status),r.changedFields;const a=i.collections[t];if(!a)return[];const m=a.modified.find(n=>n.id===e);return m?(o("modified"),m.changedFields):(a.added.find(n=>n.id===e)&&o("added"),[])},[i,t,e]);return!s||(u||h)?null:d.jsx("div",{className:"overflow-auto scrollbar-stable",children:d.jsx("div",{className:"p-4 gap-4",children:d.jsx(x,{itemType:t,fields:s.fields,data:f??void 0,isSingleton:s.singleton,changedFields:g,itemStatus:l},`${t}-${e}`)})})});export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as m,p as t}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{I as e}from"./itemForm-D65KUxgZ.js";import{v as p}from"./utils-CCKKso3e.js";import"./badge-gLcN3Bjg.js";import"./index-CtLWaleL.js";import"./index-BhARCKRr.js";import"./index-DLIEpuwL.js";import"./zod-BFfp0fV9.js";import"./index-CHzEoQKp.js";import"./check-DF0ucE8d.js";import"./createLucideIcon-BvSqmaUO.js";import"./schemas-CPJfa6mm.js";import"./input-Bk91TMQj.js";import"./index-cCny74f5.js";import"./index-B2dzkZu5.js";import"./x-BVtfHpQX.js";import"./alert-dialog-CN-uuUVp.js";import"./schemas-MhAKMGOb.js";import"./index-CZSVchcX.js";import"./loader-circle-BDUbeTTe.js";const b=m(function({params:r}){const{collectionId:i}=r,{data:o}=p(i);return o?t.jsx("div",{className:"overflow-auto",children:t.jsx("div",{className:" p-4 gap-4",children:t.jsx(e,{itemType:i,fields:o.fields,isNew:!0,isSingleton:o.singleton})})}):null});export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,a as r,x as k,y as J,v as be,z as me,R as ge,w as je,O as ve}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{u as we,c as A,d as ye}from"./authSlice-BI_rlf3v.js";import{b as l,d as D,h as Ne,j as Ce,k as Se,l as ke,u as _e}from"./utils-CCKKso3e.js";import{t as y}from"./index-CZSVchcX.js";import{R as ee,C as te,a as ae,T as se,D as ne,P as ie,O as oe,u as Pe}from"./index-cCny74f5.js";import{X as re,C as H}from"./x-BVtfHpQX.js";import{B as O,u as Me,c as Oe,P as I,a as ze,b as Ee,d as Re}from"./index-BhARCKRr.js";import{c as _}from"./createLucideIcon-BvSqmaUO.js";import{S as T,c as Ae,u as De}from"./index-CtLWaleL.js";import{P as Ie}from"./index-CHzEoQKp.js";import{P as Te,R as Le,T as $e,a as Be,C as Ge,A as He}from"./index-B3bJjaCJ.js";import{L as E}from"./loader-circle-BDUbeTTe.js";import{A as Fe,a as Ve}from"./arrow-up-C0I0e1Jt.js";import{U as Ke}from"./upload-DhJ5wU_H.js";import{E as Ue}from"./external-link-ERgO2SVI.js";import{L as qe}from"./Loading-MKgXMPvl.js";import{C as We}from"./chevron-right-BFlMu-RJ.js";import"./index-DLIEpuwL.js";import"./index-B2dzkZu5.js";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"}]],Xe=_("blocks",Qe);const Ze=[["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"}]],Ye=_("files",Ze);const Je=[["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"}]],et=_("grid-3x3",Je);const tt=[["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"}]],at=_("heart",tt);const st=[["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"}]],nt=_("log-out",st);const it=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],ot=_("panel-left",it);const rt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],lt=_("square",rt);function dt({...t}){return e.jsx(ee,{"data-slot":"dialog",...t})}function ct({...t}){return e.jsx(ie,{"data-slot":"dialog-portal",...t})}function ut({className:t,...a}){return e.jsx(oe,{"data-slot":"dialog-overlay",className:l("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 ht({className:t,children:a,...n}){return e.jsxs(ct,{"data-slot":"dialog-portal",children:[e.jsx(ut,{}),e.jsxs(te,{"data-slot":"dialog-content",className:l("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(ae,{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(re,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function pt({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:l("flex flex-col gap-2 text-center sm:text-left",t),...a})}function ft({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function xt({className:t,...a}){return e.jsx(se,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",t),...a})}function bt({className:t,...a}){return e.jsx(ne,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",t),...a})}const mt="#181717",gt=r.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...i},o){return n==="default"&&(n=mt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:o,...i,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"})]})}),jt="#85EA2D",F=r.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...i},o){return n==="default"&&(n=jt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:o,...i,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 vt({isOpen:t,setOpen:a}){return e.jsx(dt,{open:t,onOpenChange:n=>a(n),children:e.jsxs(ht,{children:[e.jsxs(pt,{children:[e.jsx(xt,{children:"Editorial"}),e.jsx(bt,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(O,{asChild:!0,variant:"ghost",children:e.jsxs(k,{to:"https://lobelia-earth.github.io/editorial/",children:[e.jsx(F,{size:14}),"Documentation"]})}),e.jsx(O,{asChild:!0,variant:"ghost",children:e.jsxs(k,{to:"/doc/ui",children:[e.jsx(F,{size:14}),"Swagger API UI"]})}),e.jsx(O,{asChild:!0,variant:"ghost",children:e.jsxs(k,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(gt,{size:14}),"GitHub repository"]})})]}),e.jsx(ft,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(at,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",e.jsx(k,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}var wt="Separator",V="horizontal",yt=["horizontal","vertical"],le=r.forwardRef((t,a)=>{const{decorative:n,orientation:s=V,...i}=t,o=Nt(s)?s:V,c=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return e.jsx(Ie.div,{"data-orientation":o,...c,...i,ref:a})});le.displayName=wt;function Nt(t){return yt.includes(t)}var Ct=le;function de({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(Ct,{"data-slot":"separator-root",decorative:n,orientation:a,className:l("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 St({...t}){return e.jsx(ee,{"data-slot":"sheet",...t})}function kt({...t}){return e.jsx(ie,{"data-slot":"sheet-portal",...t})}function _t({className:t,...a}){return e.jsx(oe,{"data-slot":"sheet-overlay",className:l("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 Pt({className:t,children:a,side:n="right",...s}){return e.jsxs(kt,{children:[e.jsx(_t,{}),e.jsxs(te,{"data-slot":"sheet-content",className:l("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(ae,{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(re,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Mt({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",t),...a})}function Ot({className:t,...a}){return e.jsx(se,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",t),...a})}function zt({className:t,...a}){return e.jsx(ne,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",t),...a})}function ce({delayDuration:t=0,...a}){return e.jsx(Te,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function Et({...t}){return e.jsx(ce,{children:e.jsx(Le,{"data-slot":"tooltip",...t})})}function Rt({...t}){return e.jsx($e,{"data-slot":"tooltip-trigger",...t})}function At({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(Be,{children:e.jsxs(Ge,{"data-slot":"tooltip-content",sideOffset:a,className:l("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(He,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const R=768;function Dt(){const[t,a]=r.useState(void 0);return r.useEffect(()=>{const n=window.matchMedia(`(max-width: ${R-1}px)`),s=()=>{a(window.innerWidth<R)};return n.addEventListener("change",s),a(window.innerWidth<R),()=>n.removeEventListener("change",s)},[]),!!t}const It="sidebar_state",Tt=3600*24*7,Lt="16rem",$t="18rem",Bt="3rem",Gt="b",ue=r.createContext(null);function L(){const t=r.useContext(ue);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Ht({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:i,children:o,...d}){const c=Dt(),[x,h]=r.useState(!1),[g,C]=r.useState(t),m=a??g,f=r.useCallback(p=>{const u=typeof p=="function"?p(m):p;n?n(u):C(u),document.cookie=`${It}=${u}; path=/; max-age=${Tt}`},[n,m]),v=r.useCallback(()=>c?h(p=>!p):f(p=>!p),[c,f,h]);r.useEffect(()=>{const p=u=>{u.key===Gt&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),v())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[v]);const N=m?"expanded":"collapsed",w=r.useMemo(()=>({state:N,open:m,setOpen:f,isMobile:c,openMobile:x,setOpenMobile:h,toggleSidebar:v}),[N,m,f,c,x,h,v]);return e.jsx(ue.Provider,{value:w,children:e.jsx(ce,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Lt,"--sidebar-width-icon":Bt,...i},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...d,children:o})})})}function Ft({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:i,...o}){const{isMobile:d,state:c,openMobile:x,setOpenMobile:h}=L();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:l("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...o,children:i}):d?e.jsx(St,{open:x,onOpenChange:h,...o,children:e.jsxs(Pt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":$t},side:t,children:[e.jsxs(Mt,{className:"sr-only",children:[e.jsx(Ot,{children:"Sidebar"}),e.jsx(zt,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:l("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:l("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),...o,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:i})})]})}function Vt({className:t,onClick:a,...n}){const{toggleSidebar:s}=L();return e.jsxs(O,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:l("size-7",t),onClick:i=>{a?.(i),s()},...n,children:[e.jsx(ot,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Kt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:l("flex flex-col gap-2 p-2",t),...a})}function Ut({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l("flex flex-col gap-2 p-2",t),...a})}function qt({className:t,...a}){return e.jsx(de,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:l("bg-sidebar-border mx-2 w-auto",t),...a})}function Wt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l("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:l("relative flex w-full min-w-0 flex-col p-2",t),...a})}function U({className:t,asChild:a=!1,...n}){const s=a?T:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:l("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 q({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l("w-full text-sm",t),...a})}function W({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l("flex w-full min-w-0 flex-col gap-1",t),...a})}function S({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l("group/menu-item relative",t),...a})}const Qt=Ae("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 j({asChild:t=!1,isActive:a=!1,variant:n="default",size:s="default",tooltip:i,className:o,...d}){const c=t?T:"button",{isMobile:x,state:h}=L(),g=e.jsx(c,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:l(Qt({variant:n,size:s}),o),...d});return i?(typeof i=="string"&&(i={children:i}),e.jsxs(Et,{children:[e.jsx(Rt,{asChild:!0,children:g}),e.jsx(At,{side:"right",align:"center",hidden:h!=="collapsed"||x,...i})]})):g}function Xt({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:l("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 Zt({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...i}){const o=t?T:"a";return e.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:l("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),...i})}function Q({singleton:t}){const{data:a}=D(),{data:n}=Ne();if(!a)return null;const s=r.useMemo(()=>Object.entries(a).filter(([,i])=>t?i.singleton:!i.singleton).toSorted(([i],[o])=>i.localeCompare(o)),[a,t]);return e.jsx(e.Fragment,{children:s.map(([i,o])=>e.jsx(Xt,{children:e.jsx(J,{to:t?`/admin/dashboard/${i}/default`:`/admin/dashboard/${i}`,className:({isActive:d,isPending:c})=>c?"pending":d?"active":"",children:({isActive:d})=>e.jsx(Zt,{isActive:d,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?.[i]&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1 min-w-[25px] text-right",children:Object.keys(n[i]).length})]})})})},o.displayName))})}var z="Collapsible",[Yt]=Oe(z),[Jt,$]=Yt(z),he=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:i,disabled:o,onOpenChange:d,...c}=t,[x,h]=Me({prop:s,defaultProp:i??!1,onChange:d,caller:z});return e.jsx(Jt,{scope:n,disabled:o,contentId:Pe(),open:x,onOpenToggle:r.useCallback(()=>h(g=>!g),[h]),children:e.jsx(I.div,{"data-state":G(x),"data-disabled":o?"":void 0,...c,ref:a})})});he.displayName=z;var pe="CollapsibleTrigger",fe=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,i=$(pe,n);return e.jsx(I.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":G(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:a,onClick:ze(t.onClick,i.onOpenToggle)})});fe.displayName=pe;var B="CollapsibleContent",xe=r.forwardRef((t,a)=>{const{forceMount:n,...s}=t,i=$(B,t.__scopeCollapsible);return e.jsx(Ee,{present:n||i.open,children:({present:o})=>e.jsx(ea,{...s,ref:a,present:o})})});xe.displayName=B;var ea=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:i,...o}=t,d=$(B,n),[c,x]=r.useState(s),h=r.useRef(null),g=De(a,h),C=r.useRef(0),m=C.current,f=r.useRef(0),v=f.current,N=d.open||c,w=r.useRef(N),p=r.useRef(void 0);return r.useEffect(()=>{const u=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(u)},[]),Re(()=>{const u=h.current;if(u){p.current=p.current||{transitionDuration:u.style.transitionDuration,animationName:u.style.animationName},u.style.transitionDuration="0s",u.style.animationName="none";const M=u.getBoundingClientRect();C.current=M.height,f.current=M.width,w.current||(u.style.transitionDuration=p.current.transitionDuration,u.style.animationName=p.current.animationName),x(s)}},[d.open,s]),e.jsx(I.div,{"data-state":G(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!N,...o,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&&i})});function G(t){return t?"open":"closed"}var ta=he;function X({...t}){return e.jsx(ta,{"data-slot":"collapsible",...t})}function Z({...t}){return e.jsx(fe,{"data-slot":"collapsible-trigger",...t})}function Y({...t}){return e.jsx(xe,{"data-slot":"collapsible-content",...t})}function aa(){const t=we(),[a,n]=r.useState(!1),[s]=Ce(),[i]=Se(),[o]=ke(),[d,c]=r.useState(!1),[x,h]=r.useState(!1),[g,C]=r.useState(!1),{data:m}=_e(),{data:f}=D(),v=r.useMemo(()=>f&&!!Object.values(f).find(b=>!b.singleton),[f]),N=r.useMemo(()=>f&&!!Object.values(f).find(b=>b.singleton),[f]),w=A(b=>b.auth.user),p=async b=>{c(!0);try{await s({author:b}).unwrap()?y.success("Content published successfully."):y.error("Publishing failed.")}catch(P){y.error("Publishing failed."),console.error(P)}finally{c(!1)}},u=async()=>{h(!0);try{await i().unwrap()?y.success("Content pulled successfully."):y.error("Pulling content failed.")}catch(b){y.error("Pulling content failed."),console.error(b)}finally{h(!1)}},M=async b=>{C(!0);try{await o(b).unwrap()?y.success("Content pushed successfully."):y.error("Pushing content failed.")}catch(P){y.error("Pushing content failed."),console.error(P)}finally{C(!1)}};return e.jsxs(Ft,{className:"z-50",children:[e.jsx(vt,{isOpen:a,setOpen:n}),e.jsx(Kt,{className:"h-14 justify-center",children:e.jsx(K,{children:e.jsx(k,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:m?.name})})}),e.jsx(Wt,{children:e.jsxs(K,{children:[e.jsx(U,{children:"Content"}),e.jsx(q,{children:e.jsxs(W,{children:[e.jsx(X,{className:"group/collapsible",disabled:!v,children:e.jsxs(S,{children:[e.jsx(Z,{asChild:!0,children:e.jsxs(j,{className:"group",children:[e.jsx(et,{}),e.jsx("span",{children:"Collections"}),e.jsx(H,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(Y,{children:e.jsx(Q,{})})]})}),e.jsx(X,{className:"group/collapsible",disabled:!N,children:e.jsxs(S,{children:[e.jsx(Z,{asChild:!0,children:e.jsxs(j,{className:"group",children:[e.jsx(lt,{}),e.jsx("span",{children:"Singles"}),e.jsx(H,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(Y,{children:e.jsx(Q,{singleton:!0})})]})}),e.jsx(S,{children:e.jsx(j,{asChild:!0,children:e.jsxs(k,{to:"/admin/dashboard/files",children:[e.jsx(Ye,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(S,{children:e.jsxs(j,{disabled:!0,children:[e.jsx(Xe,{}),e.jsx("span",{children:"Components"})]})})]})})]})}),e.jsxs(Ut,{children:[e.jsx(U,{children:"Actions"}),e.jsx(q,{children:e.jsxs(W,{children:[w?.role==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(S,{children:e.jsxs(j,{className:"cursor-pointer",onClick:()=>u(),children:[x?e.jsx(E,{className:"animate-spin"}):e.jsx(Fe,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(S,{children:e.jsxs(j,{className:"cursor-pointer",onClick:()=>M({author:w.email}),children:[g?e.jsx(E,{className:"animate-spin"}):e.jsx(Ve,{}),e.jsx("span",{children:"Push to repo"})]})})]}),w&&e.jsx(S,{children:e.jsxs(j,{className:"cursor-pointer",onClick:()=>{p(w.email)},children:[d?e.jsx(E,{className:"animate-spin"}):e.jsx(Ke,{}),e.jsx("span",{children:"Publish"})]})})]})}),e.jsx(qt,{}),e.jsx(j,{asChild:!0,children:e.jsxs(k,{to:m?.previewUrl,children:["Preview",e.jsx(Ue,{className:"ml-auto"})]})}),e.jsx(j,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(j,{className:"cursor-pointer",onClick:()=>t(ye()),children:[e.jsx(nt,{}),"Log out"]}),e.jsxs("div",{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:"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",children:["Editorial v","6.19.1"]})]})]})}function sa({children:t}){const a=be(),n=A(i=>i.auth.user),s=A(i=>i.auth.isLoading);return r.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?e.jsx(qe,{}):t}function na(){const{pathname:t}=me(),{data:a}=D(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,i,o)=>e.jsxs(ge.Fragment,{children:[o.length>1&&i>=1&&e.jsx(We,{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:[i<o.length-1&&a[s]&&a[s].singleton&&(a[s]?a[s].displayName:s),i<o.length-1&&a[s]&&!a[s].singleton&&e.jsx(J,{to:`/admin/dashboard/${s}`,className:({isActive:d,isPending:c})=>c?"pending":d?"active":"",children:a[s]?a[s].displayName:s}),i===o.length-1&&(a[s]?a[s].displayName:s)]},s)]},i))}):null}const Ca=je(function(){return e.jsx(sa,{children:e.jsxs(Ht,{className:"flex h-full",children:[e.jsx(aa,{}),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(Vt,{}),e.jsx(de,{orientation:"vertical",className:"h-4"}),e.jsx(na,{})]})}),e.jsx(ve,{})]})]})})});export{Ca as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilePicker-CRgpF9yp.js","assets/chunk-EPOLDU6W-CiSVlmCe.js","assets/utils-CCKKso3e.js","assets/files-Cdeyho5X.js","assets/index-CZSVchcX.js","assets/index-DLIEpuwL.js","assets/badge-gLcN3Bjg.js","assets/index-CtLWaleL.js","assets/upload-DhJ5wU_H.js","assets/createLucideIcon-BvSqmaUO.js","assets/trash-UKLAaALv.js","assets/x-BVtfHpQX.js","assets/check-DF0ucE8d.js","assets/index-BhARCKRr.js","assets/input-Bk91TMQj.js","assets/external-link-ERgO2SVI.js","assets/markdownEditor-Wu371MZi.js","assets/authSlice-BI_rlf3v.js","assets/index-cCny74f5.js","assets/zod-BFfp0fV9.js","assets/index-CHzEoQKp.js","assets/schemas-CPJfa6mm.js","assets/index-B0u0hYGX.js","assets/index-B2dzkZu5.js","assets/index-B3bJjaCJ.js","assets/alert-dialog-CN-uuUVp.js","assets/schemas-MhAKMGOb.js","assets/loader-circle-BDUbeTTe.js","assets/markdownEditor-Dha_UaaS.css","assets/date-picker-Dgbvfw_1.js","assets/clear-button-D05R9Y5Y.js","assets/chevron-right-BFlMu-RJ.js","assets/calendar-Frbsxn98.js","assets/datetime-picker-De7vM6e7.js","assets/URLInput-CPrLDhlu.js","assets/ColorPicker-kqchGTe4.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{R as k,p as e,a as d,A as _t,v as Tt,z as Pt}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{B as Rt}from"./badge-gLcN3Bjg.js";import{c as Xe,e as Pe,u as Ue,P as B,a as M,d as Z,B as We}from"./index-BhARCKRr.js";import{g as Dt,u as Mt,a as At,F as Ot,b as me,c as he,d as le,e as fe,f as xe,C as Ke,h as Ee}from"./zod-BFfp0fV9.js";import{I as _e}from"./input-Bk91TMQj.js";import{a as Ze}from"./index-DLIEpuwL.js";import{u as $}from"./index-CtLWaleL.js";import{u as ze,b as Lt,c as Ft,h as kt,d as Vt,e as Bt,F as Ht,f as zt}from"./index-cCny74f5.js";import{c as Qe,R as $t,V as Ut,A as Wt,C as Kt,a as qt}from"./index-B2dzkZu5.js";import{b as V,z as Gt,A as Yt,h as Xt,n as Zt}from"./utils-CCKKso3e.js";import{C as Je,X as Re}from"./x-BVtfHpQX.js";import{C as Qt}from"./check-DF0ucE8d.js";import{c as et}from"./createLucideIcon-BvSqmaUO.js";import{A as Jt,b as eo,c as to,d as oo,e as no,f as so,g as ro,h as ao}from"./alert-dialog-CN-uuUVp.js";import{R as co}from"./schemas-MhAKMGOb.js";import{t as ie}from"./index-CZSVchcX.js";import{L as lo}from"./loader-circle-BDUbeTTe.js";import{s as z,_ as qe,u as io,n as uo,l as po,o as mo,a as ho}from"./schemas-CPJfa6mm.js";const fo=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],xo=et("chevron-up",fo);const go=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],vo=et("save",go);function Te(o){if(!o||o.length!==1)return null;const t=o[0].match(/^\$(.+)$/);return t?t[1]:null}const So="modulepreload",Co=function(o){return"/"+o},Ge={},re=function(t,n,p){let m=Promise.resolve();if(n&&n.length>0){let f=function(x){return Promise.all(x.map(S=>Promise.resolve(S).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=s?.nonce||s?.getAttribute("nonce");m=f(n.map(x=>{if(x=Co(x),x in Ge)return;Ge[x]=!0;const S=x.endsWith(".css"),y=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${y}`))return;const b=document.createElement("link");if(b.rel=S?"stylesheet":So,S||(b.as="script"),b.crossOrigin="",b.href=x,i&&b.setAttribute("nonce",i),document.head.appendChild(b),S)return new Promise((I,E)=>{b.addEventListener("load",I),b.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${x}`)))})}))}function h(s){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=s,window.dispatchEvent(i),!i.defaultPrevented)throw s}return m.then(s=>{for(const i of s||[])i.status==="rejected"&&h(i.reason);return t().catch(h)})};function Ye(o,[t,n]){return Math.min(n,Math.max(t,o))}function wo(o){const t=o+"CollectionProvider",[n,p]=Xe(t),[m,h]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=a=>{const{scope:v,children:N}=a,g=k.useRef(null),C=k.useRef(new Map).current;return e.jsx(m,{scope:v,itemMap:C,collectionRef:g,children:N})};s.displayName=t;const i=o+"CollectionSlot",f=Pe(i),x=k.forwardRef((a,v)=>{const{scope:N,children:g}=a,C=h(i,N),P=$(v,C.collectionRef);return e.jsx(f,{ref:P,children:g})});x.displayName=i;const S=o+"CollectionItemSlot",y="data-radix-collection-item",b=Pe(S),I=k.forwardRef((a,v)=>{const{scope:N,children:g,...C}=a,P=k.useRef(null),c=$(v,P),r=h(S,N);return k.useEffect(()=>(r.itemMap.set(P,{ref:P,...C}),()=>{r.itemMap.delete(P)})),e.jsx(b,{[y]:"",ref:c,children:g})});I.displayName=S;function E(a){const v=h(o+"CollectionConsumer",a);return k.useCallback(()=>{const g=v.collectionRef.current;if(!g)return[];const C=Array.from(g.querySelectorAll(`[${y}]`));return Array.from(v.itemMap.values()).sort((r,l)=>C.indexOf(r.ref.current)-C.indexOf(l.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:x,ItemSlot:I},E,p]}var yo=d.createContext(void 0);function bo(o){const t=d.useContext(yo);return o||t||"ltr"}var jo=[" ","Enter","ArrowUp","ArrowDown"],No=[" ","Enter"],oe="Select",[ve,Se,Io]=wo(oe),[ae]=Xe(oe,[Io,Qe]),Ce=Qe(),[Eo,Q]=ae(oe),[_o,To]=ae(oe),tt=o=>{const{__scopeSelect:t,children:n,open:p,defaultOpen:m,onOpenChange:h,value:s,defaultValue:i,onValueChange:f,dir:x,name:S,autoComplete:y,disabled:b,required:I,form:E}=o,a=Ce(t),[v,N]=d.useState(null),[g,C]=d.useState(null),[P,c]=d.useState(!1),r=bo(x),[l,u]=Ue({prop:p,defaultProp:m??!1,onChange:h,caller:oe}),[O,H]=Ue({prop:s,defaultProp:i,onChange:f,caller:oe}),j=d.useRef(null),A=v?E||!!v.closest("form"):!0,[W,q]=d.useState(new Set),G=Array.from(W).map(L=>L.props.value).join(";");return e.jsx($t,{...a,children:e.jsxs(Eo,{required:I,scope:t,trigger:v,onTriggerChange:N,valueNode:g,onValueNodeChange:C,valueNodeHasChildren:P,onValueNodeHasChildrenChange:c,contentId:ze(),value:O,onValueChange:H,open:l,onOpenChange:u,dir:r,triggerPointerDownPosRef:j,disabled:b,children:[e.jsx(ve.Provider,{scope:t,children:e.jsx(_o,{scope:o.__scopeSelect,onNativeOptionAdd:d.useCallback(L=>{q(K=>new Set(K).add(L))},[]),onNativeOptionRemove:d.useCallback(L=>{q(K=>{const Y=new Set(K);return Y.delete(L),Y})},[]),children:n})}),A?e.jsxs(jt,{"aria-hidden":!0,required:I,tabIndex:-1,name:S,autoComplete:y,value:O,onChange:L=>H(L.target.value),disabled:b,form:E,children:[O===void 0?e.jsx("option",{value:""}):null,Array.from(W)]},G):null]})})};tt.displayName=oe;var ot="SelectTrigger",nt=d.forwardRef((o,t)=>{const{__scopeSelect:n,disabled:p=!1,...m}=o,h=Ce(n),s=Q(ot,n),i=s.disabled||p,f=$(t,s.onTriggerChange),x=Se(n),S=d.useRef("touch"),[y,b,I]=It(a=>{const v=x().filter(C=>!C.disabled),N=v.find(C=>C.value===s.value),g=Et(v,a,N);g!==void 0&&s.onValueChange(g.value)}),E=a=>{i||(s.onOpenChange(!0),I()),a&&(s.triggerPointerDownPosRef.current={x:Math.round(a.pageX),y:Math.round(a.pageY)})};return e.jsx(Wt,{asChild:!0,...h,children:e.jsx(B.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Nt(s.value)?"":void 0,...m,ref:f,onClick:M(m.onClick,a=>{a.currentTarget.focus(),S.current!=="mouse"&&E(a)}),onPointerDown:M(m.onPointerDown,a=>{S.current=a.pointerType;const v=a.target;v.hasPointerCapture(a.pointerId)&&v.releasePointerCapture(a.pointerId),a.button===0&&a.ctrlKey===!1&&a.pointerType==="mouse"&&(E(a),a.preventDefault())}),onKeyDown:M(m.onKeyDown,a=>{const v=y.current!=="";!(a.ctrlKey||a.altKey||a.metaKey)&&a.key.length===1&&b(a.key),!(v&&a.key===" ")&&jo.includes(a.key)&&(E(),a.preventDefault())})})})});nt.displayName=ot;var st="SelectValue",rt=d.forwardRef((o,t)=>{const{__scopeSelect:n,className:p,style:m,children:h,placeholder:s="",...i}=o,f=Q(st,n),{onValueNodeHasChildrenChange:x}=f,S=h!==void 0,y=$(t,f.onValueNodeChange);return Z(()=>{x(S)},[x,S]),e.jsx(B.span,{...i,ref:y,style:{pointerEvents:"none"},children:Nt(f.value)?e.jsx(e.Fragment,{children:s}):h})});rt.displayName=st;var Po="SelectIcon",at=d.forwardRef((o,t)=>{const{__scopeSelect:n,children:p,...m}=o;return e.jsx(B.span,{"aria-hidden":!0,...m,ref:t,children:p||"▼"})});at.displayName=Po;var Ro="SelectPortal",ct=o=>e.jsx(Lt,{asChild:!0,...o});ct.displayName=Ro;var ne="SelectContent",lt=d.forwardRef((o,t)=>{const n=Q(ne,o.__scopeSelect),[p,m]=d.useState();if(Z(()=>{m(new DocumentFragment)},[]),!n.open){const h=p;return h?Ze.createPortal(e.jsx(it,{scope:o.__scopeSelect,children:e.jsx(ve.Slot,{scope:o.__scopeSelect,children:e.jsx("div",{children:o.children})})}),h):null}return e.jsx(dt,{...o,ref:t})});lt.displayName=ne;var U=10,[it,J]=ae(ne),Do="SelectContentImpl",Mo=Pe("SelectContent.RemoveScroll"),dt=d.forwardRef((o,t)=>{const{__scopeSelect:n,position:p="item-aligned",onCloseAutoFocus:m,onEscapeKeyDown:h,onPointerDownOutside:s,side:i,sideOffset:f,align:x,alignOffset:S,arrowPadding:y,collisionBoundary:b,collisionPadding:I,sticky:E,hideWhenDetached:a,avoidCollisions:v,...N}=o,g=Q(ne,n),[C,P]=d.useState(null),[c,r]=d.useState(null),l=$(t,w=>P(w)),[u,O]=d.useState(null),[H,j]=d.useState(null),A=Se(n),[W,q]=d.useState(!1),G=d.useRef(!1);d.useEffect(()=>{if(C)return kt(C)},[C]),Vt();const L=d.useCallback(w=>{const[R,...F]=A().map(D=>D.ref.current),[_]=F.slice(-1),T=document.activeElement;for(const D of w)if(D===T||(D?.scrollIntoView({block:"nearest"}),D===R&&c&&(c.scrollTop=0),D===_&&c&&(c.scrollTop=c.scrollHeight),D?.focus(),document.activeElement!==T))return},[A,c]),K=d.useCallback(()=>L([u,C]),[L,u,C]);d.useEffect(()=>{W&&K()},[W,K]);const{onOpenChange:Y,triggerPointerDownPosRef:X}=g;d.useEffect(()=>{if(C){let w={x:0,y:0};const R=_=>{w={x:Math.abs(Math.round(_.pageX)-(X.current?.x??0)),y:Math.abs(Math.round(_.pageY)-(X.current?.y??0))}},F=_=>{w.x<=10&&w.y<=10?_.preventDefault():C.contains(_.target)||Y(!1),document.removeEventListener("pointermove",R),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",R),document.addEventListener("pointerup",F,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",F,{capture:!0})}}},[C,Y,X]),d.useEffect(()=>{const w=()=>Y(!1);return window.addEventListener("blur",w),window.addEventListener("resize",w),()=>{window.removeEventListener("blur",w),window.removeEventListener("resize",w)}},[Y]);const[we,ue]=It(w=>{const R=A().filter(T=>!T.disabled),F=R.find(T=>T.ref.current===document.activeElement),_=Et(R,w,F);_&&setTimeout(()=>_.ref.current.focus())}),ye=d.useCallback((w,R,F)=>{const _=!G.current&&!F;(g.value!==void 0&&g.value===R||_)&&(O(w),_&&(G.current=!0))},[g.value]),be=d.useCallback(()=>C?.focus(),[C]),se=d.useCallback((w,R,F)=>{const _=!G.current&&!F;(g.value!==void 0&&g.value===R||_)&&j(w)},[g.value]),pe=p==="popper"?De:ut,ce=pe===De?{side:i,sideOffset:f,align:x,alignOffset:S,arrowPadding:y,collisionBoundary:b,collisionPadding:I,sticky:E,hideWhenDetached:a,avoidCollisions:v}:{};return e.jsx(it,{scope:n,content:C,viewport:c,onViewportChange:r,itemRefCallback:ye,selectedItem:u,onItemLeave:be,itemTextRefCallback:se,focusSelectedItem:K,selectedItemText:H,position:p,isPositioned:W,searchRef:we,children:e.jsx(Bt,{as:Mo,allowPinchZoom:!0,children:e.jsx(Ht,{asChild:!0,trapped:g.open,onMountAutoFocus:w=>{w.preventDefault()},onUnmountAutoFocus:M(m,w=>{g.trigger?.focus({preventScroll:!0}),w.preventDefault()}),children:e.jsx(zt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:s,onFocusOutside:w=>w.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:e.jsx(pe,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:w=>w.preventDefault(),...N,...ce,onPlaced:()=>q(!0),ref:l,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:M(N.onKeyDown,w=>{const R=w.ctrlKey||w.altKey||w.metaKey;if(w.key==="Tab"&&w.preventDefault(),!R&&w.key.length===1&&ue(w.key),["ArrowUp","ArrowDown","Home","End"].includes(w.key)){let _=A().filter(T=>!T.disabled).map(T=>T.ref.current);if(["ArrowUp","End"].includes(w.key)&&(_=_.slice().reverse()),["ArrowUp","ArrowDown"].includes(w.key)){const T=w.target,D=_.indexOf(T);_=_.slice(D+1)}setTimeout(()=>L(_)),w.preventDefault()}})})})})})})});dt.displayName=Do;var Ao="SelectItemAlignedPosition",ut=d.forwardRef((o,t)=>{const{__scopeSelect:n,onPlaced:p,...m}=o,h=Q(ne,n),s=J(ne,n),[i,f]=d.useState(null),[x,S]=d.useState(null),y=$(t,l=>S(l)),b=Se(n),I=d.useRef(!1),E=d.useRef(!0),{viewport:a,selectedItem:v,selectedItemText:N,focusSelectedItem:g}=s,C=d.useCallback(()=>{if(h.trigger&&h.valueNode&&i&&x&&a&&v&&N){const l=h.trigger.getBoundingClientRect(),u=x.getBoundingClientRect(),O=h.valueNode.getBoundingClientRect(),H=N.getBoundingClientRect();if(h.dir!=="rtl"){const T=H.left-u.left,D=O.left-T,ee=l.left-D,te=l.width+ee,je=Math.max(te,u.width),Ne=window.innerWidth-U,Ie=Ye(D,[U,Math.max(U,Ne-je)]);i.style.minWidth=te+"px",i.style.left=Ie+"px"}else{const T=u.right-H.right,D=window.innerWidth-O.right-T,ee=window.innerWidth-l.right-D,te=l.width+ee,je=Math.max(te,u.width),Ne=window.innerWidth-U,Ie=Ye(D,[U,Math.max(U,Ne-je)]);i.style.minWidth=te+"px",i.style.right=Ie+"px"}const j=b(),A=window.innerHeight-U*2,W=a.scrollHeight,q=window.getComputedStyle(x),G=parseInt(q.borderTopWidth,10),L=parseInt(q.paddingTop,10),K=parseInt(q.borderBottomWidth,10),Y=parseInt(q.paddingBottom,10),X=G+L+W+Y+K,we=Math.min(v.offsetHeight*5,X),ue=window.getComputedStyle(a),ye=parseInt(ue.paddingTop,10),be=parseInt(ue.paddingBottom,10),se=l.top+l.height/2-U,pe=A-se,ce=v.offsetHeight/2,w=v.offsetTop+ce,R=G+L+w,F=X-R;if(R<=se){const T=j.length>0&&v===j[j.length-1].ref.current;i.style.bottom="0px";const D=x.clientHeight-a.offsetTop-a.offsetHeight,ee=Math.max(pe,ce+(T?be:0)+D+K),te=R+ee;i.style.height=te+"px"}else{const T=j.length>0&&v===j[0].ref.current;i.style.top="0px";const ee=Math.max(se,G+a.offsetTop+(T?ye:0)+ce)+F;i.style.height=ee+"px",a.scrollTop=R-se+a.offsetTop}i.style.margin=`${U}px 0`,i.style.minHeight=we+"px",i.style.maxHeight=A+"px",p?.(),requestAnimationFrame(()=>I.current=!0)}},[b,h.trigger,h.valueNode,i,x,a,v,N,h.dir,p]);Z(()=>C(),[C]);const[P,c]=d.useState();Z(()=>{x&&c(window.getComputedStyle(x).zIndex)},[x]);const r=d.useCallback(l=>{l&&E.current===!0&&(C(),g?.(),E.current=!1)},[C,g]);return e.jsx(Lo,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:I,onScrollButtonChange:r,children:e.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:e.jsx(B.div,{...m,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...m.style}})})})});ut.displayName=Ao;var Oo="SelectPopperPosition",De=d.forwardRef((o,t)=>{const{__scopeSelect:n,align:p="start",collisionPadding:m=U,...h}=o,s=Ce(n);return e.jsx(Kt,{...s,...h,ref:t,align:p,collisionPadding:m,style:{boxSizing:"border-box",...h.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});De.displayName=Oo;var[Lo,$e]=ae(ne,{}),Me="SelectViewport",pt=d.forwardRef((o,t)=>{const{__scopeSelect:n,nonce:p,...m}=o,h=J(Me,n),s=$e(Me,n),i=$(t,h.onViewportChange),f=d.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:p}),e.jsx(ve.Slot,{scope:n,children:e.jsx(B.div,{"data-radix-select-viewport":"",role:"presentation",...m,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...m.style},onScroll:M(m.onScroll,x=>{const S=x.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:b}=s;if(b?.current&&y){const I=Math.abs(f.current-S.scrollTop);if(I>0){const E=window.innerHeight-U*2,a=parseFloat(y.style.minHeight),v=parseFloat(y.style.height),N=Math.max(a,v);if(N<E){const g=N+I,C=Math.min(E,g),P=g-C;y.style.height=C+"px",y.style.bottom==="0px"&&(S.scrollTop=P>0?P:0,y.style.justifyContent="flex-end")}}}f.current=S.scrollTop})})})]})});pt.displayName=Me;var mt="SelectGroup",[Fo,ko]=ae(mt),Vo=d.forwardRef((o,t)=>{const{__scopeSelect:n,...p}=o,m=ze();return e.jsx(Fo,{scope:n,id:m,children:e.jsx(B.div,{role:"group","aria-labelledby":m,...p,ref:t})})});Vo.displayName=mt;var ht="SelectLabel",Bo=d.forwardRef((o,t)=>{const{__scopeSelect:n,...p}=o,m=ko(ht,n);return e.jsx(B.div,{id:m.id,...p,ref:t})});Bo.displayName=ht;var ge="SelectItem",[Ho,ft]=ae(ge),xt=d.forwardRef((o,t)=>{const{__scopeSelect:n,value:p,disabled:m=!1,textValue:h,...s}=o,i=Q(ge,n),f=J(ge,n),x=i.value===p,[S,y]=d.useState(h??""),[b,I]=d.useState(!1),E=$(t,g=>f.itemRefCallback?.(g,p,m)),a=ze(),v=d.useRef("touch"),N=()=>{m||(i.onValueChange(p),i.onOpenChange(!1))};if(p==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(Ho,{scope:n,value:p,disabled:m,textId:a,isSelected:x,onItemTextChange:d.useCallback(g=>{y(C=>C||(g?.textContent??"").trim())},[]),children:e.jsx(ve.ItemSlot,{scope:n,value:p,disabled:m,textValue:S,children:e.jsx(B.div,{role:"option","aria-labelledby":a,"data-highlighted":b?"":void 0,"aria-selected":x&&b,"data-state":x?"checked":"unchecked","aria-disabled":m||void 0,"data-disabled":m?"":void 0,tabIndex:m?void 0:-1,...s,ref:E,onFocus:M(s.onFocus,()=>I(!0)),onBlur:M(s.onBlur,()=>I(!1)),onClick:M(s.onClick,()=>{v.current!=="mouse"&&N()}),onPointerUp:M(s.onPointerUp,()=>{v.current==="mouse"&&N()}),onPointerDown:M(s.onPointerDown,g=>{v.current=g.pointerType}),onPointerMove:M(s.onPointerMove,g=>{v.current=g.pointerType,m?f.onItemLeave?.():v.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:M(s.onPointerLeave,g=>{g.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:M(s.onKeyDown,g=>{f.searchRef?.current!==""&&g.key===" "||(No.includes(g.key)&&N(),g.key===" "&&g.preventDefault())})})})})});xt.displayName=ge;var de="SelectItemText",gt=d.forwardRef((o,t)=>{const{__scopeSelect:n,className:p,style:m,...h}=o,s=Q(de,n),i=J(de,n),f=ft(de,n),x=To(de,n),[S,y]=d.useState(null),b=$(t,N=>y(N),f.onItemTextChange,N=>i.itemTextRefCallback?.(N,f.value,f.disabled)),I=S?.textContent,E=d.useMemo(()=>e.jsx("option",{value:f.value,disabled:f.disabled,children:I},f.value),[f.disabled,f.value,I]),{onNativeOptionAdd:a,onNativeOptionRemove:v}=x;return Z(()=>(a(E),()=>v(E)),[a,v,E]),e.jsxs(e.Fragment,{children:[e.jsx(B.span,{id:f.textId,...h,ref:b}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ze.createPortal(h.children,s.valueNode):null]})});gt.displayName=de;var vt="SelectItemIndicator",St=d.forwardRef((o,t)=>{const{__scopeSelect:n,...p}=o;return ft(vt,n).isSelected?e.jsx(B.span,{"aria-hidden":!0,...p,ref:t}):null});St.displayName=vt;var Ae="SelectScrollUpButton",Ct=d.forwardRef((o,t)=>{const n=J(Ae,o.__scopeSelect),p=$e(Ae,o.__scopeSelect),[m,h]=d.useState(!1),s=$(t,p.onScrollButtonChange);return Z(()=>{if(n.viewport&&n.isPositioned){let i=function(){const x=f.scrollTop>0;h(x)};const f=n.viewport;return i(),f.addEventListener("scroll",i),()=>f.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),m?e.jsx(yt,{...o,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:f}=n;i&&f&&(i.scrollTop=i.scrollTop-f.offsetHeight)}}):null});Ct.displayName=Ae;var Oe="SelectScrollDownButton",wt=d.forwardRef((o,t)=>{const n=J(Oe,o.__scopeSelect),p=$e(Oe,o.__scopeSelect),[m,h]=d.useState(!1),s=$(t,p.onScrollButtonChange);return Z(()=>{if(n.viewport&&n.isPositioned){let i=function(){const x=f.scrollHeight-f.clientHeight,S=Math.ceil(f.scrollTop)<x;h(S)};const f=n.viewport;return i(),f.addEventListener("scroll",i),()=>f.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),m?e.jsx(yt,{...o,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:f}=n;i&&f&&(i.scrollTop=i.scrollTop+f.offsetHeight)}}):null});wt.displayName=Oe;var yt=d.forwardRef((o,t)=>{const{__scopeSelect:n,onAutoScroll:p,...m}=o,h=J("SelectScrollButton",n),s=d.useRef(null),i=Se(n),f=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>f(),[f]),Z(()=>{i().find(S=>S.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),e.jsx(B.div,{"aria-hidden":!0,...m,ref:t,style:{flexShrink:0,...m.style},onPointerDown:M(m.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(p,50))}),onPointerMove:M(m.onPointerMove,()=>{h.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(p,50))}),onPointerLeave:M(m.onPointerLeave,()=>{f()})})}),zo="SelectSeparator",bt=d.forwardRef((o,t)=>{const{__scopeSelect:n,...p}=o;return e.jsx(B.div,{"aria-hidden":!0,...p,ref:t})});bt.displayName=zo;var Le="SelectArrow",$o=d.forwardRef((o,t)=>{const{__scopeSelect:n,...p}=o,m=Ce(n),h=Q(Le,n),s=J(Le,n);return h.open&&s.position==="popper"?e.jsx(qt,{...m,...p,ref:t}):null});$o.displayName=Le;var Uo="SelectBubbleInput",jt=d.forwardRef(({__scopeSelect:o,value:t,...n},p)=>{const m=d.useRef(null),h=$(p,m),s=Dt(t);return d.useEffect(()=>{const i=m.current;if(!i)return;const f=window.HTMLSelectElement.prototype,S=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==t&&S){const y=new Event("change",{bubbles:!0});S.call(i,t),i.dispatchEvent(y)}},[s,t]),e.jsx(B.select,{...n,style:{...Ut,...n.style},ref:h,defaultValue:t})});jt.displayName=Uo;function Nt(o){return o===""||o===void 0}function It(o){const t=Ft(o),n=d.useRef(""),p=d.useRef(0),m=d.useCallback(s=>{const i=n.current+s;t(i),(function f(x){n.current=x,window.clearTimeout(p.current),x!==""&&(p.current=window.setTimeout(()=>f(""),1e3))})(i)},[t]),h=d.useCallback(()=>{n.current="",window.clearTimeout(p.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(p.current),[]),[n,m,h]}function Et(o,t,n){const m=t.length>1&&Array.from(t).every(x=>x===t[0])?t[0]:t,h=n?o.indexOf(n):-1;let s=Wo(o,Math.max(h,0));m.length===1&&(s=s.filter(x=>x!==n));const f=s.find(x=>x.textValue.toLowerCase().startsWith(m.toLowerCase()));return f!==n?f:void 0}function Wo(o,t){return o.map((n,p)=>o[(t+p)%o.length])}var Ko=tt,qo=nt,Go=rt,Yo=at,Xo=ct,Zo=lt,Qo=pt,Jo=xt,en=gt,tn=St,on=Ct,nn=wt,Mn=bt;function Fe({...o}){return e.jsx(Ko,{"data-slot":"select",...o})}function ke({...o}){return e.jsx(Go,{"data-slot":"select-value",...o})}function Ve({className:o,size:t="default",children:n,...p}){return e.jsxs(qo,{"data-slot":"select-trigger","data-size":t,className:V("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),...p,children:[n,e.jsx(Yo,{asChild:!0,children:e.jsx(Je,{className:"size-4 opacity-50"})})]})}function Be({className:o,children:t,position:n="popper",...p}){return e.jsx(Xo,{children:e.jsxs(Zo,{"data-slot":"select-content",className:V("bg-popover text-popover-foreground 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 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o),position:n,...p,children:[e.jsx(sn,{}),e.jsx(Qo,{className:V("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),e.jsx(rn,{})]})})}function He({className:o,children:t,...n}){return e.jsxs(Jo,{"data-slot":"select-item",className:V("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),...n,children:[e.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(tn,{children:e.jsx(Qt,{className:"size-4"})})}),e.jsx(en,{children:t})]})}function sn({className:o,...t}){return e.jsx(on,{"data-slot":"select-scroll-up-button",className:V("flex cursor-default items-center justify-center py-1",o),...t,children:e.jsx(xo,{className:"size-4"})})}function rn({className:o,...t}){return e.jsx(nn,{"data-slot":"select-scroll-down-button",className:V("flex cursor-default items-center justify-center py-1",o),...t,children:e.jsx(Je,{className:"size-4"})})}function an({hasUnsavedChanges:o,title:t="Unsaved Changes",description:n="You have unsaved changes. Are you sure you want to leave this page? Your changes will be lost.",stayButtonText:p="Stay on Page",leaveButtonText:m="Leave Page"}){const h=_t(({currentLocation:S,nextLocation:y})=>o&&S.pathname!==y.pathname),[s,i]=d.useState(!1),f=()=>{h.state==="blocked"&&h.proceed()},x=()=>{h.state==="blocked"&&h.reset()};return d.useEffect(()=>{i(h.state==="blocked")},[h.state,s]),d.useEffect(()=>{const S=y=>{o&&(y.preventDefault(),y.returnValue="")};return o&&window.addEventListener("beforeunload",S),()=>{window.removeEventListener("beforeunload",S)}},[o]),e.jsx(Jt,{open:s,onOpenChange:i,children:e.jsxs(eo,{children:[e.jsxs(to,{children:[e.jsx(oo,{children:t}),e.jsx(no,{children:n})]}),e.jsxs(so,{children:[e.jsx(ro,{onClick:x,children:p}),e.jsx(ao,{onClick:f,children:m})]})]})})}const cn=({field:o,value:t,resolvedChoices:n,key:p,hasMinMax:m})=>{const h=o.value?String(o.value).split(",").map(s=>s.trim()).filter(Boolean):[];return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-wrap gap-2 min-h-[38px] p-2 border rounded-md bg-background",children:h.length>0?h.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-sm font-medium bg-gray-100 text-black-800",children:[s,e.jsxs("button",{type:"button",onClick:()=>{const i=h.filter(f=>f!==s);o.onChange(i.join(","))},className:"hover:bg-gray-200 rounded-sm p-0.5",children:[e.jsx(Re,{size:14}),e.jsxs("span",{className:"sr-only",children:["Remove ",s]})]})]},s)):e.jsx("span",{className:"text-muted-foreground text-sm",children:t.placeholder??"Select items..."})}),(!t.maxSelectedChoices||h.length<t.maxSelectedChoices)&&e.jsxs(Fe,{value:"",onValueChange:s=>{const i=h;i.includes(s)||o.onChange([...i,s].join(","))},children:[e.jsx(Ve,{id:p,className:"w-full",children:e.jsx(ke,{placeholder:"Add item..."})}),e.jsx(Be,{children:n.filter(s=>!h.includes(s)).map(s=>e.jsx(He,{value:s,children:s},s))})]}),m&&e.jsxs("span",{className:V("text-xs",t.minSelectedChoices&&h.length<t.minSelectedChoices?"text-destructive":"text-muted-foreground"),children:[h.length,t.minSelectedChoices&&t.maxSelectedChoices?`/${t.maxSelectedChoices} (min ${t.minSelectedChoices})`:t.minSelectedChoices?` selected (min ${t.minSelectedChoices})`:`/${t.maxSelectedChoices} selected`]})]})},ln=k.lazy(()=>re(()=>import("./FilePicker-CRgpF9yp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))),dn=k.lazy(()=>re(()=>import("./markdownEditor-Wu371MZi.js"),__vite__mapDeps([16,1,17,2,5,18,13,7,19,20,12,9,21,22,23,24,6,14,11,25,26,4,27,28]))),un=k.lazy(()=>re(()=>import("./date-picker-Dgbvfw_1.js"),__vite__mapDeps([29,1,13,7,2,5,30,9,31,11,22,18,23,20,32]))),pn=k.lazy(()=>re(()=>import("./datetime-picker-De7vM6e7.js"),__vite__mapDeps([33,1,13,7,2,5,30,9,31,11,22,18,23,20,14,32]))),mn=k.lazy(()=>re(()=>import("./URLInput-CPrLDhlu.js"),__vite__mapDeps([34,1,14,2,15,9]))),hn=k.lazy(()=>re(()=>import("./ColorPicker-kqchGTe4.js"),__vite__mapDeps([35,1])));function An({itemType:o,fields:t,isSingleton:n,data:p,isNew:m,changedFields:h=[],itemStatus:s}){const i=Tt(),{hash:f}=Pt(),[x]=Gt(),[S]=Yt(),{data:y}=Xt(),b=c=>h.includes(c);d.useEffect(()=>{if(!f)return;const c=f.slice(1),r=document.getElementById(c);r&&(window.scrollTo({top:window.scrollY,behavior:"smooth"}),r.focus())},[f]);const I=d.useMemo(()=>({id:n?"default":p?.id??"",isDraft:String(p?.isDraft??!1),...Object.fromEntries(Object.keys(t).map(c=>{const r=t[c].type,l=p?.[c];return l!=null?r==="boolean"?[c,String(l)]:r==="multiselect"?[c,Array.isArray(l)?l:[l]]:[c,String(l)]:r==="boolean"?[c,"false"]:r==="multiselect"?[c,[]]:[c,""]}))}),[p,t,n]),E=d.useMemo(()=>{const c={id:z().min(1,"ID is required").regex(/^[a-z0-9-]+$/,"ID can only include lowercase letters and numbers"),isDraft:z()};return Object.entries(t).forEach(([r,l])=>{let u;switch(l.type){case"boolean":u=qe(["true","false"]);break;case"number":u=uo();break;case"url":u=io("Must be a valid URL");break;case"date":u=z();break;case"datetime":u=z();break;case"color":u=co;break;case"select":Te(l.choicesFixed)?u=z():l.choicesFixed&&l.choicesFixed.length>0?u=qe(l.choicesFixed):u=z();break;case"multiselect":u=ho(z()),l.minSelectedChoices&&(u=u.min(l.minSelectedChoices,`${l.displayName} requires at least ${l.minSelectedChoices} selection${l.minSelectedChoices>1?"s":""}`)),l.maxSelectedChoices&&(u=u.max(l.maxSelectedChoices,`${l.displayName} allows maximum ${l.maxSelectedChoices} selection${l.maxSelectedChoices>1?"s":""}`));break;case"string":l.isMultiple?Te(l.choicesFixed)?u=z():l.choicesFixed&&l.choicesFixed.length>0?u=z():u=z():u=z();break;default:u=z()}l.optional?l.type==="multiselect"?l.minSelectedChoices||(u=u.optional()):u=u.optional().or(po("")):l.type==="multiselect"&&!l.minSelectedChoices?u=u.min(1,`${l.displayName} requires at least one selection`):l.type!=="boolean"&&l.type!=="select"&&!(l.type==="string"&&l.isMultiple&&l.choicesFixed)&&(u=u.min(1,`${l.displayName} is required`)),c[r]=u}),mo(c)},[t]),a=Mt({resolver:At(E),defaultValues:I});d.useEffect(()=>{a.reset(I)},[I,a]),d.useEffect(()=>{if(!a)return;const c=window.location.hash;c&&a.setFocus(c.substring(1))},[a]),d.useEffect(()=>{const c=r=>{(r.ctrlKey||r.metaKey)&&r.key==="s"&&(r.preventDefault(),(a.formState.isDirty||m)&&a.handleSubmit(v)())};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[a,m,v]);async function v(c){const r={...c,isDraft:c.isDraft==="true",type:o};if(Object.entries(t).forEach(([l,u])=>{u.type==="boolean"&&(r[l]=c[l]==="true")}),m)try{const l=await x(r);"error"in l?ie.error("Failed to create item."):(ie.success("Item created successfully."),i(`/admin/dashboard/${o}/${l.data.id}`))}catch(l){ie.error("Failed to create item."),console.error(l)}else try{await S(r),ie.success("Item updated successfully."),a.reset(c)}catch(l){ie.error("Failed to update item."),console.error(l)}}const N=d.useMemo(()=>Object.entries(t).filter(([,c])=>c.type==="boolean"),[t]),g=d.useMemo(()=>{const c={};return Object.entries(t).forEach(([r,l])=>{if(l.type==="select"||l.type==="multiselect"||l.type==="string"&&l.isMultiple&&l.choicesFixed){const u=Te(l.choicesFixed);if(u&&y){const O=y[u];O?c[r]=Object.values(O).map(H=>H.id):c[r]=[]}else c[r]=l.choicesFixed||[]}}),c},[t,y]),C="outline outline-1 outline-yellow-400 outline-offset-4 rounded-sm",P=()=>e.jsx("span",{className:"text-yellow-800 text-xs",children:"(modified)"});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[p&&p.updatedAt&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Last updated:"}),e.jsx("p",{className:"text-sm",children:new Date(p.updatedAt).toLocaleString()})]}),s&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Unpublished status:"}),e.jsx(Rt,{className:V("capitalize",Zt[s]),children:s})]})]}),e.jsxs(Ot,{...a,children:[e.jsxs("form",{onSubmit:a.handleSubmit(v),className:"space-y-4 max-w-[800px] w-[800px]",children:[e.jsx(me,{name:"id",control:a.control,rules:{required:!0},render:({field:c})=>e.jsxs(he,{id:"id",className:V((p?.id==="default"||n)&&"hidden",b("id")&&C),children:[e.jsxs(le,{className:"flex gap-1 items-baseline",children:["ID",b("id")&&e.jsx(P,{})]}),e.jsx(fe,{children:e.jsx(_e,{placeholder:"item-id",...a.register("id"),...c,value:c.value,onChange:r=>{const l=r.target.value.toLowerCase().replace(/\s+/g,"-").replace(/-+/g,"-").replace(/[^a-z0-9-]/g,"");c.onChange(l)},onBlur:r=>{const l=r.target.value.trim().replace(/^-+|-+$/g,"");c.onChange(l)}})}),e.jsx(xe,{})]})}),e.jsx(me,{name:"isDraft",control:a.control,render:({field:c})=>e.jsxs(he,{id:"isDraft",className:V("flex flex-col items-start",(p?.id==="default"||n)&&"hidden",b("isDraft")&&C),children:[e.jsxs("div",{className:"flex flex-row space-x-2",children:[e.jsx(fe,{children:e.jsx(Ke,{id:"isDraft",...a.register("isDraft"),checked:c.value==="true",onCheckedChange:r=>{c.onChange(r===!0?"true":"false")}})}),e.jsxs(le,{className:"flex gap-1 items-baseline",children:["Draft",b("isDraft")&&e.jsx("span",{className:"text-yellow-600 text-xs",children:e.jsx(P,{})})]})]}),e.jsx(Ee,{children:"Draft items are not visible on the published site"}),e.jsx(xe,{})]})}),N.length>0&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(le,{children:"Flags"}),e.jsx("div",{className:"flex flex-row flex-wrap gap-4",children:N.map(([c,r])=>e.jsx(me,{name:c,control:a.control,render:({field:l})=>e.jsxs(he,{className:V("flex flex-col items-start",b(c)&&C),children:[e.jsxs("div",{className:"flex flex-row space-x-2",children:[e.jsx(fe,{children:e.jsx(Ke,{id:c,...a.register(c),checked:l.value==="true",onCheckedChange:u=>{l.onChange(u===!0?"true":"false")}})}),e.jsxs(le,{className:"flex gap-1 items-baseline",children:[r.displayName,b(c)&&e.jsx("span",{className:"text-yellow-800 text-xs",children:e.jsx(P,{})})]})]}),r.displayExtra&&e.jsx(Ee,{children:r.displayExtra}),e.jsx(xe,{})]})},c))})]}),Object.entries(t).filter(([,c])=>c.type!=="boolean").map(([c,r])=>{const l=g[c]??[];return e.jsx(me,{name:c,control:a.control,rules:{required:!r.optional},render:({field:u})=>{const O=u.value?.length??0,H=(r.type==="multiselect"||r.type==="string"&&r.isMultiple&&r.choicesFixed)&&(r.minSelectedChoices||r.maxSelectedChoices);return e.jsxs(he,{id:c,className:V(b(c)&&C),children:[e.jsxs(le,{className:"flex gap-1 items-baseline",children:[r.displayName,r.optional&&e.jsx("span",{className:"text-gray-400",children:"(optional)"}),b(c)&&e.jsx("span",{className:"text-yellow-600 text-xs",children:e.jsx(P,{})})]}),e.jsx(fe,{children:r.type==="markdown"?e.jsx(dn,{id:c,name:c,register:a.register,className:"h-52",markdown:u.value,onChange:(j,A)=>{A||u.onChange(j)},placeholder:r.placeholder,fieldDisplayName:r.displayName}):r.type==="url"?e.jsx(mn,{id:c,...a.register(c),placeholder:r.placeholder??"https://example.website/",...u,value:u.value}):r.type==="string"&&r.isUploadedFile?e.jsx(ln,{id:c,name:c,register:a.register,value:u.value,onChange:u.onChange}):r.type==="date"?e.jsx(un,{id:c,...a.register(c),date:u.value?new Date(u.value):void 0,onDateChange:j=>{u.onChange(j?j.toISOString():"")},placeholder:r.placeholder??"Select date",allowClear:r.optional}):r.type==="datetime"?e.jsx("div",{className:"relative",children:e.jsx(pn,{id:c,...a.register(c),date:u.value?new Date(u.value):void 0,onDateTimeChange:j=>{u.onChange(j?j.toISOString():"")},placeholder:r.placeholder??"Select date and time",allowClear:r.optional})}):r.type==="color"?e.jsx(hn,{id:c,value:u.value,onChange:u.onChange,placeholder:r.placeholder}):r.type==="number"?e.jsx(_e,{id:c,...a.register(c,{valueAsNumber:!0}),type:"number",value:u.value,onChange:u.onChange,placeholder:r.placeholder}):r.type==="select"?e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Fe,{value:u.value,onValueChange:u.onChange,children:[e.jsx(Ve,{id:c,className:"w-full",children:e.jsx(ke,{placeholder:r.placeholder??"Select an item..."})}),e.jsx(Be,{children:l.map(j=>e.jsx(He,{value:j,children:j},j))})]}),r.optional&&u.value&&e.jsxs(We,{type:"button",variant:"outline",size:"icon",onClick:()=>u.onChange(""),className:"shrink-0",children:[e.jsx(Re,{size:16}),e.jsx("span",{className:"sr-only",children:"Clear selection"})]})]}):r.type==="multiselect"?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-wrap gap-2 min-h-[38px] p-2 border rounded-md bg-background",children:u.value?.length>0?u.value.map(j=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-sm font-medium bg-gray-100 text-black-800",children:[j,e.jsxs("button",{type:"button",onClick:()=>{const A=u.value.filter(W=>W!==j);u.onChange(A)},className:"hover:bg-gray-200 rounded-sm p-0.5",children:[e.jsx(Re,{size:14}),e.jsxs("span",{className:"sr-only",children:["Remove ",j]})]})]},j)):e.jsx("span",{className:"text-muted-foreground text-sm",children:r.placeholder??"Select items..."})}),(!r.maxSelectedChoices||O<r.maxSelectedChoices)&&e.jsxs(Fe,{value:"",onValueChange:j=>{const A=u.value||[];A.includes(j)||u.onChange([...A,j])},children:[e.jsx(Ve,{id:c,className:"w-full",children:e.jsx(ke,{placeholder:"Add item..."})}),e.jsx(Be,{children:l.filter(j=>!u.value?.includes(j)).map(j=>e.jsx(He,{value:j,children:j},j))})]}),H&&e.jsxs("span",{className:V("text-xs",r.minSelectedChoices&&O<r.minSelectedChoices?"text-destructive":"text-muted-foreground"),children:[O,r.minSelectedChoices&&r.maxSelectedChoices?`/${r.maxSelectedChoices} (min ${r.minSelectedChoices})`:r.minSelectedChoices?` selected (min ${r.minSelectedChoices})`:`/${r.maxSelectedChoices} selected`]})]}):r.type==="string"&&r.isMultiple&&r.choicesFixed?e.jsx(cn,{field:u,resolvedChoices:l,value:r,hasMinMax:H},c):e.jsx(_e,{id:c,...a.register(c),placeholder:r.placeholder,...u,value:u.value})}),r.displayExtra&&e.jsx(Ee,{children:r.displayExtra}),e.jsx(xe,{})]})}},c)}),e.jsxs(We,{disabled:!a.formState.isDirty&&!m||a.formState.isSubmitting,type:"submit",children:[a.formState.isSubmitting?e.jsx(lo,{className:"animate-spin"}):e.jsx(vo,{}),a.formState.isSubmitting?"Saving":a.watch("isDraft")==="true"?"Save Draft":"Save"]})]}),e.jsx(an,{hasUnsavedChanges:!a.formState.isSubmitting&&a.formState.isDirty})]})]})}export{Zo as C,An as I,Xo as P,Ko as R,Mn as S,qo as T,Go as V,Yo as a,Qo as b,wo as c,Jo as d,en as e,bo as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-C94uvdU2.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/index-DLIEpuwL.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":true,"module":"/assets/root-CLpfMQQt.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/index-DLIEpuwL.js","/assets/index-CZSVchcX.js","/assets/loader-circle-BDUbeTTe.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/circle-check-C6CxUIig.js","/assets/utils-CCKKso3e.js","/assets/authSlice-BI_rlf3v.js","/assets/Loading-MKgXMPvl.js"],"css":["/assets/root-D5WeoLDH.css"]},"routes/home":{"id":"routes/home","parentId":"root","path":"/admin","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/home-DChaVk_H.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/Loading-MKgXMPvl.js","/assets/index-BhARCKRr.js","/assets/zod-BFfp0fV9.js","/assets/input-Bk91TMQj.js","/assets/authSlice-BI_rlf3v.js","/assets/schemas-CPJfa6mm.js","/assets/utils-CCKKso3e.js","/assets/loader-circle-BDUbeTTe.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/index-CtLWaleL.js","/assets/index-DLIEpuwL.js","/assets/index-CHzEoQKp.js","/assets/check-DF0ucE8d.js"],"css":[]},"routes/dashboard._layout":{"id":"routes/dashboard._layout","parentId":"root","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._layout-
|
|
1
|
+
window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-C94uvdU2.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/index-DLIEpuwL.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":true,"module":"/assets/root-CLpfMQQt.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/index-DLIEpuwL.js","/assets/index-CZSVchcX.js","/assets/loader-circle-BDUbeTTe.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/circle-check-C6CxUIig.js","/assets/utils-CCKKso3e.js","/assets/authSlice-BI_rlf3v.js","/assets/Loading-MKgXMPvl.js"],"css":["/assets/root-D5WeoLDH.css"]},"routes/home":{"id":"routes/home","parentId":"root","path":"/admin","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/home-DChaVk_H.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/Loading-MKgXMPvl.js","/assets/index-BhARCKRr.js","/assets/zod-BFfp0fV9.js","/assets/input-Bk91TMQj.js","/assets/authSlice-BI_rlf3v.js","/assets/schemas-CPJfa6mm.js","/assets/utils-CCKKso3e.js","/assets/loader-circle-BDUbeTTe.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/index-CtLWaleL.js","/assets/index-DLIEpuwL.js","/assets/index-CHzEoQKp.js","/assets/check-DF0ucE8d.js"],"css":[]},"routes/dashboard._layout":{"id":"routes/dashboard._layout","parentId":"root","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._layout-BVHPyiAo.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/authSlice-BI_rlf3v.js","/assets/utils-CCKKso3e.js","/assets/index-CZSVchcX.js","/assets/index-cCny74f5.js","/assets/x-BVtfHpQX.js","/assets/index-BhARCKRr.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/index-CtLWaleL.js","/assets/index-CHzEoQKp.js","/assets/index-B3bJjaCJ.js","/assets/loader-circle-BDUbeTTe.js","/assets/arrow-up-C0I0e1Jt.js","/assets/upload-DhJ5wU_H.js","/assets/external-link-ERgO2SVI.js","/assets/Loading-MKgXMPvl.js","/assets/chevron-right-BFlMu-RJ.js","/assets/index-DLIEpuwL.js","/assets/index-B2dzkZu5.js"],"css":[]},"routes/dashboard":{"id":"routes/dashboard","parentId":"routes/dashboard._layout","path":"/admin/dashboard","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard-Dpm8zjXn.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/utils-CCKKso3e.js","/assets/index-pxU98Is7.js","/assets/badge-gLcN3Bjg.js","/assets/schemas-MhAKMGOb.js","/assets/index-CtLWaleL.js","/assets/schemas-CPJfa6mm.js"],"css":[]},"routes/dashboard.$collection.new":{"id":"routes/dashboard.$collection.new","parentId":"routes/dashboard._layout","path":"/admin/dashboard/:collectionId/new","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._collection.new-BGBlbXgX.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/itemForm-D65KUxgZ.js","/assets/utils-CCKKso3e.js","/assets/badge-gLcN3Bjg.js","/assets/index-CtLWaleL.js","/assets/index-BhARCKRr.js","/assets/index-DLIEpuwL.js","/assets/zod-BFfp0fV9.js","/assets/index-CHzEoQKp.js","/assets/check-DF0ucE8d.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/schemas-CPJfa6mm.js","/assets/input-Bk91TMQj.js","/assets/index-cCny74f5.js","/assets/index-B2dzkZu5.js","/assets/x-BVtfHpQX.js","/assets/alert-dialog-CN-uuUVp.js","/assets/schemas-MhAKMGOb.js","/assets/index-CZSVchcX.js","/assets/loader-circle-BDUbeTTe.js"],"css":[]},"routes/dashboard.$collection":{"id":"routes/dashboard.$collection","parentId":"routes/dashboard._layout","path":"/admin/dashboard/:collectionId","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._collection-WrdG5htb.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/index-BhARCKRr.js","/assets/utils-CCKKso3e.js","/assets/input-Bk91TMQj.js","/assets/index-pxU98Is7.js","/assets/alert-dialog-CN-uuUVp.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/calendar-Frbsxn98.js","/assets/trash-UKLAaALv.js","/assets/external-link-ERgO2SVI.js","/assets/circle-check-C6CxUIig.js","/assets/arrow-up-C0I0e1Jt.js","/assets/index-CtLWaleL.js","/assets/index-DLIEpuwL.js","/assets/index-cCny74f5.js"],"css":[]},"routes/dashboard.$collection.$document":{"id":"routes/dashboard.$collection.$document","parentId":"routes/dashboard._layout","path":"/admin/dashboard/:collectionId/:documentId","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._collection._document-jlBNC0sw.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/itemForm-D65KUxgZ.js","/assets/utils-CCKKso3e.js","/assets/badge-gLcN3Bjg.js","/assets/index-CtLWaleL.js","/assets/index-BhARCKRr.js","/assets/index-DLIEpuwL.js","/assets/zod-BFfp0fV9.js","/assets/index-CHzEoQKp.js","/assets/check-DF0ucE8d.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/schemas-CPJfa6mm.js","/assets/input-Bk91TMQj.js","/assets/index-cCny74f5.js","/assets/index-B2dzkZu5.js","/assets/x-BVtfHpQX.js","/assets/alert-dialog-CN-uuUVp.js","/assets/schemas-MhAKMGOb.js","/assets/index-CZSVchcX.js","/assets/loader-circle-BDUbeTTe.js"],"css":[]},"routes/dashboard.files":{"id":"routes/dashboard.files","parentId":"routes/dashboard._layout","path":"/admin/dashboard/files","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard.files-BK6IOREO.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/files-Cdeyho5X.js","/assets/utils-CCKKso3e.js","/assets/index-CZSVchcX.js","/assets/index-DLIEpuwL.js","/assets/badge-gLcN3Bjg.js","/assets/index-CtLWaleL.js","/assets/upload-DhJ5wU_H.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/trash-UKLAaALv.js","/assets/x-BVtfHpQX.js","/assets/check-DF0ucE8d.js"],"css":[]}},"url":"/assets/manifest-a5f7d74e.js","version":"a5f7d74e"};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as R,R as C,p as G,C as nw,D as u0}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{c as a9,e as c9}from"./authSlice-BI_rlf3v.js";import{_ as h0,D as u9,b as uc}from"./utils-CCKKso3e.js";import{a as fp}from"./index-DLIEpuwL.js";import{u as h9,c as f9,R as d9,P as p9,O as g9,C as m9,T as O9,a as x9}from"./index-cCny74f5.js";import{i as b9,u as rw}from"./zod-BFfp0fV9.js";import{R as y9,A as k9,P as S9,C as w9,a as v9}from"./index-B0u0hYGX.js";import{P as iw,R as sw,T as ow,a as lw,C as aw,A as C9}from"./index-B3bJjaCJ.js";import{c as Pm,P as ri,a as vi,u as Rh}from"./index-BhARCKRr.js";import{c as T9,u as Qm,R as _9,S as P9,T as Q9,V as $9,a as E9,P as A9,C as M9,b as L9,d as I9,e as R9}from"./itemForm-BR_x2kdj.js";import{u as N9}from"./index-CtLWaleL.js";import{c as cw}from"./createLucideIcon-BvSqmaUO.js";import"./index-CHzEoQKp.js";import"./check-DF0ucE8d.js";import"./schemas-CPJfa6mm.js";import"./index-B2dzkZu5.js";import"./badge-gLcN3Bjg.js";import"./input-Bk91TMQj.js";import"./x-BVtfHpQX.js";import"./alert-dialog-CN-uuUVp.js";import"./schemas-CsWpUuhN.js";import"./loader-circle-BDUbeTTe.js";const D9=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16.2V21h-4.8",key:"1hrera"}],["path",{d:"M21 7.8V3h-4.8",key:"ul1q53"}],["path",{d:"M3 16.2V21h4.8",key:"1x04uo"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 7.8V3h4.8",key:"1ijppm"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],Z9=cw("expand",D9);const B9=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],z9=cw("shrink",B9);var V9=Object.defineProperty,F9=(n,e,t)=>e in n?V9(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,qr=(n,e,t)=>F9(n,typeof e!="symbol"?e+"":e,t);let X9=class uw{constructor(e=new Map){this.map=e}clone(){return new uw(new Map(this.map))}increment(e){const t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&t())}},hc=class{constructor(){qr(this,"map",new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){const r=this.get(e);r!==void 0&&t(r)}delete(e){return this.map.delete(e)}};function qs(n,e){return e(n),n}function $m(){}const hw="cell";function f0(n,e){return n===e}const Nh=new Map;let W9=class{constructor(e={}){qr(this,"subscriptions",new hc),qr(this,"singletonSubscriptions",new Map),qr(this,"graph",new hc),qr(this,"state",new Map),qr(this,"distinctNodes",new Map),qr(this,"executionMaps",new Map),qr(this,"definitionRegistry",new Set),qr(this,"combinedCells",[]);for(const t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),t!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,t===!0?f0:t),r}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?f0:e),t}sub(e,t){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(t),()=>r.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){const r=this.signalInstance();return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.sub(r,t)}pubIn(e){var t;const r=Reflect.ownKeys(e),i=this.getExecutionMap(r),s=i.refCount.clone(),o=i.participatingNodes.slice(),l=new Map(this.state),a=c=>{this.graph.use(c,u=>{for(const{sources:h,sink:f}of u)h.has(c)&&s.decrement(f,()=>{o.splice(o.indexOf(f),1),a(f)})})};for(;;){const c=o.shift();if(c===void 0)break;const u=c;let h=!1;const f=d=>{const p=this.distinctNodes.get(u);if(p!=null&&p(l.get(u),d)){h=!1;return}h=!0,l.set(u,d),this.state.has(u)&&this.state.set(u,d)};if(Object.prototype.hasOwnProperty.call(e,u)?f(e[u]):i.projections.use(u,d=>{for(const p of d){const g=[...Array.from(p.sources),...Array.from(p.pulls)].map(m=>l.get(m));p.map(f)(...g)}}),h){const d=l.get(u);this.inContext(()=>{this.subscriptions.use(u,p=>{for(const g of p)g(d)})}),(t=this.singletonSubscriptions.get(u))==null||t(d)}else a(u)}}connect({sources:e,pulls:t=[],map:r,sink:i}){const s={map:r,pulls:new Set(t),sink:this.register(i),sources:new Set(e)};for(const o of[...e,...t])this.register(o),this.graph.getOrCreate(o).add(s);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>qs(this.signalInstance(),r=>(this.link(this.pipe(r,...e),t),r))}link(e,t){this.connect({map:r=>i=>{r(i)},sink:t,sources:[e]})}combine(...e){return qs(this.signalInstance(),t=>{this.connect({map:r=>(...i)=>{r(i)},sink:t,sources:e})})}combineCells(...e){const t=this.combinedCells.find(i=>e.length===i.sources.length&&e.every((s,o)=>s===i.sources[o]));if(t)return t.cell;const r=this.cellInstance(e.map(i=>this.getValue(i)),!0);return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.combinedCells.push({sources:e,cell:r}),r}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(t=>this.getValue(t))}register(e){const t=Nh.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),qs(t.type===hw?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),r=>{this.inContext(()=>{t.init(this,r)})}))}inContext(e){return e()}changeWith(e,t,r){this.connect({sources:[t],pulls:[e],sink:e,map:i=>(s,o)=>{i(r(o,s))}})}calculateExecutionMap(e){const t=[],r=new Set,i=new hc,s=new X9,o=new hc,l=(a,c=0)=>{s.increment(a),!r.has(a)&&(this.register(a),i.use(a,u=>{c=Math.max(...Array.from(u).map(h=>t.indexOf(h)))+1}),this.graph.use(a,u=>{for(const h of u)h.sources.has(a)?(o.getOrCreate(h.sink).add(h),l(h.sink,c)):i.getOrCreate(h.sink).add(a)}),r.add(a),t.splice(c,0,a))};return e.forEach(l),{participatingNodes:t,pendingPulls:i,projections:o,refCount:s}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];const i=this.executionMaps.get(t);if(i!==void 0)return i}else for(const[i,s]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===e.length&&i.every(o=>e.includes(o)))return s;const r=this.calculateExecutionMap(e);return this.executionMaps.set(t,r),r}combineOperators(...e){return t=>{for(const r of e)t=r(t,this);return t}}};function oe(n,e=$m,t=!0){return qs(Symbol(),r=>{Nh.set(r,{type:hw,distinct:t,initial:n,init:e})})}function bt(n=$m,e=!1){return qs(Symbol(),t=>{Nh.set(t,{type:"signal",distinct:e,init:n})})}function Ni(n=$m){return qs(Symbol(),e=>{Nh.set(e,{type:"signal",distinct:!1,init:n})})}const fw=R.createContext(null);function $a(){const n=R.useContext(fw);if(n===null)throw new Error("useRealm must be used within a RealmContextProvider");return n}function nn(n){const e=$a();e.register(n);const t=R.useCallback(r=>e.sub(n,r),[e,n]);return R.useSyncExternalStore(t,()=>e.getValue(n),()=>e.getValue(n))}function Wt(...n){const e=$a(),t=R.useMemo(()=>e.combineCells.apply(e,n),[e,...n]);return nn(t)}function ut(n){const e=$a();return e.register(n),R.useCallback(t=>{e.pub(n,t)},[e,n])}function js(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{i(n(s))},sink:r,sources:[e]}),r}}function Je(...n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>(...s)=>{i(s)},pulls:n,sink:r,sources:[e]}),r}}function dw(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>()=>{i(n)},sink:r,sources:[e]}),r}}function Ea(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{n(s)&&i(s)},sink:r,sources:[e]}),r}}function pw(n,e){return(t,r)=>{const i=r.signalInstance();return r.connect({map:s=>o=>{s(e=n(e,o))},sink:i,sources:[t]}),i}}function q9(n,e){return e(n),n}function Ys(){}function Ln(n){return function(e){return{init:t=>{var r;return(r=n.init)==null?void 0:r.call(n,t,e)},postInit:t=>{var r;return(r=n.postInit)==null?void 0:r.call(n,t,e)},update:t=>{var r;return(r=n.update)==null?void 0:r.call(n,t,e)}}}}function j9({children:n,plugins:e}){const t=C.useMemo(()=>q9(new W9,r=>{var i,s;for(const o of e)(i=o.init)==null||i.call(o,r);for(const o of e)(s=o.postInit)==null||s.call(o,r)}),[]);return C.useEffect(()=>{var r;for(const i of e)(r=i.update)==null||r.call(i,t)}),C.createElement(fw.Provider,{value:t},n)}const gw=R.createContext(null);function Y9(n,e){return{getTheme:function(){return e??null}}}function Nt(){const n=R.useContext(gw);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",e);for(const s of t)i.append("v",s);throw r.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),n}function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const tr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,H9=tr&&"documentMode"in document?document.documentMode:null,Vn=tr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ci=tr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_u=!(!tr||!("InputEvent"in window)||H9)&&"getTargetRanges"in new window.InputEvent("input"),jl=tr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),co=tr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,U9=tr&&/Android/.test(navigator.userAgent),mw=tr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),d0=tr&&U9&&mw,Pu=tr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mw;function Qu(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const G9=1,K9=3,J9=9,eQ=11,ds=0,Ow=1,uo=2,tQ=0,nQ=1,rQ=2,$u=4,Eu=8,Em=128,iQ=1792|(112|(3|$u|Eu)|Em),Am=1,Mm=2,Lm=3,Im=4,Rm=5,Nm=6,Dh=jl||co||Pu?" ":"",ii=`
|
|
1
|
+
import{a as R,R as C,p as G,C as nw,D as u0}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{c as a9,e as c9}from"./authSlice-BI_rlf3v.js";import{_ as h0,D as u9,b as uc}from"./utils-CCKKso3e.js";import{a as fp}from"./index-DLIEpuwL.js";import{u as h9,c as f9,R as d9,P as p9,O as g9,C as m9,T as O9,a as x9}from"./index-cCny74f5.js";import{i as b9,u as rw}from"./zod-BFfp0fV9.js";import{R as y9,A as k9,P as S9,C as w9,a as v9}from"./index-B0u0hYGX.js";import{P as iw,R as sw,T as ow,a as lw,C as aw,A as C9}from"./index-B3bJjaCJ.js";import{c as Pm,P as ri,a as vi,u as Rh}from"./index-BhARCKRr.js";import{c as T9,u as Qm,R as _9,S as P9,T as Q9,V as $9,a as E9,P as A9,C as M9,b as L9,d as I9,e as R9}from"./itemForm-D65KUxgZ.js";import{u as N9}from"./index-CtLWaleL.js";import{c as cw}from"./createLucideIcon-BvSqmaUO.js";import"./index-CHzEoQKp.js";import"./check-DF0ucE8d.js";import"./schemas-CPJfa6mm.js";import"./index-B2dzkZu5.js";import"./badge-gLcN3Bjg.js";import"./input-Bk91TMQj.js";import"./x-BVtfHpQX.js";import"./alert-dialog-CN-uuUVp.js";import"./schemas-MhAKMGOb.js";import"./index-CZSVchcX.js";import"./loader-circle-BDUbeTTe.js";const D9=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16.2V21h-4.8",key:"1hrera"}],["path",{d:"M21 7.8V3h-4.8",key:"ul1q53"}],["path",{d:"M3 16.2V21h4.8",key:"1x04uo"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 7.8V3h4.8",key:"1ijppm"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],Z9=cw("expand",D9);const B9=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],z9=cw("shrink",B9);var V9=Object.defineProperty,F9=(n,e,t)=>e in n?V9(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,qr=(n,e,t)=>F9(n,typeof e!="symbol"?e+"":e,t);let X9=class uw{constructor(e=new Map){this.map=e}clone(){return new uw(new Map(this.map))}increment(e){const t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&t())}},hc=class{constructor(){qr(this,"map",new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){const r=this.get(e);r!==void 0&&t(r)}delete(e){return this.map.delete(e)}};function qs(n,e){return e(n),n}function $m(){}const hw="cell";function f0(n,e){return n===e}const Nh=new Map;let W9=class{constructor(e={}){qr(this,"subscriptions",new hc),qr(this,"singletonSubscriptions",new Map),qr(this,"graph",new hc),qr(this,"state",new Map),qr(this,"distinctNodes",new Map),qr(this,"executionMaps",new Map),qr(this,"definitionRegistry",new Set),qr(this,"combinedCells",[]);for(const t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),t!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,t===!0?f0:t),r}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?f0:e),t}sub(e,t){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(t),()=>r.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){const r=this.signalInstance();return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.sub(r,t)}pubIn(e){var t;const r=Reflect.ownKeys(e),i=this.getExecutionMap(r),s=i.refCount.clone(),o=i.participatingNodes.slice(),l=new Map(this.state),a=c=>{this.graph.use(c,u=>{for(const{sources:h,sink:f}of u)h.has(c)&&s.decrement(f,()=>{o.splice(o.indexOf(f),1),a(f)})})};for(;;){const c=o.shift();if(c===void 0)break;const u=c;let h=!1;const f=d=>{const p=this.distinctNodes.get(u);if(p!=null&&p(l.get(u),d)){h=!1;return}h=!0,l.set(u,d),this.state.has(u)&&this.state.set(u,d)};if(Object.prototype.hasOwnProperty.call(e,u)?f(e[u]):i.projections.use(u,d=>{for(const p of d){const g=[...Array.from(p.sources),...Array.from(p.pulls)].map(m=>l.get(m));p.map(f)(...g)}}),h){const d=l.get(u);this.inContext(()=>{this.subscriptions.use(u,p=>{for(const g of p)g(d)})}),(t=this.singletonSubscriptions.get(u))==null||t(d)}else a(u)}}connect({sources:e,pulls:t=[],map:r,sink:i}){const s={map:r,pulls:new Set(t),sink:this.register(i),sources:new Set(e)};for(const o of[...e,...t])this.register(o),this.graph.getOrCreate(o).add(s);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>qs(this.signalInstance(),r=>(this.link(this.pipe(r,...e),t),r))}link(e,t){this.connect({map:r=>i=>{r(i)},sink:t,sources:[e]})}combine(...e){return qs(this.signalInstance(),t=>{this.connect({map:r=>(...i)=>{r(i)},sink:t,sources:e})})}combineCells(...e){const t=this.combinedCells.find(i=>e.length===i.sources.length&&e.every((s,o)=>s===i.sources[o]));if(t)return t.cell;const r=this.cellInstance(e.map(i=>this.getValue(i)),!0);return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.combinedCells.push({sources:e,cell:r}),r}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(t=>this.getValue(t))}register(e){const t=Nh.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),qs(t.type===hw?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),r=>{this.inContext(()=>{t.init(this,r)})}))}inContext(e){return e()}changeWith(e,t,r){this.connect({sources:[t],pulls:[e],sink:e,map:i=>(s,o)=>{i(r(o,s))}})}calculateExecutionMap(e){const t=[],r=new Set,i=new hc,s=new X9,o=new hc,l=(a,c=0)=>{s.increment(a),!r.has(a)&&(this.register(a),i.use(a,u=>{c=Math.max(...Array.from(u).map(h=>t.indexOf(h)))+1}),this.graph.use(a,u=>{for(const h of u)h.sources.has(a)?(o.getOrCreate(h.sink).add(h),l(h.sink,c)):i.getOrCreate(h.sink).add(a)}),r.add(a),t.splice(c,0,a))};return e.forEach(l),{participatingNodes:t,pendingPulls:i,projections:o,refCount:s}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];const i=this.executionMaps.get(t);if(i!==void 0)return i}else for(const[i,s]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===e.length&&i.every(o=>e.includes(o)))return s;const r=this.calculateExecutionMap(e);return this.executionMaps.set(t,r),r}combineOperators(...e){return t=>{for(const r of e)t=r(t,this);return t}}};function oe(n,e=$m,t=!0){return qs(Symbol(),r=>{Nh.set(r,{type:hw,distinct:t,initial:n,init:e})})}function bt(n=$m,e=!1){return qs(Symbol(),t=>{Nh.set(t,{type:"signal",distinct:e,init:n})})}function Ni(n=$m){return qs(Symbol(),e=>{Nh.set(e,{type:"signal",distinct:!1,init:n})})}const fw=R.createContext(null);function $a(){const n=R.useContext(fw);if(n===null)throw new Error("useRealm must be used within a RealmContextProvider");return n}function nn(n){const e=$a();e.register(n);const t=R.useCallback(r=>e.sub(n,r),[e,n]);return R.useSyncExternalStore(t,()=>e.getValue(n),()=>e.getValue(n))}function Wt(...n){const e=$a(),t=R.useMemo(()=>e.combineCells.apply(e,n),[e,...n]);return nn(t)}function ut(n){const e=$a();return e.register(n),R.useCallback(t=>{e.pub(n,t)},[e,n])}function js(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{i(n(s))},sink:r,sources:[e]}),r}}function Je(...n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>(...s)=>{i(s)},pulls:n,sink:r,sources:[e]}),r}}function dw(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>()=>{i(n)},sink:r,sources:[e]}),r}}function Ea(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{n(s)&&i(s)},sink:r,sources:[e]}),r}}function pw(n,e){return(t,r)=>{const i=r.signalInstance();return r.connect({map:s=>o=>{s(e=n(e,o))},sink:i,sources:[t]}),i}}function q9(n,e){return e(n),n}function Ys(){}function Ln(n){return function(e){return{init:t=>{var r;return(r=n.init)==null?void 0:r.call(n,t,e)},postInit:t=>{var r;return(r=n.postInit)==null?void 0:r.call(n,t,e)},update:t=>{var r;return(r=n.update)==null?void 0:r.call(n,t,e)}}}}function j9({children:n,plugins:e}){const t=C.useMemo(()=>q9(new W9,r=>{var i,s;for(const o of e)(i=o.init)==null||i.call(o,r);for(const o of e)(s=o.postInit)==null||s.call(o,r)}),[]);return C.useEffect(()=>{var r;for(const i of e)(r=i.update)==null||r.call(i,t)}),C.createElement(fw.Provider,{value:t},n)}const gw=R.createContext(null);function Y9(n,e){return{getTheme:function(){return e??null}}}function Nt(){const n=R.useContext(gw);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",e);for(const s of t)i.append("v",s);throw r.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),n}function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const tr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,H9=tr&&"documentMode"in document?document.documentMode:null,Vn=tr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ci=tr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_u=!(!tr||!("InputEvent"in window)||H9)&&"getTargetRanges"in new window.InputEvent("input"),jl=tr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),co=tr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,U9=tr&&/Android/.test(navigator.userAgent),mw=tr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),d0=tr&&U9&&mw,Pu=tr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mw;function Qu(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const G9=1,K9=3,J9=9,eQ=11,ds=0,Ow=1,uo=2,tQ=0,nQ=1,rQ=2,$u=4,Eu=8,Em=128,iQ=1792|(112|(3|$u|Eu)|Em),Am=1,Mm=2,Lm=3,Im=4,Rm=5,Nm=6,Dh=jl||co||Pu?" ":"",ii=`
|
|
2
2
|
|
|
3
3
|
`,sQ=Ci?" ":Dh,xw="֑-߿יִ-﷽ﹰ-ﻼ",bw="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",oQ=new RegExp("^[^"+bw+"]*["+xw+"]"),lQ=new RegExp("^[^"+xw+"]*["+bw+"]"),ps={bold:1,capitalize:1024,code:16,highlight:Em,italic:2,lowercase:256,strikethrough:$u,subscript:32,superscript:64,underline:Eu,uppercase:512},aQ={directionless:1,unmergeable:2},p0={center:Mm,end:Nm,justify:Im,left:Am,right:Lm,start:Rm},cQ={[Mm]:"center",[Nm]:"end",[Im]:"justify",[Am]:"left",[Lm]:"right",[Rm]:"start"},uQ={normal:0,segmented:2,token:1},hQ={[tQ]:"normal",[rQ]:"segmented",[nQ]:"token"},fQ="$";function yw(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const l=o.__key;o.__parent===e&&(I(o)&&yw(o,l,t,r,i,s),t.has(l)||s.delete(l),i.push(l)),o=o.getNextSibling()}}const dQ=100;let dp=!1,Dm=0;function pQ(n){Dm=n.timeStamp}function Ef(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&Jh(n,t)!==void 0}function gQ(n,e,t){const r=Gn(An(t));let i=null,s=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,s=r.focusOffset);const o=n.nodeValue;o!==null&&lO(e,o,i,s,!1)}function mQ(n,e,t){if(z(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return ui(e)&&t.isAttached()}function OQ(n,e,t,r){for(let i=n;i&&!i$(i);i=za(i)){const s=Jh(i,e);if(s!==void 0){const o=Ke(s,t);if(o)return Qe(o)||!nt(i)?void 0:[i,o]}else if(i===r)return[r,l2(t)]}}function kw(n,e,t){dp=!0;const r=performance.now()-Dm>dQ;try{vn(n,(()=>{const i=X()||(function(f){return f.getEditorState().read((()=>{const d=X();return d!==null?d.clone():null}))})(n),s=new Map,o=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f<e.length;f++){const d=e[f],p=d.type,g=d.target,m=OQ(g,n,l,o);if(!m)continue;const[O,b]=m;if(p==="characterData")r&&q(b)&&ui(g)&&mQ(i,g,b)&&gQ(g,b,n);else if(p==="childList"){c=!0;const x=d.addedNodes;for(let k=0;k<x.length;k++){const S=x[k],v=s2(S),T=S.parentNode;if(T!=null&&S!==a&&v===null&&!Ef(S,T,n)){if(Ci){const A=(nt(S)?S.innerText:null)||S.nodeValue;A&&(u+=A)}T.removeChild(S)}}const y=d.removedNodes,w=y.length;if(w>0){let k=0;for(let S=0;S<w;S++){const v=y[S];(Ef(v,g,n)||a===v)&&(g.appendChild(v),k++)}w!==k&&s.set(O,b)}}}if(s.size>0)for(const[f,d]of s)d.reconcileObservedMutation(f,n);const h=t.takeRecords();if(h.length>0){for(let f=0;f<h.length;f++){const d=h[f],p=d.addedNodes,g=d.target;for(let m=0;m<p.length;m++){const O=p[m],b=O.parentNode;b==null||O.nodeName!=="BR"||Ef(O,g,n)||b.removeChild(O)}}t.takeRecords()}i!==null&&(c&&dt(i),Ci&&h2(n)&&i.insertRawText(u))}))}finally{dp=!1}}function Sw(n){const e=n._observer;e!==null&&kw(n,e.takeRecords(),e)}function ww(n){(function(e){Dm===0&&An(e).addEventListener("textInput",pQ,!0)})(n),n._observer=new MutationObserver(((e,t)=>{kw(n,e,t)}))}let xQ=class vw{constructor(e,t=new Map,r=void 0,i=new Map,s=void 0){this.node=e,this.sharedConfigMap=t,this.unknownState=r,this.knownState=i;const o=s!==void 0?s:(function(l,a,c){let u=c.size;if(a)for(const h in a){const f=l.get(h);f&&c.has(f)||u++}return u})(t,r,i);this.size=o}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState};for(const[t,r]of this.knownState)t.isEqual(r,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(r);return fc(e)?{[fQ]:e}:{}}getWritable(e){if(this.node===e)return this;const t=new Map(this.knownState),r=fc(i=this.unknownState)&&{...i};var i;if(r)for(const s of t.keys())delete r[s.key];return new vw(e,this.sharedConfigMap,fc(r),t,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedConfigMap.set(r,e);const{knownState:i,unknownState:s}=this;i.has(e)||s&&r in s||this.size++,i.set(e,t)}updateFromUnknown(e,t){const r=this.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState={},e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i);this.unknownState=fc(this.unknownState)}};function fc(n){if(n)for(const e in n)return n}function bQ(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new xQ(e);return e.__state=t,t}function g0(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,l=e.__style,a=n.__state,c=e.__state;return(t===null||t===s)&&(r===null||r===o)&&(i===null||i===l)&&(n.__state===null||a===c||(function(u,h){if(u===h)return!0;if(u&&h&&u.size!==h.size)return!1;const f=new Set,d=(g,m)=>{for(const[O,b]of g.knownState){if(f.has(O.key))continue;f.add(O.key);const x=m?m.getValue(O):O.defaultValue;if(x!==b&&!O.isEqual(x,b))return!0}return!1},p=(g,m)=>{const{unknownState:O}=g,b=m?m.unknownState:void 0;if(O){for(const[x,y]of Object.entries(O))if(!f.has(x)&&(f.add(x),y!==(b?b[x]:void 0)))return!0}return!1};return!(u&&d(u,h)||h&&d(h,u)||u&&p(u,h)||h&&p(h,u))})(a,c))}function m0(n,e){const t=n.mergeWithSibling(e),r=tt()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function O0(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&q(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(g0(e,r)){r=m0(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&q(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(g0(r,t)){r=m0(r,t);break}break}t.remove()}}else r.remove()}function gs(n){return x0(n.anchor),x0(n.focus),n}function x0(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),q(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!I(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let Pi,Ft,Yl,Zh,pp,gp,ms,Yn,mp,Hl,gt="",Vt="",dr=null,pr="",Yr="",Cw=!1,Ul=!1,su=null;function Au(n,e){const t=ms.get(n);if(e!==null){const r=bp(n);r.parentNode===e&&e.removeChild(r)}if(Yn.has(n)||Ft._keyToDOMMap.delete(n),I(t)){const r=Lu(t,ms);Op(r,0,r.length-1,null)}t!==void 0&&aO(Hl,Yl,Zh,t,"destroyed")}function Op(n,e,t,r){let i=e;for(;i<=t;++i){const s=n[i];s!==void 0&&Au(s,r)}}function ji(n,e){n.setProperty("text-align",e)}const yQ="40px";function Tw(n,e){const t=Pi.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||yQ;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function _w(n,e){const t=n.style;e===0?ji(t,""):e===Am?ji(t,"left"):e===Mm?ji(t,"center"):e===Lm?ji(t,"right"):e===Im?ji(t,"justify"):e===Rm?ji(t,"start"):e===Nm&&ji(t,"end")}function Mu(n,e){const t=Yn.get(n);t===void 0&&F(60);const r=t.createDOM(Pi,Ft);if((function(i,s,o){const l=o._keyToDOMMap;(function(a,c,u){const h=`__lexicalKey_${c._key}`;a[h]=u})(s,o,i),l.set(i,s)})(n,r,Ft),q(t)?r.setAttribute("data-lexical-text","true"):Qe(t)&&r.setAttribute("data-lexical-decorator","true"),I(t)){const i=t.__indent,s=t.__size;if(i!==0&&Tw(r,i),s!==0){const l=s-1;(function(a,c,u,h){const f=Vt;Vt="",xp(a,u,0,c,u.getDOMSlot(h)),Qw(u,h),Vt=f})(Lu(t,Yn),l,t,r)}const o=t.__format;o!==0&&_w(r,o),t.isInline()||Pw(null,t,r),ef(t)&&(gt+=ii,Yr+=ii)}else{const i=t.getTextContent();if(Qe(t)){const s=t.decorate(Ft,Pi);s!==null&&$w(n,s),r.contentEditable="false"}else q(t)&&(t.isDirectionless()||(Vt+=i));gt+=i,Yr+=i}return e!==null&&e.insertChild(r),aO(Hl,Yl,Zh,t,"created"),r}function xp(n,e,t,r,i){const s=gt;gt="";let o=t;for(;o<=r;++o){Mu(n[o],i);const l=Yn.get(n[o]);l!==null&&q(l)&&(dr===null&&(dr=l.getFormat()),pr===""&&(pr=l.getStyle()))}ef(e)&&(gt+=ii),i.element.__lexicalTextContent=gt,gt=s+gt}function b0(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return Hn(r)?"line-break":Qe(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Pw(n,e,t){const r=b0(n,ms),i=b0(e,Yn);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function Qw(n,e){const t=e.__lexicalDirTextContent||"",r=e.__lexicalDir||"";if(t!==Vt||r!==su){const i=Vt==="",s=i?su:(function(o){return oQ.test(o)?"rtl":lQ.test(o)?"ltr":null})(Vt);if(s!==r){const o=e.classList,l=Pi.theme;let a=r!==null?l[r]:void 0,c=s!==null?l[s]:void 0;if(a!==void 0){if(typeof a=="string"){const u=Qu(a);a=l[r]=u}o.remove(...a)}if(s===null||i&&s==="ltr")e.removeAttribute("dir");else{if(c!==void 0){if(typeof c=="string"){const u=Qu(c);c=l[s]=u}c!==void 0&&o.add(...c)}e.dir=s}Ul||(n.getWritable().__dir=s)}su=s,e.__lexicalDirTextContent=Vt,e.__lexicalDir=s}}function kQ(n,e,t){const r=Vt;var i;Vt="",dr=null,pr="",(function(s,o,l){const a=gt,c=s.__size,u=o.__size;gt="";const h=l.element;if(c===1&&u===1){const f=s.__first,d=o.__first;if(f===d)gl(f,h);else{const g=bp(f),m=Mu(d,null);try{h.replaceChild(m,g)}catch(O){if(typeof O=="object"&&O!=null){const b=`${O.toString()} Parent: ${h.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(b)}throw O}Au(f,null)}const p=Yn.get(d);q(p)&&(dr===null&&(dr=p.getFormat()),pr===""&&(pr=p.getStyle()))}else{const f=Lu(s,ms),d=Lu(o,Yn);if(f.length!==c&&F(227),d.length!==u&&F(228),c===0)u!==0&&xp(d,o,0,u-1,l);else if(u===0){if(c!==0){const p=l.after==null&&l.before==null&&l.element.__lexicalLineBreak==null;Op(f,0,c-1,p?null:h),p&&(h.textContent="")}}else(function(p,g,m,O,b,x){const y=O-1,w=b-1;let k,S,v=x.getFirstChild(),T=0,A=0;for(;T<=y&&A<=w;){const E=g[T],D=m[A];if(E===D)v=Af(gl(D,x.element)),T++,A++;else{k===void 0&&(k=new Set(g)),S===void 0&&(S=new Set(m));const J=S.has(E),U=k.has(D);if(J)if(U){const le=fo(Ft,D);le===v?v=Af(gl(D,x.element)):(x.withBefore(v).insertChild(le),gl(D,x.element)),T++,A++}else Mu(D,x.withBefore(v)),A++;else v=Af(bp(E)),Au(E,x.element),T++}const B=Yn.get(D);B!==null&&q(B)&&(dr===null&&(dr=B.getFormat()),pr===""&&(pr=B.getStyle()))}const M=T>y,L=A>w;if(M&&!L){const E=m[w+1],D=E===void 0?null:Ft.getElementByKey(E);xp(m,p,A,w,x.withBefore(D))}else L&&!M&&Op(g,T,y,x.element)})(o,f,d,c,u,l)}ef(o)&&(gt+=ii),h.__lexicalTextContent=gt,gt=a+gt})(n,e,e.getDOMSlot(t)),Qw(e,t),i=e,dr==null||dr===i.__textFormat||Ul||i.setTextFormat(dr),(function(s){pr===""||pr===s.__textStyle||Ul||s.setTextStyle(pr)})(e),Vt=r}function Lu(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&F(101),t.push(r),r=i.__next}return t}function gl(n,e){const t=ms.get(n);let r=Yn.get(n);t!==void 0&&r!==void 0||F(61);const i=Cw||gp.has(n)||pp.has(n),s=fo(Ft,n);if(t===r&&!i){if(I(t)){const o=s.__lexicalTextContent;o!==void 0&&(gt+=o,Yr+=o);const l=s.__lexicalDirTextContent;l!==void 0&&(Vt+=l)}else{const o=t.getTextContent();q(t)&&!t.isDirectionless()&&(Vt+=o),Yr+=o,gt+=o}return s}if(t!==r&&i&&aO(Hl,Yl,Zh,r,"updated"),r.updateDOM(t,s,Pi)){const o=Mu(n,null);return e===null&&F(62),e.replaceChild(o,s),Au(n,null),o}if(I(t)&&I(r)){const o=r.__indent;o!==t.__indent&&Tw(s,o);const l=r.__format;l!==t.__format&&_w(s,l),i&&(kQ(t,r,s),Qt(r)||r.isInline()||Pw(t,r,s)),ef(r)&&(gt+=ii,Yr+=ii)}else{const o=r.getTextContent();if(Qe(r)){const l=r.decorate(Ft,Pi);l!==null&&$w(n,l)}else q(r)&&!r.isDirectionless()&&(Vt+=o);gt+=o,Yr+=o}if(!Ul&&Qt(r)&&r.__cachedText!==Yr){const o=r.getWritable();o.__cachedText=Yr,r=o}return s}function $w(n,e){let t=Ft._pendingDecorators;const r=Ft._decorators;if(t===null){if(r[n]===e)return;t=o2(Ft)}t[n]=e}function Af(n){let e=n.nextSibling;return e!==null&&e===Ft._blockCursorElement&&(e=e.nextSibling),e}function SQ(n,e,t,r,i,s){gt="",Yr="",Vt="",Cw=r===uo,su=null,Ft=t,Pi=t._config,Yl=t._nodes,Zh=Ft._listeners.mutation,pp=i,gp=s,ms=n._nodeMap,Yn=e._nodeMap,Ul=e._readOnly,mp=new Map(t._keyToDOMMap);const o=new Map;return Hl=o,gl("root",null),Ft=void 0,Yl=void 0,pp=void 0,gp=void 0,ms=void 0,Yn=void 0,Pi=void 0,mp=void 0,Hl=void 0,o}function bp(n){const e=mp.get(n);return e===void 0&&F(75,n),e}function ci(n){return{}}const Bh={},wQ={},zh={},ls={},Hs={},Gl={},Us={},Aa={},yp={},Kl={},Jl={},Kr={},Vh={},Fh={},Ew={},Aw={},vQ={},Zm={},CQ={},Bm={},zm={},ea={},Vm={},Xh={},Ma={},Wh={},Fm={},Mw={},Iu={},kp={},Xm={},TQ={},qh={},Wm={},_Q={},jh={},qm={},Sp={},PQ={},QQ={},ml={},Ol={},Lw={},Iw={},Rw={},Vr=Object.freeze({}),wp=30,vp=[["keydown",function(n,e){if(Ql=n.timeStamp,Cp=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:s,altKey:o}=n;if(!re(e,Ew,n)&&t!=null){if(Mf&&As(Cp))return vn(e,(()=>{dc(e,Lf)})),Mf=!1,void(Lf="");if((function(l,a,c,u){return q0(l)&&!a&&!u&&!c})(t,i,o,s))re(e,Aw,n);else if((function(l,a,c,u,h){return q0(l)&&!u&&!c&&(a||h)})(t,i,r,o,s))re(e,vQ,n);else if((function(l,a,c,u){return W0(l)&&!a&&!u&&!c})(t,i,o,s))re(e,Zm,n);else if((function(l,a,c,u,h){return W0(l)&&!u&&!c&&(a||h)})(t,i,r,o,s))re(e,CQ,n);else if((function(l,a,c){return(function(u){return u==="ArrowUp"})(l)&&!a&&!c})(t,i,s))re(e,Bm,n);else if((function(l,a,c){return(function(u){return u==="ArrowDown"})(l)&&!a&&!c})(t,i,s))re(e,zm,n);else if((function(l,a){return j0(l)&&a})(t,r))$l=!0,re(e,ea,n);else if((function(l){return l===" "})(t))re(e,Vm,n);else if((function(l,a){return Vn&&a&&l.toLowerCase()==="o"})(t,i))n.preventDefault(),$l=!0,re(e,Hs,!0);else if((function(l,a){return j0(l)&&!a})(t,r))$l=!1,re(e,ea,n);else if((function(l,a,c,u){return Vn?!a&&!c&&(As(l)||l.toLowerCase()==="h"&&u):u||a||c?!1:As(l)})(t,o,s,i))As(t)?re(e,Xh,n):(n.preventDefault(),re(e,ls,!0));else if((function(l){return l==="Escape"})(t))re(e,Ma,n);else if((function(l,a,c,u,h){return Vn?!(c||u||h)&&(nl(l)||l.toLowerCase()==="d"&&a):a||u||h?!1:nl(l)})(t,i,r,o,s))nl(t)?re(e,Wh,n):(n.preventDefault(),re(e,ls,!1));else if((function(l,a,c){return As(l)&&(Vn?a:c)})(t,o,i))n.preventDefault(),re(e,Kl,!0);else if((function(l,a,c){return nl(l)&&(Vn?a:c)})(t,o,i))n.preventDefault(),re(e,Kl,!1);else if((function(l,a){return Vn&&a&&As(l)})(t,s))n.preventDefault(),re(e,Jl,!0);else if((function(l,a){return Vn&&a&&nl(l)})(t,s))n.preventDefault(),re(e,Jl,!1);else if((function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&xl(c,u)})(t,o,s,i))n.preventDefault(),re(e,Kr,"bold");else if((function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&xl(c,u)})(t,o,s,i))n.preventDefault(),re(e,Kr,"underline");else if((function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&xl(c,u)})(t,o,s,i))n.preventDefault(),re(e,Kr,"italic");else if((function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u})(t,o,i,s))re(e,Fm,n);else if((function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&xl(c,u)})(t,r,s,i))n.preventDefault(),re(e,Vh,void 0);else if((function(l,a,c,u){return Vn?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a})(t,r,s,i))n.preventDefault(),re(e,Fh,void 0);else{const l=e._editorState._selection;l===null||z(l)?!Ci&&Y0(t,s,i)&&(n.preventDefault(),re(e,Sp,n)):(function(a,c,u,h){return c?!1:a.toLowerCase()==="c"?Vn?u:h:!1})(t,r,s,i)?(n.preventDefault(),re(e,jh,n)):(function(a,c,u,h){return c?!1:a.toLowerCase()==="x"?Vn?u:h:!1})(t,r,s,i)?(n.preventDefault(),re(e,qm,n)):Y0(t,s,i)&&(n.preventDefault(),re(e,Sp,n))}(function(l,a,c,u){return l||a||c||u})(i,r,o,s)&&re(e,Rw,n)}}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;Bo(t)&&r!=="touch"&&n.button===0&&vn(e,(()=>{Qe(Ar(t))||(_p=!0)}))}],["compositionstart",function(n,e){vn(e,(()=>{const t=X();if(z(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();Tt(r.key),(n.timeStamp<Ql+wp||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||q(i)&&i.getStyle()!==t.style)&&re(e,Us,sQ)}}))}],["compositionend",function(n,e){Ci?tl=!0:co||!jl&&!Pu?vn(e,(()=>{dc(e,n.data)})):(Mf=!0,Lf=n.data)}],["input",function(n,e){n.stopPropagation(),vn(e,(()=>{const t=X(),r=n.data,i=zw(n);if(r!=null&&z(t)&&Zw(t,i,r,n.timeStamp,!1)){tl&&(dc(e,r),tl=!1);const s=t.anchor.getNode(),o=Gn(An(e));if(o===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;_u&&!t.isCollapsed()&&q(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,a)+r+s.getTextContent().slice(a+c)===u2(o.anchorNode)||re(e,Us,r);const u=r.length;Ci&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),jl||co||Pu||!e.isComposing()||(Ql=0,Tt(null))}else oO(!1,e,r!==null?r:void 0),tl&&(dc(e,r||void 0),tl=!1);(function(){At();const s=tt();Sw(s)})()}),{event:n}),Ns=null}],["click",function(n,e){vn(e,(()=>{const t=X(),r=Gn(An(e)),i=No();if(r){if(z(t)){const s=t.anchor,o=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!Qt(o)&&Fe().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const l=(function(a,c){let u=a;for(;u!==Fe()&&u!=null;){if(c(u))return u;u=u.getParent()}return null})(o,(a=>I(a)&&!a.isInline()));I(l)&&l.select(0)}}else if(n.pointerType==="touch"){const s=r.anchorNode;(nt(s)||ui(s))&&dt(Um(i,r,e,n))}}re(e,zh,n)}))}],["cut",Vr],["copy",Vr],["dragstart",Vr],["dragover",Vr],["dragend",Vr],["paste",Vr],["focus",Vr],["blur",Vr],["drop",Vr]];_u&&vp.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType,s=zw(t);i==="deleteCompositionText"||Ci&&h2(r)||i!=="insertCompositionText"&&vn(r,(()=>{const o=X();if(i==="deleteContentBackward"){if(o===null){const d=No();if(!z(d))return;dt(d.clone())}if(z(o)){const d=o.anchor.key===o.focus.key;if(l=t.timeStamp,Cp==="MediaLast"&&l<Ql+wp&&r.isComposing()&&d){if(Tt(null),Ql=0,setTimeout((()=>{vn(r,(()=>{Tt(null)}))}),wp),z(o)){const p=o.anchor.getNode();p.markDirty(),q(p)||F(142),Bw(o,p)}}else{Tt(null),t.preventDefault();const p=o.anchor.getNode(),g=p.getTextContent(),m=p.canInsertTextAfter(),O=o.anchor.offset===0&&o.focus.offset===g.length;let b=d0&&d&&!O&&m;if(b&&o.isCollapsed()&&(b=!Qe(Ep(o.anchor,!0))),!b){re(r,ls,!0);const x=X();d0&&z(x)&&x.isCollapsed()&&(Ki=x,setTimeout((()=>Ki=null)))}}return}}var l;if(!z(o))return;const a=t.data;Ns!==null&&oO(!1,r,Ns),o.dirty&&Ns===null||!o.isCollapsed()||Qt(o.anchor.getNode())||s===null||o.applyDOMRange(s),Ns=null;const c=o.anchor,u=o.focus,h=c.getNode(),f=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":re(r,Us,t);break;case"insertFromComposition":Tt(null),re(r,Us,t);break;case"insertLineBreak":Tt(null),re(r,Hs,!1);break;case"insertParagraph":Tt(null),$l&&!co?($l=!1,re(r,Hs,!1)):re(r,Gl,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":re(r,Aa,t);break;case"deleteByComposition":(function(d,p){return d!==p||I(d)||I(p)||!d.isToken()||!p.isToken()})(h,f)&&re(r,yp,t);break;case"deleteByDrag":case"deleteByCut":re(r,yp,t);break;case"deleteContent":re(r,ls,!1);break;case"deleteWordBackward":re(r,Kl,!0);break;case"deleteWordForward":re(r,Kl,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":re(r,Jl,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":re(r,Jl,!1);break;case"formatStrikeThrough":re(r,Kr,"strikethrough");break;case"formatBold":re(r,Kr,"bold");break;case"formatItalic":re(r,Kr,"italic");break;case"formatUnderline":re(r,Kr,"underline");break;case"historyUndo":re(r,Vh,void 0);break;case"historyRedo":re(r,Fh,void 0)}else{if(a===`
|
|
4
4
|
`)t.preventDefault(),re(r,Hs,!1);else if(a===ii)t.preventDefault(),re(r,Gl,void 0);else if(a==null&&t.dataTransfer){const d=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(d)}else a!=null&&Zw(o,s,a,t.timeStamp,!0)?(t.preventDefault(),re(r,Us,a)):Ns=a;Nw=t.timeStamp}}))})(n,e)]);let Ql=0,Cp=null,Nw=0,Ns=null;const Ru=new WeakMap;let Tp=!1,_p=!1,$l=!1,tl=!1,Mf=!1,Lf="",Ki=null,Dw=[0,"",0,"root",0];function Zw(n,e,t,r,i){const s=n.anchor,o=n.focus,l=s.getNode(),a=tt(),c=Gn(An(a)),u=c!==null?c.anchorNode:null,h=s.key,f=a.getElementByKey(h),d=t.length;return h!==o.key||!q(l)||(!i&&(!_u||Nw<r+50)||l.isDirty()&&d<2||a2(t))&&s.offset!==o.offset&&!l.isComposing()||Ds(l)||l.isDirty()&&d>1||(i||!_u)&&f!==null&&!l.isComposing()&&u!==ho(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||(function(p,g){if(g.isSegmented())return!0;if(!p.isCollapsed())return!1;const m=p.anchor.offset,O=g.getParentOrThrow(),b=g.isToken();return m===0?!g.canInsertTextBefore()||!O.canInsertTextBefore()&&!g.isComposing()||b||(function(x){const y=x.getPreviousSibling();return(q(y)||I(y)&&y.isInline())&&!y.canInsertTextAfter()})(g):m===g.getTextContentSize()&&(!g.canInsertTextAfter()||!O.canInsertTextAfter()&&!g.isComposing()||b)})(n,l)}function y0(n,e){return ui(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function k0(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;Tp&&(Tp=!1,y0(r,i)&&y0(s,o)&&!Ki)||vn(e,(()=>{if(!t)return void dt(null);if(!Ba(e,r,s))return;let l=X();if(Ki&&z(l)&&l.isCollapsed()){const a=l.anchor,c=Ki.anchor;(a.key===c.key&&a.offset===c.offset+1||a.offset===1&&c.getNode().is(a.getNode().getPreviousSibling()))&&(l=Ki.clone(),dt(l))}if(Ki=null,z(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=An(e).event,h=u?u.timeStamp:performance.now(),[f,d,p,g,m]=Dw,O=Fe(),b=e.isComposing()===!1&&O.getTextContent()==="";if(h<m+200&&a.offset===p&&a.key===g)ou(l,f,d);else if(a.type==="text")q(c)||F(141),Bw(l,c);else if(a.type==="element"&&!b){I(c)||F(259);const x=a.getNode();x.isEmpty()?(function(y,w){const k=w.getTextFormat(),S=w.getTextStyle();ou(y,k,S)})(l,x):ou(l,0,"")}}else{const u=a.key,h=l.focus.key,f=l.getNodes(),d=f.length,p=l.isBackward(),g=p?o:i,m=p?i:o,O=p?h:u,b=p?u:h;let x=iQ,y=!1;for(let w=0;w<d;w++){const k=f[w],S=k.getTextContentSize();if(q(k)&&S!==0&&!(w===0&&k.__key===O&&g===S||w===d-1&&k.__key===b&&m===0)&&(y=!0,x&=k.getFormat(),x===0))break}l.format=y?x:0}}re(e,Bh,void 0)}))}function ou(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function Bw(n,e){ou(n,e.getFormat(),e.getStyle())}function zw(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function dc(n,e){const t=n._compositionKey;if(Tt(null),t!==null&&e!=null){if(e===""){const r=Ke(t),i=ho(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&q(r)&&lO(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
@@ -97,4 +97,4 @@ import{a as R,R as C,p as G,C as nw,D as u0}from"./chunk-EPOLDU6W-CiSVlmCe.js";i
|
|
|
97
97
|
`),r=[];for(const i of t)r.push("> "+i);return r.join(`
|
|
98
98
|
`)},regExp:$Y,replace:(n,e,t,r)=>{if(r){const s=n.getPreviousSibling();if(Zp(s))return s.splice(s.getChildrenSize(),0,[Un(),...e]),s.select(0,0),void n.remove()}const i=Va();i.append(...e),n.replace(i),i.select(0,0)},type:"element"},UP={dependencies:[l0],export:n=>{if(!a0(n))return null;const e=n.getTextContent();return"```"+(n.getLanguage()||"")+(e?`
|
|
99
99
|
`+e:"")+"\n```"},regExpEnd:{optional:!0,regExp:AY},regExpStart:EY,replace:(n,e,t,r,i,s)=>{let o,l;if(!e&&i){if(i.length===1)r?(o=ti(),l=t[1]+i[0]):(o=ti(t[1]),l=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=ti(t[1]),i[0].trim().length===0)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();l=i.join(`
|
|
100
|
-
`)}const a=He(l);o.append(a),n.append(o)}else e&&YP((a=>ti(a?a[1]:void 0)))(n,e,t,s)},type:"multiline-element"},GP={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:_Y,replace:c0("bullet"),type:"element"},LY={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:PY,replace:c0("check"),type:"element"},KP={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:TY,replace:c0("number"),type:"element"},JP={format:["code"],tag:"`",type:"text-format"},IY={format:["highlight"],tag:"==",type:"text-format"},e9={format:["bold","italic"],tag:"***",type:"text-format"},t9={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},n9={format:["bold"],tag:"**",type:"text-format"},r9={format:["bold"],intraword:!1,tag:"__",type:"text-format"},RY={format:["strikethrough"],tag:"~~",type:"text-format"},i9={format:["italic"],tag:"*",type:"text-format"},s9={format:["italic"],intraword:!1,tag:"_",type:"text-format"},o9={dependencies:[hi],export:(n,e,t)=>{if(!xr(n))return null;const r=n.getTitle(),i=e(n);return r?`[${i}](${n.getURL()} "${r}")`:`[${i}](${n.getURL()})`},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{const[,t,r,i]=e,s=Ss(r,{title:i}),o=He(t);return o.setFormat(n.getFormat()),s.append(o),n.replace(s),o},trigger:")",type:"text-match"},NY=[MY,HP,GP,KP],DY=[UP],ZY=[JP,e9,t9,n9,r9,IY,i9,s9,RY],BY=[o9],l9=[...NY,...DY,...ZY,...BY],zY=[{dependencies:[qa],export:n=>df(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Xo();r||n.getNextSibling()!=null?n.replace(i):n.insertBefore(i),i.selectNext()},type:"element"},...l9];function ew({transformers:n=zY}){const[e]=Nt();return R.useEffect((()=>CY(e,n)),[e,n]),null}const VY=Ln({init(n){const e=n.getValue(QO),t=e.includes("headings")?n.getValue(ff):[],r=WY(e,t);n.pubIn({[Qs]:()=>C.createElement(ew,{transformers:r}),[Dv]:()=>C.createElement(ew,{transformers:r})})}}),FY=n=>(e,t,r)=>{const i=n(r);i.append(...t),e.replace(i),i.select(0,0)},XY={dependencies:[qa],export:n=>df(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Xo();r||n.getNextSibling()!=null?n.replace(i):n.insertBefore(i),i.selectNext()},type:"element"};function WY(n,e){const t=[e9,t9,n9,r9,JP,i9,s9];if(n.includes("headings")){const r=Math.min(...e),i=Math.max(...e),s=new RegExp(`^(#{${r},${i}})\\s`),o={dependencies:[Fa],export:(l,a)=>{if(!of(l))return null;const c=Number(l.getTag().slice(1));return"#".repeat(c)+" "+a(l)},regExp:s,replace:FY(l=>{const a=`h${l[1].length}`;return wr(a)}),type:"element"};t.push(o)}if(n.includes("thematicBreak")&&t.push(XY),n.includes("quote")&&t.push(HP),n.includes("link")&&t.push(o9),n.includes("lists")&&t.push(KP,GP,LY),n.includes("codeblock")){const r={...UP,dependencies:[qo],replace:(i,s,o)=>{const l=Ha({code:"",language:o[1]??"",meta:""});i.replace(l),setTimeout(()=>{l.select()},80)}};t.push(r)}return t}const qY=()=>{const n=ut(qu),e=nn(Zv),t=nn(QO),r=t.includes("quote"),i=t.includes("headings"),s=kn();if(!r&&!i)return null;const o=[{label:s("toolbar.blockTypes.paragraph","Paragraph"),value:"paragraph"}];if(r&&o.push({label:s("toolbar.blockTypes.quote","Quote"),value:"quote"}),i){const l=nn(ff);o.push(...l.map(a=>({label:s("toolbar.blockTypes.heading","Heading {{level}}",{level:a}),value:`h${a}`})))}return C.createElement(Zq,{value:e,onChange:l=>{switch(l){case"quote":n(()=>Va());break;case"paragraph":n(()=>Re());break;case"":break;default:if(l.startsWith("h"))n(()=>wr(l));else throw new Error(`Unknown block type: ${l}`)}},triggerTitle:s("toolbar.blockTypeSelect.selectBlockTypeTooltip","Select block type"),placeholder:s("toolbar.blockTypeSelect.placeholder","Block type"),items:o})},hp=({format:n,addTitle:e,removeTitle:t,icon:r,formatName:i})=>{const[s,o]=Wt(Ov,rr),l=ut(xv),a=(s&n)!==0;return C.createElement(G3,{title:a?t:e,on:a,onValueChange:()=>{l(i)}},o(r))},jY=({options:n})=>{const e=kn(),t=typeof n>"u";return C.createElement("div",{className:H.toolbarGroupOfGroups},t||n.includes("Bold")?C.createElement(hp,{format:Ll,addTitle:e("toolbar.bold","Bold"),removeTitle:e("toolbar.removeBold","Remove bold"),icon:"format_bold",formatName:"bold"}):null,t||n.includes("Italic")?C.createElement(hp,{format:Il,addTitle:e("toolbar.italic","Italic"),removeTitle:e("toolbar.removeItalic","Remove italic"),icon:"format_italic",formatName:"italic"}):null,t||n.includes("Underline")?C.createElement(hp,{format:Rl,addTitle:e("toolbar.underline","Underline"),removeTitle:e("toolbar.removeUnderline","Remove underline"),icon:"format_underlined",formatName:"underline"}):null)},YY=()=>{const n=ut(H1),e=nn(rr),t=kn();return C.createElement(jq,{"aria-label":t("toolbar.link","Create link"),title:t("toolbar.link","Create link"),onClick:r=>{n()}},e("link"))},HY=({children:n,SourceToolbar:e,options:t=["rich-text","diff","source"]})=>{const[r,i]=Wt(Ei,rr),s=ut(Ei),o=kn(),l=[];return t.includes("rich-text")&&l.push({title:o("toolbar.richText","Rich text"),contents:i("rich_text"),value:"rich-text"}),t.includes("diff")&&l.push({title:o("toolbar.diffMode","Diff mode"),contents:i("difference"),value:"diff"}),t.includes("source")&&l.push({title:o("toolbar.source","Source mode"),contents:i("markdown"),value:"source"}),C.createElement(C.Fragment,null,r==="rich-text"?n:r==="diff"?C.createElement("span",{className:H.toolbarTitleMode},o("toolbar.diffMode","Diff mode")):e??C.createElement("span",{className:H.toolbarTitleMode},o("toolbar.source","Source mode")),C.createElement("div",{className:H.diffSourceToggleWrapper},C.createElement(K3,{className:H.diffSourceToggle,ggClassName:H.ggDiffSourceToggle,value:r,items:l,onChange:a=>{s(a===""?"rich-text":a)}})))},UY=C.forwardRef((n,e)=>{const t=ut(G5),[r,i]=Wt(yn,rr),s=kn();return C.createElement(P5,{className:H.toolbarButton,ref:e,disabled:r,onClick:()=>{t()}},C.createElement(cc,{title:s("toolbar.image","Insert image")},i("add_photo")))}),GY={bullet:"format_list_bulleted",number:"format_list_numbered",check:"format_list_checked"},KY=({options:n=["bullet","number","check"]})=>{const[e,t]=Wt(cg,rr),r=ut(r5),i=kn(),s={bullet:i("toolbar.bulletedList","Bulleted list"),number:i("toolbar.numberedList","Numbered list"),check:i("toolbar.checkList","Check list")},o=n.map(l=>({value:l,title:s[l],contents:t(GY[l])}));return C.createElement(K3,{value:e||"",items:o,onChange:r})},tw=()=>{const[n,e]=Wt(rr,st),[t,r]=C.useState(!1),[i,s]=C.useState(!1),o=kn();return C.useEffect(()=>{if(e)return ln(e.registerCommand(Ol,l=>(r(l),!1),si),e.registerCommand(ml,l=>(s(l),!1),si))},[e]),C.createElement(Yq,{items:[{title:o("toolbar.undo","Undo {{shortcut}}",{shortcut:ju?"⌘Z":"Ctrl+Z"}),disabled:!t,contents:n("undo"),active:!1,onChange:()=>e?.dispatchCommand(Vh,void 0)},{title:o("toolbar.redo","Redo {{shortcut}}",{shortcut:ju?"⌘Y":"Ctrl+Y"}),disabled:!i,contents:n("redo"),active:!1,onChange:()=>e?.dispatchCommand(Fh,void 0)}]})},JY="_mdxeditor_fpzxa_2",eH="_fullscreenBackdrop_fpzxa_2",tH="_fullscreenContainer_fpzxa_2",nH="_fullscreen_fpzxa_2",iu={mdxeditor:JY,fullscreenBackdrop:eH,fullscreenContainer:tH,fullscreen:nH},rH={match:(n,e)=>!0,priority:0,Editor:n=>{const e=IR();return G.jsxs("div",{className:"flex flex-col bg-gray-100 my-4",onKeyDown:t=>t.nativeEvent.stopImmediatePropagation(),children:[G.jsx("input",{defaultValue:n.language}),G.jsx("textarea",{className:"flex-1",defaultValue:n.code,onChange:t=>e.setCode(t.target.value)})]})}};function iH(n){const e=[];function t(r){for(const i of r)e.push(i),i.children&&t(i.children)}return t(n),e}function
|
|
100
|
+
`)}const a=He(l);o.append(a),n.append(o)}else e&&YP((a=>ti(a?a[1]:void 0)))(n,e,t,s)},type:"multiline-element"},GP={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:_Y,replace:c0("bullet"),type:"element"},LY={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:PY,replace:c0("check"),type:"element"},KP={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:TY,replace:c0("number"),type:"element"},JP={format:["code"],tag:"`",type:"text-format"},IY={format:["highlight"],tag:"==",type:"text-format"},e9={format:["bold","italic"],tag:"***",type:"text-format"},t9={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},n9={format:["bold"],tag:"**",type:"text-format"},r9={format:["bold"],intraword:!1,tag:"__",type:"text-format"},RY={format:["strikethrough"],tag:"~~",type:"text-format"},i9={format:["italic"],tag:"*",type:"text-format"},s9={format:["italic"],intraword:!1,tag:"_",type:"text-format"},o9={dependencies:[hi],export:(n,e,t)=>{if(!xr(n))return null;const r=n.getTitle(),i=e(n);return r?`[${i}](${n.getURL()} "${r}")`:`[${i}](${n.getURL()})`},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{const[,t,r,i]=e,s=Ss(r,{title:i}),o=He(t);return o.setFormat(n.getFormat()),s.append(o),n.replace(s),o},trigger:")",type:"text-match"},NY=[MY,HP,GP,KP],DY=[UP],ZY=[JP,e9,t9,n9,r9,IY,i9,s9,RY],BY=[o9],l9=[...NY,...DY,...ZY,...BY],zY=[{dependencies:[qa],export:n=>df(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Xo();r||n.getNextSibling()!=null?n.replace(i):n.insertBefore(i),i.selectNext()},type:"element"},...l9];function ew({transformers:n=zY}){const[e]=Nt();return R.useEffect((()=>CY(e,n)),[e,n]),null}const VY=Ln({init(n){const e=n.getValue(QO),t=e.includes("headings")?n.getValue(ff):[],r=WY(e,t);n.pubIn({[Qs]:()=>C.createElement(ew,{transformers:r}),[Dv]:()=>C.createElement(ew,{transformers:r})})}}),FY=n=>(e,t,r)=>{const i=n(r);i.append(...t),e.replace(i),i.select(0,0)},XY={dependencies:[qa],export:n=>df(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Xo();r||n.getNextSibling()!=null?n.replace(i):n.insertBefore(i),i.selectNext()},type:"element"};function WY(n,e){const t=[e9,t9,n9,r9,JP,i9,s9];if(n.includes("headings")){const r=Math.min(...e),i=Math.max(...e),s=new RegExp(`^(#{${r},${i}})\\s`),o={dependencies:[Fa],export:(l,a)=>{if(!of(l))return null;const c=Number(l.getTag().slice(1));return"#".repeat(c)+" "+a(l)},regExp:s,replace:FY(l=>{const a=`h${l[1].length}`;return wr(a)}),type:"element"};t.push(o)}if(n.includes("thematicBreak")&&t.push(XY),n.includes("quote")&&t.push(HP),n.includes("link")&&t.push(o9),n.includes("lists")&&t.push(KP,GP,LY),n.includes("codeblock")){const r={...UP,dependencies:[qo],replace:(i,s,o)=>{const l=Ha({code:"",language:o[1]??"",meta:""});i.replace(l),setTimeout(()=>{l.select()},80)}};t.push(r)}return t}const qY=()=>{const n=ut(qu),e=nn(Zv),t=nn(QO),r=t.includes("quote"),i=t.includes("headings"),s=kn();if(!r&&!i)return null;const o=[{label:s("toolbar.blockTypes.paragraph","Paragraph"),value:"paragraph"}];if(r&&o.push({label:s("toolbar.blockTypes.quote","Quote"),value:"quote"}),i){const l=nn(ff);o.push(...l.map(a=>({label:s("toolbar.blockTypes.heading","Heading {{level}}",{level:a}),value:`h${a}`})))}return C.createElement(Zq,{value:e,onChange:l=>{switch(l){case"quote":n(()=>Va());break;case"paragraph":n(()=>Re());break;case"":break;default:if(l.startsWith("h"))n(()=>wr(l));else throw new Error(`Unknown block type: ${l}`)}},triggerTitle:s("toolbar.blockTypeSelect.selectBlockTypeTooltip","Select block type"),placeholder:s("toolbar.blockTypeSelect.placeholder","Block type"),items:o})},hp=({format:n,addTitle:e,removeTitle:t,icon:r,formatName:i})=>{const[s,o]=Wt(Ov,rr),l=ut(xv),a=(s&n)!==0;return C.createElement(G3,{title:a?t:e,on:a,onValueChange:()=>{l(i)}},o(r))},jY=({options:n})=>{const e=kn(),t=typeof n>"u";return C.createElement("div",{className:H.toolbarGroupOfGroups},t||n.includes("Bold")?C.createElement(hp,{format:Ll,addTitle:e("toolbar.bold","Bold"),removeTitle:e("toolbar.removeBold","Remove bold"),icon:"format_bold",formatName:"bold"}):null,t||n.includes("Italic")?C.createElement(hp,{format:Il,addTitle:e("toolbar.italic","Italic"),removeTitle:e("toolbar.removeItalic","Remove italic"),icon:"format_italic",formatName:"italic"}):null,t||n.includes("Underline")?C.createElement(hp,{format:Rl,addTitle:e("toolbar.underline","Underline"),removeTitle:e("toolbar.removeUnderline","Remove underline"),icon:"format_underlined",formatName:"underline"}):null)},YY=()=>{const n=ut(H1),e=nn(rr),t=kn();return C.createElement(jq,{"aria-label":t("toolbar.link","Create link"),title:t("toolbar.link","Create link"),onClick:r=>{n()}},e("link"))},HY=({children:n,SourceToolbar:e,options:t=["rich-text","diff","source"]})=>{const[r,i]=Wt(Ei,rr),s=ut(Ei),o=kn(),l=[];return t.includes("rich-text")&&l.push({title:o("toolbar.richText","Rich text"),contents:i("rich_text"),value:"rich-text"}),t.includes("diff")&&l.push({title:o("toolbar.diffMode","Diff mode"),contents:i("difference"),value:"diff"}),t.includes("source")&&l.push({title:o("toolbar.source","Source mode"),contents:i("markdown"),value:"source"}),C.createElement(C.Fragment,null,r==="rich-text"?n:r==="diff"?C.createElement("span",{className:H.toolbarTitleMode},o("toolbar.diffMode","Diff mode")):e??C.createElement("span",{className:H.toolbarTitleMode},o("toolbar.source","Source mode")),C.createElement("div",{className:H.diffSourceToggleWrapper},C.createElement(K3,{className:H.diffSourceToggle,ggClassName:H.ggDiffSourceToggle,value:r,items:l,onChange:a=>{s(a===""?"rich-text":a)}})))},UY=C.forwardRef((n,e)=>{const t=ut(G5),[r,i]=Wt(yn,rr),s=kn();return C.createElement(P5,{className:H.toolbarButton,ref:e,disabled:r,onClick:()=>{t()}},C.createElement(cc,{title:s("toolbar.image","Insert image")},i("add_photo")))}),GY={bullet:"format_list_bulleted",number:"format_list_numbered",check:"format_list_checked"},KY=({options:n=["bullet","number","check"]})=>{const[e,t]=Wt(cg,rr),r=ut(r5),i=kn(),s={bullet:i("toolbar.bulletedList","Bulleted list"),number:i("toolbar.numberedList","Numbered list"),check:i("toolbar.checkList","Check list")},o=n.map(l=>({value:l,title:s[l],contents:t(GY[l])}));return C.createElement(K3,{value:e||"",items:o,onChange:r})},tw=()=>{const[n,e]=Wt(rr,st),[t,r]=C.useState(!1),[i,s]=C.useState(!1),o=kn();return C.useEffect(()=>{if(e)return ln(e.registerCommand(Ol,l=>(r(l),!1),si),e.registerCommand(ml,l=>(s(l),!1),si))},[e]),C.createElement(Yq,{items:[{title:o("toolbar.undo","Undo {{shortcut}}",{shortcut:ju?"⌘Z":"Ctrl+Z"}),disabled:!t,contents:n("undo"),active:!1,onChange:()=>e?.dispatchCommand(Vh,void 0)},{title:o("toolbar.redo","Redo {{shortcut}}",{shortcut:ju?"⌘Y":"Ctrl+Y"}),disabled:!i,contents:n("redo"),active:!1,onChange:()=>e?.dispatchCommand(Fh,void 0)}]})},JY="_mdxeditor_fpzxa_2",eH="_fullscreenBackdrop_fpzxa_2",tH="_fullscreenContainer_fpzxa_2",nH="_fullscreen_fpzxa_2",iu={mdxeditor:JY,fullscreenBackdrop:eH,fullscreenContainer:tH,fullscreen:nH},rH={match:(n,e)=>!0,priority:0,Editor:n=>{const e=IR();return G.jsxs("div",{className:"flex flex-col bg-gray-100 my-4",onKeyDown:t=>t.nativeEvent.stopImmediatePropagation(),children:[G.jsx("input",{defaultValue:n.language}),G.jsx("textarea",{className:"flex-1",defaultValue:n.code,onChange:t=>e.setCode(t.target.value)})]})}};function iH(n){const e=[];function t(r){for(const i of r)e.push(i),i.children&&t(i.children)}return t(n),e}function NH({id:n,className:e,markdown:t,name:r,register:i,onChange:s,fieldDisplayName:o,fullscreenable:l=!0}){const{data:a}=u9(),c=R.useRef(t),[u,h]=R.useState(!1),f=a9(c9);R.useEffect(()=>{const m=O=>{O.key==="Escape"&&u&&h(!1)};return u&&(document.addEventListener("keydown",m),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",m),document.body.style.overflow=""}},[u]);const d=R.useMemo(()=>a?iH(a):[],[a]),p=()=>G.jsx(G.Fragment,{children:G.jsxs("div",{className:"flex items-center flex-1 gap-1",children:[u&&G.jsxs(G.Fragment,{children:[G.jsx("span",{className:"text-sm font-medium text-gray-600",children:o}),G.jsx(Hc,{})]}),G.jsx(qY,{}),G.jsx(jY,{}),G.jsx(Hc,{}),G.jsx(KY,{options:["bullet","number"]}),G.jsx(Hc,{}),G.jsx(YY,{}),G.jsx(UY,{}),G.jsxs("div",{className:"flex items-center ml-auto gap-1",children:[f?.role==="developer"?G.jsx(HY,{children:G.jsx(tw,{})}):G.jsx(tw,{}),l&&G.jsxs(G.Fragment,{children:[G.jsx(Hc,{}),G.jsx("button",{type:"button",className:"p-1 hover:bg-gray-100 rounded transition-colors",onClick:()=>h(!u),title:u?"Exit fullscreen":"Enter fullscreen","aria-label":u?"Exit fullscreen":"Enter fullscreen",children:u?G.jsx(z9,{size:16}):G.jsx(Z9,{size:16})})]})]})]})}),g=()=>G.jsx("div",{id:n,children:G.jsx(NM,{...i(r),className:uc("flex flex-col w-full rounded-md border border-input bg-transparent text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",iu.mdxeditor,u?iu.fullscreen:e),suppressHtmlProcessing:!0,markdown:t,onChange:s,plugins:[FM(),yL(),pI(),Fq(),$R(),yR({imageAutocompleteSuggestions:d?.filter(m=>m.type!=="directory").map(m=>m.relativePath),imagePreviewHandler:m=>new Promise(O=>O(`/${m}`)),disableImageResize:!0}),UM(),VY(),VR({codeBlockEditorDescriptors:[rH]}),cY({viewMode:"rich-text",diffMarkdown:c.current}),Hq({toolbarClassName:uc("flex flex-row overflow-hidden shrink-0 h-10 border-b bg-white rounded-none",u&&"border-gray-200"),toolbarContents:p})]})});return u?fp.createPortal(G.jsx("div",{className:uc("fixed inset-0 z-50",iu.fullscreenBackdrop),children:G.jsx("div",{className:uc("m-8 h-[calc(100vh-4rem)] flex flex-col bg-white rounded-lg shadow-2xl",iu.fullscreenContainer),children:g()})}),document.body):g()}export{NH as default};
|