@snagset/server 0.1.59 → 0.1.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/integrations/trello.js +16 -0
- package/dist/integrations/trello.js.map +1 -1
- package/dist/routes/integrations.js +11 -1
- package/dist/routes/integrations.js.map +1 -1
- package/package.json +1 -1
- package/static/dashboard/assets/{CompositeItem-XBuzWv1L.js → CompositeItem-Cbbgho1I.js} +1 -1
- package/static/dashboard/assets/{CompositeList-C2IVT2Po.js → CompositeList-U-qk8UP6.js} +1 -1
- package/static/dashboard/assets/{ConfirmDialog-B9o4voIS.js → ConfirmDialog-_B1eNA1i.js} +1 -1
- package/static/dashboard/assets/{CopyButton-DLU4a9od.js → CopyButton-CIoiqDbz.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-CM5jeOco.js → FieldItemContext-DrmapX6T.js} +1 -1
- package/static/dashboard/assets/{InstallTag-CZO85i-P.js → InstallTag-C4m3dgQN.js} +1 -1
- package/static/dashboard/assets/{InstanceRows-D-tveODw.js → InstanceRows-Cu43MthB.js} +1 -1
- package/static/dashboard/assets/{McpTokens-DikOatOF.js → McpTokens-y9bU9w2F.js} +1 -1
- package/static/dashboard/assets/{Picker-lokRYiMC.js → Picker-0Wc1iFQj.js} +1 -1
- package/static/dashboard/assets/{SaveState-e4RnpJbD.js → SaveState-B4LwnOrc.js} +1 -1
- package/static/dashboard/assets/{_app-6KTAiiJs.js → _app-CQSx4Ud0.js} +1 -1
- package/static/dashboard/assets/{_app-Dqyx0uzh.js → _app-DL2c5AyL.js} +1 -1
- package/static/dashboard/assets/{activity-D87uMIpc.js → activity-CkDNq67c.js} +1 -1
- package/static/dashboard/assets/{arrow-left-Txus48to.js → arrow-left-kr0TdNCI.js} +1 -1
- package/static/dashboard/assets/{avatar-d0V38Rww.js → avatar-DQ2PBAkd.js} +1 -1
- package/static/dashboard/assets/{badge-BpJT5EUT.js → badge-5vfpTOMk.js} +1 -1
- package/static/dashboard/assets/{card-BqU7TCLe.js → card-DEnJVYTc.js} +1 -1
- package/static/dashboard/assets/{check-T8owKS6W.js → check-BhmdAbBD.js} +1 -1
- package/static/dashboard/assets/{chevron-down-CPxjYKx7.js → chevron-down-CkYqA6Tw.js} +1 -1
- package/static/dashboard/assets/{chevron-right-BOLW380q.js → chevron-right-BSOkA3zX.js} +1 -1
- package/static/dashboard/assets/{copy-D7ySfk8w.js → copy-DefIRiwo.js} +1 -1
- package/static/dashboard/assets/{createBaseUIEventDetails-D5nICp6F.js → createBaseUIEventDetails-BDbAfTsh.js} +1 -1
- package/static/dashboard/assets/{dialog-C8j9bKc9.js → dialog-Dsu0e02Q.js} +1 -1
- package/static/dashboard/assets/{dropdown-menu-7_qYsjof.js → dropdown-menu-BMaIF-mT.js} +1 -1
- package/static/dashboard/assets/{forgot-L_4h7Uc5.js → forgot-BuErlHeu.js} +1 -1
- package/static/dashboard/assets/{getPseudoElementBounds-r9s2Gh_c.js → getPseudoElementBounds-Df0qQn0E.js} +1 -1
- package/static/dashboard/assets/{image-off-DEk2KdgQ.js → image-off-_kTeT3Bb.js} +1 -1
- package/static/dashboard/assets/{index-DBw3b5Rd.js → index-B_3U6pyz.js} +3 -3
- package/static/dashboard/assets/{inertValue-DPJM1mgv.js → inertValue-Dl2ZzbZu.js} +1 -1
- package/static/dashboard/assets/{invite-BQzST24s.js → invite-DpmMNgTf.js} +1 -1
- package/static/dashboard/assets/{label-BqqDq1Bf.js → label-BPkAzYEe.js} +1 -1
- package/static/dashboard/assets/{layout-grid-BaI-ZaQt.js → layout-grid-CbZa6REW.js} +1 -1
- package/static/dashboard/assets/me-Ffh61LTY.js +1 -0
- package/static/dashboard/assets/{parts-Dh3j93KT.js → parts-BZnB0y34.js} +1 -1
- package/static/dashboard/assets/{plus-DLkZ3d4a.js → plus-CopH4JTI.js} +1 -1
- package/static/dashboard/assets/{reset-25I5KwzQ.js → reset-CYrrEwsu.js} +1 -1
- package/static/dashboard/assets/{s._site-AdxvCMDp.js → s._site-j6OX54re.js} +1 -1
- package/static/dashboard/assets/{s._site.comments-Bn8q0GfW.js → s._site.comments-Cgn2xgc5.js} +1 -1
- package/static/dashboard/assets/{s._site.reviewers-DhplEadn.js → s._site.reviewers-B_TpRGpR.js} +1 -1
- package/static/dashboard/assets/{s._site.settings-DkxPhD29.js → s._site.settings-CfenEkX3.js} +1 -1
- package/static/dashboard/assets/{setup-BT2ymvDA.js → setup-CXMNChwN.js} +1 -1
- package/static/dashboard/assets/{sign-in--bQ1djiP.js → sign-in-Cw4pIFDX.js} +1 -1
- package/static/dashboard/assets/{sign-up-Tosf460o.js → sign-up-CumNkOCM.js} +1 -1
- package/static/dashboard/assets/{sites-Bk7faXQx.js → sites-dYYYlsEx.js} +1 -1
- package/static/dashboard/assets/studio-BFe4RbS0.js +1 -0
- package/static/dashboard/assets/{studio-BXY-BYUr.js → studio-C-cl-Bid.js} +1 -1
- package/static/dashboard/assets/{studio.index-iCwNlbml.js → studio.index-Bpv89ttE.js} +1 -1
- package/static/dashboard/assets/studio.integrations-CEERZTjS.js +16 -0
- package/static/dashboard/assets/{studio.members-BnuODZjt.js → studio.members-Bmyx_q-i.js} +1 -1
- package/static/dashboard/assets/{studio.plan-B2BnZVlI.js → studio.plan-Chh-cjMh.js} +1 -1
- package/static/dashboard/assets/{sun-DZ77z3mK.js → sun-xwDuvNCi.js} +1 -1
- package/static/dashboard/assets/{switch-DNodWtiG.js → switch-9hlceDWy.js} +1 -1
- package/static/dashboard/assets/{table-_kCW8sw7.js → table-BtGHQI2k.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-CIrxFX1m.js → useAriaLabelledBy-x5XF8M1H.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-n1C4QVXL.js → useBaseQuery-BWQygP2V.js} +1 -1
- package/static/dashboard/assets/{useCompositeItem-YAQuEkY3.js → useCompositeItem-uwStRlwJ.js} +1 -1
- package/static/dashboard/assets/useQuery-HUEWFxW8.js +1 -0
- package/static/dashboard/assets/useRender-BMKPZM38.js +1 -0
- package/static/dashboard/assets/{useScrollLock-BPMFXP7l.js → useScrollLock-Bxg3WK_6.js} +1 -1
- package/static/dashboard/assets/{useValueChanged-w_Y86K5W.js → useValueChanged-B2j76Odc.js} +1 -1
- package/static/dashboard/assets/{users-ZI_E8YXB.js → users-CkVdOVuU.js} +1 -1
- package/static/dashboard/assets/{welcome-CBYYDde-.js → welcome-CSLvCL-G.js} +1 -1
- package/static/dashboard/assets/{widget-signin-Of2xQvu-.js → widget-signin-D2hoyT51.js} +1 -1
- package/static/dashboard/assets/{you-ey1-XO69.js → you-CzmFaW7t.js} +1 -1
- package/static/dashboard/assets/{zod-D8TwVQUn.js → zod-BqdlirRI.js} +1 -1
- package/static/dashboard/index.html +1 -1
- package/static/widget/build.json +2 -2
- package/static/widget/snag.js +1 -1
- package/static/widget/snag.runtime.js +1 -1
- package/static/dashboard/assets/me-BuXPSKyo.js +0 -1
- package/static/dashboard/assets/studio-C5_LeEu7.js +0 -1
- package/static/dashboard/assets/studio.integrations-25ah_0to.js +0 -16
- package/static/dashboard/assets/useQuery-rfvcXYjq.js +0 -1
- package/static/dashboard/assets/useRender-Rc2aDa9D.js +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{c as ie,d as le,r as i,a5 as L,s as C,a6 as B,a8 as A,j as e,B as b,C as Ie,h as Re,A as Ee,a9 as Ge,q as oe,L as re,t as Te,a2 as $e,$ as Qe}from"./index-B_3U6pyz.js";import{P as J}from"./Picker-0Wc1iFQj.js";import{u as ce}from"./useQuery-HUEWFxW8.js";import{B as Pe}from"./badge-5vfpTOMk.js";import{i as de,j as me,l as he,k as ue,m as pe,n as xe}from"./dialog-Dsu0e02Q.js";import{I as E,L as q}from"./label-BPkAzYEe.js";import{C as Ye}from"./ConfirmDialog-_B1eNA1i.js";import{A as Ve,P as Xe,a as Ze}from"./parts-BZnB0y34.js";import{u as Le}from"./me-Ffh61LTY.js";import{v as _}from"./useScrollLock-Bxg3WK_6.js";import{M as et}from"./McpTokens-y9bU9w2F.js";import{C as Fe}from"./CopyButton-CIoiqDbz.js";import{C as We}from"./check-BhmdAbBD.js";import"./chevron-down-CkYqA6Tw.js";import"./isElementDisabled-CwHw_lZC.js";import"./createBaseUIEventDetails-BDbAfTsh.js";import"./inertValue-Dl2ZzbZu.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-B2j76Odc.js";import"./getPseudoElementBounds-Df0qQn0E.js";import"./CompositeList-U-qk8UP6.js";import"./useBaseQuery-BWQygP2V.js";import"./useRender-BMKPZM38.js";import"./copy-DefIRiwo.js";import"./card-DEnJVYTc.js";import"./switch-9hlceDWy.js";import"./useAriaLabelledBy-x5XF8M1H.js";/**
|
|
2
|
+
* @license lucide-react v1.39.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 tt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],st=ie("circle-alert",tt);/**
|
|
7
|
+
* @license lucide-react v1.39.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const nt=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],at=ie("eye-off",nt);/**
|
|
12
|
+
* @license lucide-react v1.39.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const ot=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],rt=ie("eye",ot),_e="https://snagset.com/docs/integrations/",Oe={github:"Repository",linear:"Team",jira:"Project",trello:"Board"},ae="__new_board__",it=t=>`https://trello.com/1/authorize?expiration=never&scope=read,write&response_type=token&name=Snagset&key=${encodeURIComponent(t.trim())}`;function De(t){const r=u=>t.find(c=>u.test(c.label))?.value,l=r(/^(to ?do|backlog|open|new|inbox)/i)??t[0]?.value??"",o=r(/^(done|complete|resolved|shipped|fixed)/i)??t[t.length-1]?.value??"",m=r(/(doing|progress|review|working)/i)??t.find(u=>u.value!==l&&u.value!==o)?.value??"";return{open:l,progress:m,resolved:o}}function ge({id:t,value:r,onChange:l,placeholder:o}){const[m,u]=i.useState(!1);return e.jsxs("div",{className:"relative",children:[e.jsx(E,{id:t,type:m?"text":"password",placeholder:o,value:r,onChange:c=>l(c.target.value),autoComplete:"off",spellCheck:!1,className:"pr-9 font-mono text-[12.5px]"}),e.jsx("button",{type:"button",onClick:()=>u(c=>!c),"aria-label":m?"Hide":"Show","aria-pressed":m,className:"absolute inset-y-0 right-0 flex w-9 items-center justify-center rounded-r-md text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:m?e.jsx(at,{className:"size-4"}):e.jsx(rt,{className:"size-4"})})]})}function lt({at:t}){const r=["Access","Connect","Way back"];return e.jsx("ol",{className:"m-0 flex list-none items-center gap-2 p-0 text-[12px]","aria-label":"Steps",children:r.map((l,o)=>{const m=o+1;return e.jsxs("li",{"aria-current":m===t?"step":void 0,className:"flex items-center gap-2",children:[e.jsx("span",{className:Re("flex size-5 items-center justify-center rounded-full border text-[11px] tabular-nums",m<t&&"border-transparent bg-primary text-primary-foreground",m===t&&"border-primary text-foreground",m>t&&"border-border text-muted-foreground"),children:m<t?e.jsx(We,{className:"size-3"}):m}),e.jsx("span",{className:m===t?"font-medium text-foreground":"text-muted-foreground",children:l}),o<r.length-1&&e.jsx("span",{className:"h-px w-5 bg-border","aria-hidden":!0})]},l)})})}function P({id:t,label:r,hint:l,children:o}){return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{htmlFor:t,children:r}),o,l&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:l})]})}function ze({children:t}){return e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:t})}function F({href:t,children:r}){return e.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"font-medium text-foreground underline underline-offset-2",children:r})}const M=t=>t instanceof Ie?t.message:"Could not reach the server.";function ct({provider:t,jiraSite:r,trelloKey:l=""}){const o=t==="trello"?[e.jsxs(e.Fragment,{children:["Open ",e.jsx(F,{href:"https://trello.com/power-ups/admin",children:"Trello › Power-Ups admin"})," › New. Name it Snagset, any workspace, and tick that it does not use Power-Up capabilities. Skip the OAuth 2.0 page."]}),e.jsx(e.Fragment,{children:"Open its API key tab, generate a key, and paste the key below."}),e.jsxs(e.Fragment,{children:["On that same page, click the Token link beside the key",l.trim()?e.jsxs(e.Fragment,{children:[" ","(or ",e.jsx(F,{href:it(l),children:"this one"}),")"]}):null,": Allow, then copy the whole token (it starts ATTA) and paste it below."]})]:t==="github"?[e.jsxs(e.Fragment,{children:["Open ",e.jsx(F,{href:"https://github.com/settings/personal-access-tokens/new",children:"GitHub › Fine-grained tokens › Generate new token"}),"."]}),e.jsx(e.Fragment,{children:"Repository access: only the site's repository. Permissions › Issues: Read and write."}),e.jsx(e.Fragment,{children:"Generate, copy the token, paste it below."})]:t==="linear"?[e.jsxs(e.Fragment,{children:["Open ",e.jsx(F,{href:"https://linear.app/settings/account/security",children:"Linear › Settings › Security & access"}),"."]}),e.jsx(e.Fragment,{children:"Under Personal API keys, make a new key. It acts as you, so you must be in the team."}),e.jsx(e.Fragment,{children:"Copy the key, paste it below."})]:[e.jsxs(e.Fragment,{children:["Open ",e.jsx(F,{href:"https://id.atlassian.com/manage-profile/security/api-tokens",children:"Atlassian account › Security › API tokens"}),"."]}),e.jsx(e.Fragment,{children:'Create API token — the plain one, not "with scopes". Name it Snagset.'}),e.jsxs(e.Fragment,{children:["Copy it, paste it below with the email you sign in to ",r?r.replace(/^https?:\/\//,""):"Jira"," with."]})];return e.jsx("ol",{className:"m-0 flex list-decimal flex-col gap-1 pl-5 text-[13px] text-muted-foreground",children:o.map((m,u)=>e.jsx("li",{children:m},u))})}function Be({provider:t,site:r,shownSecret:l,target:o,onSecret:m}){const u=le(),c=`${location.origin}/api/v1/integrations/${t}/inbound`,[y]=i.useState(()=>Date.now()),[f,w]=i.useState(""),[g,v]=i.useState(""),[T,O]=i.useState(!1),[k,$]=i.useState(null),p=ce({...Ee.integrations(),refetchInterval:3e3}).data?.data.find(N=>N.site===r&&N.provider===t),h=L({mutationFn:N=>C.setWebhookSecret(r,t,N),onSuccess:N=>{v(""),w(""),O(!0),$(N.check??null),m(N.webhook.secret??null),u.invalidateQueries({queryKey:["integrations"]}),B.success(t==="linear"?"Signing secret saved":t==="trello"?"Secret saved":"New secret made — the old one has stopped working")},onError:N=>v(M(N))}),a=p?.lastDeliveryAt?Date.parse(p.lastDeliveryAt):0,d=p?.lastRefusedAt?Date.parse(p.lastRefusedAt):0,x=(t==="linear"||t==="trello")&&p&&!p.hasWebhookSecret?"nosecret":a?"ok":d?"refused":"waiting",n=x==="ok"&&d>a,R=t==="github"?"GitHub sends a test delivery the moment the webhook is saved.":t==="trello"?k?.sent?`Snagset made a check card on ${o.label} and deleted it again; Trello's delivery for it confirms the secret in a moment.`:k?`Snagset could not make its check card (${k.detail}). Move any card on ${o.label} to another list once instead.`:`Saving the secret makes a check card on ${o.label} and deletes it again; Trello's delivery for it confirms the secret.`:t==="linear"?`Then move any issue in ${o.label} to another status once.`:`Then move any issue in ${o.label} once.`;return e.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[g&&e.jsx(ze,{children:g}),e.jsx("ol",{className:"m-0 flex list-decimal flex-col gap-1 pl-5 text-[13px] text-muted-foreground",children:t==="github"?e.jsxs(e.Fragment,{children:[e.jsxs("li",{children:["Open"," ",e.jsx(F,{href:o.repo?`https://github.com/${o.repo}/settings/hooks/new`:"https://github.com",children:"the repository's Settings › Webhooks › Add webhook"}),"."]}),e.jsx("li",{children:"Paste the address and the secret below; content type application/json."}),e.jsx("li",{children:'"Let me select individual events" → tick Issues only. Add webhook.'})]}):t==="trello"?e.jsxs(e.Fragment,{children:[e.jsx("li",{children:p&&!p.webhookRegistered?`Snagset could not register the webhook on ${o.label}${o.trelloNote?`: ${o.trelloNote}`:""}. Trello must be able to reach this server's address; connect again once it can.`:`Snagset registered the webhook on ${o.label} for you: nothing to set up in Trello.`}),e.jsxs("li",{children:["Trello signs each delivery with your Power-Up's secret. Open ",e.jsx(F,{href:"https://trello.com/power-ups/admin",children:"Trello › Power-Ups admin"}),", your Power-Up's API key tab, and copy the Secret."]}),e.jsx("li",{children:"Paste it below."})]}):t==="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("li",{children:["Open ",e.jsx(F,{href:"https://linear.app/settings/api",children:"Linear › Settings › API"}),", then Webhooks › New webhook."]}),e.jsxs("li",{children:["Paste the address; pick the team ",o.label,"; under data change events tick Issues. Create."]}),e.jsx("li",{children:"Linear shows a signing secret: copy it and paste it below."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("li",{children:["Open"," ",e.jsx(F,{href:o.jiraSite?`${o.jiraSite}/plugins/servlet/webhooks`:"https://admin.atlassian.com",children:"Jira › Settings › System › WebHooks"})," ","› Create a WebHook. It needs a Jira admin."]}),e.jsx("li",{children:"Paste the address and the secret below."}),e.jsx("li",{children:"Under Issue, tick updated and deleted. Create."})]})}),e.jsxs("dl",{className:"m-0 grid grid-cols-[88px_minmax(0,1fr)] items-center gap-x-3 gap-y-2.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Address"}),e.jsxs("dd",{className:"m-0 flex min-w-0 items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 break-all rounded-md bg-muted px-2 py-1 font-mono text-[12px]","data-testid":"webhook-url",children:c}),e.jsx(Fe,{text:c,label:"Copy the address"})]}),t!=="linear"&&t!=="trello"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Secret"}),e.jsx("dd",{className:"m-0 flex min-w-0 items-center gap-2",children:l?e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"min-w-0 flex-1 break-all rounded-md bg-muted px-2 py-1 font-mono text-[12px]","data-testid":"webhook-secret",children:l}),e.jsx(Fe,{text:l,label:"Copy the secret"})]}):e.jsxs("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2 text-muted-foreground",children:["Shown once, when it was made.",e.jsx(b,{type:"button",size:"sm",variant:"outline",loading:h.isPending,onClick:()=>h.mutate(void 0),children:"Make a new secret"})]})})]}),t==="github"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Content type"}),e.jsx("dd",{className:"m-0 font-mono text-[12px]",children:"application/json"})]})]}),l&&e.jsx("p",{className:"m-0 -mt-2 text-[12px] text-muted-foreground",children:"Copy it now: it is not shown again. A new one can be made here any time."}),(t==="linear"||t==="trello")&&e.jsx(P,{id:"wb-secret",label:t==="linear"?"Signing secret":"Power-Up secret",hint:T||p?.hasWebhookSecret?"Saved. Paste a new one to replace it.":t==="linear"?"From the webhook Linear just made.":"Next to the API key in Trello.",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(ge,{id:"wb-secret",value:f,onChange:w,placeholder:t==="linear"?"lin_wh_…":""})}),e.jsx(b,{type:"button",variant:"outline",disabled:!f.trim(),loading:h.isPending,onClick:()=>h.mutate(f.trim()),children:"Save"})]})}),e.jsxs("div",{role:"status","aria-live":"polite","data-testid":"webhook-check","data-state":x,className:Re("flex items-start gap-2.5 rounded-md border px-3 py-2.5 text-[13px]",x==="ok"&&"border-emerald-500/40 bg-emerald-500/10",x==="refused"&&"border-destructive/40 bg-warn-soft",(x==="waiting"||x==="nosecret")&&"border-border bg-muted/40"),children:[x==="ok"?e.jsx(We,{className:"mt-0.5 size-4 shrink-0 text-emerald-600"}):x==="refused"?e.jsx(st,{className:"mt-0.5 size-4 shrink-0 text-destructive"}):e.jsx(Ge,{className:"mt-0.5 size-4 shrink-0 animate-spin text-muted-foreground motion-reduce:animate-none"}),e.jsx("span",{className:"min-w-0",children:x==="ok"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"The webhook works."})," Last delivery ",_(p.lastDeliveryAt),a>=y?", just now.":".",n&&e.jsxs("span",{className:"mt-1 block text-muted-foreground",children:["A later delivery was refused (",_(p.lastRefusedAt),"): ",p.lastRefusedError," If you did not change the secret, it may not have come from ",A[t],"."]})]}):x==="refused"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"A delivery arrived and was refused"})," (",_(p.lastRefusedAt),"). ",p.lastRefusedError,e.jsxs("span",{className:"mt-1 block text-muted-foreground",children:["A refused delivery is unsigned, so it may not be from ",A[t],". Check the delivery log on ",A[t],"'s webhook before changing anything."]})]}):x==="nosecret"?e.jsxs(e.Fragment,{children:["Waiting for the ",t==="linear"?"signing secret":"Power-Up's secret",". Without it, ",A[t],"'s deliveries are refused."]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:t==="trello"&&k?.sent?"Checking the secret…":"Waiting for the first delivery."})," ",R]})})]})]})}function dt({provider:t,open:r,onOpenChange:l,sites:o}){const m=le(),u=A[t],[c,y]=i.useState(1),[f,w]=i.useState(""),[g,v]=i.useState(""),[T,O]=i.useState(""),[k,$]=i.useState(""),[j,p]=i.useState(""),[h,a]=i.useState([]),[d,x]=i.useState({open:"",progress:"",resolved:""}),[n,R]=i.useState(""),[N,fe]=i.useState(""),[G,Q]=i.useState([]),[S,z]=i.useState(""),[be,je]=i.useState(""),[ke,ye]=i.useState(!1),[Me,Y]=i.useState(null),[Ue,we]=i.useState(""),[ve,I]=i.useState("");i.useEffect(()=>{r||(y(1),w(""),v(""),O(""),$(""),p(""),a([]),x({open:"",progress:"",resolved:""}),R(""),fe(""),Q([]),z(""),je(""),ye(!1),Y(null),we(""),I(""))},[r]);const W=f||o[0]?.uid||"",U=T.trim().replace(/\/+$/,"").replace(/^(?!https?:\/\/)/,"https://"),Ke=t==="github"?{token:g.trim()}:t==="linear"?{apiKey:g.trim()}:t==="trello"?{apiKey:j.trim(),token:g.trim()}:{siteUrl:U,email:k.trim(),apiToken:g.trim()},K=i.useRef(""),V=L({mutationFn:s=>C.discoverTracker("trello",{apiKey:j.trim(),token:g.trim(),boardId:s}),onSuccess:(s,D)=>{D===K.current&&(I(""),a(s.options),x(De(s.options)))},onError:(s,D)=>{D===K.current&&I(M(s))}}),[H,X]=i.useState(!1),[Z,He]=i.useState("Snagset feedback"),Ne=L({mutationFn:s=>C.discoverTracker("trello",{apiKey:j.trim(),token:g.trim(),newBoard:s}),onSuccess:s=>{s.board&&(I(""),X(!1),Q(D=>[...D,s.board]),K.current=s.board.value,z(s.board.value),a(s.options),x(De(s.options)))},onError:s=>I(M(s))}),Se=s=>{if(s===ae){X(!0);return}X(!1),K.current=s,z(s),a([]),x({open:"",progress:"",resolved:""}),s&&V.mutate(s)},ee=L({mutationFn:()=>C.discoverTracker(t,Ke),onSuccess:s=>{I(""),fe(s.who),Q(s.options);const D=s.options.find(ne=>ne.canWrite!==!1)?.value??s.options[0]?.value??"";t==="trello"?Se(D):z(D),y(2)},onError:s=>I(M(s))}),te=L({mutationFn:()=>{const s=ke?"thread.created":"manual";return t==="github"?C.connectTracker(W,"github",{repository:S.trim(),token:g.trim(),labels:be.trim(),createOn:s}):t==="linear"?C.connectTracker(W,"linear",{team:S.trim(),apiKey:g.trim(),createOn:s}):t==="trello"?C.connectTracker(W,"trello",{apiKey:j.trim(),token:g.trim(),boardId:S,openList:d.open,progressList:d.progress,resolvedList:d.resolved,createOn:s}):C.connectTracker(W,"jira",{siteUrl:U,project:S.trim(),email:k.trim(),apiToken:g.trim(),createOn:s})},onSuccess:s=>{I(""),v(""),Y(s.webhook?.secret??null),R(s.webhook?.error??""),we(W),m.invalidateQueries({queryKey:["integrations"]}),B.success(`${u} connected`),y(3)},onError:s=>I(M(s))}),Ce=!!W&&!!g.trim()&&(t!=="jira"||!!T.trim()&&!!k.trim())&&(t!=="trello"||!!j.trim()),se=t!=="trello"||!H&&!!d.open&&!!d.progress&&!!d.resolved&&new Set([d.open,d.progress,d.resolved]).size===3,Ae=G.find(s=>s.value===S),Je=Ae?.label??S;return e.jsx(de,{open:r,onOpenChange:l,children:e.jsx(me,{className:"sm:max-w-[560px]",children:e.jsxs("form",{className:"flex min-w-0 flex-col gap-4",noValidate:!0,onSubmit:s=>{s.preventDefault(),c===1&&Ce?ee.mutate():c===2&&S.trim()&&se?te.mutate():c===3&&l(!1)},children:[e.jsxs(he,{children:[e.jsxs(ue,{children:["Connect a site to ",u]}),e.jsxs(pe,{children:[c===1?`Give Snagset access to ${u}. The key is checked now and stored encrypted with this instance's secret key.`:c===2?`Signed in to ${u}${N?` as ${N}`:""}. Choose where this site's comments go.`:`Connected. Now the way back: a webhook, so that moving ${t==="trello"?"a card":"an issue"} in ${u} moves the comment here.`," ",e.jsx(F,{href:`${_e}#${t}`,children:"Step-by-step guide"})]})]}),e.jsx(lt,{at:c}),ve&&c!==3&&e.jsx(ze,{children:ve}),c===1&&e.jsxs(e.Fragment,{children:[e.jsx(P,{id:"ct-site",label:"Site",children:e.jsx(J,{id:"ct-site",value:W,onChange:w,options:o.map(s=>({value:s.uid,label:s.name}))})}),e.jsx(ct,{provider:t,jiraSite:U,trelloKey:j}),t==="trello"&&e.jsx(P,{id:"ct-trello-key",label:"API key",children:e.jsx(E,{id:"ct-trello-key",value:j,onChange:s=>p(s.target.value),autoComplete:"off",spellCheck:!1})}),t==="jira"&&e.jsxs(e.Fragment,{children:[e.jsx(P,{id:"ct-jira-site",label:"Jira site",hint:"The address you open Jira at.",children:e.jsx(E,{id:"ct-jira-site",placeholder:"https://kilnwork.atlassian.net",value:T,onChange:s=>O(s.target.value),autoComplete:"off"})}),e.jsx(P,{id:"ct-email",label:"Account email",children:e.jsx(E,{id:"ct-email",type:"email",placeholder:"you@kilnwork.studio",value:k,onChange:s=>$(s.target.value),autoComplete:"off"})})]}),e.jsx(P,{id:"ct-token",label:t==="github"||t==="trello"?"Token":t==="linear"?"API key":"API token",children:e.jsx(ge,{id:"ct-token",value:g,onChange:v,placeholder:t==="github"?"github_pat_…":t==="linear"?"lin_api_…":""})})]}),c===2&&e.jsxs(e.Fragment,{children:[G.length>0||t==="trello"?e.jsx(P,{id:"ct-target",label:Oe[t],hint:Ae?.canWrite===!1?"This token can only read that repository: give it Issues › Read and write, or pick another.":t==="jira"?"Jira calls these spaces; the key in brackets is the prefix on its issues.":void 0,children:e.jsx(J,{id:"ct-target",value:H?ae:S,onChange:t==="trello"?Se:z,options:[...G.map(s=>({value:s.value,label:s.label})),...t==="trello"?[{value:ae,label:"New board…"}]:[]]})}):e.jsx(P,{id:"ct-target",label:Oe[t],hint:`${u} listed nothing this key can see. Type it instead: ${t==="github"?"owner/name":"the prefix on its issues, like ENG"}.`,children:e.jsx(E,{id:"ct-target",value:S,onChange:s=>z(s.target.value),autoComplete:"off"})}),t==="trello"&&H&&e.jsx(P,{id:"ct-new-board",label:"Board name",hint:"Snagset makes it, private to you, with three lists: To do, Doing and Done.",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(E,{id:"ct-new-board",value:Z,onChange:s=>He(s.target.value),autoComplete:"off",className:"min-w-0 flex-1"}),e.jsx(b,{type:"button",variant:"outline",disabled:!Z.trim(),loading:Ne.isPending,onClick:()=>Ne.mutate(Z.trim()),children:"Make board"})]})}),t==="trello"&&!H&&(V.isPending?e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:"Reading the board's lists…"}):h.length>0?e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:"A card's list is its status. Moving a card between these three moves the comment here, and back."}),[["open","Open"],["progress","In progress"],["resolved","Resolved"]].map(([s,D])=>e.jsx(P,{id:`ct-list-${s}`,label:D,children:e.jsx(J,{id:`ct-list-${s}`,value:d[s],onChange:ne=>x(qe=>({...qe,[s]:ne})),options:h})},s)),!se&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:"Pick three different lists."})]}):S?e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:"This board has no open lists. Add three in Trello (for example To do, Doing, Done), then pick it again."}):null),t==="github"&&e.jsx(P,{id:"ct-labels",label:"Labels",hint:"Optional, comma-separated. Put on every issue Snagset opens.",children:e.jsx(E,{id:"ct-labels",placeholder:"review",value:be,onChange:s=>je(s.target.value),autoComplete:"off"})}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 rounded-md border border-border px-3 py-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:ke,onChange:s=>ye(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:t==="trello"?"A card for every new comment":"An issue for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:t==="trello"?"Off: you make a card from a comment's brief when you mean it. On: every new comment makes one.":"Off: you make an issue from a comment's brief when you mean it. On: every new comment opens one."})]})]})]}),c===3&&e.jsx(Be,{provider:t,site:Ue,shownSecret:Me,onSecret:Y,target:{label:Je,...t==="jira"?{jiraSite:U}:{},...t==="github"?{repo:S}:{},...t==="trello"&&n?{trelloNote:n}:{}}}),e.jsxs(xe,{children:[c===1&&e.jsxs(e.Fragment,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(b,{type:"submit",loading:ee.isPending,disabled:!Ce,children:ee.isPending?"Checking…":"Check access"})]}),c===2&&e.jsxs(e.Fragment,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>y(1),children:"Back"}),e.jsx(b,{type:"submit",loading:te.isPending,disabled:!S.trim()||!se||V.isPending,children:te.isPending?"Connecting…":"Connect"})]}),c===3&&e.jsx(b,{type:"submit",children:"Done"})]})]})})})}function mt({state:t,onClose:r}){const[l,o]=i.useState(null);return i.useEffect(()=>{t||o(null)},[t]),e.jsx(de,{open:t!==null,onOpenChange:m=>!m&&r(),children:e.jsx(me,{className:"sm:max-w-[560px]",children:t&&e.jsxs(e.Fragment,{children:[e.jsxs(he,{children:[e.jsxs(ue,{children:[A[t.provider]," webhook for ",t.siteName]}),e.jsxs(pe,{children:["The way back: moving ",t.provider==="trello"?"a card":"an issue"," in ",A[t.provider]," moves the comment here. ",e.jsx(F,{href:`${_e}#${t.provider}`,children:"Step-by-step guide"})]})]}),e.jsx(Be,{provider:t.provider,site:t.site,shownSecret:l,onSecret:o,target:t.target}),e.jsx(xe,{children:e.jsx(b,{type:"button",onClick:r,children:"Done"})})]})})})}const ht={ok:{label:"Healthy",tone:"ok"},needs_reauth:{label:"Needs a new token",tone:"bad"},error:{label:"Failing",tone:"bad"}};function ut(){const t=Le(),r=oe(t.user.role,"settings"),l=oe(t.user.role,"studio")&&Te(t),o=ce(Ee.integrations()),m=le(),u=()=>m.invalidateQueries({queryKey:["integrations"]}),[c,y]=i.useState(null),[f,w]=i.useState(null),[g,v]=i.useState(null),T=L({mutationFn:({uid:a,provider:d})=>C.testTracker(a,d).then(x=>({...x,provider:d})),onSuccess:a=>{B[a.ok?"success":"error"](a.ok?`${A[a.provider]} can see ${a.target}`:a.detail??`${A[a.provider]} refused the token`),u()},onError:a=>B.error($e(a))}),O=L({mutationFn:({uid:a,provider:d})=>C.disconnectTracker(a,d),onSuccess:()=>{w(null),u()},onError:a=>B.error($e(a))}),k=o.data?.data??[],$=a=>k.filter(d=>d.provider===a),j=t.projects.filter(a=>!a.archived&&!a.locked),p=a=>j.filter(d=>!$(a).some(x=>x.site===d.uid)),h=r?t.limits.integrations?j.length===0?"site":null:"plan":null;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(Xe,{title:"Integrations",sub:"Your coding agent first, then the trackers that mirror a comment's status, then Slack, which only announces"}),e.jsx(et,{owner:r,instanceOwner:l,operator:Te(t),sites:t.projects}),h&&e.jsxs("div",{role:"note",className:"flex max-w-[1040px] flex-wrap items-center gap-x-4 gap-y-2 rounded-lg border border-border bg-muted/40 px-4 py-3 text-[13px]",children:[e.jsx("span",{className:"min-w-0 flex-1",children:h==="plan"?t.user.role==="owner"?"This studio's plan does not include integrations. A plan that does lets you connect each site to GitHub, Linear, Jira and Slack.":"This studio's plan does not include integrations. An owner can change the plan.":t.projects.length===0?"An integration connects one site to one repository, team, project or channel. Add a site first, then connect it here.":"An integration connects one site at a time, and every site here is archived or read-only. Restore one, or add a site, then connect it here."}),h==="plan"?t.user.role==="owner"&&e.jsx(b,{variant:"outline",size:"sm",render:e.jsx(re,{to:"/studio/plan"}),children:"See plans"}):e.jsx(b,{variant:"outline",size:"sm",render:e.jsx(re,{to:"/sites"}),children:"Go to Sites"})]}),["github","linear","jira","trello","slack"].map(a=>{const d=$(a),x=p(a);return e.jsxs(Ze,{title:A[a],description:a==="github"?"A comment becomes an issue in the site's repository, with the brief as its body; resolving it here closes the issue there, and closing it there resolves it here. A fine-grained token per site — no OAuth app to register.":a==="linear"?"A comment becomes an issue in the site's team, with the brief as its body; our status moves it between the team's workflow states by type, and a webhook from Linear moves it back. A personal API key per site — no OAuth app to register.":a==="jira"?"A comment becomes an issue in the site's Jira project, with the brief as its description; our status moves it through the workflow by status category, and a webhook from Jira moves it back. An API token with the account's email — what Atlassian gives a self-hoster.":a==="trello"?"A comment becomes a card on the site's board, with the brief as its description. A card's list is its status: our status moves it between the three lists you pick, and moving it there moves the comment here. An API key and token from your own Power-Up; Snagset sets up the webhook.":"One message per comment in a channel, edited in place as the status moves — never a second message, never a reply. A bot token from an app you create in a click from our manifest; Slack sends nothing back.",children:[o.isPending&&e.jsx(Qe,{rows:2}),o.isSuccess&&d.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Pe,{variant:"outline",children:"Not connected"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:a==="github"?"No site is connected to a repository yet.":a==="linear"?"No site is connected to a team yet.":a==="jira"?"No site is connected to a project yet.":a==="trello"?"No site is connected to a board yet.":"No site is connected to a channel yet."})]}),d.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:d.map(n=>{const R=ht[n.health]??{label:n.health,tone:"warn"};return e.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border px-3 py-2.5 text-[13px]",children:[e.jsx("span",{className:"font-medium",children:n.siteName??n.site}),e.jsx("span",{className:"text-muted-foreground",children:"→"}),e.jsx("code",{className:"font-mono text-[12.5px]",children:n.provider==="github"?`${n.owner}/${n.repo}`:n.provider==="linear"?`${n.teamKey} · ${n.teamName}`:n.provider==="jira"?`${n.projectKey} · ${n.projectName}`:n.provider==="trello"?`${n.boardName} · ${n.listNames.open} / ${n.listNames.progress} / ${n.listNames.resolved}`:`#${n.channelName} · ${n.teamName}`}),e.jsx(Pe,{variant:"outline",className:R.tone==="ok"?"border-ok text-ok":R.tone==="bad"?"border-destructive text-destructive":"",children:R.label}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[n.provider==="slack"?n.createOn==="thread.created"?"A message for every new comment":"Messages when you ask, from the brief":n.provider==="trello"?n.createOn==="thread.created"?"A card for every new comment":"Cards when you ask, from the brief":n.createOn==="thread.created"?"An issue for every new comment":"Issues when you ask, from the brief",n.provider==="github"&&n.labels.length?` · labels ${n.labels.join(", ")}`:""," · ",_(n.updatedAt)]}),n.provider!=="slack"&&e.jsx(xt,{r:n}),n.lastError&&e.jsx("span",{className:"basis-full text-[12px] text-destructive",children:n.lastError}),r&&e.jsxs("span",{className:"ml-auto flex gap-1",children:[n.provider!=="slack"&&e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>v({provider:n.provider,site:n.site,siteName:n.siteName??n.site,target:n.provider==="github"?{label:`${n.owner}/${n.repo}`,repo:`${n.owner}/${n.repo}`}:n.provider==="linear"?{label:n.teamName}:n.provider==="trello"?{label:n.boardName}:{label:n.projectName,jiraSite:n.siteUrl}}),children:"Webhook…"}),e.jsx(b,{variant:"ghost",size:"sm",loading:T.isPending,onClick:()=>T.mutate({uid:n.site,provider:n.provider}),children:"Test"}),e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>w(n),children:"Disconnect"})]})]},`${n.provider}:${n.site}`)})}),r&&!h&&x.length>0&&e.jsx("div",{children:e.jsx(b,{variant:"outline",size:"sm",onClick:()=>y(a),children:"Connect a site…"})})]},a)}),["github","linear","jira","trello"].map(a=>e.jsx(dt,{provider:a,open:c===a,onOpenChange:d=>!d&&y(null),sites:p(a)},a)),e.jsx(pt,{open:c==="slack",onOpenChange:a=>!a&&y(null),sites:p("slack"),onDone:()=>void u()}),e.jsx(mt,{state:g,onClose:()=>v(null)}),e.jsx(Ye,{open:f!==null,onOpenChange:a=>!a&&w(null),title:`Disconnect ${f?.siteName??"this site"} from ${f?A[f.provider]:"the tracker"}?`,description:f?.provider==="slack"?e.jsx(e.Fragment,{children:"Messages already posted stay in the channel; no new ones are posted and they stop being updated. The token is forgotten."}):e.jsx(e.Fragment,{children:"Issues already made keep their links; no new ones are made and status stops mirroring. The token is forgotten."}),confirmLabel:"Disconnect",busy:O.isPending,onConfirm:async()=>{f&&await O.mutateAsync({uid:f.site,provider:f.provider})}})]})}function pt({open:t,onOpenChange:r,sites:l,onDone:o}){const[m,u]=i.useState(""),[c,y]=i.useState(""),[f,w]=i.useState(""),[g,v]=i.useState(!0),[T,O]=i.useState(""),k=ce({queryKey:["integrations","slack","manifest"],queryFn:()=>C.slackManifest(),enabled:t,staleTime:1/0}),$=L({mutationFn:h=>C.connectTracker(h,"slack",{channel:c.trim(),token:f.trim(),createOn:g?"thread.created":"manual"})}),j=m||l[0]?.uid||"",p=async h=>{h.preventDefault(),O("");try{await $.mutateAsync(j),y(""),w(""),v(!0),r(!1),o(j),B.success("Slack connected")}catch(a){O(a instanceof Ie?a.message:"Could not reach the server.")}};return e.jsx(de,{open:t,onOpenChange:r,children:e.jsx(me,{children:e.jsxs("form",{onSubmit:h=>void p(h),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(he,{children:[e.jsx(ue,{children:"Connect a site to Slack"}),e.jsx(pe,{children:"Create the app in your workspace from our manifest — one click, the scopes are filled in — install it, and paste its Bot User OAuth Token. The token is checked against the channel before it is saved, and stored encrypted with this instance's secret key."})]}),T&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:T}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{htmlFor:"sl-site",children:"Site"}),e.jsx(J,{id:"sl-site",value:j,onChange:u,options:l.map(h=>({value:h.uid,label:h.name}))})]}),e.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border px-3 py-2 text-[13px]",children:[e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block font-medium",children:"1. Create the app"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Opens api.slack.com with the manifest pasted; then Install to Workspace."})]}),e.jsx(b,{type:"button",variant:"outline",size:"sm",disabled:!k.data,render:e.jsx("a",{href:k.data?.url??"#",target:"_blank",rel:"noreferrer"}),children:"Create app…"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{htmlFor:"sl-token",children:"2. Bot User OAuth Token"}),e.jsx(ge,{id:"sl-token",placeholder:"xoxb-…",value:f,onChange:w}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"On the app's OAuth & Permissions page after installing."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{htmlFor:"sl-channel",children:"3. Channel"}),e.jsx(E,{id:"sl-channel",placeholder:"#reviews",value:c,onChange:h=>y(h.target.value),autoComplete:"off"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"A public channel by name; a private one needs the app invited first, then its name works too."})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:g,onChange:h=>v(h.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"A message for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"On by default: a channel is where people are told. Turn it off to post from the brief when you mean it."})]})]}),e.jsxs(xe,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(b,{type:"submit",loading:$.isPending,disabled:!c.trim()||!f.trim()||!j,children:$.isPending?"Checking…":"Connect"})]})]})})})}function xt({r:t}){const r=A[t.provider];if(t.lastDeliveryAt){const l=t.lastRefusedAt&&Date.parse(t.lastRefusedAt)>Date.parse(t.lastDeliveryAt);return e.jsxs("span",{className:"basis-full text-[12px] text-muted-foreground",children:["Webhook works · last delivery ",_(t.lastDeliveryAt),l?` · a later one was refused ${_(t.lastRefusedAt)}`:""]})}return t.lastRefusedAt?e.jsxs("span",{className:"basis-full text-[12px] text-destructive",children:["Webhook refused ",_(t.lastRefusedAt),": ",t.lastRefusedError," Unsigned, so check ",r,"'s webhook log first."]}):t.provider==="trello"&&!t.webhookRegistered?e.jsxs("span",{className:"basis-full text-[12px] text-destructive",children:["Snagset could not register the webhook on ",t.boardName,": Trello must reach this server's address. Connect again once it can."]}):(t.provider==="linear"||t.provider==="trello")&&!t.hasWebhookSecret?e.jsxs("span",{className:"basis-full text-[12px] text-muted-foreground",children:["No webhook yet, so ",r," cannot move comments here. Webhook… sets it up."]}):e.jsx("span",{className:"basis-full text-[12px] text-muted-foreground",children:"No webhook delivery seen yet. Webhook… shows how to set it up."})}const Ut=()=>oe(Le().user.role,"settings")?e.jsx(ut,{}):e.jsx(Ve,{title:"Integrations",children:e.jsxs("p",{className:"m-0",children:["Connecting a site to GitHub, Linear, Jira or Slack is done by an owner or an admin. Your own agent tokens are on"," ",e.jsx(re,{to:"/you",className:"text-brand hover:underline",children:"You"}),"."]})});export{Ut as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as W,q as M,j as e,ab as X,r as f,B as h,ac as g,ad as P,a2 as C,I as J,D as K,ae as Z,af as ee,ag as se,F as te,A as S}from"./index-
|
|
1
|
+
import{c as W,q as M,j as e,ab as X,r as f,B as h,ac as g,ad as P,a2 as C,I as J,D as K,ae as Z,af as ee,ag as se,F as te,A as S}from"./index-B_3U6pyz.js";import{u as k}from"./useQuery-HUEWFxW8.js";import{u as ae,a as ie,C as ne}from"./zod-BqdlirRI.js";import{S as le,a as re,b as oe,c as me,d as de,P as ce}from"./Picker-0Wc1iFQj.js";import{A as xe,a as he}from"./avatar-DQ2PBAkd.js";import{B as ue}from"./badge-5vfpTOMk.js";import{C as E}from"./card-DEnJVYTc.js";import{X as pe,i as je,j as fe,l as R,k as A,m as I,n as D}from"./dialog-Dsu0e02Q.js";import{L,I as ge}from"./label-BPkAzYEe.js";import{T,a as $,b as v,c,d as B,e as x}from"./table-BtGHQI2k.js";import{C as ve}from"./ConfirmDialog-_B1eNA1i.js";import{C as be}from"./CopyButton-CIoiqDbz.js";import{A as ye,P as we,b as Ne}from"./parts-BZnB0y34.js";import{u as O}from"./me-Ffh61LTY.js";import{s as Ce}from"./useScrollLock-Bxg3WK_6.js";import{c as Se,d as ke,e as Re,f as Ae,g as Ie}from"./studio-C-cl-Bid.js";import{P as De}from"./plus-CopH4JTI.js";import"./useBaseQuery-BWQygP2V.js";import"./chevron-down-CkYqA6Tw.js";import"./check-BhmdAbBD.js";import"./isElementDisabled-CwHw_lZC.js";import"./createBaseUIEventDetails-BDbAfTsh.js";import"./inertValue-Dl2ZzbZu.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-B2j76Odc.js";import"./getPseudoElementBounds-Df0qQn0E.js";import"./CompositeList-U-qk8UP6.js";import"./useRender-BMKPZM38.js";import"./copy-DefIRiwo.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,ah as Y,r as d,p as M,d as A,A as $,S as B,h as m,B as P}from"./index-
|
|
1
|
+
import{j as e,ah as Y,r as d,p as M,d as A,A as $,S as B,h as m,B as P}from"./index-B_3U6pyz.js";import{u as _}from"./useQuery-HUEWFxW8.js";import{b as j}from"./InstanceRows-Cu43MthB.js";import{A as D,P as K}from"./parts-BZnB0y34.js";import{u as y}from"./me-Ffh61LTY.js";import{C as U}from"./check-BhmdAbBD.js";import"./useBaseQuery-BWQygP2V.js";import"./dialog-Dsu0e02Q.js";import"./useScrollLock-Bxg3WK_6.js";import"./inertValue-Dl2ZzbZu.js";import"./createBaseUIEventDetails-BDbAfTsh.js";import"./label-BPkAzYEe.js";import"./ConfirmDialog-_B1eNA1i.js";import"./copy-DefIRiwo.js";import"./card-DEnJVYTc.js";function L(){const s=y(),{said:r}=Y.useSearch(),[a,o]=d.useState(r),[c]=d.useState(()=>Date.now()),u=M(),p=A();d.useEffect(()=>{r&&u({to:"/studio/plan",search:{},replace:!0})},[r,u]);const w=_($.setupState()),i=w.data?.billingUrl??null,v=_({queryKey:["plan-state",i],enabled:!!i,refetchInterval:()=>a&&Date.now()-c<3e4?3e3:!1,queryFn:async()=>{const t=await fetch(`${i.replace(/\/+$/,"")}/state`,{credentials:"include",headers:{accept:"application/json"}});if(!t.ok)throw new Error(String(t.status));return await t.json()}}),n=v.data,b=d.useRef(null),f=n?.current?.name??null;d.useEffect(()=>{f&&(b.current===null?b.current=f:f!==b.current&&(o(void 0),p.invalidateQueries({queryKey:$.me().queryKey})))},[f,p]);const[h,R]=d.useState(!1),q=!!n?.plans.some(t=>t.yearly),S=n?.plans.find(t=>t.current);return e.jsxs("div",{className:"flex flex-col gap-8 p-7",children:[e.jsx(K,{title:"Plan & billing",sub:s.org.name}),a&&e.jsx("p",{role:"status",className:"m-0 max-w-[1040px] rounded-md border border-border bg-card px-3 py-2 text-[13px]",children:a}),w.isSuccess&&!i?e.jsx("p",{className:"m-0 text-muted-foreground",children:"This instance has no plans: everything is included."}):v.isError?e.jsx("p",{className:"m-0 text-muted-foreground",children:"The plans could not be loaded. Reload to try again."}):n?e.jsxs("div",{className:"flex max-w-[1040px] flex-col",children:[e.jsxs("section",{"aria-label":"Your plan",className:"grid grid-cols-1 gap-5 rounded-xl border border-border bg-card px-6 py-5 sm:grid-cols-[minmax(0,1fr)_auto]",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"m-0 text-[11.5px] font-medium uppercase tracking-wider text-muted-foreground",children:"Your plan"}),e.jsxs("p",{className:"m-0 mt-1 text-[28px] font-bold leading-tight",children:[n.current?.name??S?.name,e.jsx("span",{className:"ml-2 text-[15px] font-normal text-muted-foreground",children:n.current?.price??S?.price})]}),n.current?.period&&e.jsx("p",{className:"m-0 mt-1 text-[13px] text-ink-soft",children:n.current.period})]}),n.manage&&e.jsx("div",{children:e.jsx(g,{base:i,form:n.manage})}),e.jsx("div",{className:"sm:col-span-2",children:e.jsx(Q,{})}),n.current?.warning&&e.jsx("p",{role:"status",className:"m-0 rounded-md bg-warn-soft px-3.5 py-2.5 text-[13px] sm:col-span-2",children:n.current.warning}),n.nudge&&e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-lg bg-brand-soft px-3.5 py-2.5 sm:col-span-2",children:[e.jsx("p",{className:"m-0 min-w-[220px] flex-1 text-[13px]",children:n.nudge.text}),e.jsx(g,{base:i,form:n.nudge.action})]})]}),e.jsxs("div",{className:"mb-4 mt-9 flex flex-wrap items-center justify-between gap-3",children:[e.jsx("h2",{id:"compare",className:"m-0 text-[17px] font-semibold",children:"Compare plans"}),q&&e.jsx("div",{role:"radiogroup","aria-label":"Billing period",className:"inline-flex rounded-full border border-border bg-card p-0.5",children:[!1,!0].map(t=>e.jsx("button",{type:"button",role:"radio","aria-checked":h===t,onClick:()=>R(t),className:m("rounded-full px-3.5 py-1 text-[13px]",h===t?"bg-foreground text-background":"text-ink-soft"),children:t?e.jsxs(e.Fragment,{children:["Yearly ",e.jsx("span",{className:m("font-medium",h?"opacity-80":"text-brand"),children:"2 months free"})]}):"Monthly"},String(t)))})]}),e.jsx("div",{"aria-labelledby":"compare",className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:n.plans.map(t=>{const x=h&&t.yearly?t.yearly:null,k=x?x.actions:t.actions,E=t.relation==="downgrade";return e.jsxs("div",{className:m("relative flex min-w-0 flex-col gap-4 rounded-xl border bg-card p-5",t.recommended?"border-brand shadow-[0_0_0_1px_var(--color-brand),0_10px_30px_rgb(61_97_217/.12)]":"border-border"),children:[(t.current||t.recommended)&&e.jsx("span",{className:m("absolute -top-2.5 left-5 rounded-full px-2.5 py-px text-[11.5px] font-semibold",t.current?"bg-foreground text-background":"bg-brand text-white"),children:t.current?"Your plan":"Recommended"}),e.jsxs("div",{children:[e.jsx("h3",{className:"m-0 text-[16px] font-semibold",children:t.name}),t.pitch&&e.jsx("p",{className:"m-0 mt-0.5 text-[13px] text-muted-foreground",children:t.pitch})]}),e.jsxs("p",{className:"m-0 text-[34px] font-bold leading-none tracking-tight",children:[x?.amount??t.amount??t.price,(x?.unit??t.unit)&&e.jsx("span",{className:"ml-1 text-[13px] font-normal tracking-normal text-muted-foreground",children:x?.unit??t.unit})]}),e.jsx("ul",{className:"m-0 flex flex-1 list-none flex-col gap-2 p-0",children:t.features.map(l=>e.jsxs("li",{className:m("flex gap-2 text-[13.5px]",t.added?.includes(l)&&"font-semibold"),children:[e.jsx(U,{className:"mt-0.5 size-4 shrink-0 text-ok","aria-hidden":!0}),l]},l))}),t.current?e.jsx(P,{type:"button",variant:"outline",disabled:!0,className:"w-full",children:"Current plan"}):E?k.map(l=>e.jsx(O,{base:i,form:l,warning:t.warning??null},l.label)):k.map(l=>e.jsx(g,{base:i,form:{...l,primary:!!t.recommended||l.primary},wide:!0},l.label))]},t.id)})}),e.jsxs("p",{className:"m-0 mt-5 text-center text-[13px] text-muted-foreground",children:[n.footer?e.jsxs("b",{className:"font-semibold text-foreground",children:[n.footer.split(". ")[0],"."]}):n.intro," ",n.footer?.split(". ").slice(1).join(". ")]}),n.notes.length>0&&e.jsx("p",{className:"m-0 mt-1.5 text-center text-[12px] text-muted-foreground",children:n.notes.join(" ")})]}):e.jsx(B,{})]})}function O({base:s,form:r,warning:a}){const[o,c]=d.useState(!1);return a&&o?e.jsxs("div",{className:"flex flex-col gap-2 rounded-md bg-warn-soft px-3 py-2.5 text-[12.5px]",children:[e.jsx("p",{className:"m-0",children:a}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(g,{base:s,form:{...r,label:"Downgrade anyway",primary:!1}}),e.jsx("button",{type:"button",className:"text-[13px] text-muted-foreground underline underline-offset-2",onClick:()=>c(!1),children:"Keep my plan"})]})]}):a?e.jsx("button",{type:"button",className:"self-center text-[13px] text-muted-foreground underline underline-offset-[3px]",onClick:()=>c(!0),children:r.label}):e.jsxs("form",{method:"post",action:new URL(r.action,s).toString(),className:"m-0 self-center",children:[Object.entries(r.fields).map(([u,p])=>e.jsx("input",{type:"hidden",name:u,value:p},u)),e.jsx("button",{type:"submit",className:"text-[13px] text-muted-foreground underline underline-offset-[3px]",children:r.label})]})}function g({base:s,form:r,wide:a}){return e.jsxs("form",{method:"post",action:new URL(r.action,s).toString(),className:"m-0",children:[Object.entries(r.fields).map(([o,c])=>e.jsx("input",{type:"hidden",name:o,value:c},o)),e.jsx(P,{type:"submit",variant:r.primary?"default":"outline",className:a?"w-full":void 0,children:r.label})]})}function Q(){const{limits:s}=y(),r=[{label:"Sites",text:C(s.projects.used,s.projects.limit,"site","sites"),share:N(s.projects.used,s.projects.limit)},{label:"Members",text:C(s.members.used,s.members.limit,"member","members"),share:N(s.members.used,s.members.limit)},{label:"Screenshots",text:s.screenshots?s.storage.limit===null?`${j(s.storage.used)} used`:`${j(s.storage.used)} of ${j(s.storage.limit)}`:"Not on this plan",share:s.screenshots?N(s.storage.used,s.storage.limit):null}];return e.jsx("dl",{className:"m-0 grid grid-cols-1 gap-5 border-t border-border pt-4 sm:grid-cols-3",children:r.map(a=>e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("dt",{className:"text-[12px] text-muted-foreground",children:a.label}),e.jsx("dd",{className:"m-0 text-[13px]",children:a.text}),a.share!==null&&e.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted","aria-hidden":!0,children:e.jsx("div",{className:m("h-full rounded-full",a.share>=1?"bg-destructive":"bg-brand"),style:{width:`${Math.min(100,Math.round(a.share*100))}%`}})})]},a.label))})}const N=(s,r)=>r===null||r===0?null:s/r,C=(s,r,a,o)=>r===null?`${s} ${s===1?a:o}, unlimited`:`${s} of ${r} ${r===1?a:o}`,ne=()=>y().user.role==="owner"?e.jsx(L,{}):e.jsx(D,{title:"Plan & billing"});export{ne as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,i as ae,al as re,e as se,aj as ie,E as ne,k as j,j as f,am as oe,h as de}from"./index-
|
|
1
|
+
import{r as i,i as ae,al as re,e as se,aj as ie,E as ne,k as j,j as f,am as oe,h as de}from"./index-B_3U6pyz.js";import{f as ce,e as le,h as ue,j as fe,u as pe,A as he,k as be,l as me,c as ge,n as ve}from"./createBaseUIEventDetails-BDbAfTsh.js";import{x as ke,y as xe}from"./useScrollLock-Bxg3WK_6.js";import{u as we}from"./useAriaLabelledBy-x5XF8M1H.js";import{u as ye}from"./useValueChanged-B2j76Odc.js";const M=i.createContext(void 0);function Ce(){const r=i.useContext(M);if(r===void 0)throw new Error(ae(63));return r}const D={...ce,checked(r){return r?{"data-checked":""}:{"data-unchecked":""}}},Re=i.forwardRef(function(s,o){const{checked:k,className:F,defaultChecked:x,"aria-labelledby":g,form:p,id:L,inputRef:T,name:w,nativeButton:h=!1,onCheckedChange:V,readOnly:d=!1,required:b=!1,disabled:N=!1,render:ze,uncheckedValue:y,value:C,style:Ee,...A}=s,{clearErrors:H}=le(),{state:R,setTouched:q,setDirty:O,validityData:W,setFilled:v,setFocused:P,validationMode:J,disabled:U,name:Y,validation:c}=ue(),{labelId:_}=fe(),t=U||N,l=Y??w,n=i.useRef(null),G=re(n,T,c.inputRef),m=i.useRef(null),z=pe(),E=he({id:L,implicit:!1,controlRef:m}),B=h?void 0:E,[a,K]=be({controlled:k,default:!!x,name:"Switch",state:"checked"});me(m,z,a,void 0,!t,w),se(()=>{n.current&&v(n.current.checked)},[v]),ye(a,()=>{H(l),O(a!==W.initialValue),v(a),c.change(a)});const{getButtonProps:Q,buttonRef:X}=ie({disabled:t,native:h}),Z=we(g,_,n,!h,B),$={id:h?E:z,role:"switch","aria-checked":a,"aria-readonly":d||void 0,"aria-required":b||void 0,"aria-labelledby":Z,onFocus(){t||P(!0)},onBlur(){const e=n.current;!e||t||(q(!0),P(!1),J==="onBlur"&&c.commit(e.checked))},onClick(e){if(d||t)return;e.preventDefault();const u=n.current;u&&oe(u,e)}},ee={...c.getValidationProps(t),checked:a,disabled:t,form:p,id:B,name:l,required:b,style:l?ke:xe,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:G,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(d){e.preventDefault();return}const u=e.currentTarget.checked,S=ge(ve,e.nativeEvent);V?.(u,S),!S.isCanceled&&K(u)},onClick(e){e.stopPropagation()},onFocus(){m.current?.focus()},...C!==void 0?{value:C}:ne},I=i.useMemo(()=>({...R,checked:a,disabled:t,readOnly:d,required:b}),[R,a,t,d,b]),te=j("span",s,{state:I,ref:[o,m,X],props:[$,A,Q,e=>c.getValidationProps(t,e)],stateAttributesMapping:D});return f.jsxs(M.Provider,{value:I,children:[te,!a&&l&&y!==void 0&&f.jsx("input",{type:"hidden",form:p,name:l,value:y,disabled:t}),f.jsx("input",{...ee,suppressHydrationWarning:!0})]})}),Pe=i.forwardRef(function(s,o){const{render:k,className:F,style:x,...g}=s,p=Ce();return j("span",s,{state:p,ref:o,stateAttributesMapping:D,props:g})});function De({className:r,size:s="default",...o}){return f.jsx(Re,{"data-slot":"switch","data-size":s,className:de("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",r),...o,children:f.jsx(Pe,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}export{De as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,h as l}from"./index-
|
|
1
|
+
import{j as t,h as l}from"./index-B_3U6pyz.js";function o({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function r({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function d({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function n({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",a),...e})}function b({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",a),...e})}function c({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",a),...e})}export{o as T,r as a,n as b,b as c,d,c as e};
|
package/static/dashboard/assets/{useAriaLabelledBy-CIrxFX1m.js → useAriaLabelledBy-x5XF8M1H.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,e as l}from"./index-
|
|
1
|
+
import{r as u,e as l}from"./index-B_3U6pyz.js";import{u as c}from"./createBaseUIEventDetails-BDbAfTsh.js";function y(e,n,t,r=!0,i){const[a,d]=u.useState(),f=c(i?`${i}-label`:void 0),o=e??n??a;return l(()=>{const s=e||n||!r?void 0:L(t.current,f);a!==s&&d(s)}),o}function L(e,n){const t=b(e);if(t)return!t.id&&n&&(t.id=n),t.id||void 0}function b(e){if(!e)return;const n=e.parentElement;if(n&&n.tagName==="LABEL")return n;const t=e.id;if(t){const i=e.nextElementSibling;if(i&&i.htmlFor===t)return i}const r=e.labels;return r&&r[0]}export{y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bc as N,bd as h,be as O,bf as U,bg as k,bh as B,bi as A,bj as y,bk as H,bl as V,bm as M,bn as x,r as p,bo as F,d as j}from"./index-
|
|
1
|
+
import{bc as N,bd as h,be as O,bf as U,bg as k,bh as B,bi as A,bj as y,bk as H,bl as V,bm as M,bn as x,r as p,bo as F,d as j}from"./index-B_3U6pyz.js";var st=class extends N{#e;#t=void 0;#f=void 0;#s=void 0;#n;#c;#i;#p;#u;#l;#a;#o;#r;#d=new Set;constructor(t,e){super(),this.options=e,this.#e=t,this.#i=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Q(this.#t,this.options)?this.#h():this.updateResult(),this.#m())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#g(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof h(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#t.setOptions(this.options),e._defaulted&&!O(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&P(this.#t,s,this.options,e)&&this.#h(),this.updateResult(),i&&(this.#t!==s||h(this.options.enabled,this.#t)!==h(e.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(e.staleTime,this.#t))&&this.#R();const r=this.#v();i&&(this.#t!==s||h(this.options.enabled,this.#t)!==h(e.enabled,this.#t)||r!==this.#r)&&this.#y(r)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return O(this.getCurrentResult(),s)||(this.#s=s,this.#c=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#s}trackResult(t,e){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),e?.(i),Reflect.get(s,i))})}trackProp(t){this.#d.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);let i=()=>{},r;const c=new Promise(a=>{r=a,i=this.#e.getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===s.queryHash&&s.state.data!==void 0&&(i(),a(this.createResult(s,e)))})});return Promise.race([s.fetch().then(()=>{const a=this.createResult(s,e);return r?.(a),a}).finally(()=>{i()}),c])}fetch(t){return this.#h({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#h(t){this.#O();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(U)),e}#b(t){return!k()&&h(this.options.enabled,this.#t)!==!1&&B(t)}#R(){this.#S();const t=h(this.options.staleTime,this.#t);if(this.#s.isStale||!this.#b(t))return;const e=A(this.#s.dataUpdatedAt,t)+1;this.#a=y.setTimeout(()=>{this.#s.isStale||this.updateResult()},e)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(t){this.#g(),this.#r=t,!(this.#r===0||!this.#b(this.#r))&&(this.#o=y.setInterval(()=>{(this.options.refetchIntervalInBackground||H.isFocused())&&this.#h()},this.#r))}#m(){this.#R(),this.#y(this.#v())}#S(){this.#a!==void 0&&(y.clearTimeout(this.#a),this.#a=void 0)}#g(){this.#o!==void 0&&(y.clearInterval(this.#o),this.#o=void 0)}createResult(t,e){const s=this.#t,i=this.options,r=this.#s,c=this.#n,a=this.#c,u=t!==s?t.state:this.#f,{state:l}=t;let n={...l},d=!1,o;if(e._optimisticResults){const f=this.hasListeners(),D=!f&&Q(t,e),L=f&&P(t,s,e,i);(D||L)&&(n={...n,...V(l.data,t.options)}),e._optimisticResults==="isRestoring"&&(n.fetchStatus="idle")}let{error:R,errorUpdatedAt:v,status:b}=n;o=n.data;let I=!1;if(e.placeholderData!==void 0&&o===void 0&&b==="pending"){let f;r?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(f=r.data,I=!0):f=typeof e.placeholderData=="function"?e.placeholderData(this.#l?.state.data,this.#l):e.placeholderData,f!==void 0&&(b="success",o=M(r?.data,f,e),d=!0)}if(e.select&&o!==void 0&&!I)if(r&&o===c?.data&&e.select===this.#p)o=this.#u;else try{this.#p=e.select,o=e.select(o),o=M(r?.data,o,e),this.#u=o,this.#i=null}catch(f){this.#i=f}else o===void 0&&(this.#i=null);this.#i&&(R=this.#i,o=this.#u,v=Date.now(),b="error",d=!1);const m=n.fetchStatus==="fetching",S=b==="pending",g=b==="error",T=S&&m,w=o!==void 0;return{status:b,fetchStatus:n.fetchStatus,isPending:S,isSuccess:b==="success",isError:g,isInitialLoading:T,isLoading:T,data:o,dataUpdatedAt:n.dataUpdatedAt,error:R,errorUpdatedAt:v,failureCount:n.fetchFailureCount,failureReason:n.fetchFailureReason,errorUpdateCount:n.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:n.dataUpdateCount>u.dataUpdateCount||n.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!S,isLoadingError:g&&!w,isPaused:n.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:g&&w,isStale:C(t,e),refetch:this.refetch,isEnabled:h(e.enabled,t)!==!1}}updateResult(){const t=this.#s,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#c=this.options,this.#n.data!==void 0&&(this.#l=this.#t),O(e,t))return;this.#s=e;const i=(()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,c=typeof r=="function"?r():r;if(c==="all"||!c&&!this.#d.size)return!0;const a=new Set(c??this.#d);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(u=>{const l=u;return this.#s[l]!==t[l]&&a.has(l)})})();x.batch(()=>{i&&this.listeners.forEach(r=>{r(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#O(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#f=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#m()}};function W(t,e){return h(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&h(e.retryOnMount,t)===!1)}function Q(t,e){return W(t,e)||t.state.data!==void 0&&E(t,e,e.refetchOnMount)}function E(t,e,s){if(h(e.enabled,t)!==!1&&h(e.staleTime,t)!=="static"){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&C(t,e)}return!1}function P(t,e,s,i){return(t!==e||h(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&C(t,s)}function C(t,e){return h(e.enabled,t)!==!1&&t.isStaleByTime(h(e.staleTime,t))}const _=p.createContext(!1),z=()=>p.useContext(_);_.Provider;function K(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const G=p.createContext(K()),J=()=>p.useContext(G),X=(t,e,s)=>{const i=s?.state.error&&typeof t.throwOnError=="function"?F(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||i)&&(e.isReset()||(t.retryOnMount=!1))},Y=t=>{p.useEffect(()=>{t.clearReset()},[t])},Z=({result:t,errorResetBoundary:e,throwOnError:s,query:i,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(r&&t.data===void 0||F(s,[t.error,i])),it=(t,e)=>e.state.data===void 0,$=t=>{if(t.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...r)=>s(i(...r)):s(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},q=(t,e)=>t?.suspense&&e.isPending,tt=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function rt(t,e,s){const i=z(),r=J(),c=j(),a=c.defaultQueryOptions(t),u=c.getQueryCache().get(a.queryHash),l=t.subscribed!==!1;a._optimisticResults=i?"isRestoring":l?"optimistic":void 0,$(a),X(a,r,u),Y(r);const[n]=p.useState(()=>new e(c,a)),d=n.getOptimisticResult(a),o=!i&&l;if(p.useSyncExternalStore(p.useCallback(R=>{const v=o?n.subscribe(x.batchCalls(R)):U;return n.updateResult(),v},[n,o]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),p.useEffect(()=>{n.setOptions(a)},[a,n]),q(a,d))throw tt(a,n,r);if(Z({result:d,errorResetBoundary:r,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw d.error;return a.notifyOnChangeProps?d:n.trackResult(d)}export{st as Q,it as d,rt as u};
|
package/static/dashboard/assets/{useCompositeItem-YAQuEkY3.js → useCompositeItem-uwStRlwJ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aJ as d,r as f,al as h}from"./index-
|
|
1
|
+
import{aJ as d,r as f,al as h}from"./index-B_3U6pyz.js";import{u as p}from"./CompositeList-U-qk8UP6.js";function I(i={}){const{highlightItemOnHover:n,highlightedIndex:r,onHighlightedIndexChange:u}=d(),{ref:a,index:t}=p(i),o=r===t,s=f.useRef(null),c=h(a,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){u(t)},onMouseMove(){const e=s.current;if(!n||!e)return;const m=e.hasAttribute("disabled")||e.ariaDisabled==="true";!o&&!m&&e.focus()}},compositeRef:c,index:t}}export{I as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as r,Q as u}from"./useBaseQuery-BWQygP2V.js";function a(e,s){return r(e,u)}export{a as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as n}from"./index-B_3U6pyz.js";function u(e){return n(e.defaultTagName??"div",e,e)}export{u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as Dt,b as Tn,T as bt,t as Rn,d as vn,r as he,a as xn,u as Cn,p as In}from"./inertValue-DPJM1mgv.js";import{aF as te,l as ve,aU as se,b6 as ct,aP as Ht,ai as De,e as D,r as a,j as ne,ak as Vt,n as ut,E as Be,f as G,b7 as On,k as wn,al as mt,g as Ge,aH as qe,aI as Pn,b8 as kn,b9 as An,ba as Fn,aV as Mn}from"./index-DBw3b5Rd.js";import{a as w,o as W,m as pe,c as xe,x as Wt,w as at,b as _t,s as Bt,g as Se,t as Ut,q as Yt,n as Nn,p as Ln}from"./createBaseUIEventDetails-D5nICp6F.js";const Dn=["open","progress","review","resolved"],Kr={open:"Open",progress:"In progress",review:"In review",resolved:"Resolved"},$r={open:"bg-status-open text-white",progress:"bg-status-progress text-[#16161a]",review:"bg-status-review text-white",resolved:"bg-status-resolved text-[#16161a]"};function qr(e){return Dn.includes(e)}function zr(e,t=Date.now()){if(!e)return"";const n=Math.max(0,(t-new Date(e).getTime())/1e3);return n<60?"now":n<3600?`${Math.floor(n/60)} min`:n<86400?`${Math.floor(n/3600)} h`:n<86400*30?`${Math.floor(n/86400)} d`:new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short"})}function Jr(e,t=""){const n=e.trim().split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():n.length===1&&n[0].length>0?n[0].slice(0,2).toUpperCase():(t[0]??"?").toUpperCase()}function Hn(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Vn,platform:Wn,maxTouchPoints:_n}=Hn(),Xe=Vn.toLowerCase(),Ne=Wn.toLowerCase(),lt=/^i(os$|p)/.test(Ne)||Ne==="macintel"&&_n>1,yt="android",tt=Ne===yt||Xe.includes(yt),Bn=!lt&&Ne.startsWith("mac");Ne.startsWith("win");const Un=Bn||lt,Ie=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Ie&&Xe.includes("firefox");!Ie&&Xe.includes("chrom");const Yn=Un,jt=/jsdom|happydom/.test(Xe),nt="data-base-ui-focusable",Gt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Qr="ArrowLeft",Zr="ArrowRight",es="ArrowUp",ts="ArrowDown";function ns(e,t){if(!ve(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(w(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function ze(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function jn(e){return e.matches("html,body")}function Xt(e){return te(e)&&e.matches(Gt)}function rs(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Gt}`)!=null}function Et(e){return e?e.getAttribute("role")==="combobox"&&Xt(e):!1}function ss(e){if(!e||jt)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function St(e){return e?e.hasAttribute(nt)?e:e.querySelector(`[${nt}]`)||e:null}function Le(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Le(e,s.id,n)])}function Tt(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function Gn(e){e.preventDefault(),e.stopPropagation()}function Xn(e){return"nativeEvent"in e}function Kn(e){return e.pointerType===""&&e.isTrusted?!0:tt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $n(e){return jt?!1:!tt&&e.width===0&&e.height===0||tt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function os(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function qn(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const zn='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Jn(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return ct(n)?n.host:null}function rt(e){for(const t of Array.from(e.children))if(se(t)==="summary")return t;return null}function Qn(e,t){const n=rt(t);return!!n&&(e===n||w(n,e))}function Kt(e){const t=e?se(e):"";return e!=null&&e.matches(zn)&&(t!=="summary"||e.parentElement!=null&&se(e.parentElement)==="details"&&rt(e.parentElement)===e)&&(t!=="details"||rt(e)==null)&&(t!=="input"||e.type!=="hidden")}function $t(e){if(!Kt(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Jn(t)){const n=t!==e,r=se(t)==="slot";if(t.hasAttribute("inert")||n&&se(t)==="details"&&!t.open&&!Qn(e,t)||t.hasAttribute("hidden")||!r&&!Zn(t,n))return!1}return!0}function Zn(e,t){const n=Ht(e);return t?n.display!=="none":Dt(e,n)}function qt(e){const t=e.tabIndex;if(t<0){const n=se(e);if(n==="details"||n==="audio"||n==="video"||te(e)&&e.isContentEditable)return 0}return t}function Je(e){if(se(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function er(e,t){const n=Je(e);if(!n)return!0;const r=t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form})===n}function zt(e){if(te(e)&&se(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return te(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Jt(e,t){zt(e).forEach(n=>{Kt(n)&&t.push(n),Jt(n,t)})}function Qt(e,t,n){zt(e).forEach(r=>{te(r)&&r.matches(t)&&n.push(r),Qt(r,t,n)})}function ft(e){return $t(e)&&qt(e)>=0}function Zt(e){const t=[];return Jt(e,t),t.filter($t)}function He(e){const t=Zt(e);return t.filter(n=>qt(n)>=0&&er(n,t))}function en(e,t){const n=He(e),r=n.length;if(r===0)return;const s=pe(W(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function tn(e){return en(W(e).body,1)||e}function nn(e){return en(W(e).body,-1)||e}function rn(e,t){if(!e)return null;const n=He(W(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const o=(s+t+r)%r;return n[o]}function is(e){return rn(e,1)}function cs(e){return rn(e,-1)}function Me(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!w(n,r)}function tr(e){He(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rt(e){const t=[];Qt(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Ae=0;class Te{static create(){return new Te}currentId=Ae;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ae,n()},t)}isStarted(){return this.currentId!==Ae}clear=()=>{this.currentId!==Ae&&(clearTimeout(this.currentId),this.currentId=Ae)};disposeEffect=()=>this.clear}function Ue(){const e=De(Te.create).current;return Tn(e.disposeEffect),e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=bt.startingStyle]="startingStyle",e[e.endingStyle=bt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const nr={"data-popup-open":""},rr={"data-popup-open":"","data-pressed":""},sr={"data-open":""},or={"data-closed":""},ir={"data-anchor-hidden":""},us={open(e){return e?nr:null}},as={open(e){return e?rr:null}},cr={open(e){return e?sr:or},anchorHidden(e){return e?ir:null}},ls={...cr,...Rn};function P(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ce(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function We(e){const t=De(ur,e).current;return t.next=e,D(t.effect),t}function ur(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const sn={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ar={...sn,position:"fixed",top:0,left:0},fs={...sn,position:"absolute"},Ye=a.forwardRef(function(t,n){const[r,s]=a.useState();D(()=>{Yn&&Ie&&s("button")},[]);const o={tabIndex:0,role:r};return ne.jsx("span",{...t,ref:n,style:ar,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});function je(e){return`data-base-ui-${e}`}let _e=0;function Qe(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(_e);function o(){s&&!s()||e?.focus({preventScroll:n})}if(r)return o(),Vt;const i=requestAnimationFrame(o);return _e=i,()=>{_e===i&&(cancelAnimationFrame(i),_e=0)}}const Ze={inert:new WeakMap,"aria-hidden":new WeakMap},vt="data-base-ui-inert",st={inert:new WeakSet,"aria-hidden":new WeakSet};let Fe=new WeakMap,et=0;function lr(e){return st[e]}function on(e){return e?ct(e)?e.host:on(e.parentNode):null}const xt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=on(n);return e.contains(r)?r:null}).filter(n=>n!=null),Ct=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},It=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{se(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function fr(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,u=null;const p=xt(t,e),c=s?It(t,Ct(p),new Set(p)):[],y=[],C=[];if(o){const d=Ze[o],g=lr(o);u=g,i=d;const v=xt(t,Array.from(t.querySelectorAll("[aria-live]"))),k=p.concat(v);It(t,Ct(k),new Set(k)).forEach(R=>{const b=R.getAttribute(o),q=b!==null&&b!=="false",V=(d.get(R)||0)+1;d.set(R,V),y.push(R),V===1&&q&&g.add(R),q||R.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(d=>{const g=(Fe.get(d)||0)+1;Fe.set(d,g),C.push(d),g===1&&d.setAttribute(vt,"")}),et+=1,()=>{i&&y.forEach(d=>{const v=(i.get(d)||0)-1;i.set(d,v),v||(!u?.has(d)&&o&&d.removeAttribute(o),u?.delete(d))}),s&&C.forEach(d=>{const g=(Fe.get(d)||0)-1;Fe.set(d,g),g||d.removeAttribute(vt)}),et-=1,et||(Ze.inert=new WeakMap,Ze["aria-hidden"]=new WeakMap,st.inert=new WeakSet,st["aria-hidden"]=new WeakSet,Fe=new WeakMap)}}function Ot(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=W(e[0]).body;return fr(e,o,n,r,{mark:s})}const ds=500,ps=500,gs={style:{transition:"none"}},dr="data-base-ui-click-trigger",hs={fallbackAxisSide:"none"},bs={fallbackAxisSide:"end"},pr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},cn=a.createContext(null),un=()=>a.useContext(cn),gr=je("portal");function hr(e={}){const{ref:t,container:n,componentProps:r=Be,elementProps:s}=e,o=at(),u=un()?.portalNode,[p,c]=a.useState(null),[y,C]=a.useState(null),d=G(S=>{S!==null&&C(S)}),g=a.useRef(null);D(()=>{if(n===null){g.current&&(g.current=null,C(null),c(null));return}const S=(n&&(On(n)?n:n.current))??u??document.body;if(S==null){g.current&&(g.current=null,C(null),c(null));return}g.current!==S&&(g.current=S,C(null),c(S))},[n,u]);const v=wn("div",r,{ref:[t,d],props:[{id:o,[gr]:""},s]}),k=p&&v?ut.createPortal(v,p):null;return{node:y,nodeId:a.isValidElement(v)?v.props.id:void 0,subtree:k}}const ms=a.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:u,...p}=t,{node:c,nodeId:y,subtree:C}=hr({container:u,ref:n,componentProps:t,elementProps:p}),d=a.useRef(null),g=a.useRef(null),v=a.useRef(null),k=a.useRef(null),[S,R]=a.useState(null),b=a.useRef(!1),q=S?.modal,V=S?.open,Y=!!S&&!S.modal&&S.open&&!!c;a.useEffect(()=>{if(!c||q)return;function A(j){c&&j.relatedTarget&&Me(j)&&(j.type==="focusin"?b.current&&(Rt(c),b.current=!1):(tr(c),b.current=!0))}return Ce(P(c,"focusin",A,!0),P(c,"focusout",A,!0))},[c,q]),D(()=>{!c||V!==!0||!b.current||(Rt(c),b.current=!1)},[V,c]);const z=a.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:g,beforeInsideRef:v,afterInsideRef:k,portalNode:c,setFocusManagerState:R}),[c]);return ne.jsxs(a.Fragment,{children:[C,ne.jsxs(cn.Provider,{value:z,children:[Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:d,onFocus:A=>{if(Me(A,c))v.current?.focus();else{const j=S?S.domReference:null;nn(j)?.focus()}}}),Y&&c&&ne.jsx("span",{"aria-owns":y,style:pr}),c&&ut.createPortal(i,c),Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:g,onFocus:A=>{if(Me(A,c))k.current?.focus();else{const j=S?S.domReference:null;tn(j)?.focus(),S?.closeOnFocusOut&&S?.onOpenChange(!1,xe(Wt,A.nativeEvent))}}})]})]})});function an(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class br{nodesRef={current:[]};events=an();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const ln=a.createContext(null),fn=a.createContext(null),dt=()=>a.useContext(ln)?.id||null,pt=e=>{const t=a.useContext(fn);return e??t};function ys(e){const t=at(),n=pt(e),r=dt();return D(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function Es(e){const{children:t,id:n}=e,r=dt();return ne.jsx(ln.Provider,{value:a.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Ss(e){const{children:t,externalTree:n}=e,r=De(()=>n??new br).current;return ne.jsx(fn.Provider,{value:r,children:t})}function mr(e,t){const n=Ge(Se(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const wt=20;let be=[];function gt(){be=be.filter(e=>e.deref()?.isConnected)}function Pt(e){gt(),e&&se(e)!=="body"&&(be.push(new WeakRef(e)),be.length>wt&&(be=be.slice(-wt)))}function kt(){return gt(),be[be.length-1]?.deref()}function yr(e){return e?ft(e)?e:He(e)[0]||e:null}function At(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Zt(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return ft(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Ts(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:u=!0,closeOnFocusOut:p=!0,openInteractionType:c="",nextFocusableElement:y,previousFocusableElement:C,beforeContentFocusGuardRef:d,externalTree:g,getInsideElements:v}=e,k="rootStore"in t?t.rootStore:t,S=k.useState("open"),R=k.useState("domReferenceElement"),b=k.useState("floatingElement"),{events:q,dataRef:V}=k.context,Y=G(()=>V.current.floatingContext?.nodeId),z=s===!1,A=Et(R)&&z,j=We(s),M=We(o),J=We(c),Oe=We(S),_=pt(g),x=un(),U=a.useRef(!1),ae=a.useRef(!1),oe=a.useRef(!1),ie=a.useRef(null),me=a.useRef(""),ge=a.useRef(""),ye=a.useRef(null),Re=a.useRef(null),I=mt(ye,d,x?.beforeInsideRef),Q=mt(Re,x?.afterInsideRef),le=Ue(),fe=Ue(),we=vn(),Ve=x!=null,E=St(b),ce=G((T=E)=>T?He(T):[]),re=G(()=>v?.().filter(T=>T!=null)??[]);a.useEffect(()=>{if(r||!u)return;function T(B){B.key==="Tab"&&w(E,pe(W(E)))&&ce().length===0&&!A&&Gn(B)}const L=W(E);return P(L,"keydown",T)},[r,E,u,A,ce]),a.useEffect(()=>{if(r||!S)return;const T=W(E);function L(){oe.current=!1}function B(Z){const m=Se(Z),F=re(),h=w(b,m)||w(R,m)||w(x?.portalNode,m)||F.some(H=>H===m||w(H,m));oe.current=!h,ge.current=Z.pointerType||"keyboard",m?.closest(`[${dr}]`)&&(ae.current=!0,fe.start(0,()=>{ae.current=!1}))}function X(){ge.current="keyboard"}return Ce(P(T,"pointerdown",B,!0),P(T,"pointerup",L,!0),P(T,"pointercancel",L,!0),P(T,"keydown",X,!0),L)},[r,b,R,E,S,x,fe,re]),a.useEffect(()=>{if(r||!p)return;const T=W(E);function L(){ae.current=!0,fe.start(0,()=>{ae.current=!1})}function B(F){const h=Se(F);ft(h)&&(ie.current=h)}function X(F){const h=F.relatedTarget,H=F.currentTarget,K=Se(F);u&&h==null&&K!=null&&w(b,K)&&Pt(K),queueMicrotask(()=>{const N=Y(),ee=k.context.triggerElements,l=re(),f=h?.hasAttribute(je("focus-guard"))&&[ye.current,Re.current,x?.beforeInsideRef.current,x?.afterInsideRef.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,he(C),he(y)].includes(h),$=!(w(R,h)||w(b,h)||w(h,b)||w(x?.portalNode,h)||l.some(O=>O===h||w(O,h))||ee.hasMatchingElement(O=>w(O,h))||f||_&&(Le(_.nodesRef.current,N).find(O=>w(O.context?.elements.floating,h)||w(O.context?.elements.domReference,h))||Tt(_.nodesRef.current,N).find(O=>[O.context?.elements.floating,St(O.context?.elements.floating)].includes(h)||O.context?.elements.domReference===h)));if(H===R&&E&&At(E),i&&H!==R&&!Dt(K)&&pe(T)===T.body){if(te(E)&&(E.focus(),i==="popup")){we.request(()=>{E.focus()});return}const O=ce(),de=ie.current,Pe=(de&&O.includes(de)?de:null)||O[O.length-1]||E;te(Pe)&&Pe.focus()}if(V.current.insideReactTree){V.current.insideReactTree=!1;return}(A||!u)&&h&&$&&!ae.current&&(A||h!==kt())&&(U.current=!0,k.setOpen(!1,xe(Wt,F)))})}function Z(){oe.current||(V.current.insideReactTree=!0,le.start(0,()=>{V.current.insideReactTree=!1}))}const m=te(R)?R:null;if(!(!b&&!m))return Ce(m&&P(m,"focusout",X),m&&P(m,"pointerdown",L),b&&P(b,"focusin",B),b&&P(b,"focusout",X),b&&x&&P(b,"focusout",Z,!0))},[r,R,b,E,u,_,x,k,p,i,ce,A,Y,V,le,fe,we,y,C,re]),a.useEffect(()=>{if(r||!b||!S)return;const T=Array.from(x?.portalNode?.querySelectorAll(`[${je("portal")}]`)||[]),B=(_?Tt(_.nodesRef.current,Y()):[]).find(H=>Et(H.context?.elements.domReference||null))?.context?.elements.domReference,Z=[...[b,...T,ye.current,Re.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,...re()],B,he(C),he(y),A?R:null].filter(H=>H!=null),m=Ot(Z,{ariaHidden:u||A,mark:!1}),F=[b,...T].filter(H=>H!=null),h=Ot(F);return()=>{h(),m()}},[S,r,R,b,u,x,A,_,Y,y,C,re]),D(()=>{if(!S||r||!te(E))return;me.current="",ge.current="";const T=W(E),L=pe(T);queueMicrotask(()=>{const B=j.current,X=typeof B=="function"?B(J.current||""):B;if(X===void 0||X===!1||w(E,L))return;let m=null;const F=()=>(m==null&&(m=ce(E)),m[0]||E);let h;X===!0||X===null?h=F():h=he(X),h=h||F();const H=w(E,pe(T));Qe(h,{preventScroll:h===E,shouldFocus(){if(!Oe.current)return!1;if(H)return!0;const K=pe(T);return!(K!==h&&w(E,K))}})})},[r,S,E,ce,j,J,Oe]),D(()=>{if(r||!E)return;const T=W(E),L=pe(T),B=J.current==null;Pt(L);function X(m){if(m.open||(me.current=mr(m.nativeEvent,ge.current)),m.reason===_t&&m.nativeEvent.type==="mouseleave"&&(U.current=!0),m.reason===Bt)if(m.nested)U.current=!1;else if(Kn(m.nativeEvent)||$n(m.nativeEvent))U.current=!1;else{let F=!1;W(E).createElement("div").focus({get preventScroll(){return F=!0,!1}}),F?U.current=!1:U.current=!0}}q.on("openchange",X);function Z(m){const F=M.current;let h=typeof F=="function"?F(m):F;if(h===void 0||h===!1)return null;h===null&&(h=!0);const H=R?.isConnected?R:null,K=L?.isConnected&&se(L)!=="body"?L:null;let N=B?K||H:H||K;return N||(N=kt()||null),typeof h=="boolean"?N:he(h)||N||null}return()=>{q.off("openchange",X);const m=pe(T),F=re(),h=w(b,m)||F.some(ee=>ee===m||w(ee,m))||_&&Le(_.nodesRef.current,Y(),!1).some(ee=>w(ee.context?.elements.floating,m)),H=M.current,K=me.current,N=Z(K);queueMicrotask(()=>{const ee=yr(N),l=typeof H!="boolean";if(H&&!U.current&&te(ee)&&(!(!l&&ee!==m&&m!==T.body)||h)){const f={preventScroll:!0};K==="keyboard"&&(f.focusVisible=!0),ee.focus(f)}U.current=!1})}},[r,b,E,M,J,q,_,R,Y,re]),D(()=>{if(!Ie||S||!b)return;const T=pe(W(b));!te(T)||!Xt(T)||w(b,T)&&T.blur()},[S,b]),D(()=>{if(!(r||!x))return x.setFocusManagerState({modal:u,closeOnFocusOut:p,open:S,onOpenChange:k.setOpen,domReference:R}),()=>{x.setFocusManagerState(null)}},[r,x,u,S,k,p,R]),D(()=>{if(!(r||!E))return At(E),()=>{queueMicrotask(gt)}},[r,E]);const Ee=!r&&(u?!A:!0)&&(Ve||u);return ne.jsxs(a.Fragment,{children:[Ee&&ne.jsx(Ye,{"data-type":"inside",ref:I,onFocus:T=>{if(u){const L=ce();Qe(L[L.length-1])}else x?.portalNode&&(U.current=!1,Me(T,x.portalNode)?tn(R)?.focus():he(C??x.beforeOutsideRef)?.focus())}}),n,Ee&&ne.jsx(Ye,{"data-type":"inside",ref:Q,onFocus:T=>{u?Qe(ce()[0]):x?.portalNode&&(p&&(U.current=!0),Me(T,x.portalNode)?nn(R)?.focus():he(y??x.afterOutsideRef)?.focus())}})]})}function Er(){return!1}function Sr(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Rs(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=Er,bubbles:u,externalTree:p}=t,c="rootStore"in e?e.rootStore:e,y=c.useState("open"),C=c.useState("floatingElement"),{dataRef:d}=c.context,g=pt(p),v=G(typeof s=="function"?s:()=>!1),k=typeof s=="function"?v:s,S=k!==!1,R=G(()=>o),{escapeKey:b,outsidePress:q}=Sr(u),V=a.useRef(!1),Y=a.useRef(!1),z=a.useRef(!1),A=a.useRef(!1),j=a.useRef(""),M=a.useRef(null),J=Ue(),Oe=Ue(),_=G(()=>{Oe.clear(),d.current.insideReactTree=!1}),x=G(I=>{const Q=d.current.floatingContext?.nodeId;return(g?Le(g.nodesRef.current,Q):[]).some(fe=>fe.context?.open&&!fe.context.dataRef.current[I])}),U=G(I=>ze(I,c.select("floatingElement"))||ze(I,c.select("domReferenceElement"))),ae=G(I=>{i()&&c.setOpen(!1,xe(Ut,I.nativeEvent))}),oe=G(I=>{if(!y||!n||!r||I.key!=="Escape"||A.current||!b&&x("__escapeKeyBubbles"))return;const Q=Xn(I)?I.nativeEvent:I,le=xe(Yt,Q);c.setOpen(!1,le),le.isCanceled||I.preventDefault(),!b&&!le.isPropagationAllowed&&I.stopPropagation()}),ie=G(()=>{d.current.insideReactTree=!0,Oe.start(0,_)}),me=G(I=>{if(!y||!n||I.button!==0)return;const Q=Se(I.nativeEvent);w(c.select("floatingElement"),Q)&&(V.current||(V.current=!0,Y.current=!1))}),ge=G(I=>{!y||!n||(I.defaultPrevented||I.nativeEvent.defaultPrevented)&&V.current&&(Y.current=!0)});a.useEffect(()=>{if(!y||!n)return _;d.current.__escapeKeyBubbles=b,d.current.__outsidePressBubbles=q;const I=new Te,Q=new Te;function le(){I.clear(),A.current=!0}function fe(){I.start(Ie?5:0,()=>{A.current=!1})}function we(){z.current=!0,Q.start(0,()=>{z.current=!1})}function Ve(){V.current=!1,Y.current=!1}function E(){const l=j.current,f=l==="pen"||!l?"mouse":l,$=R(),O=typeof $=="function"?$():$;return typeof O=="string"?O:O[f]}function ce(l){const f=E();return f==="intentional"&&l.type!=="click"||f==="sloppy"&&l.type==="click"}function re(l){const f=d.current.floatingContext?.nodeId,$=g&&Le(g.nodesRef.current,f).some(O=>ze(l,O.context?.elements.floating));return U(l)||$}function Ee(l){if(ce(l)){l.type!=="click"&&!U(l)&&(Q.clear(),z.current=!1),_();return}if(d.current.insideReactTree){_();return}const f=Se(l),$=`[${je("inert")}]`,O=ve(f)?f.getRootNode():null,de=Array.from((ct(O)?O:W(c.select("floatingElement"))).querySelectorAll($)),Pe=c.context.triggerElements;if(f&&(Pe.hasElement(f)||Pe.hasMatchingElement(ue=>w(ue,f))))return;let ke=ve(f)?f:null;for(;ke&&!qe(ke);){const ue=Pn(ke);if(qe(ue)||!ve(ue))break;ke=ue}if(!(de.length&&ve(f)&&!jn(f)&&!w(f,c.select("floatingElement"))&&de.every(ue=>!w(ke,ue)))){if(te(f)&&!("touches"in l)){const ue=qe(f),$e=Ht(f),ht=/auto|scroll/,gn=ue||ht.test($e.overflowX),hn=ue||ht.test($e.overflowY),bn=gn&&f.clientWidth>0&&f.scrollWidth>f.clientWidth,mn=hn&&f.clientHeight>0&&f.scrollHeight>f.clientHeight,yn=$e.direction==="rtl",En=mn&&(yn?l.offsetX<=f.offsetWidth-f.clientWidth:l.offsetX>f.clientWidth),Sn=bn&&l.offsetY>f.clientHeight;if(En||Sn)return}if(!re(l)){if(E()==="intentional"&&z.current){Q.clear(),z.current=!1;return}typeof k=="function"&&!k(l)||x("__outsidePressBubbles")||(c.setOpen(!1,xe(Bt,l)),_())}}}function T(l){E()!=="sloppy"||l.pointerType==="touch"||!c.select("open")||!n||U(l)||Ee(l)}function L(l){if(E()!=="sloppy"||!c.select("open")||!n||U(l))return;const f=l.touches[0];f&&(M.current={startTime:Date.now(),startX:f.clientX,startY:f.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},J.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function B(l,f){const $=Se(l);if(!$)return;const O=P($,l.type,()=>{f(l),O()})}function X(l){j.current="touch",B(l,L)}function Z(l){J.clear(),l.type==="pointerdown"&&(j.current=l.pointerType),!(l.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)&&B(l,f=>{f.type==="pointerdown"?T(f):Ee(f)})}function m(l){if(!V.current)return;const f=Y.current;if(Ve(),E()==="intentional"){if(l.type==="pointercancel"){f&&we();return}if(!re(l)){if(f){we();return}typeof k=="function"&&!k(l)||(Q.clear(),z.current=!0,_())}}}function F(l){if(E()!=="sloppy"||!M.current||U(l))return;const f=l.touches[0];if(!f)return;const $=Math.abs(f.clientX-M.current.startX),O=Math.abs(f.clientY-M.current.startY),de=Math.sqrt($*$+O*O);de>5&&(M.current.dismissOnTouchEnd=!0),de>10&&(Ee(l),J.clear(),M.current=null)}function h(l){B(l,F)}function H(l){E()!=="sloppy"||!M.current||U(l)||(M.current.dismissOnTouchEnd&&Ee(l),J.clear(),M.current=null)}function K(l){B(l,H)}const N=W(C),ee=Ce(r&&Ce(P(N,"keydown",oe),P(N,"compositionstart",le),P(N,"compositionend",fe)),S&&Ce(P(N,"click",Z,!0),P(N,"pointerdown",Z,!0),P(N,"pointerup",m,!0),P(N,"pointercancel",m,!0),P(N,"mousedown",Z,!0),P(N,"mouseup",m,!0),P(N,"touchstart",X,!0),P(N,"touchmove",h,!0),P(N,"touchend",K,!0)));return()=>{ee(),I.clear(),Q.clear(),Ve(),z.current=!1,_()}},[d,C,r,S,k,y,n,b,q,oe,_,R,x,U,g,c,J]);const ye=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ae,onClick:ae}),[oe,ae]),Re=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ge,onMouseDown:ge,onClickCapture:ie,onMouseDownCapture(I){ie(),me(I)},onPointerDownCapture(I){ie(),me(I)},onMouseUpCapture:ie,onTouchEndCapture:ie,onTouchMoveCapture:ie}),[oe,ie,me,ge]);return a.useMemo(()=>n?{reference:ye,floating:Re,trigger:ye}:{},[n,ye,Re])}var dn=kn();const ot=[];let it;function Tr(){return it}function Rr(e){ot.push(e)}function vr(e){const t=(n,r)=>{const s=De(xr).current;let o;try{it=s;for(const i of ot)i.before(s);o=e(n,r);for(const i of ot)i.after(s);s.didInitialize=!0}finally{it=void 0}return o};return t.displayName=e.displayName||e.name,t}function vs(e){return a.forwardRef(vr(e))}function xr(){return{didInitialize:!1}}const Cr=An(19),Ir=Cr?wr:Pr;function pn(e,t,n,r,s){return Ir(e,t,n,r,s)}function Or(e,t,n,r,s){const o=a.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return dn.useSyncExternalStore(e.subscribe,o,o)}Rr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),dn.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function wr(e,t,n,r,s){const o=Tr();if(!o)return Or(e,t,n,r,s);const i=o.syncIndex;o.syncIndex+=1;let u;return o.didInitialize?(u=o.syncHooks[i],(u.store!==e||u.selector!==t||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,s))&&(u.store!==e&&(o.didChangeStore=!0),u.store=e,u.selector=t,u.a1=n,u.a2=r,u.a3=s,u.value=t(e.getSnapshot(),n,r,s))):(u={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},o.syncHooks.push(u)),u.value}function Pr(e,t,n,r,s){return Fn.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class kr{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return pn(this,t,n,r,s)}}class Ar extends kr{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){a.useDebugValue(t);const r=this;D(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;D(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);D(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){a.useDebugValue(t);const r=this,s=n!==void 0;D(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const o=this.selectors[t];return o(this.state,n,r,s)}useState(t,n,r,s){return a.useDebugValue(t),pn(this,this.selectors[t],n,r,s)}useContextCallback(t,n){a.useDebugValue(t);const r=G(n??Vt);this.context[t]=r}useStateSetter(t){const n=a.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const i=r(o);if(!Object.is(s,i)){const u=s;s=i,n(i,u,this)}})}}const Fr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Mr extends Ar{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:an(),nested:r,triggerElements:o},Fr),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&qn(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function Nr(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,u=t.useState("open"),p=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),y=t.context.triggerElements,C=i,d=a.useRef(null);r===void 0&&d.current===null&&(d.current=new Mr({open:u,transitionStatus:void 0,referenceElement:p,floatingElement:c,triggerElements:y,onOpenChange:C,floatingId:s,syncOnly:!0,nested:o}));const g=r??d.current;return t.useSyncedValue("floatingId",s),D(()=>{const v={open:u,floatingId:s,referenceElement:p,floatingElement:c};ve(p)&&(v.domReferenceElement=p),g.state.positionReference===g.state.referenceElement&&(v.positionReference=p),g.update(v)},[u,s,p,c,g]),g.context.onOpenChange=C,g.context.nested=o,g}const xs={tabIndex:-1,[nt]:""};function Cs(e){return t=>t==="touch"?e.current:!0}function Is(e,t=!1){const n=at(),r=dt()!=null,s=De(()=>e(n,r)).current;return Nr({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Os({handle:e,store:t}){return D(()=>e.attachStore(t),[e,t]),null}function Lr(e,t){const n=a.useRef(null),r=a.useRef(null);return a.useCallback(s=>{if(e===void 0)return;let o=!1;if(n.current!==null){const i=n.current,u=r.current,p=t.context.triggerElements.getById(i);u&&p===u&&(t.context.triggerElements.delete(i),o=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),o=!0),o){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function Dr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function Hr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function ws(e,t,n,r={}){const s=n.reason,o=s===_t,i=t&&s===Ln,u=!t&&(s===Ut||s===Yt),p=Hr(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const y={...r.extraState,open:t};i?y.instantType="focus":u?y.instantType="dismiss":o&&(y.instantType=void 0),Dr(y,t,n.trigger,p()),e.update(y)};o?ut.flushSync(c):c()}function Ps(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=Lr(e,n),i=G(p=>{const c=n.select("open"),y=n.select("activeTriggerId");if(y===e){n.update({activeTriggerElement:p,...c?r:null});return}y==null&&c&&n.update({activeTriggerId:e,activeTriggerElement:p,...r})}),u=a.useCallback(p=>{o(p),p&&i(p)},[o,i]);return D(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:u,isMountedByThisTrigger:s}}function ks(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=a.useRef(null),s=e.useState("open"),o=e.useState("triggerCount"),i=e.useState("activeTriggerId"),u=e.useState("activeTriggerElement");D(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const p=e.context.triggerElements.size,c={};e.state.triggerCount!==p&&(c.triggerCount=p);const y=e.select("activeTriggerId");let C=null;if(y){const d=e.context.triggerElements.getById(y);if(d)r.current=y,d!==e.state.activeTriggerElement&&(c.activeTriggerElement=d);else{for(const[g,v]of e.context.triggerElements.entries())if(v===e.state.activeTriggerElement){c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g;break}c.activeTriggerId===void 0&&(r.current===y?C=y:r.current=null)}}else r.current=null;if(!C&&!y&&p===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[g,v]=d.value;c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),C&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===C&&!e.context.triggerElements.getById(C)){const d=xe(Nn);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,u,n])}function As(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=xn(e),i=t.useState("preventUnmountingOnClose"),u=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:u});const p=G(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Cn({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||p()}}),{forceUnmount:p,transitionStatus:o}}function Fs(e,t){e.useSyncedValues(t),D(()=>()=>{e.update({activeTriggerProps:Be,inactiveTriggerProps:Be,popupProps:Be})},[e])}function Ms(e,t){D(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),D(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Ns{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}const Ls=a.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return ne.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});let Ft={},Mt={},Nt="";function Ke(e,t){return Mn(e)?e:t}function Lt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ke(t,n)).overflowY)}function Vr(e){if(typeof document>"u")return!1;const t=W(e);return Ge(t).innerWidth-t.documentElement.clientWidth>0}function Wr(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=W(e),r=n.documentElement,s=n.body,o=Ke(r,s),i=o.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const p=o.offsetWidth;o.style.overflowY="hidden";const c=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=u,p===c}function _r(e){const t=W(e),n=t.documentElement,r=t.body,s=Ke(n,r),o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function Br(e){const t=W(e),n=t.documentElement,r=t.body,s=Ge(n);let o=0,i=0,u=!1;const p=In.create();if(Ie&&(s.visualViewport?.scale??1)!==1)return()=>{};function c(){const g=s.getComputedStyle(n),v=s.getComputedStyle(r),R=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Ft={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Nt=n.style.scrollBehavior,Mt={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,q=n.scrollWidth>n.clientWidth,V=g.overflowY==="scroll"||v.overflowY==="scroll",Y=g.overflowX==="scroll"||v.overflowX==="scroll",z=Math.max(0,s.innerWidth-r.clientWidth),A=Math.max(0,s.innerHeight-r.clientHeight),j=parseFloat(v.marginTop)+parseFloat(v.marginBottom),M=parseFloat(v.marginLeft)+parseFloat(v.marginRight),J=Ke(n,r);if(u=Wr(e),u){n.style.scrollbarGutter=R,J.style.overflowY="hidden",J.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(b||V)&&(n.style.overflowY="scroll"),(q||Y)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:j||A?`calc(100dvh - ${j+A}px)`:"100dvh",width:M||z?`calc(100vw - ${M+z}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function y(){Object.assign(n.style,Ft),Object.assign(r.style,Mt),u||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Nt)}function C(){y(),p.request(c)}c();const d=P(s,"resize",C);return()=>{p.cancel(),y(),typeof s.removeEventListener=="function"&&d()}}class Ur{lockCount=0;restore=null;timeoutLock=Te.create();timeoutUnlock=Te.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=W(t),r=n.documentElement,s=n.body,o=Ge(r);if(Lt(o,r,s)){const u=new o.MutationObserver(()=>{Lt(o,r,s)||(u.disconnect(),this.restore=null,this.lock(t))}),p={attributes:!0};u.observe(r,p),u.observe(s,p),this.restore=()=>u.disconnect();return}const i=lt||!Vr(t);this.restore=i?_r(t):Br(t)}}const Yr=new Ur;function Ds(e=!0,t=null){D(()=>{if(e)return Yr.acquire(t)},[e,t])}export{Ss as $,Ce as A,Bn as B,Ie as C,je as D,ns as E,xs as F,Xt as G,ss as H,pt as I,dt as J,rs as K,Le as L,Ts as M,ms as N,hs as O,Ns as P,Ls as Q,Ar as R,Kr as S,Te as T,Es as U,br as V,ys as W,Hr as X,Dr as Y,Nr as Z,ds as _,P as a,Me as a0,is as a1,tn as a2,cs as a3,as as a4,Ye as a5,ps as a6,Mr as a7,pn as a8,St as a9,Kn as aa,$n as ab,Et as ac,Qe as ad,Gn as ae,Qr as af,Zr as ag,es as ah,ts as ai,lt as aj,gs as ak,Ds as al,jt as am,Cs as an,Ms as ao,$r as ap,ws as b,ks as c,As as d,Os as e,vr as f,Rs as g,Fs as h,os as i,vs as j,Ps as k,We as l,Ue as m,hr as n,bs as o,ls as p,cr as q,qr as r,Jr as s,us as t,Is as u,zr as v,Dn as w,fs as x,ar as y,dn as z};
|
|
1
|
+
import{j as Dt,b as Tn,T as bt,t as Rn,d as vn,r as he,a as xn,u as Cn,p as In}from"./inertValue-Dl2ZzbZu.js";import{aF as te,l as ve,aU as se,b6 as ct,aP as Ht,ai as De,e as D,r as a,j as ne,ak as Vt,n as ut,E as Be,f as G,b7 as On,k as wn,al as mt,g as Ge,aH as qe,aI as Pn,b8 as kn,b9 as An,ba as Fn,aV as Mn}from"./index-B_3U6pyz.js";import{a as w,o as W,m as pe,c as xe,x as Wt,w as at,b as _t,s as Bt,g as Se,t as Ut,q as Yt,n as Nn,p as Ln}from"./createBaseUIEventDetails-BDbAfTsh.js";const Dn=["open","progress","review","resolved"],Kr={open:"Open",progress:"In progress",review:"In review",resolved:"Resolved"},$r={open:"bg-status-open text-white",progress:"bg-status-progress text-[#16161a]",review:"bg-status-review text-white",resolved:"bg-status-resolved text-[#16161a]"};function qr(e){return Dn.includes(e)}function zr(e,t=Date.now()){if(!e)return"";const n=Math.max(0,(t-new Date(e).getTime())/1e3);return n<60?"now":n<3600?`${Math.floor(n/60)} min`:n<86400?`${Math.floor(n/3600)} h`:n<86400*30?`${Math.floor(n/86400)} d`:new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short"})}function Jr(e,t=""){const n=e.trim().split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():n.length===1&&n[0].length>0?n[0].slice(0,2).toUpperCase():(t[0]??"?").toUpperCase()}function Hn(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Vn,platform:Wn,maxTouchPoints:_n}=Hn(),Xe=Vn.toLowerCase(),Ne=Wn.toLowerCase(),lt=/^i(os$|p)/.test(Ne)||Ne==="macintel"&&_n>1,yt="android",tt=Ne===yt||Xe.includes(yt),Bn=!lt&&Ne.startsWith("mac");Ne.startsWith("win");const Un=Bn||lt,Ie=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Ie&&Xe.includes("firefox");!Ie&&Xe.includes("chrom");const Yn=Un,jt=/jsdom|happydom/.test(Xe),nt="data-base-ui-focusable",Gt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Qr="ArrowLeft",Zr="ArrowRight",es="ArrowUp",ts="ArrowDown";function ns(e,t){if(!ve(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(w(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function ze(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function jn(e){return e.matches("html,body")}function Xt(e){return te(e)&&e.matches(Gt)}function rs(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Gt}`)!=null}function Et(e){return e?e.getAttribute("role")==="combobox"&&Xt(e):!1}function ss(e){if(!e||jt)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function St(e){return e?e.hasAttribute(nt)?e:e.querySelector(`[${nt}]`)||e:null}function Le(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Le(e,s.id,n)])}function Tt(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function Gn(e){e.preventDefault(),e.stopPropagation()}function Xn(e){return"nativeEvent"in e}function Kn(e){return e.pointerType===""&&e.isTrusted?!0:tt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $n(e){return jt?!1:!tt&&e.width===0&&e.height===0||tt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function os(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function qn(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const zn='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Jn(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return ct(n)?n.host:null}function rt(e){for(const t of Array.from(e.children))if(se(t)==="summary")return t;return null}function Qn(e,t){const n=rt(t);return!!n&&(e===n||w(n,e))}function Kt(e){const t=e?se(e):"";return e!=null&&e.matches(zn)&&(t!=="summary"||e.parentElement!=null&&se(e.parentElement)==="details"&&rt(e.parentElement)===e)&&(t!=="details"||rt(e)==null)&&(t!=="input"||e.type!=="hidden")}function $t(e){if(!Kt(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Jn(t)){const n=t!==e,r=se(t)==="slot";if(t.hasAttribute("inert")||n&&se(t)==="details"&&!t.open&&!Qn(e,t)||t.hasAttribute("hidden")||!r&&!Zn(t,n))return!1}return!0}function Zn(e,t){const n=Ht(e);return t?n.display!=="none":Dt(e,n)}function qt(e){const t=e.tabIndex;if(t<0){const n=se(e);if(n==="details"||n==="audio"||n==="video"||te(e)&&e.isContentEditable)return 0}return t}function Je(e){if(se(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function er(e,t){const n=Je(e);if(!n)return!0;const r=t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form})===n}function zt(e){if(te(e)&&se(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return te(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Jt(e,t){zt(e).forEach(n=>{Kt(n)&&t.push(n),Jt(n,t)})}function Qt(e,t,n){zt(e).forEach(r=>{te(r)&&r.matches(t)&&n.push(r),Qt(r,t,n)})}function ft(e){return $t(e)&&qt(e)>=0}function Zt(e){const t=[];return Jt(e,t),t.filter($t)}function He(e){const t=Zt(e);return t.filter(n=>qt(n)>=0&&er(n,t))}function en(e,t){const n=He(e),r=n.length;if(r===0)return;const s=pe(W(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function tn(e){return en(W(e).body,1)||e}function nn(e){return en(W(e).body,-1)||e}function rn(e,t){if(!e)return null;const n=He(W(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const o=(s+t+r)%r;return n[o]}function is(e){return rn(e,1)}function cs(e){return rn(e,-1)}function Me(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!w(n,r)}function tr(e){He(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rt(e){const t=[];Qt(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Ae=0;class Te{static create(){return new Te}currentId=Ae;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ae,n()},t)}isStarted(){return this.currentId!==Ae}clear=()=>{this.currentId!==Ae&&(clearTimeout(this.currentId),this.currentId=Ae)};disposeEffect=()=>this.clear}function Ue(){const e=De(Te.create).current;return Tn(e.disposeEffect),e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=bt.startingStyle]="startingStyle",e[e.endingStyle=bt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const nr={"data-popup-open":""},rr={"data-popup-open":"","data-pressed":""},sr={"data-open":""},or={"data-closed":""},ir={"data-anchor-hidden":""},us={open(e){return e?nr:null}},as={open(e){return e?rr:null}},cr={open(e){return e?sr:or},anchorHidden(e){return e?ir:null}},ls={...cr,...Rn};function P(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ce(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function We(e){const t=De(ur,e).current;return t.next=e,D(t.effect),t}function ur(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const sn={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ar={...sn,position:"fixed",top:0,left:0},fs={...sn,position:"absolute"},Ye=a.forwardRef(function(t,n){const[r,s]=a.useState();D(()=>{Yn&&Ie&&s("button")},[]);const o={tabIndex:0,role:r};return ne.jsx("span",{...t,ref:n,style:ar,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});function je(e){return`data-base-ui-${e}`}let _e=0;function Qe(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(_e);function o(){s&&!s()||e?.focus({preventScroll:n})}if(r)return o(),Vt;const i=requestAnimationFrame(o);return _e=i,()=>{_e===i&&(cancelAnimationFrame(i),_e=0)}}const Ze={inert:new WeakMap,"aria-hidden":new WeakMap},vt="data-base-ui-inert",st={inert:new WeakSet,"aria-hidden":new WeakSet};let Fe=new WeakMap,et=0;function lr(e){return st[e]}function on(e){return e?ct(e)?e.host:on(e.parentNode):null}const xt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=on(n);return e.contains(r)?r:null}).filter(n=>n!=null),Ct=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},It=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{se(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function fr(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,u=null;const p=xt(t,e),c=s?It(t,Ct(p),new Set(p)):[],y=[],C=[];if(o){const d=Ze[o],g=lr(o);u=g,i=d;const v=xt(t,Array.from(t.querySelectorAll("[aria-live]"))),k=p.concat(v);It(t,Ct(k),new Set(k)).forEach(R=>{const b=R.getAttribute(o),q=b!==null&&b!=="false",V=(d.get(R)||0)+1;d.set(R,V),y.push(R),V===1&&q&&g.add(R),q||R.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(d=>{const g=(Fe.get(d)||0)+1;Fe.set(d,g),C.push(d),g===1&&d.setAttribute(vt,"")}),et+=1,()=>{i&&y.forEach(d=>{const v=(i.get(d)||0)-1;i.set(d,v),v||(!u?.has(d)&&o&&d.removeAttribute(o),u?.delete(d))}),s&&C.forEach(d=>{const g=(Fe.get(d)||0)-1;Fe.set(d,g),g||d.removeAttribute(vt)}),et-=1,et||(Ze.inert=new WeakMap,Ze["aria-hidden"]=new WeakMap,st.inert=new WeakSet,st["aria-hidden"]=new WeakSet,Fe=new WeakMap)}}function Ot(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=W(e[0]).body;return fr(e,o,n,r,{mark:s})}const ds=500,ps=500,gs={style:{transition:"none"}},dr="data-base-ui-click-trigger",hs={fallbackAxisSide:"none"},bs={fallbackAxisSide:"end"},pr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},cn=a.createContext(null),un=()=>a.useContext(cn),gr=je("portal");function hr(e={}){const{ref:t,container:n,componentProps:r=Be,elementProps:s}=e,o=at(),u=un()?.portalNode,[p,c]=a.useState(null),[y,C]=a.useState(null),d=G(S=>{S!==null&&C(S)}),g=a.useRef(null);D(()=>{if(n===null){g.current&&(g.current=null,C(null),c(null));return}const S=(n&&(On(n)?n:n.current))??u??document.body;if(S==null){g.current&&(g.current=null,C(null),c(null));return}g.current!==S&&(g.current=S,C(null),c(S))},[n,u]);const v=wn("div",r,{ref:[t,d],props:[{id:o,[gr]:""},s]}),k=p&&v?ut.createPortal(v,p):null;return{node:y,nodeId:a.isValidElement(v)?v.props.id:void 0,subtree:k}}const ms=a.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:u,...p}=t,{node:c,nodeId:y,subtree:C}=hr({container:u,ref:n,componentProps:t,elementProps:p}),d=a.useRef(null),g=a.useRef(null),v=a.useRef(null),k=a.useRef(null),[S,R]=a.useState(null),b=a.useRef(!1),q=S?.modal,V=S?.open,Y=!!S&&!S.modal&&S.open&&!!c;a.useEffect(()=>{if(!c||q)return;function A(j){c&&j.relatedTarget&&Me(j)&&(j.type==="focusin"?b.current&&(Rt(c),b.current=!1):(tr(c),b.current=!0))}return Ce(P(c,"focusin",A,!0),P(c,"focusout",A,!0))},[c,q]),D(()=>{!c||V!==!0||!b.current||(Rt(c),b.current=!1)},[V,c]);const z=a.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:g,beforeInsideRef:v,afterInsideRef:k,portalNode:c,setFocusManagerState:R}),[c]);return ne.jsxs(a.Fragment,{children:[C,ne.jsxs(cn.Provider,{value:z,children:[Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:d,onFocus:A=>{if(Me(A,c))v.current?.focus();else{const j=S?S.domReference:null;nn(j)?.focus()}}}),Y&&c&&ne.jsx("span",{"aria-owns":y,style:pr}),c&&ut.createPortal(i,c),Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:g,onFocus:A=>{if(Me(A,c))k.current?.focus();else{const j=S?S.domReference:null;tn(j)?.focus(),S?.closeOnFocusOut&&S?.onOpenChange(!1,xe(Wt,A.nativeEvent))}}})]})]})});function an(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class br{nodesRef={current:[]};events=an();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const ln=a.createContext(null),fn=a.createContext(null),dt=()=>a.useContext(ln)?.id||null,pt=e=>{const t=a.useContext(fn);return e??t};function ys(e){const t=at(),n=pt(e),r=dt();return D(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function Es(e){const{children:t,id:n}=e,r=dt();return ne.jsx(ln.Provider,{value:a.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Ss(e){const{children:t,externalTree:n}=e,r=De(()=>n??new br).current;return ne.jsx(fn.Provider,{value:r,children:t})}function mr(e,t){const n=Ge(Se(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const wt=20;let be=[];function gt(){be=be.filter(e=>e.deref()?.isConnected)}function Pt(e){gt(),e&&se(e)!=="body"&&(be.push(new WeakRef(e)),be.length>wt&&(be=be.slice(-wt)))}function kt(){return gt(),be[be.length-1]?.deref()}function yr(e){return e?ft(e)?e:He(e)[0]||e:null}function At(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Zt(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return ft(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Ts(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:u=!0,closeOnFocusOut:p=!0,openInteractionType:c="",nextFocusableElement:y,previousFocusableElement:C,beforeContentFocusGuardRef:d,externalTree:g,getInsideElements:v}=e,k="rootStore"in t?t.rootStore:t,S=k.useState("open"),R=k.useState("domReferenceElement"),b=k.useState("floatingElement"),{events:q,dataRef:V}=k.context,Y=G(()=>V.current.floatingContext?.nodeId),z=s===!1,A=Et(R)&&z,j=We(s),M=We(o),J=We(c),Oe=We(S),_=pt(g),x=un(),U=a.useRef(!1),ae=a.useRef(!1),oe=a.useRef(!1),ie=a.useRef(null),me=a.useRef(""),ge=a.useRef(""),ye=a.useRef(null),Re=a.useRef(null),I=mt(ye,d,x?.beforeInsideRef),Q=mt(Re,x?.afterInsideRef),le=Ue(),fe=Ue(),we=vn(),Ve=x!=null,E=St(b),ce=G((T=E)=>T?He(T):[]),re=G(()=>v?.().filter(T=>T!=null)??[]);a.useEffect(()=>{if(r||!u)return;function T(B){B.key==="Tab"&&w(E,pe(W(E)))&&ce().length===0&&!A&&Gn(B)}const L=W(E);return P(L,"keydown",T)},[r,E,u,A,ce]),a.useEffect(()=>{if(r||!S)return;const T=W(E);function L(){oe.current=!1}function B(Z){const m=Se(Z),F=re(),h=w(b,m)||w(R,m)||w(x?.portalNode,m)||F.some(H=>H===m||w(H,m));oe.current=!h,ge.current=Z.pointerType||"keyboard",m?.closest(`[${dr}]`)&&(ae.current=!0,fe.start(0,()=>{ae.current=!1}))}function X(){ge.current="keyboard"}return Ce(P(T,"pointerdown",B,!0),P(T,"pointerup",L,!0),P(T,"pointercancel",L,!0),P(T,"keydown",X,!0),L)},[r,b,R,E,S,x,fe,re]),a.useEffect(()=>{if(r||!p)return;const T=W(E);function L(){ae.current=!0,fe.start(0,()=>{ae.current=!1})}function B(F){const h=Se(F);ft(h)&&(ie.current=h)}function X(F){const h=F.relatedTarget,H=F.currentTarget,K=Se(F);u&&h==null&&K!=null&&w(b,K)&&Pt(K),queueMicrotask(()=>{const N=Y(),ee=k.context.triggerElements,l=re(),f=h?.hasAttribute(je("focus-guard"))&&[ye.current,Re.current,x?.beforeInsideRef.current,x?.afterInsideRef.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,he(C),he(y)].includes(h),$=!(w(R,h)||w(b,h)||w(h,b)||w(x?.portalNode,h)||l.some(O=>O===h||w(O,h))||ee.hasMatchingElement(O=>w(O,h))||f||_&&(Le(_.nodesRef.current,N).find(O=>w(O.context?.elements.floating,h)||w(O.context?.elements.domReference,h))||Tt(_.nodesRef.current,N).find(O=>[O.context?.elements.floating,St(O.context?.elements.floating)].includes(h)||O.context?.elements.domReference===h)));if(H===R&&E&&At(E),i&&H!==R&&!Dt(K)&&pe(T)===T.body){if(te(E)&&(E.focus(),i==="popup")){we.request(()=>{E.focus()});return}const O=ce(),de=ie.current,Pe=(de&&O.includes(de)?de:null)||O[O.length-1]||E;te(Pe)&&Pe.focus()}if(V.current.insideReactTree){V.current.insideReactTree=!1;return}(A||!u)&&h&&$&&!ae.current&&(A||h!==kt())&&(U.current=!0,k.setOpen(!1,xe(Wt,F)))})}function Z(){oe.current||(V.current.insideReactTree=!0,le.start(0,()=>{V.current.insideReactTree=!1}))}const m=te(R)?R:null;if(!(!b&&!m))return Ce(m&&P(m,"focusout",X),m&&P(m,"pointerdown",L),b&&P(b,"focusin",B),b&&P(b,"focusout",X),b&&x&&P(b,"focusout",Z,!0))},[r,R,b,E,u,_,x,k,p,i,ce,A,Y,V,le,fe,we,y,C,re]),a.useEffect(()=>{if(r||!b||!S)return;const T=Array.from(x?.portalNode?.querySelectorAll(`[${je("portal")}]`)||[]),B=(_?Tt(_.nodesRef.current,Y()):[]).find(H=>Et(H.context?.elements.domReference||null))?.context?.elements.domReference,Z=[...[b,...T,ye.current,Re.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,...re()],B,he(C),he(y),A?R:null].filter(H=>H!=null),m=Ot(Z,{ariaHidden:u||A,mark:!1}),F=[b,...T].filter(H=>H!=null),h=Ot(F);return()=>{h(),m()}},[S,r,R,b,u,x,A,_,Y,y,C,re]),D(()=>{if(!S||r||!te(E))return;me.current="",ge.current="";const T=W(E),L=pe(T);queueMicrotask(()=>{const B=j.current,X=typeof B=="function"?B(J.current||""):B;if(X===void 0||X===!1||w(E,L))return;let m=null;const F=()=>(m==null&&(m=ce(E)),m[0]||E);let h;X===!0||X===null?h=F():h=he(X),h=h||F();const H=w(E,pe(T));Qe(h,{preventScroll:h===E,shouldFocus(){if(!Oe.current)return!1;if(H)return!0;const K=pe(T);return!(K!==h&&w(E,K))}})})},[r,S,E,ce,j,J,Oe]),D(()=>{if(r||!E)return;const T=W(E),L=pe(T),B=J.current==null;Pt(L);function X(m){if(m.open||(me.current=mr(m.nativeEvent,ge.current)),m.reason===_t&&m.nativeEvent.type==="mouseleave"&&(U.current=!0),m.reason===Bt)if(m.nested)U.current=!1;else if(Kn(m.nativeEvent)||$n(m.nativeEvent))U.current=!1;else{let F=!1;W(E).createElement("div").focus({get preventScroll(){return F=!0,!1}}),F?U.current=!1:U.current=!0}}q.on("openchange",X);function Z(m){const F=M.current;let h=typeof F=="function"?F(m):F;if(h===void 0||h===!1)return null;h===null&&(h=!0);const H=R?.isConnected?R:null,K=L?.isConnected&&se(L)!=="body"?L:null;let N=B?K||H:H||K;return N||(N=kt()||null),typeof h=="boolean"?N:he(h)||N||null}return()=>{q.off("openchange",X);const m=pe(T),F=re(),h=w(b,m)||F.some(ee=>ee===m||w(ee,m))||_&&Le(_.nodesRef.current,Y(),!1).some(ee=>w(ee.context?.elements.floating,m)),H=M.current,K=me.current,N=Z(K);queueMicrotask(()=>{const ee=yr(N),l=typeof H!="boolean";if(H&&!U.current&&te(ee)&&(!(!l&&ee!==m&&m!==T.body)||h)){const f={preventScroll:!0};K==="keyboard"&&(f.focusVisible=!0),ee.focus(f)}U.current=!1})}},[r,b,E,M,J,q,_,R,Y,re]),D(()=>{if(!Ie||S||!b)return;const T=pe(W(b));!te(T)||!Xt(T)||w(b,T)&&T.blur()},[S,b]),D(()=>{if(!(r||!x))return x.setFocusManagerState({modal:u,closeOnFocusOut:p,open:S,onOpenChange:k.setOpen,domReference:R}),()=>{x.setFocusManagerState(null)}},[r,x,u,S,k,p,R]),D(()=>{if(!(r||!E))return At(E),()=>{queueMicrotask(gt)}},[r,E]);const Ee=!r&&(u?!A:!0)&&(Ve||u);return ne.jsxs(a.Fragment,{children:[Ee&&ne.jsx(Ye,{"data-type":"inside",ref:I,onFocus:T=>{if(u){const L=ce();Qe(L[L.length-1])}else x?.portalNode&&(U.current=!1,Me(T,x.portalNode)?tn(R)?.focus():he(C??x.beforeOutsideRef)?.focus())}}),n,Ee&&ne.jsx(Ye,{"data-type":"inside",ref:Q,onFocus:T=>{u?Qe(ce()[0]):x?.portalNode&&(p&&(U.current=!0),Me(T,x.portalNode)?nn(R)?.focus():he(y??x.afterOutsideRef)?.focus())}})]})}function Er(){return!1}function Sr(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Rs(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=Er,bubbles:u,externalTree:p}=t,c="rootStore"in e?e.rootStore:e,y=c.useState("open"),C=c.useState("floatingElement"),{dataRef:d}=c.context,g=pt(p),v=G(typeof s=="function"?s:()=>!1),k=typeof s=="function"?v:s,S=k!==!1,R=G(()=>o),{escapeKey:b,outsidePress:q}=Sr(u),V=a.useRef(!1),Y=a.useRef(!1),z=a.useRef(!1),A=a.useRef(!1),j=a.useRef(""),M=a.useRef(null),J=Ue(),Oe=Ue(),_=G(()=>{Oe.clear(),d.current.insideReactTree=!1}),x=G(I=>{const Q=d.current.floatingContext?.nodeId;return(g?Le(g.nodesRef.current,Q):[]).some(fe=>fe.context?.open&&!fe.context.dataRef.current[I])}),U=G(I=>ze(I,c.select("floatingElement"))||ze(I,c.select("domReferenceElement"))),ae=G(I=>{i()&&c.setOpen(!1,xe(Ut,I.nativeEvent))}),oe=G(I=>{if(!y||!n||!r||I.key!=="Escape"||A.current||!b&&x("__escapeKeyBubbles"))return;const Q=Xn(I)?I.nativeEvent:I,le=xe(Yt,Q);c.setOpen(!1,le),le.isCanceled||I.preventDefault(),!b&&!le.isPropagationAllowed&&I.stopPropagation()}),ie=G(()=>{d.current.insideReactTree=!0,Oe.start(0,_)}),me=G(I=>{if(!y||!n||I.button!==0)return;const Q=Se(I.nativeEvent);w(c.select("floatingElement"),Q)&&(V.current||(V.current=!0,Y.current=!1))}),ge=G(I=>{!y||!n||(I.defaultPrevented||I.nativeEvent.defaultPrevented)&&V.current&&(Y.current=!0)});a.useEffect(()=>{if(!y||!n)return _;d.current.__escapeKeyBubbles=b,d.current.__outsidePressBubbles=q;const I=new Te,Q=new Te;function le(){I.clear(),A.current=!0}function fe(){I.start(Ie?5:0,()=>{A.current=!1})}function we(){z.current=!0,Q.start(0,()=>{z.current=!1})}function Ve(){V.current=!1,Y.current=!1}function E(){const l=j.current,f=l==="pen"||!l?"mouse":l,$=R(),O=typeof $=="function"?$():$;return typeof O=="string"?O:O[f]}function ce(l){const f=E();return f==="intentional"&&l.type!=="click"||f==="sloppy"&&l.type==="click"}function re(l){const f=d.current.floatingContext?.nodeId,$=g&&Le(g.nodesRef.current,f).some(O=>ze(l,O.context?.elements.floating));return U(l)||$}function Ee(l){if(ce(l)){l.type!=="click"&&!U(l)&&(Q.clear(),z.current=!1),_();return}if(d.current.insideReactTree){_();return}const f=Se(l),$=`[${je("inert")}]`,O=ve(f)?f.getRootNode():null,de=Array.from((ct(O)?O:W(c.select("floatingElement"))).querySelectorAll($)),Pe=c.context.triggerElements;if(f&&(Pe.hasElement(f)||Pe.hasMatchingElement(ue=>w(ue,f))))return;let ke=ve(f)?f:null;for(;ke&&!qe(ke);){const ue=Pn(ke);if(qe(ue)||!ve(ue))break;ke=ue}if(!(de.length&&ve(f)&&!jn(f)&&!w(f,c.select("floatingElement"))&&de.every(ue=>!w(ke,ue)))){if(te(f)&&!("touches"in l)){const ue=qe(f),$e=Ht(f),ht=/auto|scroll/,gn=ue||ht.test($e.overflowX),hn=ue||ht.test($e.overflowY),bn=gn&&f.clientWidth>0&&f.scrollWidth>f.clientWidth,mn=hn&&f.clientHeight>0&&f.scrollHeight>f.clientHeight,yn=$e.direction==="rtl",En=mn&&(yn?l.offsetX<=f.offsetWidth-f.clientWidth:l.offsetX>f.clientWidth),Sn=bn&&l.offsetY>f.clientHeight;if(En||Sn)return}if(!re(l)){if(E()==="intentional"&&z.current){Q.clear(),z.current=!1;return}typeof k=="function"&&!k(l)||x("__outsidePressBubbles")||(c.setOpen(!1,xe(Bt,l)),_())}}}function T(l){E()!=="sloppy"||l.pointerType==="touch"||!c.select("open")||!n||U(l)||Ee(l)}function L(l){if(E()!=="sloppy"||!c.select("open")||!n||U(l))return;const f=l.touches[0];f&&(M.current={startTime:Date.now(),startX:f.clientX,startY:f.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},J.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function B(l,f){const $=Se(l);if(!$)return;const O=P($,l.type,()=>{f(l),O()})}function X(l){j.current="touch",B(l,L)}function Z(l){J.clear(),l.type==="pointerdown"&&(j.current=l.pointerType),!(l.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)&&B(l,f=>{f.type==="pointerdown"?T(f):Ee(f)})}function m(l){if(!V.current)return;const f=Y.current;if(Ve(),E()==="intentional"){if(l.type==="pointercancel"){f&&we();return}if(!re(l)){if(f){we();return}typeof k=="function"&&!k(l)||(Q.clear(),z.current=!0,_())}}}function F(l){if(E()!=="sloppy"||!M.current||U(l))return;const f=l.touches[0];if(!f)return;const $=Math.abs(f.clientX-M.current.startX),O=Math.abs(f.clientY-M.current.startY),de=Math.sqrt($*$+O*O);de>5&&(M.current.dismissOnTouchEnd=!0),de>10&&(Ee(l),J.clear(),M.current=null)}function h(l){B(l,F)}function H(l){E()!=="sloppy"||!M.current||U(l)||(M.current.dismissOnTouchEnd&&Ee(l),J.clear(),M.current=null)}function K(l){B(l,H)}const N=W(C),ee=Ce(r&&Ce(P(N,"keydown",oe),P(N,"compositionstart",le),P(N,"compositionend",fe)),S&&Ce(P(N,"click",Z,!0),P(N,"pointerdown",Z,!0),P(N,"pointerup",m,!0),P(N,"pointercancel",m,!0),P(N,"mousedown",Z,!0),P(N,"mouseup",m,!0),P(N,"touchstart",X,!0),P(N,"touchmove",h,!0),P(N,"touchend",K,!0)));return()=>{ee(),I.clear(),Q.clear(),Ve(),z.current=!1,_()}},[d,C,r,S,k,y,n,b,q,oe,_,R,x,U,g,c,J]);const ye=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ae,onClick:ae}),[oe,ae]),Re=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ge,onMouseDown:ge,onClickCapture:ie,onMouseDownCapture(I){ie(),me(I)},onPointerDownCapture(I){ie(),me(I)},onMouseUpCapture:ie,onTouchEndCapture:ie,onTouchMoveCapture:ie}),[oe,ie,me,ge]);return a.useMemo(()=>n?{reference:ye,floating:Re,trigger:ye}:{},[n,ye,Re])}var dn=kn();const ot=[];let it;function Tr(){return it}function Rr(e){ot.push(e)}function vr(e){const t=(n,r)=>{const s=De(xr).current;let o;try{it=s;for(const i of ot)i.before(s);o=e(n,r);for(const i of ot)i.after(s);s.didInitialize=!0}finally{it=void 0}return o};return t.displayName=e.displayName||e.name,t}function vs(e){return a.forwardRef(vr(e))}function xr(){return{didInitialize:!1}}const Cr=An(19),Ir=Cr?wr:Pr;function pn(e,t,n,r,s){return Ir(e,t,n,r,s)}function Or(e,t,n,r,s){const o=a.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return dn.useSyncExternalStore(e.subscribe,o,o)}Rr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),dn.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function wr(e,t,n,r,s){const o=Tr();if(!o)return Or(e,t,n,r,s);const i=o.syncIndex;o.syncIndex+=1;let u;return o.didInitialize?(u=o.syncHooks[i],(u.store!==e||u.selector!==t||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,s))&&(u.store!==e&&(o.didChangeStore=!0),u.store=e,u.selector=t,u.a1=n,u.a2=r,u.a3=s,u.value=t(e.getSnapshot(),n,r,s))):(u={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},o.syncHooks.push(u)),u.value}function Pr(e,t,n,r,s){return Fn.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class kr{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return pn(this,t,n,r,s)}}class Ar extends kr{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){a.useDebugValue(t);const r=this;D(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;D(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);D(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){a.useDebugValue(t);const r=this,s=n!==void 0;D(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const o=this.selectors[t];return o(this.state,n,r,s)}useState(t,n,r,s){return a.useDebugValue(t),pn(this,this.selectors[t],n,r,s)}useContextCallback(t,n){a.useDebugValue(t);const r=G(n??Vt);this.context[t]=r}useStateSetter(t){const n=a.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const i=r(o);if(!Object.is(s,i)){const u=s;s=i,n(i,u,this)}})}}const Fr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Mr extends Ar{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:an(),nested:r,triggerElements:o},Fr),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&qn(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function Nr(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,u=t.useState("open"),p=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),y=t.context.triggerElements,C=i,d=a.useRef(null);r===void 0&&d.current===null&&(d.current=new Mr({open:u,transitionStatus:void 0,referenceElement:p,floatingElement:c,triggerElements:y,onOpenChange:C,floatingId:s,syncOnly:!0,nested:o}));const g=r??d.current;return t.useSyncedValue("floatingId",s),D(()=>{const v={open:u,floatingId:s,referenceElement:p,floatingElement:c};ve(p)&&(v.domReferenceElement=p),g.state.positionReference===g.state.referenceElement&&(v.positionReference=p),g.update(v)},[u,s,p,c,g]),g.context.onOpenChange=C,g.context.nested=o,g}const xs={tabIndex:-1,[nt]:""};function Cs(e){return t=>t==="touch"?e.current:!0}function Is(e,t=!1){const n=at(),r=dt()!=null,s=De(()=>e(n,r)).current;return Nr({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Os({handle:e,store:t}){return D(()=>e.attachStore(t),[e,t]),null}function Lr(e,t){const n=a.useRef(null),r=a.useRef(null);return a.useCallback(s=>{if(e===void 0)return;let o=!1;if(n.current!==null){const i=n.current,u=r.current,p=t.context.triggerElements.getById(i);u&&p===u&&(t.context.triggerElements.delete(i),o=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),o=!0),o){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function Dr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function Hr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function ws(e,t,n,r={}){const s=n.reason,o=s===_t,i=t&&s===Ln,u=!t&&(s===Ut||s===Yt),p=Hr(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const y={...r.extraState,open:t};i?y.instantType="focus":u?y.instantType="dismiss":o&&(y.instantType=void 0),Dr(y,t,n.trigger,p()),e.update(y)};o?ut.flushSync(c):c()}function Ps(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=Lr(e,n),i=G(p=>{const c=n.select("open"),y=n.select("activeTriggerId");if(y===e){n.update({activeTriggerElement:p,...c?r:null});return}y==null&&c&&n.update({activeTriggerId:e,activeTriggerElement:p,...r})}),u=a.useCallback(p=>{o(p),p&&i(p)},[o,i]);return D(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:u,isMountedByThisTrigger:s}}function ks(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=a.useRef(null),s=e.useState("open"),o=e.useState("triggerCount"),i=e.useState("activeTriggerId"),u=e.useState("activeTriggerElement");D(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const p=e.context.triggerElements.size,c={};e.state.triggerCount!==p&&(c.triggerCount=p);const y=e.select("activeTriggerId");let C=null;if(y){const d=e.context.triggerElements.getById(y);if(d)r.current=y,d!==e.state.activeTriggerElement&&(c.activeTriggerElement=d);else{for(const[g,v]of e.context.triggerElements.entries())if(v===e.state.activeTriggerElement){c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g;break}c.activeTriggerId===void 0&&(r.current===y?C=y:r.current=null)}}else r.current=null;if(!C&&!y&&p===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[g,v]=d.value;c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),C&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===C&&!e.context.triggerElements.getById(C)){const d=xe(Nn);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,u,n])}function As(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=xn(e),i=t.useState("preventUnmountingOnClose"),u=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:u});const p=G(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Cn({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||p()}}),{forceUnmount:p,transitionStatus:o}}function Fs(e,t){e.useSyncedValues(t),D(()=>()=>{e.update({activeTriggerProps:Be,inactiveTriggerProps:Be,popupProps:Be})},[e])}function Ms(e,t){D(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),D(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Ns{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}const Ls=a.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return ne.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});let Ft={},Mt={},Nt="";function Ke(e,t){return Mn(e)?e:t}function Lt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ke(t,n)).overflowY)}function Vr(e){if(typeof document>"u")return!1;const t=W(e);return Ge(t).innerWidth-t.documentElement.clientWidth>0}function Wr(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=W(e),r=n.documentElement,s=n.body,o=Ke(r,s),i=o.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const p=o.offsetWidth;o.style.overflowY="hidden";const c=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=u,p===c}function _r(e){const t=W(e),n=t.documentElement,r=t.body,s=Ke(n,r),o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function Br(e){const t=W(e),n=t.documentElement,r=t.body,s=Ge(n);let o=0,i=0,u=!1;const p=In.create();if(Ie&&(s.visualViewport?.scale??1)!==1)return()=>{};function c(){const g=s.getComputedStyle(n),v=s.getComputedStyle(r),R=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Ft={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Nt=n.style.scrollBehavior,Mt={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,q=n.scrollWidth>n.clientWidth,V=g.overflowY==="scroll"||v.overflowY==="scroll",Y=g.overflowX==="scroll"||v.overflowX==="scroll",z=Math.max(0,s.innerWidth-r.clientWidth),A=Math.max(0,s.innerHeight-r.clientHeight),j=parseFloat(v.marginTop)+parseFloat(v.marginBottom),M=parseFloat(v.marginLeft)+parseFloat(v.marginRight),J=Ke(n,r);if(u=Wr(e),u){n.style.scrollbarGutter=R,J.style.overflowY="hidden",J.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(b||V)&&(n.style.overflowY="scroll"),(q||Y)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:j||A?`calc(100dvh - ${j+A}px)`:"100dvh",width:M||z?`calc(100vw - ${M+z}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function y(){Object.assign(n.style,Ft),Object.assign(r.style,Mt),u||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Nt)}function C(){y(),p.request(c)}c();const d=P(s,"resize",C);return()=>{p.cancel(),y(),typeof s.removeEventListener=="function"&&d()}}class Ur{lockCount=0;restore=null;timeoutLock=Te.create();timeoutUnlock=Te.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=W(t),r=n.documentElement,s=n.body,o=Ge(r);if(Lt(o,r,s)){const u=new o.MutationObserver(()=>{Lt(o,r,s)||(u.disconnect(),this.restore=null,this.lock(t))}),p={attributes:!0};u.observe(r,p),u.observe(s,p),this.restore=()=>u.disconnect();return}const i=lt||!Vr(t);this.restore=i?_r(t):Br(t)}}const Yr=new Ur;function Ds(e=!0,t=null){D(()=>{if(e)return Yr.acquire(t)},[e,t])}export{Ss as $,Ce as A,Bn as B,Ie as C,je as D,ns as E,xs as F,Xt as G,ss as H,pt as I,dt as J,rs as K,Le as L,Ts as M,ms as N,hs as O,Ns as P,Ls as Q,Ar as R,Kr as S,Te as T,Es as U,br as V,ys as W,Hr as X,Dr as Y,Nr as Z,ds as _,P as a,Me as a0,is as a1,tn as a2,cs as a3,as as a4,Ye as a5,ps as a6,Mr as a7,pn as a8,St as a9,Kn as aa,$n as ab,Et as ac,Qe as ad,Gn as ae,Qr as af,Zr as ag,es as ah,ts as ai,lt as aj,gs as ak,Ds as al,jt as am,Cs as an,Ms as ao,$r as ap,ws as b,ks as c,As as d,Os as e,vr as f,Rs as g,Fs as h,os as i,vs as j,Ps as k,We as l,Ue as m,hr as n,bs as o,ls as p,cr as q,qr as r,Jr as s,us as t,Is as u,zr as v,Dn as w,fs as x,ar as y,dn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,f as c,e as n}from"./index-
|
|
1
|
+
import{r as s,f as c,e as n}from"./index-B_3U6pyz.js";function u(e,r){const t=s.useRef(e),a=c(r);n(()=>{t.current!==e&&a(t.current),t.current=e},[e,a])}export{u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as z,V as E,p as F,d as B,r as l,j as e,G as L,h as k,B as n,s as w,A as x,C as S}from"./index-
|
|
1
|
+
import{c as z,V as E,p as F,d as B,r as l,j as e,G as L,h as k,B as n,s as w,A as x,C as S}from"./index-B_3U6pyz.js";import{C as f}from"./card-DEnJVYTc.js";import{L as C,I as q}from"./label-BPkAzYEe.js";import{I as P}from"./InstallTag-C4m3dgQN.js";import{C as R}from"./check-BhmdAbBD.js";import{A}from"./arrow-left-kr0TdNCI.js";import"./createBaseUIEventDetails-BDbAfTsh.js";import"./CompositeList-U-qk8UP6.js";import"./isElementDisabled-CwHw_lZC.js";import"./inertValue-Dl2ZzbZu.js";import"./useCompositeItem-uwStRlwJ.js";import"./copy-DefIRiwo.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as h,r as x,j as e,B as a,G as N,s as y,X as b}from"./index-
|
|
1
|
+
import{W as h,r as x,j as e,B as a,G as N,s as y,X as b}from"./index-B_3U6pyz.js";const S=`${b}session`;function E(){const{project:o,origin:t,env:g}=h.useSearch(),{me:n}=h.useRouteContext(),[l,d]=x.useState(""),[f,u]=x.useState(!1),i=n.projects.find(s=>s.uid===o),m=typeof window<"u"?window.opener:null,r=()=>window.close();if(!o||!t||!m)return e.jsx(c,{title:"Nothing to sign in to",children:e.jsxs("p",{className:"m-0 text-muted-foreground",children:["This window is opened by the comment box on a site you are reviewing. Open it from there — choose"," ",e.jsx("em",{children:"Studio member? Sign in"})," — and it will ask you here."]})});if(!i)return e.jsxs(c,{title:"Not one of this studio's sites",children:[e.jsxs("p",{className:"m-0 text-muted-foreground",children:["You are signed in to ",n.org.name,", and that site is not one of its sites. If it belongs to another studio you are in, switch to it in the dashboard and try again."]}),e.jsx(a,{variant:"outline",onClick:r,children:"Close"})]});const p=async()=>{d(""),u(!0);try{const s=await y.memberSession(i.uid,t,g);if(s.origin!==t)throw new Error("The address changed while signing in. Try again from the site.");const{origin:j,...w}=s;m.postMessage({type:S,session:w},j),r()}catch(s){d(s instanceof Error?s.message:"Could not reach the server."),u(!1)}};return e.jsxs(c,{title:`Sign in to ${i.name}`,children:[e.jsxs("p",{className:"m-0 text-muted-foreground",children:["Comment on ",e.jsx("span",{className:"font-medium text-foreground",children:t})," as"," ",e.jsx("span",{className:"font-medium text-foreground",children:n.user.name||n.user.email}),", from ",n.org.name,". Your comments there and your replies here will be one author."]}),l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(a,{size:"lg",className:"flex-1",loading:f,onClick:()=>void p(),children:"Continue"}),e.jsx(a,{size:"lg",variant:"outline",onClick:r,children:"Cancel"})]})]})}function c({title:o,children:t}){return e.jsx(N,{children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:o}),t]})})}export{E as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,x as b,j as e,h as y,y as N,B as j,q as f,t as S,a2 as C}from"./index-
|
|
1
|
+
import{r,x as b,j as e,h as y,y as N,B as j,q as f,t as S,a2 as C}from"./index-B_3U6pyz.js";import{L as c,I as d}from"./label-BPkAzYEe.js";import{P,a as h}from"./parts-BZnB0y34.js";import{S as A}from"./SaveState-B4LwnOrc.js";import{M as k}from"./McpTokens-y9bU9w2F.js";import{u as M}from"./me-Ffh61LTY.js";import{u as F,a as E}from"./studio-C-cl-Bid.js";import{M as T,S as D,a as z}from"./sun-xwDuvNCi.js";import"./createBaseUIEventDetails-BDbAfTsh.js";import"./card-DEnJVYTc.js";import"./useScrollLock-Bxg3WK_6.js";import"./inertValue-Dl2ZzbZu.js";import"./Picker-0Wc1iFQj.js";import"./chevron-down-CkYqA6Tw.js";import"./check-BhmdAbBD.js";import"./isElementDisabled-CwHw_lZC.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-B2j76Odc.js";import"./getPseudoElementBounds-Df0qQn0E.js";import"./CompositeList-U-qk8UP6.js";import"./useQuery-HUEWFxW8.js";import"./useBaseQuery-BWQygP2V.js";import"./badge-5vfpTOMk.js";import"./useRender-BMKPZM38.js";import"./dialog-Dsu0e02Q.js";import"./switch-9hlceDWy.js";import"./useAriaLabelledBy-x5XF8M1H.js";import"./ConfirmDialog-_B1eNA1i.js";import"./copy-DefIRiwo.js";import"./CopyButton-CIoiqDbz.js";function H({items:s}){const[a,o]=r.useState(b);return e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":"Theme",children:s.map(t=>e.jsxs("button",{type:"button",role:"radio","aria-checked":a===t.value,onClick:()=>{N(t.value),o(t.value)},className:y("inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12.5px] font-medium text-ink-soft",a===t.value&&"border-line-strong bg-muted text-foreground"),children:[t.icon,t.label]},t.value))})}function pe(){const s=M(),a=F(),[o,t]=r.useState(s.user.name),[u,i]=r.useState(null);r.useEffect(()=>t(s.user.name),[s.user.name]);const m=o.trim()!==s.user.name;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(P,{title:"You",sub:"Your own account on this studio",actions:e.jsx(A,{saving:a.isPending,savedAt:u})}),e.jsxs(h,{title:"Profile",description:"How you appear on replies and in the members list.",children:[e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:l=>{l.preventDefault(),m&&a.mutate(o.trim(),{onSuccess:()=>i(Date.now())})},children:[e.jsx(c,{htmlFor:"your-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{id:"your-name",value:o,onChange:l=>t(l.target.value)}),m&&e.jsx(j,{type:"submit",variant:"outline",children:"Save"})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"your-email",children:"Email"}),e.jsx(d,{id:"your-email",value:s.user.email,readOnly:!0,className:"bg-muted text-ink-soft"}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["How you sign in, and how the server finds you. An owner changes it with"," ",e.jsx("code",{className:"font-mono",children:"snagset passwd"}),"."]})]})]}),e.jsx(h,{title:"Password",description:"Changing it keeps this session and ends every other one.",children:e.jsx(L,{})}),!f(s.user.role,"settings")&&f(s.user.role,"review")&&e.jsx(k,{owner:!0,mine:!0,instanceOwner:!1,operator:S(s),sites:s.projects}),e.jsx(h,{title:"Appearance",description:"Also in your menu at the bottom of the sidebar.",children:e.jsx(H,{items:[{value:"system",label:"System",icon:e.jsx(T,{className:"size-3.5"})},{value:"light",label:"Light",icon:e.jsx(D,{className:"size-3.5"})},{value:"dark",label:"Dark",icon:e.jsx(z,{className:"size-3.5"})}]})})]})}function L(){const s=E(),[a,o]=r.useState(""),[t,u]=r.useState(""),[i,m]=r.useState(""),[l,g]=r.useState(""),[v,p]=r.useState(!1),x=a.length>0&&t.length>=12&&t===i;return e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:async n=>{if(n.preventDefault(),!(!x||s.isPending)){g("");try{await s.mutateAsync({current:a,next:t}),o(""),u(""),m(""),p(!0)}catch(w){g(C(w))}}},children:[l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-current",children:"Current password"}),e.jsx(d,{id:"pw-current",type:"password",autoComplete:"current-password",value:a,onChange:n=>{o(n.target.value),p(!1)}})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-next",children:"New password"}),e.jsx(d,{id:"pw-next",type:"password",autoComplete:"new-password",value:t,onChange:n=>{u(n.target.value),p(!1)}}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. No composition rules — length is what matters."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-again",children:"Confirm new password"}),e.jsx(d,{id:"pw-again",type:"password",autoComplete:"new-password",value:i,onChange:n=>{m(n.target.value),p(!1)}}),i.length>0&&t!==i&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Those do not match yet."})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{type:"submit",loading:s.isPending,disabled:!x,children:s.isPending?"Changing…":v&&!x?"Changed":"Change password"})})]})}export{pe as component};
|