@snagset/server 0.1.34 → 0.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/routes/account.js +9 -1
  2. package/dist/routes/account.js.map +1 -1
  3. package/dist/routes/assignees.js +47 -9
  4. package/dist/routes/assignees.js.map +1 -1
  5. package/package.json +1 -1
  6. package/static/dashboard/assets/{CompositeItem-DOjAZOIw.js → CompositeItem-DpSaUtYZ.js} +1 -1
  7. package/static/dashboard/assets/{ConfirmDialog-YHdRCMuk.js → ConfirmDialog-s6KLZt6w.js} +1 -1
  8. package/static/dashboard/assets/{CopyButton-BPFFhzYZ.js → CopyButton-Cqz1MLVB.js} +1 -1
  9. package/static/dashboard/assets/{FieldItemContext-CvuTIqbu.js → FieldItemContext-4dJ9QpEG.js} +1 -1
  10. package/static/dashboard/assets/{InstallTag-Dyle6Z7u.js → InstallTag-B4frNgVO.js} +1 -1
  11. package/static/dashboard/assets/{SaveState-zx4IRIWV.js → SaveState-DfBHRtEq.js} +1 -1
  12. package/static/dashboard/assets/{_app-BT2PvVrr.js → _app-5y2NMiTw.js} +1 -1
  13. package/static/dashboard/assets/{_app-CATs1X1F.js → _app-CnifsCfr.js} +1 -1
  14. package/static/dashboard/assets/{activity-Ja8jqvTl.js → activity-DX3WrmQt.js} +1 -1
  15. package/static/dashboard/assets/{arrow-left-D-J1WDaF.js → arrow-left-iXAzDNV6.js} +1 -1
  16. package/static/dashboard/assets/{avatar-JYCiU767.js → avatar-DkFTIwsR.js} +1 -1
  17. package/static/dashboard/assets/{badge-NV2UvVlq.js → badge-CrUHZwEL.js} +1 -1
  18. package/static/dashboard/assets/{card-PWIpee1m.js → card-C4v3pSqd.js} +1 -1
  19. package/static/dashboard/assets/{check-fUN7a3GX.js → check-BKP4SJjJ.js} +1 -1
  20. package/static/dashboard/assets/{chevron-right-D_gtsnlu.js → chevron-right-BVbfidnK.js} +1 -1
  21. package/static/dashboard/assets/{copy-ZBdagSqO.js → copy-nRZWPHR1.js} +1 -1
  22. package/static/dashboard/assets/{dialog-B_kwIiUp.js → dialog-lgIL_ZCX.js} +1 -1
  23. package/static/dashboard/assets/{dropdown-menu-D5UGpMWY.js → dropdown-menu-DyLLQk8L.js} +1 -1
  24. package/static/dashboard/assets/{image-off-kQWiBpm4.js → image-off-B6flKQEZ.js} +1 -1
  25. package/static/dashboard/assets/{index-BCjjK9dr.js → index-DMCyFEmS.js} +3 -3
  26. package/static/dashboard/assets/{invite-Cn7ntzp8.js → invite-CrR7zqFd.js} +1 -1
  27. package/static/dashboard/assets/{label-CU7jvj5k.js → label-CL3Ivlhy.js} +1 -1
  28. package/static/dashboard/assets/{layout-grid-DgutVVEL.js → layout-grid-B-9bb2Av.js} +1 -1
  29. package/static/dashboard/assets/me-6-FBHysO.js +1 -0
  30. package/static/dashboard/assets/{parts-Oxy1krsw.js → parts-b71WkkoI.js} +1 -1
  31. package/static/dashboard/assets/{plus-Cl722ZH_.js → plus-BOeukd4A.js} +1 -1
  32. package/static/dashboard/assets/s._site-MtCDp62_.js +1 -0
  33. package/static/dashboard/assets/s._site.comments-vNVUqPN4.js +54 -0
  34. package/static/dashboard/assets/{s._site.reviewers-BuxVEObS.js → s._site.reviewers-BMYyb10D.js} +1 -1
  35. package/static/dashboard/assets/{s._site.settings-BLyC2Ix8.js → s._site.settings-BaBm7RJi.js} +1 -1
  36. package/static/dashboard/assets/{setup-BUjOodJm.js → setup-DjA-0YhC.js} +1 -1
  37. package/static/dashboard/assets/{sign-in-CppGynIo.js → sign-in-vMnULz18.js} +1 -1
  38. package/static/dashboard/assets/{sign-up-BGy3UTxi.js → sign-up-K_HV-_C8.js} +1 -1
  39. package/static/dashboard/assets/{sites-CzRwDpMY.js → sites-Dw-qQxr1.js} +1 -1
  40. package/static/dashboard/assets/{studio-DepK2GJ4.js → studio-CBGrW0G1.js} +1 -1
  41. package/static/dashboard/assets/studio-DcijgVQL.js +1 -0
  42. package/static/dashboard/assets/{studio.index-C4hVZYkE.js → studio.index-D-9QUrvv.js} +1 -1
  43. package/static/dashboard/assets/{studio.integrations-2-WJQjiK.js → studio.integrations-Djhl8gKq.js} +1 -1
  44. package/static/dashboard/assets/{studio.members-CMxEJYg1.js → studio.members-DaS0HWwE.js} +1 -1
  45. package/static/dashboard/assets/{sun-DDSRise2.js → sun-ygOg7Lon.js} +1 -1
  46. package/static/dashboard/assets/{switch-L2_Pf-6w.js → switch-CYLwE1-9.js} +1 -1
  47. package/static/dashboard/assets/{table-fR4tWQ4-.js → table-BgojscGP.js} +1 -1
  48. package/static/dashboard/assets/{useAriaLabelledBy-Bk7BENOF.js → useAriaLabelledBy-Ce10PDSC.js} +1 -1
  49. package/static/dashboard/assets/{useBaseQuery-CoqlgX-x.js → useBaseQuery-BI_bJwNl.js} +1 -1
  50. package/static/dashboard/assets/useQuery-Cl9FITTP.js +1 -0
  51. package/static/dashboard/assets/useRender-Ck8DP-Z3.js +1 -0
  52. package/static/dashboard/assets/{useValueChanged-BhvEiD3-.js → useValueChanged-Dh5Yg1r8.js} +1 -1
  53. package/static/dashboard/assets/{users-STxJg0L8.js → users-BXCV1C3P.js} +1 -1
  54. package/static/dashboard/assets/{welcome-D7-mGhDy.js → welcome-C9fdUqeW.js} +1 -1
  55. package/static/dashboard/assets/{widget-signin-jj3P3IbD.js → widget-signin-DiXxk1Ln.js} +1 -1
  56. package/static/dashboard/assets/{you-BMCOM6zE.js → you-CZGeTvq7.js} +1 -1
  57. package/static/dashboard/assets/{zod-DbWDuTiO.js → zod-khKoKeAB.js} +1 -1
  58. package/static/dashboard/index.html +1 -1
  59. package/static/widget/build.json +2 -2
  60. package/static/widget/snag.js +1 -1
  61. package/static/widget/snag.runtime.js +1 -1
  62. package/static/dashboard/assets/me-ttfbX4Cb.js +0 -1
  63. package/static/dashboard/assets/s._site-DI7lRsnw.js +0 -1
  64. package/static/dashboard/assets/s._site.comments-BLiaZNHo.js +0 -54
  65. package/static/dashboard/assets/studio-BJa7hKy2.js +0 -1
  66. package/static/dashboard/assets/useQuery-6QR_MT4t.js +0 -1
  67. package/static/dashboard/assets/useRender-BybHPfHo.js +0 -1
@@ -1 +1 @@
1
- import{R as N,j as e,o as y,r as h,p as v,x as S,z as A,A as f,G as g,C,B as k,D as F,L as E,F as I,H as x}from"./index-BCjjK9dr.js";import{u as L,a as B}from"./zod-DbWDuTiO.js";import{L as u,I as p}from"./label-CU7jvj5k.js";function G(){const s=N.useLoaderData();return s.ok?e.jsx(P,{token:s.token,invite:s.invite}):e.jsx(R,{code:s.code,message:s.message})}function R({code:s,message:a}){const{title:l,signIn:i}=F(s);return e.jsx(g,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:l}),e.jsx("p",{role:"alert",className:"m-0 text-muted-foreground",children:a}),i&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx(E,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Sign in"})})]})})}const J=I({name:x().trim().max(120).optional(),email:x().trim().email("An email address"),password:x().min(1,"A password")});function P({token:s,invite:a}){const l=y(),[i,m]=h.useState(""),[r,j]=h.useState(!1),{register:d,handleSubmit:w,formState:t}=L({resolver:B(J),defaultValues:{email:a.email??"",name:""}}),c=a.org.name||"a studio",b=w(async o=>{if(m(""),!r&&o.password.length<12){m("The password must be at least 12 characters. A short phrase of real words is fine.");return}try{await v.acceptInvite({token:s,password:o.password,...o.name?{name:o.name}:{},...a.email?{}:{email:o.email}}),S("in"),A.clear(),l({to:"/sites",replace:!0})}catch(n){n instanceof f&&n.code==="account_exists"&&j(!0),m(n instanceof f?n.message:"Could not reach the server. Try again.")}});return e.jsx(g,{width:400,children:e.jsxs("form",{onSubmit:b,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:["Join ",c]}),e.jsxs("p",{className:"m-0 mt-1.5 text-muted-foreground",children:[a.invitedBy?`${a.invitedBy} invited you`:"You were invited"," to join ",c," as ",C(a.role),".",r?" Sign in with the account you already have here.":" Choose your password and you're in."]})]}),i&&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:i}),e.jsxs("fieldset",{disabled:t.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(u,{htmlFor:"email",children:"Email"}),e.jsx(p,{id:"email",type:"email",autoComplete:"username",readOnly:!!a.email,"aria-invalid":!!t.errors.email,...d("email")}),t.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:t.errors.email.message})]}),!r&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(u,{htmlFor:"name",children:["Your name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(p,{id:"name",autoComplete:"name",...d("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(u,{htmlFor:"password",children:r?"Your password":"Choose a password"}),e.jsx(p,{id:"password",type:"password",autoComplete:r?"current-password":"new-password","aria-invalid":!!t.errors.password,...d("password")}),!r&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. A short phrase of real words is fine."})]}),e.jsx(k,{type:"submit",size:"lg",loading:t.isSubmitting,children:t.isSubmitting?"Joining…":`Join ${c}`})]})]})})}export{G as component};
1
+ import{R as N,j as e,o as y,r as h,p as v,x as S,z as A,A as f,G as g,C,B as k,D as F,L as E,F as I,H as x}from"./index-DMCyFEmS.js";import{u as L,a as B}from"./zod-khKoKeAB.js";import{L as u,I as p}from"./label-CL3Ivlhy.js";function G(){const s=N.useLoaderData();return s.ok?e.jsx(P,{token:s.token,invite:s.invite}):e.jsx(R,{code:s.code,message:s.message})}function R({code:s,message:a}){const{title:l,signIn:i}=F(s);return e.jsx(g,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:l}),e.jsx("p",{role:"alert",className:"m-0 text-muted-foreground",children:a}),i&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx(E,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Sign in"})})]})})}const J=I({name:x().trim().max(120).optional(),email:x().trim().email("An email address"),password:x().min(1,"A password")});function P({token:s,invite:a}){const l=y(),[i,m]=h.useState(""),[r,j]=h.useState(!1),{register:d,handleSubmit:w,formState:t}=L({resolver:B(J),defaultValues:{email:a.email??"",name:""}}),c=a.org.name||"a studio",b=w(async o=>{if(m(""),!r&&o.password.length<12){m("The password must be at least 12 characters. A short phrase of real words is fine.");return}try{await v.acceptInvite({token:s,password:o.password,...o.name?{name:o.name}:{},...a.email?{}:{email:o.email}}),S("in"),A.clear(),l({to:"/sites",replace:!0})}catch(n){n instanceof f&&n.code==="account_exists"&&j(!0),m(n instanceof f?n.message:"Could not reach the server. Try again.")}});return e.jsx(g,{width:400,children:e.jsxs("form",{onSubmit:b,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:["Join ",c]}),e.jsxs("p",{className:"m-0 mt-1.5 text-muted-foreground",children:[a.invitedBy?`${a.invitedBy} invited you`:"You were invited"," to join ",c," as ",C(a.role),".",r?" Sign in with the account you already have here.":" Choose your password and you're in."]})]}),i&&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:i}),e.jsxs("fieldset",{disabled:t.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(u,{htmlFor:"email",children:"Email"}),e.jsx(p,{id:"email",type:"email",autoComplete:"username",readOnly:!!a.email,"aria-invalid":!!t.errors.email,...d("email")}),t.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:t.errors.email.message})]}),!r&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(u,{htmlFor:"name",children:["Your name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(p,{id:"name",autoComplete:"name",...d("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(u,{htmlFor:"password",children:r?"Your password":"Choose a password"}),e.jsx(p,{id:"password",type:"password",autoComplete:r?"current-password":"new-password","aria-invalid":!!t.errors.password,...d("password")}),!r&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. A short phrase of real words is fine."})]}),e.jsx(k,{type:"submit",size:"lg",loading:t.isSubmitting,children:t.isSubmitting?"Joining…":`Join ${c}`})]})]})})}export{G as component};
@@ -1 +1 @@
1
- import{r as o,a6 as l,h as J,E as V,aZ as W,a4 as A,e as M,d as v,k as X,aU as Z,i as Q,j as T,f as _}from"./index-BCjjK9dr.js";function ee(t){return t?.ownerDocument||document}const te={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ne={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},se={disabled:!1,...ne},ae={valid(t){return t===null?null:t?{"data-valid":""}:{"data-invalid":""}}},re={invalid:void 0,name:void 0,validityData:{state:te,errors:[],error:"",value:"",initialValue:null},setValidityData:l,disabled:void 0,setTouched:l,setDirty:l,setFilled:l,setFocused:l,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:se,registerFieldControl:l,validation:{getValidationProps:(t,e=V)=>e,inputRef:{current:null},registeredInputs:new Map,registerInput:l,getInputControl:()=>null,commit:async()=>{},change:l}},oe=o.createContext(re);function N(t=!0){const e=o.useContext(oe);if(e.setValidityData===l&&!t)throw new Error(J(28));return e}const ie=o.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:l,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function le(){return o.useContext(ie)}let S=0;function ue(t,e="mui"){const[n,s]=o.useState(t),u=t||n;return o.useEffect(()=>{n==null&&(S+=1,s(`${e}-${S}`))},[n,e]),u}const L=W.useId;function de(t,e){if(L!==void 0){const n=L();return t??(e?`${e}-${n}`:n)}return ue(t,e)}function ce(t){return de(t,"base-ui")}const fe=o.createContext({controlId:void 0,registerControlId:l,labelId:void 0,setLabelId:l,messageIds:[],setMessageIds:l,getDescriptionProps:t=>t});function U(){return o.useContext(fe)}function ge(t={}){const{id:e,implicit:n=!1,controlRef:s}=t,{controlId:u,registerControlId:i}=U(),a=ce(e),r=n?u:void 0,c=A(()=>Symbol()),p=o.useRef(!1),b=o.useRef(e!=null),f=M(()=>{!p.current||i===l||(p.current=!1,i(c.current,void 0))});return v(()=>{if(i===l)return;let m;if(n){const I=s?.current;X(I)&&I.closest("label")!=null?m=e??null:m=r??a}else if(e!=null)b.current=!0,m=e;else if(b.current)m=a;else{f();return}if(m===void 0){f();return}p.current=!0,i(c.current,m)},[e,s,r,i,n,a,c,f]),o.useEffect(()=>f,[f]),u??a}function pe(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function he(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&Z(n)){let s=e;for(;s;){if(t===s)return!0;s=s.parentNode||s.host}}return!1}function Te(t){return"composedPath"in t?t.composedPath()[0]:t.target}function me({controlled:t,default:e,name:n,state:s="value"}){const{current:u}=o.useRef(t!==void 0),[i,a]=o.useState(e),r=u?t:i,c=o.useCallback(p=>{u||a(p)},[]);return[r,c]}function be(t,e,n,s,u=!0,i){const{registerFieldControl:a}=N(),r=A(()=>Symbol());v(()=>{const c=r.current;if(!u){a(c,void 0);return}a(c,{controlRef:t,getValue:s,id:e,name:i,value:n})},[t,u,s,e,i,a,r,n]),v(()=>{const c=r.current;return()=>{a(c,void 0)}},[a,r])}const ve="none",we="trigger-press",ye="trigger-hover",Fe="trigger-focus",De="outside-press",Pe="item-press",Se="close-press",Le="focus-out",Ve="escape-key",Ae="list-navigation",Me="cancel-open",_e="sibling-open",Ne="disabled",Ue="imperative-action";function Ie(t,e,n,s){let u=!1,i=!1;const a=s??V;return{reason:t,event:e??new Event("base-ui"),cancel(){u=!0},allowPropagation(){i=!0},get isCanceled(){return u},get isPropagationAllowed(){return i},trigger:n,...a}}const Ee=o.forwardRef(function(e,n){const{render:s,className:u,id:i,name:a,value:r,disabled:c=!1,onValueChange:p,defaultValue:b,autoFocus:f=!1,style:m,...I}=e,{state:k,name:O,disabled:j,setTouched:w,setDirty:B,validityData:$,setFocused:E,setFilled:R,validationMode:K,validation:g}=N(),{clearErrors:Y}=le(),C=j||c,y=O??a,q={...k,disabled:C},{labelId:z}=U(),F=ge({id:i});v(()=>{const d=r!=null;g.inputRef.current?.value||d&&r!==""?R(!0):d&&r===""&&R(!1)},[g.inputRef,R,r]);const h=o.useRef(null);v(()=>{f&&h.current===pe(ee(h.current))&&E(!0)},[f,E]);const[G]=me({controlled:r,default:b,name:"FieldControl",state:"value"}),D=r!==void 0,P=D?G:void 0,H=M(()=>g.inputRef.current?.value);return be(g.inputRef,F,P,H,!C,a),Q("input",e,{ref:[n,h],state:q,props:[{id:F,disabled:C,name:y,ref:g.inputRef,"aria-labelledby":z,autoFocus:f,...D?{value:P}:{defaultValue:b},onChange(d){const x=d.currentTarget.value;p?.(x,Ie(ve,d.nativeEvent)),B(x!==($.initialValue??"")),R(x!==""),d.nativeEvent.defaultPrevented||(Y(y),g.change(x))},onFocus(){E(!0)},onBlur(d){w(!0),E(!1),K==="onBlur"&&g.commit(d.currentTarget.value)},onKeyDown(d){d.currentTarget.tagName==="INPUT"&&d.key==="Enter"&&(w(!0),g.commit(d.currentTarget.value))}},I,d=>g.getValidationProps(C,d)],stateAttributesMapping:ae})}),Re=o.forwardRef(function(e,n){return T.jsx(Ee,{ref:n,...e})});function ke({className:t,type:e,...n}){return T.jsx(Re,{type:e,"data-slot":"input",className:_("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...n})}function Oe({className:t,...e}){return T.jsx("label",{"data-slot":"label",className:_("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}export{ge as A,Se as B,ke as I,Oe as L,he as a,ye as b,Ie as c,Ne as d,le as e,ae as f,Te as g,N as h,Ue as i,U as j,me as k,be as l,pe as m,ve as n,ee as o,Fe as p,Ve as q,Ae as r,Le as s,we as t,ce as u,Pe as v,De as w,_e as x,de as y,Me as z};
1
+ import{r as o,a6 as l,h as J,E as V,aZ as W,a4 as A,e as M,d as v,k as X,aU as Z,i as Q,j as T,f as _}from"./index-DMCyFEmS.js";function ee(t){return t?.ownerDocument||document}const te={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ne={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},se={disabled:!1,...ne},ae={valid(t){return t===null?null:t?{"data-valid":""}:{"data-invalid":""}}},re={invalid:void 0,name:void 0,validityData:{state:te,errors:[],error:"",value:"",initialValue:null},setValidityData:l,disabled:void 0,setTouched:l,setDirty:l,setFilled:l,setFocused:l,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:se,registerFieldControl:l,validation:{getValidationProps:(t,e=V)=>e,inputRef:{current:null},registeredInputs:new Map,registerInput:l,getInputControl:()=>null,commit:async()=>{},change:l}},oe=o.createContext(re);function N(t=!0){const e=o.useContext(oe);if(e.setValidityData===l&&!t)throw new Error(J(28));return e}const ie=o.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:l,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function le(){return o.useContext(ie)}let S=0;function ue(t,e="mui"){const[n,s]=o.useState(t),u=t||n;return o.useEffect(()=>{n==null&&(S+=1,s(`${e}-${S}`))},[n,e]),u}const L=W.useId;function de(t,e){if(L!==void 0){const n=L();return t??(e?`${e}-${n}`:n)}return ue(t,e)}function ce(t){return de(t,"base-ui")}const fe=o.createContext({controlId:void 0,registerControlId:l,labelId:void 0,setLabelId:l,messageIds:[],setMessageIds:l,getDescriptionProps:t=>t});function U(){return o.useContext(fe)}function ge(t={}){const{id:e,implicit:n=!1,controlRef:s}=t,{controlId:u,registerControlId:i}=U(),a=ce(e),r=n?u:void 0,c=A(()=>Symbol()),p=o.useRef(!1),b=o.useRef(e!=null),f=M(()=>{!p.current||i===l||(p.current=!1,i(c.current,void 0))});return v(()=>{if(i===l)return;let m;if(n){const I=s?.current;X(I)&&I.closest("label")!=null?m=e??null:m=r??a}else if(e!=null)b.current=!0,m=e;else if(b.current)m=a;else{f();return}if(m===void 0){f();return}p.current=!0,i(c.current,m)},[e,s,r,i,n,a,c,f]),o.useEffect(()=>f,[f]),u??a}function pe(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function he(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&Z(n)){let s=e;for(;s;){if(t===s)return!0;s=s.parentNode||s.host}}return!1}function Te(t){return"composedPath"in t?t.composedPath()[0]:t.target}function me({controlled:t,default:e,name:n,state:s="value"}){const{current:u}=o.useRef(t!==void 0),[i,a]=o.useState(e),r=u?t:i,c=o.useCallback(p=>{u||a(p)},[]);return[r,c]}function be(t,e,n,s,u=!0,i){const{registerFieldControl:a}=N(),r=A(()=>Symbol());v(()=>{const c=r.current;if(!u){a(c,void 0);return}a(c,{controlRef:t,getValue:s,id:e,name:i,value:n})},[t,u,s,e,i,a,r,n]),v(()=>{const c=r.current;return()=>{a(c,void 0)}},[a,r])}const ve="none",we="trigger-press",ye="trigger-hover",Fe="trigger-focus",De="outside-press",Pe="item-press",Se="close-press",Le="focus-out",Ve="escape-key",Ae="list-navigation",Me="cancel-open",_e="sibling-open",Ne="disabled",Ue="imperative-action";function Ie(t,e,n,s){let u=!1,i=!1;const a=s??V;return{reason:t,event:e??new Event("base-ui"),cancel(){u=!0},allowPropagation(){i=!0},get isCanceled(){return u},get isPropagationAllowed(){return i},trigger:n,...a}}const Ee=o.forwardRef(function(e,n){const{render:s,className:u,id:i,name:a,value:r,disabled:c=!1,onValueChange:p,defaultValue:b,autoFocus:f=!1,style:m,...I}=e,{state:k,name:O,disabled:j,setTouched:w,setDirty:B,validityData:$,setFocused:E,setFilled:R,validationMode:K,validation:g}=N(),{clearErrors:Y}=le(),C=j||c,y=O??a,q={...k,disabled:C},{labelId:z}=U(),F=ge({id:i});v(()=>{const d=r!=null;g.inputRef.current?.value||d&&r!==""?R(!0):d&&r===""&&R(!1)},[g.inputRef,R,r]);const h=o.useRef(null);v(()=>{f&&h.current===pe(ee(h.current))&&E(!0)},[f,E]);const[G]=me({controlled:r,default:b,name:"FieldControl",state:"value"}),D=r!==void 0,P=D?G:void 0,H=M(()=>g.inputRef.current?.value);return be(g.inputRef,F,P,H,!C,a),Q("input",e,{ref:[n,h],state:q,props:[{id:F,disabled:C,name:y,ref:g.inputRef,"aria-labelledby":z,autoFocus:f,...D?{value:P}:{defaultValue:b},onChange(d){const x=d.currentTarget.value;p?.(x,Ie(ve,d.nativeEvent)),B(x!==($.initialValue??"")),R(x!==""),d.nativeEvent.defaultPrevented||(Y(y),g.change(x))},onFocus(){E(!0)},onBlur(d){w(!0),E(!1),K==="onBlur"&&g.commit(d.currentTarget.value)},onKeyDown(d){d.currentTarget.tagName==="INPUT"&&d.key==="Enter"&&(w(!0),g.commit(d.currentTarget.value))}},I,d=>g.getValidationProps(C,d)],stateAttributesMapping:ae})}),Re=o.forwardRef(function(e,n){return T.jsx(Ee,{ref:n,...e})});function ke({className:t,type:e,...n}){return T.jsx(Re,{type:e,"data-slot":"input",className:_("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...n})}function Oe({className:t,...e}){return T.jsx("label",{"data-slot":"label",className:_("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}export{ge as A,Se as B,ke as I,Oe as L,he as a,ye as b,Ie as c,Ne as d,le as e,ae as f,Te as g,N as h,Ue as i,U as j,me as k,be as l,pe as m,ve as n,ee as o,Fe as p,Ve as q,Ae as r,Le as s,we as t,ce as u,Pe as v,De as w,_e as x,de as y,Me as z};
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-BCjjK9dr.js";/**
1
+ import{c as t}from"./index-DMCyFEmS.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{u as r,Q as u,d as s}from"./useBaseQuery-BI_bJwNl.js";import{y as t}from"./index-DMCyFEmS.js";function a(e,o){return r({...e,enabled:!0,suspense:!0,throwOnError:s,placeholderData:void 0},u)}function i(){return a(t.me()).data}export{i as u};
@@ -1 +1 @@
1
- import{j as e,f as r}from"./index-BCjjK9dr.js";import{C as x}from"./card-PWIpee1m.js";import{S as m,d as l,i as d}from"./labels--UUyt9uB.js";function p({title:t,sub:s,actions:a}){return e.jsxs("div",{className:"mb-5 flex items-center gap-3",children:[e.jsx("h1",{className:"m-0 text-xl font-semibold tracking-tight",children:t}),s&&e.jsx("p",{className:"m-0 text-muted-foreground",children:s}),e.jsx("div",{className:"flex-1"}),a]})}function u({title:t,description:s,children:a,danger:n,cardClassName:i}){return e.jsxs("section",{className:"grid max-w-[1040px] grid-cols-1 gap-4 lg:grid-cols-[minmax(220px,1fr)_2fr] lg:gap-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:r("m-0 mb-1.5 text-[15.5px] font-semibold tracking-tight",n&&"text-destructive"),children:t}),s&&e.jsx("p",{className:"m-0 text-[13px] leading-normal text-muted-foreground",children:s})]}),e.jsx(x,{className:r("flex max-w-[640px] flex-col gap-4 p-5",n&&"border-destructive",i),children:a})]})}function g({icon:t,title:s,children:a,action:n,className:i}){return e.jsxs("div",{className:r("flex flex-col items-center gap-2 px-6 py-16 text-center",i),children:[t&&e.jsx("div",{className:"mb-1.5 flex size-11 items-center justify-center rounded-[10px] bg-muted text-ink-soft",children:t}),e.jsx("h3",{className:"m-0 text-[15px] font-semibold",children:s}),a&&e.jsx("div",{className:"m-0 max-w-[360px] text-muted-foreground",children:a}),n&&e.jsx("div",{className:"mt-2",children:n})]})}function j({status:t,className:s}){const a=d(t);return e.jsx("span",{className:r("inline-flex h-5 items-center whitespace-nowrap rounded-full px-2 text-[11.5px] font-medium leading-none",a?l[t]:"bg-muted text-muted-foreground",s),children:a?m[t]:t})}function h({children:t}){return e.jsx("div",{className:"text-[11.5px] font-medium uppercase tracking-wide text-muted-foreground",children:t})}export{g as E,p as P,j as S,u as a,h as b};
1
+ import{j as e,f as r}from"./index-DMCyFEmS.js";import{C as x}from"./card-C4v3pSqd.js";import{S as m,d as l,i as d}from"./labels--UUyt9uB.js";function p({title:t,sub:s,actions:a}){return e.jsxs("div",{className:"mb-5 flex items-center gap-3",children:[e.jsx("h1",{className:"m-0 text-xl font-semibold tracking-tight",children:t}),s&&e.jsx("p",{className:"m-0 text-muted-foreground",children:s}),e.jsx("div",{className:"flex-1"}),a]})}function u({title:t,description:s,children:a,danger:n,cardClassName:i}){return e.jsxs("section",{className:"grid max-w-[1040px] grid-cols-1 gap-4 lg:grid-cols-[minmax(220px,1fr)_2fr] lg:gap-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:r("m-0 mb-1.5 text-[15.5px] font-semibold tracking-tight",n&&"text-destructive"),children:t}),s&&e.jsx("p",{className:"m-0 text-[13px] leading-normal text-muted-foreground",children:s})]}),e.jsx(x,{className:r("flex max-w-[640px] flex-col gap-4 p-5",n&&"border-destructive",i),children:a})]})}function g({icon:t,title:s,children:a,action:n,className:i}){return e.jsxs("div",{className:r("flex flex-col items-center gap-2 px-6 py-16 text-center",i),children:[t&&e.jsx("div",{className:"mb-1.5 flex size-11 items-center justify-center rounded-[10px] bg-muted text-ink-soft",children:t}),e.jsx("h3",{className:"m-0 text-[15px] font-semibold",children:s}),a&&e.jsx("div",{className:"m-0 max-w-[360px] text-muted-foreground",children:a}),n&&e.jsx("div",{className:"mt-2",children:n})]})}function j({status:t,className:s}){const a=d(t);return e.jsx("span",{className:r("inline-flex h-5 items-center whitespace-nowrap rounded-full px-2 text-[11.5px] font-medium leading-none",a?l[t]:"bg-muted text-muted-foreground",s),children:a?m[t]:t})}function h({children:t}){return e.jsx("div",{className:"text-[11.5px] font-medium uppercase tracking-wide text-muted-foreground",children:t})}export{g as E,p as P,j as S,u as a,h as b};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-BCjjK9dr.js";/**
1
+ import{c as e}from"./index-DMCyFEmS.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{j as t,O as o}from"./index-DMCyFEmS.js";const n=()=>t.jsx(o,{});export{n as component};
@@ -0,0 +1,54 @@
1
+ import{c as Q,r as x,h as zs,a4 as Ts,a5 as Es,d as Je,a6 as Qe,a7 as Is,m as Ps,E as _s,i as ns,j as e,a8 as Bs,g as Fs,f as D,B as M,a9 as as,aa as Ls,$ as Xe,ab as Os,_ as rs,A as Vs,ac as Ze,o as qs,ad as Us,ae as Ye,af as Ks,ag as Hs,ah as Ws,ai as Gs,aj as Js,ak as Qs,al as Xs,am as Zs,an as Ys,ao as et,ap as be,L as os,F as st,a1 as es,H as je,aq as tt,y as $e}from"./index-DMCyFEmS.js";import{u as ve}from"./useQuery-Cl9FITTP.js";import{C as is}from"./check-BKP4SJjJ.js";import{f as nt,e as at,h as rt,j as ot,u as ss,k as it,l as lt,c as dt,n as ct,L as qe,I as Re}from"./label-CL3Ivlhy.js";import{L as ut,M as mt,N as ht,A as xt,O as pt,E as ls,G as ds,I as cs,H as us,J as ms,K as hs,X as ft}from"./dialog-lgIL_ZCX.js";import{u as gt}from"./FieldItemContext-4dJ9QpEG.js";import{u as bt}from"./useAriaLabelledBy-Ce10PDSC.js";import{u as jt}from"./useValueChanged-Dh5Yg1r8.js";import{D as se,i as te,j as ne,k as ce,l as ye,m as G,n as xs,E as ts,o as Ue,p as de,S as vt}from"./dropdown-menu-DyLLQk8L.js";import{A as he,a as xe}from"./avatar-DkFTIwsR.js";import{C as ps}from"./ConfirmDialog-s6KLZt6w.js";import{b as Ke,S as fs,E as Oe}from"./parts-b71WkkoI.js";import{S as pe,i as yt,b as ze,c as Me,a as ke}from"./labels--UUyt9uB.js";import{C as kt}from"./copy-nRZWPHR1.js";import{I as Nt}from"./image-off-B6flKQEZ.js";import{C as wt}from"./chevron-right-BVbfidnK.js";import{I as Ct}from"./InstallTag-B4frNgVO.js";import{u as St}from"./me-6-FBHysO.js";import{A as $t}from"./arrow-left-iXAzDNV6.js";import"./useBaseQuery-BI_bJwNl.js";import"./CompositeItem-DpSaUtYZ.js";import"./card-C4v3pSqd.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 Mt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ae=Q("chevron-down",Mt);/**
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 At=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Dt=Q("columns-2",At);/**
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 Rt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],zt=Q("ellipsis",Rt);/**
17
+ * @license lucide-react v1.39.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Tt=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],Et=Q("inbox",Tt);/**
22
+ * @license lucide-react v1.39.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const It=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Pt=Q("list",It);/**
27
+ * @license lucide-react v1.39.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const _t=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Bt=Q("pencil",_t);/**
32
+ * @license lucide-react v1.39.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const Ft=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Lt=Q("rotate-cw",Ft);/**
37
+ * @license lucide-react v1.39.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const Ot=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],gs=Q("trash-2",Ot);/**
42
+ * @license lucide-react v1.39.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const Vt=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],qt=Q("user-plus",Vt);/**
47
+ * @license lucide-react v1.39.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const Ut=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Kt=Q("user-round",Ut);function Ht(s){if(!s)return null;for(const t of s.elements){const r=t.tagName;if(r==="BUTTON"||r==="INPUT"){const o=t;if(o.type==="submit")return o}}return null}function bs(s){return{checked(t){return s.indeterminate?{}:t?{"data-checked":""}:{"data-unchecked":""}},...nt}}const Wt=x.createContext(void 0);function Gt(){return x.useContext(Wt)}const js=x.createContext(void 0);function Jt(){const s=x.useContext(js);if(s===void 0)throw new Error(zs(14));return s}const Qt="data-parent",Xt=x.forwardRef(function(t,r){const{checked:o,className:h,defaultChecked:i=!1,"aria-labelledby":l,disabled:y=!1,form:c,id:m,indeterminate:k=!1,inputRef:p,name:d,onCheckedChange:w,parent:a=!1,readOnly:C=!1,render:N,required:A=!1,uncheckedValue:v,value:z,nativeButton:E=!1,style:_,...I}=t,{clearErrors:f}=at(),{disabled:L,name:Z,setDirty:U,setFilled:K,setFocused:$,setTouched:T,state:V,validationMode:ue,validityData:me,validation:B}=rt(),g=gt(),{labelId:b,controlId:q,registerControlId:Y,getDescriptionProps:Te}=ot(),R=Gt(),J=R?.allValues===void 0?void 0:R.parent,ae=J!==void 0,F=L||g.disabled||R?.disabled||y,O=Z??d,P=z??O,n=ss(),u=ss();let S=m||q;ae&&(a?S=u:P!==void 0?S=`${J.id}-${P}`:S||=u);let H={};ae&&(a?H=J.getParentProps():P!==void 0&&(H=J.getChildProps(P)));const{checked:ee=o,indeterminate:re=k,onCheckedChange:Ne,...Ee}=H,Ie=R?.value,we=x.useRef(null),Ce=Ts(()=>Symbol()),Pe=x.useRef(!1),{getButtonProps:Ns,buttonRef:ws}=Es({disabled:F,native:E}),fe=R?.validation??B,[W,Cs]=it({controlled:P!==void 0&&Ie!==void 0&&!a?Ie.includes(P):ee,default:i,name:"Checkbox",state:"checked"}),_e=ae?!!ee:W,ge=ae&&re||k;Je(()=>{Y!==Qe&&(Pe.current=!0,Y(Ce.current,S))},[S,Y,Ce]),x.useEffect(()=>{const j=Ce.current;return()=>{!Pe.current||Y===Qe||(Pe.current=!1,Y(j,void 0))}},[Y,Ce]),lt(we,n,W,void 0,!R&&!F,d);const oe=x.useRef(null),We=fe.registerInput,Ge=R?P:void 0,Ss=x.useCallback(j=>We(j,{controlRef:we,value:Ge}),[We,Ge]),$s=Is(p,oe,a?void 0:Ss),Ms=bt(l,b,oe,!E,S??void 0);Je(()=>{oe.current&&(oe.current.indeterminate=ge,W&&K(!0))},[W,ge,K]),jt(W,()=>{R||(f(O),K(W),U(W!==me.initialValue),fe.change(W))});const As=Ps({checked:W,disabled:F,form:c,name:a?void 0:O,id:E?void 0:S??void 0,required:A,ref:$s,style:O?ut:mt,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(j){if(j.nativeEvent.defaultPrevented)return;if(C){j.preventDefault();return}const X=j.currentTarget.checked,ie=dt(ct,j.nativeEvent);if(w?.(X,ie),!ie.isCanceled&&(Ne?.(X,ie),!ie.isCanceled&&(Cs(X),P!==void 0&&R!==void 0&&!a&&!ae))){const le=X?[...R.value,P]:R.value.filter(Se=>Se!==P);R.setValue(le,ie)}},onClick(j){j.stopPropagation()},onFocus(){we.current?.focus()}},z!==void 0?{value:(R?W&&z:z)||""}:_s,Te,j=>fe.getValidationProps(F,j));x.useEffect(()=>{if(!J||P===void 0)return;const j=J.disabledStatesRef.current;return j.set(P,F),()=>{j.delete(P)}},[J,F,P]);const Be=x.useMemo(()=>({...V,checked:_e,disabled:F,readOnly:C,required:A,indeterminate:ge}),[V,_e,F,C,A,ge]),Ds=bs(Be),Rs=ns("span",t,{state:Be,ref:[ws,we,r],props:[{id:E?S??void 0:n,role:"checkbox","aria-checked":ge?"mixed":_e,"aria-readonly":C||void 0,"aria-required":A||void 0,"aria-labelledby":Ms,[Qt]:a?"":void 0,onFocus(){F||$(!0)},onBlur(){const j=oe.current;j&&(T(!0),$(!1),ue==="onBlur"&&fe.commit(R?Ie:j.checked))},onKeyDown(j){if(j.key!=="Enter"||(j.preventBaseUIHandler(),j.defaultPrevented))return;const X=oe.current?.form??null,ie=j.currentTarget,le=j.nativeEvent,Se=j.preventDefault,Fe=le.preventDefault;let Le=!1;j.preventDefault=()=>{Le=!0,Se.call(j)},le.preventDefault=()=>{Le=!0,Fe.call(le)},Fe.call(le),Fs(ie).queueMicrotask(()=>{j.preventDefault=Se,le.preventDefault=Fe,Le||Ht(X)?.click()})},onClick(j){if(C||F)return;j.preventDefault();const X=oe.current;X&&Bs(X,j)}},I,Ee,Ns,Te,j=>fe.getValidationProps(F,j)],stateAttributesMapping:Ds});return e.jsxs(js.Provider,{value:Be,children:[Rs,!W&&!R&&O&&!a&&v!==void 0&&e.jsx("input",{type:"hidden",form:c,name:O,value:v,disabled:F}),e.jsx("input",{...As,suppressHydrationWarning:!0})]})}),Zt=x.forwardRef(function(t,r){const{render:o,className:h,style:i,keepMounted:l=!1,...y}=t,c=Jt(),m=c.checked||c.indeterminate,{mounted:k,transitionStatus:p,setMounted:d}=ht(m),w=x.useRef(null),a={...c,transitionStatus:p};xt({open:m,ref:w,onComplete(){m||d(!1)}});const N={...bs(c),...pt},A=l||k,v=ns("span",t,{ref:[r,w],state:a,stateAttributesMapping:N,props:y});return A?v:null});function Yt({className:s,...t}){return e.jsx(Xt,{"data-slot":"checkbox",className:D("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",s),...t,children:e.jsx(Zt,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:e.jsx(is,{})})})}function vs({className:s,...t}){return e.jsx("textarea",{"data-slot":"textarea",className:D("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",s),...t})}function en({rounds:s,active:t,onPick:r,onStart:o,starting:h}){const i=s.find(p=>p.number===t),l=(s[0]?.number??0)+1,[y,c]=x.useState(!1),[m,k]=x.useState("");return e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsxs(te,{render:e.jsx("button",{type:"button",className:"inline-flex h-7 items-center gap-1.5 rounded-md border border-line-strong bg-muted px-2.5 text-[12.5px] font-semibold text-foreground","aria-label":"Round"}),children:[e.jsx(Lt,{className:"size-3.5"}),i?.name??`Round ${t}`,e.jsx(Ae,{className:"size-3 text-muted-foreground"})]}),e.jsxs(ne,{align:"start",className:"w-[260px]",children:[e.jsxs(ce,{children:[e.jsx(ye,{children:"Rounds"}),s.map(p=>e.jsxs(G,{onClick:()=>r(p.number),children:[e.jsx("span",{className:"truncate",children:p.name}),e.jsxs("span",{className:"ml-auto text-[11.5px] text-muted-foreground",children:[p.closed?"closed":"open",p.unresolved>0?` · ${p.unresolved} to go`:""]})]},p.id))]}),e.jsx(xs,{}),e.jsx(G,{onClick:()=>{k(`Round ${l}`),c(!0)},children:"Start a new round…"})]})]}),i&&e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[i.closed?"closed":"open",i.unresolved>0?` · ${i.unresolved} to go`:i.closed?"":" · all clear"]}),e.jsx(ls,{open:y,onOpenChange:c,children:e.jsx(ds,{children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:p=>{p.preventDefault(),!(!m.trim()||h)&&(o(m.trim()),c(!1))},children:[e.jsxs(cs,{children:[e.jsx(us,{children:"Start a new round"}),e.jsx(ms,{children:"A round is one pass of feedback, and it runs beside the others: starting one closes none of them. Reviewers pick a round in the widget and their comments go to it. Close or archive rounds in Settings."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(qe,{htmlFor:"round-name",children:"Name"}),e.jsx(Re,{id:"round-name",value:m,onChange:p=>k(p.target.value),autoFocus:!0})]}),e.jsxs(hs,{children:[e.jsx(M,{type:"button",variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsx(M,{type:"submit",disabled:!m.trim()||h,children:h?"Starting…":"Start the round"})]})]})})})]})}function ys({rounds:s,onMove:t,busy:r}){return s.length===0?null:e.jsxs(se,{children:[e.jsx(te,{render:e.jsx(M,{variant:"outline",size:"sm",disabled:r}),children:"Move to round…"}),e.jsx(ne,{align:"start",className:"w-[240px]",children:e.jsxs(ce,{children:[e.jsx(ye,{children:"Move to round"}),s.map(o=>e.jsxs(G,{onClick:()=>t(o.number),children:[e.jsx("span",{className:"truncate",children:o.name}),e.jsx("span",{className:"ml-auto text-[11.5px] text-muted-foreground",children:o.closed?"closed":"open"})]},o.id))]})})]})}const sn={open:"Open",progress:"In progress",review:"In review",resolved:"Resolved"};function tn(s,t,r={}){const o=r.fence??((f,L)=>L),h=r.statusLabel??(f=>sn[f]??f),i=s.anchor??{},l=s.context??{},y=i.page,c=y?.route??s.route??"/",m=y?.origin??t.origin??"",k=y?.pathname??c,p=m?`${m}${k}`:k,d=typeof i.label=="string"?o("label",i.label):"",w=i.element??i,a=[];a.push(`# ${s.key}${d?` — ${d}`:""}`),a.push(""),a.push(`${t.name} · ${h(s.status)} · left by ${s.createdBy?.name?o("name",s.createdBy.name):"someone"} on ${s.createdAt.slice(0,10)}`+(s.assignee?` · assigned to ${o("name",s.assignee.name)}`:"")),a.push(""),a.push("## Where to look"),a.push(""),a.push(`- Page: ${p}`),m&&a.push(`- Open on the page: ${m}${k}?${as("t")}=${encodeURIComponent(s.key)}`),d&&a.push(`- Element: ${d}`);const C=typeof i.css=="string"?i.css:typeof w.selector=="string"?w.selector:"";if(C&&a.push(`- Selector: \`${o("selector",C)}\``),typeof i.domid=="string"&&a.push(`- DOM id: \`#${o("selector",i.domid)}\``),typeof w.role=="string"){const f=typeof w.accessibleName=="string"?` “${o("label",w.accessibleName)}”`:"";a.push(`- Role: ${o("label",w.role)}${f}`)}typeof w.testId=="string"&&a.push(`- Test id: ${o("label",w.testId)}`);const N=i.text;N?.exact&&a.push(`- Text: “${o("label",N.exact)}”`),a.push(`- Anchor: ${s.anchorState??"unknown"}`),a.push(""),a.push("## What's wrong"),a.push("");const A=(s.comments??[]).filter(f=>f.body!==null);A.length===0&&a.push("> (no comment — a pin with no words)");for(const f of A){const L=f.author?.name?o("name",f.author.name):"Anonymous";a.push(`> **${L}${f.author?.kind==="agent"?" (agent)":""}** — ${f.createdAt.slice(0,16).replace("T"," ")}`);for(const Z of o("body",String(f.body)).split(`
52
+ `))a.push(`> ${Z}`);a.push(">")}a[a.length-1]===">"&&a.pop(),a.push(""),a.push("## Environment"),a.push("");const v=l.derived,z=l.viewport;(v?.browser||v?.os)&&a.push(`- Browser: ${[v.browser,v.os,v.device].filter(Boolean).join(" · ")}`),z?.w&&a.push(`- Viewport: ${z.w} × ${z.h}${z.dpr?` @${Math.round(z.dpr*10)/10}x`:""}`),l.prefersColorScheme&&a.push(`- Colour scheme: ${l.prefersColorScheme}`),l.language&&a.push(`- Language: ${l.language}`),l.ua&&a.push(`- User agent: ${o("label",String(l.ua))}`);const E=l.build;E&&Object.keys(E).length&&a.push(`- Build: ${Object.entries(E).map(([f,L])=>`${f}=${o("label",String(L))}`).join(", ")}`),a.push("");const _=l.breadcrumbs;if(_?.length){a.push(`## Breadcrumbs (${_.length}, oldest first)`),a.push("");for(const f of _)a.push(`- \`${String(f.t).slice(11,19)}\` ${f.type}${f.level?`/${f.level}`:""}: ${o("breadcrumb",String(f.message))}`);a.push("")}const I=s.attachments?.find(f=>f.kind==="screenshot")??s.attachments?.[0];if(I){a.push("## Screenshot"),a.push(""),a.push("Examine this screenshot for visual context — it is the viewport at the moment of the click."),a.push("");const f=I.url.startsWith("http")?I.url:`${t.dashboardOrigin??""}${I.url}`;a.push(`![${s.key}${I.width?` at ${I.width}×${I.height}`:""}](${f})`),a.push("")}return a.join(`
53
+ `).trimEnd()+`
54
+ `}function nn(s,t){return tn(s,t,{statusLabel:r=>yt(r)?pe[r]:r})}function an({thread:s,site:t,onStatus:r,onReply:o,replying:h,onClose:i,pool:l,onAssign:y,onAddPerson:c,trackers:m,onCreateIssue:k,creatingIssue:p,onEditComment:d,onDeleteComment:w,onDeleteThread:a,move:C}){const N=s.anchor??{},A=s.context??{},v=typeof N.label=="string"?N.label:"",z=N.page,E=z?.route??s.route??"/",_=z?.origin??t.origin,I=_?`${_}${z?.pathname??E}?${as("t")}=${encodeURIComponent(s.key)}`:"",f=s.attachments?.find(g=>g.kind==="screenshot")??s.attachments?.[0],[L,Z]=x.useState(""),[U,K]=x.useState(""),[$,T]=x.useState(!1),[V,ue]=x.useState(!1),me=l.find(g=>g.isMe)?.id,B=()=>{navigator.clipboard?.writeText(nn(s,{name:t.name,..._?{origin:_}:{},dashboardOrigin:location.origin})),rs.success("Copied as a brief")};return e.jsxs("article",{className:"flex min-h-0 flex-1 flex-col","aria-label":`${s.key} — ${v||"a comment"}`,children:[e.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border/60 px-4 py-2.5",children:[e.jsx("span",{className:"font-mono text-[12px] text-muted-foreground",children:s.key}),e.jsx(on,{status:s.status,onStatus:r}),e.jsx(mn,{assignee:s.assignee??null,pool:l,onAssign:y,onAddPerson:c}),(m??[]).map(g=>{const b=s.refs?.find(q=>q.provider===g&&q.kind===Ls[g]&&q.status!=="detached");if(b){const q=g==="github"?`Issue #${b.externalId}`:g==="jira"?b.externalId:g==="slack"?"Slack message":/\/issue\/([A-Z][A-Z0-9]*-\d+)/.exec(b.url)?.[1]??`${Xe[g]} issue`;return e.jsxs(M,{variant:"ghost",size:"sm",render:e.jsx("a",{href:b.url,target:"_blank",rel:"noreferrer"}),children:[e.jsx(ts,{}),q]},g)}return k?e.jsx(M,{variant:"ghost",size:"sm",disabled:!!p,onClick:()=>k(g),children:p===g?g==="slack"?"Posting…":"Creating…":g==="slack"?"Post to Slack":`Create ${Xe[g]} issue`},g):null}),e.jsx("div",{className:"flex-1"}),C&&e.jsx(ys,{rounds:C.rounds,onMove:C.onMove,busy:C.busy}),e.jsxs(M,{variant:"ghost",size:"sm",onClick:B,children:[e.jsx(kt,{}),"Copy as brief"]}),a&&e.jsx(M,{variant:"ghost",size:"icon-sm","aria-label":`Delete ${s.key}`,title:"Delete this thread",onClick:()=>T(!0),children:e.jsx(gs,{})}),e.jsx(M,{variant:"ghost",size:"icon-sm","aria-label":"Close",onClick:i,children:e.jsx(ft,{})})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto px-4 py-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[16px] font-semibold leading-snug tracking-tight",children:v||"A comment on this page"}),e.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[12.5px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:E}),_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("a",{href:`${_}${z?.pathname??E}`,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-brand hover:underline",children:[_.replace(/^https?:\/\//,""),e.jsx(ts,{className:"size-3"})]})]}),I&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("a",{href:I,target:"_blank",rel:"noreferrer",className:"text-brand hover:underline",children:"Open on the page"})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-3",children:[!s.comments[0]?.body&&e.jsx("p",{className:"m-0 text-muted-foreground",children:"A pin with no words — the element says what it is about."}),s.comments.filter(g=>g.body!==null).map(g=>e.jsx(rn,{comment:g,reply:g!==s.comments[0],mine:Os(g,me),...d?{onEdit:b=>d(g.id,b)}:{},...w?{onDelete:()=>w(g.id)}:{}},g.id)),e.jsxs("form",{className:"flex gap-2.5",onSubmit:async g=>{g.preventDefault();const b=L.trim();if(!(!b||h)){K("");try{await o(b),Z("")}catch(q){K(q instanceof Error?q.message:"Could not send that reply.")}}},children:[e.jsx(he,{className:"size-6 shrink-0",children:e.jsx(xe,{className:"bg-primary text-[10px] font-semibold text-primary-foreground",children:"you"})}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2 rounded-md border border-input bg-card p-2",children:[e.jsx(vs,{"aria-label":"Reply",placeholder:`Reply to ${s.createdBy.name||"the reviewer"}…`,value:L,onChange:g=>Z(g.target.value),rows:2,className:"min-h-0 resize-none border-0 bg-transparent p-1 shadow-none focus-visible:ring-0"}),U&&e.jsx("p",{role:"alert",className:"m-0 text-[12px] text-destructive",children:U}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.status==="resolved"?e.jsx(M,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("open"),children:"Reopen"}):e.jsxs(e.Fragment,{children:[s.status!=="review"&&e.jsx(M,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("review"),children:"Mark in review"}),e.jsx(M,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("resolved"),children:"Mark resolved"})]}),e.jsx(M,{type:"submit",size:"sm",disabled:!L.trim()||h,children:h?"Sending…":"Reply"})]})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx(Ke,{children:"Screenshot"}),f?e.jsxs(e.Fragment,{children:[e.jsx("a",{href:f.url,target:"_blank",rel:"noreferrer",className:"block overflow-hidden rounded-lg border border-border bg-background",children:e.jsx("img",{src:f.url,alt:`The page when ${s.key} was left`,width:f.width,height:f.height,loading:"lazy",className:"block h-auto w-full"})}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:[f.width??"?"," × ",f.height??"?",A.prefersColorScheme?` · ${A.prefersColorScheme}`:""," · taken at the click, ",ze(s.createdAt)," ·"," ",e.jsx("a",{href:f.url,target:"_blank",rel:"noreferrer",className:"text-brand hover:underline",children:"open full size"})]})]}):e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-dashed border-border px-3 py-3 text-[12.5px] text-muted-foreground",children:[e.jsx(Nt,{className:"size-4 shrink-0"}),e.jsx("span",{children:"No screenshot for this one — either no bucket was connected when it was left, or the reviewer turned the picture off. The element and the environment below are unaffected."})]}),e.jsx(dn,{ctx:A})]}),e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx(Ke,{children:"Element"}),e.jsxs("dl",{className:"m-0 grid grid-cols-[110px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[v&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Label"}),e.jsx("dd",{className:"m-0",children:v})]}),typeof N.css=="string"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Selector"}),e.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-ink-soft",children:N.css})]}),typeof N.domid=="string"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"DOM id"}),e.jsxs("dd",{className:"m-0 font-mono text-[12px] text-ink-soft",children:["#",N.domid]})]}),typeof N.role=="string"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Role"}),e.jsxs("dd",{className:"m-0",children:[N.role,typeof N.accessibleName=="string"?` “${N.accessibleName}”`:""]})]}),N.text?.exact&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Text"}),e.jsxs("dd",{className:"m-0",children:["“",String(N.text.exact),"”"]})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Anchor"}),e.jsx("dd",{className:"m-0",children:e.jsx(ln,{state:s.anchorState})})]})]}),e.jsx(cn,{ctx:A}),e.jsx(un,{ctx:A})]}),a&&e.jsx(ps,{open:$,onOpenChange:T,title:`Delete ${s.key}?`,description:"Removes this comment thread and its screenshot for everyone. Linked issues in your tracker are not deleted.",confirmLabel:"Delete thread",busy:V,onConfirm:async()=>{ue(!0);try{await a(),T(!1)}catch{}finally{ue(!1)}}})]})}function rn({comment:s,reply:t,mine:r,onEdit:o,onDelete:h}){const[i,l]=x.useState(!1),[y,c]=x.useState(""),[m,k]=x.useState(!1),[p,d]=x.useState(!1),[w,a]=x.useState(!1),C=r&&!!o,N=!!h,A=async()=>{const v=y.trim();if(!(!v||m||!o)){if(v===s.body){l(!1);return}k(!0);try{await o(v),l(!1)}catch{}finally{k(!1)}}};return e.jsxs("div",{className:"flex gap-2.5",children:[e.jsx(he,{className:"size-6 shrink-0",children:e.jsx(xe,{className:D("text-[10px] font-semibold",s.author.kind==="agent"?"bg-muted text-ink-soft":"bg-brand-soft text-brand"),children:ke(s.author.name,"?")})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-baseline gap-2 text-[12px] text-muted-foreground",children:[e.jsx("b",{className:"text-[13px] font-semibold text-foreground",children:s.author.name||"Anonymous"}),s.author.kind==="agent"&&e.jsx("span",{className:"rounded-sm bg-muted px-1 text-[10.5px] font-medium uppercase tracking-wide",children:"agent"}),e.jsx("span",{children:ze(s.createdAt)}),(C||N)&&!i&&e.jsxs(se,{children:[e.jsx(te,{render:e.jsx(M,{variant:"ghost",size:"icon-xs",className:"ml-auto self-center text-muted-foreground","aria-label":`Actions for ${s.author.name||"Anonymous"}’s comment`}),children:e.jsx(zt,{})}),e.jsxs(ne,{align:"end",className:"min-w-36",children:[C&&e.jsxs(G,{onClick:()=>{c(s.body??""),l(!0)},children:[e.jsx(Bt,{}),"Edit"]}),N&&e.jsxs(G,{variant:"destructive",onClick:()=>d(!0),children:[e.jsx(gs,{}),"Delete"]})]})]})]}),i?e.jsxs("form",{className:"mt-1 flex flex-col gap-2",onSubmit:v=>{v.preventDefault(),A()},children:[e.jsx(vs,{"aria-label":"Edit your comment",value:y,autoFocus:!0,rows:3,disabled:m,onChange:v=>c(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),A()),v.key==="Escape"&&!m&&(v.preventDefault(),l(!1))}}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(M,{type:"button",variant:"ghost",size:"sm",disabled:m,onClick:()=>l(!1),children:"Cancel"}),e.jsx(M,{type:"submit",size:"sm",loading:m,disabled:!y.trim(),children:m?"Saving…":"Save"})]})]}):e.jsx("p",{className:"m-0 whitespace-pre-wrap text-[13.5px] leading-normal",children:s.body})]}),N&&e.jsx(ps,{open:p,onOpenChange:d,title:"Delete this comment?",description:t?"The reply is removed for everyone.":"The comment is removed for everyone. The pin and its replies stay.",confirmLabel:"Delete comment",busy:w,onConfirm:async()=>{a(!0);try{await h(),d(!1)}catch{}finally{a(!1)}}})]})}function on({status:s,onStatus:t}){return e.jsxs(se,{children:[e.jsx(te,{render:e.jsx("button",{type:"button",className:"inline-flex items-center rounded-full","aria-label":"Status"}),children:e.jsx(fs,{status:s})}),e.jsx(ne,{align:"start",className:"w-[180px]",children:e.jsx(Ue,{value:s,onValueChange:r=>t(r),children:Me.map(r=>e.jsx(de,{value:r,children:pe[r]},r))})})]})}function ln({state:s}){const t=s==="anchored"?"bg-ok-soft text-ok":s==="approximate"?"bg-muted text-ink-soft":"bg-warn-soft text-destructive",r=s==="anchored"?"Anchored":s==="approximate"?"Approximate":s==="orphaned"?"Orphaned":s;return e.jsx("span",{className:D("rounded-full px-2 py-0.5 text-[11.5px] font-medium",t),children:r})}function dn({ctx:s}){const t=s.capture;if(!t)return null;const r=[];return t.screenshot&&t.screenshot!=="ok"&&r.push(`Screenshot ${t.screenshot}${t.reasons?.length?` — ${t.reasons.join("; ")}`:""}`),t.breadcrumbs&&t.breadcrumbs!=="ok"&&r.push(`Breadcrumbs ${t.breadcrumbs}`),t.blindSpots?.length&&r.push(`${t.blindSpots.length} blind spot${t.blindSpots.length===1?"":"s"}: ${t.blindSpots.join("; ")}`),t.droppedCategories?.length&&r.push(`Dropped: ${t.droppedCategories.join(", ")}`),r.length?e.jsx("ul",{className:"m-0 list-none p-0 text-[12px] text-caution",children:r.map(o=>e.jsx("li",{children:o},o))}):null}function cn({ctx:s}){const t=s.derived,r=s.viewport,o=s.build,h=[];return t?.browser||t?.os?h.push(["Browser",[t.browser,t.os,t.device].filter(Boolean).join(" · ")]):s.ua&&h.push(["User agent",String(s.ua)]),r?.w&&h.push(["Viewport",`${r.w} × ${r.h}${r.dpr?` @${Math.round(r.dpr*10)/10}x`:""}`]),s.language&&h.push(["Language",String(s.language)]),o&&Object.keys(o).length&&h.push(["Build",Object.entries(o).map(([i,l])=>`${i} ${String(l)}`).join(" · ")]),h.length?e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ke,{children:"Environment"}),e.jsx("button",{type:"button",className:"text-[11.5px] text-brand hover:underline",onClick:()=>{navigator.clipboard?.writeText(JSON.stringify(s,null,2)),rs.success("Copied the environment")},children:"copy as JSON"})]}),e.jsx("dl",{className:"m-0 grid grid-cols-[110px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:h.map(([i,l])=>e.jsxs("span",{className:"contents",children:[e.jsx("dt",{className:"text-muted-foreground",children:i}),e.jsx("dd",{className:D("m-0",i==="Build"&&"font-mono text-[12px] text-ink-soft"),children:l})]},i))})]}):null}function un({ctx:s}){const t=s.breadcrumbs,[r,o]=x.useState(!1);if(!t?.length)return null;const h=t.filter(i=>i.level==="error"||i.type==="error").length;return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("button",{type:"button",className:"flex items-center gap-2 rounded-md border border-border px-3 py-2 text-left text-[13px] text-ink-soft","aria-expanded":r,onClick:()=>o(!r),children:[e.jsx(wt,{className:D("size-3.5 text-muted-foreground transition-transform",r&&"rotate-90")}),t.length," breadcrumb",t.length===1?"":"s",h>0?` · ${h} error${h===1?"":"s"} before the click`:"",e.jsx("span",{className:"ml-auto text-[12px] text-muted-foreground",children:r?"hide":"show"})]}),r&&e.jsx("ol",{className:"m-0 flex list-none flex-col gap-1 p-0 font-mono text-[11.5px]",children:t.map((i,l)=>e.jsxs("li",{className:D("flex gap-2",(i.level==="error"||i.type==="error")&&"text-destructive"),children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:i.t.slice(11,19)}),e.jsxs("span",{className:"shrink-0 w-14 text-muted-foreground",children:[i.type,i.level?`/${i.level}`:""]}),e.jsx("span",{className:"min-w-0 break-words",children:i.message})]},l))})]})}function mn({assignee:s,pool:t,onAssign:r,onAddPerson:o}){const[h,i]=x.useState(!1),l=t.find(d=>d.isMe),y=t.filter(d=>d.isTeam),c=t.filter(d=>!d.isTeam&&!d.isAgent),m=t.filter(d=>!d.isTeam&&d.isAgent),k=d=>r({id:d.id,name:d.name,kind:d.kind,isTeam:d.isTeam}),p=d=>e.jsxs(G,{onClick:()=>k(d),children:[e.jsx(he,{className:"size-4",children:e.jsx(xe,{className:D("text-[8px] font-semibold",d.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:ke(d.name,d.email)})}),e.jsx("span",{className:"truncate",children:d.isMe?`${d.name} (you)`:d.name}),s?.id===d.id&&e.jsx(is,{className:"ml-auto size-3.5"})]},d.id);return e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(te,{render:e.jsx(M,{variant:"ghost",size:"sm","aria-label":s?`Assignee: ${s.name}`:"Assignee"}),children:s?e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"size-4",children:e.jsx(xe,{className:D("text-[8px] font-semibold",s.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:ke(s.name)})}),e.jsx("span",{className:"max-w-[150px] truncate",children:s.name})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{}),"Assign"]})}),e.jsxs(ne,{align:"start",className:"min-w-56",children:[l&&s?.id!==l.id||s?e.jsxs(ce,{children:[l&&s?.id!==l.id&&e.jsx(G,{onClick:()=>k(l),children:"Assign to me"}),s&&e.jsx(G,{onClick:()=>r(null),children:"Unassign"})]}):null,y.length>0&&e.jsxs(ce,{children:[e.jsx(ye,{children:"The studio"}),y.map(p)]}),c.length>0&&e.jsxs(ce,{children:[e.jsx(ye,{children:"People who commented"}),c.map(p)]}),m.length>0&&e.jsxs(ce,{children:[e.jsx(ye,{children:"Agents"}),m.map(p)]}),e.jsx(xs,{}),e.jsx(ce,{children:e.jsxs(G,{onClick:()=>i(!0),children:[e.jsx(qt,{}),"Add a person…"]})})]})]}),e.jsx(hn,{open:h,onOpenChange:i,onAdd:async d=>{const w=await o(d);k(w)}})]})}function hn({open:s,onOpenChange:t,onAdd:r}){const[o,h]=x.useState(""),[i,l]=x.useState(""),[y,c]=x.useState(!1),[m,k]=x.useState(""),p=async d=>{if(d.preventDefault(),!(!o.trim()||y)){c(!0),k("");try{await r({name:o.trim(),...i.trim()?{email:i.trim()}:{}}),h(""),l(""),t(!1)}catch(w){k(w instanceof Vs?w.message:"Could not add the person.")}finally{c(!1)}}};return e.jsx(ls,{open:s,onOpenChange:t,children:e.jsx(ds,{children:e.jsxs("form",{onSubmit:d=>void p(d),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(cs,{children:[e.jsx(us,{children:"Add a person"}),e.jsx(ms,{children:"Somebody to assign comments to who has not commented yet — your client, before they have said anything. If they later open a review link with this email, their comments join up."})]}),m&&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:m}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(qe,{htmlFor:"person-name",children:"Name"}),e.jsx(Re,{id:"person-name",placeholder:"Sofia",value:o,onChange:d=>h(d.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(qe,{htmlFor:"person-email",children:"Email (optional)"}),e.jsx(Re,{id:"person-email",type:"email",placeholder:"sofia@acme.com",value:i,onChange:d=>l(d.target.value)})]}),e.jsxs(hs,{children:[e.jsx(M,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),e.jsx(M,{type:"submit",loading:y,disabled:!o.trim(),children:y?"Adding…":"Add and assign"})]})]})})})}st({thread:je().optional(),status:je().optional(),page:je().optional(),q:je().optional(),sort:es(["newest","oldest"]).optional(),round:tt().int().positive().optional(),assignee:je().optional(),view:es(["board"]).optional()});const ks={open:"bg-status-open",progress:"bg-status-progress",review:"bg-status-review",resolved:"bg-status-resolved"};function On(){const{site:s}=Ze.useParams(),t=Ze.useSearch(),r=qs(),o=St(),h=o.projects.find(n=>n.uid===s),i=ve($e.origins(s)),l=ve($e.rounds(s)),y=ve($e.assignees(s)),c=ve($e.siteIntegrations(s)),m=y.data?.data??[],k=m.find(n=>n.isMe)?.id,p=t.round??(l.data?Us(l.data.data):void 0),d=(l.data?.data??[]).filter(n=>!n.archived||n.number===p),w=x.useMemo(()=>({...p!==void 0?{round:p}:{},...t.page?{route:t.page}:{},...t.q?{q:t.q}:{}}),[p,t.page,t.q]),a=ve({...Ye(s,w),enabled:l.isSuccess}),C=Ye(s,w).queryKey,N=Ks(s,C),A=Hs(C),v=Ws(s,C),z=Gs(s),E=Js(s,C),_=Qs(s),I=Xs(s),f=Zs(C),L=Ys(C),Z=et(s,C),[U,K]=x.useState(new Set),$=n=>void r({to:"/s/$site/comments",params:{site:s},search:u=>({...u,...n}),replace:!0}),T=a.data?.data??[],V=x.useMemo(()=>new Set((t.status??"").split(",").filter(Boolean)),[t.status]),ue=x.useMemo(()=>{const n=new Map;for(const u of T)n.set(u.status,(n.get(u.status)??0)+1);return n},[T]),me=x.useMemo(()=>[...new Set(T.map(n=>He(n)))].sort(),[T]),B=x.useMemo(()=>{let n=V.size?T.filter(u=>V.has(u.status)):T;return t.assignee==="unassigned"?n=n.filter(u=>!u.assignee):t.assignee==="me"?n=n.filter(u=>!!k&&u.assignee?.id===k):t.assignee&&(n=n.filter(u=>u.assignee?.id===t.assignee)),t.sort==="oldest"&&(n=[...n].reverse()),n},[T,V,t.sort,t.assignee,k]),g=x.useMemo(()=>{const n=new Map;for(const u of B){const S=He(u);n.has(S)||n.set(S,[]),n.get(S).push(u)}return[...n.entries()]},[B]),b=t.thread?T.find(n=>n.key===t.thread)??null:null,q=V.size>0||!!t.page||!!t.q||!!t.assignee,Y=d.filter(n=>n.number!==p&&n.unresolved>0),R=o.user.role==="owner"||o.user.role==="admin"?d.filter(n=>!n.archived&&n.number!==p):[],J=(n,u)=>I.mutate({ids:n,round:u},{onSuccess:()=>{K(new Set),t.thread&&n.includes(b?.id??"")&&$({thread:void 0})}}),ae=n=>{const u=new Set(V);u.has(n)?u.delete(n):u.add(n),$({status:[...u].join(",")||void 0})},F=async n=>{const u=[...U];K(new Set);for(const S of u)await N.mutateAsync({id:S,status:n}).catch(()=>{})};x.useEffect(()=>{const n=u=>{if(u.metaKey||u.ctrlKey||u.altKey)return;const S=u.target;if(S&&(S.closest("input,textarea,select,[contenteditable]")||S.isContentEditable))return;const H=u.key.toLowerCase();if(H!=="j"&&H!=="k"&&H!=="e"||B.length===0)return;if(u.preventDefault(),H==="e"){if(!b)return;N.mutate({id:b.id,status:b.status==="resolved"?"open":"resolved"});return}const ee=b?B.findIndex(Ee=>Ee.id===b.id):-1,re=H==="j"?Math.min(ee+1,B.length-1):Math.max(ee-1,0),Ne=B[ee===-1?0:re];Ne&&$({thread:Ne.key})};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)});const O=t.view==="board",P=x.useMemo(()=>Me.map(n=>({status:n,items:B.filter(u=>u.status===n)})),[B]);return e.jsxs("div",{className:"flex h-[calc(100dvh-3rem)] min-h-0 flex-col",children:[e.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-border/60 px-4 py-2",children:U.size>0?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-[13px] font-medium",children:[U.size," selected"]}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"Move to"}),Me.map(n=>e.jsx(M,{variant:"outline",size:"sm",onClick:()=>void F(n),children:pe[n]},n)),e.jsx(ys,{rounds:R,busy:I.isPending,onMove:n=>J([...U],n)}),e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>K(new Set),children:"Clear"})]}):e.jsxs(e.Fragment,{children:[d.length>0&&p!==void 0&&e.jsx(en,{rounds:d,active:p,onPick:n=>$({round:n,thread:void 0}),onStart:n=>_.mutate(n,{onSuccess:u=>$({round:u.number,thread:void 0,status:void 0})}),starting:_.isPending}),e.jsx("span",{className:"mx-1 h-[18px] w-px bg-border"}),e.jsxs(Ve,{on:V.size===0,onClick:()=>$({status:void 0}),children:["All ",e.jsx("span",{className:"text-muted-foreground",children:T.length})]}),Me.map(n=>e.jsxs(Ve,{on:V.has(n),onClick:()=>ae(n),children:[e.jsx("span",{className:D("size-[7px] rounded-full",ks[n])}),pe[n]," ",e.jsx("span",{className:"text-muted-foreground",children:ue.get(n)??0})]},n)),e.jsx("div",{className:"flex-1"}),e.jsxs(Ve,{on:O,onClick:()=>$({view:O?void 0:"board"}),children:[O?e.jsx(Pt,{className:"size-3.5"}):e.jsx(Dt,{className:"size-3.5"}),O?"List":"Board"]}),e.jsx(pn,{value:t.q??"",onChange:n=>$({q:n||void 0})}),me.length>1&&e.jsxs(se,{children:[e.jsxs(te,{render:e.jsx("button",{type:"button",className:De(!!t.page)}),children:[t.page??"All pages",e.jsx(Ae,{className:"size-3 text-muted-foreground"})]}),e.jsxs(ne,{align:"end",children:[e.jsx(G,{onClick:()=>$({page:void 0}),children:"All pages"}),me.map(n=>e.jsx(G,{onClick:()=>$({page:n}),children:e.jsx("span",{className:"font-mono text-[12px]",children:n})},n))]})]}),e.jsxs(se,{children:[e.jsxs(te,{render:e.jsx("button",{type:"button",className:De(!!t.assignee),"aria-label":"Filter by assignee"}),children:[xn(t.assignee,m),e.jsx(Ae,{className:"size-3 text-muted-foreground"})]}),e.jsx(ne,{align:"end",children:e.jsxs(Ue,{value:t.assignee??"any",onValueChange:n=>$({assignee:n==="any"?void 0:n}),children:[e.jsx(de,{value:"any",children:"Anyone"}),e.jsx(de,{value:"unassigned",children:"Unassigned"}),k&&e.jsx(de,{value:"me",children:"Me"}),m.filter(n=>!n.isMe).map(n=>e.jsx(de,{value:n.id,children:n.name},n.id))]})})]}),e.jsxs(se,{children:[e.jsxs(te,{render:e.jsx("button",{type:"button",className:De(!1)}),children:[t.sort==="oldest"?"Oldest":"Newest",e.jsx(Ae,{className:"size-3 text-muted-foreground"})]}),e.jsx(ne,{align:"end",children:e.jsxs(Ue,{value:t.sort??"newest",onValueChange:n=>$({sort:n==="oldest"?"oldest":void 0}),children:[e.jsx(de,{value:"newest",children:"Newest first"}),e.jsx(de,{value:"oldest",children:"Oldest first"})]})})]})]})}),Y.map(n=>e.jsxs("button",{type:"button",className:"shrink-0 border-b border-border/60 bg-brand-soft px-4 py-1.5 text-left text-[12.5px] text-foreground",onClick:()=>$({round:n.number,thread:void 0}),children:[e.jsxs("b",{className:"font-semibold",children:[n.unresolved," unresolved"]})," in ",n.name," — still open, not carried over."," ",e.jsx("span",{className:"text-brand",children:"Go there"})]},n.id)),e.jsxs("div",{className:D("grid min-h-0 flex-1",b?"grid-cols-1 lg:grid-cols-[minmax(0,1fr)_520px]":"grid-cols-1"),children:[e.jsxs("div",{className:D("min-h-0 overflow-auto lg:border-r lg:border-border",b&&"hidden lg:block"),children:[a.isPending&&e.jsx(gn,{}),a.isError&&e.jsx(Oe,{title:"Could not load the comments",children:a.error.message}),a.isSuccess&&T.length===0&&!q&&e.jsx("div",{className:"mx-auto max-w-[560px] py-8",children:e.jsxs(Oe,{icon:e.jsx(Et,{className:"size-5"}),title:"No comments yet",children:[e.jsxs("p",{className:"m-0",children:["When someone leaves a comment on ",h.name," it appears here, grouped by page."]}),e.jsx("div",{className:"mt-4 text-left",children:e.jsx(Ct,{uid:s})})]})}),a.isSuccess&&T.length>0&&B.length===0&&e.jsx(Oe,{title:"Nothing matches",action:e.jsx(M,{variant:"outline",size:"sm",onClick:()=>$({status:void 0,page:void 0,q:void 0,assignee:void 0}),children:"Show all"}),children:"No comment matches that filter."}),O&&a.isSuccess&&B.length>0&&e.jsx(bn,{columns:P,uid:s,selectedId:b?.id??null,onMove:(n,u)=>N.mutate({id:n,status:u})}),!O&&g.map(([n,u])=>e.jsxs("div",{children:[e.jsxs("div",{className:"sticky top-0 z-10 flex items-center gap-2 border-b border-border/60 bg-background px-4 py-2 font-mono text-[12px] text-ink-soft",children:[n," ",e.jsxs("span",{className:"font-sans text-muted-foreground",children:["· ",u.length]})]}),u.map(S=>e.jsx(fn,{t:S,uid:s,on:b?.id===S.id,picked:U.has(S.id),picking:U.size>0,onPick:H=>K(ee=>{const re=new Set(ee);return H?re.add(S.id):re.delete(S.id),re})},S.id))]},n))]}),b&&e.jsxs("div",{className:"flex min-h-0 flex-col overflow-hidden bg-card",children:[e.jsx("div",{className:"lg:hidden",children:e.jsxs(M,{variant:"ghost",size:"sm",className:"m-2",onClick:()=>$({thread:void 0}),children:[e.jsx($t,{}),"Back to the list"]})}),e.jsx(an,{thread:b,site:{name:h.name,...i.data?.origins[0]?{origin:i.data.origins[0]}:{}},onStatus:n=>N.mutate({id:b.id,status:n}),onReply:n=>A.mutateAsync({id:b.id,body:n}),replying:A.isPending,pool:m,onAssign:n=>v.mutate({id:b.id,assignee:n}),onAddPerson:n=>z.mutateAsync(n),trackers:(c.data?.data??[]).map(n=>n.provider),onCreateIssue:n=>E.mutate({id:b.id,provider:n}),creatingIssue:E.isPending?E.variables?.provider:void 0,onEditComment:(n,u)=>f.mutateAsync({threadId:b.id,commentId:n,body:u}),onDeleteComment:n=>L.mutateAsync({threadId:b.id,commentId:n}),...o.user.role!=="viewer"?{onDeleteThread:async()=>{await Z.mutateAsync(b.id),$({thread:void 0})}}:{},...R.length?{move:{rounds:R,busy:I.isPending,onMove:n=>J([b.id],n)}}:{},onClose:()=>$({thread:void 0})})]})]})]})}function xn(s,t){return s?s==="unassigned"?"Unassigned":s==="me"?"Me":t.find(r=>r.id===s)?.name??"Assignee":"Assignee"}function He(s){return s.anchor?.page?.route??s.route??"/"}function De(s){return D("inline-flex h-7 items-center gap-1.5 whitespace-nowrap rounded-md border border-border bg-card px-2.5 text-[12.5px] font-medium text-ink-soft",s&&"border-line-strong bg-muted text-foreground")}function Ve({on:s,onClick:t,children:r}){return e.jsx("button",{type:"button",className:De(s),"aria-pressed":s,onClick:t,children:r})}function pn({value:s,onChange:t}){const[r,o]=x.useState(s);return e.jsxs("form",{className:"relative",onSubmit:h=>{h.preventDefault(),t(r.trim())},children:[e.jsx(vt,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),e.jsx(Re,{type:"search","aria-label":"Search comments",placeholder:"Search",value:r,onChange:h=>o(h.target.value),onBlur:()=>r.trim()!==s&&t(r.trim()),className:"h-7 w-[170px] pl-7 text-[12.5px]"})]})}function fn({t:s,uid:t,on:r,picked:o,picking:h,onPick:i}){const l=s.comments[0]?.body??(typeof s.anchor?.label=="string"?s.anchor.label:"(no comment)"),y=s.comments[0]?.body&&typeof s.anchor?.label=="string"?s.anchor.label:"";return e.jsxs("div",{className:D("group grid h-12 grid-cols-[22px_56px_minmax(0,1fr)_auto] items-center gap-2.5 border-b border-border/60 bg-card px-4 hover:bg-accent/60",r&&"bg-brand-soft hover:bg-brand-soft"),children:[e.jsx("span",{className:D("flex items-center",!h&&"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),children:e.jsx(Yt,{checked:o,onCheckedChange:c=>i(!!c),"aria-label":`Select ${s.key}`})}),e.jsxs(os,{to:"/s/$site/comments",params:{site:t},search:c=>({...c,thread:s.key}),className:"contents text-foreground",children:[e.jsx("span",{className:"font-mono text-[11.5px] text-muted-foreground",children:s.key}),e.jsxs("span",{className:"truncate text-[13.5px]",children:[l,y&&e.jsx("small",{className:"ml-2 text-[12px] text-muted-foreground",children:y})]}),e.jsxs("span",{className:"flex items-center gap-2.5 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"hidden sm:inline",children:s.createdBy.name||"someone"}),s.assignee&&e.jsx(he,{className:"size-5",title:`Assigned to ${s.assignee.name}`,children:e.jsx(xe,{className:D("text-[9px] font-semibold",s.assignee.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:ke(s.assignee.name)})}),e.jsx(fs,{status:s.status}),e.jsx("span",{className:"w-11 whitespace-nowrap text-right",children:ze(s.updatedAt)})]})]})]})}function gn(){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"flex items-center border-b border-border/60 bg-background px-4 py-2",children:e.jsx(be,{className:"h-3 w-16"})}),[70,55,80,62].map((s,t)=>e.jsxs("div",{className:"grid h-12 grid-cols-[22px_56px_minmax(0,1fr)_auto] items-center gap-2.5 border-b border-border/60 px-4",children:[e.jsx("span",{}),e.jsx(be,{className:"h-3 w-10"}),e.jsx(be,{className:"h-3",style:{width:`${s}%`}}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(be,{className:"h-3 w-11"}),e.jsx(be,{className:"h-[18px] w-16 rounded-full"})]})]},t))]})}function bn({columns:s,uid:t,selectedId:r,onMove:o}){const[h,i]=x.useState(null);return e.jsx("div",{className:"flex h-full min-h-0 gap-3 overflow-x-auto p-3",children:s.map(({status:l,items:y})=>e.jsxs("section",{"aria-label":pe[l],onDragOver:c=>{c.preventDefault(),i(l)},onDragLeave:()=>i(c=>c===l?null:c),onDrop:c=>{c.preventDefault(),i(null);const m=c.dataTransfer.getData("text/plain");m&&o(m,l)},className:D("flex w-[280px] shrink-0 flex-col rounded-lg border border-border bg-muted/40",h===l&&"border-brand bg-brand-soft"),children:[e.jsxs("h3",{className:"m-0 flex items-center gap-2 px-3 py-2 text-[12px] font-medium",children:[e.jsx("span",{className:D("size-[7px] rounded-full",ks[l])}),pe[l],e.jsx("span",{className:"text-muted-foreground",children:y.length})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-2 pt-0",children:[y.length===0&&e.jsx("p",{className:"m-0 px-1 py-3 text-[12px] text-muted-foreground",children:"Nothing here."}),y.map(c=>e.jsxs(os,{to:"/s/$site/comments",params:{site:t},search:m=>({...m,thread:c.key}),draggable:!0,onDragStart:m=>{m.dataTransfer.setData("text/plain",c.id),m.dataTransfer.effectAllowed="move"},className:D("flex cursor-grab flex-col gap-1.5 rounded-md border border-border bg-card p-2.5 text-foreground no-underline active:cursor-grabbing",r===c.id&&"border-brand ring-1 ring-brand"),children:[e.jsx("span",{className:"line-clamp-3 text-[13px]",children:c.comments[0]?.body??(typeof c.anchor?.label=="string"?c.anchor.label:"(no comment)")}),e.jsxs("span",{className:"flex items-center gap-2 text-[11.5px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:c.key}),e.jsx("span",{className:"truncate",children:He(c)}),e.jsx("span",{className:"flex-1"}),c.assignee&&e.jsx(he,{className:"size-4",title:`Assigned to ${c.assignee.name}`,children:e.jsx(xe,{className:D("text-[8px] font-semibold",c.assignee.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:ke(c.assignee.name)})}),e.jsx("span",{children:ze(c.updatedAt)})]})]},c.id))]})]},l))})}export{On as component,yt as isStatus};
@@ -1 +1 @@
1
- import{aI as A,r as f,j as e,B as g,aJ as S,f as I,aK as E,y as k,Y as F,F as L,H as y}from"./index-BCjjK9dr.js";import{u as C}from"./useQuery-6QR_MT4t.js";import{u as P,a as H}from"./zod-DbWDuTiO.js";import{C as R}from"./card-PWIpee1m.js";import{X as M,E as U,G as $,I as B,H as z,J as K,K as Y}from"./dialog-B_kwIiUp.js";import{L as N,I as J}from"./label-CU7jvj5k.js";import{T as V,a as q,b as D,c as p,d as G,e as j}from"./table-fR4tWQ4-.js";import{C as O}from"./ConfirmDialog-YHdRCMuk.js";import{C as Q}from"./CopyButton-BPFFhzYZ.js";import{P as X,E as W}from"./parts-Oxy1krsw.js";import{b as T}from"./labels--UUyt9uB.js";import{C as Z}from"./check-fUN7a3GX.js";import{U as _}from"./users-STxJg0L8.js";import{P as ee}from"./plus-Cl722ZH_.js";import"./useBaseQuery-CoqlgX-x.js";import"./copy-ZBdagSqO.js";function be(){const{site:s}=A.useParams(),{site:d}=A.useRouteContext(),r=C(k.links(s)),l=C(k.origins(s)),[x,t]=f.useState(!1),[n,a]=f.useState(null);f.useEffect(()=>a(null),[s]);const i=r.data?.data??[],c=l.data?.origins[0]?.replace(/\/+$/,"")??"",m=n?`${c}/${n.fragment}`:"",v=e.jsxs(g,{onClick:()=>t(!0),children:[e.jsx(ee,{}),"Add reviewer"]});return e.jsxs("div",{className:"p-7",children:[e.jsx(X,{title:"Reviewers",sub:`Each reviewer gets their own link to ${d.name}`,actions:v}),n&&e.jsxs("div",{className:"mb-4 flex max-w-[1040px] items-center gap-3 rounded-lg border border-ok bg-ok-soft px-3.5 py-3",role:"status",children:[e.jsx(Z,{className:"size-4 shrink-0 text-ok"}),e.jsxs("div",{className:"shrink-0",children:[e.jsxs("b",{className:"font-semibold",children:[n.name," added."]})," ",e.jsx("span",{className:"text-ink-soft",children:"Share this link — it is shown once."})]}),e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[12.5px]",children:m}),e.jsx(Q,{text:m,label:"Copy link",withText:!0}),e.jsx(g,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss",onClick:()=>a(null),children:e.jsx(M,{})})]}),r.isSuccess&&i.length===0?e.jsx(R,{className:"max-w-[1040px]",children:e.jsx(W,{icon:e.jsx(_,{className:"size-5"}),title:"No reviewers yet",action:v,children:"Add your client and send them their link. They never need an account."})}):e.jsx(R,{className:"max-w-[1040px] overflow-hidden py-0",children:e.jsxs(V,{children:[e.jsx(q,{children:e.jsxs(D,{children:[e.jsx(p,{children:"Name"}),e.jsx(p,{children:"Status"}),e.jsx(p,{children:"Uses"}),e.jsx(p,{children:"Last seen"}),e.jsx(p,{className:"w-0"})]})}),e.jsx(G,{children:i.map(u=>e.jsx(se,{link:u,uid:s,onRevoked:()=>a(h=>h?.id===u.id?null:h)},u.id))})]})}),e.jsx("p",{className:"m-0 mt-3 max-w-[1040px] text-[12.5px] text-muted-foreground",children:"Revoking ends every session minted from the link within 10 seconds. The comments a reviewer left stay."}),e.jsx(te,{uid:s,open:x,onOpenChange:t,onMinted:a})]})}function se({link:s,uid:d,onRevoked:r}){const l=S(d),[x,t]=f.useState(!1),n=!!s.revokedAt,a=!n&&new Date(s.expiresAt).getTime()<=Date.now(),i=n||a,c=Math.max(0,Math.ceil((new Date(s.expiresAt).getTime()-Date.now())/864e5));return e.jsxs(D,{className:I(i&&"text-muted-foreground"),children:[e.jsx(j,{className:"font-medium",children:s.name}),e.jsx(j,{children:n?e.jsxs("span",{children:["Revoked ",T(s.revokedAt)]}):a?e.jsx("span",{children:"Expired"}):e.jsxs("span",{children:[e.jsx("span",{className:"rounded-full bg-ok-soft px-2 py-0.5 text-[11.5px] font-medium text-ok",children:"Active"}),e.jsxs("span",{className:"ml-2 text-[12px] text-muted-foreground",children:["expires in ",c," day",c===1?"":"s"]})]})}),e.jsx(j,{children:s.useCount}),e.jsx(j,{className:"text-muted-foreground",children:s.lastUsedAt?T(s.lastUsedAt):"never"}),e.jsxs(j,{className:"text-right",children:[!n&&e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>t(!0),children:"Revoke"}),e.jsx(O,{open:x,onOpenChange:t,title:`Revoke ${s.name}'s link?`,description:`Every session minted from it ends within 10 seconds. The comments ${s.name} left stay. This cannot be undone — adding them again makes a new link.`,confirmLabel:"Revoke",busy:l.isPending,onConfirm:()=>{t(!1),r(),l.mutate(s.id)}})]})]})}const ne=L({name:y().trim().min(1,"Their name"),days:y(),roundId:y().optional()});function te({uid:s,open:d,onOpenChange:r,onMinted:l}){const x=E(s),t=C({...k.rounds(s),enabled:d}),[n,a]=f.useState(""),{register:i,handleSubmit:c,formState:m,reset:v}=P({resolver:H(ne),defaultValues:{days:"14",roundId:""}}),u=c(async o=>{a("");const b=Number(o.days);try{const w=await x.mutateAsync({name:o.name,...Number.isFinite(b)&&b>0?{expiresAt:new Date(Date.now()+b*864e5).toISOString()}:{},...o.roundId?{roundId:o.roundId}:{}});l(w),v(),r(!1)}catch(w){a(F(w))}}),h="h-8 w-full rounded-md border border-input bg-card px-2.5 text-[13.5px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50";return e.jsx(U,{open:d,onOpenChange:r,children:e.jsx($,{children:e.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(B,{children:[e.jsx(z,{children:"New reviewer"}),e.jsx(K,{children:"Your client's name, as you will see it on their comments. A link is generated once and shown to you once."})]}),n&&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:n}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(N,{htmlFor:"reviewer-name",children:"Name"}),e.jsx(J,{id:"reviewer-name",placeholder:"Marta, Kilnwork","aria-invalid":!!m.errors.name,...i("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(N,{htmlFor:"reviewer-days",children:"Link expires in"}),e.jsxs("select",{id:"reviewer-days",className:h,...i("days"),children:[e.jsx("option",{value:"7",children:"7 days"}),e.jsx("option",{value:"14",children:"14 days"}),e.jsx("option",{value:"30",children:"30 days"}),e.jsx("option",{value:"90",children:"90 days"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"You can revoke it at any time before that."})]}),t.data&&t.data.data.length>0&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(N,{htmlFor:"reviewer-round",children:"Pin to a round"}),e.jsxs("select",{id:"reviewer-round",className:h,...i("roundId"),children:[e.jsx("option",{value:"",children:"Any round"}),t.data.data.map(o=>e.jsx("option",{value:o.id,children:o.name},o.id))]})]}),e.jsxs(Y,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(g,{type:"submit",loading:m.isSubmitting,children:m.isSubmitting?"Adding…":"Add reviewer"})]})]})})})}export{be as component};
1
+ import{aI as A,r as f,j as e,B as g,aJ as S,f as I,aK as E,y as k,Y as F,F as L,H as y}from"./index-DMCyFEmS.js";import{u as C}from"./useQuery-Cl9FITTP.js";import{u as P,a as H}from"./zod-khKoKeAB.js";import{C as R}from"./card-C4v3pSqd.js";import{X as M,E as U,G as $,I as B,H as z,J as K,K as Y}from"./dialog-lgIL_ZCX.js";import{L as N,I as J}from"./label-CL3Ivlhy.js";import{T as V,a as q,b as D,c as p,d as G,e as j}from"./table-BgojscGP.js";import{C as O}from"./ConfirmDialog-s6KLZt6w.js";import{C as Q}from"./CopyButton-Cqz1MLVB.js";import{P as X,E as W}from"./parts-b71WkkoI.js";import{b as T}from"./labels--UUyt9uB.js";import{C as Z}from"./check-BKP4SJjJ.js";import{U as _}from"./users-BXCV1C3P.js";import{P as ee}from"./plus-BOeukd4A.js";import"./useBaseQuery-BI_bJwNl.js";import"./copy-nRZWPHR1.js";function be(){const{site:s}=A.useParams(),{site:d}=A.useRouteContext(),r=C(k.links(s)),l=C(k.origins(s)),[x,t]=f.useState(!1),[n,a]=f.useState(null);f.useEffect(()=>a(null),[s]);const i=r.data?.data??[],c=l.data?.origins[0]?.replace(/\/+$/,"")??"",m=n?`${c}/${n.fragment}`:"",v=e.jsxs(g,{onClick:()=>t(!0),children:[e.jsx(ee,{}),"Add reviewer"]});return e.jsxs("div",{className:"p-7",children:[e.jsx(X,{title:"Reviewers",sub:`Each reviewer gets their own link to ${d.name}`,actions:v}),n&&e.jsxs("div",{className:"mb-4 flex max-w-[1040px] items-center gap-3 rounded-lg border border-ok bg-ok-soft px-3.5 py-3",role:"status",children:[e.jsx(Z,{className:"size-4 shrink-0 text-ok"}),e.jsxs("div",{className:"shrink-0",children:[e.jsxs("b",{className:"font-semibold",children:[n.name," added."]})," ",e.jsx("span",{className:"text-ink-soft",children:"Share this link — it is shown once."})]}),e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[12.5px]",children:m}),e.jsx(Q,{text:m,label:"Copy link",withText:!0}),e.jsx(g,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss",onClick:()=>a(null),children:e.jsx(M,{})})]}),r.isSuccess&&i.length===0?e.jsx(R,{className:"max-w-[1040px]",children:e.jsx(W,{icon:e.jsx(_,{className:"size-5"}),title:"No reviewers yet",action:v,children:"Add your client and send them their link. They never need an account."})}):e.jsx(R,{className:"max-w-[1040px] overflow-hidden py-0",children:e.jsxs(V,{children:[e.jsx(q,{children:e.jsxs(D,{children:[e.jsx(p,{children:"Name"}),e.jsx(p,{children:"Status"}),e.jsx(p,{children:"Uses"}),e.jsx(p,{children:"Last seen"}),e.jsx(p,{className:"w-0"})]})}),e.jsx(G,{children:i.map(u=>e.jsx(se,{link:u,uid:s,onRevoked:()=>a(h=>h?.id===u.id?null:h)},u.id))})]})}),e.jsx("p",{className:"m-0 mt-3 max-w-[1040px] text-[12.5px] text-muted-foreground",children:"Revoking ends every session minted from the link within 10 seconds. The comments a reviewer left stay."}),e.jsx(te,{uid:s,open:x,onOpenChange:t,onMinted:a})]})}function se({link:s,uid:d,onRevoked:r}){const l=S(d),[x,t]=f.useState(!1),n=!!s.revokedAt,a=!n&&new Date(s.expiresAt).getTime()<=Date.now(),i=n||a,c=Math.max(0,Math.ceil((new Date(s.expiresAt).getTime()-Date.now())/864e5));return e.jsxs(D,{className:I(i&&"text-muted-foreground"),children:[e.jsx(j,{className:"font-medium",children:s.name}),e.jsx(j,{children:n?e.jsxs("span",{children:["Revoked ",T(s.revokedAt)]}):a?e.jsx("span",{children:"Expired"}):e.jsxs("span",{children:[e.jsx("span",{className:"rounded-full bg-ok-soft px-2 py-0.5 text-[11.5px] font-medium text-ok",children:"Active"}),e.jsxs("span",{className:"ml-2 text-[12px] text-muted-foreground",children:["expires in ",c," day",c===1?"":"s"]})]})}),e.jsx(j,{children:s.useCount}),e.jsx(j,{className:"text-muted-foreground",children:s.lastUsedAt?T(s.lastUsedAt):"never"}),e.jsxs(j,{className:"text-right",children:[!n&&e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>t(!0),children:"Revoke"}),e.jsx(O,{open:x,onOpenChange:t,title:`Revoke ${s.name}'s link?`,description:`Every session minted from it ends within 10 seconds. The comments ${s.name} left stay. This cannot be undone — adding them again makes a new link.`,confirmLabel:"Revoke",busy:l.isPending,onConfirm:()=>{t(!1),r(),l.mutate(s.id)}})]})]})}const ne=L({name:y().trim().min(1,"Their name"),days:y(),roundId:y().optional()});function te({uid:s,open:d,onOpenChange:r,onMinted:l}){const x=E(s),t=C({...k.rounds(s),enabled:d}),[n,a]=f.useState(""),{register:i,handleSubmit:c,formState:m,reset:v}=P({resolver:H(ne),defaultValues:{days:"14",roundId:""}}),u=c(async o=>{a("");const b=Number(o.days);try{const w=await x.mutateAsync({name:o.name,...Number.isFinite(b)&&b>0?{expiresAt:new Date(Date.now()+b*864e5).toISOString()}:{},...o.roundId?{roundId:o.roundId}:{}});l(w),v(),r(!1)}catch(w){a(F(w))}}),h="h-8 w-full rounded-md border border-input bg-card px-2.5 text-[13.5px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50";return e.jsx(U,{open:d,onOpenChange:r,children:e.jsx($,{children:e.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(B,{children:[e.jsx(z,{children:"New reviewer"}),e.jsx(K,{children:"Your client's name, as you will see it on their comments. A link is generated once and shown to you once."})]}),n&&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:n}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(N,{htmlFor:"reviewer-name",children:"Name"}),e.jsx(J,{id:"reviewer-name",placeholder:"Marta, Kilnwork","aria-invalid":!!m.errors.name,...i("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(N,{htmlFor:"reviewer-days",children:"Link expires in"}),e.jsxs("select",{id:"reviewer-days",className:h,...i("days"),children:[e.jsx("option",{value:"7",children:"7 days"}),e.jsx("option",{value:"14",children:"14 days"}),e.jsx("option",{value:"30",children:"30 days"}),e.jsx("option",{value:"90",children:"90 days"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"You can revoke it at any time before that."})]}),t.data&&t.data.data.length>0&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(N,{htmlFor:"reviewer-round",children:"Pin to a round"}),e.jsxs("select",{id:"reviewer-round",className:h,...i("roundId"),children:[e.jsx("option",{value:"",children:"Any round"}),t.data.data.map(o=>e.jsx("option",{value:o.id,children:o.name},o.id))]})]}),e.jsxs(Y,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(g,{type:"submit",loading:m.isSubmitting,children:m.isSubmitting?"Adding…":"Add reviewer"})]})]})})})}export{be as component};
@@ -1 +1 @@
1
- import{r as l,h as Me,a6 as de,a7 as Oe,d as ue,a5 as _e,E as me,i as he,j as e,a8 as Ye,e as Q,aG as ve,aM as Ue,f as pe,aN as Qe,aO as Je,B as V,y as Ae,aP as Xe,aQ as Ze,o as et,aR as tt}from"./index-BCjjK9dr.js";import{u as Fe}from"./useQuery-6QR_MT4t.js";import{f as Te,h as Le,j as Ve,u as Ke,A as st,c as nt,n as at,g as ye,e as it,k as ot,l as rt,a as dt,I as ae,L as q}from"./label-CU7jvj5k.js";import{O as lt,L as ct,M as ut,N as mt,A as ft,aL as je,ak as Re,ad as le,a9 as ce,aM as Ce,aN as Ie,ao as ht,aO as we,aa as pt,ab as gt,aP as ke,aQ as Ne,aR as Se,aS as Ee,aT as xt,aU as bt,X as vt}from"./dialog-B_kwIiUp.js";import{b as yt,u as jt,C as Rt}from"./CompositeItem-DOjAZOIw.js";import{u as Ct}from"./useValueChanged-BhvEiD3-.js";import{u as It}from"./FieldItemContext-CvuTIqbu.js";import{u as wt}from"./useAriaLabelledBy-Bk7BENOF.js";import{C as He}from"./ConfirmDialog-YHdRCMuk.js";import{C as kt}from"./CopyButton-BPFFhzYZ.js";import{I as Nt}from"./InstallTag-Dyle6Z7u.js";import{B as St}from"./badge-NV2UvVlq.js";import{a as ne,P as Et}from"./parts-Oxy1krsw.js";import{u as Be}from"./me-ttfbX4Cb.js";import{S as Pe}from"./switch-L2_Pf-6w.js";import{S as Pt}from"./SaveState-zx4IRIWV.js";import{P as Dt}from"./plus-Cl722ZH_.js";import"./useBaseQuery-CoqlgX-x.js";import"./check-fUN7a3GX.js";import"./copy-ZBdagSqO.js";import"./useRender-BybHPfHo.js";import"./card-PWIpee1m.js";import"./labels--UUyt9uB.js";const Mt=l.createContext(void 0);function Ot(s=!1){const t=l.useContext(Mt);if(!t&&!s)throw new Error(Me(86));return t}function At(s,t){return s.matches(":disabled")?!1:!t||s.form===t?!0:s.form===null&&!s.hasAttribute("form")}function Ft(s){return s==null||s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"}const fe={checked(s){return s?{"data-checked":""}:{"data-unchecked":""}},...lt,...Te},Ge="data-composite-item-active",ze=l.createContext(void 0);function Tt(){return l.useContext(ze)}function Lt(s){if(s==null)return"";if(typeof s=="string")return s;try{return JSON.stringify(s)}catch{return String(s)}}const We=l.createContext(void 0);function Vt(){const s=l.useContext(We);if(s===void 0)throw new Error(Me(52));return s}const Kt=l.forwardRef(function(t,n){const{render:d,className:o,disabled:c=!1,readOnly:r=!1,required:p=!1,"aria-labelledby":x,value:i,inputRef:T,nativeButton:h=!1,id:O,style:y,...j}=t,I=Tt(),{disabled:E,readOnly:_,required:b,form:B,checkedValue:R,touched:A=!1,validation:G,name:w,setCheckedValue:$=de,setTouched:Y=de,registerInputRef:a=de}=I??{},{setTouched:g,setFilled:v,state:k,disabled:P}=Le(),D=It(),{labelId:K,getDescriptionProps:J}=Ve(),m=P||D.disabled||E||c,f=_||r,L=b||p,H=B,N=I?R===i:i==="",F=l.useRef(null),S=l.useRef(null),z=G?.registerInput,W=l.useCallback(C=>z?.(C,{controlRef:F,value:void 0}),[z]),X=Oe(T,S,a,W);ue(()=>{S.current?.checked&&v(!0)},[v]),ue(()=>{if(S.current){if(m&&N){a(null);return}a(S.current)}},[N,m,a]);const ee=Ke(),te=st({id:O,implicit:!1,controlRef:F}),se=h?void 0:te,ie=wt(x,K,S,!h,se),oe={role:"radio","aria-checked":N,"aria-labelledby":ie,[Ge]:N?"":void 0,id:h?te:ee,onKeyDown(C){C.key==="Enter"&&C.preventDefault()},onClick(C){if(C.defaultPrevented||m||f)return;C.preventDefault();const Z=S.current;Z&&Ye(Z,C)},onFocus(C){C.defaultPrevented||m||f||!A||(S.current?.click(),Y(!1))}},{getButtonProps:re,buttonRef:u}=_e({disabled:m,native:h,composite:!1}),M={type:"radio",ref:X,form:H,id:se,name:w,tabIndex:-1,style:w?ct:ut,"aria-hidden":!0,...i!==void 0?{value:Lt(i)}:me,disabled:m,checked:N,required:L,readOnly:f,onChange(C){if(C.nativeEvent.defaultPrevented||m||f||i===void 0)return;const Z=nt(at,C.nativeEvent);$(i,Z),!Z.isCanceled&&g(!0)},onClick(C){C.stopPropagation()},onFocus(){F.current?.focus()}},U=l.useMemo(()=>({...k,required:L,disabled:m,readOnly:f,checked:N}),[k,m,f,N,L]),$e=U,ge=I!==void 0,xe=[n,F,u],be=[oe,j,re,J,G?C=>G.getValidationProps(m,C):me],qe=he("span",t,{enabled:!ge,state:U,ref:xe,props:be,stateAttributesMapping:fe});return e.jsxs(We.Provider,{value:$e,children:[ge?e.jsx(yt,{tag:"span",render:d,className:o,style:y,state:U,refs:xe,props:be,stateAttributesMapping:fe}):qe,e.jsx("input",{...M,suppressHydrationWarning:!0})]})}),Ht=l.forwardRef(function(t,n){const{render:d,className:o,style:c,keepMounted:r=!1,...p}=t,x=Vt(),i=x.checked,{mounted:T,transitionStatus:h,setMounted:O}=mt(i),y={...x,transitionStatus:h},j=l.useRef(null),I=r||T,E=he("span",t,{ref:[n,j],state:y,props:p,stateAttributesMapping:fe});return ft({open:i,ref:j,onComplete(){i||O(!1)}}),I?E:null}),Bt=[];function Gt(s){const{loopFocus:t=!0,orientation:n="both",grid:d,onLoop:o,direction:c,highlightedIndex:r,onHighlightedIndexChange:p,rootRef:x,enableHomeAndEndKeys:i=!1,stopEventPropagation:T,disabledIndices:h,modifierKeys:O=Bt}=s,[y,j]=l.useState(0),I=d!=null,E=l.useRef(null),_=Oe(E,x),b=l.useRef([]),B=l.useRef(!1),R=r??y,A=Q((a,g=!1)=>{if((p??j)(a),g){const v=b.current[a];je(E.current,v,c,n)}}),G=Q(a=>{if(a.size===0||B.current)return;B.current=!0;const g=Array.from(a.keys()),v=g.find(P=>P?.hasAttribute(Ge))??null,k=v?a.get(v)?.index??-1:-1;if(k!==-1)A(k);else if(Re(g,R,h)){const P=le(g,{disabledIndices:h});ce(g,P)||A(P)}je(E.current,v,c,n)});ue(()=>{if(h==null||r!=null||!B.current)return;const a=b.current;if(Re(a,R,h)){const g=le(a,{disabledIndices:h});ce(a,g)||A(g)}},[h,r,R,b,A]);const w=Q((a,g,v)=>o?o(a,g,v,b):v),$=Q(a=>{const g=a.key===Ce||a.key===Ie;if(!ht.has(a.key)||!i&&g||zt(a,O)||!E.current)return;const k=c==="rtl",P=k?Se:Ee,D=k?Ee:Se,K=n==="vertical"?ke:P,J=n==="vertical"?Ne:D,m=ye(a.nativeEvent);if(m!=null&&we(m)&&!Ft(m)){const S=m.selectionStart,z=m.selectionEnd,W=m.value;if(S==null||a.shiftKey||S!==z||a.key!==J&&S<W.length||a.key!==K&&S>0)return}let f=R;const L=pt(b,h),H=gt(b,h);d!=null&&(f=d({disabledIndices:h,elementsRef:b,event:a,highlightedIndex:R,loopFocus:t,maxIndex:H,minIndex:L,onLoop:w,orientation:n,rtl:k}));const N=n!=="vertical"&&a.key===P||n!=="horizontal"&&a.key===ke,F=n!=="vertical"&&a.key===D||n!=="horizontal"&&a.key===Ne;i&&(a.key===Ce?f=L:a.key===Ie&&(f=H)),f===R&&(N||F)&&(t&&f===H&&N?(f=L,o&&(f=o(a,R,f,b))):t&&f===L&&F?(f=H,o&&(f=o(a,R,f,b))):f=le(b.current,{startingIndex:f,decrement:F,disabledIndices:h})),f!==R&&!ce(b.current,f)&&(T&&a.stopPropagation(),(I||g||N||F)&&a.preventDefault(),A(f,!0),queueMicrotask(()=>{b.current[f]?.focus()}))});return{props:{ref:_,onFocus(a){const g=E.current,v=ye(a.nativeEvent);!g||v==null||!we(v)||v.setSelectionRange(0,v.value.length)},onKeyDown:$},highlightedIndex:R,onHighlightedIndexChange:A,elementsRef:b,onMapChange:G,relayKeyboardEvent:$}}function zt(s,t){for(const n of xt)if(!t.includes(n)&&s.getModifierState(n))return!0;return!1}function Wt(s){const{render:t,className:n,style:d,refs:o=ve,props:c=ve,state:r=me,stateAttributesMapping:p,highlightedIndex:x,onHighlightedIndexChange:i,orientation:T,grid:h,loopFocus:O,onLoop:y,enableHomeAndEndKeys:j,onMapChange:I,stopEventPropagation:E=!0,rootRef:_,disabledIndices:b,modifierKeys:B,highlightItemOnHover:R=!1,tag:A="div",...G}=s,w=jt(),{props:$,highlightedIndex:Y,onHighlightedIndexChange:a,elementsRef:g,onMapChange:v,relayKeyboardEvent:k}=Gt({grid:h,loopFocus:O,onLoop:y,orientation:T,highlightedIndex:x,onHighlightedIndexChange:i,rootRef:_,stopEventPropagation:E,enableHomeAndEndKeys:j,direction:w,disabledIndices:b,modifierKeys:B}),P=he(A,s,{state:r,ref:o,props:[$,...c,G],stateAttributesMapping:p}),D=l.useMemo(()=>({highlightedIndex:Y,onHighlightedIndexChange:a,highlightItemOnHover:R,relayKeyboardEvent:k}),[Y,a,R,k]);return e.jsx(Ue.Provider,{value:D,children:e.jsx(Rt,{elementsRef:g,onMapChange:K=>{I?.(K),v(K)},children:P})})}const $t=[bt],qt=l.forwardRef(function(t,n){const{render:d,className:o,disabled:c,readOnly:r,required:p,onValueChange:x,value:i,defaultValue:T,form:h,name:O,inputRef:y,id:j,style:I,...E}=t,{setTouched:_,setFocused:b,validationMode:B,name:R,disabled:A,state:G,validation:w,setDirty:$,setFilled:Y,validityData:a}=Le(),{labelId:g}=Ve(),{clearErrors:v,elementRef:k}=it(),P=Ot(!0),D=A||c,K=R??O,J=Ke(j),[m,f]=ot({controlled:i,default:T,name:"RadioGroup",state:"value"}),[L,H]=l.useState(!1),N=Q((u,M)=>{x?.(u,M),!M.isCanceled&&f(u)}),F=w.getInputControl,S=l.useMemo(()=>({get current(){return F()}}),[F]),z=l.useRef(null),W=l.useRef(null);function X(u){let M;return y&&(typeof y=="function"?M=y(u):y.current=u),z.current=u,M}const ee=Q(u=>{if(!u||u.disabled)return;W.current||(W.current=u);const M=z.current,U=u.checked||M==null||M.disabled?X(u):void 0;return()=>{W.current===u&&(W.current=null),z.current===u?U?(U(),z.current=null):X(null):U?.()}}),te=Q(()=>{const u=k.current;if(!u)return m??null;for(const M of w.registeredInputs.keys())if(M.checked&&At(M,u))return m??null;return null});rt(S,J,m??null,te,!D,O),Ct(m,()=>{v(K),$(m!==a.initialValue),Y(m!=null),w.change(m);const u=W.current;m==null&&u&&!u.disabled&&X(u)});const se=g??P?.legendId,ie={...G,disabled:D??!1,required:p??!1,readOnly:r??!1},oe=l.useMemo(()=>({checkedValue:m,disabled:D,form:h,validation:w,name:K,readOnly:r,registerInputRef:ee,required:p,setCheckedValue:N,setTouched:H,touched:L}),[m,D,h,w,K,r,ee,p,N,H,L]),re={id:j,role:"radiogroup","aria-required":p||void 0,"aria-disabled":D||void 0,"aria-readonly":r||void 0,"aria-labelledby":se,onFocus(){b(!0)},onBlur(u){dt(u.currentTarget,u.relatedTarget)||(_(!0),b(!1),B==="onBlur"&&w.commit(m))},onKeyDownCapture(u){u.key.startsWith("Arrow")&&(H(!0),b(!0))}};return e.jsx(ze.Provider,{value:oe,children:e.jsx(Wt,{render:d,className:o,style:I,state:ie,props:[re,E,u=>w.getValidationProps(D??!1,u)],refs:[n],stateAttributesMapping:Te,enableHomeAndEndKeys:!1,modifierKeys:$t})})});function _t({className:s,...t}){return e.jsx(qt,{"data-slot":"radio-group",className:pe("grid w-full gap-2",s),...t})}function Yt({className:s,...t}){return e.jsx(Kt,{"data-slot":"radio-group-item",className:pe("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",s),...t,children:e.jsx(Ht,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:e.jsx("span",{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground"})})})}function Ut({uid:s}){const t=Be(),n=Fe(Ae.rounds(s)),d=t.user.role==="owner"||t.user.role==="admin",o=n.data?.data??[],c=o.filter(r=>!r.closed&&!r.archived).length;return e.jsxs(ne,{title:"Rounds",description:e.jsx(e.Fragment,{children:"One pass of feedback each, and several can run at once — your own QA beside the client's. A new comment goes to the round its reviewer is looking at. Archive a finished round to put it away; delete removes its comments too."}),children:[!d&&e.jsx("p",{className:"m-0 text-[12.5px] text-muted-foreground",children:"Only an owner or an admin can change rounds."}),e.jsxs("ul",{className:"m-0 flex list-none flex-col divide-y divide-border p-0","aria-label":"Rounds",children:[o.map(r=>e.jsx(Qt,{uid:s,round:r,manager:d,last:!r.closed&&!r.archived&&c===1},r.id)),n.isSuccess&&o.length===0&&e.jsx("li",{className:"text-[12.5px] text-muted-foreground",children:"No rounds yet."})]})]})}const De="Open another round first — new comments need somewhere to go.";function Qt({uid:s,round:t,manager:n,last:d}){const o=Qe(s),c=Je(s),[r,p]=l.useState(!1),[x,i]=l.useState(t.name),[T,h]=l.useState(!1),O=t.archived?"archived":t.closed?"closed":"open",y=o.isPending||c.isPending;return e.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 py-2.5 first:pt-0 last:pb-0",children:[r?e.jsxs("form",{className:"flex min-w-0 flex-1 items-center gap-2",onSubmit:j=>{j.preventDefault();const I=x.trim();if(!I||I===t.name)return p(!1);o.mutate({id:t.id,name:I},{onSuccess:()=>p(!1)})},children:[e.jsx(ae,{"aria-label":`New name for ${t.name}`,value:x,maxLength:80,autoFocus:!0,onChange:j=>i(j.target.value),onKeyDown:j=>j.key==="Escape"&&p(!1)}),e.jsx(V,{type:"submit",size:"sm",disabled:!x.trim()||o.isPending,children:"Save"}),e.jsx(V,{type:"button",size:"sm",variant:"ghost",onClick:()=>p(!1),children:"Cancel"})]}):e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-[13.5px] font-medium",children:t.name}),e.jsx(St,{variant:"outline",className:"text-[11px]",children:O})]}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] text-muted-foreground",children:["Round ",t.number," · ",t.threads," ",t.threads===1?"comment":"comments",t.unresolved>0?` · ${t.unresolved} unresolved`:""]})]}),n&&!r&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1",title:d?De:void 0,children:[e.jsx(V,{size:"sm",variant:"ghost","aria-label":`Rename ${t.name}`,disabled:y,onClick:()=>{i(t.name),p(!0)},children:"Rename"}),!t.archived&&e.jsx(V,{size:"sm",variant:"ghost","aria-label":`${t.closed?"Reopen":"Close"} ${t.name}`,disabled:y||d,onClick:()=>o.mutate({id:t.id,closed:!t.closed}),children:t.closed?"Reopen":"Close"}),e.jsx(V,{size:"sm",variant:"ghost","aria-label":`${t.archived?"Restore":"Archive"} ${t.name}`,disabled:y||d,onClick:()=>o.mutate({id:t.id,archived:!t.archived}),children:t.archived?"Restore":"Archive"}),e.jsx(V,{size:"sm",variant:"ghost",className:"text-destructive","aria-label":`Delete ${t.name}`,disabled:y||d,onClick:()=>h(!0),children:"Delete…"})]}),n&&d&&!r&&e.jsx("p",{className:"m-0 w-full text-[12px] text-muted-foreground",children:De}),e.jsx(He,{open:T,onOpenChange:h,title:`Delete ${t.name}?`,description:t.threads>0?e.jsxs(e.Fragment,{children:["This deletes the round and"," ",e.jsxs("b",{className:"font-semibold text-foreground",children:[t.threads," ",t.threads===1?"comment":"comments"," and their screenshots"]}),". Reviewers stop seeing them straight away. To keep them out of sight instead, archive the round."]}):e.jsxs(e.Fragment,{children:["This round has no comments. Its number, Round ",t.number,", is not used again."]}),confirmLabel:"Delete round",confirmWord:t.name,busy:c.isPending,onConfirm:()=>c.mutate({id:t.id,confirm:t.name},{onSuccess:()=>h(!1)})})]})}const Jt=[{id:"open",title:"Everyone on the site",note:"The toolbar appears for every visitor on the addresses above. Simplest for a staging URL nobody else knows."},{id:"link-required",title:"Only reviewers with a link",note:"You add a reviewer and send them their link. Use this when staging is publicly reachable, or when one reviewer needs revoking without shutting the whole site."}];function ws(){const{site:s}=Xe.useParams(),t=Be(),n=t.projects.find(i=>i.uid===s),d=t.user.role==="owner"||t.user.role==="admin",o=Fe(Ae.origins(s)),c=Ze(s),[r,p]=l.useState(null),x=i=>c.mutate(i,{onSuccess:()=>p(Date.now())});return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(Et,{title:"Settings",sub:n.name,actions:e.jsx(Pt,{saving:c.isPending,savedAt:r})}),e.jsxs(ne,{title:"Site",description:"Its name, its ID for the tag, and where the widget may run.",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{children:"Site ID"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"rounded-md bg-muted px-2.5 py-1.5 font-mono text-[12.5px] text-ink-soft",children:n.uid}),e.jsx(kt,{text:n.uid,label:"Copy the site ID"})]})]}),e.jsx(Xt,{name:n.name,onSave:i=>x({name:i})}),e.jsx(Zt,{domain:o.data?.domain??null,loaded:o.isSuccess,onSave:i=>x({domain:i})}),e.jsx(es,{list:o.data?.origins??[],loaded:o.isSuccess,hasDomain:!!o.data?.domain,onChange:i=>x({origins:i})})]}),e.jsxs(ne,{title:"Widget",description:"Whether it runs, who the toolbar appears for, what guests may do, and the tag itself.",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(q,{htmlFor:"widget-on",className:"text-[13px] font-medium",children:"Widget on this site"}),e.jsx("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:"Off hides the toolbar for everyone and refuses new comments. The tag can stay in the site's code."})]}),e.jsx(Pe,{id:"widget-on","aria-label":"Widget on this site",checked:n.status!=="paused",onCheckedChange:i=>x({status:i?"active":"paused"})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(q,{htmlFor:"guests-status",className:"text-[13px] font-medium",children:"Guests can change status"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:["People who comment without an account or a review link can move a comment between Open, In progress, In review and Resolved.",!d&&" Only an owner or an admin can change this."]})]}),e.jsx(Pe,{id:"guests-status","aria-label":"Guests can change status",checked:n.guestsCanChangeStatus!==!1,disabled:!d,onCheckedChange:i=>x({guestsCanChangeStatus:i})})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(q,{children:"Who can comment"}),e.jsx(_t,{value:n.writeMode,onValueChange:i=>x({writeMode:String(i)}),className:"gap-2",children:Jt.map(i=>e.jsxs("label",{className:pe("flex cursor-pointer items-start gap-2.5 rounded-md border border-border px-3 py-2.5",n.writeMode===i.id&&"border-brand bg-brand-soft"),children:[e.jsx(Yt,{value:i.id,className:"mt-0.5","aria-label":i.title}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-[13px] font-medium",children:i.title}),e.jsx("span",{className:"block text-[12px] leading-normal text-muted-foreground",children:i.note})]})]},i.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{children:"The tag"}),e.jsx(Nt,{uid:n.uid}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["Paste it before ",e.jsx("code",{className:"font-mono",children:"</body>"})," on every page you want reviewed."]})]})]}),e.jsx(Ut,{uid:s}),e.jsx(ts,{uid:s,name:n.name})]})}function Xt({name:s,onSave:t}){const[n,d]=l.useState(s);l.useEffect(()=>d(s),[s]);const o=n.trim().length>0&&n.trim()!==s;return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:c=>{c.preventDefault(),o&&t(n.trim())},children:[e.jsx(q,{htmlFor:"site-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{id:"site-name",value:n,onChange:c=>d(c.target.value)}),o&&e.jsx(V,{type:"submit",variant:"outline",children:"Save"})]})]})}function Zt({domain:s,loaded:t,onSave:n}){const[d,o]=l.useState(s??"");l.useEffect(()=>o(s??""),[s]);const c=d.trim()!==(s??"");return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:r=>{r.preventDefault(),c&&n(d.trim()||null)},children:[e.jsx(q,{htmlFor:"site-domain",children:"Domain"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{id:"site-domain",placeholder:"kilnwork.studio",value:d,onChange:r=>o(r.target.value),disabled:!t}),c&&e.jsx(V,{type:"submit",variant:"outline",children:d.trim()?"Save domain":"Clear domain"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build."})]})}function es({list:s,loaded:t,hasDomain:n,onChange:d}){const[o,c]=l.useState("");return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{htmlFor:"site-origin-add",children:"Also allowed"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Exact addresses the domain does not cover — a client's other host, a preview on somebody else's suffix."}),e.jsxs("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:[s.map(r=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"rounded-md border border-border px-2 py-1 font-mono text-[12px]",children:r}),e.jsx(V,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove ${r}`,disabled:s.length<=1&&!n,onClick:()=>d(s.filter(p=>p!==r)),children:e.jsx(vt,{})})]},r)),t&&s.length===0&&e.jsx("li",{className:"text-[12.5px] text-muted-foreground",children:n?"None besides the domain.":"No address yet."})]}),e.jsxs("form",{className:"flex gap-2",onSubmit:r=>{r.preventDefault();const p=o.trim();p&&(d([...s,p]),c(""))},children:[e.jsx(ae,{id:"site-origin-add",placeholder:"https://staging.example.com",value:o,onChange:r=>c(r.target.value)}),e.jsxs(V,{type:"submit",variant:"outline",disabled:!o.trim(),children:[e.jsx(Dt,{}),"Add"]})]})]})}function ts({uid:s,name:t}){const[n,d]=l.useState(!1),o=et(),c=tt(s);return e.jsxs(ne,{danger:!0,title:"Delete this site",description:e.jsxs(e.Fragment,{children:["The site stops appearing and its widget stops being served."," ",e.jsx("b",{className:"font-semibold text-foreground",children:"Nothing your client wrote is destroyed"})," — the comments stay in the database, so a mistake here is recoverable."]}),children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("p",{className:"m-0 flex-1 text-[13px] text-ink-soft",children:"You will be asked to type the site's name."}),e.jsxs(V,{type:"button",variant:"outline",className:"border-destructive text-destructive",onClick:()=>d(!0),children:["Delete ",t,"…"]})]}),e.jsx(He,{open:n,onOpenChange:d,title:`Delete ${t}?`,description:"The site stops appearing and its widget stops being served. Nothing your client wrote is destroyed — the comments stay in the database.",confirmLabel:"Delete",confirmWord:t,busy:c.isPending,onConfirm:()=>c.mutate(void 0,{onSuccess:()=>{d(!1),o({to:"/sites"})}})})]})}export{ws as component};
1
+ import{r as l,h as Me,a6 as de,a7 as Oe,d as ue,a5 as _e,E as me,i as he,j as e,a8 as Ye,e as Q,aG as ve,aM as Ue,f as pe,aN as Qe,aO as Je,B as V,y as Ae,aP as Xe,aQ as Ze,o as et,aR as tt}from"./index-DMCyFEmS.js";import{u as Fe}from"./useQuery-Cl9FITTP.js";import{f as Te,h as Le,j as Ve,u as Ke,A as st,c as nt,n as at,g as ye,e as it,k as ot,l as rt,a as dt,I as ae,L as q}from"./label-CL3Ivlhy.js";import{O as lt,L as ct,M as ut,N as mt,A as ft,aL as je,ak as Re,ad as le,a9 as ce,aM as Ce,aN as Ie,ao as ht,aO as we,aa as pt,ab as gt,aP as ke,aQ as Ne,aR as Se,aS as Ee,aT as xt,aU as bt,X as vt}from"./dialog-lgIL_ZCX.js";import{b as yt,u as jt,C as Rt}from"./CompositeItem-DpSaUtYZ.js";import{u as Ct}from"./useValueChanged-Dh5Yg1r8.js";import{u as It}from"./FieldItemContext-4dJ9QpEG.js";import{u as wt}from"./useAriaLabelledBy-Ce10PDSC.js";import{C as He}from"./ConfirmDialog-s6KLZt6w.js";import{C as kt}from"./CopyButton-Cqz1MLVB.js";import{I as Nt}from"./InstallTag-B4frNgVO.js";import{B as St}from"./badge-CrUHZwEL.js";import{a as ne,P as Et}from"./parts-b71WkkoI.js";import{u as Be}from"./me-6-FBHysO.js";import{S as Pe}from"./switch-CYLwE1-9.js";import{S as Pt}from"./SaveState-DfBHRtEq.js";import{P as Dt}from"./plus-BOeukd4A.js";import"./useBaseQuery-BI_bJwNl.js";import"./check-BKP4SJjJ.js";import"./copy-nRZWPHR1.js";import"./useRender-Ck8DP-Z3.js";import"./card-C4v3pSqd.js";import"./labels--UUyt9uB.js";const Mt=l.createContext(void 0);function Ot(s=!1){const t=l.useContext(Mt);if(!t&&!s)throw new Error(Me(86));return t}function At(s,t){return s.matches(":disabled")?!1:!t||s.form===t?!0:s.form===null&&!s.hasAttribute("form")}function Ft(s){return s==null||s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"}const fe={checked(s){return s?{"data-checked":""}:{"data-unchecked":""}},...lt,...Te},Ge="data-composite-item-active",ze=l.createContext(void 0);function Tt(){return l.useContext(ze)}function Lt(s){if(s==null)return"";if(typeof s=="string")return s;try{return JSON.stringify(s)}catch{return String(s)}}const We=l.createContext(void 0);function Vt(){const s=l.useContext(We);if(s===void 0)throw new Error(Me(52));return s}const Kt=l.forwardRef(function(t,n){const{render:d,className:o,disabled:c=!1,readOnly:r=!1,required:p=!1,"aria-labelledby":x,value:i,inputRef:T,nativeButton:h=!1,id:O,style:y,...j}=t,I=Tt(),{disabled:E,readOnly:_,required:b,form:B,checkedValue:R,touched:A=!1,validation:G,name:w,setCheckedValue:$=de,setTouched:Y=de,registerInputRef:a=de}=I??{},{setTouched:g,setFilled:v,state:k,disabled:P}=Le(),D=It(),{labelId:K,getDescriptionProps:J}=Ve(),m=P||D.disabled||E||c,f=_||r,L=b||p,H=B,N=I?R===i:i==="",F=l.useRef(null),S=l.useRef(null),z=G?.registerInput,W=l.useCallback(C=>z?.(C,{controlRef:F,value:void 0}),[z]),X=Oe(T,S,a,W);ue(()=>{S.current?.checked&&v(!0)},[v]),ue(()=>{if(S.current){if(m&&N){a(null);return}a(S.current)}},[N,m,a]);const ee=Ke(),te=st({id:O,implicit:!1,controlRef:F}),se=h?void 0:te,ie=wt(x,K,S,!h,se),oe={role:"radio","aria-checked":N,"aria-labelledby":ie,[Ge]:N?"":void 0,id:h?te:ee,onKeyDown(C){C.key==="Enter"&&C.preventDefault()},onClick(C){if(C.defaultPrevented||m||f)return;C.preventDefault();const Z=S.current;Z&&Ye(Z,C)},onFocus(C){C.defaultPrevented||m||f||!A||(S.current?.click(),Y(!1))}},{getButtonProps:re,buttonRef:u}=_e({disabled:m,native:h,composite:!1}),M={type:"radio",ref:X,form:H,id:se,name:w,tabIndex:-1,style:w?ct:ut,"aria-hidden":!0,...i!==void 0?{value:Lt(i)}:me,disabled:m,checked:N,required:L,readOnly:f,onChange(C){if(C.nativeEvent.defaultPrevented||m||f||i===void 0)return;const Z=nt(at,C.nativeEvent);$(i,Z),!Z.isCanceled&&g(!0)},onClick(C){C.stopPropagation()},onFocus(){F.current?.focus()}},U=l.useMemo(()=>({...k,required:L,disabled:m,readOnly:f,checked:N}),[k,m,f,N,L]),$e=U,ge=I!==void 0,xe=[n,F,u],be=[oe,j,re,J,G?C=>G.getValidationProps(m,C):me],qe=he("span",t,{enabled:!ge,state:U,ref:xe,props:be,stateAttributesMapping:fe});return e.jsxs(We.Provider,{value:$e,children:[ge?e.jsx(yt,{tag:"span",render:d,className:o,style:y,state:U,refs:xe,props:be,stateAttributesMapping:fe}):qe,e.jsx("input",{...M,suppressHydrationWarning:!0})]})}),Ht=l.forwardRef(function(t,n){const{render:d,className:o,style:c,keepMounted:r=!1,...p}=t,x=Vt(),i=x.checked,{mounted:T,transitionStatus:h,setMounted:O}=mt(i),y={...x,transitionStatus:h},j=l.useRef(null),I=r||T,E=he("span",t,{ref:[n,j],state:y,props:p,stateAttributesMapping:fe});return ft({open:i,ref:j,onComplete(){i||O(!1)}}),I?E:null}),Bt=[];function Gt(s){const{loopFocus:t=!0,orientation:n="both",grid:d,onLoop:o,direction:c,highlightedIndex:r,onHighlightedIndexChange:p,rootRef:x,enableHomeAndEndKeys:i=!1,stopEventPropagation:T,disabledIndices:h,modifierKeys:O=Bt}=s,[y,j]=l.useState(0),I=d!=null,E=l.useRef(null),_=Oe(E,x),b=l.useRef([]),B=l.useRef(!1),R=r??y,A=Q((a,g=!1)=>{if((p??j)(a),g){const v=b.current[a];je(E.current,v,c,n)}}),G=Q(a=>{if(a.size===0||B.current)return;B.current=!0;const g=Array.from(a.keys()),v=g.find(P=>P?.hasAttribute(Ge))??null,k=v?a.get(v)?.index??-1:-1;if(k!==-1)A(k);else if(Re(g,R,h)){const P=le(g,{disabledIndices:h});ce(g,P)||A(P)}je(E.current,v,c,n)});ue(()=>{if(h==null||r!=null||!B.current)return;const a=b.current;if(Re(a,R,h)){const g=le(a,{disabledIndices:h});ce(a,g)||A(g)}},[h,r,R,b,A]);const w=Q((a,g,v)=>o?o(a,g,v,b):v),$=Q(a=>{const g=a.key===Ce||a.key===Ie;if(!ht.has(a.key)||!i&&g||zt(a,O)||!E.current)return;const k=c==="rtl",P=k?Se:Ee,D=k?Ee:Se,K=n==="vertical"?ke:P,J=n==="vertical"?Ne:D,m=ye(a.nativeEvent);if(m!=null&&we(m)&&!Ft(m)){const S=m.selectionStart,z=m.selectionEnd,W=m.value;if(S==null||a.shiftKey||S!==z||a.key!==J&&S<W.length||a.key!==K&&S>0)return}let f=R;const L=pt(b,h),H=gt(b,h);d!=null&&(f=d({disabledIndices:h,elementsRef:b,event:a,highlightedIndex:R,loopFocus:t,maxIndex:H,minIndex:L,onLoop:w,orientation:n,rtl:k}));const N=n!=="vertical"&&a.key===P||n!=="horizontal"&&a.key===ke,F=n!=="vertical"&&a.key===D||n!=="horizontal"&&a.key===Ne;i&&(a.key===Ce?f=L:a.key===Ie&&(f=H)),f===R&&(N||F)&&(t&&f===H&&N?(f=L,o&&(f=o(a,R,f,b))):t&&f===L&&F?(f=H,o&&(f=o(a,R,f,b))):f=le(b.current,{startingIndex:f,decrement:F,disabledIndices:h})),f!==R&&!ce(b.current,f)&&(T&&a.stopPropagation(),(I||g||N||F)&&a.preventDefault(),A(f,!0),queueMicrotask(()=>{b.current[f]?.focus()}))});return{props:{ref:_,onFocus(a){const g=E.current,v=ye(a.nativeEvent);!g||v==null||!we(v)||v.setSelectionRange(0,v.value.length)},onKeyDown:$},highlightedIndex:R,onHighlightedIndexChange:A,elementsRef:b,onMapChange:G,relayKeyboardEvent:$}}function zt(s,t){for(const n of xt)if(!t.includes(n)&&s.getModifierState(n))return!0;return!1}function Wt(s){const{render:t,className:n,style:d,refs:o=ve,props:c=ve,state:r=me,stateAttributesMapping:p,highlightedIndex:x,onHighlightedIndexChange:i,orientation:T,grid:h,loopFocus:O,onLoop:y,enableHomeAndEndKeys:j,onMapChange:I,stopEventPropagation:E=!0,rootRef:_,disabledIndices:b,modifierKeys:B,highlightItemOnHover:R=!1,tag:A="div",...G}=s,w=jt(),{props:$,highlightedIndex:Y,onHighlightedIndexChange:a,elementsRef:g,onMapChange:v,relayKeyboardEvent:k}=Gt({grid:h,loopFocus:O,onLoop:y,orientation:T,highlightedIndex:x,onHighlightedIndexChange:i,rootRef:_,stopEventPropagation:E,enableHomeAndEndKeys:j,direction:w,disabledIndices:b,modifierKeys:B}),P=he(A,s,{state:r,ref:o,props:[$,...c,G],stateAttributesMapping:p}),D=l.useMemo(()=>({highlightedIndex:Y,onHighlightedIndexChange:a,highlightItemOnHover:R,relayKeyboardEvent:k}),[Y,a,R,k]);return e.jsx(Ue.Provider,{value:D,children:e.jsx(Rt,{elementsRef:g,onMapChange:K=>{I?.(K),v(K)},children:P})})}const $t=[bt],qt=l.forwardRef(function(t,n){const{render:d,className:o,disabled:c,readOnly:r,required:p,onValueChange:x,value:i,defaultValue:T,form:h,name:O,inputRef:y,id:j,style:I,...E}=t,{setTouched:_,setFocused:b,validationMode:B,name:R,disabled:A,state:G,validation:w,setDirty:$,setFilled:Y,validityData:a}=Le(),{labelId:g}=Ve(),{clearErrors:v,elementRef:k}=it(),P=Ot(!0),D=A||c,K=R??O,J=Ke(j),[m,f]=ot({controlled:i,default:T,name:"RadioGroup",state:"value"}),[L,H]=l.useState(!1),N=Q((u,M)=>{x?.(u,M),!M.isCanceled&&f(u)}),F=w.getInputControl,S=l.useMemo(()=>({get current(){return F()}}),[F]),z=l.useRef(null),W=l.useRef(null);function X(u){let M;return y&&(typeof y=="function"?M=y(u):y.current=u),z.current=u,M}const ee=Q(u=>{if(!u||u.disabled)return;W.current||(W.current=u);const M=z.current,U=u.checked||M==null||M.disabled?X(u):void 0;return()=>{W.current===u&&(W.current=null),z.current===u?U?(U(),z.current=null):X(null):U?.()}}),te=Q(()=>{const u=k.current;if(!u)return m??null;for(const M of w.registeredInputs.keys())if(M.checked&&At(M,u))return m??null;return null});rt(S,J,m??null,te,!D,O),Ct(m,()=>{v(K),$(m!==a.initialValue),Y(m!=null),w.change(m);const u=W.current;m==null&&u&&!u.disabled&&X(u)});const se=g??P?.legendId,ie={...G,disabled:D??!1,required:p??!1,readOnly:r??!1},oe=l.useMemo(()=>({checkedValue:m,disabled:D,form:h,validation:w,name:K,readOnly:r,registerInputRef:ee,required:p,setCheckedValue:N,setTouched:H,touched:L}),[m,D,h,w,K,r,ee,p,N,H,L]),re={id:j,role:"radiogroup","aria-required":p||void 0,"aria-disabled":D||void 0,"aria-readonly":r||void 0,"aria-labelledby":se,onFocus(){b(!0)},onBlur(u){dt(u.currentTarget,u.relatedTarget)||(_(!0),b(!1),B==="onBlur"&&w.commit(m))},onKeyDownCapture(u){u.key.startsWith("Arrow")&&(H(!0),b(!0))}};return e.jsx(ze.Provider,{value:oe,children:e.jsx(Wt,{render:d,className:o,style:I,state:ie,props:[re,E,u=>w.getValidationProps(D??!1,u)],refs:[n],stateAttributesMapping:Te,enableHomeAndEndKeys:!1,modifierKeys:$t})})});function _t({className:s,...t}){return e.jsx(qt,{"data-slot":"radio-group",className:pe("grid w-full gap-2",s),...t})}function Yt({className:s,...t}){return e.jsx(Kt,{"data-slot":"radio-group-item",className:pe("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",s),...t,children:e.jsx(Ht,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:e.jsx("span",{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground"})})})}function Ut({uid:s}){const t=Be(),n=Fe(Ae.rounds(s)),d=t.user.role==="owner"||t.user.role==="admin",o=n.data?.data??[],c=o.filter(r=>!r.closed&&!r.archived).length;return e.jsxs(ne,{title:"Rounds",description:e.jsx(e.Fragment,{children:"One pass of feedback each, and several can run at once — your own QA beside the client's. A new comment goes to the round its reviewer is looking at. Archive a finished round to put it away; delete removes its comments too."}),children:[!d&&e.jsx("p",{className:"m-0 text-[12.5px] text-muted-foreground",children:"Only an owner or an admin can change rounds."}),e.jsxs("ul",{className:"m-0 flex list-none flex-col divide-y divide-border p-0","aria-label":"Rounds",children:[o.map(r=>e.jsx(Qt,{uid:s,round:r,manager:d,last:!r.closed&&!r.archived&&c===1},r.id)),n.isSuccess&&o.length===0&&e.jsx("li",{className:"text-[12.5px] text-muted-foreground",children:"No rounds yet."})]})]})}const De="Open another round first — new comments need somewhere to go.";function Qt({uid:s,round:t,manager:n,last:d}){const o=Qe(s),c=Je(s),[r,p]=l.useState(!1),[x,i]=l.useState(t.name),[T,h]=l.useState(!1),O=t.archived?"archived":t.closed?"closed":"open",y=o.isPending||c.isPending;return e.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 py-2.5 first:pt-0 last:pb-0",children:[r?e.jsxs("form",{className:"flex min-w-0 flex-1 items-center gap-2",onSubmit:j=>{j.preventDefault();const I=x.trim();if(!I||I===t.name)return p(!1);o.mutate({id:t.id,name:I},{onSuccess:()=>p(!1)})},children:[e.jsx(ae,{"aria-label":`New name for ${t.name}`,value:x,maxLength:80,autoFocus:!0,onChange:j=>i(j.target.value),onKeyDown:j=>j.key==="Escape"&&p(!1)}),e.jsx(V,{type:"submit",size:"sm",disabled:!x.trim()||o.isPending,children:"Save"}),e.jsx(V,{type:"button",size:"sm",variant:"ghost",onClick:()=>p(!1),children:"Cancel"})]}):e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-[13.5px] font-medium",children:t.name}),e.jsx(St,{variant:"outline",className:"text-[11px]",children:O})]}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] text-muted-foreground",children:["Round ",t.number," · ",t.threads," ",t.threads===1?"comment":"comments",t.unresolved>0?` · ${t.unresolved} unresolved`:""]})]}),n&&!r&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1",title:d?De:void 0,children:[e.jsx(V,{size:"sm",variant:"ghost","aria-label":`Rename ${t.name}`,disabled:y,onClick:()=>{i(t.name),p(!0)},children:"Rename"}),!t.archived&&e.jsx(V,{size:"sm",variant:"ghost","aria-label":`${t.closed?"Reopen":"Close"} ${t.name}`,disabled:y||d,onClick:()=>o.mutate({id:t.id,closed:!t.closed}),children:t.closed?"Reopen":"Close"}),e.jsx(V,{size:"sm",variant:"ghost","aria-label":`${t.archived?"Restore":"Archive"} ${t.name}`,disabled:y||d,onClick:()=>o.mutate({id:t.id,archived:!t.archived}),children:t.archived?"Restore":"Archive"}),e.jsx(V,{size:"sm",variant:"ghost",className:"text-destructive","aria-label":`Delete ${t.name}`,disabled:y||d,onClick:()=>h(!0),children:"Delete…"})]}),n&&d&&!r&&e.jsx("p",{className:"m-0 w-full text-[12px] text-muted-foreground",children:De}),e.jsx(He,{open:T,onOpenChange:h,title:`Delete ${t.name}?`,description:t.threads>0?e.jsxs(e.Fragment,{children:["This deletes the round and"," ",e.jsxs("b",{className:"font-semibold text-foreground",children:[t.threads," ",t.threads===1?"comment":"comments"," and their screenshots"]}),". Reviewers stop seeing them straight away. To keep them out of sight instead, archive the round."]}):e.jsxs(e.Fragment,{children:["This round has no comments. Its number, Round ",t.number,", is not used again."]}),confirmLabel:"Delete round",confirmWord:t.name,busy:c.isPending,onConfirm:()=>c.mutate({id:t.id,confirm:t.name},{onSuccess:()=>h(!1)})})]})}const Jt=[{id:"open",title:"Everyone on the site",note:"The toolbar appears for every visitor on the addresses above. Simplest for a staging URL nobody else knows."},{id:"link-required",title:"Only reviewers with a link",note:"You add a reviewer and send them their link. Use this when staging is publicly reachable, or when one reviewer needs revoking without shutting the whole site."}];function ws(){const{site:s}=Xe.useParams(),t=Be(),n=t.projects.find(i=>i.uid===s),d=t.user.role==="owner"||t.user.role==="admin",o=Fe(Ae.origins(s)),c=Ze(s),[r,p]=l.useState(null),x=i=>c.mutate(i,{onSuccess:()=>p(Date.now())});return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(Et,{title:"Settings",sub:n.name,actions:e.jsx(Pt,{saving:c.isPending,savedAt:r})}),e.jsxs(ne,{title:"Site",description:"Its name, its ID for the tag, and where the widget may run.",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{children:"Site ID"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"rounded-md bg-muted px-2.5 py-1.5 font-mono text-[12.5px] text-ink-soft",children:n.uid}),e.jsx(kt,{text:n.uid,label:"Copy the site ID"})]})]}),e.jsx(Xt,{name:n.name,onSave:i=>x({name:i})}),e.jsx(Zt,{domain:o.data?.domain??null,loaded:o.isSuccess,onSave:i=>x({domain:i})}),e.jsx(es,{list:o.data?.origins??[],loaded:o.isSuccess,hasDomain:!!o.data?.domain,onChange:i=>x({origins:i})})]}),e.jsxs(ne,{title:"Widget",description:"Whether it runs, who the toolbar appears for, what guests may do, and the tag itself.",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(q,{htmlFor:"widget-on",className:"text-[13px] font-medium",children:"Widget on this site"}),e.jsx("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:"Off hides the toolbar for everyone and refuses new comments. The tag can stay in the site's code."})]}),e.jsx(Pe,{id:"widget-on","aria-label":"Widget on this site",checked:n.status!=="paused",onCheckedChange:i=>x({status:i?"active":"paused"})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(q,{htmlFor:"guests-status",className:"text-[13px] font-medium",children:"Guests can change status"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:["People who comment without an account or a review link can move a comment between Open, In progress, In review and Resolved.",!d&&" Only an owner or an admin can change this."]})]}),e.jsx(Pe,{id:"guests-status","aria-label":"Guests can change status",checked:n.guestsCanChangeStatus!==!1,disabled:!d,onCheckedChange:i=>x({guestsCanChangeStatus:i})})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(q,{children:"Who can comment"}),e.jsx(_t,{value:n.writeMode,onValueChange:i=>x({writeMode:String(i)}),className:"gap-2",children:Jt.map(i=>e.jsxs("label",{className:pe("flex cursor-pointer items-start gap-2.5 rounded-md border border-border px-3 py-2.5",n.writeMode===i.id&&"border-brand bg-brand-soft"),children:[e.jsx(Yt,{value:i.id,className:"mt-0.5","aria-label":i.title}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-[13px] font-medium",children:i.title}),e.jsx("span",{className:"block text-[12px] leading-normal text-muted-foreground",children:i.note})]})]},i.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{children:"The tag"}),e.jsx(Nt,{uid:n.uid}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["Paste it before ",e.jsx("code",{className:"font-mono",children:"</body>"})," on every page you want reviewed."]})]})]}),e.jsx(Ut,{uid:s}),e.jsx(ts,{uid:s,name:n.name})]})}function Xt({name:s,onSave:t}){const[n,d]=l.useState(s);l.useEffect(()=>d(s),[s]);const o=n.trim().length>0&&n.trim()!==s;return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:c=>{c.preventDefault(),o&&t(n.trim())},children:[e.jsx(q,{htmlFor:"site-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{id:"site-name",value:n,onChange:c=>d(c.target.value)}),o&&e.jsx(V,{type:"submit",variant:"outline",children:"Save"})]})]})}function Zt({domain:s,loaded:t,onSave:n}){const[d,o]=l.useState(s??"");l.useEffect(()=>o(s??""),[s]);const c=d.trim()!==(s??"");return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:r=>{r.preventDefault(),c&&n(d.trim()||null)},children:[e.jsx(q,{htmlFor:"site-domain",children:"Domain"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{id:"site-domain",placeholder:"kilnwork.studio",value:d,onChange:r=>o(r.target.value),disabled:!t}),c&&e.jsx(V,{type:"submit",variant:"outline",children:d.trim()?"Save domain":"Clear domain"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build."})]})}function es({list:s,loaded:t,hasDomain:n,onChange:d}){const[o,c]=l.useState("");return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{htmlFor:"site-origin-add",children:"Also allowed"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Exact addresses the domain does not cover — a client's other host, a preview on somebody else's suffix."}),e.jsxs("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:[s.map(r=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"rounded-md border border-border px-2 py-1 font-mono text-[12px]",children:r}),e.jsx(V,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove ${r}`,disabled:s.length<=1&&!n,onClick:()=>d(s.filter(p=>p!==r)),children:e.jsx(vt,{})})]},r)),t&&s.length===0&&e.jsx("li",{className:"text-[12.5px] text-muted-foreground",children:n?"None besides the domain.":"No address yet."})]}),e.jsxs("form",{className:"flex gap-2",onSubmit:r=>{r.preventDefault();const p=o.trim();p&&(d([...s,p]),c(""))},children:[e.jsx(ae,{id:"site-origin-add",placeholder:"https://staging.example.com",value:o,onChange:r=>c(r.target.value)}),e.jsxs(V,{type:"submit",variant:"outline",disabled:!o.trim(),children:[e.jsx(Dt,{}),"Add"]})]})]})}function ts({uid:s,name:t}){const[n,d]=l.useState(!1),o=et(),c=tt(s);return e.jsxs(ne,{danger:!0,title:"Delete this site",description:e.jsxs(e.Fragment,{children:["The site stops appearing and its widget stops being served."," ",e.jsx("b",{className:"font-semibold text-foreground",children:"Nothing your client wrote is destroyed"})," — the comments stay in the database, so a mistake here is recoverable."]}),children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("p",{className:"m-0 flex-1 text-[13px] text-ink-soft",children:"You will be asked to type the site's name."}),e.jsxs(V,{type:"button",variant:"outline",className:"border-destructive text-destructive",onClick:()=>d(!0),children:["Delete ",t,"…"]})]}),e.jsx(He,{open:n,onOpenChange:d,title:`Delete ${t}?`,description:"The site stops appearing and its widget stops being served. Nothing your client wrote is destroyed — the comments stay in the database.",confirmLabel:"Delete",confirmWord:t,busy:c.isPending,onConfirm:()=>c.mutate(void 0,{onSuccess:()=>{d(!1),o({to:"/sites"})}})})]})}export{ws as component};
@@ -1 +1 @@
1
- import{I as x,o as h,r as g,p as f,x as j,z as N,A as w,j as e,G as b,B as y,F as S,H as r}from"./index-BCjjK9dr.js";import{u as v,a as A}from"./zod-DbWDuTiO.js";import{L as i,I as o}from"./label-CU7jvj5k.js";const F=S({email:r().trim().email("An email address"),password:r().min(12,"At least 12 characters"),orgName:r().trim().max(120).optional()});function E(){const{claim:d}=x.useSearch(),c=h(),[l,n]=g.useState(""),{register:a,handleSubmit:p,formState:s}=v({resolver:A(F)}),u=p(async t=>{n("");try{await f.setup({token:d??"",orgName:t.orgName||"My studio",projectName:"",email:t.email,password:t.password,address:location.origin}),j("in"),N.clear(),c({to:"/welcome",replace:!0})}catch(m){n(m instanceof w?m.message:"Something went wrong. Try again.")}});return e.jsx(b,{width:400,children:e.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Set up Snagset"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"This instance has not been claimed yet. The account you make here is the only one, until you add another."})]}),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("fieldset",{disabled:s.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"email",children:"Your email"}),e.jsx(o,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!s.errors.email,...a("email")}),s.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:s.errors.email.message})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"password",children:"Password"}),e.jsx(o,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!s.errors.password,...a("password")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. There is no reset email on a fresh install — keep it."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(i,{htmlFor:"orgName",children:["Studio name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(o,{id:"orgName",placeholder:"My studio",...a("orgName")})]}),e.jsx(y,{type:"submit",size:"lg",loading:s.isSubmitting,children:s.isSubmitting?"Setting up…":"Create my account"})]})]})})}export{E as component};
1
+ import{I as x,o as h,r as g,p as f,x as j,z as N,A as w,j as e,G as b,B as y,F as S,H as r}from"./index-DMCyFEmS.js";import{u as v,a as A}from"./zod-khKoKeAB.js";import{L as i,I as o}from"./label-CL3Ivlhy.js";const F=S({email:r().trim().email("An email address"),password:r().min(12,"At least 12 characters"),orgName:r().trim().max(120).optional()});function E(){const{claim:d}=x.useSearch(),c=h(),[l,n]=g.useState(""),{register:a,handleSubmit:p,formState:s}=v({resolver:A(F)}),u=p(async t=>{n("");try{await f.setup({token:d??"",orgName:t.orgName||"My studio",projectName:"",email:t.email,password:t.password,address:location.origin}),j("in"),N.clear(),c({to:"/welcome",replace:!0})}catch(m){n(m instanceof w?m.message:"Something went wrong. Try again.")}});return e.jsx(b,{width:400,children:e.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Set up Snagset"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"This instance has not been claimed yet. The account you make here is the only one, until you add another."})]}),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("fieldset",{disabled:s.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"email",children:"Your email"}),e.jsx(o,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!s.errors.email,...a("email")}),s.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:s.errors.email.message})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"password",children:"Password"}),e.jsx(o,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!s.errors.password,...a("password")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. There is no reset email on a fresh install — keep it."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(i,{htmlFor:"orgName",children:["Studio name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(o,{id:"orgName",placeholder:"My studio",...a("orgName")})]}),e.jsx(y,{type:"submit",size:"lg",loading:s.isSubmitting,children:s.isSubmitting?"Setting up…":"Create my account"})]})]})})}export{E as component};
@@ -1 +1 @@
1
- import{J as w,o as y,r as l,y as d,p as N,x as S,A as k,j as e,G as C,B as F,f as E,L,F as R,H as m}from"./index-BCjjK9dr.js";import{u as c}from"./useQuery-6QR_MT4t.js";import{u as A,a as I}from"./zod-DbWDuTiO.js";import{L as u,I as p}from"./label-CU7jvj5k.js";import{C as z}from"./chevron-right-D_gtsnlu.js";import"./useBaseQuery-CoqlgX-x.js";const B=R({email:m().trim().min(1,"Your email"),password:m().min(1,"Your password")});function Q(){const{redirect:x}=w.useSearch(),r=y(),[a,o]=l.useState(""),[s,h]=l.useState(!1),{register:i,handleSubmit:f,formState:t}=A({resolver:I(B)});c({...d.claimed(),enabled:!0}).data===!1&&r({to:"/setup",replace:!0});const g=c(d.setupState()),j=f(async({email:b,password:v})=>{o("");try{await N.login(b,v),S("in"),r({to:x??"/sites",replace:!0})}catch(n){o(n instanceof k?n.message:"Could not reach the server.")}});return e.jsx(C,{children:e.jsxs("form",{onSubmit:j,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Sign in"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"The studio side. Reviewers don't sign in — they open a link."})]}),a&&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:a}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(u,{htmlFor:"email",children:"Email"}),e.jsx(p,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!t.errors.email,...i("email")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(u,{htmlFor:"password",children:"Password"}),e.jsx(p,{id:"password",type:"password",autoComplete:"current-password","aria-invalid":!!t.errors.password,...i("password")})]}),e.jsx(F,{type:"submit",size:"lg",loading:t.isSubmitting,children:t.isSubmitting?"Signing in…":"Sign in"}),e.jsxs("button",{type:"button",className:"flex items-center gap-2 rounded-md border border-border px-3 py-2 text-left text-[13px] text-ink-soft","aria-expanded":s,onClick:()=>h(!s),children:[e.jsx(z,{className:E("size-3.5 text-muted-foreground transition-transform",s&&"rotate-90")}),"Forgot your password?"]}),g.data?.signup&&e.jsxs("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:["New here?"," ",e.jsx(L,{to:"/sign-up",className:"text-foreground underline underline-offset-4",children:"Create a studio"})]}),s&&e.jsxs("div",{className:"flex flex-col gap-2 text-[12.5px] leading-relaxed text-muted-foreground",children:[e.jsx("p",{className:"m-0",children:"There's no reset email — a fresh install has no mail set up, and whoever has a shell on the server already holds more authority than a reset link would grant. From that machine:"}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md border border-border bg-card px-3 py-2 font-mono text-[12px] text-foreground",children:e.jsx("code",{children:`printf '%s' "$NEW" | snagset passwd you@example.com`})}),e.jsx("p",{className:"m-0",children:"Every existing session for that account is signed out when it runs."})]})]})})}export{Q as component};
1
+ import{J as w,o as y,r as l,y as d,p as N,x as S,A as k,j as e,G as C,B as F,f as E,L,F as R,H as m}from"./index-DMCyFEmS.js";import{u as c}from"./useQuery-Cl9FITTP.js";import{u as A,a as I}from"./zod-khKoKeAB.js";import{L as u,I as p}from"./label-CL3Ivlhy.js";import{C as z}from"./chevron-right-BVbfidnK.js";import"./useBaseQuery-BI_bJwNl.js";const B=R({email:m().trim().min(1,"Your email"),password:m().min(1,"Your password")});function Q(){const{redirect:x}=w.useSearch(),r=y(),[a,o]=l.useState(""),[s,h]=l.useState(!1),{register:i,handleSubmit:f,formState:t}=A({resolver:I(B)});c({...d.claimed(),enabled:!0}).data===!1&&r({to:"/setup",replace:!0});const g=c(d.setupState()),j=f(async({email:b,password:v})=>{o("");try{await N.login(b,v),S("in"),r({to:x??"/sites",replace:!0})}catch(n){o(n instanceof k?n.message:"Could not reach the server.")}});return e.jsx(C,{children:e.jsxs("form",{onSubmit:j,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Sign in"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"The studio side. Reviewers don't sign in — they open a link."})]}),a&&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:a}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(u,{htmlFor:"email",children:"Email"}),e.jsx(p,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!t.errors.email,...i("email")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(u,{htmlFor:"password",children:"Password"}),e.jsx(p,{id:"password",type:"password",autoComplete:"current-password","aria-invalid":!!t.errors.password,...i("password")})]}),e.jsx(F,{type:"submit",size:"lg",loading:t.isSubmitting,children:t.isSubmitting?"Signing in…":"Sign in"}),e.jsxs("button",{type:"button",className:"flex items-center gap-2 rounded-md border border-border px-3 py-2 text-left text-[13px] text-ink-soft","aria-expanded":s,onClick:()=>h(!s),children:[e.jsx(z,{className:E("size-3.5 text-muted-foreground transition-transform",s&&"rotate-90")}),"Forgot your password?"]}),g.data?.signup&&e.jsxs("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:["New here?"," ",e.jsx(L,{to:"/sign-up",className:"text-foreground underline underline-offset-4",children:"Create a studio"})]}),s&&e.jsxs("div",{className:"flex flex-col gap-2 text-[12.5px] leading-relaxed text-muted-foreground",children:[e.jsx("p",{className:"m-0",children:"There's no reset email — a fresh install has no mail set up, and whoever has a shell on the server already holds more authority than a reset link would grant. From that machine:"}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md border border-border bg-card px-3 py-2 font-mono text-[12px] text-foreground",children:e.jsx("code",{children:`printf '%s' "$NEW" | snagset passwd you@example.com`})}),e.jsx("p",{className:"m-0",children:"Every existing session for that account is signed out when it runs."})]})]})})}export{Q as component};
@@ -1 +1 @@
1
- import{o as p,r as u,p as h,x as g,z as f,A as j,j as e,G as N,B as w,L as v,F as y,H as t}from"./index-BCjjK9dr.js";import{u as b,a as S}from"./zod-DbWDuTiO.js";import{L as o,I as i}from"./label-CU7jvj5k.js";const A=y({email:t().trim().email("An email address"),password:t().min(12,"At least 12 characters"),name:t().trim().max(120).optional(),orgName:t().trim().max(120).optional()});function k(){const d=p(),[n,l]=u.useState(""),{register:r,handleSubmit:c,formState:a}=b({resolver:S(A)}),x=c(async s=>{l("");try{await h.register({email:s.email,password:s.password,...s.name?{name:s.name}:{},orgName:s.orgName||"My studio"}),g("in"),f.clear(),d({to:"/welcome",replace:!0})}catch(m){l(m instanceof j?m.message:"Something went wrong. Try again.")}});return e.jsx(N,{width:400,children:e.jsxs("form",{onSubmit:x,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Create a studio"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"Your account, and the studio your sites live in. Reviewers never sign up — they open a link."})]}),n&&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:n}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(o,{htmlFor:"email",children:"Your email"}),e.jsx(i,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!a.errors.email,...r("email")}),a.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:a.errors.email.message})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(o,{htmlFor:"password",children:"Password"}),e.jsx(i,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!a.errors.password,...r("password")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. A short phrase of real words is fine."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(o,{htmlFor:"name",children:["Your name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(i,{id:"name",autoComplete:"name",...r("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(o,{htmlFor:"orgName",children:["Studio name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(i,{id:"orgName",placeholder:"My studio",...r("orgName")})]}),e.jsx(w,{type:"submit",size:"lg",loading:a.isSubmitting,children:a.isSubmitting?"Creating…":"Create my studio"}),e.jsxs("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:["Already have an account?"," ",e.jsx(v,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Sign in"})]})]})})}export{k as component};
1
+ import{o as p,r as u,p as h,x as g,z as f,A as j,j as e,G as N,B as w,L as v,F as y,H as t}from"./index-DMCyFEmS.js";import{u as b,a as S}from"./zod-khKoKeAB.js";import{L as o,I as i}from"./label-CL3Ivlhy.js";const A=y({email:t().trim().email("An email address"),password:t().min(12,"At least 12 characters"),name:t().trim().max(120).optional(),orgName:t().trim().max(120).optional()});function k(){const d=p(),[n,l]=u.useState(""),{register:r,handleSubmit:c,formState:a}=b({resolver:S(A)}),x=c(async s=>{l("");try{await h.register({email:s.email,password:s.password,...s.name?{name:s.name}:{},orgName:s.orgName||"My studio"}),g("in"),f.clear(),d({to:"/welcome",replace:!0})}catch(m){l(m instanceof j?m.message:"Something went wrong. Try again.")}});return e.jsx(N,{width:400,children:e.jsxs("form",{onSubmit:x,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Create a studio"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"Your account, and the studio your sites live in. Reviewers never sign up — they open a link."})]}),n&&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:n}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(o,{htmlFor:"email",children:"Your email"}),e.jsx(i,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!a.errors.email,...r("email")}),a.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:a.errors.email.message})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(o,{htmlFor:"password",children:"Password"}),e.jsx(i,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!a.errors.password,...r("password")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. A short phrase of real words is fine."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(o,{htmlFor:"name",children:["Your name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(i,{id:"name",autoComplete:"name",...r("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(o,{htmlFor:"orgName",children:["Studio name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(i,{id:"orgName",placeholder:"My studio",...r("orgName")})]}),e.jsx(w,{type:"submit",size:"lg",loading:a.isSubmitting,children:a.isSubmitting?"Creating…":"Create my studio"}),e.jsxs("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:["Already have an account?"," ",e.jsx(v,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Sign in"})]})]})})}export{k as component};
@@ -1 +1 @@
1
- import{X as v,r as x,j as e,B as c,L as N,o as y,t as w,p as A,A as S,F as $,H as p}from"./index-BCjjK9dr.js";import{u as k,a as _}from"./zod-DbWDuTiO.js";import{C}from"./card-PWIpee1m.js";import{E,G as D,I as F,H as I,J as L,K as P}from"./dialog-B_kwIiUp.js";import{L as h,I as g}from"./label-CU7jvj5k.js";import{P as z,E as H}from"./parts-Oxy1krsw.js";import{b as K}from"./labels--UUyt9uB.js";import{u as T}from"./me-ttfbX4Cb.js";import{P as f}from"./plus-Cl722ZH_.js";import{L as q}from"./layout-grid-DgutVVEL.js";import{I as B}from"./image-off-kQWiBpm4.js";import"./useBaseQuery-CoqlgX-x.js";function te(){const i=T(),{add:a}=v.useSearch(),[m,r]=x.useState(!!a);x.useEffect(()=>{a&&r(!0)},[a]);const d=i.projects.reduce((s,o)=>s+o.unresolved,0),t=i.limits.projects.limit,n=t!==null&&i.projects.length>=t;return e.jsxs("div",{className:"p-7",children:[e.jsx(z,{title:"Sites",sub:i.projects.length?`${i.projects.length}${t!==null?` of ${t}`:""} site${i.projects.length===1&&t===null?"":"s"} · ${d} open`:t!==null?`0 of ${t} sites`:void 0,actions:e.jsxs(c,{onClick:()=>r(!0),disabled:n,title:n?`This studio's plan allows ${t} sites.`:void 0,children:[e.jsx(f,{}),"Add a site"]})}),i.projects.length===0?e.jsx(C,{className:"max-w-[1100px]",children:e.jsx(H,{icon:e.jsx(q,{className:"size-5"}),title:"No sites yet",action:e.jsxs(c,{onClick:()=>r(!0),children:[e.jsx(f,{}),"Add a site"]}),children:"A site is one client website. Add it, paste the tag, and comments start arriving here."})}):e.jsx("div",{className:"grid max-w-[1100px] grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3",children:i.projects.map(s=>e.jsxs(N,{to:"/s/$site/comments",params:{site:s.uid},className:"block overflow-hidden rounded-lg border border-border bg-card text-foreground transition-shadow hover:shadow-[0_1px_2px_rgb(24_23_22/.06),0_8px_24px_rgb(24_23_22/.08)]",children:[e.jsx("div",{className:"flex h-[150px] items-center justify-center border-b border-border bg-background",children:s.previewUrl?e.jsx("img",{src:s.previewUrl,alt:"",className:"size-full object-cover object-top"}):e.jsxs("div",{className:"flex flex-col items-center gap-1 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-muted",children:e.jsx(B,{className:"size-4"})}),"No screenshot yet"]})}),e.jsxs("div",{className:"px-3.5 pb-3.5 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[14px] font-semibold",children:[e.jsx("span",{className:"truncate",children:s.name}),s.status==="paused"&&e.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-px text-[10.5px] font-medium uppercase tracking-wide text-muted-foreground",children:"Paused"})]}),s.domain&&e.jsx("div",{className:"mt-0.5 truncate font-mono text-[12px] text-muted-foreground",children:s.domain}),e.jsx("div",{className:"mt-2 text-[12.5px] text-ink-soft",children:s.threads===0?"Nothing filed yet":`${s.unresolved} open of ${s.threads}${s.lastActivityAt?` · ${K(s.lastActivityAt)}`:""}`})]})]},s.uid))}),e.jsx(Q,{open:m,onOpenChange:r})]})}const G=$({name:p().trim().min(1,"A name"),domain:p().trim().min(1,"Its domain")});function Q({open:i,onOpenChange:a}){const m=y(),r=w(),[d,t]=x.useState(""),{register:n,handleSubmit:s,formState:o,reset:j}=k({resolver:_(G)}),b=s(async u=>{t("");try{const l=await A.createProject(u.name,"",u.domain);await r.invalidateQueries({queryKey:["me"]}),j(),a(!1),m({to:"/s/$site/comments",params:{site:l.uid}})}catch(l){t(l instanceof S?l.message:"Could not add the site.")}});return e.jsx(E,{open:i,onOpenChange:a,children:e.jsx(D,{children:e.jsxs("form",{onSubmit:b,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(F,{children:[e.jsx(I,{children:"Add a site"}),e.jsx(L,{children:"One client website. The tag it needs is shown right after."})]}),d&&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:d}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(h,{htmlFor:"site-name",children:"Name"}),e.jsx(g,{id:"site-name",placeholder:"Kilnwork","aria-invalid":!!o.errors.name,...n("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(h,{htmlFor:"site-domain",children:"Domain"}),e.jsx(g,{id:"site-domain",placeholder:"kilnwork.studio","aria-invalid":!!o.errors.domain,...n("domain")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build. Exact addresses elsewhere can be added in Settings."})]}),e.jsxs(P,{children:[e.jsx(c,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(c,{type:"submit",loading:o.isSubmitting,children:o.isSubmitting?"Adding…":"Add site"})]})]})})})}export{te as component};
1
+ import{X as v,r as x,j as e,B as c,L as N,o as y,t as w,p as A,A as S,F as $,H as p}from"./index-DMCyFEmS.js";import{u as k,a as _}from"./zod-khKoKeAB.js";import{C}from"./card-C4v3pSqd.js";import{E,G as D,I as F,H as I,J as L,K as P}from"./dialog-lgIL_ZCX.js";import{L as h,I as g}from"./label-CL3Ivlhy.js";import{P as z,E as H}from"./parts-b71WkkoI.js";import{b as K}from"./labels--UUyt9uB.js";import{u as T}from"./me-6-FBHysO.js";import{P as f}from"./plus-BOeukd4A.js";import{L as q}from"./layout-grid-B-9bb2Av.js";import{I as B}from"./image-off-B6flKQEZ.js";import"./useBaseQuery-BI_bJwNl.js";function te(){const i=T(),{add:a}=v.useSearch(),[m,r]=x.useState(!!a);x.useEffect(()=>{a&&r(!0)},[a]);const d=i.projects.reduce((s,o)=>s+o.unresolved,0),t=i.limits.projects.limit,n=t!==null&&i.projects.length>=t;return e.jsxs("div",{className:"p-7",children:[e.jsx(z,{title:"Sites",sub:i.projects.length?`${i.projects.length}${t!==null?` of ${t}`:""} site${i.projects.length===1&&t===null?"":"s"} · ${d} open`:t!==null?`0 of ${t} sites`:void 0,actions:e.jsxs(c,{onClick:()=>r(!0),disabled:n,title:n?`This studio's plan allows ${t} sites.`:void 0,children:[e.jsx(f,{}),"Add a site"]})}),i.projects.length===0?e.jsx(C,{className:"max-w-[1100px]",children:e.jsx(H,{icon:e.jsx(q,{className:"size-5"}),title:"No sites yet",action:e.jsxs(c,{onClick:()=>r(!0),children:[e.jsx(f,{}),"Add a site"]}),children:"A site is one client website. Add it, paste the tag, and comments start arriving here."})}):e.jsx("div",{className:"grid max-w-[1100px] grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3",children:i.projects.map(s=>e.jsxs(N,{to:"/s/$site/comments",params:{site:s.uid},className:"block overflow-hidden rounded-lg border border-border bg-card text-foreground transition-shadow hover:shadow-[0_1px_2px_rgb(24_23_22/.06),0_8px_24px_rgb(24_23_22/.08)]",children:[e.jsx("div",{className:"flex h-[150px] items-center justify-center border-b border-border bg-background",children:s.previewUrl?e.jsx("img",{src:s.previewUrl,alt:"",className:"size-full object-cover object-top"}):e.jsxs("div",{className:"flex flex-col items-center gap-1 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-muted",children:e.jsx(B,{className:"size-4"})}),"No screenshot yet"]})}),e.jsxs("div",{className:"px-3.5 pb-3.5 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[14px] font-semibold",children:[e.jsx("span",{className:"truncate",children:s.name}),s.status==="paused"&&e.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-px text-[10.5px] font-medium uppercase tracking-wide text-muted-foreground",children:"Paused"})]}),s.domain&&e.jsx("div",{className:"mt-0.5 truncate font-mono text-[12px] text-muted-foreground",children:s.domain}),e.jsx("div",{className:"mt-2 text-[12.5px] text-ink-soft",children:s.threads===0?"Nothing filed yet":`${s.unresolved} open of ${s.threads}${s.lastActivityAt?` · ${K(s.lastActivityAt)}`:""}`})]})]},s.uid))}),e.jsx(Q,{open:m,onOpenChange:r})]})}const G=$({name:p().trim().min(1,"A name"),domain:p().trim().min(1,"Its domain")});function Q({open:i,onOpenChange:a}){const m=y(),r=w(),[d,t]=x.useState(""),{register:n,handleSubmit:s,formState:o,reset:j}=k({resolver:_(G)}),b=s(async u=>{t("");try{const l=await A.createProject(u.name,"",u.domain);await r.invalidateQueries({queryKey:["me"]}),j(),a(!1),m({to:"/s/$site/comments",params:{site:l.uid}})}catch(l){t(l instanceof S?l.message:"Could not add the site.")}});return e.jsx(E,{open:i,onOpenChange:a,children:e.jsx(D,{children:e.jsxs("form",{onSubmit:b,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(F,{children:[e.jsx(I,{children:"Add a site"}),e.jsx(L,{children:"One client website. The tag it needs is shown right after."})]}),d&&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:d}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(h,{htmlFor:"site-name",children:"Name"}),e.jsx(g,{id:"site-name",placeholder:"Kilnwork","aria-invalid":!!o.errors.name,...n("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(h,{htmlFor:"site-domain",children:"Domain"}),e.jsx(g,{id:"site-domain",placeholder:"kilnwork.studio","aria-invalid":!!o.errors.domain,...n("domain")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build. Exact addresses elsewhere can be added in Settings."})]}),e.jsxs(P,{children:[e.jsx(c,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(c,{type:"submit",loading:o.isSubmitting,children:o.isSubmitting?"Adding…":"Add site"})]})]})})})}export{te as component};
@@ -1 +1 @@
1
- import{t as o,y as s,Z as u,p as i,_ as y,Y as c}from"./index-BCjjK9dr.js";function Q(){const e=o(),t=s.me().queryKey;return u({mutationFn:a=>i.renameOrg(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,org:{...r.org,name:a}}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>e.invalidateQueries({queryKey:t})})}function q(){const e=o(),t=s.me().queryKey;return u({mutationFn:a=>i.renameMe(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,user:{...r.user,name:a}}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>{e.invalidateQueries({queryKey:t}),e.invalidateQueries({queryKey:s.members().queryKey})}})}function f(){return u({mutationFn:e=>i.changePassword(e.current,e.next)})}function l(){const e=o();return u({mutationFn:t=>i.createInvite(t),onSuccess:()=>void e.invalidateQueries({queryKey:s.invites().queryKey})})}function w(){const e=o(),t=s.invites().queryKey;return u({mutationFn:a=>i.revokeInvite(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,data:r.data.filter(n=>n.id!==a)}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>e.invalidateQueries({queryKey:t})})}function v(){return u({mutationFn:e=>i.sendInvite(e.id,e.token)})}function K(){const e=o(),t=s.members().queryKey;return u({mutationFn:a=>i.setMemberRole(a.email,a.role),onMutate:async({email:a,role:r})=>{await e.cancelQueries({queryKey:t});const n=e.getQueryData(t);return n&&e.setQueryData(t,{data:n.data.map(m=>m.email===a?{...m,role:r}:m)}),{was:n}},onSuccess:(a,{email:r})=>{e.setQueryData(t,a),a.data.find(n=>n.email===r)?.you&&e.invalidateQueries({queryKey:s.me().queryKey})},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))}})}function D(){const e=o(),t=s.members().queryKey;return u({mutationFn:a=>i.removeMember(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{data:r.data.filter(n=>n.email!==a)}),{was:r}},onSuccess:a=>e.setQueryData(t,a),onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))}})}export{f as a,Q as b,K as c,D as d,w as e,l as f,v as g,q as u};
1
+ import{t as o,y as s,Z as u,p as i,_ as y,Y as c}from"./index-DMCyFEmS.js";function Q(){const e=o(),t=s.me().queryKey;return u({mutationFn:a=>i.renameOrg(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,org:{...r.org,name:a}}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>e.invalidateQueries({queryKey:t})})}function q(){const e=o(),t=s.me().queryKey;return u({mutationFn:a=>i.renameMe(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,user:{...r.user,name:a}}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>{e.invalidateQueries({queryKey:t}),e.invalidateQueries({queryKey:s.members().queryKey})}})}function f(){return u({mutationFn:e=>i.changePassword(e.current,e.next)})}function l(){const e=o();return u({mutationFn:t=>i.createInvite(t),onSuccess:()=>void e.invalidateQueries({queryKey:s.invites().queryKey})})}function w(){const e=o(),t=s.invites().queryKey;return u({mutationFn:a=>i.revokeInvite(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,data:r.data.filter(n=>n.id!==a)}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>e.invalidateQueries({queryKey:t})})}function v(){return u({mutationFn:e=>i.sendInvite(e.id,e.token)})}function K(){const e=o(),t=s.members().queryKey;return u({mutationFn:a=>i.setMemberRole(a.email,a.role),onMutate:async({email:a,role:r})=>{await e.cancelQueries({queryKey:t});const n=e.getQueryData(t);return n&&e.setQueryData(t,{data:n.data.map(m=>m.email===a?{...m,role:r}:m)}),{was:n}},onSuccess:(a,{email:r})=>{e.setQueryData(t,a),a.data.find(n=>n.email===r)?.you&&e.invalidateQueries({queryKey:s.me().queryKey})},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))}})}function D(){const e=o(),t=s.members().queryKey;return u({mutationFn:a=>i.removeMember(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{data:r.data.filter(n=>n.email!==a)}),{was:r}},onSuccess:a=>e.setQueryData(t,a),onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))}})}export{f as a,Q as b,K as c,D as d,w as e,l as f,v as g,q as u};
@@ -0,0 +1 @@
1
+ import{j as t,O as o}from"./index-DMCyFEmS.js";const n=()=>t.jsx(o,{});export{n as component};