@hot-updater/console 1.0.0-rc.7 → 1.0.0-rc.9

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 (61) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{HashValueDisplay-CY2Cai48.js → HashValueDisplay-BpTc3Oyg.js} +1 -1
  3. package/.output/public/assets/{api-keys-CWfHO6DY.js → api-keys-64PM9PwW.js} +1 -1
  4. package/.output/public/assets/{dialog-Dbuw0R4e.js → dialog-IVMkBRCq.js} +1 -1
  5. package/.output/public/assets/index-Cb_D1D6N.js +10 -0
  6. package/.output/public/assets/{insights-C_2j568D.js → insights-Bm9v8uO3.js} +2 -2
  7. package/.output/public/assets/insights-DS3iO7Up.js +1 -0
  8. package/.output/public/assets/{insights-usage-rpc-BXtlz1S0.js → insights-usage-rpc-BaGR3lgq.js} +1 -1
  9. package/.output/public/assets/{insights_.distribution-BwKYrVUv.js → insights_.distribution-B1i6cjlQ.js} +1 -1
  10. package/.output/public/assets/{insights_.distribution-ByJobL9p.js → insights_.distribution-C1Wf27eB.js} +2 -2
  11. package/.output/public/assets/{installations-fhsURlc2.js → installations-CkFW4fV9.js} +2 -2
  12. package/.output/public/assets/{installations-CGObvuL8.js → installations-DxTaIcHD.js} +1 -1
  13. package/.output/public/assets/{routes-BKnnJLD3.js → routes-Cgtvspjg.js} +2 -2
  14. package/.output/public/assets/{routes-BZVv_cIP.js → routes-O2r2UUN8.js} +1 -1
  15. package/.output/public/assets/{valueToPercent-eWmbHiZg.js → valueToPercent-BAtcbSLk.js} +1 -1
  16. package/.output/server/{__23tanstack-start-server-fn-resolver-Dg6mvjrg.mjs → __23tanstack-start-server-fn-resolver-DBRojHaG.mjs} +35 -35
  17. package/.output/server/_libs/lucide-react.mjs +15 -1
  18. package/.output/server/_ssr/{HashValueDisplay-DyyzNuzZ.mjs → HashValueDisplay-CyMmr0O9.mjs} +2 -2
  19. package/.output/server/_ssr/{InsightsPageHeader-B3fWWegB.mjs → InsightsPageHeader-mtxVuZKK.mjs} +4 -4
  20. package/.output/server/_ssr/{api-BZ-OvJCh.mjs → api-BfCgYlj5.mjs} +2 -2
  21. package/.output/server/_ssr/{api-keys-DQo0lq3_.mjs → api-keys-CzZ7Ont4.mjs} +8 -8
  22. package/.output/server/_ssr/{api-keys-api-TEyo6WfP.mjs → api-keys-api-C3oeq01R.mjs} +2 -2
  23. package/.output/server/_ssr/{api-keys-rpc-CmTC7jBa.mjs → api-keys-rpc-CdPFdGOx.mjs} +3 -3
  24. package/.output/server/_ssr/{api-rpc-BKjnp3TJ.mjs → api-rpc-B2E1ZIG5.mjs} +21 -21
  25. package/.output/server/_ssr/{auth-rpc-UCf_vmlp.mjs → auth-rpc-DH6Bhwcz.mjs} +2 -2
  26. package/.output/server/_ssr/{bundle-signing-rpc-iSr-Ngwt.mjs → bundle-signing-rpc-Di7-I6fE.mjs} +2 -2
  27. package/.output/server/_ssr/{card-B_gzKhRe.mjs → card-Bemj0dpY.mjs} +1 -1
  28. package/.output/server/_ssr/{config.server-BkYL6fW9.mjs → config.server-B8WsT3s0.mjs} +2 -2
  29. package/.output/server/_ssr/{createSsrRpc-C34Dal5W.mjs → createSsrRpc-CdlfejmI.mjs} +2 -2
  30. package/.output/server/_ssr/{dialog-Ds_i5bv-.mjs → dialog-CKvQ4VIE.mjs} +1 -1
  31. package/.output/server/_ssr/{field-ld8e_WUj.mjs → field-BrQ2u0fT.mjs} +2 -2
  32. package/.output/server/_ssr/{input-group-DULLqCud.mjs → input-group-BrGSjz4S.mjs} +1 -1
  33. package/.output/server/_ssr/{insights-jLos2FOi.mjs → insights-BwQ-wF2a.mjs} +2 -2
  34. package/.output/server/_ssr/{insights-CYvWpnAZ.mjs → insights-gr1I_dJU.mjs} +87 -84
  35. package/.output/server/_ssr/{insights-recovery-rpc-BYbyVb92.mjs → insights-recovery-rpc-DOzxfYfv.mjs} +3 -3
  36. package/.output/server/_ssr/{insights-rpc-DS_BoE-v.mjs → insights-rpc-DDKmIrpV.mjs} +2 -2
  37. package/.output/server/_ssr/{insights-usage-rpc-CJCoqMOF.mjs → insights-usage-rpc-4ImOq_0p.mjs} +3 -3
  38. package/.output/server/_ssr/{insights-usage-rpc-BWExUEjD.mjs → insights-usage-rpc-BUruODjE.mjs} +2 -2
  39. package/.output/server/_ssr/{insights_.distribution-DiTfPsb7.mjs → insights_.distribution-VmHuikRE.mjs} +2 -2
  40. package/.output/server/_ssr/{insights_.distribution-ixF84W1_.mjs → insights_.distribution-cIsU-kHG.mjs} +9 -9
  41. package/.output/server/_ssr/{installations-CUrqA6LX.mjs → installations-C5anhyP0.mjs} +10 -10
  42. package/.output/server/_ssr/{installations-CLtFq-gD.mjs → installations-HXMF_kKf.mjs} +2 -2
  43. package/.output/server/_ssr/{router-DckMSIPJ.mjs → router-BuanSsRI.mjs} +43 -19
  44. package/.output/server/_ssr/{routes-BBb0K8Sd.mjs → routes-DY-vqU6R.mjs} +12 -12
  45. package/.output/server/_ssr/{routes-IZNP7l0O.mjs → routes-Dru3IRj0.mjs} +2 -2
  46. package/.output/server/_ssr/{select-VIcRoXiO.mjs → select-DD2szs3Y.mjs} +2 -2
  47. package/.output/server/_ssr/{server-4_Ats6nF.mjs → server-DJm72Kj-.mjs} +3 -3
  48. package/.output/server/_ssr/{signing-DuuE3pAM.mjs → signing-H8Lg4lPe.mjs} +4 -4
  49. package/.output/server/_ssr/ssr.mjs +1 -1
  50. package/.output/server/_ssr/{table-CnGb5bTm.mjs → table-CTj6n-4F.mjs} +1 -1
  51. package/.output/server/{_tanstack-start-manifest_v-BRzxTsLK.mjs → _tanstack-start-manifest_v-DsFcTLw_.mjs} +24 -24
  52. package/.output/server/index.mjs +129 -129
  53. package/package.json +2 -2
  54. package/src/components/AppSidebar.tsx +33 -1
  55. package/src/components/ConsoleAccessPage.tsx +5 -1
  56. package/src/components/features/insights/AppUsage.tsx +2 -2
  57. package/src/routes/__root.tsx +3 -3
  58. package/.output/public/assets/index-DtyGtumE.js +0 -10
  59. package/.output/public/assets/insights-B1jNm97C.js +0 -1
  60. /package/.output/public/assets/{dist--1mhr9Bo.js → dist-BR4GzeEu.js} +0 -0
  61. /package/.output/public/assets/{useOpenInteractionType-r8C6rVqm.js → useOpenInteractionType-D5kduCTD.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  {
2
- "date": "2026-09-08T04:30:41.709Z",
2
+ "date": "2026-09-08T07:46:45.908Z",
3
3
  "preset": "node-server",
4
4
  "framework": {
5
5
  "name": "nitro",
@@ -1 +1 @@
1
- import{_ as e,cr as t,g as n,jn as r,nr as i,y as a}from"./createServerFn-DU71xucx.js";import{n as o}from"./dist--1mhr9Bo.js";var s=i(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),c=t(),l=(e,t=12)=>e.length>t?`${e.slice(0,Math.max(1,t-4))}…${e.slice(-4)}`:e;function u({value:t,maxLength:i=12,className:s,buttonClassName:u}){let d=t.length>i,f=l(t,i),p=async()=>{try{await navigator.clipboard.writeText(t),o.success(`Copied to clipboard`,{description:t})}catch{o.error(`Failed to copy value`)}},m=e=>{e.preventDefault(),e.stopPropagation(),p()},h=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),p())},g=(0,c.jsx)(`span`,{translate:`no`,className:r(`font-mono text-xs tabular-nums whitespace-nowrap`,s),children:f});return(0,c.jsxs)(n,{children:[(0,c.jsx)(a,{render:(0,c.jsx)(`button`,{type:`button`,"aria-label":`Copy full value: ${t}`,translate:`no`,className:r(`ring-ring/30 bg-muted/40 border-border/70 inline-flex min-w-0 max-w-full cursor-pointer items-center rounded-md border px-1.5 py-0.5 align-top shadow-xs outline-none transition-[background-color,border-color,transform,box-shadow]`,`hover:bg-muted/70 active:scale-[0.98] active:bg-muted/85 focus-visible:ring-[2px]`,`touch-manipulation select-none motion-reduce:transition-none motion-reduce:active:scale-100`,!d&&`cursor-copy`,u),onClick:m,onKeyDown:h}),children:g}),(0,c.jsx)(e,{hidden:!d,children:(0,c.jsx)(`p`,{translate:`no`,className:`break-all font-mono text-xs tabular-nums`,children:t})})]})}export{l as n,s as r,u as t};
1
+ import{_ as e,cr as t,g as n,jn as r,nr as i,y as a}from"./createServerFn-DU71xucx.js";import{n as o}from"./dist-BR4GzeEu.js";var s=i(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),c=t(),l=(e,t=12)=>e.length>t?`${e.slice(0,Math.max(1,t-4))}…${e.slice(-4)}`:e;function u({value:t,maxLength:i=12,className:s,buttonClassName:u}){let d=t.length>i,f=l(t,i),p=async()=>{try{await navigator.clipboard.writeText(t),o.success(`Copied to clipboard`,{description:t})}catch{o.error(`Failed to copy value`)}},m=e=>{e.preventDefault(),e.stopPropagation(),p()},h=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),p())},g=(0,c.jsx)(`span`,{translate:`no`,className:r(`font-mono text-xs tabular-nums whitespace-nowrap`,s),children:f});return(0,c.jsxs)(n,{children:[(0,c.jsx)(a,{render:(0,c.jsx)(`button`,{type:`button`,"aria-label":`Copy full value: ${t}`,translate:`no`,className:r(`ring-ring/30 bg-muted/40 border-border/70 inline-flex min-w-0 max-w-full cursor-pointer items-center rounded-md border px-1.5 py-0.5 align-top shadow-xs outline-none transition-[background-color,border-color,transform,box-shadow]`,`hover:bg-muted/70 active:scale-[0.98] active:bg-muted/85 focus-visible:ring-[2px]`,`touch-manipulation select-none motion-reduce:transition-none motion-reduce:active:scale-100`,!d&&`cursor-copy`,u),onClick:m,onKeyDown:h}),children:g}),(0,c.jsx)(e,{hidden:!d,children:(0,c.jsx)(`p`,{translate:`no`,className:`break-all font-mono text-xs tabular-nums`,children:t})})]})}export{l as n,s as r,u as t};
@@ -1 +1 @@
1
- import{En as e,On as t,Rr as n,Vr as r,cr as i,kn as a,m as o,nr as s,tr as c}from"./createServerFn-DU71xucx.js";import{a as l,i as u,n as d,r as f,s as p,t as m}from"./field-B3CYDpjg.js";import{a as h,i as ee,o as g,r as _}from"./api-keys-api-BeaJnvY5.js";import{t as v}from"./loader-circle-CUKfUqow.js";import{T as te,_ as y,a as b,d as x,f as ne,g as re,h as S,i as C,l as w,m as T,n as E,o as D,p as O,r as k,t as A,u as j,v as M}from"./dialog-Dbuw0R4e.js";import{t as N}from"./refresh-cw-CNE_2PnD.js";import{a as P,i as F,n as I,o as L,r as R,t as z}from"./table-BuWQgxJJ.js";import{n as B}from"./dist--1mhr9Bo.js";import{a as V,c as H,d as U,l as W,n as G,o as K,s as q,t as J,u as Y}from"./card-CYHs5FZv.js";var X=s(`clipboard`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]),Z=s(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Q=r(n(),1),$=i(),ie=e=>new Date(e).toISOString().slice(0,10);function ae(){let[e,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(``),[o,s]=(0,Q.useState)(null),c=ee(),h=r.trim(),_=h.length>64?`Name must be 64 characters or fewer.`:null,y=()=>{i(``),s(null),c.reset()},x=e=>{n(e),e||y()};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(a,{onClick:()=>n(!0),children:[(0,$.jsx)(te,{"data-icon":`inline-start`}),`Create API key`]}),(0,$.jsx)(A,{open:e,onOpenChange:x,children:(0,$.jsxs)(E,{showCloseButton:o===null,children:[(0,$.jsxs)(b,{children:[(0,$.jsx)(D,{children:o===null?`Create API key`:`Save your API key`}),(0,$.jsx)(k,{children:o===null?`Name the app or environment that will use this key.`:`This key is shown once. Store it securely before closing.`})]}),o===null?(0,$.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!(h.length===0||_!==null))try{s((await c.mutateAsync(h)).apiKey),B.success(`API key created`)}catch(e){B.error(e instanceof Error?e.message:`Unable to create API key`)}},children:[(0,$.jsx)(u,{children:(0,$.jsxs)(m,{"data-invalid":_!==null||void 0,children:[(0,$.jsx)(l,{htmlFor:`api-key-name`,children:`Name`}),(0,$.jsx)(t,{id:`api-key-name`,autoComplete:`off`,maxLength:65,onChange:e=>i(e.target.value),placeholder:`Production app`,value:r}),(0,$.jsx)(d,{children:`Use a name you can identify before revoking the key.`}),(0,$.jsx)(f,{children:_})]})}),(0,$.jsx)(C,{className:`mt-4`,children:(0,$.jsxs)(a,{disabled:c.isPending||h.length===0||_!==null,type:`submit`,children:[c.isPending?(0,$.jsx)(v,{"data-icon":`inline-start`,className:`animate-spin`}):(0,$.jsx)(g,{"data-icon":`inline-start`}),`Create API key`]})})]}):(0,$.jsxs)(u,{children:[(0,$.jsxs)(m,{children:[(0,$.jsx)(l,{htmlFor:`created-api-key`,children:`API key`}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(t,{id:`created-api-key`,className:`font-mono`,readOnly:!0,value:o}),(0,$.jsxs)(a,{onClick:async()=>{if(o!==null)try{await navigator.clipboard.writeText(o),B.success(`API key copied`)}catch{B.error(`Unable to copy API key`)}},type:`button`,variant:`outline`,children:[(0,$.jsx)(X,{"data-icon":`inline-start`}),`Copy`]})]})]}),(0,$.jsx)(C,{children:(0,$.jsxs)(a,{onClick:()=>x(!1),children:[(0,$.jsx)(p,{"data-icon":`inline-start`}),`Done`]})})]})]})})]})}function oe({record:e}){let[t,n]=(0,Q.useState)(!1),r=h(),i=async t=>{t.preventDefault();try{await r.mutateAsync(e.id),n(!1),B.success(`API key revoked`)}catch(e){B.error(e instanceof Error?e.message:`Unable to revoke API key`)}};return(0,$.jsxs)(w,{open:t,onOpenChange:e=>{r.isPending||n(e)},children:[(0,$.jsxs)(M,{render:(0,$.jsx)(a,{size:`sm`,variant:`ghost`}),children:[(0,$.jsx)(Z,{"data-icon":`inline-start`}),`Revoke`]}),(0,$.jsxs)(ne,{children:[(0,$.jsxs)(S,{children:[(0,$.jsx)(re,{children:(0,$.jsx)(Z,{})}),(0,$.jsxs)(y,{children:[`Revoke `,e.name,`?`]}),(0,$.jsxs)(O,{children:[`Apps using `,e.prefix,`… will immediately lose OTA update and insights access. This action cannot be undone.`]})]}),(0,$.jsxs)(T,{children:[(0,$.jsx)(x,{disabled:r.isPending,children:`Cancel`}),(0,$.jsx)(j,{disabled:r.isPending,onClick:e=>void i(e),variant:`destructive`,children:`Revoke API key`})]})]})]})}function se(){let t=_();return(0,$.jsxs)(J,{className:`overflow-hidden shadow-sm`,children:[(0,$.jsxs)(V,{className:`flex-row items-center justify-between space-y-0 border-b px-4 py-3`,children:[(0,$.jsx)(K,{className:`text-sm`,children:(0,$.jsx)(`h2`,{children:`API keys`})}),(0,$.jsx)(ae,{})]}),(0,$.jsx)(G,{className:`p-0`,children:t.isError?(0,$.jsx)(`div`,{className:`p-4`,children:(0,$.jsxs)(H,{variant:`destructive`,children:[(0,$.jsx)(c,{}),(0,$.jsx)(U,{children:`API keys couldn't be loaded`}),(0,$.jsx)(Y,{children:`Check your connection and try again.`}),(0,$.jsx)(W,{children:(0,$.jsxs)(a,{onClick:()=>void t.refetch(),size:`xs`,variant:`outline`,children:[(0,$.jsx)(N,{"data-icon":`inline-start`}),`Retry`]})})]})}):(0,$.jsxs)(z,{"aria-label":`API keys`,className:`table-fixed`,children:[(0,$.jsx)(P,{children:(0,$.jsxs)(L,{children:[(0,$.jsx)(F,{children:`Key`}),(0,$.jsx)(F,{className:`w-32`,children:`Created`}),(0,$.jsx)(F,{className:`w-24 text-right`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,$.jsx)(I,{children:t.isLoading?Array.from({length:3},(t,n)=>(0,$.jsxs)(L,{children:[(0,$.jsxs)(R,{className:`space-y-2 py-3`,children:[n===0?(0,$.jsx)(`span`,{className:`sr-only`,children:`Loading API keys`}):null,(0,$.jsx)(e,{className:`h-3.5 w-32`}),(0,$.jsx)(e,{className:`h-3 w-20`})]}),(0,$.jsx)(R,{children:(0,$.jsx)(e,{className:`h-3.5 w-20`})}),(0,$.jsx)(R,{children:(0,$.jsx)(e,{className:`ml-auto h-6 w-16`})})]},n)):t.data?.length===0?(0,$.jsx)(L,{children:(0,$.jsx)(R,{colSpan:3,className:`h-40 text-center text-muted-foreground`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex max-w-xs flex-col items-center gap-2`,children:[(0,$.jsx)(g,{className:`size-5`}),(0,$.jsx)(`p`,{className:`font-medium text-foreground`,children:`No API keys`}),(0,$.jsx)(`p`,{children:`Create an API key to connect an app.`})]})})}):t.data?.map(e=>(0,$.jsxs)(L,{className:e.revoked_at_ms===null?void 0:`text-muted-foreground`,children:[(0,$.jsx)(R,{className:`whitespace-normal py-3`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(`p`,{className:`break-words font-medium text-foreground`,children:e.name}),(0,$.jsxs)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:[e.prefix,`…`]})]})}),(0,$.jsx)(R,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(`time`,{dateTime:new Date(e.created_at_ms).toISOString(),children:ie(e.created_at_ms)})}),(0,$.jsx)(R,{className:`text-right`,children:e.revoked_at_ms===null?(0,$.jsx)(oe,{record:e}):(0,$.jsx)(q,{variant:`outline`,children:`Revoked`})})]},e.id))})]})})]})}function ce(){return(0,$.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,$.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b bg-background px-3 py-3 sm:min-h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,$.jsx)(o,{className:`-ml-1`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(g,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,$.jsx)(`h1`,{className:`text-sm font-medium`,children:`API keys`})]}),(0,$.jsx)(`p`,{className:`basis-full pl-9 text-xs text-muted-foreground sm:basis-auto sm:pl-0`,children:`API keys can download OTA updates and submit insights only.`})]}),(0,$.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-5xl`,children:(0,$.jsx)(se,{})})})]})}export{ce as component};
1
+ import{En as e,On as t,Rr as n,Vr as r,cr as i,kn as a,m as o,nr as s,tr as c}from"./createServerFn-DU71xucx.js";import{a as l,i as u,n as d,r as f,s as p,t as m}from"./field-B3CYDpjg.js";import{a as h,i as ee,o as g,r as _}from"./api-keys-api-BeaJnvY5.js";import{t as v}from"./loader-circle-CUKfUqow.js";import{T as te,_ as y,a as b,d as x,f as ne,g as re,h as S,i as C,l as w,m as T,n as E,o as D,p as O,r as k,t as A,u as j,v as M}from"./dialog-IVMkBRCq.js";import{t as N}from"./refresh-cw-CNE_2PnD.js";import{a as P,i as F,n as I,o as L,r as R,t as z}from"./table-BuWQgxJJ.js";import{n as B}from"./dist-BR4GzeEu.js";import{a as V,c as H,d as U,l as W,n as G,o as K,s as q,t as J,u as Y}from"./card-CYHs5FZv.js";var X=s(`clipboard`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]),Z=s(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Q=r(n(),1),$=i(),ie=e=>new Date(e).toISOString().slice(0,10);function ae(){let[e,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(``),[o,s]=(0,Q.useState)(null),c=ee(),h=r.trim(),_=h.length>64?`Name must be 64 characters or fewer.`:null,y=()=>{i(``),s(null),c.reset()},x=e=>{n(e),e||y()};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(a,{onClick:()=>n(!0),children:[(0,$.jsx)(te,{"data-icon":`inline-start`}),`Create API key`]}),(0,$.jsx)(A,{open:e,onOpenChange:x,children:(0,$.jsxs)(E,{showCloseButton:o===null,children:[(0,$.jsxs)(b,{children:[(0,$.jsx)(D,{children:o===null?`Create API key`:`Save your API key`}),(0,$.jsx)(k,{children:o===null?`Name the app or environment that will use this key.`:`This key is shown once. Store it securely before closing.`})]}),o===null?(0,$.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!(h.length===0||_!==null))try{s((await c.mutateAsync(h)).apiKey),B.success(`API key created`)}catch(e){B.error(e instanceof Error?e.message:`Unable to create API key`)}},children:[(0,$.jsx)(u,{children:(0,$.jsxs)(m,{"data-invalid":_!==null||void 0,children:[(0,$.jsx)(l,{htmlFor:`api-key-name`,children:`Name`}),(0,$.jsx)(t,{id:`api-key-name`,autoComplete:`off`,maxLength:65,onChange:e=>i(e.target.value),placeholder:`Production app`,value:r}),(0,$.jsx)(d,{children:`Use a name you can identify before revoking the key.`}),(0,$.jsx)(f,{children:_})]})}),(0,$.jsx)(C,{className:`mt-4`,children:(0,$.jsxs)(a,{disabled:c.isPending||h.length===0||_!==null,type:`submit`,children:[c.isPending?(0,$.jsx)(v,{"data-icon":`inline-start`,className:`animate-spin`}):(0,$.jsx)(g,{"data-icon":`inline-start`}),`Create API key`]})})]}):(0,$.jsxs)(u,{children:[(0,$.jsxs)(m,{children:[(0,$.jsx)(l,{htmlFor:`created-api-key`,children:`API key`}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(t,{id:`created-api-key`,className:`font-mono`,readOnly:!0,value:o}),(0,$.jsxs)(a,{onClick:async()=>{if(o!==null)try{await navigator.clipboard.writeText(o),B.success(`API key copied`)}catch{B.error(`Unable to copy API key`)}},type:`button`,variant:`outline`,children:[(0,$.jsx)(X,{"data-icon":`inline-start`}),`Copy`]})]})]}),(0,$.jsx)(C,{children:(0,$.jsxs)(a,{onClick:()=>x(!1),children:[(0,$.jsx)(p,{"data-icon":`inline-start`}),`Done`]})})]})]})})]})}function oe({record:e}){let[t,n]=(0,Q.useState)(!1),r=h(),i=async t=>{t.preventDefault();try{await r.mutateAsync(e.id),n(!1),B.success(`API key revoked`)}catch(e){B.error(e instanceof Error?e.message:`Unable to revoke API key`)}};return(0,$.jsxs)(w,{open:t,onOpenChange:e=>{r.isPending||n(e)},children:[(0,$.jsxs)(M,{render:(0,$.jsx)(a,{size:`sm`,variant:`ghost`}),children:[(0,$.jsx)(Z,{"data-icon":`inline-start`}),`Revoke`]}),(0,$.jsxs)(ne,{children:[(0,$.jsxs)(S,{children:[(0,$.jsx)(re,{children:(0,$.jsx)(Z,{})}),(0,$.jsxs)(y,{children:[`Revoke `,e.name,`?`]}),(0,$.jsxs)(O,{children:[`Apps using `,e.prefix,`… will immediately lose OTA update and insights access. This action cannot be undone.`]})]}),(0,$.jsxs)(T,{children:[(0,$.jsx)(x,{disabled:r.isPending,children:`Cancel`}),(0,$.jsx)(j,{disabled:r.isPending,onClick:e=>void i(e),variant:`destructive`,children:`Revoke API key`})]})]})]})}function se(){let t=_();return(0,$.jsxs)(J,{className:`overflow-hidden shadow-sm`,children:[(0,$.jsxs)(V,{className:`flex-row items-center justify-between space-y-0 border-b px-4 py-3`,children:[(0,$.jsx)(K,{className:`text-sm`,children:(0,$.jsx)(`h2`,{children:`API keys`})}),(0,$.jsx)(ae,{})]}),(0,$.jsx)(G,{className:`p-0`,children:t.isError?(0,$.jsx)(`div`,{className:`p-4`,children:(0,$.jsxs)(H,{variant:`destructive`,children:[(0,$.jsx)(c,{}),(0,$.jsx)(U,{children:`API keys couldn't be loaded`}),(0,$.jsx)(Y,{children:`Check your connection and try again.`}),(0,$.jsx)(W,{children:(0,$.jsxs)(a,{onClick:()=>void t.refetch(),size:`xs`,variant:`outline`,children:[(0,$.jsx)(N,{"data-icon":`inline-start`}),`Retry`]})})]})}):(0,$.jsxs)(z,{"aria-label":`API keys`,className:`table-fixed`,children:[(0,$.jsx)(P,{children:(0,$.jsxs)(L,{children:[(0,$.jsx)(F,{children:`Key`}),(0,$.jsx)(F,{className:`w-32`,children:`Created`}),(0,$.jsx)(F,{className:`w-24 text-right`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,$.jsx)(I,{children:t.isLoading?Array.from({length:3},(t,n)=>(0,$.jsxs)(L,{children:[(0,$.jsxs)(R,{className:`space-y-2 py-3`,children:[n===0?(0,$.jsx)(`span`,{className:`sr-only`,children:`Loading API keys`}):null,(0,$.jsx)(e,{className:`h-3.5 w-32`}),(0,$.jsx)(e,{className:`h-3 w-20`})]}),(0,$.jsx)(R,{children:(0,$.jsx)(e,{className:`h-3.5 w-20`})}),(0,$.jsx)(R,{children:(0,$.jsx)(e,{className:`ml-auto h-6 w-16`})})]},n)):t.data?.length===0?(0,$.jsx)(L,{children:(0,$.jsx)(R,{colSpan:3,className:`h-40 text-center text-muted-foreground`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex max-w-xs flex-col items-center gap-2`,children:[(0,$.jsx)(g,{className:`size-5`}),(0,$.jsx)(`p`,{className:`font-medium text-foreground`,children:`No API keys`}),(0,$.jsx)(`p`,{children:`Create an API key to connect an app.`})]})})}):t.data?.map(e=>(0,$.jsxs)(L,{className:e.revoked_at_ms===null?void 0:`text-muted-foreground`,children:[(0,$.jsx)(R,{className:`whitespace-normal py-3`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(`p`,{className:`break-words font-medium text-foreground`,children:e.name}),(0,$.jsxs)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:[e.prefix,`…`]})]})}),(0,$.jsx)(R,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(`time`,{dateTime:new Date(e.created_at_ms).toISOString(),children:ie(e.created_at_ms)})}),(0,$.jsx)(R,{className:`text-right`,children:e.revoked_at_ms===null?(0,$.jsx)(oe,{record:e}):(0,$.jsx)(q,{variant:`outline`,children:`Revoked`})})]},e.id))})]})})]})}function ce(){return(0,$.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,$.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b bg-background px-3 py-3 sm:min-h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,$.jsx)(o,{className:`-ml-1`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(g,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,$.jsx)(`h1`,{className:`text-sm font-medium`,children:`API keys`})]}),(0,$.jsx)(`p`,{className:`basis-full pl-9 text-xs text-muted-foreground sm:basis-auto sm:pl-0`,children:`API keys can download OTA updates and submit insights only.`})]}),(0,$.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-5xl`,children:(0,$.jsx)(se,{})})})]})}export{ce as component};
@@ -1 +1 @@
1
- import{$n as e,A as t,B as n,E as r,F as i,H as a,I as o,Jn as s,K as c,Kn as l,L as u,M as d,Mn as f,N as p,O as m,P as h,Pt as g,R as _,Rr as v,Rt as y,T as b,Tn as x,Ut as S,V as C,Vr as w,W as T,Y as E,Z as D,cr as O,er as k,j as A,jn as j,kn as M,ln as ee,nr as te,rt as N,tt as P,un as F,w as I,z as ne}from"./createServerFn-DU71xucx.js";import{s as re}from"./table-BuWQgxJJ.js";import{C as ie,S as ae,i as oe,n as se,u as ce,w as le,x as ue}from"./useOpenInteractionType-r8C6rVqm.js";var de=te(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),L=w(v());function fe(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`);ne(t,a),o(t);let{forceUnmount:s}=u(a,t),c=L.useCallback(()=>{t.setOpen(!1,g(S))},[t]);return L.useImperativeHandle(r,()=>({unmount:s,close:c}),[s,c]),{parentContext:n,isDrawer:i}}function R({store:e,dialogRoot:t}){let{parentContext:n,isDrawer:r}=t,i=e.useState(`open`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[u,d]=L.useState(0),[f,p]=L.useState(0),m=u===0,g=D(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0||`touches`in t&&t.touches.length!==1)return!1;let n=F(t);if(m&&!a){let t=n;return o&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===t||e.context.backdropRef.current===t||ee(t,c)&&!t?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:m});return ue(i&&o===!0,c),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{d(e),p(t)}),e.useContextCallback(`onNestedDialogClose`,()=>{d(0),p(0)}),L.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(u+1,f+ +!!r),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[r,i,u,f,n]),_(e,{activeTriggerProps:g.reference??s,inactiveTriggerProps:g.trigger??s,popupProps:L.useMemo(()=>k(h,g.floating),[g.floating]),nestedOpenDialogCount:u,nestedOpenDrawerCount:f}),null}var z=L.createContext(!1),B=L.createContext(void 0);function V(t){let n=L.useContext(B);if(t===!1&&n===void 0)throw Error(e(27));return n}var pe={...d,modal:E(e=>e.modal),nested:E(e=>e.nested),nestedOpenDialogCount:E(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:E(e=>e.nestedOpenDrawerCount),disablePointerDismissal:E(e=>e.disablePointerDismissal),openMethod:E(e=>e.openMethod),descriptionElementId:E(e=>e.descriptionElementId),titleElementId:E(e=>e.titleElementId),viewportElement:E(e=>e.viewportElement),role:E(e=>e.role)},me=class e extends c{constructor(e,t,n=!1){let r=new p,i=he(e);i.floatingRootContext=A(r,t,n),super(i,{popupRef:L.createRef(),backdropRef:L.createRef(),internalBackdropRef:L.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},pe)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};i(n,e,t.trigger),this.update(n)};static useStore(t,r){return n(t,(t,n)=>new e(r,t,n),!0).store}};function he(e={}){return{...t(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}var H=O();function U(e,t=`dialog`){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=e,p=t===`drawer`,m=t===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=V(!0),y={modal:h,disablePointerDismissal:g,nested:!!v,role:_},b=me.useStore(u?.store,{open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y});x(()=>{let e=r===void 0&&b.state.open===!1&&i===!0?{open:!0,activeTriggerId:f}:null;m?b.update(e?{...y,...e}:y):e&&b.update(e)}),b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let S=b.useState(`open`),C=b.useState(`mounted`),w=b.useState(`payload`),T=fe({store:b,actionsRef:l,parentContext:v?.store.context,isDrawer:p}),E=S||C,D=L.useMemo(()=>({store:b}),[b]);return(0,H.jsx)(z.Provider,{value:!1,children:(0,H.jsxs)(B.Provider,{value:D,children:[E&&(0,H.jsx)(R,{store:b,dialogRoot:T}),typeof n==`function`?n({payload:w}):n]})})}function ge(e){return U(e,`alert-dialog`)}var _e={...r,...T},W=L.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=V(),c=s.useState(`open`),u=s.useState(`nested`),d=s.useState(`mounted`);return l(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:_e,props:[{role:`presentation`,hidden:!d,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!u})}),G=L.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{store:c}=V(),u=c.useState(`open`),{getButtonProps:d,buttonRef:p}=f({disabled:a,native:o}),m={disabled:a};function h(e){u&&c.setOpen(!1,g(y,e.nativeEvent))}return l(`button`,e,{state:m,ref:[t,p],props:[{onClick:h},s,d]})}),K=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=V(),c=I(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),l(`p`,e,{ref:t,props:[{id:c},o]})}),ve=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),ye=function(e){return e[e.open=b.open]=`open`,e[e.closed=b.closed]=`closed`,e[e.startingStyle=b.startingStyle]=`startingStyle`,e[e.endingStyle=b.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),q=L.createContext(void 0);function be(){let t=L.useContext(q);if(t===void 0)throw Error(e(26));return t}var xe={...r,...T,nestedDialogOpen(e){return e?{[ye.nestedDialogOpen]:``}:null}},J=L.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:o,initialFocus:s,...c}=e,{store:u}=V(),d=u.useState(`descriptionElementId`),f=u.useState(`disablePointerDismissal`),p=u.useState(`floatingRootContext`),m=u.useState(`popupProps`),g=u.useState(`modal`),_=u.useState(`mounted`),v=u.useState(`nested`),y=u.useState(`nestedOpenDialogCount`),b=u.useState(`open`),x=u.useState(`openMethod`),S=u.useState(`titleElementId`),C=u.useState(`transitionStatus`),w=u.useState(`role`),T=p.useState(`floatingId`),E=c.id??T;be(),a({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}});function D(e){return e===`touch`?u.context.popupRef.current:!0}let O=s===void 0?D:s,k=y>0,A=u.useStateSetter(`popupElement`),j=l(`div`,e,{state:{open:b,nested:v,transitionStatus:C,nestedDialogOpen:k},props:[m,{id:E,"aria-labelledby":S??void 0,"aria-describedby":d??void 0,role:w,...h,hidden:!_,onKeyDown(e){ce.has(e.key)&&e.stopPropagation()},style:{[ve.nestedDialogs]:y}},c],ref:[t,u.context.popupRef,A],stateAttributesMapping:xe});return(0,H.jsx)(le,{context:p,openInteractionType:x,disabled:!_,closeOnFocusOut:!f,initialFocus:O,returnFocus:o,modal:g!==!1,restoreFocus:`popup`,children:j})}),Y=L.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=V(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,H.jsx)(q.Provider,{value:n,children:(0,H.jsxs)(P,{ref:t,...r,children:[a&&o===!0&&(0,H.jsx)(oe,{ref:i.context.internalBackdropRef,inert:ae(!s)}),e.children]})}):null}),X=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=V(),c=I(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),l(`h2`,e,{ref:t,props:[{id:c},o]})}),Z=L.forwardRef(function(t,n){let{render:r,className:i,style:a,disabled:o=!1,nativeButton:s=!0,id:c,payload:u,handle:d,...p}=t,h=V(!0),g=d?.store??h?.store;if(!g)throw Error(e(79));let _=I(c),v=g.useState(`floatingRootContext`),y=g.useState(`isOpenedByTrigger`,_),b=g.useState(`triggerPopupId`,_),x=L.useRef(null),{registerTrigger:S,isMountedByThisTrigger:w}=C(_,x,g,{payload:u}),{getButtonProps:T,buttonRef:E}=f({disabled:o,native:s}),D=ie(v,{enabled:v!=null}),O=se(()=>g.select(`open`),e=>{g.set(`openMethod`,e)}),k={disabled:o,open:y},A=g.useState(`triggerProps`,w);return l(`button`,t,{state:k,ref:[E,n,S,x],props:[D.reference,A,O,{[N]:``,id:_,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,T],stateAttributesMapping:m})}),Se=Z;function Ce({...e}){return(0,H.jsx)(ge,{"data-slot":`alert-dialog`,...e})}function we({...e}){return(0,H.jsx)(Se,{"data-slot":`alert-dialog-trigger`,...e})}function Te({...e}){return(0,H.jsx)(Y,{"data-slot":`alert-dialog-portal`,...e})}function Ee({className:e,...t}){return(0,H.jsx)(W,{"data-slot":`alert-dialog-overlay`,className:j(`fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function De({className:e,size:t=`default`,...n}){return(0,H.jsxs)(Te,{children:[(0,H.jsx)(Ee,{}),(0,H.jsx)(J,{"data-slot":`alert-dialog-content`,"data-size":t,className:j(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-3 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function Oe({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:j(`grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function ke({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:j(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Ae({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-dialog-media`,className:j(`mb-2 inline-flex size-8 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-4`,e),...t})}function je({className:e,...t}){return(0,H.jsx)(X,{"data-slot":`alert-dialog-title`,className:j(`text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Me({className:e,...t}){return(0,H.jsx)(K,{"data-slot":`alert-dialog-description`,className:j(`text-xs/relaxed text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Ne({className:e,...t}){return(0,H.jsx)(M,{"data-slot":`alert-dialog-action`,className:j(e),...t})}function Pe({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,H.jsx)(G,{"data-slot":`alert-dialog-cancel`,className:j(e),render:(0,H.jsx)(M,{variant:t,size:n}),...r})}function Q(e){return U(e,L.useContext(z)?`drawer`:`dialog`)}function $({...e}){return(0,H.jsx)(Q,{"data-slot":`dialog`,...e})}function Fe({...e}){return(0,H.jsx)(Z,{"data-slot":`dialog-trigger`,...e})}function Ie({...e}){return(0,H.jsx)(Y,{"data-slot":`dialog-portal`,...e})}function Le({className:e,...t}){return(0,H.jsx)(W,{"data-slot":`dialog-overlay`,className:j(`fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Re({className:e,children:t,showCloseButton:n=!0,...r}){return(0,H.jsxs)(Ie,{children:[(0,H.jsx)(Le,{}),(0,H.jsxs)(J,{"data-slot":`dialog-content`,className:j(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-xs/relaxed ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,H.jsxs)(G,{"data-slot":`dialog-close`,render:(0,H.jsx)(M,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,H.jsx)(re,{}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function ze({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`dialog-header`,className:j(`flex flex-col gap-1`,e),...t})}function Be({className:e,showCloseButton:t=!1,children:n,...r}){return(0,H.jsxs)(`div`,{"data-slot":`dialog-footer`,className:j(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,H.jsx)(G,{render:(0,H.jsx)(M,{variant:`outline`}),children:`Close`})]})}function Ve({className:e,...t}){return(0,H.jsx)(X,{"data-slot":`dialog-title`,className:j(`text-sm font-medium`,e),...t})}function He({className:e,...t}){return(0,H.jsx)(K,{"data-slot":`dialog-description`,className:j(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}export{G as C,K as S,de as T,je as _,ze as a,Y as b,Q as c,Pe as d,De as f,Ae as g,Oe as h,Be as i,Ce as l,ke as m,Re as n,Ve as o,Me as p,He as r,Fe as s,$ as t,Ne as u,we as v,W as w,J as x,X as y};
1
+ import{$n as e,A as t,B as n,E as r,F as i,H as a,I as o,Jn as s,K as c,Kn as l,L as u,M as d,Mn as f,N as p,O as m,P as h,Pt as g,R as _,Rr as v,Rt as y,T as b,Tn as x,Ut as S,V as C,Vr as w,W as T,Y as E,Z as D,cr as O,er as k,j as A,jn as j,kn as M,ln as ee,nr as te,rt as N,tt as P,un as F,w as I,z as ne}from"./createServerFn-DU71xucx.js";import{s as re}from"./table-BuWQgxJJ.js";import{C as ie,S as ae,i as oe,n as se,u as ce,w as le,x as ue}from"./useOpenInteractionType-D5kduCTD.js";var de=te(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),L=w(v());function fe(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`);ne(t,a),o(t);let{forceUnmount:s}=u(a,t),c=L.useCallback(()=>{t.setOpen(!1,g(S))},[t]);return L.useImperativeHandle(r,()=>({unmount:s,close:c}),[s,c]),{parentContext:n,isDrawer:i}}function R({store:e,dialogRoot:t}){let{parentContext:n,isDrawer:r}=t,i=e.useState(`open`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[u,d]=L.useState(0),[f,p]=L.useState(0),m=u===0,g=D(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0||`touches`in t&&t.touches.length!==1)return!1;let n=F(t);if(m&&!a){let t=n;return o&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===t||e.context.backdropRef.current===t||ee(t,c)&&!t?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:m});return ue(i&&o===!0,c),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{d(e),p(t)}),e.useContextCallback(`onNestedDialogClose`,()=>{d(0),p(0)}),L.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(u+1,f+ +!!r),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[r,i,u,f,n]),_(e,{activeTriggerProps:g.reference??s,inactiveTriggerProps:g.trigger??s,popupProps:L.useMemo(()=>k(h,g.floating),[g.floating]),nestedOpenDialogCount:u,nestedOpenDrawerCount:f}),null}var z=L.createContext(!1),B=L.createContext(void 0);function V(t){let n=L.useContext(B);if(t===!1&&n===void 0)throw Error(e(27));return n}var pe={...d,modal:E(e=>e.modal),nested:E(e=>e.nested),nestedOpenDialogCount:E(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:E(e=>e.nestedOpenDrawerCount),disablePointerDismissal:E(e=>e.disablePointerDismissal),openMethod:E(e=>e.openMethod),descriptionElementId:E(e=>e.descriptionElementId),titleElementId:E(e=>e.titleElementId),viewportElement:E(e=>e.viewportElement),role:E(e=>e.role)},me=class e extends c{constructor(e,t,n=!1){let r=new p,i=he(e);i.floatingRootContext=A(r,t,n),super(i,{popupRef:L.createRef(),backdropRef:L.createRef(),internalBackdropRef:L.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},pe)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};i(n,e,t.trigger),this.update(n)};static useStore(t,r){return n(t,(t,n)=>new e(r,t,n),!0).store}};function he(e={}){return{...t(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}var H=O();function U(e,t=`dialog`){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=e,p=t===`drawer`,m=t===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=V(!0),y={modal:h,disablePointerDismissal:g,nested:!!v,role:_},b=me.useStore(u?.store,{open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y});x(()=>{let e=r===void 0&&b.state.open===!1&&i===!0?{open:!0,activeTriggerId:f}:null;m?b.update(e?{...y,...e}:y):e&&b.update(e)}),b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let S=b.useState(`open`),C=b.useState(`mounted`),w=b.useState(`payload`),T=fe({store:b,actionsRef:l,parentContext:v?.store.context,isDrawer:p}),E=S||C,D=L.useMemo(()=>({store:b}),[b]);return(0,H.jsx)(z.Provider,{value:!1,children:(0,H.jsxs)(B.Provider,{value:D,children:[E&&(0,H.jsx)(R,{store:b,dialogRoot:T}),typeof n==`function`?n({payload:w}):n]})})}function ge(e){return U(e,`alert-dialog`)}var _e={...r,...T},W=L.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=V(),c=s.useState(`open`),u=s.useState(`nested`),d=s.useState(`mounted`);return l(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:_e,props:[{role:`presentation`,hidden:!d,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!u})}),G=L.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{store:c}=V(),u=c.useState(`open`),{getButtonProps:d,buttonRef:p}=f({disabled:a,native:o}),m={disabled:a};function h(e){u&&c.setOpen(!1,g(y,e.nativeEvent))}return l(`button`,e,{state:m,ref:[t,p],props:[{onClick:h},s,d]})}),K=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=V(),c=I(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),l(`p`,e,{ref:t,props:[{id:c},o]})}),ve=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),ye=function(e){return e[e.open=b.open]=`open`,e[e.closed=b.closed]=`closed`,e[e.startingStyle=b.startingStyle]=`startingStyle`,e[e.endingStyle=b.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),q=L.createContext(void 0);function be(){let t=L.useContext(q);if(t===void 0)throw Error(e(26));return t}var xe={...r,...T,nestedDialogOpen(e){return e?{[ye.nestedDialogOpen]:``}:null}},J=L.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:o,initialFocus:s,...c}=e,{store:u}=V(),d=u.useState(`descriptionElementId`),f=u.useState(`disablePointerDismissal`),p=u.useState(`floatingRootContext`),m=u.useState(`popupProps`),g=u.useState(`modal`),_=u.useState(`mounted`),v=u.useState(`nested`),y=u.useState(`nestedOpenDialogCount`),b=u.useState(`open`),x=u.useState(`openMethod`),S=u.useState(`titleElementId`),C=u.useState(`transitionStatus`),w=u.useState(`role`),T=p.useState(`floatingId`),E=c.id??T;be(),a({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}});function D(e){return e===`touch`?u.context.popupRef.current:!0}let O=s===void 0?D:s,k=y>0,A=u.useStateSetter(`popupElement`),j=l(`div`,e,{state:{open:b,nested:v,transitionStatus:C,nestedDialogOpen:k},props:[m,{id:E,"aria-labelledby":S??void 0,"aria-describedby":d??void 0,role:w,...h,hidden:!_,onKeyDown(e){ce.has(e.key)&&e.stopPropagation()},style:{[ve.nestedDialogs]:y}},c],ref:[t,u.context.popupRef,A],stateAttributesMapping:xe});return(0,H.jsx)(le,{context:p,openInteractionType:x,disabled:!_,closeOnFocusOut:!f,initialFocus:O,returnFocus:o,modal:g!==!1,restoreFocus:`popup`,children:j})}),Y=L.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=V(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,H.jsx)(q.Provider,{value:n,children:(0,H.jsxs)(P,{ref:t,...r,children:[a&&o===!0&&(0,H.jsx)(oe,{ref:i.context.internalBackdropRef,inert:ae(!s)}),e.children]})}):null}),X=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=V(),c=I(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),l(`h2`,e,{ref:t,props:[{id:c},o]})}),Z=L.forwardRef(function(t,n){let{render:r,className:i,style:a,disabled:o=!1,nativeButton:s=!0,id:c,payload:u,handle:d,...p}=t,h=V(!0),g=d?.store??h?.store;if(!g)throw Error(e(79));let _=I(c),v=g.useState(`floatingRootContext`),y=g.useState(`isOpenedByTrigger`,_),b=g.useState(`triggerPopupId`,_),x=L.useRef(null),{registerTrigger:S,isMountedByThisTrigger:w}=C(_,x,g,{payload:u}),{getButtonProps:T,buttonRef:E}=f({disabled:o,native:s}),D=ie(v,{enabled:v!=null}),O=se(()=>g.select(`open`),e=>{g.set(`openMethod`,e)}),k={disabled:o,open:y},A=g.useState(`triggerProps`,w);return l(`button`,t,{state:k,ref:[E,n,S,x],props:[D.reference,A,O,{[N]:``,id:_,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,T],stateAttributesMapping:m})}),Se=Z;function Ce({...e}){return(0,H.jsx)(ge,{"data-slot":`alert-dialog`,...e})}function we({...e}){return(0,H.jsx)(Se,{"data-slot":`alert-dialog-trigger`,...e})}function Te({...e}){return(0,H.jsx)(Y,{"data-slot":`alert-dialog-portal`,...e})}function Ee({className:e,...t}){return(0,H.jsx)(W,{"data-slot":`alert-dialog-overlay`,className:j(`fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function De({className:e,size:t=`default`,...n}){return(0,H.jsxs)(Te,{children:[(0,H.jsx)(Ee,{}),(0,H.jsx)(J,{"data-slot":`alert-dialog-content`,"data-size":t,className:j(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-3 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function Oe({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:j(`grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function ke({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:j(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Ae({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-dialog-media`,className:j(`mb-2 inline-flex size-8 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-4`,e),...t})}function je({className:e,...t}){return(0,H.jsx)(X,{"data-slot":`alert-dialog-title`,className:j(`text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Me({className:e,...t}){return(0,H.jsx)(K,{"data-slot":`alert-dialog-description`,className:j(`text-xs/relaxed text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Ne({className:e,...t}){return(0,H.jsx)(M,{"data-slot":`alert-dialog-action`,className:j(e),...t})}function Pe({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,H.jsx)(G,{"data-slot":`alert-dialog-cancel`,className:j(e),render:(0,H.jsx)(M,{variant:t,size:n}),...r})}function Q(e){return U(e,L.useContext(z)?`drawer`:`dialog`)}function $({...e}){return(0,H.jsx)(Q,{"data-slot":`dialog`,...e})}function Fe({...e}){return(0,H.jsx)(Z,{"data-slot":`dialog-trigger`,...e})}function Ie({...e}){return(0,H.jsx)(Y,{"data-slot":`dialog-portal`,...e})}function Le({className:e,...t}){return(0,H.jsx)(W,{"data-slot":`dialog-overlay`,className:j(`fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Re({className:e,children:t,showCloseButton:n=!0,...r}){return(0,H.jsxs)(Ie,{children:[(0,H.jsx)(Le,{}),(0,H.jsxs)(J,{"data-slot":`dialog-content`,className:j(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-xs/relaxed ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,H.jsxs)(G,{"data-slot":`dialog-close`,render:(0,H.jsx)(M,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,H.jsx)(re,{}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function ze({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`dialog-header`,className:j(`flex flex-col gap-1`,e),...t})}function Be({className:e,showCloseButton:t=!1,children:n,...r}){return(0,H.jsxs)(`div`,{"data-slot":`dialog-footer`,className:j(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,H.jsx)(G,{render:(0,H.jsx)(M,{variant:`outline`}),children:`Close`})]})}function Ve({className:e,...t}){return(0,H.jsx)(X,{"data-slot":`dialog-title`,className:j(`text-sm font-medium`,e),...t})}function He({className:e,...t}){return(0,H.jsx)(K,{"data-slot":`dialog-description`,className:j(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}export{G as C,K as S,de as T,je as _,ze as a,Y as b,Q as c,Pe as d,De as f,Ae as g,Oe as h,Be as i,Ce as l,ke as m,Re as n,Ve as o,Me as p,He as r,Fe as s,$ as t,Ne as u,we as v,W as w,J as x,X as y};