@promptowl/contextnest-community 1.25.0 → 1.26.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 (120) hide show
  1. package/API.md +68 -8
  2. package/CONFIGURATION.md +572 -116
  3. package/README.md +3 -2
  4. package/dist/{chunk-32SZCH36.js → chunk-2QOJE7A5.js} +4 -4
  5. package/dist/{chunk-2KHM5C7V.js → chunk-DGPTJXIV.js} +13 -15
  6. package/dist/chunk-I5EDEZBQ.js +523 -0
  7. package/dist/{chunk-TI7HMP64.js → chunk-IEAWRHMV.js} +2 -2
  8. package/dist/{chunk-DTLMBF4W.js → chunk-M6PGYMBD.js} +15 -8
  9. package/dist/{chunk-F66VCBLA.js → chunk-PICUHQEM.js} +51 -2
  10. package/dist/{chunk-KPGNZLZL.js → chunk-RPGFHESR.js} +1 -1
  11. package/dist/{chunk-7FROMOZM.js → chunk-SWA5M5XX.js} +68 -544
  12. package/dist/{chunk-JDAOA5KP.js → chunk-TRSGPS27.js} +39 -14
  13. package/dist/{engine-TER6FDBP.js → engine-QNMFDIBV.js} +3 -2
  14. package/dist/{external-edit-service-CAGENHDJ.js → external-edit-service-4MEGPT4D.js} +4 -3
  15. package/dist/{grants-service-2OTFS7EH.js → grants-service-24GLUBY4.js} +2 -2
  16. package/dist/index.js +911 -263
  17. package/dist/invited-user-AM6A3WGO.js +12 -0
  18. package/dist/{migrations.postgres-23VJJJJX.js → migrations.postgres-HGSQ7IA5.js} +4 -0
  19. package/dist/{review-service-4G2XUFS6.js → review-service-2EWN7WWO.js} +7 -6
  20. package/dist/{stewardship-service-S22V2JKG.js → stewardship-service-TDZUC2Q6.js} +4 -3
  21. package/dist/{version-service-X4FAG2OZ.js → version-service-C3JTZLJH.js} +4 -3
  22. package/dist/web3/assets/ActivityTracePage-DzwWIjjx.js +1 -0
  23. package/dist/web3/assets/{AgentDocsPage-Dkhgb1hk.js → AgentDocsPage-ixP2UdAE.js} +1 -1
  24. package/dist/web3/assets/CollaboratorManager-C9VAXZ0h.js +1 -0
  25. package/dist/web3/assets/CollaboratorsTab-tq4ZTexH.js +1 -0
  26. package/dist/web3/assets/DocumentEditor-C2CP2fiE.js +36 -0
  27. package/dist/web3/assets/DocumentsTab-Mh7KxUoB.js +6 -0
  28. package/dist/web3/assets/ExternalEditsTab-B_CWKXZ_.js +1 -0
  29. package/dist/web3/assets/{MarkdownEditor-Dfk5uIE5.js → MarkdownEditor-CKh4WSn-.js} +136 -131
  30. package/dist/web3/assets/MarkdownEditor-ndtIx5x0.css +1 -0
  31. package/dist/web3/assets/NestPageHeader-Cizo8nUi.js +1 -0
  32. package/dist/web3/assets/NestView-EW-sraEb.js +73 -0
  33. package/dist/web3/assets/OverviewTab-CjidsMX_.js +6 -0
  34. package/dist/web3/assets/PersonCombobox-BKI7dff4.js +1 -0
  35. package/dist/web3/assets/{ReviewActions-BXDTDPp1.js → ReviewActions-CS8JXgXF.js} +2 -2
  36. package/dist/web3/assets/ReviewTab-CwVrXzw5.js +1 -0
  37. package/dist/web3/assets/StewardsTab-C-iP6gnh.js +1 -0
  38. package/dist/web3/assets/SubmitForReviewModal-Biq3m79i.js +1 -0
  39. package/dist/web3/assets/{alert-dialog-4SiLKlz8.js → alert-dialog-BvF3NFr7.js} +2 -2
  40. package/dist/web3/assets/{arrow-left-BAgIocLn.js → arrow-left-CWIsv-sG.js} +1 -1
  41. package/dist/web3/assets/backlinks-Cqcn7n1J.js +19 -0
  42. package/dist/web3/assets/boxes-ClbgQqG2.js +6 -0
  43. package/dist/web3/assets/{chevron-left-XR4ReJ9Z.js → chevron-left-CK_ZPFm9.js} +1 -1
  44. package/dist/web3/assets/{circle-check-CSkZUEFK.js → circle-check-Bw_aTXiH.js} +1 -1
  45. package/dist/web3/assets/{circle-x-in2o3aHU.js → circle-x-DkIG68H7.js} +1 -1
  46. package/dist/web3/assets/{code-xml-pPQgdctI.js → code-xml-BlR7EN6l.js} +1 -1
  47. package/dist/web3/assets/{corner-down-right-CuxZWscX.js → corner-down-right-DSVxK3tf.js} +1 -1
  48. package/dist/web3/assets/count-skeleton-DToLM74B.js +1 -0
  49. package/dist/web3/assets/{earth-CXOcThqn.js → earth-BXhVPvCR.js} +1 -1
  50. package/dist/web3/assets/{file-exclamation-point-CSphs1VD.js → file-exclamation-point-BevGZgtj.js} +1 -1
  51. package/dist/web3/assets/{folder-input-BAwK9tFL.js → folder-input-m8UBV4fA.js} +1 -1
  52. package/dist/web3/assets/{index-A0_ymcqL.js → index-BOVYgMvj.js} +1 -1
  53. package/dist/web3/assets/index-DVnaYqj9.css +1 -0
  54. package/dist/web3/assets/index-WYDmEOfO.js +404 -0
  55. package/dist/web3/assets/page-B6pkc9cd.js +2 -0
  56. package/dist/web3/assets/page-BJrFCKXB.js +1 -0
  57. package/dist/web3/assets/page-Bgy9Ng9p.js +1 -0
  58. package/dist/web3/assets/page-C2zoxumw.js +1 -0
  59. package/dist/web3/assets/page-CJWO06dN.js +1 -0
  60. package/dist/web3/assets/page-CptuAPJc.js +6 -0
  61. package/dist/web3/assets/page-DPY01SOj.js +1 -0
  62. package/dist/web3/assets/page-Dea2SblF.js +9 -0
  63. package/dist/web3/assets/page-Deq6IKiN.js +6 -0
  64. package/dist/web3/assets/page-Dfjg8p7Z.js +1 -0
  65. package/dist/web3/assets/{page-xzYqkBUP.js → page-Dh57L0RG.js} +5 -5
  66. package/dist/web3/assets/page-Dwbp4Seu.js +6 -0
  67. package/dist/web3/assets/{page-CUjuSs5Q.js → page-DzKwP5Ds.js} +3 -3
  68. package/dist/web3/assets/page-YxjrE5b5.js +45 -0
  69. package/dist/web3/assets/{page-title-BkqlUA0j.js → page-title-DVq4qvMR.js} +1 -1
  70. package/dist/web3/assets/{play-B8xE9j5f.js → play-CXhS6Pgq.js} +1 -1
  71. package/dist/web3/assets/{send-CvAgOUPG.js → send-DdfwnIrj.js} +1 -1
  72. package/dist/web3/assets/{settings-EY4A_DYv.js → settings-DKX0Q4gO.js} +1 -1
  73. package/dist/web3/assets/{share-2-vGmZUl90.js → share-2-CxmXRt58.js} +1 -1
  74. package/dist/web3/assets/{tag-Br_y1f00.js → tag-DeYC_mRv.js} +1 -1
  75. package/dist/web3/assets/{trash-2-B4hRXo-p.js → trash-2-B0HyPTnI.js} +1 -1
  76. package/dist/web3/assets/{user-plus-4CTYEkd3.js → user-plus-Ckm_Isyc.js} +1 -1
  77. package/dist/web3/assets/{x-qxt1WrUi.js → x-mNtADYHc.js} +1 -1
  78. package/dist/web3/assets/{zap-BcsKR0ef.js → zap-D2ifcnYb.js} +1 -1
  79. package/dist/web3/index.html +2 -2
  80. package/package.json +3 -2
  81. package/dist/client-D44ZHDTJ.js +0 -11
  82. package/dist/keys-CTOGAG3W.js +0 -20
  83. package/dist/web3/assets/ActivityTracePage-D2iIbEph.js +0 -1
  84. package/dist/web3/assets/CollaboratorManager-Bo81D--Q.js +0 -1
  85. package/dist/web3/assets/CollaboratorsTab-DRCitQuX.js +0 -1
  86. package/dist/web3/assets/DocumentEditor-DV2WHYbj.js +0 -36
  87. package/dist/web3/assets/DocumentsTab-BUxBCN8o.js +0 -6
  88. package/dist/web3/assets/ExternalEditsTab-kIBimZyE.js +0 -1
  89. package/dist/web3/assets/MarkdownEditor-CsVusP2d.css +0 -1
  90. package/dist/web3/assets/NestPageHeader-yOK-OIYZ.js +0 -1
  91. package/dist/web3/assets/NestView-DwIagxwJ.js +0 -68
  92. package/dist/web3/assets/OverviewTab-DFOFMVyE.js +0 -1
  93. package/dist/web3/assets/PersonCombobox-D350WlrJ.js +0 -1
  94. package/dist/web3/assets/ReasonDialog-CN3ECAnQ.js +0 -1
  95. package/dist/web3/assets/ReviewTab-CZewAYiz.js +0 -1
  96. package/dist/web3/assets/StewardsTab-AagNWcWS.js +0 -1
  97. package/dist/web3/assets/SubmitForReviewModal-BOZJxwRN.js +0 -1
  98. package/dist/web3/assets/backlinks-Cb8Uf8mw.js +0 -24
  99. package/dist/web3/assets/card-UDyMRcps.js +0 -1
  100. package/dist/web3/assets/count-skeleton-DBWCDhRy.js +0 -1
  101. package/dist/web3/assets/dates-BCxbm4_q.js +0 -1
  102. package/dist/web3/assets/index-B5hLclEq.js +0 -389
  103. package/dist/web3/assets/index-DrUAtoQM.css +0 -1
  104. package/dist/web3/assets/page-BHD4beun.js +0 -1
  105. package/dist/web3/assets/page-BSYUXYmO.js +0 -11
  106. package/dist/web3/assets/page-BYc2DIux.js +0 -45
  107. package/dist/web3/assets/page-BfibLg8e.js +0 -1
  108. package/dist/web3/assets/page-CGe8MtUu.js +0 -9
  109. package/dist/web3/assets/page-CIgPJmG6.js +0 -2
  110. package/dist/web3/assets/page-Ck31nx9b.js +0 -1
  111. package/dist/web3/assets/page-Cpdj_11Y.js +0 -1
  112. package/dist/web3/assets/page-D0sN3GO6.js +0 -1
  113. package/dist/web3/assets/page-DEpH91X2.js +0 -1
  114. package/dist/web3/assets/page-l8-B7CGt.js +0 -1
  115. package/dist/web3/assets/page-mnSHmk6A.js +0 -6
  116. package/dist/web3/assets/refresh-cw-CsCtmWwX.js +0 -6
  117. package/dist/web3/assets/scroll-area-CbcH6yrZ.js +0 -1
  118. package/dist/web3/assets/scroll-area-dRWncRqa.css +0 -1
  119. package/dist/web3/assets/select-DrL0mpRN.js +0 -6
  120. package/dist/web3/assets/triangle-alert-CsYGyfGZ.js +0 -6
@@ -1,2 +0,0 @@
1
- import{r as n,u as G,i as z,f as l,aI as U,_ as V,j as e,B as C,L as M,ag as W,aP as J,aU as X,aV as Y,aT as Z}from"./index-B5hLclEq.js";import{N as I}from"./NestPageHeader-yOK-OIYZ.js";import{T as ee}from"./trash-2-B4hRXo-p.js";import{T as te}from"./triangle-alert-CsYGyfGZ.js";import"./arrow-left-BAgIocLn.js";function se({nestId:a,nestName:B,isArchived:T,onBack:H}){var K;const[h,Q]=n.useState([]),p=G(),[S,D]=n.useState(!0),[d,E]=n.useState(!1),[g,P]=n.useState(!1),[i,_]=n.useState(null),[o,j]=n.useState(""),[c,w]=n.useState(""),[A,b]=n.useState(""),x=n.useCallback(async()=>{D(!0);try{const{definitions:t}=await p.fetchQuery(z.definitions(a));Q(t)}catch(t){l.error((t==null?void 0:t.message)||"Failed to load definitions")}finally{D(!1)}},[a]);n.useEffect(()=>{let t=!1;return p.fetchQuery(z.nest(a)).then(s=>{if(t)return;const q=U({roles:(s==null?void 0:s.roles)??[],permission:(s==null?void 0:s.permission)??null,myStewards:(s==null?void 0:s.myStewards)??[],isOwner:(s==null?void 0:s.permission)==="owner",isAdmin:(s==null?void 0:s.permission)==="admin",isArchived:T||V(s==null?void 0:s.nest)});E(q.canManage||q.collabCanWrite)}).catch(()=>{t||E(!1)}),()=>{t=!0}},[a,p,T]),n.useEffect(()=>{x()},[x]);const N=()=>{_(null),j(""),w(""),b("")},y=t=>{var s;_(t.id),j(t.term),w(t.definition),b(((s=t.linked_tag)==null?void 0:s.replace(/^#/,""))??"")},L=o.trim().toLowerCase(),r=L?h.find(t=>t.term.toLowerCase()===L&&t.id!==i)??null:null,F=async()=>{if(!o.trim()||!c.trim())return l.error("Term and definition are both required."),!1;P(!0);try{const t=A.trim();return await X(a,{term:o.trim(),definition:c.trim(),...t||i?{linked_tag:t||null}:{},...i?{editing_id:i}:{}}),l.success(i?"Definition updated":r?`Replaced the definition of "${r.term}"`:"Term defined"),N(),await x(),!0}catch(t){return l.error((t==null?void 0:t.message)||"Save failed"),!1}finally{P(!1)}},O=async t=>{try{await Y(a,t.id),l.success(`Removed "${t.term}"`),await x()}catch(s){l.error((s==null?void 0:s.message)||"Delete failed")}},[u,m]=n.useState(!1),f=i??(u?"new":null),$=()=>{N(),m(!1)},v=t=>{t.key==="Escape"?(t.preventDefault(),$()):t.key==="Enter"&&(t.ctrlKey||t.metaKey||!(t.target instanceof HTMLTextAreaElement))&&(t.preventDefault(),F().then(s=>s&&m(!1)))},k="w-full rounded-md border border-input bg-background px-2 py-1 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",R=e.jsxs(e.Fragment,{children:[e.jsx("td",{className:"align-top",children:e.jsx("input",{autoFocus:!0,value:o,onChange:t=>j(t.target.value),onKeyDown:v,placeholder:"Term","aria-label":"Term",className:k,"data-testid":"definitions-term"})}),e.jsx("td",{className:"align-top",children:e.jsx("textarea",{value:c,onChange:t=>w(t.target.value),onKeyDown:v,placeholder:"What this term means here — formula or source if quantitative. Ctrl+Enter saves.","aria-label":"Definition",rows:Math.min(8,Math.max(2,c.split(`
2
- `).length+1)),className:`${k} min-h-[2.25rem] resize-y`,"data-testid":"definitions-definition"})}),e.jsx("td",{className:"align-top",children:e.jsx("input",{value:A,onChange:t=>b(t.target.value),onKeyDown:v,placeholder:"tag","aria-label":"Linked tag",className:`${k} w-28`,"data-testid":"definitions-tag"})}),e.jsx("td",{className:"align-top text-xs text-muted-foreground whitespace-nowrap pt-2",children:i?(K=h.find(t=>t.id===i))==null?void 0:K.defined_by:"you"}),e.jsx("td",{className:"align-top whitespace-nowrap text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(C,{variant:"ghost",size:"sm",className:"h-7",onClick:$,disabled:g,children:"Cancel"}),e.jsx(C,{size:"sm",className:"h-7",onClick:()=>void F().then(t=>t&&m(!1)),disabled:g||!o.trim()||!c.trim(),"data-testid":"definitions-save",children:g?e.jsx(M,{className:"h-3.5 w-3.5 animate-spin"}):r&&!i?"Replace":"Save"})]})})]});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(I,{nestName:B,onBack:H,title:e.jsx("h1",{className:"min-w-0 truncate text-xl font-semibold",children:"Definitions"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"The nest's shared vocabulary — what each term means here, written down once so everyone (and every agent reading this nest) uses it the same way. Click a row to edit it."}),e.jsx("div",{className:"border border-border rounded-lg overflow-x-auto","data-testid":"definitions-table",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/50 text-muted-foreground text-xs",children:e.jsxs("tr",{className:"[&>th]:px-3 [&>th]:py-2 [&>th]:text-left [&>th]:font-medium",children:[e.jsx("th",{className:"w-[18%]",children:"Term"}),e.jsx("th",{children:"Definition"}),e.jsx("th",{className:"w-28",children:"Tag"}),e.jsx("th",{className:"w-36",children:"Defined by"}),e.jsx("th",{className:"w-28"})]})}),e.jsxs("tbody",{children:[S&&e.jsx("tr",{children:e.jsxs("td",{colSpan:5,className:"px-3 py-8 text-center text-muted-foreground",children:[e.jsx(M,{className:"h-4 w-4 animate-spin inline mr-2"}),"Loading…"]})}),!S&&h.length===0&&!u&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-3 py-8 text-center text-muted-foreground",children:d?"No terms defined yet. Add the first one below.":"No terms defined yet."})}),h.map(t=>f===t.id?e.jsx("tr",{className:"border-t border-border bg-muted/20 [&>td]:px-2 [&>td]:py-1.5","data-testid":"definitions-row-editing",children:R},t.id):e.jsxs("tr",{onClick:d&&f===null?()=>y(t):void 0,className:`group border-t border-border align-top [&>td]:px-3 [&>td]:py-2${d&&f===null?" cursor-text hover:bg-muted/30":""}`,"data-testid":"definitions-row",children:[e.jsx("td",{className:"font-medium whitespace-nowrap",children:t.term}),e.jsx("td",{className:"max-w-[520px]",children:e.jsx("span",{className:"whitespace-pre-wrap",children:t.definition})}),e.jsx("td",{className:"whitespace-nowrap",children:t.linked_tag?e.jsx("span",{className:"rounded bg-amber-50 text-amber-700 px-1.5 py-0.5 text-xs",children:t.linked_tag}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx("td",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.defined_by}),e.jsx("td",{className:"whitespace-nowrap text-right",children:d&&e.jsxs("span",{className:"opacity-0 group-hover:opacity-100 focus-within:opacity-100",children:[e.jsx("button",{type:"button","aria-label":`Edit ${t.term}`,onClick:s=>{s.stopPropagation(),y(t)},className:"p-1 rounded hover:bg-accent mr-1",children:e.jsx(W,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button","aria-label":`Delete ${t.term}`,onClick:s=>{s.stopPropagation(),O(t)},className:"p-1 rounded hover:bg-accent text-red-600",children:e.jsx(ee,{className:"h-3.5 w-3.5"})})]})})]},t.id)),f!==null&&r&&e.jsx("tr",{className:"bg-amber-50/60",children:e.jsx("td",{colSpan:5,className:"px-3 py-2 text-xs text-amber-800",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(te,{className:"h-3.5 w-3.5 shrink-0 mt-0.5"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("b",{children:r.term})," ",i?e.jsxs(e.Fragment,{children:["is already defined by another row (",r.defined_by,") — this rename will be rejected."]}):e.jsxs(e.Fragment,{children:["is already defined by ",r.defined_by,". Saving replaces that definition."]})]}),!i&&e.jsxs(C,{variant:"outline",size:"sm",className:"h-7 shrink-0",onClick:()=>{m(!1),y(r)},children:[e.jsx(W,{className:"h-3.5 w-3.5 mr-1"})," Edit it instead"]})]})})}),d&&u&&i===null&&e.jsx("tr",{className:"border-t border-border bg-muted/20 [&>td]:px-2 [&>td]:py-1.5","data-testid":"definitions-row-new",children:R}),d&&!u&&e.jsx("tr",{className:"border-t border-border",children:e.jsx("td",{colSpan:5,className:"p-0",children:e.jsxs("button",{type:"button",onClick:()=>{N(),m(!0)},className:"flex w-full items-center gap-1.5 px-3 py-2 text-left text-sm text-muted-foreground hover:bg-muted/40 hover:text-foreground","data-testid":"definitions-add",children:[e.jsx(J,{className:"h-3.5 w-3.5"})," New term"]})})})]})]})}),e.jsxs("details",{className:"rounded-md border bg-muted/30 px-3 py-2 text-xs",children:[e.jsx("summary",{className:"cursor-pointer font-medium text-muted-foreground",children:"For developers — fetch a definition over HTTP"}),e.jsxs("div",{className:"mt-2 space-y-1.5 text-muted-foreground",children:[e.jsx("p",{children:"Agents and analysis jobs read these live, so a definition edited here changes what they answer with on the next call."}),e.jsxs("pre",{className:"overflow-x-auto rounded border bg-background p-2 font-mono text-[10.5px] leading-relaxed",children:["GET /nests/",a,"/definitions?term=<term>"]}),e.jsx("p",{children:"Omit the query to get the whole glossary."})]})]})]})}function le(){const a=Z();return e.jsx(se,{nestId:a.nestId,nestName:a.nestName,isArchived:a.isArchived,onBack:a.leaveNest})}export{le as default};
@@ -1 +0,0 @@
1
- import{ck as he,O as ue,r as h,u as pe,i as U,co as F,j as t,cp as xe,cq as q,C as fe,f as x,s as ge,L as ve,B as u,bx as K,cr as be,cs as je,ct as ye,bO as ke,bP as Ne,as as _e,ax as we}from"./index-B5hLclEq.js";import{f as Ce,r as Q}from"./dates-BCxbm4_q.js";import{P as Re}from"./page-title-BkqlUA0j.js";import{A as Se,a as $e,R as Ae}from"./ReviewActions-BXDTDPp1.js";import{f as V}from"./scroll-area-CbcH6yrZ.js";import"./select-DrL0mpRN.js";import"./card-UDyMRcps.js";import{R as J}from"./ReasonDialog-CN3ECAnQ.js";import{C as We}from"./circle-check-CSkZUEFK.js";import{T as qe}from"./trash-2-B4hRXo-p.js";import{C as Te}from"./circle-x-in2o3aHU.js";import{C as De}from"./chevron-left-XR4ReJ9Z.js";const Y=8;function ze(f,j,g=Y){return j?f:f.slice(0,g)}function X(f,j){return f.filter(g=>g.id!==j)}function Je(){var I,E;const{openNest:f,openReview:j}=he(),{adminStatus:g}=ue(),G=((I=g==null?void 0:g.me)==null?void 0:I.email)??null,[n,m]=h.useState({items:[],waiting:[]}),[H,Z]=h.useState(!0),[T,D]=h.useState(!1),[l,S]=h.useState(null),[y,z]=h.useState("delete"),[d,v]=h.useState(new Set),[p,N]=h.useState(null),[$,ee]=h.useState(!1),M=pe(),w=async e=>{D(!0);try{const s=await M.fetchQuery(U.myWork({offset:e}));m(a=>({items:s.items,waiting:s.waiting,notifications:s.notifications??a.notifications,pagination:s.pagination}));const i=new Set(s.items.map(a=>`${a.nest_id}:${a.node_id}`));v(a=>new Set([...a].filter(k=>i.has(k))))}catch(s){console.error("[Dashboard] goToWorkPage failed",s)}finally{D(!1)}};h.useEffect(()=>{M.fetchQuery(U.myWork()).then(m).catch(()=>m({items:[],waiting:[],notifications:[]})).finally(()=>Z(!1))},[G]);const te=async(e,s)=>{await be(e.nest_id,e.node_id,s),R(e)},se=async(e,s)=>{await je(e.nest_id,e.node_id,s),R(e)},b=n.items.filter(e=>e.type==="review"),A=e=>`${e.nest_id}:${e.node_id}`,C=(()=>{const e=new Map;for(const i of b)d.has(A(i))&&e.set(i.nest_id,(e.get(i.nest_id)??0)+1);const s=Math.max(0,...e.values());return Math.max(0,s-F)})(),ie=async(e,s)=>{var B;const i=b.filter(o=>d.has(A(o)));if(i.length===0){x.info("Nothing selected on this page"),v(new Set),N(null);return}const a=new Map;for(const o of i)a.set(o.nest_id,[...a.get(o.nest_id)??[],o.node_id]);const k=await Promise.all([...a].map(([o,r])=>ye(o,e,r,s||void 0).then(_=>({nestId:o,..._})).catch(_=>({nestId:o,succeeded:0,failed:r.length,results:r.map(me=>({nodeId:me,ok:!1,error:(_==null?void 0:_.message)||"Request failed"}))})))),W=k.reduce((o,r)=>o+r.succeeded,0),L=k.reduce((o,r)=>o+r.failed,0),ce=new Set(k.flatMap(o=>o.results.filter(r=>!r.ok).map(r=>`${o.nestId}:${r.nodeId}`))),O=e==="approve"?"approved":"rejected";if(L===0)x.success(`${W} document${W===1?"":"s"} ${O}`);else{const o=[...new Set(k.flatMap(r=>r.results).filter(r=>!r.ok).map(r=>r.error||"Unknown reason"))];x.warning(`${W} ${O}, ${L} could not be`,{description:o.join(" "),duration:1e4})}v(ce),N(null),w(((B=n.pagination)==null?void 0:B.offset)??0)},c=e=>e.target_type==="nest_archive",ne=e=>e.type!=="deletion"?"Review":c(e)?"Archive":"Deletion",ae=async()=>{const e=l;await ke(e.nest_id,e.request_id),R(e)},oe=async e=>{const s=l;await Ne(s.nest_id,s.request_id,e),R(s)},re=async e=>{await _e(e.nest_id,e.request_id),m(s=>({...s,waiting:s.waiting.filter(i=>!(i.nest_id===e.nest_id&&i.node_id===e.node_id))}))},de=async e=>{await we(e.nest_id,e.node_id),m(s=>({...s,waiting:s.waiting.filter(i=>!(i.nest_id===e.nest_id&&i.node_id===e.node_id))}))},P=e=>{if(e.type==="deletion"&&e.target_type&&e.target_type!=="document"){f(e.nest_id,e.nest_name,!1,!1);return}j(e.nest_id,e.nest_name,e.node_id)},le=e=>{q([e.id]).catch(()=>{}),m(s=>({...s,notifications:X(s.notifications??[],e.id)})),e.node_id?j(e.nest_id,e.nest_name,e.node_id):f(e.nest_id,e.nest_name,!1,!1)},R=e=>{var s;m(i=>({...i,items:i.items.filter(a=>!(a.nest_id===e.nest_id&&a.node_id===e.node_id))})),v(i=>{const a=new Set(i);return a.delete(`${e.nest_id}:${e.node_id}`),a}),w(((s=n.pagination)==null?void 0:s.offset)??0)};return t.jsxs("div",{className:"space-y-4",children:[t.jsx(Re,{icon:xe,title:"My Work",description:"Reviews and requests waiting on you, and what you handed off.",className:"mb-0"}),t.jsx("div",{children:t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{children:[(((E=n.notifications)==null?void 0:E.length)??0)>0&&t.jsxs("div",{className:"mb-3 rounded-lg border border-amber-300/50 bg-amber-500/5",children:[t.jsxs("div",{className:"px-4 py-2 flex items-center gap-2 text-sm font-medium",children:["🔔 Notifications",t.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",n.notifications.length,")"]}),t.jsx("div",{className:"flex-1"}),t.jsx("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:async()=>{await q("all"),m(e=>({...e,notifications:[]}))},children:"Mark all read"})]}),t.jsx("div",{className:ge("divide-y border-t",$&&"max-h-80 overflow-y-auto"),children:ze(n.notifications,$).map(e=>t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-xs hover:bg-amber-500/10",children:[t.jsxs("button",{type:"button",onClick:()=>le(e),className:"flex-1 flex items-center gap-2 text-left",children:[t.jsx("span",{className:"flex-1",children:e.message}),t.jsx("span",{className:"text-muted-foreground shrink-0",children:Ce(e.created_at)})]}),t.jsx("button",{type:"button",title:"Mark as read","aria-label":"Mark as read",className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-amber-500/20 hover:text-foreground",onClick:async()=>{try{await q([e.id]),m(s=>({...s,notifications:X(s.notifications??[],e.id)}))}catch(s){x.error((s==null?void 0:s.message)||"Failed to mark as read")}},children:t.jsx(fe,{className:"h-3.5 w-3.5"})})]},e.id))}),n.notifications.length>Y&&t.jsx("div",{className:"border-t px-4 py-1.5 text-center",children:t.jsx("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>ee(e=>!e),children:$?"Show less":`Show all (${n.notifications.length})`})})]}),H?t.jsxs("div",{className:"rounded-lg border bg-muted/20 px-4 py-6 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(ve,{className:"h-4 w-4 animate-spin"}),"Loading your work…"]}):n.items.length===0?t.jsx("div",{className:"rounded-lg border bg-muted/20 px-4 py-6 text-center text-sm text-muted-foreground",children:"You're all caught up — nothing waiting on you."}):t.jsxs("div",{className:"rounded-lg border divide-y overflow-hidden",children:[b.length>1&&t.jsxs("div",{className:"flex flex-wrap items-center gap-2 bg-muted/40 px-4 py-2 text-sm",children:[t.jsx(V,{checked:d.size===0?!1:d.size===b.length?!0:"indeterminate",onCheckedChange:e=>v(e===!0?new Set(b.map(A)):new Set),"aria-label":"Select every review waiting on you","data-testid":"work-select-all"}),t.jsx("span",{className:"text-muted-foreground",children:d.size>0?`${d.size} selected`:`Select all ${b.length} reviews`}),C>0&&t.jsxs("span",{className:"text-destructive",children:["Up to ",F," per nest — deselect"," ",C,"."]}),d.size>0&&t.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[t.jsxs(u,{size:"sm",disabled:C>0,onClick:()=>N("approve"),"data-testid":"work-bulk-approve",children:["Approve ",d.size]}),t.jsxs(u,{size:"sm",variant:"outline",disabled:C>0,onClick:()=>N("reject"),"data-testid":"work-bulk-reject",children:["Reject ",d.size]}),t.jsx(u,{size:"sm",variant:"ghost",onClick:()=>v(new Set),children:"Clear"})]})]}),n.items.map(e=>{const s=`${e.nest_id}:${e.node_id}`;return t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-muted/40 group",children:[b.length>1&&t.jsx(V,{checked:d.has(s),disabled:e.type!=="review",onCheckedChange:()=>v(i=>{const a=new Set(i);return a.has(s)?a.delete(s):a.add(s),a}),"aria-label":`Select ${e.title}`,className:e.type==="review"?"":"invisible"}),t.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide shrink-0 ${e.type==="deletion"&&!c(e)?"bg-red-100 text-red-800 dark:bg-red-950/40 dark:text-red-300":"bg-amber-100 text-amber-800 dark:bg-amber-950/40 dark:text-amber-300"}`,children:ne(e)}),t.jsxs("button",{onClick:()=>P(e),className:"flex items-center gap-2 min-w-0 flex-1 text-left",children:[t.jsx("span",{className:"font-medium truncate",children:e.title}),t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["in ",e.nest_name," · ",e.requested_by," · ",Q(e.requested_at),e.reason?` · "${e.reason}"`:""]})]}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:e.type==="deletion"?t.jsxs(t.Fragment,{children:[t.jsxs(u,{variant:"outline",className:c(e)?Se:"text-destructive hover:text-destructive",onClick:()=>{z("delete"),S(e)},children:[c(e)?t.jsx(We,{className:"h-4 w-4 mr-2"}):t.jsx(qe,{className:"h-4 w-4 mr-2"}),c(e)?"Approve":"Delete"]}),t.jsxs(u,{variant:"outline",className:$e,onClick:()=>{z("decline"),S(e)},children:[t.jsx(Te,{className:"h-4 w-4 mr-2"})," Reject"]})]}):t.jsx(Ae,{documentTitle:e.title,version:1,onApprove:i=>te(e,i),onReject:i=>se(e,i)})})]},s)})]})]}),n.waiting.length>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx("h3",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Waiting on others"}),t.jsx("span",{className:"rounded-full bg-muted text-muted-foreground text-xs font-semibold px-2 py-0.5",children:n.waiting.length})]}),t.jsx("div",{className:"rounded-lg border divide-y overflow-hidden",children:n.waiting.map(e=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 hover:bg-muted/40 group text-sm",children:[t.jsxs("button",{onClick:()=>P(e),className:"flex items-center gap-3 flex-1 min-w-0 text-left",children:[t.jsx("span",{className:"font-medium truncate",children:e.title}),t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["in ",e.nest_name," ·"," ",e.type==="deletion"?"requested":"submitted"," ",Q(e.requested_at)]}),t.jsx("span",{className:"flex-1"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:e.type!=="deletion"?"Pending Review":c(e)?"Archive Requested":"Deletion Requested"})]}),e.type==="deletion"&&e.request_id&&t.jsx(u,{size:"sm",variant:"ghost",className:"shrink-0 text-muted-foreground h-7 px-2",onClick:async s=>{s.stopPropagation();try{await re(e),x.success(c(e)?"Archive request withdrawn":"Deletion request withdrawn")}catch(i){x.error((i==null?void 0:i.message)||"Failed to withdraw deletion request")}},title:"Withdraw this deletion request",children:"Withdraw"}),e.type==="review"&&t.jsx(u,{size:"sm",variant:"ghost",className:"shrink-0 text-muted-foreground h-7 px-2",onClick:async s=>{s.stopPropagation();try{await de(e),x.success("Submission withdrawn — back to Draft")}catch(i){x.error((i==null?void 0:i.message)||"Failed to withdraw submission")}},title:"Withdraw this submission and return the document to Draft",children:"Withdraw"}),t.jsx(K,{className:"h-4 w-4 text-muted-foreground group-hover:translate-x-0.5 transition-transform shrink-0"})]},`${e.nest_id}:${e.node_id}`))})]}),n.pagination&&n.pagination.total>n.pagination.limit&&t.jsxs("div",{className:"flex items-center justify-center gap-3 pt-1 text-sm text-muted-foreground",children:[t.jsxs(u,{variant:"outline",size:"sm",disabled:T||n.pagination.offset===0,onClick:()=>w(Math.max(0,n.pagination.offset-n.pagination.limit)),children:[t.jsx(De,{className:"h-3.5 w-3.5 mr-1"}),"Prev"]}),t.jsxs("span",{children:["Page ",Math.floor(n.pagination.offset/n.pagination.limit)+1," of"," ",Math.max(1,Math.ceil(n.pagination.total/n.pagination.limit))]}),t.jsxs(u,{variant:"outline",size:"sm",disabled:T||!n.pagination.has_more,onClick:()=>w(n.pagination.offset+n.pagination.limit),children:["Next",t.jsx(K,{className:"h-3.5 w-3.5 ml-1"})]})]})]})}),p&&t.jsx(J,{open:!0,onOpenChange:e=>!e&&N(null),title:p==="approve"?`Approve ${d.size} document${d.size===1?"":"s"}?`:`Reject ${d.size} document${d.size===1?"":"s"}?`,description:p==="approve"?"Approving publishes each one. Anything that changed since this inbox loaded is reported back and left alone.":"Each author gets the same reason and the work goes back to them.",label:p==="reject"?"Why?":"Comment (optional)",optionalReason:p==="approve",placeholder:"Shared with every author in this batch",confirmLabel:p==="approve"?"Approve all":"Reject all",destructive:p==="reject",onConfirm:e=>ie(p,e)}),l&&t.jsx(J,{open:!0,onOpenChange:e=>!e&&S(null),title:y!=="delete"?`Reject this ${c(l)?"archive":"deletion"} request`:c(l)?`Archive "${l.title}"?`:`Delete "${l.title}"?`,description:`${l.requested_by} asked for this: "${l.reason??""}". ${y!=="delete"?c(l)?"The nest stays where it is; your note is the record, and the requester is notified.":"The document stays; your note is the record, and the requester is notified.":c(l)?"The nest goes read-only and leaves the dashboard; nothing is deleted and you can restore it.":"Deleting removes the document, its history, comments and annotations. It cannot be undone."}`,label:y==="decline"?"Why are you rejecting?":void 0,placeholder:"e.g. still referenced by onboarding",confirmLabel:y!=="delete"?"Reject":c(l)?"Archive nest":"Delete document",destructive:y==="delete"&&!c(l),onConfirm:y==="delete"?ae:oe})]})}export{Je as default};
@@ -1 +0,0 @@
1
- import{ck as U,O as V,r as i,u as X,bX as G,j as e,ag as J,I as W,L as R,B as h,bA as Y,bx as Z,i as ee,aA as te,f as k,a5 as se}from"./index-B5hLclEq.js";import{r as ae}from"./dates-BCxbm4_q.js";import{P as re}from"./page-title-BkqlUA0j.js";import{f as T}from"./scroll-area-CbcH6yrZ.js";import"./select-DrL0mpRN.js";import"./card-UDyMRcps.js";import{S as ie}from"./SubmitForReviewModal-BOZJxwRN.js";import{A as ne,a as oe,b as le,c as de,d as ce,e as me,f as fe,g as ue}from"./alert-dialog-4SiLKlz8.js";import{C as E}from"./circle-check-CSkZUEFK.js";import{T as M}from"./trash-2-B4hRXo-p.js";import{C as he}from"./chevron-left-XR4ReJ9Z.js";import"./send-CvAgOUPG.js";function ke(){var z;const{openReview:F}=U(),{adminStatus:D}=V(),L=((z=D==null?void 0:D.me)==null?void 0:z.email)??null,[c,S]=i.useState([]),[a,P]=i.useState(null),[N,$]=i.useState(!0),[m,j]=i.useState(null),[C,B]=i.useState(""),[v,O]=i.useState(""),[b,Q]=i.useState("updated"),[l,x]=i.useState(new Set),[w,_]=i.useState(!1),[n,y]=i.useState(null),q=X(),u=async t=>{$(!0);try{const s=await q.fetchQuery(ee.myDrafts({offset:t,q:v||void 0,sort:b}));if(s.drafts.length===0&&t>0&&s.pagination.total>0)return void await u(0);S(s.drafts),P(s.pagination)}catch(s){console.error("[Dashboard] goToDraftsPage failed",s),S([])}finally{$(!1)}},I=async(t,s,f)=>{const r=[],d=[];for(const o of t)try{await te(o.nest_id,o.node_id,s,f),r.push(o)}catch(g){d.push(o),console.error("[Dashboard] submitForReview failed",o.node_id,g)}if(S(o=>o.filter(g=>!r.some(K=>p(K)===p(g)))),x(new Set),u((a==null?void 0:a.offset)??0),d.length){j(d);const o=r.length?`${r.length} submitted. `:"";throw new Error(`${o}Couldn't submit ${d.length}: ${d.map(g=>g.title).join(", ")}`)}r.length>1&&k.success(`${r.length} submitted for review`)},p=t=>`${t.nest_id}:${t.node_id}`;i.useEffect(()=>{const t=setTimeout(()=>O(C.trim()),250);return()=>clearTimeout(t)},[C]),i.useEffect(()=>{u(0)},[L]);const A=G.useRef(!1);i.useEffect(()=>{if(!A.current){A.current=!0;return}x(new Set),u(0)},[v,b]);const H=async t=>{if(t.length===0)return;y(null),_(!0);let s=0,f=0;const r=[];for(const d of t)try{(await se(d.nest_id,d.node_id)).deleted?f++:s++}catch(o){r.push(d.title),console.error("[Dashboard] discardDraft failed",d.node_id,o)}_(!1),x(new Set),(s||f)&&k.success([s?`${s} restored to the approved version`:"",f?`${f} deleted`:""].filter(Boolean).join(" · ")),r.length&&k.error(`Couldn't discard: ${r.join(", ")}`),u((a==null?void 0:a.offset)??0)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(re,{icon:J,title:"My Drafts",description:"Everything you started and never handed off.",className:"mb-0"}),e.jsx("div",{children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx(W,{value:C,onChange:t=>B(t.target.value),placeholder:"Search drafts by title or nest…",className:"h-8 max-w-xs","aria-label":"Search your drafts","data-testid":"drafts-search"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Sort:"}),e.jsx("div",{className:"inline-flex items-center rounded-md border bg-muted/40 p-0.5",role:"group","aria-label":"Sort drafts",children:[["updated","Recently edited"],["title","Title"]].map(([t,s])=>e.jsx("button",{type:"button","aria-pressed":b===t,onClick:()=>Q(t),className:`h-6 rounded px-2 text-xs transition-colors ${b===t?"bg-background font-medium text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,"data-testid":`drafts-sort-${t}`,children:s},t))})]})]}),N?e.jsxs("div",{className:"rounded-lg border bg-muted/20 px-4 py-6 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"}),"Loading your drafts…"]}):c.length===0?e.jsx("div",{className:"rounded-lg border bg-muted/20 px-4 py-6 text-center text-sm text-muted-foreground",children:v?`No drafts match "${v}".`:"No unsubmitted drafts — everything you've written is in review or approved."}):e.jsxs("div",{className:"rounded-lg border divide-y overflow-hidden",children:[c.length>1&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 bg-muted/40 px-4 py-2 text-sm",children:[e.jsx(T,{checked:l.size===0?!1:l.size===c.length?!0:"indeterminate",onCheckedChange:t=>x(t===!0?new Set(c.map(p)):new Set),"aria-label":"Select every draft on this page","data-testid":"drafts-select-all"}),e.jsx("span",{className:"text-muted-foreground",children:l.size>0?`${l.size} selected`:`Select all ${c.length} on this page`}),l.size>0&&e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsxs(h,{size:"sm",variant:"outline",disabled:w,onClick:()=>j(c.filter(t=>l.has(p(t)))),"data-testid":"drafts-bulk-submit",children:[e.jsx(E,{className:"h-3.5 w-3.5 mr-1"}),"Submit ",l.size," for review"]}),e.jsxs(h,{size:"sm",variant:"outline",disabled:w,onClick:()=>y(c.filter(t=>l.has(p(t)))),"data-testid":"drafts-bulk-discard",children:[w?e.jsx(R,{className:"h-3.5 w-3.5 mr-1 animate-spin"}):e.jsx(M,{className:"h-3.5 w-3.5 mr-1"}),"Discard ",l.size]}),e.jsx(h,{size:"sm",variant:"ghost",onClick:()=>x(new Set),children:"Clear"})]})]}),c.map(t=>{const s=`${t.nest_id}:${t.node_id}`;return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-muted/40 group",children:[c.length>1&&e.jsx(T,{checked:l.has(s),onCheckedChange:()=>x(f=>{const r=new Set(f);return r.has(s)?r.delete(s):r.add(s),r}),"aria-label":`Select ${t.title}`}),e.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide shrink-0 ${t.status==="rejected"?"bg-red-100 text-red-800 dark:bg-red-950/40 dark:text-red-300":"bg-muted text-muted-foreground"}`,children:t.status==="rejected"?"Rejected":"Draft"}),e.jsxs("button",{onClick:()=>F(t.nest_id,t.nest_name,t.node_id),className:"flex flex-col min-w-0 flex-1 text-left gap-0.5",children:[e.jsx("span",{className:"font-medium truncate",children:t.title}),e.jsxs("span",{className:"text-xs text-muted-foreground truncate",title:`${t.nest_name} / ${t.node_id}`,children:[e.jsx(Y,{className:"h-3 w-3 inline mr-1 -mt-0.5"}),t.nest_name,t.folder?` / ${t.folder}`:""," · edited"," ",ae(t.updated_at)]})]}),e.jsxs(h,{size:"sm",variant:"outline",className:"shrink-0",onClick:()=>j([t]),children:[e.jsx(E,{className:"h-3.5 w-3.5 mr-1"}),"Submit for review"]}),e.jsx(h,{size:"sm",variant:"ghost",disabled:w,className:"shrink-0 text-muted-foreground hover:text-destructive",title:"Discard this draft — back to the last approved version, or delete it if there isn't one",onClick:()=>y([t]),"data-testid":"draft-discard",children:e.jsx(M,{className:"h-3.5 w-3.5"})})]},s)})]}),a&&a.total>a.limit&&e.jsxs("div",{className:"flex items-center justify-center gap-3 pt-3 text-sm text-muted-foreground",children:[e.jsxs(h,{variant:"outline",size:"sm",disabled:N||a.offset===0,onClick:()=>u(Math.max(0,a.offset-a.limit)),children:[e.jsx(he,{className:"h-3.5 w-3.5 mr-1"}),"Prev"]}),e.jsxs("span",{children:["Page ",Math.floor(a.offset/a.limit)+1," of"," ",Math.max(1,Math.ceil(a.total/a.limit))]}),e.jsxs(h,{variant:"outline",size:"sm",disabled:N||!a.has_more,onClick:()=>u(a.offset+a.limit),children:["Next",e.jsx(Z,{className:"h-3.5 w-3.5 ml-1"})]})]})]})}),m&&m.length>0&&e.jsx(ie,{isOpen:!0,onClose:()=>j(null),documentTitle:m.length===1?m[0].title:`${m.length} drafts`,currentVersion:m.length===1?m[0].version:null,onSubmit:(t,s)=>I(m,t,s)}),e.jsx(ne,{open:!!n,onOpenChange:t=>!t&&y(null),children:e.jsxs(oe,{children:[e.jsxs(le,{children:[e.jsx(de,{children:(n==null?void 0:n.length)===1?`Discard "${n[0].title}"?`:`Discard ${(n==null?void 0:n.length)??0} drafts?`}),e.jsxs(ce,{children:[(n==null?void 0:n.length)===1?"The document goes":"Each document goes"," ","back to its last approved version. A document that was never approved is deleted instead. This can't be undone."]})]}),e.jsxs(me,{children:[e.jsx(fe,{children:"Cancel"}),e.jsx(ue,{onClick:()=>void H(n??[]),"data-testid":"drafts-discard-confirm",children:"Discard"})]})]})})]})}export{ke as default};
@@ -1 +0,0 @@
1
- import{j as e,r as o,c_ as Ve,d3 as ze,dk as Ge,cP as ue,dl as Ue,c$ as Ye,cS as k,dm as xe,d2 as he,dn as qe,cX as Xe,dp as Ke,dq as Qe,dr as We,s as Je,u as pe,i as fe,ds as oe,A as L,K as J,a as I,L as _,B as C,dt as Ze,D as V,x as z,y as G,z as U,H as Y,C as je,e as M,bS as es,ab as ss,du as ts,f as E,O as ns,dv as rs,U as as,aP as os,T as ls,P as is,Q as le,R as ie,dw as cs,ag as ds,I as ge,dx as se,dy as ms,dz as ve,bB as us,dA as xs,dB as hs,dC as ps}from"./index-B5hLclEq.js";import{P as fs}from"./page-title-BkqlUA0j.js";import{P as js}from"./PersonCombobox-D350WlrJ.js";import{C as q,d as X,a as ye}from"./card-UDyMRcps.js";import{R as gs,S as we,a as Ne,b as Ce,c as be,d as Te}from"./select-DrL0mpRN.js";import{R as Pe}from"./refresh-cw-CsCtmWwX.js";import{T as vs}from"./triangle-alert-CsYGyfGZ.js";import{T as Ee}from"./trash-2-B4hRXo-p.js";import{C as Se}from"./circle-check-CSkZUEFK.js";import{C as Re}from"./circle-x-in2o3aHU.js";import{X as ys}from"./x-qxt1WrUi.js";import{U as ws}from"./user-plus-4CTYEkd3.js";var Ns=Symbol("radix.slottable");function Cs(s){const n=({children:t})=>e.jsx(e.Fragment,{children:t});return n.displayName=`${s}.Slottable`,n.__radixId=Ns,n}var[K]=Xe("Tooltip",[xe]),Q=xe(),ke="TooltipProvider",bs=700,Z="tooltip.open",[Ts,te]=K(ke),Oe=s=>{const{__scopeTooltip:n,delayDuration:t=bs,skipDelayDuration:a=300,disableHoverableContent:r=!1,children:m}=s,u=o.useRef(!0),p=o.useRef(!1),d=o.useRef(0);return o.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),e.jsx(Ts,{scope:n,isOpenDelayedRef:u,delayDuration:t,onOpen:o.useCallback(()=>{window.clearTimeout(d.current),u.current=!1},[]),onClose:o.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>u.current=!0,a)},[a]),isPointerInTransitRef:p,onPointerInTransitChange:o.useCallback(f=>{p.current=f},[]),disableHoverableContent:r,children:m})};Oe.displayName=ke;var H="Tooltip",[Ps,F]=K(H),Ae=s=>{const{__scopeTooltip:n,children:t,open:a,defaultOpen:r,onOpenChange:m,disableHoverableContent:u,delayDuration:p}=s,d=te(H,s.__scopeTooltip),f=Q(n),[l,h]=o.useState(null),i=Ve(),c=o.useRef(0),j=u??d.disableHoverableContent,g=p??d.delayDuration,v=o.useRef(!1),[y,w]=ze({prop:a,defaultProp:r??!1,onChange:b=>{b?(d.onOpen(),document.dispatchEvent(new CustomEvent(Z))):d.onClose(),m==null||m(b)},caller:H}),T=o.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),P=o.useCallback(()=>{window.clearTimeout(c.current),c.current=0,v.current=!1,w(!0)},[w]),x=o.useCallback(()=>{window.clearTimeout(c.current),c.current=0,w(!1)},[w]),S=o.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>{v.current=!0,w(!0),c.current=0},g)},[g,w]);return o.useEffect(()=>()=>{c.current&&(window.clearTimeout(c.current),c.current=0)},[]),e.jsx(Ge,{...f,children:e.jsx(Ps,{scope:n,contentId:i,open:y,stateAttribute:T,trigger:l,onTriggerChange:h,onTriggerEnter:o.useCallback(()=>{d.isOpenDelayedRef.current?S():P()},[d.isOpenDelayedRef,S,P]),onTriggerLeave:o.useCallback(()=>{j?x():(window.clearTimeout(c.current),c.current=0)},[x,j]),onOpen:P,onClose:x,disableHoverableContent:j,children:t})})};Ae.displayName=H;var ee="TooltipTrigger",_e=o.forwardRef((s,n)=>{const{__scopeTooltip:t,...a}=s,r=F(ee,t),m=te(ee,t),u=Q(t),p=o.useRef(null),d=ue(n,p,r.onTriggerChange),f=o.useRef(!1),l=o.useRef(!1),h=o.useCallback(()=>f.current=!1,[]);return o.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),e.jsx(Ue,{asChild:!0,...u,children:e.jsx(Ye.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...a,ref:d,onPointerMove:k(s.onPointerMove,i=>{i.pointerType!=="touch"&&!l.current&&!m.isPointerInTransitRef.current&&(r.onTriggerEnter(),l.current=!0)}),onPointerLeave:k(s.onPointerLeave,()=>{r.onTriggerLeave(),l.current=!1}),onPointerDown:k(s.onPointerDown,()=>{r.open&&r.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:k(s.onFocus,()=>{f.current||r.onOpen()}),onBlur:k(s.onBlur,r.onClose),onClick:k(s.onClick,r.onClose)})})});_e.displayName=ee;var ne="TooltipPortal",[Es,Ss]=K(ne,{forceMount:void 0}),De=s=>{const{__scopeTooltip:n,forceMount:t,children:a,container:r}=s,m=F(ne,n);return e.jsx(Es,{scope:n,forceMount:t,children:e.jsx(he,{present:t||m.open,children:e.jsx(qe,{asChild:!0,container:r,children:a})})})};De.displayName=ne;var D="TooltipContent",Le=o.forwardRef((s,n)=>{const t=Ss(D,s.__scopeTooltip),{forceMount:a=t.forceMount,side:r="top",...m}=s,u=F(D,s.__scopeTooltip);return e.jsx(he,{present:a||u.open,children:u.disableHoverableContent?e.jsx(Ie,{side:r,...m,ref:n}):e.jsx(Rs,{side:r,...m,ref:n})})}),Rs=o.forwardRef((s,n)=>{const t=F(D,s.__scopeTooltip),a=te(D,s.__scopeTooltip),r=o.useRef(null),m=ue(n,r),[u,p]=o.useState(null),{trigger:d,onClose:f}=t,l=r.current,{onPointerInTransitChange:h}=a,i=o.useCallback(()=>{p(null),h(!1)},[h]),c=o.useCallback((j,g)=>{const v=j.currentTarget,y={x:j.clientX,y:j.clientY},w=Ds(y,v.getBoundingClientRect()),T=Ls(y,w),P=Is(g.getBoundingClientRect()),x=Hs([...T,...P]);p(x),h(!0)},[h]);return o.useEffect(()=>()=>i(),[i]),o.useEffect(()=>{if(d&&l){const j=v=>c(v,l),g=v=>c(v,d);return d.addEventListener("pointerleave",j),l.addEventListener("pointerleave",g),()=>{d.removeEventListener("pointerleave",j),l.removeEventListener("pointerleave",g)}}},[d,l,c,i]),o.useEffect(()=>{if(u){const j=g=>{const v=g.target,y={x:g.clientX,y:g.clientY},w=(d==null?void 0:d.contains(v))||(l==null?void 0:l.contains(v)),T=!Ms(y,u);w?i():T&&(i(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,l,u,f,i]),e.jsx(Ie,{...s,ref:m})}),[ks,Os]=K(H,{isInside:!1}),As=Cs("TooltipContent"),Ie=o.forwardRef((s,n)=>{const{__scopeTooltip:t,children:a,"aria-label":r,onEscapeKeyDown:m,onPointerDownOutside:u,...p}=s,d=F(D,t),f=Q(t),{onClose:l}=d;return o.useEffect(()=>(document.addEventListener(Z,l),()=>document.removeEventListener(Z,l)),[l]),o.useEffect(()=>{if(d.trigger){const h=i=>{const c=i.target;c!=null&&c.contains(d.trigger)&&l()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,l]),e.jsx(Ke,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:m,onPointerDownOutside:u,onFocusOutside:h=>h.preventDefault(),onDismiss:l,children:e.jsxs(Qe,{"data-state":d.stateAttribute,...f,...p,ref:n,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[e.jsx(As,{children:a}),e.jsx(ks,{scope:t,isInside:!0,children:e.jsx(gs,{id:d.contentId,role:"tooltip",children:r||a})})]})})});Le.displayName=D;var Me="TooltipArrow",_s=o.forwardRef((s,n)=>{const{__scopeTooltip:t,...a}=s,r=Q(t);return Os(Me,t).isInside?null:e.jsx(We,{...r,...a,ref:n})});_s.displayName=Me;function Ds(s,n){const t=Math.abs(n.top-s.y),a=Math.abs(n.bottom-s.y),r=Math.abs(n.right-s.x),m=Math.abs(n.left-s.x);switch(Math.min(t,a,r,m)){case m:return"left";case r:return"right";case t:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function Ls(s,n,t=5){const a=[];switch(n){case"top":a.push({x:s.x-t,y:s.y+t},{x:s.x+t,y:s.y+t});break;case"bottom":a.push({x:s.x-t,y:s.y-t},{x:s.x+t,y:s.y-t});break;case"left":a.push({x:s.x+t,y:s.y-t},{x:s.x+t,y:s.y+t});break;case"right":a.push({x:s.x-t,y:s.y-t},{x:s.x-t,y:s.y+t});break}return a}function Is(s){const{top:n,right:t,bottom:a,left:r}=s;return[{x:r,y:n},{x:t,y:n},{x:t,y:a},{x:r,y:a}]}function Ms(s,n){const{x:t,y:a}=s;let r=!1;for(let m=0,u=n.length-1;m<n.length;u=m++){const p=n[m],d=n[u],f=p.x,l=p.y,h=d.x,i=d.y;l>a!=i>a&&t<(h-f)*(a-l)/(i-l)+f&&(r=!r)}return r}function Hs(s){const n=s.slice();return n.sort((t,a)=>t.x<a.x?-1:t.x>a.x?1:t.y<a.y?-1:t.y>a.y?1:0),$s(n)}function $s(s){if(s.length<=1)return s.slice();const n=[];for(let a=0;a<s.length;a++){const r=s[a];for(;n.length>=2;){const m=n[n.length-1],u=n[n.length-2];if((m.x-u.x)*(r.y-u.y)>=(m.y-u.y)*(r.x-u.x))n.pop();else break}n.push(r)}n.pop();const t=[];for(let a=s.length-1;a>=0;a--){const r=s[a];for(;t.length>=2;){const m=t[t.length-1],u=t[t.length-2];if((m.x-u.x)*(r.y-u.y)>=(m.y-u.y)*(r.x-u.x))t.pop();else break}t.push(r)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}var Fs=Oe,Bs=Ae,Vs=_e,zs=De,He=Le;const Gs=({children:s,delayDuration:n=0})=>e.jsx(Fs,{delayDuration:n,children:s}),O=Bs,A=Vs,R=o.forwardRef(({className:s,sideOffset:n=4,...t},a)=>e.jsx(zs,{children:e.jsx(He,{ref:a,sideOffset:n,className:Je("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...t})}));R.displayName=He.displayName;const Us={Owner:"Admin",Editor:"Editor",Viewer:"Viewer",User:"Viewer"},ce=s=>Us[s]??"Viewer";function Ys({localTeams:s,onImported:n}){const[t,a]=o.useState([]),r=pe(),[m,u]=o.useState(!0),[p,d]=o.useState(null),[f,l]=o.useState(!1),[h,i]=o.useState(null),[c,j]=o.useState(null),[g,v]=o.useState(null),y=new Map(s.filter(x=>x.source==="promptowl"&&x.external_id).map(x=>[x.external_id,x]));o.useEffect(()=>{w()},[]);const w=async()=>{u(!0),d(null);try{const x=await r.fetchQuery(fe.promptowlTeams());a(x.teams)}catch(x){oe(x)?l(!0):d((x==null?void 0:x.message)||"Could not reach PromptOwl")}finally{u(!1)}},T=async x=>{var S;i(x.id),d(null);try{const b=await ts([x.id]);v(b.results[0]??null),n(),E.success((S=b.results[0])!=null&&S.created?`Imported ${x.name}`:`Synced ${x.name}`)}catch(b){oe(b)?l(!0):d((b==null?void 0:b.message)||"Sync failed")}finally{i(null),j(null)}},P=x=>{y.has(x.id)?j(x):T(x)};return f?e.jsxs(L,{children:[e.jsx(J,{className:"h-4 w-4"}),e.jsx(I,{children:"Your PromptOwl session has ended. Sign out and sign back in with PromptOwl to import teams."})]}):m?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(_,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"space-y-4",children:[p&&e.jsxs(L,{variant:"destructive",children:[e.jsx(J,{className:"h-4 w-4"}),e.jsx(I,{children:p})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground flex-1",children:"Your PromptOwl teams. Syncing one copies it here with its members — people without an account are invited automatically. Teams you're view-only on can't be imported, since the copy would be yours to control."}),e.jsx(C,{size:"sm",variant:"ghost",onClick:w,"aria-label":"Refresh",children:e.jsx(Pe,{className:"h-4 w-4"})})]}),g&&e.jsx(Xs,{result:g}),t.length===0?e.jsx(q,{children:e.jsx(X,{className:"py-10 text-center text-sm text-muted-foreground",children:"You're not in any teams in PromptOwl."})}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(x=>e.jsx(qs,{team:x,imported:y.has(x.id),syncing:h===x.id,canImport:Ze(x),onSync:()=>P(x)},x.id))}),e.jsx(V,{open:!!c,onOpenChange:x=>!x&&j(null),children:e.jsxs(z,{className:"sm:max-w-[460px]",children:[e.jsx(G,{children:e.jsxs(U,{children:['Sync "',c==null?void 0:c.name,'" from PromptOwl?']})}),e.jsxs(L,{children:[e.jsx(vs,{className:"h-4 w-4"}),e.jsx(I,{className:"text-xs",children:"PromptOwl is the source of truth. This team's roster here will be made to match PromptOwl exactly: roles are reset, and anyone you added by hand in ContextNest is removed."})]}),e.jsxs(Y,{children:[e.jsx(C,{variant:"outline",onClick:()=>j(null),children:"Cancel"}),e.jsxs(C,{disabled:!!h,onClick:()=>c&&T(c),children:[h&&e.jsx(_,{className:"h-4 w-4 mr-1 animate-spin"}),"Sync"]})]})]})})]})}function qs({team:s,imported:n,syncing:t,canImport:a,onSync:r}){return e.jsxs(q,{className:`flex flex-col${a?"":" opacity-70"}`,children:[e.jsx(ye,{className:"space-y-1 pb-3",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold truncate",children:s.name}),e.jsx(M,{variant:"secondary",className:"shrink-0",children:s.members.length}),n&&e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsxs(M,{variant:"outline",className:"shrink-0 gap-1",children:[e.jsx(je,{className:"h-3 w-3"}),"Synced"]})}),e.jsx(R,{children:"Already imported. Syncing again updates it in place."})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["You're ",s.your_role," in PromptOwl",s.enterprise?` · ${s.enterprise.name}`:""]})]}),a?e.jsxs(C,{size:"sm",variant:n?"outline":"default",className:"shrink-0",disabled:t,onClick:r,children:[t?e.jsx(_,{className:"h-3.5 w-3.5 animate-spin"}):n?e.jsx(Pe,{className:"h-3.5 w-3.5"}):e.jsx(es,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"ml-1",children:n?"Sync":"Import"})]}):e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 text-xs text-muted-foreground border rounded-md px-2 py-1.5",children:[e.jsx(ss,{className:"h-3 w-3"}),"View-only"]})}),e.jsx(R,{className:"max-w-xs",children:"Importing a team makes you the owner of the copy here, which is more than you can do with this team in PromptOwl. Ask an owner or editor of it to import it."})]})]})}),e.jsx(X,{className:"space-y-1.5",children:s.members.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No members."}):s.members.map(m=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"flex-1 truncate",children:m.email}),e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:ce(m.role)})}),e.jsxs(R,{children:[m.role," in PromptOwl → ",ce(m.role)," here"]})]})]},m.email))})]})}function Xs({result:s}){const n=!s.added.length&&!s.updated.length&&!s.removed.length;return e.jsxs(L,{children:[e.jsx(je,{className:"h-4 w-4"}),e.jsxs(I,{className:"text-xs space-y-0.5",children:[e.jsxs("div",{className:"font-medium",children:[s.name," — ",s.created?"imported":"synced"]}),n?e.jsx("div",{children:"Already up to date."}):e.jsxs(e.Fragment,{children:[s.added.length>0&&e.jsxs("div",{children:["Added: ",s.added.join(", ")]}),s.updated.length>0&&e.jsxs("div",{children:["Role changed: ",s.updated.join(", ")]}),s.removed.length>0&&e.jsxs("div",{children:["Removed: ",s.removed.join(", ")]})]})]})]})}const de=5,W=s=>{var n;return((n=se.find(t=>t.value===s))==null?void 0:n.label)??s},$={viewer:1,editor:2,admin:3},B=4;function me(s,n,t){if(t||s.owner_email&&s.owner_email.toLowerCase()===n)return B;const a=s.members.find(r=>(r.email||"").toLowerCase()===n);return a?$[a.role]??0:0}function mt(){var re;const{adminStatus:s,isAdmin:n,promptowlTeamsEnabled:t}=ns(),a=(((re=s==null?void 0:s.me)==null?void 0:re.email)||"").toLowerCase(),[r]=o.useState(()=>rs()),m=t&&r,[u,p]=o.useState([]),[d,f]=o.useState(!0),l=pe(),[h,i]=o.useState(null),[c,j]=o.useState(!1),[g,v]=o.useState(null),[y,w]=o.useState(null),[T,P]=o.useState(!1),x=async()=>{i(null);try{const N=await l.fetchQuery(fe.teamList());p(N.teams),v(ae=>ae?N.teams.find(Be=>Be.id===ae.id)??null:null)}catch(N){i((N==null?void 0:N.message)||"Failed to load teams")}finally{f(!1)}};o.useEffect(()=>{x()},[]);const S=async()=>{if(y){P(!0);try{await cs(y.id),E.success("Team deleted"),w(null),await x()}catch(N){E.error((N==null?void 0:N.message)||"Failed to delete team")}finally{P(!1)}}},b=d?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(_,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):u.length===0?e.jsx(q,{children:e.jsx(X,{className:"py-10 text-center text-sm text-muted-foreground",children:"No teams yet. Create one to share a nest with a whole group at once."})}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:u.map(N=>e.jsx(Qs,{team:N,rank:me(N,a,n),onEdit:()=>v(N),onDelete:()=>w(N)},N.id))});return e.jsxs(Gs,{delayDuration:150,children:[e.jsxs("div",{className:"w-full mx-auto space-y-4",children:[e.jsx(fs,{icon:as,title:"Teams",description:e.jsxs(e.Fragment,{children:["A team is a reusable group. Give each member a role, then share the team with a nest from its ",e.jsx("strong",{children:"Share"})," dialog — every member gets their role on that nest."]}),actions:e.jsxs(C,{size:"sm",onClick:()=>j(!0),children:[e.jsx(os,{className:"h-4 w-4 mr-1"}),"New Team"]})}),h&&e.jsxs(L,{variant:"destructive",children:[e.jsx(J,{className:"h-4 w-4"}),e.jsx(I,{children:h})]}),m?e.jsxs(ls,{defaultValue:"cn",children:[e.jsxs(is,{children:[e.jsx(le,{value:"cn",children:"ContextNest Teams"}),e.jsx(le,{value:"po",children:"PromptOwl Teams"})]}),e.jsx(ie,{value:"cn",className:"mt-4",children:b}),e.jsx(ie,{value:"po",className:"mt-4",children:e.jsx(Ys,{localTeams:u,onImported:x})})]}):b]}),c&&e.jsx(Ws,{onClose:()=>j(!1),onCreated:x}),g&&e.jsx(Js,{team:g,rank:me(g,a,n),onClose:()=>v(null),onChanged:x}),e.jsx(V,{open:!!y,onOpenChange:N=>!N&&w(null),children:e.jsxs(z,{className:"sm:max-w-[420px]",children:[e.jsx(G,{children:e.jsxs(U,{children:['Delete team "',y==null?void 0:y.name,'"?']})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Members lose access to every nest this team is shared with. This can't be undone."}),e.jsxs(Y,{children:[e.jsx(C,{variant:"outline",onClick:()=>w(null),children:"Cancel"}),e.jsxs(C,{variant:"destructive",disabled:T,onClick:S,children:[T&&e.jsx(_,{className:"h-4 w-4 mr-1 animate-spin"}),"Delete"]})]})]})})]})}function $e({registered:s}){return e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsx("span",{className:"shrink-0 flex items-center",children:s?e.jsx(Se,{className:"h-3.5 w-3.5 text-green-600"}):e.jsx(Re,{className:"h-3.5 w-3.5 text-red-500"})})}),e.jsx(R,{children:s?"Registered account":"Invited — hasn't signed up yet"})]})}function Ks({member:s}){return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx($e,{registered:s.registered}),e.jsx("span",{className:"flex-1 truncate",children:s.email}),e.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:W(s.role)})]})}function Qs({team:s,rank:n,onEdit:t,onDelete:a}){const r=s.members.slice(0,de),m=s.members.slice(de),u=n>=$.editor,p=n>=B;return e.jsxs(q,{className:"flex flex-col",children:[e.jsx(ye,{className:"space-y-1 pb-3",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold truncate",children:s.name}),e.jsx(M,{variant:"secondary",className:"shrink-0",children:s.members.length}),s.source==="promptowl"&&e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsx(M,{variant:"outline",className:"shrink-0",children:"PromptOwl"})}),e.jsx(R,{children:"Imported from PromptOwl. Re-syncing makes this roster match PromptOwl exactly."})]})]}),s.owner_email&&e.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["Created by ",s.owner_email]})]}),e.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[u&&e.jsx(C,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,"aria-label":"Edit team",children:e.jsx(ds,{className:"h-3.5 w-3.5"})}),p&&e.jsx(C,{size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive",onClick:a,"aria-label":"Delete team",children:e.jsx(Ee,{className:"h-3.5 w-3.5"})})]})]})}),e.jsx(X,{className:"space-y-1.5",children:s.members.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No members yet."}):e.jsxs(e.Fragment,{children:[r.map(d=>e.jsx(Ks,{member:d},d.userId)),m.length>0&&e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsxs("button",{className:"text-xs text-muted-foreground hover:text-foreground text-left",children:["+",m.length," more member",m.length===1?"":"s"]})}),e.jsx(R,{className:"max-w-xs",children:e.jsx("div",{className:"space-y-1",children:m.map(d=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.registered?e.jsx(Se,{className:"h-3 w-3 text-green-600 shrink-0"}):e.jsx(Re,{className:"h-3 w-3 text-red-500 shrink-0"}),e.jsx("span",{className:"truncate",children:d.email}),e.jsxs("span",{className:"opacity-70",children:["· ",W(d.role)]})]},d.userId))})})]})]})})]})}function Fe({onAdd:s,busy:n,maxRank:t=B,members:a=[]}){var i;const r=se.filter(c=>$[c.value]<=t),[m,u]=o.useState(""),[p,d]=o.useState(((i=r[0])==null?void 0:i.value)??"viewer"),[f,l]=o.useState(null),h=()=>{const c=m.trim();if(c){if(!us(c)){l("Enter a valid email address.");return}l(null),Promise.resolve(s(c,p)).then(()=>{var j;u(""),d(((j=r[0])==null?void 0:j.value)??"viewer")})}};return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[e.jsx(js,{value:m,onChange:c=>{u(c),f&&l(null)},onSubmit:h,placeholder:"person@company.com",exclude:a,className:"flex-1",testId:"team-member-input"}),e.jsxs(we,{value:p,onValueChange:c=>d(c),children:[e.jsx(Ne,{className:"w-full sm:w-[130px] h-8",children:e.jsx(Ce,{})}),e.jsx(be,{children:r.map(c=>e.jsx(Te,{value:c.value,children:c.label},c.value))})]}),e.jsxs(C,{size:"sm",onClick:h,disabled:n||!m.trim(),children:[e.jsx(ws,{className:"h-4 w-4 mr-1"}),"Add"]})]}),f&&e.jsx("p",{className:"text-xs text-destructive",children:f})]})}function Ws({onClose:s,onCreated:n}){const[t,a]=o.useState(""),[r,m]=o.useState([]),[u,p]=o.useState(!1),d=(l,h)=>{if(r.some(i=>i.email.toLowerCase()===l.toLowerCase())){E.error("Already added");return}m(i=>[...i,{email:l,role:h}])},f=async()=>{const l=t.trim();if(l){p(!0);try{const{team:h}=await ms(l);for(const i of r)try{await ve(h.id,{email:i.email,role:i.role})}catch(c){E.error(`${i.email}: ${(c==null?void 0:c.message)||"could not add"}`)}E.success(`Team "${l}" created`),n(),s()}catch(h){E.error((h==null?void 0:h.message)||"Failed to create team")}finally{p(!1)}}};return e.jsx(V,{open:!0,onOpenChange:l=>!l&&s(),children:e.jsxs(z,{className:"sm:max-w-[480px]",children:[e.jsx(G,{children:e.jsx(U,{children:"New team"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(ge,{autoFocus:!0,placeholder:"Team name (e.g. Platform)",value:t,onChange:l=>a(l.target.value)}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Members (optional)"}),r.length>0&&e.jsx("div",{className:"space-y-1.5",children:r.map(l=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"flex-1 truncate",children:l.email}),e.jsx("span",{className:"text-xs text-muted-foreground",children:W(l.role)}),e.jsx(C,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>m(h=>h.filter(i=>i.email!==l.email)),"aria-label":`Remove ${l.email}`,children:e.jsx(ys,{className:"h-3.5 w-3.5"})})]},l.email))}),e.jsx(Fe,{onAdd:d,members:r.map(l=>l.email)})]})]}),e.jsxs(Y,{children:[e.jsx(C,{variant:"outline",onClick:s,children:"Cancel"}),e.jsxs(C,{onClick:f,disabled:u||!t.trim(),children:[u&&e.jsx(_,{className:"h-4 w-4 mr-1 animate-spin"}),"Create"]})]})]})})}function Js({team:s,rank:n,onClose:t,onChanged:a}){const r=n>=$.admin,m=n>=$.editor,[u,p]=o.useState(s.name),[d,f]=o.useState(!1),l=async(i,c)=>{f(!0);try{await i(),c&&E.success(c),a()}catch(j){E.error((j==null?void 0:j.message)||"Something went wrong")}finally{f(!1)}},h=async()=>{if(!r)return;const i=u.trim();!i||i===s.name||await l(()=>xs(s.id,i),"Team renamed")};return e.jsx(V,{open:!0,onOpenChange:i=>!i&&t(),children:e.jsxs(z,{className:"sm:max-w-[480px]",children:[e.jsx(G,{children:e.jsx(U,{children:"Edit team"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(ge,{value:u,onChange:i=>p(i.target.value),onBlur:h,onKeyDown:i=>i.key==="Enter"&&h(),className:"h-9",disabled:!r})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Members"}),s.members.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No members yet."}):e.jsx("div",{className:"space-y-2",children:s.members.map(i=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{registered:i.registered}),e.jsx("span",{className:"text-sm flex-1 truncate",children:i.email}),r?e.jsxs(we,{value:i.role,onValueChange:c=>l(()=>hs(s.id,i.userId,c),"Role updated"),children:[e.jsx(Ne,{className:"w-[120px] h-8",children:e.jsx(Ce,{})}),e.jsx(be,{children:se.map(c=>e.jsx(Te,{value:c.value,children:c.label},c.value))})]}):e.jsx(M,{variant:"secondary",className:"text-[11px]",children:W(i.role)}),r&&e.jsx(C,{size:"icon",variant:"ghost",className:"h-8 w-8",disabled:d,onClick:()=>l(()=>ps(s.id,i.userId),"Member removed"),"aria-label":`Remove ${i.email}`,children:e.jsx(Ee,{className:"h-3.5 w-3.5"})})]},i.userId))}),m&&e.jsx("div",{className:"pt-1 border-t",children:e.jsx("div",{className:"pt-2",children:e.jsx(Fe,{busy:d,maxRank:n,members:s.members.map(i=>i.email),onAdd:(i,c)=>l(()=>ve(s.id,{email:i,role:c}),"Member added")})})})]})]}),e.jsx(Y,{children:e.jsx(C,{variant:"outline",onClick:t,children:"Done"})})]})})}export{mt as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-B5hLclEq.js";import{ActivityTracePage as r}from"./ActivityTracePage-D2iIbEph.js";import"./page-title-BkqlUA0j.js";import"./select-DrL0mpRN.js";import"./dates-BCxbm4_q.js";import"./client-attribution-BraarYaP.js";import"./arrow-left-BAgIocLn.js";import"./refresh-cw-CsCtmWwX.js";import"./chevron-left-XR4ReJ9Z.js";function f(){return t.jsx(r,{})}export{f as default};
@@ -1 +0,0 @@
1
- import{r,j as e,D as P,x as D,y as A,z as T,c8 as F,G as z,I as b,H as R,B as h,c9 as H,E as I,ca as B,f as k,O,cb as Y,cc as K,cd as U,e as G,bs as L,ce as W}from"./index-B5hLclEq.js";import{P as q}from"./page-title-BkqlUA0j.js";function S({shown:n,onToggle:c}){return e.jsx("button",{type:"button",onClick:c,tabIndex:-1,"aria-label":n?"Hide password":"Show password",title:n?"Hide password":"Show password",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?e.jsx(H,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})}function J({open:n,onClose:c}){const[u,l]=r.useState(""),[a,m]=r.useState(""),[t,x]=r.useState(""),[d,p]=r.useState(!1),[j,i]=r.useState(null),[N,v]=r.useState(!1),[w,g]=r.useState(!1),[f,o]=r.useState(!1),C=()=>{l(""),m(""),x(""),i(null),v(!1),g(!1),o(!1)},E=async()=>{if(i(null),a.trim().length===0){i("New password cannot be empty or only whitespace.");return}if(a.length<8){i("New password must be at least 8 characters.");return}if(a!==t){i("New passwords don't match.");return}if(a===u){i("New password must be different from the current password.");return}p(!0);try{await B(u,a),k.success("Password changed. Your other sessions were signed out."),C(),c()}catch(s){i((s==null?void 0:s.message)||"Could not change password.")}finally{p(!1)}};return e.jsx(P,{open:n,onOpenChange:s=>{!s&&!d&&(C(),c())},children:e.jsxs(D,{className:"sm:max-w-[400px]",children:[e.jsxs(A,{children:[e.jsxs(T,{className:"flex items-center gap-2",children:[e.jsx(F,{className:"h-4 w-4 text-muted-foreground"}),"Change password"]}),e.jsx(z,{children:"If an admin gave you a temporary password, set your own here. This signs out your other sessions."})]}),e.jsxs("div",{className:"space-y-3 py-1",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:"cp-current",className:"block text-sm font-medium",children:"Current password"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{id:"cp-current",type:N?"text":"password",placeholder:"Enter your current password",value:u,onChange:s=>l(s.target.value),autoComplete:"current-password",className:"pr-10"}),e.jsx(S,{shown:N,onToggle:()=>v(s=>!s)})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:"cp-next",className:"block text-sm font-medium",children:"New password"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{id:"cp-next",type:w?"text":"password",placeholder:"At least 8 characters",value:a,onChange:s=>m(s.target.value),autoComplete:"new-password",className:"pr-10"}),e.jsx(S,{shown:w,onToggle:()=>g(s=>!s)})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:"cp-confirm",className:"block text-sm font-medium",children:"Confirm new password"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{id:"cp-confirm",type:f?"text":"password",placeholder:"Re-enter your new password",value:t,onChange:s=>x(s.target.value),autoComplete:"new-password","aria-invalid":t.length>0&&t!==a,className:"pr-10"}),e.jsx(S,{shown:f,onToggle:()=>o(s=>!s)})]}),t.length>0&&t!==a&&e.jsx("p",{className:"text-sm text-destructive",children:"Passwords don't match."})]}),j&&e.jsx("p",{className:"text-sm text-destructive",children:j})]}),e.jsxs(R,{className:"gap-2",children:[e.jsx(h,{variant:"outline",onClick:()=>{C(),c()},disabled:d,children:"Cancel"}),e.jsx(h,{onClick:E,disabled:d||!u||!a||!t||a!==t,children:d?"Saving...":"Change password"})]})]})})}function V(){var g,f;const{adminStatus:n,isAdmin:c,refresh:u}=O(),l=(n==null?void 0:n.me)??null,[a,m]=r.useState(!1),[t,x]=r.useState(""),[d,p]=r.useState(!1),[j,i]=r.useState(!1);if(!l)return e.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Sign in to see your account."});const N=((g=l.name)==null?void 0:g.trim())||l.email,v=()=>{x(l.name??""),m(!0)},w=async()=>{p(!0);try{await W(t),await u(),k.success("Name updated."),m(!1)}catch(o){k.error((o==null?void 0:o.message)||"Could not update name.")}finally{p(!1)}};return e.jsxs("div",{"data-testid":"account-page",children:[e.jsx(q,{icon:Y,title:"Your Account",description:"Who you are on this server."}),e.jsx(y,{label:"Profile photo",children:e.jsx(K,{className:"h-20 w-20",children:e.jsx(U,{className:"text-3xl",children:N.charAt(0).toUpperCase()})})}),e.jsx(y,{label:"Name",action:a?null:e.jsx(h,{variant:"outline",size:"sm",onClick:v,"data-testid":"account-edit-name",children:"Edit"}),children:a?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{value:t,"aria-label":"Name",maxLength:80,placeholder:"Your name",autoFocus:!0,onChange:o=>x(o.target.value),onKeyDown:o=>{o.key==="Enter"&&!d&&w(),o.key==="Escape"&&m(!1)},className:"max-w-xs","data-testid":"account-name-input"}),e.jsx(h,{size:"sm",onClick:w,disabled:d||t.trim()===(l.name??"").trim(),children:d?"Saving...":"Save"}),e.jsx(h,{size:"sm",variant:"ghost",onClick:()=>m(!1),disabled:d,children:"Cancel"})]}):e.jsx("span",{className:"text-muted-foreground",children:((f=l.name)==null?void 0:f.trim())||e.jsx("em",{children:"Not set — your email is shown instead"})})}),e.jsx(y,{label:"Email address",children:e.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[l.email,c&&e.jsxs(G,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700 text-[10px] px-1.5 py-0",children:[e.jsx(L,{className:"h-2.5 w-2.5"}),"Admin"]})]})}),e.jsx(y,{label:"Password",action:e.jsx(h,{variant:"outline",size:"sm",onClick:()=>i(!0),"data-testid":"account-change-password",children:"Change password"}),children:e.jsx("span",{className:"tracking-widest text-muted-foreground","aria-hidden":!0,children:"••••••••••••"})}),e.jsx(J,{open:j,onClose:()=>i(!1)})]})}function y({label:n,action:c,children:u}){return e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-border py-5",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:n}),e.jsx("div",{className:"text-sm",children:u})]}),c]})}export{V as default};
@@ -1,6 +0,0 @@
1
- import{c as Ie,O as Re,r as a,u as De,j as e,U as ce,B as t,A as U,K as M,a as O,L as f,I as ve,cc as oe,cd as de,e as Q,bs as me,cl as Ee,df as _e,C as we,ao as ye,at as Ne,D as N,x as b,y as C,z as k,G as S,H as T,dg as Le,dh as Pe,di as Fe,i as he,J as be,dj as ze}from"./index-B5hLclEq.js";import{p as Ge}from"./dates-BCxbm4_q.js";import{P as Ue}from"./page-title-BkqlUA0j.js";import{C as xe,a as ue,c as pe,b as je,d as ge}from"./card-UDyMRcps.js";import{U as fe}from"./user-plus-4CTYEkd3.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Me=[["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"}]],Oe=Ie("shield-off",Me);function Je(){var ie,le;const{adminStatus:o}=Re(),c=((le=(ie=o==null?void 0:o.me)==null?void 0:ie.email)==null?void 0:le.toLowerCase())??null,[d,l]=a.useState([]),m=De(),[h,A]=a.useState(""),[x,I]=a.useState("all"),[R,v]=a.useState([]),[w,Y]=a.useState(!0),[J,D]=a.useState(null),[Ce,E]=a.useState(!1),[ke,H]=a.useState(""),[K,W]=a.useState(null),[i,y]=a.useState(null),[Se,$]=a.useState(!1);a.useEffect(()=>$(!1),[i==null?void 0:i.password]);const[u,_]=a.useState(null),[L,V]=a.useState(!1),[p,P]=a.useState(null),[F,X]=a.useState(!1),[Z,ee]=a.useState(null),[j,z]=a.useState(null),[G,se]=a.useState(!1),[ae,te]=a.useState(null),[re,Te]=a.useState({}),g=async()=>{Y(!0);try{const[s,n]=await Promise.all([m.fetchQuery(he.teammates()),m.fetchQuery(he.superAdmins())]);l(s.teammates),v(s.pending_stewards||[]),Te(Object.fromEntries(n.super_admins.map(r=>[r.email.toLowerCase(),{source:r.source,self:r.self}]))),D(null)}catch(s){D(s.message)}finally{Y(!1)}};a.useEffect(()=>{g()},[]);const q=h.trim().toLowerCase(),ne=d.filter(s=>x==="admin"&&!s.is_admin||x==="normal"&&s.is_admin?!1:q?s.email.toLowerCase().includes(q)||(s.name||"").toLowerCase().includes(q):!0),Ae=s=>{const n=Ge(s);if(!n)return"Never";const r=Date.now()-n.getTime();return r<6e4?"Just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:r<6048e5?`${Math.floor(r/864e5)}d ago`:n.toLocaleDateString()};return e.jsxs("div",{children:[e.jsx(Ue,{icon:ce,title:"Teammates",description:"Add teammates and manage their access",actions:e.jsxs(t,{onClick:()=>E(!0),children:[e.jsx(fe,{className:"h-4 w-4 mr-2"}),"Invite Teammate"]})}),J&&e.jsxs(U,{variant:"destructive",className:"mb-4",children:[e.jsx(M,{className:"h-4 w-4"}),e.jsx(O,{children:J})]}),e.jsxs(xe,{children:[e.jsxs(ue,{children:[e.jsxs(pe,{className:"text-lg flex items-center gap-2",children:[e.jsx(ce,{className:"h-4 w-4"}),"All Users"]}),e.jsx(je,{children:"Everyone who has access to this community server"})]}),e.jsx(ge,{children:w?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(f,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):d.length===0?e.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:'No teammates yet. Click "Invite Teammate" to add one.'}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:[e.jsx(ve,{value:h,onChange:s=>A(s.target.value),placeholder:"Search by name or email…",className:"h-8 max-w-xs text-sm"}),e.jsx("div",{className:"flex items-center rounded-md border p-0.5 text-xs",children:[["all","All"],["admin","Superadmins"],["normal","Members"]].map(([s,n])=>e.jsx("button",{type:"button",onClick:()=>I(s),className:`px-2.5 py-1 rounded ${x===s?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:n},s))})]}),ne.length===0?e.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No users match your filters."}):e.jsx("div",{className:"space-y-2",children:ne.map(s=>{var n,r;return e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border",children:[e.jsx(oe,{className:"h-9 w-9",children:e.jsx(de,{children:(s.email[0]||"?").toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium truncate",children:s.name||s.email}),c&&s.email.toLowerCase()===c&&e.jsx(Q,{variant:"outline",className:"border-emerald-200 bg-emerald-50 text-emerald-700",children:"You"}),s.is_admin&&e.jsxs(Q,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700",children:[e.jsx(me,{className:"h-3 w-3"}),"Admin"]}),!!s.is_invited&&e.jsx(Q,{variant:"outline",className:"border-amber-200 bg-amber-50 text-amber-700",title:"Added with a temporary password. They can sign in with their email + that password (use Reset password to re-issue one), then change it.",children:"Invited"})]}),e.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-3",children:[e.jsx("span",{children:s.email}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.key_count," key",s.key_count!==1?"s":""]}),s.last_active&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["last active ",Ae(s.last_active)]})]})]})]}),s.is_admin&&((n=re[s.email.toLowerCase()])==null?void 0:n.source)==="granted"&&!((r=re[s.email.toLowerCase()])!=null&&r.self)&&e.jsxs(t,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>z(s),title:"Revoke this user's superadmin access",children:[e.jsx(Oe,{className:"h-4 w-4 mr-2"}),"Revoke superadmin"]}),!s.is_admin&&e.jsxs(e.Fragment,{children:[!s.is_invited&&e.jsxs(t,{variant:"outline",size:"sm",onClick:()=>P(s),title:"Grant this user superadmin access",children:[e.jsx(Ee,{className:"h-4 w-4 mr-2"}),"Grant superadmin"]}),e.jsx(t,{variant:"outline",size:"sm",disabled:!!i,onClick:async()=>{y({email:s.email,password:null});try{const B=await _e(s.id);y({email:s.email,password:B.temporary_password||""}),await g()}catch(B){y(null),D(B.message)}},title:"Generate a temporary password to share with this user (no email is sent)",children:"Reset password"}),e.jsx(t,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>_(s),title:"Remove this user and revoke all access",children:"Remove"})]})]},s.id)})})]})})]}),R.length>0&&e.jsxs(xe,{className:"mt-4 border-amber-200 bg-amber-50/40",children:[e.jsxs(ue,{children:[e.jsxs(pe,{className:"text-lg flex items-center gap-2",children:[e.jsx(me,{className:"h-4 w-4 text-amber-700"}),"Stewards without server access"]}),e.jsx(je,{children:"These emails are assigned as stewards on one or more nests, but haven't registered to this server yet — they can't log in or approve anything until they claim an account."})]}),e.jsx(ge,{children:e.jsx("div",{className:"space-y-2",children:R.map(s=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border bg-background",children:[e.jsx(oe,{className:"h-9 w-9",children:e.jsx(de,{className:"bg-amber-100 text-amber-800",children:(s[0]||"?").toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:s}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Assigned as steward · not registered yet"})]}),e.jsxs(t,{size:"sm",onClick:()=>{H(s),E(!0)},children:[e.jsx(fe,{className:"h-3.5 w-3.5 mr-1"}),"Invite"]})]},s))})})]}),Ce&&e.jsx(He,{seedEmail:ke,onClose:()=>{E(!1),H("")},onCreated:(s,n)=>{E(!1),H(""),W({email:s,password:n}),g()}}),K&&e.jsx(Ke,{email:K.email,password:K.password,onClose:()=>W(null)}),i&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:()=>y(null),children:e.jsxs("div",{className:"w-full max-w-sm rounded-lg border bg-background p-5 shadow-lg",onClick:s=>s.stopPropagation(),children:[e.jsx("h3",{className:"font-semibold mb-1",children:"Temporary password"}),i.password===null?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[e.jsx(f,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Generating a temporary password for",e.jsx("br",{}),e.jsx("strong",{className:"text-foreground",children:i.email})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:["Share this with ",e.jsx("strong",{children:i.email})," directly — no email is sent. They sign in with it, then change it from their account. It won't be shown again. Their existing API keys keep working; revoke a key separately if it may be compromised."]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 bg-muted border rounded px-2 py-1.5 text-sm font-mono break-all",children:i.password}),e.jsx(t,{variant:"outline",size:"sm",onClick:async()=>{await Ne(i.password,"Temporary password copied")&&($(!0),setTimeout(()=>$(!1),1500))},children:Se?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-3.5 w-3.5 mr-1 text-green-600"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(ye,{className:"h-3.5 w-3.5 mr-1"}),"Copy"]})})]}),e.jsx("div",{className:"mt-4 text-right",children:e.jsx(t,{variant:"outline",size:"sm",onClick:()=>y(null),children:"Done"})})]})]})}),e.jsx(N,{open:!!u,onOpenChange:s=>!s&&!L&&_(null),children:e.jsxs(b,{className:"sm:max-w-[420px]",children:[e.jsxs(C,{children:[e.jsxs(k,{children:["Remove ",u==null?void 0:u.email,"?"]}),e.jsx(S,{children:"This revokes all their access (API keys, sessions, steward + collaborator roles) and deletes the account. This cannot be undone."})]}),e.jsxs(T,{children:[e.jsx(t,{variant:"outline",onClick:()=>_(null),disabled:L,children:"Cancel"}),e.jsx(t,{variant:"destructive",disabled:L,onClick:async()=>{if(u){V(!0);try{await Le(u.id),_(null),await g()}catch(s){D(s.message)}finally{V(!1)}}},children:L?e.jsx(f,{className:"h-4 w-4 animate-spin"}):"Remove"})]})]})}),e.jsx(N,{open:!!p,onOpenChange:s=>!s&&!F&&P(null),children:e.jsxs(b,{className:"sm:max-w-[420px]",children:[e.jsxs(C,{children:[e.jsxs(k,{children:["Grant superadmin to ",p==null?void 0:p.email,"?"]}),e.jsx(S,{children:"They immediately get server-admin access everywhere: every nest, teammate management, and the activity trace. You can revoke this later from this list."})]}),Z&&e.jsxs(U,{variant:"destructive",children:[e.jsx(M,{className:"h-4 w-4"}),e.jsx(O,{children:Z})]}),e.jsxs(T,{children:[e.jsx(t,{variant:"outline",onClick:()=>P(null),disabled:F,children:"Cancel"}),e.jsx(t,{disabled:F,onClick:async()=>{if(p){X(!0),ee(null);try{await Pe(p.email),P(null),await g()}catch(s){ee(s.message)}finally{X(!1)}}},children:F?e.jsx(f,{className:"h-4 w-4 animate-spin"}):"Grant"})]})]})}),e.jsx(N,{open:!!j,onOpenChange:s=>!s&&!G&&z(null),children:e.jsxs(b,{className:"sm:max-w-[420px]",children:[e.jsxs(C,{children:[e.jsxs(k,{children:["Revoke superadmin from ",j==null?void 0:j.email,"?"]}),e.jsx(S,{children:"They immediately lose server-admin access. They keep their account and any nest/collaborator roles granted separately. You can grant superadmin again later."})]}),ae&&e.jsxs(U,{variant:"destructive",children:[e.jsx(M,{className:"h-4 w-4"}),e.jsx(O,{children:ae})]}),e.jsxs(T,{children:[e.jsx(t,{variant:"outline",onClick:()=>z(null),disabled:G,children:"Cancel"}),e.jsx(t,{variant:"destructive",disabled:G,onClick:async()=>{if(j){se(!0),te(null);try{await Fe(j.email),z(null),await g()}catch(s){te(s.message)}finally{se(!1)}}},children:G?e.jsx(f,{className:"h-4 w-4 animate-spin"}):"Revoke"})]})]})})]})}function He({seedEmail:o,onClose:c,onCreated:d}){const[l,m]=a.useState(o||""),[h,A]=a.useState(!1),[x,I]=a.useState(null),R=async v=>{if(v.preventDefault(),!!l.trim()){A(!0),I(null);try{const w=await ze(l);d(l,w.temporary_password)}catch(w){I(w.message),A(!1)}}};return e.jsx(N,{open:!0,onOpenChange:c,children:e.jsxs(b,{className:"sm:max-w-[420px]",children:[e.jsxs(C,{children:[e.jsx(k,{children:"Add Teammate"}),e.jsx(S,{children:"Create a login for a teammate. They get a temporary password to sign in with, then can change it and create their own API key."})]}),e.jsxs("form",{onSubmit:R,className:"space-y-3",children:[x&&e.jsxs(U,{variant:"destructive",children:[e.jsx(M,{className:"h-4 w-4"}),e.jsx(O,{children:x})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(be,{children:"Email"}),e.jsx(ve,{type:"email",placeholder:"jane@acme.com",value:l,onChange:v=>m(v.target.value),required:!0,autoFocus:!0})]}),e.jsxs(T,{children:[e.jsx(t,{variant:"outline",type:"button",onClick:c,children:"Cancel"}),e.jsx(t,{type:"submit",disabled:h||!l.trim(),children:h?e.jsx(f,{className:"h-4 w-4 animate-spin"}):"Add teammate"})]})]})]})})}function Ke({email:o,password:c,onClose:d}){const[l,m]=a.useState(!1),h=async()=>{await Ne(c)&&(m(!0),setTimeout(()=>m(!1),1500))};return e.jsx(N,{open:!0,onOpenChange:d,children:e.jsxs(b,{className:"sm:max-w-[520px]",children:[e.jsxs(C,{children:[e.jsxs(k,{children:["Teammate added: ",o]}),e.jsxs(S,{children:["Send them this temporary password via Slack, email, or another secure channel. ",e.jsx("strong",{children:"It won't be shown again."})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(be,{className:"text-xs text-muted-foreground",children:"Temporary password"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 bg-muted px-3 py-2 rounded text-xs font-mono break-all",children:c}),e.jsx(t,{size:"sm",variant:"outline",onClick:h,children:l?e.jsx(we,{className:"h-3.5 w-3.5 text-green-600"}):e.jsx(ye,{className:"h-3.5 w-3.5"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-2",children:"They sign in at this server with their email + this password, then can change it under their account and create their own API key for Hootie, Claude Desktop, or the CLI."})]}),e.jsx(T,{children:e.jsx(t,{onClick:d,children:"Done"})})]})})}export{Je as default};
@@ -1,6 +0,0 @@
1
- import{c as e}from"./index-B5hLclEq.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const c=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],a=e("refresh-cw",c);export{a as R};
@@ -1 +0,0 @@
1
- import{r as n,j as p,s as H,c_ as Q,c$ as T,cM as ft,cO as ht,cW as mt,cR as pt,d0 as re,d1 as bt,d2 as ne,d3 as vt,cP as U,cS as F,d4 as gt,d5 as wt,cX as Me,C as St,d6 as xt,d7 as Y,d8 as Ct}from"./index-B5hLclEq.js";import{e as yt}from"./select-DrL0mpRN.js";const Et=n.forwardRef(({className:e,...r},t)=>p.jsx("textarea",{className:H("flex min-h-[82px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:t,...r}));Et.displayName="Textarea";var je=1,Rt=.9,kt=.8,Pt=.17,pe=.1,be=.999,At=.9999,It=.99,Tt=/[\\\/_+.#"@\[\(\{&]/,Nt=/[\\\/_+.#"@\[\(\{&]/g,jt=/[\s-]/,Oe=/[\s-]/g;function ge(e,r,t,a,o,l,s){if(l===r.length)return o===e.length?je:It;var i=`${o},${l}`;if(s[i]!==void 0)return s[i];for(var u=a.charAt(l),d=t.indexOf(u,o),f=0,h,m,v,S;d>=0;)h=ge(e,r,t,a,d+1,l+1,s),h>f&&(d===o?h*=je:Tt.test(e.charAt(d-1))?(h*=kt,v=e.slice(o,d-1).match(Nt),v&&o>0&&(h*=Math.pow(be,v.length))):jt.test(e.charAt(d-1))?(h*=Rt,S=e.slice(o,d-1).match(Oe),S&&o>0&&(h*=Math.pow(be,S.length))):(h*=Pt,o>0&&(h*=Math.pow(be,d-o))),e.charAt(d)!==r.charAt(l)&&(h*=At)),(h<pe&&t.charAt(d-1)===a.charAt(l+1)||a.charAt(l+1)===a.charAt(l)&&t.charAt(d-1)!==a.charAt(l))&&(m=ge(e,r,t,a,d+1,l+2,s),m*pe>h&&(h=m*pe)),h>f&&(f=h),d=t.indexOf(u,d+1);return s[i]=f,f}function _e(e){return e.toLowerCase().replace(Oe," ")}function _t(e,r,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,ge(e,r,_e(e),_e(r),0,0,{})}var te='[cmdk-group=""]',ve='[cmdk-group-items=""]',Lt='[cmdk-group-heading=""]',He='[cmdk-item=""]',Le=`${He}:not([aria-disabled="true"])`,we="cmdk-item-select",G="data-value",Dt=(e,r,t)=>_t(e,r,t),We=n.createContext(void 0),oe=()=>n.useContext(We),ze=n.createContext(void 0),Se=()=>n.useContext(ze),Be=n.createContext(void 0),Fe=n.forwardRef((e,r)=>{let t=J(()=>{var c,g;return{search:"",value:(g=(c=e.value)!=null?c:e.defaultValue)!=null?g:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=J(()=>new Set),o=J(()=>new Map),l=J(()=>new Map),s=J(()=>new Set),i=Xe(e),{label:u,children:d,value:f,onValueChange:h,filter:m,shouldFilter:v,loop:S,disablePointerSelection:I=!1,vimBindings:A=!0,...y}=e,R=Q(),W=Q(),M=Q(),N=n.useRef(null),x=Ut();q(()=>{if(f!==void 0){let c=f.trim();t.current.value=c,k.emit()}},[f]),q(()=>{x(6,Pe)},[]);let k=n.useMemo(()=>({subscribe:c=>(s.current.add(c),()=>s.current.delete(c)),snapshot:()=>t.current,setState:(c,g,w)=>{var b,C,E,D;if(!Object.is(t.current[c],g)){if(t.current[c]=g,c==="search")le(),j(),x(1,z);else if(c==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let _=document.getElementById(M);_?_.focus():(b=document.getElementById(R))==null||b.focus()}if(x(7,()=>{var _;t.current.selectedItemId=(_=K())==null?void 0:_.id,k.emit()}),w||x(5,Pe),((C=i.current)==null?void 0:C.value)!==void 0){let _=g??"";(D=(E=i.current).onValueChange)==null||D.call(E,_);return}}k.emit()}},emit:()=>{s.current.forEach(c=>c())}}),[]),X=n.useMemo(()=>({value:(c,g,w)=>{var b;g!==((b=l.current.get(c))==null?void 0:b.value)&&(l.current.set(c,{value:g,keywords:w}),t.current.filtered.items.set(c,P(g,w)),x(2,()=>{j(),k.emit()}))},item:(c,g)=>(a.current.add(c),g&&(o.current.has(g)?o.current.get(g).add(c):o.current.set(g,new Set([c]))),x(3,()=>{le(),j(),t.current.value||z(),k.emit()}),()=>{l.current.delete(c),a.current.delete(c),t.current.filtered.items.delete(c);let w=K();x(4,()=>{le(),(w==null?void 0:w.getAttribute("id"))===c&&z(),k.emit()})}),group:c=>(o.current.has(c)||o.current.set(c,new Set),()=>{l.current.delete(c),o.current.delete(c)}),filter:()=>i.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:R,inputId:M,labelId:W,listInnerRef:N}),[]);function P(c,g){var w,b;let C=(b=(w=i.current)==null?void 0:w.filter)!=null?b:Dt;return c?C(c,t.current.search,g):0}function j(){if(!t.current.search||i.current.shouldFilter===!1)return;let c=t.current.filtered.items,g=[];t.current.filtered.groups.forEach(b=>{let C=o.current.get(b),E=0;C.forEach(D=>{let _=c.get(D);E=Math.max(_,E)}),g.push([b,E])});let w=N.current;ee().sort((b,C)=>{var E,D;let _=b.getAttribute("id"),ae=C.getAttribute("id");return((E=c.get(ae))!=null?E:0)-((D=c.get(_))!=null?D:0)}).forEach(b=>{let C=b.closest(ve);C?C.appendChild(b.parentElement===C?b:b.closest(`${ve} > *`)):w.appendChild(b.parentElement===w?b:b.closest(`${ve} > *`))}),g.sort((b,C)=>C[1]-b[1]).forEach(b=>{var C;let E=(C=N.current)==null?void 0:C.querySelector(`${te}[${G}="${encodeURIComponent(b[0])}"]`);E==null||E.parentElement.appendChild(E)})}function z(){let c=ee().find(w=>w.getAttribute("aria-disabled")!=="true"),g=c==null?void 0:c.getAttribute(G);k.setState("value",g||void 0)}function le(){var c,g,w,b;if(!t.current.search||i.current.shouldFilter===!1){t.current.filtered.count=a.current.size;return}t.current.filtered.groups=new Set;let C=0;for(let E of a.current){let D=(g=(c=l.current.get(E))==null?void 0:c.value)!=null?g:"",_=(b=(w=l.current.get(E))==null?void 0:w.keywords)!=null?b:[],ae=P(D,_);t.current.filtered.items.set(E,ae),ae>0&&C++}for(let[E,D]of o.current)for(let _ of D)if(t.current.filtered.items.get(_)>0){t.current.filtered.groups.add(E);break}t.current.filtered.count=C}function Pe(){var c,g,w;let b=K();b&&(((c=b.parentElement)==null?void 0:c.firstChild)===b&&((w=(g=b.closest(te))==null?void 0:g.querySelector(Lt))==null||w.scrollIntoView({block:"nearest"})),b.scrollIntoView({block:"nearest"}))}function K(){var c;return(c=N.current)==null?void 0:c.querySelector(`${He}[aria-selected="true"]`)}function ee(){var c;return Array.from(((c=N.current)==null?void 0:c.querySelectorAll(Le))||[])}function he(c){let g=ee()[c];g&&k.setState("value",g.getAttribute(G))}function me(c){var g;let w=K(),b=ee(),C=b.findIndex(D=>D===w),E=b[C+c];(g=i.current)!=null&&g.loop&&(E=C+c<0?b[b.length-1]:C+c===b.length?b[0]:b[C+c]),E&&k.setState("value",E.getAttribute(G))}function Ae(c){let g=K(),w=g==null?void 0:g.closest(te),b;for(;w&&!b;)w=c>0?$t(w,te):Vt(w,te),b=w==null?void 0:w.querySelector(Le);b?k.setState("value",b.getAttribute(G)):me(c)}let Ie=()=>he(ee().length-1),Te=c=>{c.preventDefault(),c.metaKey?Ie():c.altKey?Ae(1):me(1)},Ne=c=>{c.preventDefault(),c.metaKey?he(0):c.altKey?Ae(-1):me(-1)};return n.createElement(T.div,{ref:r,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:c=>{var g;(g=y.onKeyDown)==null||g.call(y,c);let w=c.nativeEvent.isComposing||c.keyCode===229;if(!(c.defaultPrevented||w))switch(c.key){case"n":case"j":{A&&c.ctrlKey&&Te(c);break}case"ArrowDown":{Te(c);break}case"p":case"k":{A&&c.ctrlKey&&Ne(c);break}case"ArrowUp":{Ne(c);break}case"Home":{c.preventDefault(),he(0);break}case"End":{c.preventDefault(),Ie();break}case"Enter":{c.preventDefault();let b=K();if(b){let C=new Event(we);b.dispatchEvent(C)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:X.inputId,id:X.labelId,style:qt},u),ie(e,c=>n.createElement(ze.Provider,{value:k},n.createElement(We.Provider,{value:X},c))))}),Mt=n.forwardRef((e,r)=>{var t,a;let o=Q(),l=n.useRef(null),s=n.useContext(Be),i=oe(),u=Xe(e),d=(a=(t=u.current)==null?void 0:t.forceMount)!=null?a:s==null?void 0:s.forceMount;q(()=>{if(!d)return i.item(o,s==null?void 0:s.id)},[d]);let f=$e(o,l,[e.value,e.children,l],e.keywords),h=Se(),m=V(x=>x.value&&x.value===f.current),v=V(x=>d||i.filter()===!1?!0:x.search?x.filtered.items.get(o)>0:!0);n.useEffect(()=>{let x=l.current;if(!(!x||e.disabled))return x.addEventListener(we,S),()=>x.removeEventListener(we,S)},[v,e.onSelect,e.disabled]);function S(){var x,k;I(),(k=(x=u.current).onSelect)==null||k.call(x,f.current)}function I(){h.setState("value",f.current,!0)}if(!v)return null;let{disabled:A,value:y,onSelect:R,forceMount:W,keywords:M,...N}=e;return n.createElement(T.div,{ref:re(l,r),...N,id:o,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!m,"data-disabled":!!A,"data-selected":!!m,onPointerMove:A||i.getDisablePointerSelection()?void 0:I,onClick:A?void 0:S},e.children)}),Ot=n.forwardRef((e,r)=>{let{heading:t,children:a,forceMount:o,...l}=e,s=Q(),i=n.useRef(null),u=n.useRef(null),d=Q(),f=oe(),h=V(v=>o||f.filter()===!1?!0:v.search?v.filtered.groups.has(s):!0);q(()=>f.group(s),[]),$e(s,i,[e.value,e.heading,u]);let m=n.useMemo(()=>({id:s,forceMount:o}),[o]);return n.createElement(T.div,{ref:re(i,r),...l,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},t&&n.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},t),ie(e,v=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?d:void 0},n.createElement(Be.Provider,{value:m},v))))}),Ht=n.forwardRef((e,r)=>{let{alwaysRender:t,...a}=e,o=n.useRef(null),l=V(s=>!s.search);return!t&&!l?null:n.createElement(T.div,{ref:re(o,r),...a,"cmdk-separator":"",role:"separator"})}),Wt=n.forwardRef((e,r)=>{let{onValueChange:t,...a}=e,o=e.value!=null,l=Se(),s=V(d=>d.search),i=V(d=>d.selectedItemId),u=oe();return n.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),n.createElement(T.input,{ref:r,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":i,id:u.inputId,type:"text",value:o?e.value:s,onChange:d=>{o||l.setState("search",d.target.value),t==null||t(d.target.value)}})}),zt=n.forwardRef((e,r)=>{let{children:t,label:a="Suggestions",...o}=e,l=n.useRef(null),s=n.useRef(null),i=V(d=>d.selectedItemId),u=oe();return n.useEffect(()=>{if(s.current&&l.current){let d=s.current,f=l.current,h,m=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let v=d.offsetHeight;f.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return m.observe(d),()=>{cancelAnimationFrame(h),m.unobserve(d)}}},[]),n.createElement(T.div,{ref:re(l,r),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":a,id:u.listId},ie(e,d=>n.createElement("div",{ref:re(s,u.listInnerRef),"cmdk-list-sizer":""},d)))}),Bt=n.forwardRef((e,r)=>{let{open:t,onOpenChange:a,overlayClassName:o,contentClassName:l,container:s,...i}=e;return n.createElement(ft,{open:t,onOpenChange:a},n.createElement(ht,{container:s},n.createElement(mt,{"cmdk-overlay":"",className:o}),n.createElement(pt,{"aria-label":e.label,"cmdk-dialog":"",className:l},n.createElement(Fe,{ref:r,...i}))))}),Ft=n.forwardRef((e,r)=>V(t=>t.filtered.count===0)?n.createElement(T.div,{ref:r,...e,"cmdk-empty":"",role:"presentation"}):null),Xt=n.forwardRef((e,r)=>{let{progress:t,children:a,label:o="Loading...",...l}=e;return n.createElement(T.div,{ref:r,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},ie(e,s=>n.createElement("div",{"aria-hidden":!0},s)))}),L=Object.assign(Fe,{List:zt,Item:Mt,Input:Wt,Group:Ot,Separator:Ht,Dialog:Bt,Empty:Ft,Loading:Xt});function $t(e,r){let t=e.nextElementSibling;for(;t;){if(t.matches(r))return t;t=t.nextElementSibling}}function Vt(e,r){let t=e.previousElementSibling;for(;t;){if(t.matches(r))return t;t=t.previousElementSibling}}function Xe(e){let r=n.useRef(e);return q(()=>{r.current=e}),r}var q=typeof window>"u"?n.useEffect:n.useLayoutEffect;function J(e){let r=n.useRef();return r.current===void 0&&(r.current=e()),r}function V(e){let r=Se(),t=()=>e(r.snapshot());return n.useSyncExternalStore(r.subscribe,t,t)}function $e(e,r,t,a=[]){let o=n.useRef(),l=oe();return q(()=>{var s;let i=(()=>{var d;for(let f of t){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(d=f.current.textContent)==null?void 0:d.trim():o.current}})(),u=a.map(d=>d.trim());l.value(e,i,u),(s=r.current)==null||s.setAttribute(G,i),o.current=i}),o}var Ut=()=>{let[e,r]=n.useState(),t=J(()=>new Map);return q(()=>{t.current.forEach(a=>a()),t.current=new Map},[e]),(a,o)=>{t.current.set(a,o),r({})}};function Yt(e){let r=e.type;return typeof r=="function"?r(e.props):"render"in r?r.render(e.props):e}function ie({asChild:e,children:r},t){return e&&n.isValidElement(r)?n.cloneElement(Yt(r),{ref:r.ref},t(r.props.children)):t(r)}var qt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Kt=n.forwardRef(({className:e,...r},t)=>p.jsx(L,{ref:t,className:H("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));Kt.displayName=L.displayName;const Gt=n.forwardRef(({className:e,...r},t)=>p.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[p.jsx(bt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),p.jsx(L.Input,{ref:t,className:H("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));Gt.displayName=L.Input.displayName;const Jt=n.forwardRef(({className:e,...r},t)=>p.jsx(L.List,{ref:t,className:H("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));Jt.displayName=L.List.displayName;const Qt=n.forwardRef((e,r)=>p.jsx(L.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));Qt.displayName=L.Empty.displayName;const Zt=n.forwardRef(({className:e,...r},t)=>p.jsx(L.Group,{ref:t,className:H("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));Zt.displayName=L.Group.displayName;const er=n.forwardRef(({className:e,...r},t)=>p.jsx(L.Separator,{ref:t,className:H("-mx-1 h-px bg-border",e),...r}));er.displayName=L.Separator.displayName;const tr=n.forwardRef(({className:e,...r},t)=>p.jsx(L.Item,{ref:t,className:H("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...r}));tr.displayName=L.Item.displayName;var de="Checkbox",[rr]=Me(de),[nr,xe]=rr(de);function or(e){const{__scopeCheckbox:r,checked:t,children:a,defaultChecked:o,disabled:l,form:s,name:i,onCheckedChange:u,required:d,value:f="on",internal_do_not_use_render:h}=e,[m,v]=vt({prop:t,defaultProp:o??!1,onChange:u,caller:de}),[S,I]=n.useState(null),[A,y]=n.useState(null),R=n.useRef(!1),W=S?!!s||!!S.closest("form"):!0,M={checked:m,disabled:l,setChecked:v,control:S,setControl:I,name:i,form:s,value:f,hasConsumerStoppedPropagationRef:R,required:d,defaultChecked:$(o)?!1:o,isFormControl:W,bubbleInput:A,setBubbleInput:y};return p.jsx(nr,{scope:r,...M,children:lr(h)?h(M):a})}var Ve="CheckboxTrigger",Ue=n.forwardRef(({__scopeCheckbox:e,onKeyDown:r,onClick:t,...a},o)=>{const{control:l,value:s,disabled:i,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,isFormControl:v,bubbleInput:S}=xe(Ve,e),I=U(o,f),A=n.useRef(u);return n.useEffect(()=>{const y=l==null?void 0:l.form;if(y){const R=()=>h(A.current);return y.addEventListener("reset",R),()=>y.removeEventListener("reset",R)}},[l,h]),p.jsx(T.button,{type:"button",role:"checkbox","aria-checked":$(u)?"mixed":u,"aria-required":d,"data-state":Je(u),"data-disabled":i?"":void 0,disabled:i,value:s,...a,ref:I,onKeyDown:F(r,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:F(t,y=>{h(R=>$(R)?!0:!R),S&&v&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})})});Ue.displayName=Ve;var Ce=n.forwardRef((e,r)=>{const{__scopeCheckbox:t,name:a,checked:o,defaultChecked:l,required:s,disabled:i,value:u,onCheckedChange:d,form:f,...h}=e;return p.jsx(or,{__scopeCheckbox:t,checked:o,defaultChecked:l,disabled:i,required:s,onCheckedChange:d,name:a,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>p.jsxs(p.Fragment,{children:[p.jsx(Ue,{...h,ref:r,__scopeCheckbox:t}),m&&p.jsx(Ge,{__scopeCheckbox:t})]})})});Ce.displayName=de;var Ye="CheckboxIndicator",qe=n.forwardRef((e,r)=>{const{__scopeCheckbox:t,forceMount:a,...o}=e,l=xe(Ye,t);return p.jsx(ne,{present:a||$(l.checked)||l.checked===!0,children:p.jsx(T.span,{"data-state":Je(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:r,style:{pointerEvents:"none",...e.style}})})});qe.displayName=Ye;var Ke="CheckboxBubbleInput",Ge=n.forwardRef(({__scopeCheckbox:e,...r},t)=>{const{control:a,hasConsumerStoppedPropagationRef:o,checked:l,defaultChecked:s,required:i,disabled:u,name:d,value:f,form:h,bubbleInput:m,setBubbleInput:v}=xe(Ke,e),S=U(t,v),I=gt(l),A=wt(a);n.useEffect(()=>{const R=m;if(!R)return;const W=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(W,"checked").set,x=!o.current;if(I!==l&&N){const k=new Event("click",{bubbles:x});R.indeterminate=$(l),N.call(R,$(l)?!1:l),R.dispatchEvent(k)}},[m,I,l,o]);const y=n.useRef($(l)?!1:l);return p.jsx(T.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??y.current,required:i,disabled:u,name:d,value:f,form:h,...r,tabIndex:-1,ref:S,style:{...r.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ge.displayName=Ke;function lr(e){return typeof e=="function"}function $(e){return e==="indeterminate"}function Je(e){return $(e)?"indeterminate":e?"checked":"unchecked"}const ar=n.forwardRef(({className:e,...r},t)=>p.jsx(Ce,{ref:t,className:H("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...r,children:p.jsx(qe,{className:H("flex items-center justify-center text-current"),children:p.jsx(St,{className:"h-4 w-4"})})}));ar.displayName=Ce.displayName;function sr(e,r){return n.useReducer((t,a)=>r[t][a]??t,e)}var ye="ScrollArea",[Qe]=Me(ye),[cr,O]=Qe(ye),Ze=n.forwardRef((e,r)=>{const{__scopeScrollArea:t,type:a="hover",dir:o,scrollHideDelay:l=600,...s}=e,[i,u]=n.useState(null),[d,f]=n.useState(null),[h,m]=n.useState(null),[v,S]=n.useState(null),[I,A]=n.useState(null),[y,R]=n.useState(0),[W,M]=n.useState(0),[N,x]=n.useState(!1),[k,X]=n.useState(!1),P=U(r,z=>u(z)),j=xt(o);return p.jsx(cr,{scope:t,type:a,dir:j,scrollHideDelay:l,scrollArea:i,viewport:d,onViewportChange:f,content:h,onContentChange:m,scrollbarX:v,onScrollbarXChange:S,scrollbarXEnabled:N,onScrollbarXEnabledChange:x,scrollbarY:I,onScrollbarYChange:A,scrollbarYEnabled:k,onScrollbarYEnabledChange:X,onCornerWidthChange:R,onCornerHeightChange:M,children:p.jsx(T.div,{dir:j,...s,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":W+"px",...e.style}})})});Ze.displayName=ye;var et="ScrollAreaViewport",tt=n.forwardRef((e,r)=>{const{__scopeScrollArea:t,children:a,nonce:o,...l}=e,s=O(et,t),i=n.useRef(null),u=U(r,i,s.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),p.jsx(T.div,{"data-radix-scroll-area-viewport":"",...l,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});tt.displayName=et;var B="ScrollAreaScrollbar",Ee=n.forwardRef((e,r)=>{const{forceMount:t,...a}=e,o=O(B,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return n.useEffect(()=>(i?l(!0):s(!0),()=>{i?l(!1):s(!1)}),[i,l,s]),o.type==="hover"?p.jsx(ir,{...a,ref:r,forceMount:t}):o.type==="scroll"?p.jsx(dr,{...a,ref:r,forceMount:t}):o.type==="auto"?p.jsx(rt,{...a,ref:r,forceMount:t}):o.type==="always"?p.jsx(Re,{...a,ref:r}):null});Ee.displayName=B;var ir=n.forwardRef((e,r)=>{const{forceMount:t,...a}=e,o=O(B,e.__scopeScrollArea),[l,s]=n.useState(!1);return n.useEffect(()=>{const i=o.scrollArea;let u=0;if(i){const d=()=>{window.clearTimeout(u),s(!0)},f=()=>{u=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",d),i.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),i.removeEventListener("pointerenter",d),i.removeEventListener("pointerleave",f)}}},[o.scrollArea,o.scrollHideDelay]),p.jsx(ne,{present:t||l,children:p.jsx(rt,{"data-state":l?"visible":"hidden",...a,ref:r})})}),dr=n.forwardRef((e,r)=>{const{forceMount:t,...a}=e,o=O(B,e.__scopeScrollArea),l=e.orientation==="horizontal",s=fe(()=>u("SCROLL_END"),100),[i,u]=sr("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return n.useEffect(()=>{if(i==="idle"){const d=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[i,o.scrollHideDelay,u]),n.useEffect(()=>{const d=o.viewport,f=l?"scrollLeft":"scrollTop";if(d){let h=d[f];const m=()=>{const v=d[f];h!==v&&(u("SCROLL"),s()),h=v};return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[o.viewport,l,u,s]),p.jsx(ne,{present:t||i!=="hidden",children:p.jsx(Re,{"data-state":i==="hidden"?"hidden":"visible",...a,ref:r,onPointerEnter:F(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:F(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),rt=n.forwardRef((e,r)=>{const t=O(B,e.__scopeScrollArea),{forceMount:a,...o}=e,[l,s]=n.useState(!1),i=e.orientation==="horizontal",u=fe(()=>{if(t.viewport){const d=t.viewport.offsetWidth<t.viewport.scrollWidth,f=t.viewport.offsetHeight<t.viewport.scrollHeight;s(i?d:f)}},10);return Z(t.viewport,u),Z(t.content,u),p.jsx(ne,{present:a||l,children:p.jsx(Re,{"data-state":l?"visible":"hidden",...o,ref:r})})}),Re=n.forwardRef((e,r)=>{const{orientation:t="vertical",...a}=e,o=O(B,e.__scopeScrollArea),l=n.useRef(null),s=n.useRef(0),[i,u]=n.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=st(i.viewport,i.content),f={...a,sizes:i,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>l.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function h(m,v){return br(m,s.current,i,v)}return t==="horizontal"?p.jsx(ur,{...f,ref:r,onThumbPositionChange:()=>{if(o.viewport&&l.current){const m=o.viewport.scrollLeft,v=De(m,i,o.dir);l.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=h(m,o.dir))}}):t==="vertical"?p.jsx(fr,{...f,ref:r,onThumbPositionChange:()=>{if(o.viewport&&l.current){const m=o.viewport.scrollTop,v=De(m,i);l.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=h(m))}}):null}),ur=n.forwardRef((e,r)=>{const{sizes:t,onSizesChange:a,...o}=e,l=O(B,e.__scopeScrollArea),[s,i]=n.useState(),u=n.useRef(null),d=U(r,u,l.onScrollbarXChange);return n.useEffect(()=>{u.current&&i(getComputedStyle(u.current))},[u]),p.jsx(ot,{"data-orientation":"horizontal",...o,ref:d,sizes:t,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ue(t)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(l.viewport){const m=l.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),it(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&l.viewport&&s&&a({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:ce(s.paddingLeft),paddingEnd:ce(s.paddingRight)}})}})}),fr=n.forwardRef((e,r)=>{const{sizes:t,onSizesChange:a,...o}=e,l=O(B,e.__scopeScrollArea),[s,i]=n.useState(),u=n.useRef(null),d=U(r,u,l.onScrollbarYChange);return n.useEffect(()=>{u.current&&i(getComputedStyle(u.current))},[u]),p.jsx(ot,{"data-orientation":"vertical",...o,ref:d,sizes:t,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ue(t)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(l.viewport){const m=l.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),it(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&l.viewport&&s&&a({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:ce(s.paddingTop),paddingEnd:ce(s.paddingBottom)}})}})}),[hr,nt]=Qe(B),ot=n.forwardRef((e,r)=>{const{__scopeScrollArea:t,sizes:a,hasThumb:o,onThumbChange:l,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:f,onResize:h,...m}=e,v=O(B,t),[S,I]=n.useState(null),A=U(r,P=>I(P)),y=n.useRef(null),R=n.useRef(""),W=v.viewport,M=a.content-a.viewport,N=Y(f),x=Y(u),k=fe(h,10);function X(P){if(y.current){const j=P.clientX-y.current.left,z=P.clientY-y.current.top;d({x:j,y:z})}}return n.useEffect(()=>{const P=j=>{const z=j.target;(S==null?void 0:S.contains(z))&&N(j,M)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[W,S,M,N]),n.useEffect(x,[a,x]),Z(S,k),Z(v.content,k),p.jsx(hr,{scope:t,scrollbar:S,hasThumb:o,onThumbChange:Y(l),onThumbPointerUp:Y(s),onThumbPositionChange:x,onThumbPointerDown:Y(i),children:p.jsx(T.div,{...m,ref:A,style:{position:"absolute",...m.style},onPointerDown:F(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),y.current=S.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),X(P))}),onPointerMove:F(e.onPointerMove,X),onPointerUp:F(e.onPointerUp,P=>{const j=P.target;j.hasPointerCapture(P.pointerId)&&j.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=R.current,v.viewport&&(v.viewport.style.scrollBehavior=""),y.current=null})})})}),se="ScrollAreaThumb",lt=n.forwardRef((e,r)=>{const{forceMount:t,...a}=e,o=nt(se,e.__scopeScrollArea);return p.jsx(ne,{present:t||o.hasThumb,children:p.jsx(mr,{ref:r,...a})})}),mr=n.forwardRef((e,r)=>{const{__scopeScrollArea:t,style:a,...o}=e,l=O(se,t),s=nt(se,t),{onThumbPositionChange:i}=s,u=U(r,h=>s.onThumbChange(h)),d=n.useRef(void 0),f=fe(()=>{d.current&&(d.current(),d.current=void 0)},100);return n.useEffect(()=>{const h=l.viewport;if(h){const m=()=>{if(f(),!d.current){const v=vr(h,i);d.current=v,i()}};return i(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[l.viewport,f,i]),p.jsx(T.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:F(e.onPointerDownCapture,h=>{const v=h.target.getBoundingClientRect(),S=h.clientX-v.left,I=h.clientY-v.top;s.onThumbPointerDown({x:S,y:I})}),onPointerUp:F(e.onPointerUp,s.onThumbPointerUp)})});lt.displayName=se;var ke="ScrollAreaCorner",at=n.forwardRef((e,r)=>{const t=O(ke,e.__scopeScrollArea),a=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&a?p.jsx(pr,{...e,ref:r}):null});at.displayName=ke;var pr=n.forwardRef((e,r)=>{const{__scopeScrollArea:t,...a}=e,o=O(ke,t),[l,s]=n.useState(0),[i,u]=n.useState(0),d=!!(l&&i);return Z(o.scrollbarX,()=>{var h;const f=((h=o.scrollbarX)==null?void 0:h.offsetHeight)||0;o.onCornerHeightChange(f),u(f)}),Z(o.scrollbarY,()=>{var h;const f=((h=o.scrollbarY)==null?void 0:h.offsetWidth)||0;o.onCornerWidthChange(f),s(f)}),d?p.jsx(T.div,{...a,ref:r,style:{width:l,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function ce(e){return e?parseInt(e,10):0}function st(e,r){const t=e/r;return isNaN(t)?0:t}function ue(e){const r=st(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-t)*r;return Math.max(a,18)}function br(e,r,t,a="ltr"){const o=ue(t),l=o/2,s=r||l,i=o-s,u=t.scrollbar.paddingStart+s,d=t.scrollbar.size-t.scrollbar.paddingEnd-i,f=t.content-t.viewport,h=a==="ltr"?[0,f]:[f*-1,0];return ct([u,d],h)(e)}function De(e,r,t="ltr"){const a=ue(r),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=r.scrollbar.size-o,s=r.content-r.viewport,i=l-a,u=t==="ltr"?[0,s]:[s*-1,0],d=yt(e,u);return ct([0,s],[0,i])(d)}function ct(e,r){return t=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const a=(r[1]-r[0])/(e[1]-e[0]);return r[0]+a*(t-e[0])}}function it(e,r){return e>0&&e<r}var vr=(e,r=()=>{})=>{let t={left:e.scrollLeft,top:e.scrollTop},a=0;return(function o(){const l={left:e.scrollLeft,top:e.scrollTop},s=t.left!==l.left,i=t.top!==l.top;(s||i)&&r(),t=l,a=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(a)};function fe(e,r){const t=Y(e),a=n.useRef(0);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),n.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(t,r)},[t,r])}function Z(e,r){const t=Y(r);Ct(()=>{let a=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(t)});return o.observe(e),()=>{window.cancelAnimationFrame(a),o.unobserve(e)}}},[e,t])}var dt=Ze,gr=tt,wr=at;const Sr=n.forwardRef(({className:e,children:r,...t},a)=>p.jsxs(dt,{ref:a,className:H("relative overflow-hidden",e),...t,children:[p.jsx(gr,{className:"h-full w-full rounded-[inherit] [&>div]:!block [&>div]:!min-w-0",children:r}),p.jsx(ut,{}),p.jsx(wr,{})]}));Sr.displayName=dt.displayName;const ut=n.forwardRef(({className:e,orientation:r="vertical",...t},a)=>p.jsx(Ee,{ref:a,orientation:r,className:H("flex touch-none select-none transition-colors",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...t,children:p.jsx(lt,{className:"relative flex-1 rounded-full bg-border"})}));ut.displayName=Ee.displayName;export{Kt as C,Sr as S,Et as T,Gt as a,Jt as b,Qt as c,Zt as d,tr as e,ar as f};
@@ -1 +0,0 @@
1
- @font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.47"}.katex .katex-mathml{border:0;clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}
@@ -1,6 +0,0 @@
1
- import{c as ht,r as n,j as l,d0 as gt,c$ as _,d6 as vt,d3 as Te,dk as St,c_ as Ie,cP as V,d8 as z,dm as Re,dG as xt,d4 as wt,dl as yt,cS as R,dn as Ct,c6 as Pe,cX as It,d7 as bt,dH as Tt,dI as Nt,dJ as Rt,dK as Pt,dp as Et,dq as _t,dr as jt,aj as Ee,s as G,C as Mt}from"./index-B5hLclEq.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const At=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ot=ht("chevron-up",At);function Ne(t,[o,e]){return Math.min(e,Math.max(o,t))}function Dt(t){const o=Lt(t),e=n.forwardRef((s,r)=>{const{children:d,...i}=s,a=n.Children.toArray(d),c=a.find(kt);if(c){const u=c.props.children,v=a.map(S=>S===c?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:S);return l.jsx(o,{...i,ref:r,children:n.isValidElement(u)?n.cloneElement(u,void 0,v):null})}return l.jsx(o,{...i,ref:r,children:d})});return e.displayName=`${t}.Slot`,e}function Lt(t){const o=n.forwardRef((e,s)=>{const{children:r,...d}=e;if(n.isValidElement(r)){const i=Ht(r),a=Bt(d,r.props);return r.type!==n.Fragment&&(a.ref=s?gt(s,i):i),n.cloneElement(r,a)}return n.Children.count(r)>1?n.Children.only(null):null});return o.displayName=`${t}.SlotClone`,o}var Vt=Symbol("radix.slottable");function kt(t){return n.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Vt}function Bt(t,o){const e={...o};for(const s in o){const r=t[s],d=o[s];/^on[A-Z]/.test(s)?r&&d?e[s]=(...a)=>{const c=d(...a);return r(...a),c}:r&&(e[s]=r):s==="style"?e[s]={...r,...d}:s==="className"&&(e[s]=[r,d].filter(Boolean).join(" "))}return{...t,...e}}function Ht(t){var s,r;let o=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,e=o&&"isReactWarning"in o&&o.isReactWarning;return e?t.ref:(o=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,e=o&&"isReactWarning"in o&&o.isReactWarning,e?t.props.ref:t.props.ref||t.ref)}var _e=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Wt="VisuallyHidden",je=n.forwardRef((t,o)=>l.jsx(_.span,{...t,ref:o,style:{..._e,...t.style}}));je.displayName=Wt;var Io=je,Ft=[" ","Enter","ArrowUp","ArrowDown"],Ut=[" ","Enter"],Q="Select",[ie,de,Kt]=xt(Q),[oe]=It(Q,[Kt,Re]),ue=Re(),[$t,Y]=oe(Q),[zt,Gt]=oe(Q),Me=t=>{const{__scopeSelect:o,children:e,open:s,defaultOpen:r,onOpenChange:d,value:i,defaultValue:a,onValueChange:c,dir:u,name:v,autoComplete:S,disabled:T,required:N,form:b}=t,p=ue(o),[g,y]=n.useState(null),[f,h]=n.useState(null),[M,A]=n.useState(!1),ne=vt(u),[P,D]=Te({prop:s,defaultProp:r??!1,onChange:d,caller:Q}),[U,X]=Te({prop:i,defaultProp:a,onChange:c,caller:Q}),k=n.useRef(null),B=g?b||!!g.closest("form"):!0,[K,H]=n.useState(new Set),W=Array.from(K).map(E=>E.props.value).join(";");return l.jsx(St,{...p,children:l.jsxs($t,{required:N,scope:o,trigger:g,onTriggerChange:y,valueNode:f,onValueNodeChange:h,valueNodeHasChildren:M,onValueNodeHasChildrenChange:A,contentId:Ie(),value:U,onValueChange:X,open:P,onOpenChange:D,dir:ne,triggerPointerDownPosRef:k,disabled:T,children:[l.jsx(ie.Provider,{scope:o,children:l.jsx(zt,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(E=>{H(L=>new Set(L).add(E))},[]),onNativeOptionRemove:n.useCallback(E=>{H(L=>{const F=new Set(L);return F.delete(E),F})},[]),children:e})}),B?l.jsxs(ot,{"aria-hidden":!0,required:N,tabIndex:-1,name:v,autoComplete:S,value:U,onChange:E=>X(E.target.value),disabled:T,form:b,children:[U===void 0?l.jsx("option",{value:""}):null,Array.from(K)]},W):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:s=!1,...r}=t,d=ue(e),i=Y(Ae,e),a=i.disabled||s,c=V(o,i.onTriggerChange),u=de(e),v=n.useRef("touch"),[S,T,N]=rt(p=>{const g=u().filter(h=>!h.disabled),y=g.find(h=>h.value===i.value),f=st(g,p,y);f!==void 0&&i.onValueChange(f.value)}),b=p=>{a||(i.onOpenChange(!0),N()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return l.jsx(yt,{asChild:!0,...d,children:l.jsx(_.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":nt(i.value)?"":void 0,...r,ref:c,onClick:R(r.onClick,p=>{p.currentTarget.focus(),v.current!=="mouse"&&b(p)}),onPointerDown:R(r.onPointerDown,p=>{v.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(b(p),p.preventDefault())}),onKeyDown:R(r.onKeyDown,p=>{const g=S.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&T(p.key),!(g&&p.key===" ")&&Ft.includes(p.key)&&(b(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",Le=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,children:d,placeholder:i="",...a}=t,c=Y(De,e),{onValueNodeHasChildrenChange:u}=c,v=d!==void 0,S=V(o,c.onValueNodeChange);return z(()=>{u(v)},[u,v]),l.jsx(_.span,{...a,ref:S,style:{pointerEvents:"none"},children:nt(c.value)?l.jsx(l.Fragment,{children:i}):d})});Le.displayName=De;var Yt="SelectIcon",Ve=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:s,...r}=t;return l.jsx(_.span,{"aria-hidden":!0,...r,ref:o,children:s||"▼"})});Ve.displayName=Yt;var qt="SelectPortal",ke=t=>l.jsx(Ct,{asChild:!0,...t});ke.displayName=qt;var ee="SelectContent",Be=n.forwardRef((t,o)=>{const e=Y(ee,t.__scopeSelect),[s,r]=n.useState();if(z(()=>{r(new DocumentFragment)},[]),!e.open){const d=s;return d?Pe.createPortal(l.jsx(He,{scope:t.__scopeSelect,children:l.jsx(ie.Slot,{scope:t.__scopeSelect,children:l.jsx("div",{children:t.children})})}),d):null}return l.jsx(We,{...t,ref:o})});Be.displayName=ee;var O=10,[He,q]=oe(ee),Xt="SelectContentImpl",Zt=Dt("SelectContent.RemoveScroll"),We=n.forwardRef((t,o)=>{const{__scopeSelect:e,position:s="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:d,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:v,arrowPadding:S,collisionBoundary:T,collisionPadding:N,sticky:b,hideWhenDetached:p,avoidCollisions:g,...y}=t,f=Y(ee,e),[h,M]=n.useState(null),[A,ne]=n.useState(null),P=V(o,m=>M(m)),[D,U]=n.useState(null),[X,k]=n.useState(null),B=de(e),[K,H]=n.useState(!1),W=n.useRef(!1);n.useEffect(()=>{if(h)return Tt(h)},[h]),Nt();const E=n.useCallback(m=>{const[I,...j]=B().map(w=>w.ref.current),[C]=j.slice(-1),x=document.activeElement;for(const w of m)if(w===x||(w==null||w.scrollIntoView({block:"nearest"}),w===I&&A&&(A.scrollTop=0),w===C&&A&&(A.scrollTop=A.scrollHeight),w==null||w.focus(),document.activeElement!==x))return},[B,A]),L=n.useCallback(()=>E([D,h]),[E,D,h]);n.useEffect(()=>{K&&L()},[K,L]);const{onOpenChange:F,triggerPointerDownPosRef:$}=f;n.useEffect(()=>{if(h){let m={x:0,y:0};const I=C=>{var x,w;m={x:Math.abs(Math.round(C.pageX)-(((x=$.current)==null?void 0:x.x)??0)),y:Math.abs(Math.round(C.pageY)-(((w=$.current)==null?void 0:w.y)??0))}},j=C=>{m.x<=10&&m.y<=10?C.preventDefault():h.contains(C.target)||F(!1),document.removeEventListener("pointermove",I),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",j,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",j,{capture:!0})}}},[h,F,$]),n.useEffect(()=>{const m=()=>F(!1);return window.addEventListener("blur",m),window.addEventListener("resize",m),()=>{window.removeEventListener("blur",m),window.removeEventListener("resize",m)}},[F]);const[pe,ae]=rt(m=>{const I=B().filter(x=>!x.disabled),j=I.find(x=>x.ref.current===document.activeElement),C=st(I,m,j);C&&setTimeout(()=>C.ref.current.focus())}),fe=n.useCallback((m,I,j)=>{const C=!W.current&&!j;(f.value!==void 0&&f.value===I||C)&&(U(m),C&&(W.current=!0))},[f.value]),me=n.useCallback(()=>h==null?void 0:h.focus(),[h]),te=n.useCallback((m,I,j)=>{const C=!W.current&&!j;(f.value!==void 0&&f.value===I||C)&&k(m)},[f.value]),le=s==="popper"?Se:Fe,re=le===Se?{side:a,sideOffset:c,align:u,alignOffset:v,arrowPadding:S,collisionBoundary:T,collisionPadding:N,sticky:b,hideWhenDetached:p,avoidCollisions:g}:{};return l.jsx(He,{scope:e,content:h,viewport:A,onViewportChange:ne,itemRefCallback:fe,selectedItem:D,onItemLeave:me,itemTextRefCallback:te,focusSelectedItem:L,selectedItemText:X,position:s,isPositioned:K,searchRef:pe,children:l.jsx(Rt,{as:Zt,allowPinchZoom:!0,children:l.jsx(Pt,{asChild:!0,trapped:f.open,onMountAutoFocus:m=>{m.preventDefault()},onUnmountAutoFocus:R(r,m=>{var I;(I=f.trigger)==null||I.focus({preventScroll:!0}),m.preventDefault()}),children:l.jsx(Et,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:i,onFocusOutside:m=>m.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:l.jsx(le,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:m=>m.preventDefault(),...y,...re,onPlaced:()=>H(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:R(y.onKeyDown,m=>{const I=m.ctrlKey||m.altKey||m.metaKey;if(m.key==="Tab"&&m.preventDefault(),!I&&m.key.length===1&&ae(m.key),["ArrowUp","ArrowDown","Home","End"].includes(m.key)){let C=B().filter(x=>!x.disabled).map(x=>x.ref.current);if(["ArrowUp","End"].includes(m.key)&&(C=C.slice().reverse()),["ArrowUp","ArrowDown"].includes(m.key)){const x=m.target,w=C.indexOf(x);C=C.slice(w+1)}setTimeout(()=>E(C)),m.preventDefault()}})})})})})})});We.displayName=Xt;var Jt="SelectItemAlignedPosition",Fe=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:s,...r}=t,d=Y(ee,e),i=q(ee,e),[a,c]=n.useState(null),[u,v]=n.useState(null),S=V(o,P=>v(P)),T=de(e),N=n.useRef(!1),b=n.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:f}=i,h=n.useCallback(()=>{if(d.trigger&&d.valueNode&&a&&u&&p&&g&&y){const P=d.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),U=d.valueNode.getBoundingClientRect(),X=y.getBoundingClientRect();if(d.dir!=="rtl"){const x=X.left-D.left,w=U.left-x,Z=P.left-w,J=P.width+Z,he=Math.max(J,D.width),ge=window.innerWidth-O,ve=Ne(w,[O,Math.max(O,ge-he)]);a.style.minWidth=J+"px",a.style.left=ve+"px"}else{const x=D.right-X.right,w=window.innerWidth-U.right-x,Z=window.innerWidth-P.right-w,J=P.width+Z,he=Math.max(J,D.width),ge=window.innerWidth-O,ve=Ne(w,[O,Math.max(O,ge-he)]);a.style.minWidth=J+"px",a.style.right=ve+"px"}const k=T(),B=window.innerHeight-O*2,K=p.scrollHeight,H=window.getComputedStyle(u),W=parseInt(H.borderTopWidth,10),E=parseInt(H.paddingTop,10),L=parseInt(H.borderBottomWidth,10),F=parseInt(H.paddingBottom,10),$=W+E+K+F+L,pe=Math.min(g.offsetHeight*5,$),ae=window.getComputedStyle(p),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-O,le=B-te,re=g.offsetHeight/2,m=g.offsetTop+re,I=W+E+m,j=$-I;if(I<=te){const x=k.length>0&&g===k[k.length-1].ref.current;a.style.bottom="0px";const w=u.clientHeight-p.offsetTop-p.offsetHeight,Z=Math.max(le,re+(x?me:0)+w+L),J=I+Z;a.style.height=J+"px"}else{const x=k.length>0&&g===k[0].ref.current;a.style.top="0px";const Z=Math.max(te,W+p.offsetTop+(x?fe:0)+re)+j;a.style.height=Z+"px",p.scrollTop=I-te+p.offsetTop}a.style.margin=`${O}px 0`,a.style.minHeight=pe+"px",a.style.maxHeight=B+"px",s==null||s(),requestAnimationFrame(()=>N.current=!0)}},[T,d.trigger,d.valueNode,a,u,p,g,y,d.dir,s]);z(()=>h(),[h]);const[M,A]=n.useState();z(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const ne=n.useCallback(P=>{P&&b.current===!0&&(h(),f==null||f(),b.current=!1)},[h,f]);return l.jsx(eo,{scope:e,contentWrapper:a,shouldExpandOnScrollRef:N,onScrollButtonChange:ne,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:l.jsx(_.div,{...r,ref:S,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Fe.displayName=Jt;var Qt="SelectPopperPosition",Se=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:s="start",collisionPadding:r=O,...d}=t,i=ue(e);return l.jsx(_t,{...i,...d,ref:o,align:s,collisionPadding:r,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Qt;var[eo,be]=oe(ee,{}),xe="SelectViewport",Ue=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:s,...r}=t,d=q(xe,e),i=be(xe,e),a=V(o,d.onViewportChange),c=n.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),l.jsx(ie.Slot,{scope:e,children:l.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:R(r.onScroll,u=>{const v=u.currentTarget,{contentWrapper:S,shouldExpandOnScrollRef:T}=i;if(T!=null&&T.current&&S){const N=Math.abs(c.current-v.scrollTop);if(N>0){const b=window.innerHeight-O*2,p=parseFloat(S.style.minHeight),g=parseFloat(S.style.height),y=Math.max(p,g);if(y<b){const f=y+N,h=Math.min(b,f),M=f-h;S.style.height=h+"px",S.style.bottom==="0px"&&(v.scrollTop=M>0?M:0,S.style.justifyContent="flex-end")}}}c.current=v.scrollTop})})})]})});Ue.displayName=xe;var Ke="SelectGroup",[to,oo]=oe(Ke),no=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=Ie();return l.jsx(to,{scope:e,id:r,children:l.jsx(_.div,{role:"group","aria-labelledby":r,...s,ref:o})})});no.displayName=Ke;var $e="SelectLabel",ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=oo($e,e);return l.jsx(_.div,{id:r.id,...s,ref:o})});ze.displayName=$e;var ce="SelectItem",[ro,Ge]=oe(ce),Ye=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:s,disabled:r=!1,textValue:d,...i}=t,a=Y(ce,e),c=q(ce,e),u=a.value===s,[v,S]=n.useState(d??""),[T,N]=n.useState(!1),b=V(o,f=>{var h;return(h=c.itemRefCallback)==null?void 0:h.call(c,f,s,r)}),p=Ie(),g=n.useRef("touch"),y=()=>{r||(a.onValueChange(s),a.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(ro,{scope:e,value:s,disabled:r,textId:p,isSelected:u,onItemTextChange:n.useCallback(f=>{S(h=>h||((f==null?void 0:f.textContent)??"").trim())},[]),children:l.jsx(ie.ItemSlot,{scope:e,value:s,disabled:r,textValue:v,children:l.jsx(_.div,{role:"option","aria-labelledby":p,"data-highlighted":T?"":void 0,"aria-selected":u&&T,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:b,onFocus:R(i.onFocus,()=>N(!0)),onBlur:R(i.onBlur,()=>N(!1)),onClick:R(i.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:R(i.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:R(i.onPointerDown,f=>{g.current=f.pointerType}),onPointerMove:R(i.onPointerMove,f=>{var h;g.current=f.pointerType,r?(h=c.onItemLeave)==null||h.call(c):g.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:R(i.onPointerLeave,f=>{var h;f.currentTarget===document.activeElement&&((h=c.onItemLeave)==null||h.call(c))}),onKeyDown:R(i.onKeyDown,f=>{var M;((M=c.searchRef)==null?void 0:M.current)!==""&&f.key===" "||(Ut.includes(f.key)&&y(),f.key===" "&&f.preventDefault())})})})})});Ye.displayName=ce;var se="SelectItemText",qe=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,...d}=t,i=Y(se,e),a=q(se,e),c=Ge(se,e),u=Gt(se,e),[v,S]=n.useState(null),T=V(o,y=>S(y),c.onItemTextChange,y=>{var f;return(f=a.itemTextRefCallback)==null?void 0:f.call(a,y,c.value,c.disabled)}),N=v==null?void 0:v.textContent,b=n.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:N},c.value),[c.disabled,c.value,N]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return z(()=>(p(b),()=>g(b)),[p,g,b]),l.jsxs(l.Fragment,{children:[l.jsx(_.span,{id:c.textId,...d,ref:T}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Pe.createPortal(d.children,i.valueNode):null]})});qe.displayName=se;var Xe="SelectItemIndicator",Ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return Ge(Xe,e).isSelected?l.jsx(_.span,{"aria-hidden":!0,...s,ref:o}):null});Ze.displayName=Xe;var we="SelectScrollUpButton",Je=n.forwardRef((t,o)=>{const e=q(we,t.__scopeSelect),s=be(we,t.__scopeSelect),[r,d]=n.useState(!1),i=V(o,s.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let a=function(){const u=c.scrollTop>0;d(u)};const c=e.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),r?l.jsx(et,{...t,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=e;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Je.displayName=we;var ye="SelectScrollDownButton",Qe=n.forwardRef((t,o)=>{const e=q(ye,t.__scopeSelect),s=be(ye,t.__scopeSelect),[r,d]=n.useState(!1),i=V(o,s.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,v=Math.ceil(c.scrollTop)<u;d(v)};const c=e.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),r?l.jsx(et,{...t,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=e;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Qe.displayName=ye;var et=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:s,...r}=t,d=q("SelectScrollButton",e),i=n.useRef(null),a=de(e),c=n.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),z(()=>{var v;const u=a().find(S=>S.ref.current===document.activeElement);(v=u==null?void 0:u.ref.current)==null||v.scrollIntoView({block:"nearest"})},[a]),l.jsx(_.div,{"aria-hidden":!0,...r,ref:o,style:{flexShrink:0,...r.style},onPointerDown:R(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(s,50))}),onPointerMove:R(r.onPointerMove,()=>{var u;(u=d.onItemLeave)==null||u.call(d),i.current===null&&(i.current=window.setInterval(s,50))}),onPointerLeave:R(r.onPointerLeave,()=>{c()})})}),so="SelectSeparator",tt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return l.jsx(_.div,{"aria-hidden":!0,...s,ref:o})});tt.displayName=so;var Ce="SelectArrow",ao=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=ue(e),d=Y(Ce,e),i=q(Ce,e);return d.open&&i.position==="popper"?l.jsx(jt,{...r,...s,ref:o}):null});ao.displayName=Ce;var lo="SelectBubbleInput",ot=n.forwardRef(({__scopeSelect:t,value:o,...e},s)=>{const r=n.useRef(null),d=V(s,r),i=wt(o);return n.useEffect(()=>{const a=r.current;if(!a)return;const c=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==o&&v){const S=new Event("change",{bubbles:!0});v.call(a,o),a.dispatchEvent(S)}},[i,o]),l.jsx(_.select,{...e,style:{..._e,...e.style},ref:d,defaultValue:o})});ot.displayName=lo;function nt(t){return t===""||t===void 0}function rt(t){const o=bt(t),e=n.useRef(""),s=n.useRef(0),r=n.useCallback(i=>{const a=e.current+i;o(a),(function c(u){e.current=u,window.clearTimeout(s.current),u!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(a)},[o]),d=n.useCallback(()=>{e.current="",window.clearTimeout(s.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(s.current),[]),[e,r,d]}function st(t,o,e){const r=o.length>1&&Array.from(o).every(u=>u===o[0])?o[0]:o,d=e?t.indexOf(e):-1;let i=co(t,Math.max(d,0));r.length===1&&(i=i.filter(u=>u!==e));const c=i.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==e?c:void 0}function co(t,o){return t.map((e,s)=>t[(o+s)%t.length])}var io=Me,at=Oe,uo=Le,po=Ve,fo=ke,lt=Be,mo=Ue,ct=ze,it=Ye,ho=qe,go=Ze,dt=Je,ut=Qe,pt=tt;const bo=io,To=uo,vo=n.forwardRef(({className:t,children:o,...e},s)=>l.jsxs(at,{ref:s,className:G("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...e,children:[o,l.jsx(po,{asChild:!0,children:l.jsx(Ee,{className:"h-4 w-4 opacity-50"})})]}));vo.displayName=at.displayName;const ft=n.forwardRef(({className:t,...o},e)=>l.jsx(dt,{ref:e,className:G("flex cursor-default items-center justify-center py-1",t),...o,children:l.jsx(Ot,{className:"h-4 w-4"})}));ft.displayName=dt.displayName;const mt=n.forwardRef(({className:t,...o},e)=>l.jsx(ut,{ref:e,className:G("flex cursor-default items-center justify-center py-1",t),...o,children:l.jsx(Ee,{className:"h-4 w-4"})}));mt.displayName=ut.displayName;const So=n.forwardRef(({className:t,children:o,position:e="popper",...s},r)=>l.jsx(fo,{children:l.jsxs(lt,{ref:r,className:G("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,...s,children:[l.jsx(ft,{}),l.jsx(mo,{className:G("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:o}),l.jsx(mt,{})]})}));So.displayName=lt.displayName;const xo=n.forwardRef(({className:t,...o},e)=>l.jsx(ct,{ref:e,className:G("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...o}));xo.displayName=ct.displayName;const wo=n.forwardRef(({className:t,children:o,...e},s)=>l.jsxs(it,{ref:s,className:G("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(go,{children:l.jsx(Mt,{className:"h-4 w-4"})})}),l.jsx(ho,{children:o})]}));wo.displayName=it.displayName;const yo=n.forwardRef(({className:t,...o},e)=>l.jsx(pt,{ref:e,className:G("-mx-1 my-1 h-px bg-muted",t),...o}));yo.displayName=pt.displayName;export{Ot as C,Io as R,bo as S,vo as a,To as b,So as c,wo as d,Ne as e,yo as f};
@@ -1,6 +0,0 @@
1
- import{c as e}from"./index-B5hLclEq.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const a=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],o=e("triangle-alert",a);export{o as T};