@plumix/admin 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/assets/{-errors-Cm7HAP35.js → -errors-CapunOga.js} +1 -1
  2. package/dist/assets/{-schemas-CIUBpPg7.js → -schemas-Cbs_-MW6.js} +1 -1
  3. package/dist/assets/{_-CdARd5HU.js → _-C6mMIz3l.js} +1 -1
  4. package/dist/assets/{_-TJmg5kBm.js → _-CljmxTlS.js} +2 -2
  5. package/dist/assets/{_authenticated-BXBqWQO4.js → _authenticated-BYa_DMSE.js} +1 -1
  6. package/dist/assets/{_authenticated-CjQ1ovXR.js → _authenticated-Dcp2Ynic.js} +1 -1
  7. package/dist/assets/{_authenticated-BXN54ZIX.js → _authenticated-kVO_-7Sn.js} +2 -2
  8. package/dist/assets/{_name-BdQXCH-s.js → _name-BGOHegOZ.js} +1 -1
  9. package/dist/assets/{_name--PFunjJs.js → _name-aKYVqU32.js} +2 -2
  10. package/dist/assets/{_page-BuOOftjn.js → _page--PcGMzdu.js} +2 -2
  11. package/dist/assets/{_page-Cd2qh5Hj.js → _page-Be9sR1G2.js} +1 -1
  12. package/dist/assets/{_slug-D5T6BGMn.js → _slug-Bdb7jL1l.js} +1 -1
  13. package/dist/assets/{_slug-CPq3MyRU.js → _slug-DWmiGCz6.js} +2 -2
  14. package/dist/assets/{_token-DnOWzW7K.js → _token-DVnFp6Xw.js} +2 -2
  15. package/dist/assets/{_token-BV3V8P_y.js → _token-s0TefqyQ.js} +1 -1
  16. package/dist/assets/ar-Dh1_Madu.js +1 -0
  17. package/dist/assets/{bootstrap-BpS0ha2M.js → bootstrap-DAMkwOTO.js} +2 -2
  18. package/dist/assets/{bootstrap-B4UY7ClG.js → bootstrap-oBDU-2AF.js} +1 -1
  19. package/dist/assets/{create-D2nZy-Hm.js → create-3wo13Gal.js} +1 -1
  20. package/dist/assets/{create-Qrx2pnjH.js → create-CICYrKqG.js} +2 -2
  21. package/dist/assets/{create-D7WMBpH9.js → create-CaxQlu5L.js} +1 -1
  22. package/dist/assets/{create-DWhdHiGH.js → create-DQ5AIyqG.js} +2 -2
  23. package/dist/assets/de-BDyIkMJC.js +1 -0
  24. package/dist/assets/{edit-D0M8e03b.js → edit-BN3TXfeW.js} +3 -3
  25. package/dist/assets/{edit-D64WXGYa.js → edit-BskWld1E.js} +2 -2
  26. package/dist/assets/edit-CgWGy3PZ.js +2 -0
  27. package/dist/assets/{edit-BLG323-R.js → edit-DLcsu05p.js} +1 -1
  28. package/dist/assets/{edit-C8cjxuy9.js → edit-DU82eAhY.js} +1 -1
  29. package/dist/assets/{edit-CLCmZdBG.js → edit-DtsKHyYT.js} +2 -2
  30. package/dist/assets/edit-evcBUaDE.js +1 -0
  31. package/dist/assets/en-DYui4aSX.js +1 -0
  32. package/dist/assets/{index-DOeYD9Kh.js → index-CI4pEEIx.js} +2 -2
  33. package/dist/assets/login-Bify50W1.js +1 -0
  34. package/dist/assets/{login-D91-q-s1.js → login-DU7y_Ylt.js} +2 -2
  35. package/dist/assets/manifest-Bdiv3Qyq.js +1 -0
  36. package/dist/assets/{meta-box-9XmyLLTE.js → meta-box-B-hP57rw.js} +1 -1
  37. package/dist/assets/{meta-box-field-CK-LNUI9.js → meta-box-field-BTDudxyS.js} +1 -1
  38. package/dist/assets/{palette-commands-UkUQOwz_.js → palette-commands-DX18c0wH.js} +2 -2
  39. package/dist/assets/register-core-blocks-Bh6u65qH.js +7 -0
  40. package/dist/assets/{settings-B9srnZ7u.js → settings-BtTviWkj.js} +2 -2
  41. package/dist/assets/{settings-DL7pou9m.js → settings-CXPqdjqb.js} +1 -1
  42. package/dist/assets/slug-CAYcbdmW.js +1 -0
  43. package/dist/assets/uk-Cq7H12wQ.js +1 -0
  44. package/dist/assets/{validation-G0OebWge.js → validation-Cl_jr4SS.js} +1 -1
  45. package/dist/assets/zh-CN-YIfV5Hug.js +1 -0
  46. package/dist/index.html +20 -20
  47. package/package.json +5 -5
  48. package/dist/assets/ar-Dlr9PmMq.js +0 -1
  49. package/dist/assets/de-DIaivdrP.js +0 -1
  50. package/dist/assets/edit-B-2O5ofQ.js +0 -2
  51. package/dist/assets/edit-DmKuaq6h.js +0 -1
  52. package/dist/assets/en-0MUT7HwI.js +0 -1
  53. package/dist/assets/login-D-k0G5e9.js +0 -1
  54. package/dist/assets/manifest-CKNOp_Vu.js +0 -1
  55. package/dist/assets/register-core-blocks-BlT-RgVA.js +0 -7
  56. package/dist/assets/tablet-BnclzXSX.js +0 -1
  57. package/dist/assets/uk-DVE7aazP.js +0 -1
  58. package/dist/assets/zh-CN-DA1Ls1Dj.js +0 -1
@@ -1 +1 @@
1
- import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{n}from"./dist-BL2bKHuR.js";import{a as r,i,n as a,r as o,t as s}from"./select-D3kIVy0H.js";import{t as c}from"./button-DG1Ca1S5.js";import{t as l}from"./textarea-iIsBg5jH.js";import{t as u}from"./use-label-CykSHq9A.js";import{D as d,b as f,d as p,h as m,k as h,l as g,p as _,w as v,x as y,y as b}from"./dist-ClOzYsk5.js";import{n as x}from"./vmessage-CRX68a8a.js";import{n as S}from"./validation-G0OebWge.js";import{t as C}from"./input-xYuLUQID.js";import{a as w,f as T,i as E,n as D,o as O,s as k,t as A}from"./form-B_PPIck3.js";import{n as j,t as M}from"./alert-cwX3fWUu.js";import{t as N}from"./valibot-DO4fmSyX.js";import{t as P}from"./meta-box-9XmyLLTE.js";var F=e(t(),1),I={slugFormat:{id:`termForm.slug.format`},rootOption:{id:`termForm.parent.rootOption`}},L=`__root__`,R=m({name:b(v(),d(),p(1),g(200)),slug:b(v(),d(),g(200),y(/^[a-z0-9-]*$/,x(I.slugFormat))),description:b(v(),d(),g(2e3)),parentId:_(S),meta:f(v(),h())});function z({initialValues:e,isHierarchical:t,parentOptions:d,isSubmitting:f,serverError:p,submitLabel:m,metaBoxes:h,onSubmit:g,onCancel:_}){let v=u(),y=T({resolver:N(R),defaultValues:e}),b=y.handleSubmit(e=>{g(e)});return(0,F.jsx)(A,{...y,children:(0,F.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:b,children:[(0,F.jsx)(E,{control:y.control,name:`name`,render:({field:e})=>(0,F.jsxs)(w,{children:[(0,F.jsx)(O,{children:(0,F.jsx)(n,{id:`termForm.name`,message:`Name`})}),(0,F.jsx)(D,{children:(0,F.jsx)(C,{type:`text`,required:!0,disabled:f,"data-testid":`term-form-name-input`,...e})}),(0,F.jsx)(k,{})]})}),(0,F.jsx)(E,{control:y.control,name:`slug`,render:({field:e})=>(0,F.jsxs)(w,{children:[(0,F.jsx)(O,{children:(0,F.jsx)(n,{id:`termForm.slug`,message:`Slug`})}),(0,F.jsx)(D,{children:(0,F.jsx)(C,{type:`text`,autoComplete:`off`,disabled:f,"data-testid":`term-form-slug-input`,...e})}),(0,F.jsx)(k,{})]})}),(0,F.jsx)(E,{control:y.control,name:`description`,render:({field:e})=>(0,F.jsxs)(w,{children:[(0,F.jsx)(O,{children:(0,F.jsx)(n,{id:`termForm.description`,message:`Description`})}),(0,F.jsx)(D,{children:(0,F.jsx)(l,{...e,disabled:f,rows:3,"data-testid":`term-form-description-input`,className:`min-h-20`})}),(0,F.jsx)(k,{})]})}),t?(0,F.jsx)(E,{control:y.control,name:`parentId`,render:({field:e})=>(0,F.jsxs)(w,{children:[(0,F.jsx)(O,{children:(0,F.jsx)(n,{id:`termForm.parent`,message:`Parent`})}),(0,F.jsxs)(s,{value:e.value==null?L:String(e.value),onValueChange:t=>{e.onChange(t===L?null:Number(t))},disabled:f,children:[(0,F.jsx)(D,{children:(0,F.jsx)(i,{className:`w-full`,onBlur:e.onBlur,"data-testid":`term-form-parent-select`,children:(0,F.jsx)(r,{})})}),(0,F.jsxs)(a,{children:[(0,F.jsx)(o,{value:L,"data-testid":`term-form-parent-select-option-root`,children:v(I.rootOption)}),d.map(e=>(0,F.jsx)(o,{value:String(e.id),"data-testid":`term-form-parent-select-option-${e.id}`,children:e.label},e.id))]})]}),(0,F.jsx)(k,{})]})}):null,h.map(e=>(0,F.jsx)(P,{box:e,basePath:`meta`,disabled:f},e.id)),p?(0,F.jsx)(M,{variant:`destructive`,"data-testid":`term-form-server-error`,children:(0,F.jsx)(j,{children:v(p)})}):null,(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,F.jsx)(c,{type:`button`,variant:`outline`,onClick:_,disabled:f,children:(0,F.jsx)(n,{id:`termForm.cancel`,message:`Cancel`})}),(0,F.jsx)(c,{type:`submit`,disabled:f,"data-testid":`term-form-submit`,children:f?(0,F.jsx)(n,{id:`termForm.submitting`,message:`Saving…`}):v(m)})]})]})})}var B={slug_taken:{id:`terms.error.slugTaken`},parent_mismatch:{id:`terms.error.parentMismatch`},parent_self_or_cycle:{id:`terms.error.parentSelfOrCycle`}};function V(){let e=u();return(t,n)=>{let r=H(t);return r===`slug_taken`?e(B.slug_taken):r===`parent_mismatch`?e(B.parent_mismatch):r===`parent_is_self`||r===`parent_cycle`?e(B.parent_self_or_cycle):t instanceof Error?t.message:n}}function H(e){if(e&&typeof e==`object`&&`data`in e)return e.data?.reason}export{z as n,V as t};
1
+ import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{n}from"./dist-BL2bKHuR.js";import{a as r,i,n as a,r as o,t as s}from"./select-D3kIVy0H.js";import{t as c}from"./button-DG1Ca1S5.js";import{t as l}from"./textarea-iIsBg5jH.js";import{t as u}from"./use-label-CykSHq9A.js";import{D as d,b as f,d as p,h as m,k as h,l as g,p as _,w as v,x as y,y as b}from"./dist-ClOzYsk5.js";import{n as x}from"./vmessage-CRX68a8a.js";import{n as S}from"./validation-Cl_jr4SS.js";import{t as C}from"./input-xYuLUQID.js";import{a as w,f as T,i as E,n as D,o as O,s as k,t as A}from"./form-B_PPIck3.js";import{n as j,t as M}from"./alert-cwX3fWUu.js";import{t as N}from"./valibot-DO4fmSyX.js";import{t as P}from"./meta-box-B-hP57rw.js";var F=e(t(),1),I={slugFormat:{id:`termForm.slug.format`},rootOption:{id:`termForm.parent.rootOption`}},L=`__root__`,R=m({name:b(v(),d(),p(1),g(200)),slug:b(v(),d(),g(200),y(/^[a-z0-9-]*$/,x(I.slugFormat))),description:b(v(),d(),g(2e3)),parentId:_(S),meta:f(v(),h())});function z({initialValues:e,isHierarchical:t,parentOptions:d,isSubmitting:f,serverError:p,submitLabel:m,metaBoxes:h,onSubmit:g,onCancel:_}){let v=u(),y=T({resolver:N(R),defaultValues:e}),b=y.handleSubmit(e=>{g(e)});return(0,F.jsx)(A,{...y,children:(0,F.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:b,children:[(0,F.jsx)(E,{control:y.control,name:`name`,render:({field:e})=>(0,F.jsxs)(w,{children:[(0,F.jsx)(O,{children:(0,F.jsx)(n,{id:`termForm.name`,message:`Name`})}),(0,F.jsx)(D,{children:(0,F.jsx)(C,{type:`text`,required:!0,disabled:f,"data-testid":`term-form-name-input`,...e})}),(0,F.jsx)(k,{})]})}),(0,F.jsx)(E,{control:y.control,name:`slug`,render:({field:e})=>(0,F.jsxs)(w,{children:[(0,F.jsx)(O,{children:(0,F.jsx)(n,{id:`termForm.slug`,message:`Slug`})}),(0,F.jsx)(D,{children:(0,F.jsx)(C,{type:`text`,autoComplete:`off`,disabled:f,"data-testid":`term-form-slug-input`,...e})}),(0,F.jsx)(k,{})]})}),(0,F.jsx)(E,{control:y.control,name:`description`,render:({field:e})=>(0,F.jsxs)(w,{children:[(0,F.jsx)(O,{children:(0,F.jsx)(n,{id:`termForm.description`,message:`Description`})}),(0,F.jsx)(D,{children:(0,F.jsx)(l,{...e,disabled:f,rows:3,"data-testid":`term-form-description-input`,className:`min-h-20`})}),(0,F.jsx)(k,{})]})}),t?(0,F.jsx)(E,{control:y.control,name:`parentId`,render:({field:e})=>(0,F.jsxs)(w,{children:[(0,F.jsx)(O,{children:(0,F.jsx)(n,{id:`termForm.parent`,message:`Parent`})}),(0,F.jsxs)(s,{value:e.value==null?L:String(e.value),onValueChange:t=>{e.onChange(t===L?null:Number(t))},disabled:f,children:[(0,F.jsx)(D,{children:(0,F.jsx)(i,{className:`w-full`,onBlur:e.onBlur,"data-testid":`term-form-parent-select`,children:(0,F.jsx)(r,{})})}),(0,F.jsxs)(a,{children:[(0,F.jsx)(o,{value:L,"data-testid":`term-form-parent-select-option-root`,children:v(I.rootOption)}),d.map(e=>(0,F.jsx)(o,{value:String(e.id),"data-testid":`term-form-parent-select-option-${e.id}`,children:e.label},e.id))]})]}),(0,F.jsx)(k,{})]})}):null,h.map(e=>(0,F.jsx)(P,{box:e,basePath:`meta`,disabled:f},e.id)),p?(0,F.jsx)(M,{variant:`destructive`,"data-testid":`term-form-server-error`,children:(0,F.jsx)(j,{children:v(p)})}):null,(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,F.jsx)(c,{type:`button`,variant:`outline`,onClick:_,disabled:f,children:(0,F.jsx)(n,{id:`termForm.cancel`,message:`Cancel`})}),(0,F.jsx)(c,{type:`submit`,disabled:f,"data-testid":`term-form-submit`,children:f?(0,F.jsx)(n,{id:`termForm.submitting`,message:`Saving…`}):v(m)})]})]})})}var B={slug_taken:{id:`terms.error.slugTaken`},parent_mismatch:{id:`terms.error.parentMismatch`},parent_self_or_cycle:{id:`terms.error.parentSelfOrCycle`}};function V(){let e=u();return(t,n)=>{let r=H(t);return r===`slug_taken`?e(B.slug_taken):r===`parent_mismatch`?e(B.parent_mismatch):r===`parent_is_self`||r===`parent_cycle`?e(B.parent_self_or_cycle):t instanceof Error?t.message:n}}function H(e){if(e&&typeof e==`object`&&`data`in e)return e.data?.reason}export{z as n,V as t};
@@ -1 +1 @@
1
- import{O as e,g as t,h as n,s as r,w as i,y as a}from"./dist-ClOzYsk5.js";import{n as o}from"./vmessage-CRX68a8a.js";import{i as s,t as c}from"./validation-G0OebWge.js";var l=n({email:e([a(r(``)),c],o({id:`login.email.invalid`}))}),u=n({email:c,name:t(s,``)}),d=n({lang:t(i())});export{d as n,l as r,u as t};
1
+ import{O as e,g as t,h as n,s as r,w as i,y as a}from"./dist-ClOzYsk5.js";import{n as o}from"./vmessage-CRX68a8a.js";import{i as s,t as c}from"./validation-Cl_jr4SS.js";var l=n({email:e([a(r(``)),c],o({id:`login.email.invalid`}))}),u=n({email:c,name:t(s,``)}),d=n({lang:t(i())});export{d as n,l as r,u as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{t as a}from"./use-label-CykSHq9A.js";import{t as o}from"./edit-skeleton-oIsvepSM.js";import{t as s}from"./_-TJmg5kBm.js";import{r as c}from"./plugin-registry-nSDhEMki.js";import{t as l}from"./plugin-error-boundary-FjZbsCsp.js";var u=e(n()),d=e(t()),f={loadingAria:{id:`pluginPage.loading.aria`}};function p(){let{navItem:e}=s.useRouteContext(),{i18n:t}=r(),n=a()(e.label),i=e.to.replace(/^\/pages/,``),p=c(i);return p?(0,d.jsx)(l,{kind:`page`,pluginLabel:n,children:(0,d.jsx)(u.Suspense,{fallback:(0,d.jsx)(o,{ariaLabel:t._(f.loadingAria.id,{label:n},{message:f.loadingAria.message}),testId:`plugin-page__loading__${i}`}),children:(0,d.jsx)(p,{})})}):(0,d.jsx)(m,{path:i})}function m({path:e}){return(0,d.jsxs)(`div`,{className:`mx-auto max-w-2xl py-12`,"data-testid":`plugin-page__not-loaded__${e}`,children:[(0,d.jsx)(`h1`,{className:`text-2xl font-semibold`,children:(0,d.jsx)(i,{id:`pluginPage.notLoaded.title`,message:`Plugin not loaded`})}),(0,d.jsx)(`p`,{className:`text-muted-foreground mt-2 text-sm`,children:(0,d.jsx)(i,{id:`pluginPage.notLoaded.body`,message:`The admin manifest declares a page at <code>{path}</code> but no React component has been registered for it.`,values:{path:e},components:{code:(0,d.jsx)(`code`,{className:`font-mono`})},comment:`path: the manifest-declared admin-route path (e.g. '/audit-log'); pass through verbatim`})})]})}export{p as component};
1
+ import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{t as a}from"./use-label-CykSHq9A.js";import{t as o}from"./edit-skeleton-oIsvepSM.js";import{t as s}from"./_-CljmxTlS.js";import{r as c}from"./plugin-registry-nSDhEMki.js";import{t as l}from"./plugin-error-boundary-FjZbsCsp.js";var u=e(n()),d=e(t()),f={loadingAria:{id:`pluginPage.loading.aria`}};function p(){let{navItem:e}=s.useRouteContext(),{i18n:t}=r(),n=a()(e.label),i=e.to.replace(/^\/pages/,``),p=c(i);return p?(0,d.jsx)(l,{kind:`page`,pluginLabel:n,children:(0,d.jsx)(u.Suspense,{fallback:(0,d.jsx)(o,{ariaLabel:t._(f.loadingAria.id,{label:n},{message:f.loadingAria.message}),testId:`plugin-page__loading__${i}`}),children:(0,d.jsx)(p,{})})}):(0,d.jsx)(m,{path:i})}function m({path:e}){return(0,d.jsxs)(`div`,{className:`mx-auto max-w-2xl py-12`,"data-testid":`plugin-page__not-loaded__${e}`,children:[(0,d.jsx)(`h1`,{className:`text-2xl font-semibold`,children:(0,d.jsx)(i,{id:`pluginPage.notLoaded.title`,message:`Plugin not loaded`})}),(0,d.jsx)(`p`,{className:`text-muted-foreground mt-2 text-sm`,children:(0,d.jsx)(i,{id:`pluginPage.notLoaded.body`,message:`The admin manifest declares a page at <code>{path}</code> but no React component has been registered for it.`,values:{path:e},components:{code:(0,d.jsx)(`code`,{className:`font-mono`})},comment:`path: the manifest-declared admin-route path (e.g. '/audit-log'); pass through verbatim`})})]})}export{p as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_-CdARd5HU.js","./jsx-runtime-DUAcabCT.js","./react-DbyrFoBd.js","./dist-BL2bKHuR.js","./use-label-CykSHq9A.js","./edit-skeleton-oIsvepSM.js","./card-L2-kK5VK.js","./utils-DKOQrNEG.js","./skeleton-BnBM1862.js","./plugin-registry-nSDhEMki.js","./errors-BDz8PxwA.js","./plugin-error-boundary-FjZbsCsp.js","./dist-DKhWWf1L.js","./triangle-alert-BpzHmkii.js","./createLucideIcon-C0O-yxZG.js","./alert-cwX3fWUu.js"])))=>i.map(i=>d[i]);
2
- import{T as e,a as t,t as n}from"./lazyRouteComponent-CQbKoKTD.js";import{i as r,s as i}from"./matchContext-DKtpdvCQ.js";import{i as a}from"./manifest-CKNOp_Vu.js";import{t as o}from"./caps-SYhabp1B.js";var s=t(`/_authenticated/pages/$`)({beforeLoad:({context:e,params:t})=>{let n=t._splat;if(!n)throw i();let s=a(`/pages/${n}`);if(!s)throw i();if(s.capability&&!o(e.user.capabilities,s.capability))throw r({to:`/`});return{navItem:s}},component:n(()=>e(()=>import(`./_-CdARd5HU.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),`component`)});export{s as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_-C6mMIz3l.js","./jsx-runtime-DUAcabCT.js","./react-DbyrFoBd.js","./dist-BL2bKHuR.js","./use-label-CykSHq9A.js","./edit-skeleton-oIsvepSM.js","./card-L2-kK5VK.js","./utils-DKOQrNEG.js","./skeleton-BnBM1862.js","./plugin-registry-nSDhEMki.js","./errors-BDz8PxwA.js","./plugin-error-boundary-FjZbsCsp.js","./dist-DKhWWf1L.js","./triangle-alert-BpzHmkii.js","./createLucideIcon-C0O-yxZG.js","./alert-cwX3fWUu.js"])))=>i.map(i=>d[i]);
2
+ import{T as e,a as t,t as n}from"./lazyRouteComponent-CQbKoKTD.js";import{i as r,s as i}from"./matchContext-DKtpdvCQ.js";import{i as a}from"./manifest-Bdiv3Qyq.js";import{t as o}from"./caps-SYhabp1B.js";var s=t(`/_authenticated/pages/$`)({beforeLoad:({context:e,params:t})=>{let n=t._splat;if(!n)throw i();let s=a(`/pages/${n}`);if(!s)throw i();if(s.capability&&!o(e.user.capabilities,s.capability))throw r({to:`/`});return{navItem:s}},component:n(()=>e(()=>import(`./_-C6mMIz3l.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),`component`)});export{s as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{t as a}from"./orpc-CmtRGLtZ.js";import{t as o}from"./useQuery-QAYxQfCx.js";import{t as s}from"./link-CI3qhqYu.js";import{t as c}from"./button-DG1Ca1S5.js";import{a as l,i as u,o as d,r as f,t as p}from"./empty-p3QKoEqD.js";import{t as m}from"./createLucideIcon-C0O-yxZG.js";import{n as h,t as g}from"./puzzle-CkL6fcG1.js";import{t as _}from"./use-label-CykSHq9A.js";import{h as v,m as y}from"./manifest-CKNOp_Vu.js";import{t as b}from"./_authenticated-BXN54ZIX.js";import{t as x}from"./use-formatters-DLJOFcWE.js";import{a as S,i as C,n as w,r as T,t as E}from"./card-L2-kK5VK.js";import{t as D}from"./skeleton-BnBM1862.js";import{t as O}from"./plugin-registry-nSDhEMki.js";import{t as k}from"./dates-CSmOj6E-.js";import{t as A}from"./entries-MizUUcD8.js";import{t as j}from"./plugin-error-boundary-FjZbsCsp.js";var M=m(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),N=e(n(),1),P=e(t(),1);function F({widgets:e}){let t=_(),n=e.flatMap(e=>{let t=O(e.id);return t?[{widget:e,Component:t}]:[]});return n.length===0?null:(0,P.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,"data-testid":`dashboard-widgets`,children:n.map(({widget:e,Component:n})=>(0,P.jsxs)(E,{"data-testid":`dashboard-widget-${e.id}`,children:[(0,P.jsx)(C,{children:(0,P.jsx)(S,{children:t(e.title)})}),(0,P.jsx)(w,{children:(0,P.jsx)(j,{kind:`widget`,pluginLabel:t(e.title),children:(0,P.jsx)(N.Suspense,{fallback:(0,P.jsx)(D,{className:`h-16 w-full`}),children:(0,P.jsx)(n,{})})})})]},e.id))})}var I={countPublished:{id:`dashboard.count.published`},countDraft:{id:`dashboard.count.draft`}};function L(){let{user:e}=b.useRouteContext(),t=e.name??e.email,n=v(e.capabilities),m=_(),{i18n:D}=r(),{formatRelative:O}=x(),j=o(a.entry.stats.queryOptions({input:{}})),L=o(a.entry.recentActivity.queryOptions({input:{limit:8}})),R=(0,N.useMemo)(()=>{let e={};for(let t of j.data??[])(e[t.type]??={})[t.status]=t.count;return e},[j.data]);return(0,P.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{"data-testid":`dashboard-welcome-heading`,className:`text-2xl font-semibold`,children:(0,P.jsx)(i,{id:`dashboard.welcome`,message:`Welcome, {greeting}`,values:{greeting:(0,P.jsx)(`bdi`,{children:t})},comment:`greeting: the user's display name or email`})}),(0,P.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,P.jsx)(i,{id:`dashboard.tagline`,message:`What would you like to work on today?`})})]}),n.length>0?(0,P.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-3`,children:n.map(e=>{let t=m(e.labels?.plural??e.label),n=R[e.name]??{};return(0,P.jsxs)(E,{"data-testid":`dashboard-tile-${e.name}`,children:[(0,P.jsxs)(C,{children:[(0,P.jsx)(`div`,{className:`bg-primary/10 text-primary mb-2 flex size-10 items-center justify-center rounded-md`,children:(0,P.jsx)(h,{className:`size-5`,"aria-hidden":!0})}),(0,P.jsx)(S,{children:t}),(0,P.jsxs)(T,{"data-testid":`dashboard-tile-${e.name}-counts`,children:[D._(I.countPublished.id,{count:n.published??0},{message:I.countPublished.message}),` · `,D._(I.countDraft.id,{count:n.draft??0},{message:I.countDraft.message})]})]}),(0,P.jsx)(w,{children:(0,P.jsx)(c,{asChild:!0,variant:`outline`,className:`w-full`,children:(0,P.jsxs)(s,{to:`/entries/$slug`,params:{slug:e.adminSlug},search:A,"data-testid":`dashboard-tile-${e.name}-link`,children:[(0,P.jsx)(i,{id:`dashboard.tile.browse.generic`,message:`Browse`}),(0,P.jsx)(M,{className:`rtl:rotate-180`})]})})})]},e.name)})}):(0,P.jsx)(E,{className:`max-w-xl`,"data-testid":`dashboard-empty-state`,children:(0,P.jsx)(p,{children:(0,P.jsxs)(u,{children:[(0,P.jsx)(l,{variant:`icon`,children:(0,P.jsx)(g,{})}),(0,P.jsx)(d,{children:(0,P.jsx)(i,{id:`dashboard.empty.title`,message:`No content types yet`})}),(0,P.jsx)(f,{children:(0,P.jsx)(i,{id:`dashboard.empty.description`,message:`Add a plugin that registers a post type (e.g. <0>@plumix/plugin-blog</0>) to see it here.`,components:{0:(0,P.jsx)(`code`,{})}})})]})})}),n.length>0?(0,P.jsxs)(E,{"data-testid":`dashboard-recent-activity`,children:[(0,P.jsx)(C,{children:(0,P.jsx)(S,{children:(0,P.jsx)(i,{id:`dashboard.recent.title`,message:`Recent activity`})})}),(0,P.jsx)(w,{children:(L.data??[]).length===0?(0,P.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,P.jsx)(i,{id:`dashboard.recent.empty`,message:`Nothing yet.`})}):(0,P.jsx)(`ul`,{className:`flex flex-col divide-y`,children:(L.data??[]).map(e=>{let t=n.find(t=>t.name===e.type),r=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`truncate`,children:e.title}),(0,P.jsx)(`span`,{className:`text-muted-foreground ms-auto shrink-0 text-xs`,children:O(k(e.updatedAt))})]});return(0,P.jsx)(`li`,{"data-testid":`dashboard-recent-${e.id}`,children:t?(0,P.jsx)(s,{to:`/entries/$slug/$id/edit`,params:{slug:t.adminSlug,id:e.id},className:`hover:text-primary flex items-center gap-2 py-2 text-sm`,children:r}):(0,P.jsx)(`div`,{className:`flex items-center gap-2 py-2 text-sm`,children:r})},e.id)})})})]}):null,(0,P.jsx)(F,{widgets:y(e.capabilities)})]})}export{L as component};
1
+ import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{t as a}from"./orpc-CmtRGLtZ.js";import{t as o}from"./useQuery-QAYxQfCx.js";import{t as s}from"./link-CI3qhqYu.js";import{t as c}from"./button-DG1Ca1S5.js";import{a as l,i as u,o as d,r as f,t as p}from"./empty-p3QKoEqD.js";import{t as m}from"./createLucideIcon-C0O-yxZG.js";import{n as h,t as g}from"./puzzle-CkL6fcG1.js";import{t as _}from"./use-label-CykSHq9A.js";import{g as v,h as y}from"./manifest-Bdiv3Qyq.js";import{t as b}from"./_authenticated-kVO_-7Sn.js";import{t as x}from"./use-formatters-DLJOFcWE.js";import{a as S,i as C,n as w,r as T,t as E}from"./card-L2-kK5VK.js";import{t as D}from"./skeleton-BnBM1862.js";import{t as O}from"./plugin-registry-nSDhEMki.js";import{t as k}from"./dates-CSmOj6E-.js";import{t as A}from"./entries-MizUUcD8.js";import{t as j}from"./plugin-error-boundary-FjZbsCsp.js";var M=m(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),N=e(n(),1),P=e(t(),1);function F({widgets:e}){let t=_(),n=e.flatMap(e=>{let t=O(e.id);return t?[{widget:e,Component:t}]:[]});return n.length===0?null:(0,P.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,"data-testid":`dashboard-widgets`,children:n.map(({widget:e,Component:n})=>(0,P.jsxs)(E,{"data-testid":`dashboard-widget-${e.id}`,children:[(0,P.jsx)(C,{children:(0,P.jsx)(S,{children:t(e.title)})}),(0,P.jsx)(w,{children:(0,P.jsx)(j,{kind:`widget`,pluginLabel:t(e.title),children:(0,P.jsx)(N.Suspense,{fallback:(0,P.jsx)(D,{className:`h-16 w-full`}),children:(0,P.jsx)(n,{})})})})]},e.id))})}var I={countPublished:{id:`dashboard.count.published`},countDraft:{id:`dashboard.count.draft`}};function L(){let{user:e}=b.useRouteContext(),t=e.name??e.email,n=v(e.capabilities),m=_(),{i18n:D}=r(),{formatRelative:O}=x(),j=o(a.entry.stats.queryOptions({input:{}})),L=o(a.entry.recentActivity.queryOptions({input:{limit:8}})),R=(0,N.useMemo)(()=>{let e={};for(let t of j.data??[])(e[t.type]??={})[t.status]=t.count;return e},[j.data]);return(0,P.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{"data-testid":`dashboard-welcome-heading`,className:`text-2xl font-semibold`,children:(0,P.jsx)(i,{id:`dashboard.welcome`,message:`Welcome, {greeting}`,values:{greeting:(0,P.jsx)(`bdi`,{children:t})},comment:`greeting: the user's display name or email`})}),(0,P.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,P.jsx)(i,{id:`dashboard.tagline`,message:`What would you like to work on today?`})})]}),n.length>0?(0,P.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-3`,children:n.map(e=>{let t=m(e.labels?.plural??e.label),n=R[e.name]??{};return(0,P.jsxs)(E,{"data-testid":`dashboard-tile-${e.name}`,children:[(0,P.jsxs)(C,{children:[(0,P.jsx)(`div`,{className:`bg-primary/10 text-primary mb-2 flex size-10 items-center justify-center rounded-md`,children:(0,P.jsx)(h,{className:`size-5`,"aria-hidden":!0})}),(0,P.jsx)(S,{children:t}),(0,P.jsxs)(T,{"data-testid":`dashboard-tile-${e.name}-counts`,children:[D._(I.countPublished.id,{count:n.published??0},{message:I.countPublished.message}),` · `,D._(I.countDraft.id,{count:n.draft??0},{message:I.countDraft.message})]})]}),(0,P.jsx)(w,{children:(0,P.jsx)(c,{asChild:!0,variant:`outline`,className:`w-full`,children:(0,P.jsxs)(s,{to:`/entries/$slug`,params:{slug:e.adminSlug},search:A,"data-testid":`dashboard-tile-${e.name}-link`,children:[(0,P.jsx)(i,{id:`dashboard.tile.browse.generic`,message:`Browse`}),(0,P.jsx)(M,{className:`rtl:rotate-180`})]})})})]},e.name)})}):(0,P.jsx)(E,{className:`max-w-xl`,"data-testid":`dashboard-empty-state`,children:(0,P.jsx)(p,{children:(0,P.jsxs)(u,{children:[(0,P.jsx)(l,{variant:`icon`,children:(0,P.jsx)(g,{})}),(0,P.jsx)(d,{children:(0,P.jsx)(i,{id:`dashboard.empty.title`,message:`No content types yet`})}),(0,P.jsx)(f,{children:(0,P.jsx)(i,{id:`dashboard.empty.description`,message:`Add a plugin that registers a post type (e.g. <0>@plumix/plugin-blog</0>) to see it here.`,components:{0:(0,P.jsx)(`code`,{})}})})]})})}),n.length>0?(0,P.jsxs)(E,{"data-testid":`dashboard-recent-activity`,children:[(0,P.jsx)(C,{children:(0,P.jsx)(S,{children:(0,P.jsx)(i,{id:`dashboard.recent.title`,message:`Recent activity`})})}),(0,P.jsx)(w,{children:(L.data??[]).length===0?(0,P.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,P.jsx)(i,{id:`dashboard.recent.empty`,message:`Nothing yet.`})}):(0,P.jsx)(`ul`,{className:`flex flex-col divide-y`,children:(L.data??[]).map(e=>{let t=n.find(t=>t.name===e.type),r=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`truncate`,children:e.title}),(0,P.jsx)(`span`,{className:`text-muted-foreground ms-auto shrink-0 text-xs`,children:O(k(e.updatedAt))})]});return(0,P.jsx)(`li`,{"data-testid":`dashboard-recent-${e.id}`,children:t?(0,P.jsx)(s,{to:`/entries/$slug/$id/edit`,params:{slug:t.adminSlug,id:e.id},className:`hover:text-primary flex items-center gap-2 py-2 text-sm`,children:r}):(0,P.jsx)(`div`,{className:`flex items-center gap-2 py-2 text-sm`,children:r})},e.id)})})})]}):null,(0,P.jsx)(F,{widgets:y(e.capabilities)})]})}export{L as component};
@@ -1 +1 @@
1
- import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{s as a,t as o}from"./orpc-CmtRGLtZ.js";import{t as ee}from"./useQuery-QAYxQfCx.js";import{t as s}from"./useMutation-vgMtqBOX.js";import{n as c}from"./useStore-Vo4KhxPy.js";import{n as l}from"./Match-Dr0Ejexl.js";import{o as te,t as u}from"./link-CI3qhqYu.js";import{a as d,i as f,o as p,r as ne,t as re}from"./palette-commands-UkUQOwz_.js";import{t as m}from"./createLucideIcon-C0O-yxZG.js";import{A as h,B as g,C as _,D as v,E as y,H as b,I as ie,L as x,M as ae,N as oe,O as S,P as se,R as C,S as w,T,V as ce,a as le,b as ue,d as de,f as E,g as fe,h as pe,i as me,j as he,k as ge,l as D,m as O,n as k,o as A,p as j,r as M,s as N,t as P,u as F,v as I,w as L,x as _e,y as ve,z as R}from"./breadcrumb-x0qfIbU9.js";import{t as ye}from"./chevrons-up-down-DmmG8bmI.js";import{n as z,t as B}from"./puzzle-CkL6fcG1.js";import{t as be}from"./image-CYG4gQQy.js";import{t as V}from"./settings-K6TF73jB.js";import{t as H}from"./use-label-CykSHq9A.js";import{n as U,p as W}from"./manifest-CKNOp_Vu.js";import{t as xe}from"./session-Y-9LAiv-.js";import{i as Se}from"./passkey-DN4QfROE.js";import{t as Ce}from"./separator-DzRLZTkg.js";import{r as we}from"./tooltip-Bf2rZUeB.js";var G=m(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Te=m(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Ee=m(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),De=m(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Oe=m(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),ke=m(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Ae=m(`panels-top-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),je=m(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Me=m(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Ne=m(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),K=e(t(),1),Pe={dashboard:De,content:z,"file-text":z,layout:Ae,image:be,calendar:G,tag:je,folder:Te,users:Ne,settings:V,puzzle:B,mail:ke,key:Ee};function q({name:e}){return(0,K.jsx)(e?Pe[e]:B,{})}function Fe({user:e}){let{isMobile:t}=b(),n=c(),r=s({mutationFn:Se,onSettled:async e=>{if(await n.invalidate(),n.options.context.queryClient.removeQueries({queryKey:xe}),e?.redirectTo){window.location.assign(e.redirectTo);return}await n.navigate({to:`/login`})}}),a=e.name??e.email,o=a.slice(0,2).toUpperCase();return(0,K.jsxs)(ue,{children:[(0,K.jsx)(y,{asChild:!0,children:(0,K.jsxs)(C,{size:`lg`,"data-testid":`user-menu-trigger`,className:`data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground`,children:[(0,K.jsx)(v,{className:`size-8`,children:(0,K.jsx)(S,{className:`bg-sidebar-accent text-sidebar-accent-foreground text-xs font-semibold`,children:o})}),(0,K.jsxs)(`div`,{className:`grid flex-1 text-start text-sm leading-tight`,children:[(0,K.jsx)(`span`,{className:`truncate font-medium`,children:a}),(0,K.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,children:e.email})]}),(0,K.jsx)(ye,{className:`ms-auto size-4`})]})}),(0,K.jsxs)(_e,{className:`w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg`,side:t?`bottom`:`right`,align:`end`,sideOffset:4,children:[(0,K.jsx)(L,{className:`p-0 font-normal`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-1.5 text-start text-sm`,children:[(0,K.jsx)(`div`,{"aria-hidden":!0,className:`bg-sidebar-accent text-sidebar-accent-foreground flex size-8 items-center justify-center rounded-md text-xs font-semibold`,children:o}),(0,K.jsxs)(`div`,{className:`grid flex-1 text-start text-sm leading-tight`,children:[(0,K.jsx)(`span`,{className:`truncate font-medium`,children:a}),(0,K.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,children:e.email})]})]})}),(0,K.jsx)(T,{}),(0,K.jsxs)(w,{children:[(0,K.jsx)(_,{asChild:!0,children:(0,K.jsxs)(u,{to:`/profile`,"data-testid":`user-menu-profile-link`,children:[(0,K.jsx)(Me,{className:`size-4`}),(0,K.jsx)(i,{id:`menu.profile`,message:`Profile`})]})}),(0,K.jsxs)(_,{disabled:!0,children:[(0,K.jsx)(V,{className:`size-4`}),(0,K.jsx)(i,{id:`menu.settings`,message:`Settings`})]})]}),(0,K.jsx)(T,{}),(0,K.jsxs)(_,{onSelect:()=>r.mutate(),disabled:r.isPending,"data-testid":`user-menu-sign-out`,children:[(0,K.jsx)(Oe,{className:`size-4`}),r.isPending?(0,K.jsx)(i,{id:`menu.signOut.pending`,message:`Signing out…`}):(0,K.jsx)(i,{id:`menu.signOut`,message:`Sign out`})]})]})]})}function Ie({user:e,capabilities:t}){let n=W(t),r=H();return(0,K.jsxs)(ge,{collapsible:`icon`,variant:`inset`,children:[(0,K.jsx)(h,{children:n.map(e=>(0,K.jsxs)(ae,{children:[(0,K.jsx)(se,{children:r(e.label)}),(0,K.jsx)(oe,{children:(0,K.jsx)(x,{children:e.items.map(e=>(0,K.jsx)(R,{children:(0,K.jsx)(C,{asChild:!0,tooltip:r(e.label),children:(0,K.jsxs)(u,{to:e.to,activeProps:{"data-active":`true`},activeOptions:{exact:e.exact??!1},children:[(0,K.jsx)(q,{name:e.coreIcon}),(0,K.jsx)(`span`,{children:r(e.label)})]})})},e.to))})})]},e.id))}),(0,K.jsx)(he,{children:(0,K.jsx)(x,{children:(0,K.jsx)(R,{children:(0,K.jsx)(Fe,{user:e})})})})]})}var J=e(n(),1);function Le(e,t){return W(e,t).flatMap(e=>e.items.map(e=>({to:e.to,label:e.label,...e.coreIcon?{coreIcon:e.coreIcon}:{},...e.keywords?{keywords:e.keywords}:{}})))}function Re(e,t,n){let r=t.trim().toLowerCase();return r.length===0?e:e.filter(e=>[e.label,...e.keywords??[]].map(n).join(` `).toLowerCase().includes(r))}function Y(e){let t=e.indexOf(`:`);return t===-1?{domain:e,name:``}:{domain:e.slice(0,t),name:e.slice(t+1)}}function ze(e,t,n){let{domain:r,name:i}=Y(e),o=encodeURIComponent(t);switch(r){case`entry`:return`${a}/entries/${encodeURIComponent(n(i))}/${o}/edit`;case`term`:return`${a}/terms/${encodeURIComponent(i)}/${o}/edit`;case`users`:return`${a}/users/${o}/edit`;default:return null}}function Be(e){return e.metaKey||e.ctrlKey}var X=`plumix.v2.palette.recent`,Ve=8;function He(e){try{let t=[e,...Z().filter(t=>t!==e)].slice(0,Ve);localStorage.setItem(X,JSON.stringify(t))}catch{}}function Z(){try{let e=localStorage.getItem(X);if(e===null)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function Ue(e,t,n){let r=new Map(e.map(e=>[e.to,e])),i=[];for(let e of t){let t=r.get(e);if(t&&i.push(t),i.length>=n)break}return i}var Q=2,We=250,Ge=5,$={title:{id:`palette.title`},description:{id:`palette.description`},placeholder:{id:`palette.placeholder`},empty:{id:`palette.empty`},navigation:{id:`palette.group.navigation`},recent:{id:`palette.group.recent`},commands:{id:`palette.group.commands`},loading:{id:`palette.loading`},hintNavigate:{id:`palette.hint.navigate`},hintSelect:{id:`palette.hint.select`},hintClose:{id:`palette.hint.close`}},Ke=[{id:`core:profile`,title:{id:`palette.command.profile`},coreIcon:`users`,run:({navigate:e})=>void e({to:`/profile`})},{id:`core:settings`,title:{id:`palette.command.settings`},coreIcon:`settings`,capability:`settings:manage`,run:({navigate:e})=>void e({to:`/settings`})}];function qe(e,t){let[n,r]=(0,J.useState)(e);return(0,J.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function Je({capabilities:e}){let[t,n]=(0,J.useState)(!1),[r,i]=(0,J.useState)(``),a=te(),s=H(),c=(0,J.useRef)(!1);(0,J.useEffect)(()=>{function e(e){e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),n(e=>!e))}return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[]);let l=r.trim(),u=qe(l,We),d=ee(o.search.query.queryOptions({input:{query:u},enabled:t&&u.length>=Q})),f=ne([...Ke,...re()],e,l,s),p=Re(Le(e),l,s),m=t&&l.length===0?Ue(p,Z(),Ge):[],h=l.length>=Q?d.data??[]:[],g=l.length>=Q&&(l!==u||d.isFetching);function _(){n(!1),i(``)}function v(e){He(e),_(),a({to:e})}function y(e,t){let n=c.current;if(c.current=!1,_(),n){let n=ze(e,t,e=>U(e)?.adminSlug??e);n&&window.open(n,`_blank`,`noopener,noreferrer`);return}let{domain:r,name:i}=Y(e);switch(r){case`entry`:{let e=U(i)?.adminSlug??i;a({to:`/entries/$slug/$id/edit`,params:{slug:e,id:Number(t)}});return}case`term`:a({to:`/terms/$name/$id/edit`,params:{name:i,id:Number(t)}});return;case`users`:a({to:`/users/$id/edit`,params:{id:Number(t)}});return}}function b(e){c.current=Be(e)}return(0,K.jsxs)(O,{open:t,onOpenChange:e=>{n(e),e||i(``)},children:[(0,K.jsxs)(I,{className:`sr-only`,children:[(0,K.jsx)(ve,{children:s($.title)}),(0,K.jsx)(fe,{children:s($.description)})]}),(0,K.jsx)(pe,{className:`overflow-hidden p-0`,children:(0,K.jsxs)(N,{shouldFilter:!1,onClickCapture:b,onKeyDown:e=>{e.key===`Enter`&&b(e)},children:[(0,K.jsx)(de,{value:r,onValueChange:i,"data-testid":`command-palette-input`,placeholder:s($.placeholder)}),(0,K.jsxs)(j,{children:[g?(0,K.jsx)(`div`,{"data-testid":`command-palette-loading`,className:`text-muted-foreground px-3 py-2 text-sm`,children:s($.loading)}):(0,K.jsx)(D,{children:s($.empty)}),m.length>0?(0,K.jsx)(F,{heading:s($.recent),children:m.map(e=>(0,K.jsxs)(E,{value:`recent:${e.to}`,"data-testid":`command-palette-recent-${e.to}`,onSelect:()=>{v(e.to)},children:[(0,K.jsx)(q,{name:e.coreIcon}),(0,K.jsx)(`span`,{children:s(e.label)})]},`recent:${e.to}`))}):null,f.length>0?(0,K.jsx)(F,{heading:s($.commands),children:f.map(e=>(0,K.jsxs)(E,{value:e.id,"data-testid":`command-palette-command-${e.id}`,onSelect:()=>{_(),e.run({navigate:a})},children:[e.coreIcon?(0,K.jsx)(q,{name:e.coreIcon}):null,(0,K.jsx)(`span`,{children:s(e.title)})]},e.id))}):null,p.length>0?(0,K.jsx)(F,{heading:s($.navigation),children:p.map(e=>(0,K.jsxs)(E,{value:e.to,"data-testid":`command-palette-nav-${e.to}`,onSelect:()=>{v(e.to)},children:[(0,K.jsx)(q,{name:e.coreIcon}),(0,K.jsx)(`span`,{children:s(e.label)})]},e.to))}):null,h.map(e=>(0,K.jsx)(F,{heading:s(e.label),children:e.items.map(t=>(0,K.jsx)(E,{value:`${e.key}:${t.id}`,"data-testid":`command-palette-result-${e.key}:${t.id}`,onSelect:()=>{y(e.key,t.id)},children:(0,K.jsx)(`span`,{children:t.title})},`${e.key}:${t.id}`))},e.key))]}),(0,K.jsxs)(`div`,{"data-testid":`command-palette-footer`,className:`text-muted-foreground flex items-center gap-4 border-t px-3 py-2 text-xs`,children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(A,{children:`↑↓`}),s($.hintNavigate)]}),(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(A,{children:`↵`}),s($.hintSelect)]}),(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(A,{children:`⎋`}),s($.hintClose)]})]})]})})]})}function Ye(){return d(p({select:e=>e.location.pathname}))}function Xe(){let e=Ye(),{i18n:t}=r(),n=e=>typeof e.label==`string`?e.label:t._(e.label.id,e.values,{message:e.label.message});return(0,K.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-2 border-b px-4`,children:[(0,K.jsx)(ce,{className:`-ms-1`}),(0,K.jsx)(Ce,{orientation:`vertical`,className:`me-2 h-4`}),(0,K.jsx)(P,{children:(0,K.jsx)(M,{children:e.map((t,r)=>{let i=r===e.length-1,a=n(t);return(0,K.jsxs)(J.Fragment,{children:[r>0?(0,K.jsx)(le,{}):null,(0,K.jsx)(k,{children:i?(0,K.jsx)(me,{children:a}):t.to===void 0?(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:a}):(0,K.jsx)(u,{to:t.to,className:`text-muted-foreground hover:text-foreground transition-colors`,children:a})})]},`${String(r)}-${a}`)})})})]})}function Ze(){let{user:e}=f.useRouteContext();return(0,K.jsx)(we,{delayDuration:100,children:(0,K.jsxs)(g,{children:[(0,K.jsx)(Je,{capabilities:e.capabilities}),(0,K.jsx)(Ie,{user:e,capabilities:e.capabilities}),(0,K.jsxs)(ie,{children:[(0,K.jsx)(Xe,{}),(0,K.jsx)(`main`,{className:`flex-1 overflow-y-auto p-6`,children:(0,K.jsx)(l,{})})]})]})})}export{Ze as component};
1
+ import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{s as a,t as o}from"./orpc-CmtRGLtZ.js";import{t as ee}from"./useQuery-QAYxQfCx.js";import{t as s}from"./useMutation-vgMtqBOX.js";import{n as c}from"./useStore-Vo4KhxPy.js";import{n as l}from"./Match-Dr0Ejexl.js";import{o as te,t as u}from"./link-CI3qhqYu.js";import{a as d,i as f,o as p,r as ne,t as re}from"./palette-commands-DX18c0wH.js";import{t as m}from"./createLucideIcon-C0O-yxZG.js";import{A as h,B as g,C as _,D as v,E as y,H as b,I as ie,L as x,M as ae,N as oe,O as S,P as se,R as C,S as w,T,V as ce,a as le,b as ue,d as de,f as E,g as fe,h as pe,i as me,j as he,k as ge,l as D,m as O,n as k,o as A,p as j,r as M,s as N,t as P,u as F,v as I,w as L,x as _e,y as ve,z as R}from"./breadcrumb-x0qfIbU9.js";import{t as ye}from"./chevrons-up-down-DmmG8bmI.js";import{n as z,t as B}from"./puzzle-CkL6fcG1.js";import{t as be}from"./image-CYG4gQQy.js";import{t as V}from"./settings-K6TF73jB.js";import{t as H}from"./use-label-CykSHq9A.js";import{m as U,n as W}from"./manifest-Bdiv3Qyq.js";import{t as xe}from"./session-Y-9LAiv-.js";import{i as Se}from"./passkey-DN4QfROE.js";import{t as Ce}from"./separator-DzRLZTkg.js";import{r as we}from"./tooltip-Bf2rZUeB.js";var G=m(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Te=m(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Ee=m(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),De=m(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Oe=m(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),ke=m(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Ae=m(`panels-top-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),je=m(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Me=m(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Ne=m(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),K=e(t(),1),Pe={dashboard:De,content:z,"file-text":z,layout:Ae,image:be,calendar:G,tag:je,folder:Te,users:Ne,settings:V,puzzle:B,mail:ke,key:Ee};function q({name:e}){return(0,K.jsx)(e?Pe[e]:B,{})}function Fe({user:e}){let{isMobile:t}=b(),n=c(),r=s({mutationFn:Se,onSettled:async e=>{if(await n.invalidate(),n.options.context.queryClient.removeQueries({queryKey:xe}),e?.redirectTo){window.location.assign(e.redirectTo);return}await n.navigate({to:`/login`})}}),a=e.name??e.email,o=a.slice(0,2).toUpperCase();return(0,K.jsxs)(ue,{children:[(0,K.jsx)(y,{asChild:!0,children:(0,K.jsxs)(C,{size:`lg`,"data-testid":`user-menu-trigger`,className:`data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground`,children:[(0,K.jsx)(v,{className:`size-8`,children:(0,K.jsx)(S,{className:`bg-sidebar-accent text-sidebar-accent-foreground text-xs font-semibold`,children:o})}),(0,K.jsxs)(`div`,{className:`grid flex-1 text-start text-sm leading-tight`,children:[(0,K.jsx)(`span`,{className:`truncate font-medium`,children:a}),(0,K.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,children:e.email})]}),(0,K.jsx)(ye,{className:`ms-auto size-4`})]})}),(0,K.jsxs)(_e,{className:`w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg`,side:t?`bottom`:`right`,align:`end`,sideOffset:4,children:[(0,K.jsx)(L,{className:`p-0 font-normal`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-1.5 text-start text-sm`,children:[(0,K.jsx)(`div`,{"aria-hidden":!0,className:`bg-sidebar-accent text-sidebar-accent-foreground flex size-8 items-center justify-center rounded-md text-xs font-semibold`,children:o}),(0,K.jsxs)(`div`,{className:`grid flex-1 text-start text-sm leading-tight`,children:[(0,K.jsx)(`span`,{className:`truncate font-medium`,children:a}),(0,K.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,children:e.email})]})]})}),(0,K.jsx)(T,{}),(0,K.jsxs)(w,{children:[(0,K.jsx)(_,{asChild:!0,children:(0,K.jsxs)(u,{to:`/profile`,"data-testid":`user-menu-profile-link`,children:[(0,K.jsx)(Me,{className:`size-4`}),(0,K.jsx)(i,{id:`menu.profile`,message:`Profile`})]})}),(0,K.jsxs)(_,{disabled:!0,children:[(0,K.jsx)(V,{className:`size-4`}),(0,K.jsx)(i,{id:`menu.settings`,message:`Settings`})]})]}),(0,K.jsx)(T,{}),(0,K.jsxs)(_,{onSelect:()=>r.mutate(),disabled:r.isPending,"data-testid":`user-menu-sign-out`,children:[(0,K.jsx)(Oe,{className:`size-4`}),r.isPending?(0,K.jsx)(i,{id:`menu.signOut.pending`,message:`Signing out…`}):(0,K.jsx)(i,{id:`menu.signOut`,message:`Sign out`})]})]})]})}function Ie({user:e,capabilities:t}){let n=U(t),r=H();return(0,K.jsxs)(ge,{collapsible:`icon`,variant:`inset`,children:[(0,K.jsx)(h,{children:n.map(e=>(0,K.jsxs)(ae,{children:[(0,K.jsx)(se,{children:r(e.label)}),(0,K.jsx)(oe,{children:(0,K.jsx)(x,{children:e.items.map(e=>(0,K.jsx)(R,{children:(0,K.jsx)(C,{asChild:!0,tooltip:r(e.label),children:(0,K.jsxs)(u,{to:e.to,activeProps:{"data-active":`true`},activeOptions:{exact:e.exact??!1},children:[(0,K.jsx)(q,{name:e.coreIcon}),(0,K.jsx)(`span`,{children:r(e.label)})]})})},e.to))})})]},e.id))}),(0,K.jsx)(he,{children:(0,K.jsx)(x,{children:(0,K.jsx)(R,{children:(0,K.jsx)(Fe,{user:e})})})})]})}var J=e(n(),1);function Le(e,t){return U(e,t).flatMap(e=>e.items.map(e=>({to:e.to,label:e.label,...e.coreIcon?{coreIcon:e.coreIcon}:{},...e.keywords?{keywords:e.keywords}:{}})))}function Re(e,t,n){let r=t.trim().toLowerCase();return r.length===0?e:e.filter(e=>[e.label,...e.keywords??[]].map(n).join(` `).toLowerCase().includes(r))}function Y(e){let t=e.indexOf(`:`);return t===-1?{domain:e,name:``}:{domain:e.slice(0,t),name:e.slice(t+1)}}function ze(e,t,n){let{domain:r,name:i}=Y(e),o=encodeURIComponent(t);switch(r){case`entry`:return`${a}/entries/${encodeURIComponent(n(i))}/${o}/edit`;case`term`:return`${a}/terms/${encodeURIComponent(i)}/${o}/edit`;case`users`:return`${a}/users/${o}/edit`;default:return null}}function Be(e){return e.metaKey||e.ctrlKey}var X=`plumix.v2.palette.recent`,Ve=8;function He(e){try{let t=[e,...Z().filter(t=>t!==e)].slice(0,Ve);localStorage.setItem(X,JSON.stringify(t))}catch{}}function Z(){try{let e=localStorage.getItem(X);if(e===null)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function Ue(e,t,n){let r=new Map(e.map(e=>[e.to,e])),i=[];for(let e of t){let t=r.get(e);if(t&&i.push(t),i.length>=n)break}return i}var Q=2,We=250,Ge=5,$={title:{id:`palette.title`},description:{id:`palette.description`},placeholder:{id:`palette.placeholder`},empty:{id:`palette.empty`},navigation:{id:`palette.group.navigation`},recent:{id:`palette.group.recent`},commands:{id:`palette.group.commands`},loading:{id:`palette.loading`},hintNavigate:{id:`palette.hint.navigate`},hintSelect:{id:`palette.hint.select`},hintClose:{id:`palette.hint.close`}},Ke=[{id:`core:profile`,title:{id:`palette.command.profile`},coreIcon:`users`,run:({navigate:e})=>void e({to:`/profile`})},{id:`core:settings`,title:{id:`palette.command.settings`},coreIcon:`settings`,capability:`settings:manage`,run:({navigate:e})=>void e({to:`/settings`})}];function qe(e,t){let[n,r]=(0,J.useState)(e);return(0,J.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function Je({capabilities:e}){let[t,n]=(0,J.useState)(!1),[r,i]=(0,J.useState)(``),a=te(),s=H(),c=(0,J.useRef)(!1);(0,J.useEffect)(()=>{function e(e){e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),n(e=>!e))}return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[]);let l=r.trim(),u=qe(l,We),d=ee(o.search.query.queryOptions({input:{query:u},enabled:t&&u.length>=Q})),f=ne([...Ke,...re()],e,l,s),p=Re(Le(e),l,s),m=t&&l.length===0?Ue(p,Z(),Ge):[],h=l.length>=Q?d.data??[]:[],g=l.length>=Q&&(l!==u||d.isFetching);function _(){n(!1),i(``)}function v(e){He(e),_(),a({to:e})}function y(e,t){let n=c.current;if(c.current=!1,_(),n){let n=ze(e,t,e=>W(e)?.adminSlug??e);n&&window.open(n,`_blank`,`noopener,noreferrer`);return}let{domain:r,name:i}=Y(e);switch(r){case`entry`:{let e=W(i)?.adminSlug??i;a({to:`/entries/$slug/$id/edit`,params:{slug:e,id:Number(t)}});return}case`term`:a({to:`/terms/$name/$id/edit`,params:{name:i,id:Number(t)}});return;case`users`:a({to:`/users/$id/edit`,params:{id:Number(t)}});return}}function b(e){c.current=Be(e)}return(0,K.jsxs)(O,{open:t,onOpenChange:e=>{n(e),e||i(``)},children:[(0,K.jsxs)(I,{className:`sr-only`,children:[(0,K.jsx)(ve,{children:s($.title)}),(0,K.jsx)(fe,{children:s($.description)})]}),(0,K.jsx)(pe,{className:`overflow-hidden p-0`,children:(0,K.jsxs)(N,{shouldFilter:!1,onClickCapture:b,onKeyDown:e=>{e.key===`Enter`&&b(e)},children:[(0,K.jsx)(de,{value:r,onValueChange:i,"data-testid":`command-palette-input`,placeholder:s($.placeholder)}),(0,K.jsxs)(j,{children:[g?(0,K.jsx)(`div`,{"data-testid":`command-palette-loading`,className:`text-muted-foreground px-3 py-2 text-sm`,children:s($.loading)}):(0,K.jsx)(D,{children:s($.empty)}),m.length>0?(0,K.jsx)(F,{heading:s($.recent),children:m.map(e=>(0,K.jsxs)(E,{value:`recent:${e.to}`,"data-testid":`command-palette-recent-${e.to}`,onSelect:()=>{v(e.to)},children:[(0,K.jsx)(q,{name:e.coreIcon}),(0,K.jsx)(`span`,{children:s(e.label)})]},`recent:${e.to}`))}):null,f.length>0?(0,K.jsx)(F,{heading:s($.commands),children:f.map(e=>(0,K.jsxs)(E,{value:e.id,"data-testid":`command-palette-command-${e.id}`,onSelect:()=>{_(),e.run({navigate:a})},children:[e.coreIcon?(0,K.jsx)(q,{name:e.coreIcon}):null,(0,K.jsx)(`span`,{children:s(e.title)})]},e.id))}):null,p.length>0?(0,K.jsx)(F,{heading:s($.navigation),children:p.map(e=>(0,K.jsxs)(E,{value:e.to,"data-testid":`command-palette-nav-${e.to}`,onSelect:()=>{v(e.to)},children:[(0,K.jsx)(q,{name:e.coreIcon}),(0,K.jsx)(`span`,{children:s(e.label)})]},e.to))}):null,h.map(e=>(0,K.jsx)(F,{heading:s(e.label),children:e.items.map(t=>(0,K.jsx)(E,{value:`${e.key}:${t.id}`,"data-testid":`command-palette-result-${e.key}:${t.id}`,onSelect:()=>{y(e.key,t.id)},children:(0,K.jsx)(`span`,{children:t.title})},`${e.key}:${t.id}`))},e.key))]}),(0,K.jsxs)(`div`,{"data-testid":`command-palette-footer`,className:`text-muted-foreground flex items-center gap-4 border-t px-3 py-2 text-xs`,children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(A,{children:`↑↓`}),s($.hintNavigate)]}),(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(A,{children:`↵`}),s($.hintSelect)]}),(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(A,{children:`⎋`}),s($.hintClose)]})]})]})})]})}function Ye(){return d(p({select:e=>e.location.pathname}))}function Xe(){let e=Ye(),{i18n:t}=r(),n=e=>typeof e.label==`string`?e.label:t._(e.label.id,e.values,{message:e.label.message});return(0,K.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-2 border-b px-4`,children:[(0,K.jsx)(ce,{className:`-ms-1`}),(0,K.jsx)(Ce,{orientation:`vertical`,className:`me-2 h-4`}),(0,K.jsx)(P,{children:(0,K.jsx)(M,{children:e.map((t,r)=>{let i=r===e.length-1,a=n(t);return(0,K.jsxs)(J.Fragment,{children:[r>0?(0,K.jsx)(le,{}):null,(0,K.jsx)(k,{children:i?(0,K.jsx)(me,{children:a}):t.to===void 0?(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:a}):(0,K.jsx)(u,{to:t.to,className:`text-muted-foreground hover:text-foreground transition-colors`,children:a})})]},`${String(r)}-${a}`)})})})]})}function Ze(){let{user:e}=f.useRouteContext();return(0,K.jsx)(we,{delayDuration:100,children:(0,K.jsxs)(g,{children:[(0,K.jsx)(Je,{capabilities:e.capabilities}),(0,K.jsx)(Ie,{user:e,capabilities:e.capabilities}),(0,K.jsxs)(ie,{children:[(0,K.jsx)(Xe,{}),(0,K.jsx)(`main`,{className:`flex-1 overflow-y-auto p-6`,children:(0,K.jsx)(l,{})})]})]})})}export{Ze as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_authenticated-BXBqWQO4.js","./jsx-runtime-DUAcabCT.js","./react-DbyrFoBd.js","./dist-BL2bKHuR.js","./orpc-CmtRGLtZ.js","./useQuery-QAYxQfCx.js","./link-CI3qhqYu.js","./react-dom-i-Mcm3wj.js","./useStore-Vo4KhxPy.js","./with-selector-Bf4HMdmS.js","./button-DG1Ca1S5.js","./dist-Dgy1ZZMQ.js","./utils-DKOQrNEG.js","./dist-B66OmIyr.js","./empty-p3QKoEqD.js","./createLucideIcon-C0O-yxZG.js","./puzzle-CkL6fcG1.js","./use-label-CykSHq9A.js","./manifest-CKNOp_Vu.js","./style-emitter-CDGtTiRG.js","./use-formatters-DLJOFcWE.js","./dist-DKhWWf1L.js","./card-L2-kK5VK.js","./skeleton-BnBM1862.js","./plugin-registry-nSDhEMki.js","./errors-BDz8PxwA.js","./dates-CSmOj6E-.js","./entries-MizUUcD8.js","./plugin-error-boundary-FjZbsCsp.js","./triangle-alert-BpzHmkii.js","./alert-cwX3fWUu.js"])))=>i.map(i=>d[i]);
2
- import{T as e,a as t,t as n}from"./lazyRouteComponent-CQbKoKTD.js";var r=t(`/_authenticated/`)({component:n(()=>e(()=>import(`./_authenticated-BXBqWQO4.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url),`component`)});export{r as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_authenticated-BYa_DMSE.js","./jsx-runtime-DUAcabCT.js","./react-DbyrFoBd.js","./dist-BL2bKHuR.js","./orpc-CmtRGLtZ.js","./useQuery-QAYxQfCx.js","./link-CI3qhqYu.js","./react-dom-i-Mcm3wj.js","./useStore-Vo4KhxPy.js","./with-selector-Bf4HMdmS.js","./button-DG1Ca1S5.js","./dist-Dgy1ZZMQ.js","./utils-DKOQrNEG.js","./dist-B66OmIyr.js","./empty-p3QKoEqD.js","./createLucideIcon-C0O-yxZG.js","./puzzle-CkL6fcG1.js","./use-label-CykSHq9A.js","./manifest-Bdiv3Qyq.js","./style-emitter-CDGtTiRG.js","./use-formatters-DLJOFcWE.js","./dist-DKhWWf1L.js","./card-L2-kK5VK.js","./skeleton-BnBM1862.js","./plugin-registry-nSDhEMki.js","./errors-BDz8PxwA.js","./dates-CSmOj6E-.js","./entries-MizUUcD8.js","./plugin-error-boundary-FjZbsCsp.js","./triangle-alert-BpzHmkii.js","./alert-cwX3fWUu.js"])))=>i.map(i=>d[i]);
2
+ import{T as e,a as t,t as n}from"./lazyRouteComponent-CQbKoKTD.js";var r=t(`/_authenticated/`)({component:n(()=>e(()=>import(`./_authenticated-BYa_DMSE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url),`component`)});export{r as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{n as r}from"./dist-BL2bKHuR.js";import{t as i}from"./orpc-CmtRGLtZ.js";import{t as a}from"./useQuery-QAYxQfCx.js";import{t as o}from"./link-CI3qhqYu.js";import{t as s}from"./button-DG1Ca1S5.js";import{i as c,n as l,o as u,r as d,t as f}from"./empty-p3QKoEqD.js";import{n as p,r as m,t as h}from"./search-input-BG9KotQw.js";import{K as g}from"./utils-kFAy0YTP.js";import{t as _}from"./use-label-CykSHq9A.js";import{t as v}from"./caps-SYhabp1B.js";import{n as y}from"./type-labels-DEpt0nSb.js";import{t as b}from"./_name--PFunjJs.js";import{n as x,t as S}from"./alert-cwX3fWUu.js";import{r as C,t as w}from"./tree-BUpunTXw.js";var T=e(n()),E=e(t()),D={columnName:{id:`terms.list.column.name`},columnDescription:{id:`terms.list.column.description`}},O=50,k=200;function A(e,t,n){return!t||n?e.map(e=>({term:e,displayDepth:0})):C(w(e)).map(e=>({term:e.term,displayDepth:e.depth}))}function j(){let e=b.useNavigate();return{setPage:(0,T.useCallback)(t=>{e({search:e=>({...e,page:t})})},[e]),setSearch:(0,T.useCallback)(t=>{e({search:e=>({...e,q:t,page:1})})},[e])}}function M(){let e=b.useSearch(),{user:t,taxonomy:n}=b.useRouteContext(),r=_(),c=n.isHierarchical===!0,l=c?k:O,u=a(i.term.list.queryOptions({input:{taxonomy:n.name,limit:l,offset:(e.page-1)*l,...e.q?{search:e.q}:{}}})),{setPage:d,setSearch:f}=j(),C=u.data,w=(0,T.useMemo)(()=>A(C??[],c,!!e.q),[C,c,e.q]),M=e.page>1,P=(C?.length??0)===l,F=v(t.capabilities,`term:${n.name}:edit`),I=(0,T.useMemo)(()=>[{accessorKey:`name`,header:r(D.columnName),cell:({row:e})=>{let t=e.original.term,r=e.original.displayDepth;return(0,E.jsxs)(o,{to:`/terms/$name/$id/edit`,params:{name:n.name,id:t.id},"data-testid":`taxonomy-list-row-${String(t.id)}`,"aria-level":r+1,className:`hover:text-primary flex min-w-0 flex-col transition-colors`,children:[(0,E.jsxs)(`span`,{className:`font-medium`,children:[r>0?(0,E.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/60 me-1 font-normal select-none`,children:`— `.repeat(r)}):null,t.name]}),(0,E.jsx)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:t.slug})]})}},{accessorKey:`description`,header:r(D.columnDescription),cell:({row:e})=>{let t=e.original.term.description;return t===null||t.length===0?(0,E.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/50`,children:`—`}):(0,E.jsx)(`span`,{className:`text-muted-foreground line-clamp-1 text-sm`,children:t})}}],[n.name,r]);return(0,E.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`h1`,{"data-testid":`taxonomy-list-heading`,className:`text-2xl font-semibold capitalize`,children:r(n.label)}),n.description?(0,E.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:n.description}):null]}),F?(0,E.jsx)(s,{asChild:!0,children:(0,E.jsxs)(o,{to:`/terms/$name/create`,params:{name:n.name},"data-testid":`taxonomy-list-new-button`,children:[(0,E.jsx)(g,{}),r(y(n,`addNewItem`))]})}):null]}),(0,E.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,E.jsx)(`div`,{className:`ms-auto`,children:(0,E.jsx)(h,{initialValue:e.q??``,placeholder:r(y(n,`searchItems`)),testId:`taxonomy-list-search-input`,onCommit:f},e.q??``)})}),u.isError?(0,E.jsx)(S,{variant:`destructive`,children:(0,E.jsx)(x,{children:u.error instanceof Error?u.error.message:r(y(n,`loadErrorItems`))})}):(0,E.jsx)(m,{columns:I,data:w,isLoading:u.isPending,loadingLabel:r(y(n,`loadingItems`)),emptyState:(0,E.jsx)(N,{taxonomy:n,canCreate:F})}),(0,E.jsx)(p,{page:e.page,canPrev:M,canNext:P,isLoading:u.isPending,onPageChange:d})]})}function N({taxonomy:e,canCreate:t}){let n=_(),i=n(y(e,`addNewItem`));return(0,E.jsxs)(f,{"data-testid":`taxonomy-list-empty-state`,className:`border`,children:[(0,E.jsxs)(c,{children:[(0,E.jsx)(u,{children:n(y(e,`notFound`))}),(0,E.jsx)(d,{children:(0,E.jsx)(r,{id:`terms.list.empty.description`,message:`Create one to see it here.`})})]}),(0,E.jsx)(l,{children:t?(0,E.jsx)(s,{asChild:!0,children:(0,E.jsxs)(o,{to:`/terms/$name/create`,params:{name:e.name},children:[(0,E.jsx)(g,{}),i]})}):(0,E.jsxs)(s,{disabled:!0,children:[(0,E.jsx)(g,{}),i]})})]})}export{M as component};
1
+ import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{n as r}from"./dist-BL2bKHuR.js";import{t as i}from"./orpc-CmtRGLtZ.js";import{t as a}from"./useQuery-QAYxQfCx.js";import{t as o}from"./link-CI3qhqYu.js";import{t as s}from"./button-DG1Ca1S5.js";import{i as c,n as l,o as u,r as d,t as f}from"./empty-p3QKoEqD.js";import{n as p,r as m,t as h}from"./search-input-BG9KotQw.js";import{K as g}from"./utils-kFAy0YTP.js";import{t as _}from"./use-label-CykSHq9A.js";import{t as v}from"./caps-SYhabp1B.js";import{n as y}from"./type-labels-DEpt0nSb.js";import{t as b}from"./_name-aKYVqU32.js";import{n as x,t as S}from"./alert-cwX3fWUu.js";import{r as C,t as w}from"./tree-BUpunTXw.js";var T=e(n()),E=e(t()),D={columnName:{id:`terms.list.column.name`},columnDescription:{id:`terms.list.column.description`}},O=50,k=200;function A(e,t,n){return!t||n?e.map(e=>({term:e,displayDepth:0})):C(w(e)).map(e=>({term:e.term,displayDepth:e.depth}))}function j(){let e=b.useNavigate();return{setPage:(0,T.useCallback)(t=>{e({search:e=>({...e,page:t})})},[e]),setSearch:(0,T.useCallback)(t=>{e({search:e=>({...e,q:t,page:1})})},[e])}}function M(){let e=b.useSearch(),{user:t,taxonomy:n}=b.useRouteContext(),r=_(),c=n.isHierarchical===!0,l=c?k:O,u=a(i.term.list.queryOptions({input:{taxonomy:n.name,limit:l,offset:(e.page-1)*l,...e.q?{search:e.q}:{}}})),{setPage:d,setSearch:f}=j(),C=u.data,w=(0,T.useMemo)(()=>A(C??[],c,!!e.q),[C,c,e.q]),M=e.page>1,P=(C?.length??0)===l,F=v(t.capabilities,`term:${n.name}:edit`),I=(0,T.useMemo)(()=>[{accessorKey:`name`,header:r(D.columnName),cell:({row:e})=>{let t=e.original.term,r=e.original.displayDepth;return(0,E.jsxs)(o,{to:`/terms/$name/$id/edit`,params:{name:n.name,id:t.id},"data-testid":`taxonomy-list-row-${String(t.id)}`,"aria-level":r+1,className:`hover:text-primary flex min-w-0 flex-col transition-colors`,children:[(0,E.jsxs)(`span`,{className:`font-medium`,children:[r>0?(0,E.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/60 me-1 font-normal select-none`,children:`— `.repeat(r)}):null,t.name]}),(0,E.jsx)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:t.slug})]})}},{accessorKey:`description`,header:r(D.columnDescription),cell:({row:e})=>{let t=e.original.term.description;return t===null||t.length===0?(0,E.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/50`,children:`—`}):(0,E.jsx)(`span`,{className:`text-muted-foreground line-clamp-1 text-sm`,children:t})}}],[n.name,r]);return(0,E.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`h1`,{"data-testid":`taxonomy-list-heading`,className:`text-2xl font-semibold capitalize`,children:r(n.label)}),n.description?(0,E.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:n.description}):null]}),F?(0,E.jsx)(s,{asChild:!0,children:(0,E.jsxs)(o,{to:`/terms/$name/create`,params:{name:n.name},"data-testid":`taxonomy-list-new-button`,children:[(0,E.jsx)(g,{}),r(y(n,`addNewItem`))]})}):null]}),(0,E.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,E.jsx)(`div`,{className:`ms-auto`,children:(0,E.jsx)(h,{initialValue:e.q??``,placeholder:r(y(n,`searchItems`)),testId:`taxonomy-list-search-input`,onCommit:f},e.q??``)})}),u.isError?(0,E.jsx)(S,{variant:`destructive`,children:(0,E.jsx)(x,{children:u.error instanceof Error?u.error.message:r(y(n,`loadErrorItems`))})}):(0,E.jsx)(m,{columns:I,data:w,isLoading:u.isPending,loadingLabel:r(y(n,`loadingItems`)),emptyState:(0,E.jsx)(N,{taxonomy:n,canCreate:F})}),(0,E.jsx)(p,{page:e.page,canPrev:M,canNext:P,isLoading:u.isPending,onPageChange:d})]})}function N({taxonomy:e,canCreate:t}){let n=_(),i=n(y(e,`addNewItem`));return(0,E.jsxs)(f,{"data-testid":`taxonomy-list-empty-state`,className:`border`,children:[(0,E.jsxs)(c,{children:[(0,E.jsx)(u,{children:n(y(e,`notFound`))}),(0,E.jsx)(d,{children:(0,E.jsx)(r,{id:`terms.list.empty.description`,message:`Create one to see it here.`})})]}),(0,E.jsx)(l,{children:t?(0,E.jsx)(s,{asChild:!0,children:(0,E.jsxs)(o,{to:`/terms/$name/create`,params:{name:e.name},children:[(0,E.jsx)(g,{}),i]})}):(0,E.jsxs)(s,{disabled:!0,children:[(0,E.jsx)(g,{}),i]})})]})}export{M as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_name-BdQXCH-s.js","./jsx-runtime-DUAcabCT.js","./react-DbyrFoBd.js","./dist-BL2bKHuR.js","./orpc-CmtRGLtZ.js","./useQuery-QAYxQfCx.js","./link-CI3qhqYu.js","./react-dom-i-Mcm3wj.js","./useStore-Vo4KhxPy.js","./with-selector-Bf4HMdmS.js","./button-DG1Ca1S5.js","./dist-Dgy1ZZMQ.js","./utils-DKOQrNEG.js","./dist-B66OmIyr.js","./empty-p3QKoEqD.js","./search-input-BG9KotQw.js","./createLucideIcon-C0O-yxZG.js","./breadcrumb-x0qfIbU9.js","./dist-C4yHjFuP.js","./es2015-Di0DqwZ-.js","./dist-RxmsRBXP.js","./dist-BbwCNMFC.js","./dist-vYFq1OyT.js","./dist-DWZq3eNY.js","./skeleton-BnBM1862.js","./input-xYuLUQID.js","./separator-DzRLZTkg.js","./dist-BaNJ6JYm.js","./tooltip-Bf2rZUeB.js","./dist-BreUs1Gf.js","./utils-kFAy0YTP.js","./sonner-1kBVu4ZN.js","./dist-BP9v0gZx.js","./select-D3kIVy0H.js","./dist-Cz1zPiFe.js","./textarea-iIsBg5jH.js","./dist-hUh7dFZi.js","./card-L2-kK5VK.js","./popover-BoiNmQB7.js","./dist-CFgtqwWs.js","./toggle-M64NT8hi.js","./form-B_PPIck3.js","./alert-cwX3fWUu.js","./use-label-CykSHq9A.js","./caps-SYhabp1B.js","./type-labels-DEpt0nSb.js","./tree-BUpunTXw.js"])))=>i.map(i=>d[i]);
2
- import{T as e,a as t,t as n}from"./lazyRouteComponent-CQbKoKTD.js";import{s as r}from"./matchContext-DKtpdvCQ.js";import{o as i}from"./manifest-CKNOp_Vu.js";import{D as a,E as o,_ as s,f as c,g as l,h as u,i as d,l as f,m as p,o as m,w as h,y as g}from"./dist-ClOzYsk5.js";import{t as _}from"./caps-SYhabp1B.js";var v=()=>e(()=>import(`./_name-BdQXCH-s.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46]),import.meta.url),y=u({page:l(d(g(p(),m(),c(1)),1),1),q:l(d(g(h(),a(),f(200),o(e=>e.length===0?void 0:e)),void 0))}),b=t(`/_authenticated/terms/$name/`)({validateSearch:e=>s(y,e),beforeLoad:({context:e,params:t})=>{let n=i(t.name);if(!n||!_(e.user.capabilities,`term:${n.name}:read`))throw r();return{taxonomy:n}},component:n(v,`component`)});export{b as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_name-BGOHegOZ.js","./jsx-runtime-DUAcabCT.js","./react-DbyrFoBd.js","./dist-BL2bKHuR.js","./orpc-CmtRGLtZ.js","./useQuery-QAYxQfCx.js","./link-CI3qhqYu.js","./react-dom-i-Mcm3wj.js","./useStore-Vo4KhxPy.js","./with-selector-Bf4HMdmS.js","./button-DG1Ca1S5.js","./dist-Dgy1ZZMQ.js","./utils-DKOQrNEG.js","./dist-B66OmIyr.js","./empty-p3QKoEqD.js","./search-input-BG9KotQw.js","./createLucideIcon-C0O-yxZG.js","./breadcrumb-x0qfIbU9.js","./dist-C4yHjFuP.js","./es2015-Di0DqwZ-.js","./dist-RxmsRBXP.js","./dist-BbwCNMFC.js","./dist-vYFq1OyT.js","./dist-DWZq3eNY.js","./skeleton-BnBM1862.js","./input-xYuLUQID.js","./separator-DzRLZTkg.js","./dist-BaNJ6JYm.js","./tooltip-Bf2rZUeB.js","./dist-BreUs1Gf.js","./utils-kFAy0YTP.js","./sonner-1kBVu4ZN.js","./dist-BP9v0gZx.js","./select-D3kIVy0H.js","./dist-Cz1zPiFe.js","./textarea-iIsBg5jH.js","./dist-hUh7dFZi.js","./card-L2-kK5VK.js","./popover-BoiNmQB7.js","./dist-CFgtqwWs.js","./toggle-M64NT8hi.js","./form-B_PPIck3.js","./alert-cwX3fWUu.js","./use-label-CykSHq9A.js","./caps-SYhabp1B.js","./type-labels-DEpt0nSb.js","./tree-BUpunTXw.js"])))=>i.map(i=>d[i]);
2
+ import{T as e,a as t,t as n}from"./lazyRouteComponent-CQbKoKTD.js";import{s as r}from"./matchContext-DKtpdvCQ.js";import{o as i}from"./manifest-Bdiv3Qyq.js";import{D as a,E as o,_ as s,f as c,g as l,h as u,i as d,l as f,m as p,o as m,w as h,y as g}from"./dist-ClOzYsk5.js";import{t as _}from"./caps-SYhabp1B.js";var v=()=>e(()=>import(`./_name-BGOHegOZ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46]),import.meta.url),y=u({page:l(d(g(p(),m(),c(1)),1),1),q:l(d(g(h(),a(),f(200),o(e=>e.length===0?void 0:e)),void 0))}),b=t(`/_authenticated/terms/$name/`)({validateSearch:e=>s(y,e),beforeLoad:({context:e,params:t})=>{let n=i(t.name);if(!n||!_(e.user.capabilities,`term:${n.name}:read`))throw r();return{taxonomy:n}},component:n(v,`component`)});export{b as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_page-BSBKYWFe.js","./jsx-runtime-DUAcabCT.js","./dist-BL2bKHuR.js","./react-DbyrFoBd.js","./error-placeholder-ULkA-k6_.js","./empty-p3QKoEqD.js","./utils-DKOQrNEG.js","./dist-B66OmIyr.js","./triangle-alert-BpzHmkii.js","./createLucideIcon-C0O-yxZG.js","./_page-Rj3wR-yR.js","./_page-Cd2qh5Hj.js","./orpc-CmtRGLtZ.js","./useMutation-vgMtqBOX.js","./useSuspenseQuery-9GLTSYHf.js","./useQuery-QAYxQfCx.js","./button-DG1Ca1S5.js","./dist-Dgy1ZZMQ.js","./use-label-CykSHq9A.js","./manifest-CKNOp_Vu.js","./style-emitter-CDGtTiRG.js","./card-L2-kK5VK.js","./form-B_PPIck3.js","./alert-cwX3fWUu.js","./meta-box-field-CK-LNUI9.js","./select-D3kIVy0H.js","./react-dom-i-Mcm3wj.js","./dist-C4yHjFuP.js","./dist-BbwCNMFC.js","./dist-vYFq1OyT.js","./es2015-Di0DqwZ-.js","./dist-BP9v0gZx.js","./breadcrumb-x0qfIbU9.js","./dist-RxmsRBXP.js","./dist-DWZq3eNY.js","./skeleton-BnBM1862.js","./input-xYuLUQID.js","./separator-DzRLZTkg.js","./dist-BaNJ6JYm.js","./tooltip-Bf2rZUeB.js","./dist-BreUs1Gf.js","./textarea-iIsBg5jH.js","./dist-hUh7dFZi.js","./utils-kFAy0YTP.js","./sonner-1kBVu4ZN.js","./dist-Cz1zPiFe.js","./popover-BoiNmQB7.js","./dist-CFgtqwWs.js","./toggle-M64NT8hi.js","./type-labels-DEpt0nSb.js","./plugin-registry-nSDhEMki.js","./errors-BDz8PxwA.js","./meta-box-grid-CoW6o7O7.js"])))=>i.map(i=>d[i]);
2
- import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{i as n}from"./dist-BL2bKHuR.js";import{t as r}from"./orpc-CmtRGLtZ.js";import{T as i,a,t as o}from"./lazyRouteComponent-CQbKoKTD.js";import{s}from"./matchContext-DKtpdvCQ.js";import{a as c,u as l}from"./manifest-CKNOp_Vu.js";import{t as u}from"./caps-SYhabp1B.js";import{t as d}from"./_page-Rj3wR-yR.js";import{t as f}from"./edit-skeleton-oIsvepSM.js";var p=e(t(),1),m=a(`/_authenticated/settings/$page`)({beforeLoad:({context:e,params:t})=>{let n=c(t.page);if(!n||!u(e.user.capabilities,`settings:manage`))throw s();return{page:n}},loader:({context:e})=>{let t=l(e.page);return Promise.all(t.map(t=>e.queryClient.ensureQueryData(r.settings.get.queryOptions({input:{group:t.name}}))))},pendingComponent:h,errorComponent:o(()=>i(()=>import(`./_page-BSBKYWFe.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),`errorComponent`),component:o(()=>i(()=>import(`./_page-Cd2qh5Hj.js`),__vite__mapDeps([11,1,3,2,12,13,14,15,16,17,6,7,5,18,19,20,10,21,22,23,24,25,26,27,28,29,30,31,9,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]),import.meta.url),`component`)});function h(){let{i18n:e}=n();return(0,p.jsx)(f,{ariaLabel:e._(d.loadingAria.id,void 0,{message:d.loadingAria.message}),testId:`settings-page-loading`})}export{m as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_page-BSBKYWFe.js","./jsx-runtime-DUAcabCT.js","./dist-BL2bKHuR.js","./react-DbyrFoBd.js","./error-placeholder-ULkA-k6_.js","./empty-p3QKoEqD.js","./utils-DKOQrNEG.js","./dist-B66OmIyr.js","./triangle-alert-BpzHmkii.js","./createLucideIcon-C0O-yxZG.js","./_page-Rj3wR-yR.js","./_page-Be9sR1G2.js","./orpc-CmtRGLtZ.js","./useMutation-vgMtqBOX.js","./useSuspenseQuery-9GLTSYHf.js","./useQuery-QAYxQfCx.js","./button-DG1Ca1S5.js","./dist-Dgy1ZZMQ.js","./use-label-CykSHq9A.js","./manifest-Bdiv3Qyq.js","./style-emitter-CDGtTiRG.js","./card-L2-kK5VK.js","./form-B_PPIck3.js","./alert-cwX3fWUu.js","./meta-box-field-BTDudxyS.js","./select-D3kIVy0H.js","./react-dom-i-Mcm3wj.js","./dist-C4yHjFuP.js","./dist-BbwCNMFC.js","./dist-vYFq1OyT.js","./es2015-Di0DqwZ-.js","./dist-BP9v0gZx.js","./breadcrumb-x0qfIbU9.js","./dist-RxmsRBXP.js","./dist-DWZq3eNY.js","./skeleton-BnBM1862.js","./input-xYuLUQID.js","./separator-DzRLZTkg.js","./dist-BaNJ6JYm.js","./tooltip-Bf2rZUeB.js","./dist-BreUs1Gf.js","./textarea-iIsBg5jH.js","./dist-hUh7dFZi.js","./utils-kFAy0YTP.js","./sonner-1kBVu4ZN.js","./dist-Cz1zPiFe.js","./popover-BoiNmQB7.js","./dist-CFgtqwWs.js","./toggle-M64NT8hi.js","./type-labels-DEpt0nSb.js","./plugin-registry-nSDhEMki.js","./errors-BDz8PxwA.js","./meta-box-grid-CoW6o7O7.js"])))=>i.map(i=>d[i]);
2
+ import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{i as n}from"./dist-BL2bKHuR.js";import{t as r}from"./orpc-CmtRGLtZ.js";import{T as i,a,t as o}from"./lazyRouteComponent-CQbKoKTD.js";import{s}from"./matchContext-DKtpdvCQ.js";import{a as c,u as l}from"./manifest-Bdiv3Qyq.js";import{t as u}from"./caps-SYhabp1B.js";import{t as d}from"./_page-Rj3wR-yR.js";import{t as f}from"./edit-skeleton-oIsvepSM.js";var p=e(t(),1),m=a(`/_authenticated/settings/$page`)({beforeLoad:({context:e,params:t})=>{let n=c(t.page);if(!n||!u(e.user.capabilities,`settings:manage`))throw s();return{page:n}},loader:({context:e})=>{let t=l(e.page);return Promise.all(t.map(t=>e.queryClient.ensureQueryData(r.settings.get.queryOptions({input:{group:t.name}}))))},pendingComponent:h,errorComponent:o(()=>i(()=>import(`./_page-BSBKYWFe.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),`errorComponent`),component:o(()=>i(()=>import(`./_page-Be9sR1G2.js`),__vite__mapDeps([11,1,3,2,12,13,14,15,16,17,6,7,5,18,19,20,10,21,22,23,24,25,26,27,28,29,30,31,9,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]),import.meta.url),`component`)});function h(){let{i18n:e}=n();return(0,p.jsx)(f,{ariaLabel:e._(d.loadingAria.id,void 0,{message:d.loadingAria.message}),testId:`settings-page-loading`})}export{m as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{t as a,u as o}from"./orpc-CmtRGLtZ.js";import{t as s}from"./useMutation-vgMtqBOX.js";import{t as c}from"./useSuspenseQuery-9GLTSYHf.js";import{t as l}from"./button-DG1Ca1S5.js";import{i as u,o as d,r as f,t as p}from"./empty-p3QKoEqD.js";import{t as m}from"./use-label-CykSHq9A.js";import{u as h,y as g}from"./manifest-CKNOp_Vu.js";import{t as _}from"./_page-Rj3wR-yR.js";import{a as v,i as y,n as b,r as x,t as S}from"./card-L2-kK5VK.js";import{t as C}from"./_page-BuOOftjn.js";import{f as w,t as T}from"./form-B_PPIck3.js";import{n as E,t as D}from"./alert-cwX3fWUu.js";import{t as O}from"./meta-box-field-CK-LNUI9.js";import{t as k}from"./meta-box-grid-CoW6o7O7.js";var A=e(n()),j=e(t()),M=`ctx.registerSettingsPage(name, { groups: [...] })`;function N(){let{page:e}=C.useRouteContext(),t=h(e),n=m();return(0,j.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col gap-6`,children:[(0,j.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,j.jsx)(`h1`,{className:`text-2xl font-semibold`,"data-testid":`settings-page-heading`,children:n(e.label)}),e.description?(0,j.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:n(e.description)}):null]}),t.length===0?(0,j.jsx)(F,{}):t.map(e=>(0,j.jsx)(P,{group:e},e.name))]})}function P({group:e}){let{i18n:t}=r(),n=m(),u=o(),[d,f]=(0,A.useState)(null),[p,h]=(0,A.useState)(null),{data:C}=c(a.settings.get.queryOptions({input:{group:e.name}})),M=w({defaultValues:g([e],C)}),N=s({mutationFn:t=>a.settings.upsert.call({group:e.name,values:t}),onMutate:()=>{f(null),h(null)},onSuccess:async t=>{M.reset(g([e],t)),await u.invalidateQueries({queryKey:a.settings.get.queryOptions({input:{group:e.name}}).queryKey}),h(_.saved)},onError:e=>{f(e instanceof Error?e.message:_.saveFailed)}}),P=M.handleSubmit(e=>{N.mutate(e)});return(0,j.jsx)(S,{className:`@container`,"data-testid":`settings-group-card-${e.name}`,children:(0,j.jsx)(T,{...M,children:(0,j.jsxs)(`form`,{onSubmit:P,children:[(0,j.jsxs)(y,{children:[(0,j.jsx)(v,{children:(0,j.jsx)(`h2`,{className:`text-lg font-semibold`,"data-testid":`settings-group-heading-${e.name}`,children:n(e.label)})}),e.description?(0,j.jsx)(x,{children:n(e.description)}):null]}),(0,j.jsxs)(b,{className:`flex flex-col gap-4`,children:[(0,j.jsx)(`div`,{className:`grid grid-cols-12 gap-4`,children:e.fields.map(e=>(0,j.jsx)(O,{field:e,name:e.key,disabled:N.isPending,className:k(e.span)},e.key))}),d?(0,j.jsx)(D,{variant:`destructive`,role:`alert`,"data-testid":`settings-server-error-${e.name}`,children:(0,j.jsx)(E,{children:typeof d==`string`?d:t._(d.id,void 0,{message:d.message})})}):null,p?(0,j.jsx)(D,{role:`status`,"aria-live":`polite`,"data-testid":`settings-save-notice-${e.name}`,children:(0,j.jsx)(E,{children:t._(p.id,void 0,{message:p.message})})}):null]}),(0,j.jsx)(`div`,{className:`flex justify-end px-6 pb-6`,children:(0,j.jsx)(l,{type:`submit`,disabled:N.isPending,"data-testid":`settings-submit-${e.name}`,children:N.isPending?(0,j.jsx)(i,{id:`settings.page.submit.pending`,message:`Saving…`}):(0,j.jsx)(i,{id:`settings.page.submit.idle`,message:`Save changes`})})})]})})})}function F(){return(0,j.jsx)(S,{children:(0,j.jsx)(p,{children:(0,j.jsxs)(u,{children:[(0,j.jsx)(d,{children:(0,j.jsx)(i,{id:`settings.page.empty.title`,message:`No groups on this page`})}),(0,j.jsxs)(f,{children:[(0,j.jsx)(i,{id:`settings.page.empty.description`,message:`This settings page doesn't reference any registered groups yet. Plugins compose pages with the registerSettingsPage helper:`}),` `,(0,j.jsx)(`code`,{className:`font-mono text-xs`,children:M})]})]})})})}export{N as component};
1
+ import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{t as a,u as o}from"./orpc-CmtRGLtZ.js";import{t as s}from"./useMutation-vgMtqBOX.js";import{t as c}from"./useSuspenseQuery-9GLTSYHf.js";import{t as l}from"./button-DG1Ca1S5.js";import{i as u,o as d,r as f,t as p}from"./empty-p3QKoEqD.js";import{t as m}from"./use-label-CykSHq9A.js";import{b as h,u as g}from"./manifest-Bdiv3Qyq.js";import{t as _}from"./_page-Rj3wR-yR.js";import{a as v,i as y,n as b,r as x,t as S}from"./card-L2-kK5VK.js";import{t as C}from"./_page--PcGMzdu.js";import{f as w,t as T}from"./form-B_PPIck3.js";import{n as E,t as D}from"./alert-cwX3fWUu.js";import{t as O}from"./meta-box-field-BTDudxyS.js";import{t as k}from"./meta-box-grid-CoW6o7O7.js";var A=e(n()),j=e(t()),M=`ctx.registerSettingsPage(name, { groups: [...] })`;function N(){let{page:e}=C.useRouteContext(),t=g(e),n=m();return(0,j.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col gap-6`,children:[(0,j.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,j.jsx)(`h1`,{className:`text-2xl font-semibold`,"data-testid":`settings-page-heading`,children:n(e.label)}),e.description?(0,j.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:n(e.description)}):null]}),t.length===0?(0,j.jsx)(F,{}):t.map(e=>(0,j.jsx)(P,{group:e},e.name))]})}function P({group:e}){let{i18n:t}=r(),n=m(),u=o(),[d,f]=(0,A.useState)(null),[p,g]=(0,A.useState)(null),{data:C}=c(a.settings.get.queryOptions({input:{group:e.name}})),M=w({defaultValues:h([e],C)}),N=s({mutationFn:t=>a.settings.upsert.call({group:e.name,values:t}),onMutate:()=>{f(null),g(null)},onSuccess:async t=>{M.reset(h([e],t)),await u.invalidateQueries({queryKey:a.settings.get.queryOptions({input:{group:e.name}}).queryKey}),g(_.saved)},onError:e=>{f(e instanceof Error?e.message:_.saveFailed)}}),P=M.handleSubmit(e=>{N.mutate(e)});return(0,j.jsx)(S,{className:`@container`,"data-testid":`settings-group-card-${e.name}`,children:(0,j.jsx)(T,{...M,children:(0,j.jsxs)(`form`,{onSubmit:P,children:[(0,j.jsxs)(y,{children:[(0,j.jsx)(v,{children:(0,j.jsx)(`h2`,{className:`text-lg font-semibold`,"data-testid":`settings-group-heading-${e.name}`,children:n(e.label)})}),e.description?(0,j.jsx)(x,{children:n(e.description)}):null]}),(0,j.jsxs)(b,{className:`flex flex-col gap-4`,children:[(0,j.jsx)(`div`,{className:`grid grid-cols-12 gap-4`,children:e.fields.map(e=>(0,j.jsx)(O,{field:e,name:e.key,disabled:N.isPending,className:k(e.span)},e.key))}),d?(0,j.jsx)(D,{variant:`destructive`,role:`alert`,"data-testid":`settings-server-error-${e.name}`,children:(0,j.jsx)(E,{children:typeof d==`string`?d:t._(d.id,void 0,{message:d.message})})}):null,p?(0,j.jsx)(D,{role:`status`,"aria-live":`polite`,"data-testid":`settings-save-notice-${e.name}`,children:(0,j.jsx)(E,{children:t._(p.id,void 0,{message:p.message})})}):null]}),(0,j.jsx)(`div`,{className:`flex justify-end px-6 pb-6`,children:(0,j.jsx)(l,{type:`submit`,disabled:N.isPending,"data-testid":`settings-submit-${e.name}`,children:N.isPending?(0,j.jsx)(i,{id:`settings.page.submit.pending`,message:`Saving…`}):(0,j.jsx)(i,{id:`settings.page.submit.idle`,message:`Save changes`})})})]})})})}function F(){return(0,j.jsx)(S,{children:(0,j.jsx)(p,{children:(0,j.jsxs)(u,{children:[(0,j.jsx)(d,{children:(0,j.jsx)(i,{id:`settings.page.empty.title`,message:`No groups on this page`})}),(0,j.jsxs)(f,{children:[(0,j.jsx)(i,{id:`settings.page.empty.description`,message:`This settings page doesn't reference any registered groups yet. Plugins compose pages with the registerSettingsPage helper:`}),` `,(0,j.jsx)(`code`,{className:`font-mono text-xs`,children:M})]})]})})})}export{N as component};
@@ -1 +1 @@
1
- import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{t as a,u as o}from"./orpc-CmtRGLtZ.js";import{t as s}from"./useQuery-QAYxQfCx.js";import{t as c}from"./useMutation-vgMtqBOX.js";import{t as l}from"./link-CI3qhqYu.js";import{a as u,i as d,n as f,r as p,t as m}from"./select-D3kIVy0H.js";import{t as h}from"./utils-DKOQrNEG.js";import{n as g,t as _}from"./button-DG1Ca1S5.js";import{i as v,n as y,o as b,r as x,t as ee}from"./empty-p3QKoEqD.js";import{t as S}from"./createLucideIcon-C0O-yxZG.js";import{a as C,i as te,n as w,o as T,s as E,t as ne}from"./toast-CWtRg47-.js";import{n as D,r as O,t as re}from"./search-input-BG9KotQw.js";import{B as k,F as A,I as j,K as M,L as N,M as P,N as F,P as I,R as L,V as ie,n as ae,t as R,z as oe}from"./utils-kFAy0YTP.js";import{t as z}from"./use-label-CykSHq9A.js";import{o as B}from"./manifest-CKNOp_Vu.js";import{t as se}from"./caps-SYhabp1B.js";import{t as ce}from"./use-formatters-DLJOFcWE.js";import{r as V,t as H}from"./type-labels-DEpt0nSb.js";import{t as U}from"./_slug-CPq3MyRU.js";import{n as le,t as ue}from"./alert-cwX3fWUu.js";import{t as W}from"./dates-CSmOj6E-.js";var G=S(`arrow-up-down`,[[`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`}]]),K=e(n(),1),q=e(t(),1),J={selected:{id:`entries.list.bulk.selected`},trash:{id:`entries.list.bulk.trash`},restore:{id:`entries.list.bulk.restore`},delete:{id:`entries.list.bulk.delete`},trashTitle:{id:`entries.list.bulk.trashTitle`},deleteTitle:{id:`entries.list.bulk.deleteTitle`},deleteBody:{id:`entries.list.bulk.deleteBody`},confirm:{id:`entries.list.bulk.confirm`},cancel:{id:`entries.list.bulk.cancel`}};function de({count:e,view:t,busy:n,onTrash:i,onRestore:a,onDeletePermanent:o}){let{i18n:s}=r(),[c,l]=(0,K.useState)(null),u=t=>s._(t.id,{count:e},{message:t.message});return(0,q.jsxs)(`div`,{"data-testid":`content-list-bulk-bar`,className:`bg-muted/40 flex items-center gap-3 rounded-md border px-4 py-2`,children:[(0,q.jsx)(`span`,{"data-testid":`content-list-bulk-count`,className:`text-sm font-medium`,children:u(J.selected)}),(0,q.jsx)(`div`,{className:`ms-auto flex items-center gap-2`,children:t===`trash`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(_,{variant:`outline`,size:`sm`,disabled:n,onClick:a,"data-testid":`content-list-bulk-restore`,children:s._(J.restore.id,{},{message:J.restore.message})}),(0,q.jsx)(_,{variant:`destructive`,size:`sm`,disabled:n,onClick:()=>{l(`delete`)},"data-testid":`content-list-bulk-delete`,children:s._(J.delete.id,{},{message:J.delete.message})})]}):(0,q.jsx)(_,{variant:`outline`,size:`sm`,disabled:n,onClick:()=>{l(`trash`)},"data-testid":`content-list-bulk-trash`,children:s._(J.trash.id,{},{message:J.trash.message})})}),(0,q.jsx)(I,{open:c!==null,onOpenChange:e=>{e||l(null)},children:(0,q.jsxs)(N,{children:[(0,q.jsxs)(k,{children:[(0,q.jsx)(ie,{children:u(c===`delete`?J.deleteTitle:J.trashTitle)}),c===`delete`?(0,q.jsx)(L,{children:s._(J.deleteBody.id,{},{message:J.deleteBody.message})}):null]}),(0,q.jsxs)(oe,{children:[(0,q.jsx)(j,{disabled:n,children:s._(J.cancel.id,{},{message:J.cancel.message})}),(0,q.jsx)(A,{"data-testid":`content-list-bulk-confirm`,className:g({variant:`destructive`}),disabled:n,onClick:e=>{e.preventDefault();let t=c;l(null),t===`delete`?o():t===`trash`&&i()},children:s._(J.confirm.id,{},{message:J.confirm.message})})]})]})})]})}var fe=20,Y={published:`default`,draft:`secondary`,scheduled:`outline`,trash:`destructive`},X={columnTitle:{id:`entries.list.column.title`},columnStatus:{id:`entries.list.column.status`},columnUpdated:{id:`entries.list.column.updated`},statusAll:{id:`entries.list.statusFilter.all`},statusPublished:{id:`entries.list.statusFilter.published`},statusDraft:{id:`entries.list.statusFilter.draft`},statusScheduled:{id:`entries.list.statusFilter.scheduled`},statusTrash:{id:`entries.list.statusFilter.trash`},authorAll:{id:`entries.list.authorFilter.all`},authorMine:{id:`entries.list.authorFilter.mine`},filterStatusAria:{id:`entries.list.filterStatusAria`},filterAuthorAria:{id:`entries.list.filterAuthorAria`},sortAria:{id:`entries.list.sortAria`},noTitle:{id:`entries.list.noTitle`},rowEdit:{id:`entries.list.row.edit`},rowTrash:{id:`entries.list.row.trash`},rowTrashing:{id:`entries.list.row.trashing`},trashingMove:{id:`entries.list.trashDialog.moving`},trashingConfirm:{id:`entries.list.trashDialog.confirm`},rowRestore:{id:`entries.list.row.restore`},rowRestoring:{id:`entries.list.row.restoring`},rowDelete:{id:`entries.list.row.deletePermanently`},deleteDialogTitle:{id:`entries.list.deleteDialog.title`},deleteDialogDeleting:{id:`entries.list.deleteDialog.deleting`},deleteDialogConfirm:{id:`entries.list.deleteDialog.confirm`},toastTrashed:{id:`entries.list.toast.trashed`},toastRestored:{id:`entries.list.toast.restored`},toastDeleted:{id:`entries.list.toast.deleted`},toastFailed:{id:`entries.list.toast.failed`},toastDuplicated:{id:`entries.list.toast.duplicated`},rowDuplicate:{id:`entries.list.row.duplicate`},rowDuplicating:{id:`entries.list.row.duplicating`},selectAllAria:{id:`entries.list.selectAllAria`},selectRowAria:{id:`entries.list.selectRowAria`},bulkFailed:{id:`entries.list.bulk.toastFailed`},bulkTrashed:{id:`entries.list.bulk.toastTrashed`},bulkRestored:{id:`entries.list.bulk.toastRestored`},bulkDeleted:{id:`entries.list.bulk.toastDeleted`}},pe=[{value:`all`,label:X.statusAll},{value:`published`,label:X.statusPublished},{value:`draft`,label:X.statusDraft},{value:`scheduled`,label:X.statusScheduled},{value:`trash`,label:X.statusTrash}];function me({activeOrderBy:e,activeOrder:t,onSort:n,adminSlug:r,canDelete:i,canCreate:a,onTrash:o,trashingId:s,onDuplicate:c,duplicatingId:l,onRestore:u,restoringId:d,onDeletePermanent:f,showSelect:p,selectAllLabel:m,selectRowLabel:h,renderLabel:g,editLabel:_,formatDate:v}){return[...p?[{id:`select`,meta:{className:`w-8`},header:({table:e})=>{let t=e.getIsAllPageRowsSelected(),n=e.getIsSomePageRowsSelected();return(0,q.jsx)(P,{checked:t?!0:n?`indeterminate`:!1,onCheckedChange:t=>{e.toggleAllPageRowsSelected(t===!0)},"aria-label":m,"data-testid":`content-list-select-all`})},cell:({row:e})=>(0,q.jsx)(P,{checked:e.getIsSelected(),disabled:!e.getCanSelect(),onCheckedChange:t=>{e.toggleSelected(t===!0)},"aria-label":h,"data-testid":`content-list-select-${String(e.original.id)}`})}]:[],{accessorKey:`title`,header:()=>(0,q.jsx)($,{label:g(X.columnTitle),column:`title`,defaultDirection:`asc`,activeOrderBy:e,activeOrder:t,onSort:n}),cell:({row:e})=>(0,q.jsx)(ye,{entry:e.original,adminSlug:r,canDelete:i,canCreate:a,onTrash:o,isTrashing:s===e.original.id,onDuplicate:c,isDuplicating:l===e.original.id,onRestore:u,isRestoring:d===e.original.id,onDeletePermanent:f,editLabel:_})},{accessorKey:`status`,header:g(X.columnStatus),cell:({row:e})=>(0,q.jsx)(F,{variant:Y[e.original.status],className:`capitalize`,children:e.original.status})},{accessorKey:`updatedAt`,meta:{className:`text-end`},header:()=>(0,q.jsx)($,{label:g(X.columnUpdated),column:`updated_at`,defaultDirection:`desc`,activeOrderBy:e,activeOrder:t,onSort:n,align:`right`}),cell:({row:e})=>(0,q.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:v(W(e.original.updatedAt),{dateStyle:`medium`,timeStyle:`short`})})}]}function he(e,t){let n={};for(let r of t){let t=e[r];if(typeof t!=`string`||t.length===0)continue;let i=t.split(`,`).map(e=>e.trim()).filter(e=>e.length>0);i.length>0&&(n[r]=i)}return n}function ge(){let e=U.useNavigate();return{setStatus:(0,K.useCallback)(t=>{e({search:e=>({...e,status:t,page:1})})},[e]),setPage:(0,K.useCallback)(t=>{e({search:e=>({...e,page:t})})},[e]),setSearch:(0,K.useCallback)(t=>{e({search:e=>({...e,q:t,page:1})})},[e]),setAuthor:(0,K.useCallback)(t=>{e({search:e=>({...e,author:t,page:1})})},[e]),setTermFilter:(0,K.useCallback)((t,n)=>{e({search:e=>{let r={...e,page:1};return n.length>0?r[t]=n.join(`,`):delete r[t],r}})},[e]),setSort:(0,K.useCallback)((t,n)=>{e({search:e=>({...e,orderBy:t,order:Z(e.orderBy===t,e.order,n),page:1})})},[e])}}function _e({entryType:e,rows:t,canDelete:n,renderLabel:i}){let s=o(),l=(0,K.useCallback)(()=>s.invalidateQueries({queryKey:a.entry.list.key({input:{type:e.name}})}),[s,e.name]),[u,d]=(0,K.useState)(null),f=(0,K.useCallback)(()=>{ne(i(X.toastFailed))},[i]),p=(0,K.useCallback)(e=>()=>(w(i(e)),l()),[i,l]),m=c({mutationFn:e=>a.entry.trash.call({id:e}),onSuccess:p(X.toastTrashed),onError:f,onSettled:()=>{d(null)}}),h=(0,K.useCallback)(e=>{d(e)},[d]),g=m.isPending&&typeof m.variables==`number`?m.variables:null,_=c({mutationFn:e=>a.entry.duplicate.call({id:e}),onSuccess:p(X.toastDuplicated),onError:f}),v=(0,K.useCallback)(e=>{_.mutate(e)},[_]),y=_.isPending&&typeof _.variables==`number`?_.variables:null,b=c({mutationFn:e=>a.entry.restore.call({id:e}),onSuccess:p(X.toastRestored),onError:f}),x=(0,K.useCallback)(e=>{b.mutate(e)},[b]),ee=b.isPending&&typeof b.variables==`number`?b.variables:null,[S,C]=(0,K.useState)(null),te=c({mutationFn:e=>a.entry.deletePermanent.call({id:e}),onSuccess:p(X.toastDeleted),onError:f,onSettled:()=>{C(null)}}),T=(0,K.useCallback)(e=>{C(e)},[C]),{i18n:E}=r(),[D,O]=(0,K.useState)({}),re=(0,K.useMemo)(()=>{let e=new Set(t.map(e=>e.id));return Object.keys(D).map(Number).filter(t=>D[String(t)]&&e.has(t))},[D,t]),k=n&&t.length>0,A=(0,K.useCallback)((e,t)=>{w(E._(e.id,{count:t},{message:e.message}))},[E]),j=(0,K.useCallback)(e=>t=>(A(e,t.ids.length),O({}),l()),[A,l]),M=c({mutationFn:e=>a.entry.trashMany.call({ids:e}),onSuccess:j(X.bulkTrashed),onError:f}),N=c({mutationFn:e=>a.entry.restoreMany.call({ids:e}),onSuccess:j(X.bulkRestored),onError:f}),P=c({mutationFn:e=>a.entry.deletePermanentMany.call({ids:e}),onSuccess:j(X.bulkDeleted),onError:f});return{onTrash:h,trashingId:g,onDuplicate:v,duplicatingId:y,onRestore:x,restoringId:ee,onDeletePermanent:T,pendingTrashId:u,setPendingTrashId:d,trash:m,pendingDeleteId:S,setPendingDeleteId:C,deletePermanent:te,rowSelection:D,setRowSelection:O,selectedIds:re,showSelect:k,bulkBusy:M.isPending||N.isPending||P.isPending,trashMany:M,restoreMany:N,deletePermanentMany:P}}function ve(){let e=U.useSearch(),{user:t,entryType:n}=U.useRouteContext(),r=n.termTaxonomies??Se,o=(0,K.useMemo)(()=>he(e,r),[e,r]),c=s(a.entry.list.queryOptions({input:{type:n.name,limit:fe,offset:(e.page-1)*fe,orderBy:e.orderBy,order:e.order,...e.status===`all`?{}:{status:e.status},...e.q?{search:e.q}:{},...e.author===`mine`?{authorId:t.id}:{},...Object.keys(o).length>0?{termTaxonomies:o}:{}}})),{setStatus:u,setPage:d,setSearch:f,setAuthor:p,setTermFilter:m,setSort:h}=ge(),v=(0,K.useMemo)(()=>c.data??[],[c.data]),y=e.page>1,b=v.length===fe,x=z(),ee=x(n.labels?.plural??n.label),S=`entry:${n.capabilityType??n.name}:create`,C=se(t.capabilities,S),te=`entry:${n.capabilityType??n.name}:delete`,w=se(t.capabilities,te),{onTrash:T,trashingId:E,onDuplicate:ne,duplicatingId:P,onRestore:F,restoringId:ae,onDeletePermanent:R,pendingTrashId:B,setPendingTrashId:V,trash:W,pendingDeleteId:G,setPendingDeleteId:J,deletePermanent:Y,rowSelection:pe,setRowSelection:ve,selectedIds:Z,showSelect:Q,bulkBusy:$,trashMany:ye,restoreMany:xe,deletePermanentMany:Ce}=_e({entryType:n,rows:v,canDelete:w,renderLabel:x}),De=e.status===`trash`,Oe=x(H(n,`editItem`)),{formatDate:ke}=ce(),Ae=(0,K.useMemo)(()=>me({activeOrderBy:e.orderBy,activeOrder:e.order,onSort:h,adminSlug:n.adminSlug,canDelete:w,canCreate:C,onTrash:T,trashingId:E,onDuplicate:ne,duplicatingId:P,onRestore:F,restoringId:ae,onDeletePermanent:R,showSelect:Q,selectAllLabel:x(X.selectAllAria),selectRowLabel:x(X.selectRowAria),renderLabel:x,editLabel:Oe,formatDate:ke}),[e.orderBy,e.order,h,n.adminSlug,w,C,T,E,ne,P,F,ae,R,Q,x,Oe,ke]);return(0,q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsx)(`div`,{children:(0,q.jsx)(`h1`,{"data-testid":`content-list-heading`,className:`text-2xl font-semibold`,children:ee})}),C?(0,q.jsx)(_,{asChild:!0,children:(0,q.jsxs)(l,{to:`/entries/$slug/create`,params:{slug:n.adminSlug},"data-testid":`content-list-new-button`,children:[(0,q.jsx)(M,{}),x(H(n,`addNewItem`))]})}):null]}),(0,q.jsx)(be,{value:e.status,onChange:u}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(we,{value:e.author,onChange:p}),r.map(e=>(0,q.jsx)(Te,{taxonomyName:e,value:o[e]??Se,onChange:t=>{m(e,t)}},e)),(0,q.jsx)(`div`,{className:`ms-auto`,children:(0,q.jsx)(re,{initialValue:e.q??``,placeholder:x(H(n,`searchItems`)),testId:`content-list-search-input`,onCommit:f},e.q??``)})]}),Q&&Z.length>0?(0,q.jsx)(de,{count:Z.length,view:De?`trash`:`active`,busy:$,onTrash:()=>{ye.mutate(Z)},onRestore:()=>{xe.mutate(Z)},onDeletePermanent:()=>{Ce.mutate(Z)}}):null,c.isError?(0,q.jsx)(ue,{variant:`destructive`,"data-testid":`content-list-load-error`,children:(0,q.jsx)(le,{children:c.error instanceof Error?c.error.message:x(H(n,`loadErrorItems`))})}):(0,q.jsx)(O,{columns:Ae,data:v,isLoading:c.isPending,loadingLabel:x(H(n,`loadingItems`)),...Q?{rowSelection:pe,onRowSelectionChange:ve,getRowId:e=>String(e.id)}:{},emptyState:(0,q.jsx)(Ee,{entryType:n,canCreate:C,entryTypeSlug:n.adminSlug})}),(0,q.jsx)(D,{page:e.page,canPrev:y,canNext:b,isLoading:c.isPending,onPageChange:d}),(0,q.jsx)(I,{open:B!==null,onOpenChange:e=>{e||V(null)},children:(0,q.jsxs)(N,{children:[(0,q.jsxs)(k,{children:[(0,q.jsx)(ie,{children:x(H(n,`moveToTrash`))}),(0,q.jsx)(L,{children:(0,q.jsx)(i,{id:`entries.list.trashDialog.description`,message:`You can restore it from the Trash view later.`})})]}),(0,q.jsxs)(oe,{children:[(0,q.jsx)(j,{disabled:W.isPending,children:(0,q.jsx)(i,{id:`entries.list.trashDialog.cancel`,message:`Cancel`})}),(0,q.jsx)(A,{"data-testid":`content-list-trash-confirm`,className:g({variant:`destructive`}),disabled:W.isPending,onClick:e=>{e.preventDefault(),B!==null&&W.mutate(B)},children:W.isPending?x(X.trashingMove):x(X.trashingConfirm)})]})]})}),(0,q.jsx)(I,{open:G!==null,onOpenChange:e=>{e||J(null)},children:(0,q.jsxs)(N,{children:[(0,q.jsxs)(k,{children:[(0,q.jsx)(ie,{children:x(X.deleteDialogTitle)}),(0,q.jsx)(L,{children:(0,q.jsx)(i,{id:`entries.list.deleteDialog.description`,message:`This permanently deletes the entry and its revisions. It cannot be undone.`})})]}),(0,q.jsxs)(oe,{children:[(0,q.jsx)(j,{disabled:Y.isPending,children:(0,q.jsx)(i,{id:`entries.list.deleteDialog.cancel`,message:`Cancel`})}),(0,q.jsx)(A,{"data-testid":`content-list-delete-confirm`,className:g({variant:`destructive`}),disabled:Y.isPending,onClick:e=>{e.preventDefault(),G!==null&&Y.mutate(G)},children:Y.isPending?x(X.deleteDialogDeleting):x(X.deleteDialogConfirm)})]})]})})]})}function Z(e,t,n){return e?t===`asc`?`desc`:`asc`:n}function Q({isActive:e,order:t}){return e?t===`asc`?(0,q.jsx)(T,{"aria-hidden":!0,className:`size-3.5`}):(0,q.jsx)(E,{"aria-hidden":!0,className:`size-3.5`}):(0,q.jsx)(G,{"aria-hidden":!0,className:`size-3.5`})}function $({label:e,column:t,defaultDirection:n,activeOrderBy:i,activeOrder:a,onSort:o,align:s=`left`}){let{i18n:c}=r(),l=i===t,u=Z(l,a,n);return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>{o(t,n)},"data-testid":`content-list-sort-${t}`,className:h(`hover:text-foreground inline-flex items-center gap-1 rounded px-2 py-1 font-medium transition-colors`,s===`right`?`-me-2 text-end`:`-ms-2 text-start`),"aria-label":c._(X.sortAria.id,{label:e,direction:u},{message:X.sortAria.message}),"aria-pressed":l,children:[e,(0,q.jsx)(Q,{isActive:l,order:a})]})}function ye({entry:e,adminSlug:t,canDelete:n,canCreate:r,onTrash:a,isTrashing:o,onDuplicate:s,isDuplicating:c,onRestore:u,isRestoring:d,onDeletePermanent:f,editLabel:p}){let m=z(),g=e.status===`trash`,_=n&&!g,v=r&&!g,y=n&&g;return(0,q.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsx)(l,{to:`/entries/$slug/$id/edit`,params:{slug:t,id:e.id},"data-testid":`content-list-row-${String(e.id)}`,className:`hover:text-primary font-medium transition-colors`,children:e.title||(0,q.jsx)(`span`,{className:`text-muted-foreground italic`,children:(0,q.jsx)(i,{id:`entries.list.noTitle`,message:`(no title)`})})}),(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.slug}),(0,q.jsxs)(`div`,{className:h(`flex h-4 items-center gap-2 text-xs transition-opacity`,`invisible group-hover/row:visible focus-within:visible`),"data-testid":`content-list-row-actions-${String(e.id)}`,children:[(0,q.jsx)(l,{to:`/entries/$slug/$id/edit`,params:{slug:t,id:e.id},className:`text-muted-foreground hover:text-foreground`,children:p}),_?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/50`,children:`|`}),(0,q.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>{a(e.id)},className:`text-muted-foreground hover:text-destructive disabled:opacity-50`,"data-testid":`content-list-row-trash-${String(e.id)}`,children:m(o?X.rowTrashing:X.rowTrash)})]}):null,v?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/50`,children:`|`}),(0,q.jsx)(`button`,{type:`button`,disabled:c,onClick:()=>{s(e.id)},className:`text-muted-foreground hover:text-foreground disabled:opacity-50`,"data-testid":`content-list-row-duplicate-${String(e.id)}`,children:m(c?X.rowDuplicating:X.rowDuplicate)})]}):null,y?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/50`,children:`|`}),(0,q.jsx)(`button`,{type:`button`,disabled:d,onClick:()=>{u(e.id)},className:`text-muted-foreground hover:text-foreground disabled:opacity-50`,"data-testid":`content-list-row-restore-${String(e.id)}`,children:m(d?X.rowRestoring:X.rowRestore)}),(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/50`,children:`|`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{f(e.id)},className:`text-muted-foreground hover:text-destructive`,"data-testid":`content-list-row-delete-${String(e.id)}`,children:m(X.rowDelete)})]}):null]})]})}function be({value:e,onChange:t}){let n=z();return(0,q.jsx)(R,{type:`single`,variant:`outline`,value:e,onValueChange:e=>{t(e||`all`)},"aria-label":n(X.filterStatusAria),children:pe.map(e=>(0,q.jsx)(ae,{value:e.value,"data-testid":`status-view-${e.value}`,children:n(e.label)},e.value))})}var xe=[],Se=[],Ce=[{value:`all`,label:X.authorAll},{value:`mine`,label:X.authorMine}];function we({value:e,onChange:t}){let n=z();return(0,q.jsxs)(m,{value:e,onValueChange:e=>{t(e)},children:[(0,q.jsx)(d,{size:`sm`,"aria-label":n(X.filterAuthorAria),"data-testid":`author-filter`,children:(0,q.jsx)(u,{})}),(0,q.jsx)(f,{children:Ce.map(e=>(0,q.jsx)(p,{value:e.value,"data-testid":`author-filter-${e.value}`,children:n(e.label)},e.value))})]})}function Te({taxonomyName:e,value:t,onChange:n}){let r=z(),i=B(e),o=s(a.term.list.queryOptions({input:{taxonomy:e,limit:200}})),c=i?.isHierarchical===!0;return(0,q.jsx)(C,{options:(0,K.useMemo)(()=>te(o.data??xe,c),[o.data,c]),value:t,onChange:n,placeholder:r(V(i,`allItems`)),searchPlaceholder:r(V(i,`searchItems`)),emptyText:r(V(i,`noMatch`)),"aria-label":r(V(i,`filterByItem`)),testId:`taxonomy-filter-${e}`})}function Ee({entryType:e,canCreate:t,entryTypeSlug:n}){let r=z(),a=r(H(e,`addNewItem`));return(0,q.jsxs)(ee,{"data-testid":`content-list-empty-state`,className:`border`,children:[(0,q.jsxs)(v,{children:[(0,q.jsx)(b,{children:r(H(e,`notFound`))}),(0,q.jsx)(x,{children:(0,q.jsx)(i,{id:`entries.list.empty.description`,message:`Create one to see it here.`})})]}),(0,q.jsx)(y,{children:t?(0,q.jsx)(_,{asChild:!0,children:(0,q.jsxs)(l,{to:`/entries/$slug/create`,params:{slug:n},children:[(0,q.jsx)(M,{}),a]})}):(0,q.jsxs)(_,{disabled:!0,children:[(0,q.jsx)(M,{}),a]})})]})}export{ve as component};
1
+ import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{t as a,u as o}from"./orpc-CmtRGLtZ.js";import{t as s}from"./useQuery-QAYxQfCx.js";import{t as c}from"./useMutation-vgMtqBOX.js";import{t as l}from"./link-CI3qhqYu.js";import{a as u,i as d,n as f,r as p,t as m}from"./select-D3kIVy0H.js";import{t as h}from"./utils-DKOQrNEG.js";import{n as g,t as _}from"./button-DG1Ca1S5.js";import{i as v,n as y,o as b,r as x,t as ee}from"./empty-p3QKoEqD.js";import{t as S}from"./createLucideIcon-C0O-yxZG.js";import{a as C,i as te,n as w,o as T,s as E,t as ne}from"./toast-CWtRg47-.js";import{n as D,r as O,t as re}from"./search-input-BG9KotQw.js";import{B as k,F as A,I as j,K as M,L as N,M as P,N as F,P as I,R as L,V as ie,n as ae,t as R,z as oe}from"./utils-kFAy0YTP.js";import{t as z}from"./use-label-CykSHq9A.js";import{o as B}from"./manifest-Bdiv3Qyq.js";import{t as se}from"./caps-SYhabp1B.js";import{t as ce}from"./use-formatters-DLJOFcWE.js";import{r as V,t as H}from"./type-labels-DEpt0nSb.js";import{t as U}from"./_slug-DWmiGCz6.js";import{n as le,t as ue}from"./alert-cwX3fWUu.js";import{t as W}from"./dates-CSmOj6E-.js";var G=S(`arrow-up-down`,[[`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`}]]),K=e(n(),1),q=e(t(),1),J={selected:{id:`entries.list.bulk.selected`},trash:{id:`entries.list.bulk.trash`},restore:{id:`entries.list.bulk.restore`},delete:{id:`entries.list.bulk.delete`},trashTitle:{id:`entries.list.bulk.trashTitle`},deleteTitle:{id:`entries.list.bulk.deleteTitle`},deleteBody:{id:`entries.list.bulk.deleteBody`},confirm:{id:`entries.list.bulk.confirm`},cancel:{id:`entries.list.bulk.cancel`}};function de({count:e,view:t,busy:n,onTrash:i,onRestore:a,onDeletePermanent:o}){let{i18n:s}=r(),[c,l]=(0,K.useState)(null),u=t=>s._(t.id,{count:e},{message:t.message});return(0,q.jsxs)(`div`,{"data-testid":`content-list-bulk-bar`,className:`bg-muted/40 flex items-center gap-3 rounded-md border px-4 py-2`,children:[(0,q.jsx)(`span`,{"data-testid":`content-list-bulk-count`,className:`text-sm font-medium`,children:u(J.selected)}),(0,q.jsx)(`div`,{className:`ms-auto flex items-center gap-2`,children:t===`trash`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(_,{variant:`outline`,size:`sm`,disabled:n,onClick:a,"data-testid":`content-list-bulk-restore`,children:s._(J.restore.id,{},{message:J.restore.message})}),(0,q.jsx)(_,{variant:`destructive`,size:`sm`,disabled:n,onClick:()=>{l(`delete`)},"data-testid":`content-list-bulk-delete`,children:s._(J.delete.id,{},{message:J.delete.message})})]}):(0,q.jsx)(_,{variant:`outline`,size:`sm`,disabled:n,onClick:()=>{l(`trash`)},"data-testid":`content-list-bulk-trash`,children:s._(J.trash.id,{},{message:J.trash.message})})}),(0,q.jsx)(I,{open:c!==null,onOpenChange:e=>{e||l(null)},children:(0,q.jsxs)(N,{children:[(0,q.jsxs)(k,{children:[(0,q.jsx)(ie,{children:u(c===`delete`?J.deleteTitle:J.trashTitle)}),c===`delete`?(0,q.jsx)(L,{children:s._(J.deleteBody.id,{},{message:J.deleteBody.message})}):null]}),(0,q.jsxs)(oe,{children:[(0,q.jsx)(j,{disabled:n,children:s._(J.cancel.id,{},{message:J.cancel.message})}),(0,q.jsx)(A,{"data-testid":`content-list-bulk-confirm`,className:g({variant:`destructive`}),disabled:n,onClick:e=>{e.preventDefault();let t=c;l(null),t===`delete`?o():t===`trash`&&i()},children:s._(J.confirm.id,{},{message:J.confirm.message})})]})]})})]})}var fe=20,Y={published:`default`,draft:`secondary`,scheduled:`outline`,trash:`destructive`},X={columnTitle:{id:`entries.list.column.title`},columnStatus:{id:`entries.list.column.status`},columnUpdated:{id:`entries.list.column.updated`},statusAll:{id:`entries.list.statusFilter.all`},statusPublished:{id:`entries.list.statusFilter.published`},statusDraft:{id:`entries.list.statusFilter.draft`},statusScheduled:{id:`entries.list.statusFilter.scheduled`},statusTrash:{id:`entries.list.statusFilter.trash`},authorAll:{id:`entries.list.authorFilter.all`},authorMine:{id:`entries.list.authorFilter.mine`},filterStatusAria:{id:`entries.list.filterStatusAria`},filterAuthorAria:{id:`entries.list.filterAuthorAria`},sortAria:{id:`entries.list.sortAria`},noTitle:{id:`entries.list.noTitle`},rowEdit:{id:`entries.list.row.edit`},rowTrash:{id:`entries.list.row.trash`},rowTrashing:{id:`entries.list.row.trashing`},trashingMove:{id:`entries.list.trashDialog.moving`},trashingConfirm:{id:`entries.list.trashDialog.confirm`},rowRestore:{id:`entries.list.row.restore`},rowRestoring:{id:`entries.list.row.restoring`},rowDelete:{id:`entries.list.row.deletePermanently`},deleteDialogTitle:{id:`entries.list.deleteDialog.title`},deleteDialogDeleting:{id:`entries.list.deleteDialog.deleting`},deleteDialogConfirm:{id:`entries.list.deleteDialog.confirm`},toastTrashed:{id:`entries.list.toast.trashed`},toastRestored:{id:`entries.list.toast.restored`},toastDeleted:{id:`entries.list.toast.deleted`},toastFailed:{id:`entries.list.toast.failed`},toastDuplicated:{id:`entries.list.toast.duplicated`},rowDuplicate:{id:`entries.list.row.duplicate`},rowDuplicating:{id:`entries.list.row.duplicating`},selectAllAria:{id:`entries.list.selectAllAria`},selectRowAria:{id:`entries.list.selectRowAria`},bulkFailed:{id:`entries.list.bulk.toastFailed`},bulkTrashed:{id:`entries.list.bulk.toastTrashed`},bulkRestored:{id:`entries.list.bulk.toastRestored`},bulkDeleted:{id:`entries.list.bulk.toastDeleted`}},pe=[{value:`all`,label:X.statusAll},{value:`published`,label:X.statusPublished},{value:`draft`,label:X.statusDraft},{value:`scheduled`,label:X.statusScheduled},{value:`trash`,label:X.statusTrash}];function me({activeOrderBy:e,activeOrder:t,onSort:n,adminSlug:r,canDelete:i,canCreate:a,onTrash:o,trashingId:s,onDuplicate:c,duplicatingId:l,onRestore:u,restoringId:d,onDeletePermanent:f,showSelect:p,selectAllLabel:m,selectRowLabel:h,renderLabel:g,editLabel:_,formatDate:v}){return[...p?[{id:`select`,meta:{className:`w-8`},header:({table:e})=>{let t=e.getIsAllPageRowsSelected(),n=e.getIsSomePageRowsSelected();return(0,q.jsx)(P,{checked:t?!0:n?`indeterminate`:!1,onCheckedChange:t=>{e.toggleAllPageRowsSelected(t===!0)},"aria-label":m,"data-testid":`content-list-select-all`})},cell:({row:e})=>(0,q.jsx)(P,{checked:e.getIsSelected(),disabled:!e.getCanSelect(),onCheckedChange:t=>{e.toggleSelected(t===!0)},"aria-label":h,"data-testid":`content-list-select-${String(e.original.id)}`})}]:[],{accessorKey:`title`,header:()=>(0,q.jsx)($,{label:g(X.columnTitle),column:`title`,defaultDirection:`asc`,activeOrderBy:e,activeOrder:t,onSort:n}),cell:({row:e})=>(0,q.jsx)(ye,{entry:e.original,adminSlug:r,canDelete:i,canCreate:a,onTrash:o,isTrashing:s===e.original.id,onDuplicate:c,isDuplicating:l===e.original.id,onRestore:u,isRestoring:d===e.original.id,onDeletePermanent:f,editLabel:_})},{accessorKey:`status`,header:g(X.columnStatus),cell:({row:e})=>(0,q.jsx)(F,{variant:Y[e.original.status],className:`capitalize`,children:e.original.status})},{accessorKey:`updatedAt`,meta:{className:`text-end`},header:()=>(0,q.jsx)($,{label:g(X.columnUpdated),column:`updated_at`,defaultDirection:`desc`,activeOrderBy:e,activeOrder:t,onSort:n,align:`right`}),cell:({row:e})=>(0,q.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:v(W(e.original.updatedAt),{dateStyle:`medium`,timeStyle:`short`})})}]}function he(e,t){let n={};for(let r of t){let t=e[r];if(typeof t!=`string`||t.length===0)continue;let i=t.split(`,`).map(e=>e.trim()).filter(e=>e.length>0);i.length>0&&(n[r]=i)}return n}function ge(){let e=U.useNavigate();return{setStatus:(0,K.useCallback)(t=>{e({search:e=>({...e,status:t,page:1})})},[e]),setPage:(0,K.useCallback)(t=>{e({search:e=>({...e,page:t})})},[e]),setSearch:(0,K.useCallback)(t=>{e({search:e=>({...e,q:t,page:1})})},[e]),setAuthor:(0,K.useCallback)(t=>{e({search:e=>({...e,author:t,page:1})})},[e]),setTermFilter:(0,K.useCallback)((t,n)=>{e({search:e=>{let r={...e,page:1};return n.length>0?r[t]=n.join(`,`):delete r[t],r}})},[e]),setSort:(0,K.useCallback)((t,n)=>{e({search:e=>({...e,orderBy:t,order:Z(e.orderBy===t,e.order,n),page:1})})},[e])}}function _e({entryType:e,rows:t,canDelete:n,renderLabel:i}){let s=o(),l=(0,K.useCallback)(()=>s.invalidateQueries({queryKey:a.entry.list.key({input:{type:e.name}})}),[s,e.name]),[u,d]=(0,K.useState)(null),f=(0,K.useCallback)(()=>{ne(i(X.toastFailed))},[i]),p=(0,K.useCallback)(e=>()=>(w(i(e)),l()),[i,l]),m=c({mutationFn:e=>a.entry.trash.call({id:e}),onSuccess:p(X.toastTrashed),onError:f,onSettled:()=>{d(null)}}),h=(0,K.useCallback)(e=>{d(e)},[d]),g=m.isPending&&typeof m.variables==`number`?m.variables:null,_=c({mutationFn:e=>a.entry.duplicate.call({id:e}),onSuccess:p(X.toastDuplicated),onError:f}),v=(0,K.useCallback)(e=>{_.mutate(e)},[_]),y=_.isPending&&typeof _.variables==`number`?_.variables:null,b=c({mutationFn:e=>a.entry.restore.call({id:e}),onSuccess:p(X.toastRestored),onError:f}),x=(0,K.useCallback)(e=>{b.mutate(e)},[b]),ee=b.isPending&&typeof b.variables==`number`?b.variables:null,[S,C]=(0,K.useState)(null),te=c({mutationFn:e=>a.entry.deletePermanent.call({id:e}),onSuccess:p(X.toastDeleted),onError:f,onSettled:()=>{C(null)}}),T=(0,K.useCallback)(e=>{C(e)},[C]),{i18n:E}=r(),[D,O]=(0,K.useState)({}),re=(0,K.useMemo)(()=>{let e=new Set(t.map(e=>e.id));return Object.keys(D).map(Number).filter(t=>D[String(t)]&&e.has(t))},[D,t]),k=n&&t.length>0,A=(0,K.useCallback)((e,t)=>{w(E._(e.id,{count:t},{message:e.message}))},[E]),j=(0,K.useCallback)(e=>t=>(A(e,t.ids.length),O({}),l()),[A,l]),M=c({mutationFn:e=>a.entry.trashMany.call({ids:e}),onSuccess:j(X.bulkTrashed),onError:f}),N=c({mutationFn:e=>a.entry.restoreMany.call({ids:e}),onSuccess:j(X.bulkRestored),onError:f}),P=c({mutationFn:e=>a.entry.deletePermanentMany.call({ids:e}),onSuccess:j(X.bulkDeleted),onError:f});return{onTrash:h,trashingId:g,onDuplicate:v,duplicatingId:y,onRestore:x,restoringId:ee,onDeletePermanent:T,pendingTrashId:u,setPendingTrashId:d,trash:m,pendingDeleteId:S,setPendingDeleteId:C,deletePermanent:te,rowSelection:D,setRowSelection:O,selectedIds:re,showSelect:k,bulkBusy:M.isPending||N.isPending||P.isPending,trashMany:M,restoreMany:N,deletePermanentMany:P}}function ve(){let e=U.useSearch(),{user:t,entryType:n}=U.useRouteContext(),r=n.termTaxonomies??Se,o=(0,K.useMemo)(()=>he(e,r),[e,r]),c=s(a.entry.list.queryOptions({input:{type:n.name,limit:fe,offset:(e.page-1)*fe,orderBy:e.orderBy,order:e.order,...e.status===`all`?{}:{status:e.status},...e.q?{search:e.q}:{},...e.author===`mine`?{authorId:t.id}:{},...Object.keys(o).length>0?{termTaxonomies:o}:{}}})),{setStatus:u,setPage:d,setSearch:f,setAuthor:p,setTermFilter:m,setSort:h}=ge(),v=(0,K.useMemo)(()=>c.data??[],[c.data]),y=e.page>1,b=v.length===fe,x=z(),ee=x(n.labels?.plural??n.label),S=`entry:${n.capabilityType??n.name}:create`,C=se(t.capabilities,S),te=`entry:${n.capabilityType??n.name}:delete`,w=se(t.capabilities,te),{onTrash:T,trashingId:E,onDuplicate:ne,duplicatingId:P,onRestore:F,restoringId:ae,onDeletePermanent:R,pendingTrashId:B,setPendingTrashId:V,trash:W,pendingDeleteId:G,setPendingDeleteId:J,deletePermanent:Y,rowSelection:pe,setRowSelection:ve,selectedIds:Z,showSelect:Q,bulkBusy:$,trashMany:ye,restoreMany:xe,deletePermanentMany:Ce}=_e({entryType:n,rows:v,canDelete:w,renderLabel:x}),De=e.status===`trash`,Oe=x(H(n,`editItem`)),{formatDate:ke}=ce(),Ae=(0,K.useMemo)(()=>me({activeOrderBy:e.orderBy,activeOrder:e.order,onSort:h,adminSlug:n.adminSlug,canDelete:w,canCreate:C,onTrash:T,trashingId:E,onDuplicate:ne,duplicatingId:P,onRestore:F,restoringId:ae,onDeletePermanent:R,showSelect:Q,selectAllLabel:x(X.selectAllAria),selectRowLabel:x(X.selectRowAria),renderLabel:x,editLabel:Oe,formatDate:ke}),[e.orderBy,e.order,h,n.adminSlug,w,C,T,E,ne,P,F,ae,R,Q,x,Oe,ke]);return(0,q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsx)(`div`,{children:(0,q.jsx)(`h1`,{"data-testid":`content-list-heading`,className:`text-2xl font-semibold`,children:ee})}),C?(0,q.jsx)(_,{asChild:!0,children:(0,q.jsxs)(l,{to:`/entries/$slug/create`,params:{slug:n.adminSlug},"data-testid":`content-list-new-button`,children:[(0,q.jsx)(M,{}),x(H(n,`addNewItem`))]})}):null]}),(0,q.jsx)(be,{value:e.status,onChange:u}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(we,{value:e.author,onChange:p}),r.map(e=>(0,q.jsx)(Te,{taxonomyName:e,value:o[e]??Se,onChange:t=>{m(e,t)}},e)),(0,q.jsx)(`div`,{className:`ms-auto`,children:(0,q.jsx)(re,{initialValue:e.q??``,placeholder:x(H(n,`searchItems`)),testId:`content-list-search-input`,onCommit:f},e.q??``)})]}),Q&&Z.length>0?(0,q.jsx)(de,{count:Z.length,view:De?`trash`:`active`,busy:$,onTrash:()=>{ye.mutate(Z)},onRestore:()=>{xe.mutate(Z)},onDeletePermanent:()=>{Ce.mutate(Z)}}):null,c.isError?(0,q.jsx)(ue,{variant:`destructive`,"data-testid":`content-list-load-error`,children:(0,q.jsx)(le,{children:c.error instanceof Error?c.error.message:x(H(n,`loadErrorItems`))})}):(0,q.jsx)(O,{columns:Ae,data:v,isLoading:c.isPending,loadingLabel:x(H(n,`loadingItems`)),...Q?{rowSelection:pe,onRowSelectionChange:ve,getRowId:e=>String(e.id)}:{},emptyState:(0,q.jsx)(Ee,{entryType:n,canCreate:C,entryTypeSlug:n.adminSlug})}),(0,q.jsx)(D,{page:e.page,canPrev:y,canNext:b,isLoading:c.isPending,onPageChange:d}),(0,q.jsx)(I,{open:B!==null,onOpenChange:e=>{e||V(null)},children:(0,q.jsxs)(N,{children:[(0,q.jsxs)(k,{children:[(0,q.jsx)(ie,{children:x(H(n,`moveToTrash`))}),(0,q.jsx)(L,{children:(0,q.jsx)(i,{id:`entries.list.trashDialog.description`,message:`You can restore it from the Trash view later.`})})]}),(0,q.jsxs)(oe,{children:[(0,q.jsx)(j,{disabled:W.isPending,children:(0,q.jsx)(i,{id:`entries.list.trashDialog.cancel`,message:`Cancel`})}),(0,q.jsx)(A,{"data-testid":`content-list-trash-confirm`,className:g({variant:`destructive`}),disabled:W.isPending,onClick:e=>{e.preventDefault(),B!==null&&W.mutate(B)},children:W.isPending?x(X.trashingMove):x(X.trashingConfirm)})]})]})}),(0,q.jsx)(I,{open:G!==null,onOpenChange:e=>{e||J(null)},children:(0,q.jsxs)(N,{children:[(0,q.jsxs)(k,{children:[(0,q.jsx)(ie,{children:x(X.deleteDialogTitle)}),(0,q.jsx)(L,{children:(0,q.jsx)(i,{id:`entries.list.deleteDialog.description`,message:`This permanently deletes the entry and its revisions. It cannot be undone.`})})]}),(0,q.jsxs)(oe,{children:[(0,q.jsx)(j,{disabled:Y.isPending,children:(0,q.jsx)(i,{id:`entries.list.deleteDialog.cancel`,message:`Cancel`})}),(0,q.jsx)(A,{"data-testid":`content-list-delete-confirm`,className:g({variant:`destructive`}),disabled:Y.isPending,onClick:e=>{e.preventDefault(),G!==null&&Y.mutate(G)},children:Y.isPending?x(X.deleteDialogDeleting):x(X.deleteDialogConfirm)})]})]})})]})}function Z(e,t,n){return e?t===`asc`?`desc`:`asc`:n}function Q({isActive:e,order:t}){return e?t===`asc`?(0,q.jsx)(T,{"aria-hidden":!0,className:`size-3.5`}):(0,q.jsx)(E,{"aria-hidden":!0,className:`size-3.5`}):(0,q.jsx)(G,{"aria-hidden":!0,className:`size-3.5`})}function $({label:e,column:t,defaultDirection:n,activeOrderBy:i,activeOrder:a,onSort:o,align:s=`left`}){let{i18n:c}=r(),l=i===t,u=Z(l,a,n);return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>{o(t,n)},"data-testid":`content-list-sort-${t}`,className:h(`hover:text-foreground inline-flex items-center gap-1 rounded px-2 py-1 font-medium transition-colors`,s===`right`?`-me-2 text-end`:`-ms-2 text-start`),"aria-label":c._(X.sortAria.id,{label:e,direction:u},{message:X.sortAria.message}),"aria-pressed":l,children:[e,(0,q.jsx)(Q,{isActive:l,order:a})]})}function ye({entry:e,adminSlug:t,canDelete:n,canCreate:r,onTrash:a,isTrashing:o,onDuplicate:s,isDuplicating:c,onRestore:u,isRestoring:d,onDeletePermanent:f,editLabel:p}){let m=z(),g=e.status===`trash`,_=n&&!g,v=r&&!g,y=n&&g;return(0,q.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsx)(l,{to:`/entries/$slug/$id/edit`,params:{slug:t,id:e.id},"data-testid":`content-list-row-${String(e.id)}`,className:`hover:text-primary font-medium transition-colors`,children:e.title||(0,q.jsx)(`span`,{className:`text-muted-foreground italic`,children:(0,q.jsx)(i,{id:`entries.list.noTitle`,message:`(no title)`})})}),(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.slug}),(0,q.jsxs)(`div`,{className:h(`flex h-4 items-center gap-2 text-xs transition-opacity`,`invisible group-hover/row:visible focus-within:visible`),"data-testid":`content-list-row-actions-${String(e.id)}`,children:[(0,q.jsx)(l,{to:`/entries/$slug/$id/edit`,params:{slug:t,id:e.id},className:`text-muted-foreground hover:text-foreground`,children:p}),_?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/50`,children:`|`}),(0,q.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>{a(e.id)},className:`text-muted-foreground hover:text-destructive disabled:opacity-50`,"data-testid":`content-list-row-trash-${String(e.id)}`,children:m(o?X.rowTrashing:X.rowTrash)})]}):null,v?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/50`,children:`|`}),(0,q.jsx)(`button`,{type:`button`,disabled:c,onClick:()=>{s(e.id)},className:`text-muted-foreground hover:text-foreground disabled:opacity-50`,"data-testid":`content-list-row-duplicate-${String(e.id)}`,children:m(c?X.rowDuplicating:X.rowDuplicate)})]}):null,y?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/50`,children:`|`}),(0,q.jsx)(`button`,{type:`button`,disabled:d,onClick:()=>{u(e.id)},className:`text-muted-foreground hover:text-foreground disabled:opacity-50`,"data-testid":`content-list-row-restore-${String(e.id)}`,children:m(d?X.rowRestoring:X.rowRestore)}),(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/50`,children:`|`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{f(e.id)},className:`text-muted-foreground hover:text-destructive`,"data-testid":`content-list-row-delete-${String(e.id)}`,children:m(X.rowDelete)})]}):null]})]})}function be({value:e,onChange:t}){let n=z();return(0,q.jsx)(R,{type:`single`,variant:`outline`,value:e,onValueChange:e=>{t(e||`all`)},"aria-label":n(X.filterStatusAria),children:pe.map(e=>(0,q.jsx)(ae,{value:e.value,"data-testid":`status-view-${e.value}`,children:n(e.label)},e.value))})}var xe=[],Se=[],Ce=[{value:`all`,label:X.authorAll},{value:`mine`,label:X.authorMine}];function we({value:e,onChange:t}){let n=z();return(0,q.jsxs)(m,{value:e,onValueChange:e=>{t(e)},children:[(0,q.jsx)(d,{size:`sm`,"aria-label":n(X.filterAuthorAria),"data-testid":`author-filter`,children:(0,q.jsx)(u,{})}),(0,q.jsx)(f,{children:Ce.map(e=>(0,q.jsx)(p,{value:e.value,"data-testid":`author-filter-${e.value}`,children:n(e.label)},e.value))})]})}function Te({taxonomyName:e,value:t,onChange:n}){let r=z(),i=B(e),o=s(a.term.list.queryOptions({input:{taxonomy:e,limit:200}})),c=i?.isHierarchical===!0;return(0,q.jsx)(C,{options:(0,K.useMemo)(()=>te(o.data??xe,c),[o.data,c]),value:t,onChange:n,placeholder:r(V(i,`allItems`)),searchPlaceholder:r(V(i,`searchItems`)),emptyText:r(V(i,`noMatch`)),"aria-label":r(V(i,`filterByItem`)),testId:`taxonomy-filter-${e}`})}function Ee({entryType:e,canCreate:t,entryTypeSlug:n}){let r=z(),a=r(H(e,`addNewItem`));return(0,q.jsxs)(ee,{"data-testid":`content-list-empty-state`,className:`border`,children:[(0,q.jsxs)(v,{children:[(0,q.jsx)(b,{children:r(H(e,`notFound`))}),(0,q.jsx)(x,{children:(0,q.jsx)(i,{id:`entries.list.empty.description`,message:`Create one to see it here.`})})]}),(0,q.jsx)(y,{children:t?(0,q.jsx)(_,{asChild:!0,children:(0,q.jsxs)(l,{to:`/entries/$slug/create`,params:{slug:n},children:[(0,q.jsx)(M,{}),a]})}):(0,q.jsxs)(_,{disabled:!0,children:[(0,q.jsx)(M,{}),a]})})]})}export{ve as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_slug-D5T6BGMn.js","./jsx-runtime-DUAcabCT.js","./react-DbyrFoBd.js","./dist-BL2bKHuR.js","./orpc-CmtRGLtZ.js","./useQuery-QAYxQfCx.js","./useMutation-vgMtqBOX.js","./link-CI3qhqYu.js","./react-dom-i-Mcm3wj.js","./useStore-Vo4KhxPy.js","./with-selector-Bf4HMdmS.js","./select-D3kIVy0H.js","./dist-Dgy1ZZMQ.js","./dist-C4yHjFuP.js","./dist-BbwCNMFC.js","./dist-vYFq1OyT.js","./es2015-Di0DqwZ-.js","./dist-BP9v0gZx.js","./utils-DKOQrNEG.js","./createLucideIcon-C0O-yxZG.js","./button-DG1Ca1S5.js","./dist-B66OmIyr.js","./empty-p3QKoEqD.js","./toast-CWtRg47-.js","./sonner-1kBVu4ZN.js","./dist-RxmsRBXP.js","./dist-DWZq3eNY.js","./dist-Cz1zPiFe.js","./breadcrumb-x0qfIbU9.js","./skeleton-BnBM1862.js","./input-xYuLUQID.js","./separator-DzRLZTkg.js","./dist-BaNJ6JYm.js","./tooltip-Bf2rZUeB.js","./dist-BreUs1Gf.js","./chevrons-up-down-DmmG8bmI.js","./utils-kFAy0YTP.js","./textarea-iIsBg5jH.js","./dist-hUh7dFZi.js","./card-L2-kK5VK.js","./popover-BoiNmQB7.js","./dist-CFgtqwWs.js","./toggle-M64NT8hi.js","./form-B_PPIck3.js","./alert-cwX3fWUu.js","./use-label-CykSHq9A.js","./tree-BUpunTXw.js","./search-input-BG9KotQw.js","./manifest-CKNOp_Vu.js","./style-emitter-CDGtTiRG.js","./caps-SYhabp1B.js","./use-formatters-DLJOFcWE.js","./dist-DKhWWf1L.js","./type-labels-DEpt0nSb.js","./dates-CSmOj6E-.js"])))=>i.map(i=>d[i]);
2
- import{T as e,a as t,t as n}from"./lazyRouteComponent-CQbKoKTD.js";import{s as r}from"./matchContext-DKtpdvCQ.js";import{r as i}from"./manifest-CKNOp_Vu.js";import{D as a,E as o,_ as s,c,f as l,g as u,i as d,l as f,m as p,o as m,v as h,w as g,y as _}from"./dist-ClOzYsk5.js";var v=()=>e(()=>import(`./_slug-D5T6BGMn.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54]),import.meta.url),y=c({page:u(d(_(p(),m(),l(1)),1),1),status:u(d(h([`draft`,`published`,`scheduled`,`trash`,`all`]),`all`),`all`),q:u(d(_(g(),a(),f(200),o(e=>e.length===0?void 0:e)),void 0)),author:u(d(h([`all`,`mine`]),`all`),`all`),orderBy:u(d(h([`updated_at`,`published_at`,`title`,`sort_order`]),`updated_at`),`updated_at`),order:u(d(h([`asc`,`desc`]),`desc`),`desc`)}),b=t(`/_authenticated/entries/$slug/`)({validateSearch:e=>s(y,e),beforeLoad:({params:e})=>{let t=i(e.slug);if(!t)throw r();return{entryType:t}},component:n(v,`component`)});export{b as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_slug-Bdb7jL1l.js","./jsx-runtime-DUAcabCT.js","./react-DbyrFoBd.js","./dist-BL2bKHuR.js","./orpc-CmtRGLtZ.js","./useQuery-QAYxQfCx.js","./useMutation-vgMtqBOX.js","./link-CI3qhqYu.js","./react-dom-i-Mcm3wj.js","./useStore-Vo4KhxPy.js","./with-selector-Bf4HMdmS.js","./select-D3kIVy0H.js","./dist-Dgy1ZZMQ.js","./dist-C4yHjFuP.js","./dist-BbwCNMFC.js","./dist-vYFq1OyT.js","./es2015-Di0DqwZ-.js","./dist-BP9v0gZx.js","./utils-DKOQrNEG.js","./createLucideIcon-C0O-yxZG.js","./button-DG1Ca1S5.js","./dist-B66OmIyr.js","./empty-p3QKoEqD.js","./toast-CWtRg47-.js","./sonner-1kBVu4ZN.js","./dist-RxmsRBXP.js","./dist-DWZq3eNY.js","./dist-Cz1zPiFe.js","./breadcrumb-x0qfIbU9.js","./skeleton-BnBM1862.js","./input-xYuLUQID.js","./separator-DzRLZTkg.js","./dist-BaNJ6JYm.js","./tooltip-Bf2rZUeB.js","./dist-BreUs1Gf.js","./chevrons-up-down-DmmG8bmI.js","./utils-kFAy0YTP.js","./textarea-iIsBg5jH.js","./dist-hUh7dFZi.js","./card-L2-kK5VK.js","./popover-BoiNmQB7.js","./dist-CFgtqwWs.js","./toggle-M64NT8hi.js","./form-B_PPIck3.js","./alert-cwX3fWUu.js","./use-label-CykSHq9A.js","./tree-BUpunTXw.js","./search-input-BG9KotQw.js","./manifest-Bdiv3Qyq.js","./style-emitter-CDGtTiRG.js","./caps-SYhabp1B.js","./use-formatters-DLJOFcWE.js","./dist-DKhWWf1L.js","./type-labels-DEpt0nSb.js","./dates-CSmOj6E-.js"])))=>i.map(i=>d[i]);
2
+ import{T as e,a as t,t as n}from"./lazyRouteComponent-CQbKoKTD.js";import{s as r}from"./matchContext-DKtpdvCQ.js";import{r as i}from"./manifest-Bdiv3Qyq.js";import{D as a,E as o,_ as s,c,f as l,g as u,i as d,l as f,m as p,o as m,v as h,w as g,y as _}from"./dist-ClOzYsk5.js";var v=()=>e(()=>import(`./_slug-Bdb7jL1l.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54]),import.meta.url),y=c({page:u(d(_(p(),m(),l(1)),1),1),status:u(d(h([`draft`,`published`,`scheduled`,`trash`,`all`]),`all`),`all`),q:u(d(_(g(),a(),f(200),o(e=>e.length===0?void 0:e)),void 0)),author:u(d(h([`all`,`mine`]),`all`),`all`),orderBy:u(d(h([`updated_at`,`published_at`,`title`,`sort_order`]),`updated_at`),`updated_at`),order:u(d(h([`asc`,`desc`]),`desc`),`desc`)}),b=t(`/_authenticated/entries/$slug/`)({validateSearch:e=>s(y,e),beforeLoad:({params:e})=>{let t=i(e.slug);if(!t)throw r();return{entryType:t}},component:n(v,`component`)});export{b as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_token-BV3V8P_y.js","./jsx-runtime-DUAcabCT.js","./react-DbyrFoBd.js","./dist-BL2bKHuR.js","./useMutation-vgMtqBOX.js","./orpc-CmtRGLtZ.js","./useStore-Vo4KhxPy.js","./with-selector-Bf4HMdmS.js","./button-DG1Ca1S5.js","./dist-Dgy1ZZMQ.js","./utils-DKOQrNEG.js","./dist-B66OmIyr.js","./manifest-CKNOp_Vu.js","./style-emitter-CDGtTiRG.js","./session-Y-9LAiv-.js","./matchContext-DKtpdvCQ.js","./-locale-param-DNqvygi2.js","./select-D3kIVy0H.js","./react-dom-i-Mcm3wj.js","./dist-C4yHjFuP.js","./dist-BbwCNMFC.js","./dist-vYFq1OyT.js","./es2015-Di0DqwZ-.js","./dist-BP9v0gZx.js","./createLucideIcon-C0O-yxZG.js","./card-L2-kK5VK.js","./input-xYuLUQID.js","./passkey-DN4QfROE.js","./use-label-CykSHq9A.js","./form-B_PPIck3.js","./alert-cwX3fWUu.js"])))=>i.map(i=>d[i]);
2
- import{T as e,a as t,t as n}from"./lazyRouteComponent-CQbKoKTD.js";import{i as r}from"./matchContext-DKtpdvCQ.js";import{r as i}from"./session-Y-9LAiv-.js";import{n as a}from"./-schemas-CIUBpPg7.js";var o=t(`/_auth/accept-invite/$token`)({validateSearch:a,beforeLoad:async({context:e})=>{if((await e.queryClient.ensureQueryData(i())).user)throw r({to:`/`})},component:n(()=>e(()=>import(`./_token-BV3V8P_y.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url),`component`)});export{o as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./_token-s0TefqyQ.js","./jsx-runtime-DUAcabCT.js","./react-DbyrFoBd.js","./dist-BL2bKHuR.js","./useMutation-vgMtqBOX.js","./orpc-CmtRGLtZ.js","./useStore-Vo4KhxPy.js","./with-selector-Bf4HMdmS.js","./button-DG1Ca1S5.js","./dist-Dgy1ZZMQ.js","./utils-DKOQrNEG.js","./dist-B66OmIyr.js","./manifest-Bdiv3Qyq.js","./style-emitter-CDGtTiRG.js","./session-Y-9LAiv-.js","./matchContext-DKtpdvCQ.js","./-locale-param-DNqvygi2.js","./select-D3kIVy0H.js","./react-dom-i-Mcm3wj.js","./dist-C4yHjFuP.js","./dist-BbwCNMFC.js","./dist-vYFq1OyT.js","./es2015-Di0DqwZ-.js","./dist-BP9v0gZx.js","./createLucideIcon-C0O-yxZG.js","./card-L2-kK5VK.js","./input-xYuLUQID.js","./passkey-DN4QfROE.js","./use-label-CykSHq9A.js","./form-B_PPIck3.js","./alert-cwX3fWUu.js"])))=>i.map(i=>d[i]);
2
+ import{T as e,a as t,t as n}from"./lazyRouteComponent-CQbKoKTD.js";import{i as r}from"./matchContext-DKtpdvCQ.js";import{r as i}from"./session-Y-9LAiv-.js";import{n as a}from"./-schemas-Cbs_-MW6.js";var o=t(`/_auth/accept-invite/$token`)({validateSearch:a,beforeLoad:async({context:e})=>{if((await e.queryClient.ensureQueryData(i())).user)throw r({to:`/`})},component:n(()=>e(()=>import(`./_token-s0TefqyQ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url),`component`)});export{o as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{t as a}from"./useMutation-vgMtqBOX.js";import{n as o}from"./useStore-Vo4KhxPy.js";import{t as s}from"./button-DG1Ca1S5.js";import{d as c}from"./manifest-CKNOp_Vu.js";import{t as l}from"./session-Y-9LAiv-.js";import{n as u,r as d,t as f}from"./-locale-param-DNqvygi2.js";import{a as p,i as m,n as h,r as g,t as _}from"./card-L2-kK5VK.js";import{t as v}from"./_token-DnOWzW7K.js";import{t as y}from"./input-xYuLUQID.js";import{a as b,o as x,t as S}from"./passkey-DN4QfROE.js";import{a as C,f as w,i as T,n as E,o as D,s as O,t as k}from"./form-B_PPIck3.js";import{n as A,t as j}from"./alert-cwX3fWUu.js";var M=e(n()),N=e(t());function P(){let e=x(),{token:t}=v.useParams(),n=v.useSearch(),P=c(),{i18n:F}=r(),I=o(),[L,R]=(0,M.useState)(null),z=e=>{u(e),window.location.assign(f(n,e))},B=a({mutationFn:e=>S({token:t,...e.name?{name:e.name}:{}}),onMutate:()=>{R(null)},onSuccess:async()=>{await I.options.context.queryClient.invalidateQueries({queryKey:l}),await I.navigate({to:`/`})},onError:e=>{R(e instanceof b?e.code:`unknown`)}}),V=w({defaultValues:{name:``}}),H=V.handleSubmit(e=>{B.mutate({name:e.name||void 0})});return(0,N.jsxs)(_,{children:[(0,N.jsxs)(m,{children:[(0,N.jsx)(p,{children:(0,N.jsx)(`h1`,{"data-testid":`accept-invite-heading`,children:(0,N.jsx)(i,{id:`auth.acceptInvite.title`,message:`Accept your invite`})})}),(0,N.jsx)(g,{children:(0,N.jsx)(i,{id:`auth.acceptInvite.description`,message:`Set up a passkey to finish creating your account. Your browser or device will guide you through the prompt.`})})]}),(0,N.jsxs)(h,{children:[(0,N.jsx)(k,{...V,children:(0,N.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:H,children:[(0,N.jsx)(T,{control:V.control,name:`name`,render:({field:e})=>(0,N.jsxs)(C,{children:[(0,N.jsx)(D,{children:(0,N.jsx)(i,{id:`auth.acceptInvite.name`,message:`Name`})}),(0,N.jsx)(E,{children:(0,N.jsx)(y,{type:`text`,autoComplete:`name`,disabled:B.isPending,"data-testid":`accept-invite-name-input`,...e})}),(0,N.jsx)(O,{})]})}),L?(0,N.jsx)(j,{variant:`destructive`,"data-testid":`accept-invite-error`,children:(0,N.jsx)(A,{children:e(L)})}):null,(0,N.jsx)(s,{type:`submit`,disabled:B.isPending,"data-testid":`accept-invite-submit`,children:B.isPending?(0,N.jsx)(i,{id:`auth.acceptInvite.submit.pending`,message:`Setting up…`}):(0,N.jsx)(i,{id:`auth.acceptInvite.submit.idle`,message:`Create passkey`})})]})}),(0,N.jsx)(d,{currentCode:F.locale,manifest:P,onSelect:z})]})]})}export{P as component};
1
+ import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{i as r,n as i}from"./dist-BL2bKHuR.js";import{t as a}from"./useMutation-vgMtqBOX.js";import{n as o}from"./useStore-Vo4KhxPy.js";import{t as s}from"./button-DG1Ca1S5.js";import{f as c}from"./manifest-Bdiv3Qyq.js";import{t as l}from"./session-Y-9LAiv-.js";import{n as u,r as d,t as f}from"./-locale-param-DNqvygi2.js";import{a as p,i as m,n as h,r as g,t as _}from"./card-L2-kK5VK.js";import{t as v}from"./_token-DVnFp6Xw.js";import{t as y}from"./input-xYuLUQID.js";import{a as b,o as x,t as S}from"./passkey-DN4QfROE.js";import{a as C,f as w,i as T,n as E,o as D,s as O,t as k}from"./form-B_PPIck3.js";import{n as A,t as j}from"./alert-cwX3fWUu.js";var M=e(n()),N=e(t());function P(){let e=x(),{token:t}=v.useParams(),n=v.useSearch(),P=c(),{i18n:F}=r(),I=o(),[L,R]=(0,M.useState)(null),z=e=>{u(e),window.location.assign(f(n,e))},B=a({mutationFn:e=>S({token:t,...e.name?{name:e.name}:{}}),onMutate:()=>{R(null)},onSuccess:async()=>{await I.options.context.queryClient.invalidateQueries({queryKey:l}),await I.navigate({to:`/`})},onError:e=>{R(e instanceof b?e.code:`unknown`)}}),V=w({defaultValues:{name:``}}),H=V.handleSubmit(e=>{B.mutate({name:e.name||void 0})});return(0,N.jsxs)(_,{children:[(0,N.jsxs)(m,{children:[(0,N.jsx)(p,{children:(0,N.jsx)(`h1`,{"data-testid":`accept-invite-heading`,children:(0,N.jsx)(i,{id:`auth.acceptInvite.title`,message:`Accept your invite`})})}),(0,N.jsx)(g,{children:(0,N.jsx)(i,{id:`auth.acceptInvite.description`,message:`Set up a passkey to finish creating your account. Your browser or device will guide you through the prompt.`})})]}),(0,N.jsxs)(h,{children:[(0,N.jsx)(k,{...V,children:(0,N.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:H,children:[(0,N.jsx)(T,{control:V.control,name:`name`,render:({field:e})=>(0,N.jsxs)(C,{children:[(0,N.jsx)(D,{children:(0,N.jsx)(i,{id:`auth.acceptInvite.name`,message:`Name`})}),(0,N.jsx)(E,{children:(0,N.jsx)(y,{type:`text`,autoComplete:`name`,disabled:B.isPending,"data-testid":`accept-invite-name-input`,...e})}),(0,N.jsx)(O,{})]})}),L?(0,N.jsx)(j,{variant:`destructive`,"data-testid":`accept-invite-error`,children:(0,N.jsx)(A,{children:e(L)})}):null,(0,N.jsx)(s,{type:`submit`,disabled:B.isPending,"data-testid":`accept-invite-submit`,children:B.isPending?(0,N.jsx)(i,{id:`auth.acceptInvite.submit.pending`,message:`Setting up…`}):(0,N.jsx)(i,{id:`auth.acceptInvite.submit.idle`,message:`Create passkey`})})]})}),(0,N.jsx)(d,{currentCode:F.locale,manifest:P,onSelect:z})]})]})}export{P as component};