@snagset/server 0.1.66 → 0.1.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/db/migrations/0020_attachments_shared_key.sql +37 -0
- package/dist/jobs/reaper.js +71 -21
- package/dist/jobs/reaper.js.map +1 -1
- package/dist/plan.js +1 -1
- package/dist/plan.js.map +1 -1
- package/dist/routes/attachments.js +88 -32
- package/dist/routes/attachments.js.map +1 -1
- package/dist/routes/reviewLinks.js +4 -1
- package/dist/routes/reviewLinks.js.map +1 -1
- package/dist/storage/shared.js +96 -0
- package/dist/storage/shared.js.map +1 -0
- package/package.json +1 -1
- package/static/dashboard/assets/{CompositeItem-DUU2dBBI.js → CompositeItem-DBlbEmrq.js} +1 -1
- package/static/dashboard/assets/{CompositeList-nzDbuttJ.js → CompositeList-BzeA8yRv.js} +1 -1
- package/static/dashboard/assets/{ConfirmDialog-CHFBH7e-.js → ConfirmDialog-InDeLqVY.js} +1 -1
- package/static/dashboard/assets/{CopyButton-U3SFd-HD.js → CopyButton-CuM8jLD2.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-Ctu8Sx36.js → FieldItemContext-UklvviEG.js} +1 -1
- package/static/dashboard/assets/{InstallTag-Dv3gaL4O.js → InstallTag-SFIkAvLJ.js} +1 -1
- package/static/dashboard/assets/{InstanceRows-DPIpELtc.js → InstanceRows-CdfJ5245.js} +1 -1
- package/static/dashboard/assets/{McpTokens-yimU884S.js → McpTokens-DvasPFMw.js} +1 -1
- package/static/dashboard/assets/{Picker-CCAp0603.js → Picker-B42iZVoy.js} +1 -1
- package/static/dashboard/assets/{SaveState-zj94ZTUn.js → SaveState-BRkBmXqs.js} +1 -1
- package/static/dashboard/assets/_-Cqe1ACLG.js +1 -0
- package/static/dashboard/assets/_app-BYZ11Msi.js +1 -0
- package/static/dashboard/assets/{_app-Boi8G11t.js → _app-D16rNb9V.js} +1 -1
- package/static/dashboard/assets/{_app-CPD7sbIv.js → _app-gdWCSHu8.js} +1 -1
- package/static/dashboard/assets/{activity-BXgHGBG-.js → activity-DJN1xKxv.js} +1 -1
- package/static/dashboard/assets/address-C-21UTZG.js +1 -0
- package/static/dashboard/assets/{arrow-left-BWxLUUtR.js → arrow-left-COavGffT.js} +1 -1
- package/static/dashboard/assets/{avatar-C272UWe3.js → avatar-D-xvBFxx.js} +1 -1
- package/static/dashboard/assets/{badge-CYPTl0cy.js → badge-iEJVsBYn.js} +1 -1
- package/static/dashboard/assets/{check-2F6z9BBy.js → check-BoeukqKC.js} +1 -1
- package/static/dashboard/assets/{chevron-down-Co3oKci1.js → chevron-down-BI3rT8EZ.js} +1 -1
- package/static/dashboard/assets/{chevron-right-DMXTfy_h.js → chevron-right-BA1nBLwE.js} +1 -1
- package/static/dashboard/assets/{copy-B-mCACcx.js → copy-DvA576Ce.js} +1 -1
- package/static/dashboard/assets/{createBaseUIEventDetails-67bayC1B.js → createBaseUIEventDetails-DxVYwN0n.js} +1 -1
- package/static/dashboard/assets/{dialog-l22OkYXh.js → dialog-DMLR5Ann.js} +1 -1
- package/static/dashboard/assets/{dropdown-menu-CIJhCtDQ.js → dropdown-menu-DJu3c_AK.js} +1 -1
- package/static/dashboard/assets/{forgot-ykPZ1Kdg.js → forgot-C7sjq6sz.js} +1 -1
- package/static/dashboard/assets/{getPseudoElementBounds-D9YqITSR.js → getPseudoElementBounds-DzoINCkV.js} +1 -1
- package/static/dashboard/assets/{image-off-BkVnePLU.js → image-off-rYr6mHjc.js} +1 -1
- package/static/dashboard/assets/{index-BC1mWQy8.js → index-C7KR1inc.js} +3 -3
- package/static/dashboard/assets/{inertValue-Dy4HJtbg.js → inertValue-CI-rS9np.js} +1 -1
- package/static/dashboard/assets/{invite-DDvCZ3v_.js → invite-B42fXoS_.js} +1 -1
- package/static/dashboard/assets/{label-Des6lF0o.js → label-Blp9UOAu.js} +1 -1
- package/static/dashboard/assets/{layout-grid-ojTM11RH.js → layout-grid-Cnury9dY.js} +1 -1
- package/static/dashboard/assets/me-BK0rftp3.js +1 -0
- package/static/dashboard/assets/{plus-CqHIH0K8.js → plus-DZmzLC79.js} +1 -1
- package/static/dashboard/assets/{reset-GkTsanrN.js → reset-bLKOzgnn.js} +1 -1
- package/static/dashboard/assets/{s._site-DuFqROtI.js → s._site-Djh35HSb.js} +1 -1
- package/static/dashboard/assets/{s._site.comments-DwPDdi_u.js → s._site.comments-DJI0OPtT.js} +11 -11
- package/static/dashboard/assets/s._site.reviewers-BU7pBSo5.js +1 -0
- package/static/dashboard/assets/{s._site.settings-0uXBXAn-.js → s._site.settings-DWrNkl_z.js} +1 -1
- package/static/dashboard/assets/{setup-CGKTYRhS.js → setup-CmW1XX0v.js} +1 -1
- package/static/dashboard/assets/{sign-in-BFx4q3Vl.js → sign-in-XOa4u4NO.js} +1 -1
- package/static/dashboard/assets/{sign-up-BeS3OqBr.js → sign-up-BL6Twjt_.js} +1 -1
- package/static/dashboard/assets/{sites-DWQtdLHK.js → sites-DZSK9rHh.js} +1 -1
- package/static/dashboard/assets/studio-C6Nmlwud.js +1 -0
- package/static/dashboard/assets/{studio-DxClsYRz.js → studio-DyTgShdj.js} +1 -1
- package/static/dashboard/assets/{studio.index-BKeRxtvS.js → studio.index-4BPM7HJY.js} +1 -1
- package/static/dashboard/assets/{studio.integrations-BDKRHU8R.js → studio.integrations-iKQV-OdC.js} +1 -1
- package/static/dashboard/assets/{studio.members-Dnw8MvSM.js → studio.members-DFQ7Ifit.js} +1 -1
- package/static/dashboard/assets/{studio.plan-CV9lR0OF.js → studio.plan-BqilzE9p.js} +1 -1
- package/static/dashboard/assets/{sun-BDbnQON-.js → sun-BuEfrAI0.js} +1 -1
- package/static/dashboard/assets/{switch-BQZZEckg.js → switch-L54Y3-uU.js} +1 -1
- package/static/dashboard/assets/{table-B41i9RfM.js → table-CMT1vo3l.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-hDZ_Qzgg.js → useAriaLabelledBy-B7r0Y4KR.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-Di_lHTAg.js → useBaseQuery-C-W7OQbv.js} +1 -1
- package/static/dashboard/assets/{useCompositeItem-R43gS2Zb.js → useCompositeItem-IXvKKl7V.js} +1 -1
- package/static/dashboard/assets/useQuery-Cgt__oKH.js +1 -0
- package/static/dashboard/assets/useRender-BH8zvQt8.js +1 -0
- package/static/dashboard/assets/{useScrollLock-DV1FkBvY.js → useScrollLock-BJQ8REVY.js} +1 -1
- package/static/dashboard/assets/{useValueChanged-CxAXjLUw.js → useValueChanged-Pz2Tfnzh.js} +1 -1
- package/static/dashboard/assets/{users-jxEArjZq.js → users-bHIFUIgt.js} +1 -1
- package/static/dashboard/assets/{welcome-D7cMtm0u.js → welcome-CdW8w4Iz.js} +1 -1
- package/static/dashboard/assets/{widget-signin-BtBII7zp.js → widget-signin-ne9Avuvc.js} +1 -1
- package/static/dashboard/assets/{you-DcgRgPxz.js → you-a05RPClq.js} +1 -1
- package/static/dashboard/assets/{zod-DxcG0x06.js → zod-BZsHesp0.js} +1 -1
- package/static/dashboard/index.html +1 -1
- package/static/widget/build.json +2 -2
- package/static/widget/snag.js +1 -1
- package/static/widget/snag.runtime.js +1 -1
- package/static/dashboard/assets/_-C2HgkYw_.js +0 -1
- package/static/dashboard/assets/_app-Cy8QntP-.js +0 -1
- package/static/dashboard/assets/me-DWKKjc2l.js +0 -1
- package/static/dashboard/assets/s._site.reviewers-BdujL59q.js +0 -1
- package/static/dashboard/assets/studio-gXJp7MI3.js +0 -1
- package/static/dashboard/assets/useQuery-B1QbR4lk.js +0 -1
- package/static/dashboard/assets/useRender-bF5mRtl9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b0 as T,r as p,aT as I,av as P,f as M,n as E,e as b,aS as S,bm as R}from"./index-
|
|
1
|
+
import{b0 as T,r as p,aT as I,av as P,f as M,n as E,e as b,aS as S,bm as R}from"./index-C7KR1inc.js";function G(t,s){return s<0||s>=t.length}function X(t,s){return L(t.current,{disabledIndices:s})}function j(t,s){return L(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:s})}function L(t,{startingIndex:s=-1,decrement:n=!1,disabledIndices:r,amount:e=1}={}){let i=s;do i+=n?-e:e;while(i>=0&&i<=t.length-1&&m(t,i,r));return i}function m(t,s,n){if(typeof n=="function"?n(s):n?.includes(s)??!1)return!0;const e=t[s];return e?!y(e)||e.matches(":disabled")?!0:!n&&(e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"):!1}function O(t){return t.visibility==="hidden"||t.visibility==="collapse"}function y(t,s=t?T(t):null){return!t||!t.isConnected||!s||O(s)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():s.display!=="none"&&s.display!=="contents"}function k(t){p.useEffect(t,I)}const d=null;class F{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=s=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let e=0;e<n.length;e+=1)n[e]?.(s)};request(s){const n=this.nextId;return this.nextId+=1,this.callbacks.push(s),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(s){const n=s-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let g=new F;class f{static create(){return new f}static request(s){return g.request(s)}static cancel(s){return g.cancel(s)}currentId=d;request(s){this.cancel(),this.currentId=g.request(()=>{this.currentId=d,s()})}cancel=()=>{this.currentId!==d&&(g.cancel(this.currentId),this.currentId=d)};disposeEffect=()=>this.cancel}function W(){const t=P(f.create).current;return k(t.disposeEffect),t}function w(t){return t==null?t:"current"in t?t.current:t}function x(t,s=!1){const n=W();return M((r,e=null)=>{n.cancel();const i=w(t);if(i==null)return;const l=i,u=()=>{E.flushSync(r)};if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function o(){Promise.all(l.getAnimations().map(a=>a.finished)).then(()=>{e?.aborted||u()},()=>{if(e?.aborted)return;if(l.getAnimations().some(c=>c.pending||c.playState!=="finished")){o();return}u()})}if(s){const a="data-starting-style";if(!l.hasAttribute(a)){n.request(o);return}const c=new MutationObserver(()=>{l.hasAttribute(a)||(c.disconnect(),o())});c.observe(l,{attributes:!0,attributeFilter:[a]}),e?.addEventListener("abort",()=>c.disconnect(),{once:!0});return}n.request(o)})}function z(t){const{enabled:s=!0,open:n,ref:r,onComplete:e}=t,i=M(e),l=x(r,n);p.useEffect(()=>{if(!s)return;const u=new AbortController;return l(i,u.signal),()=>{u.abort()}},[s,n,i,l])}let C=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const H={"data-starting-style":""},N={"data-ending-style":""},$={transitionStatus(t){return t==="starting"?H:t==="ending"?N:null}};function J(t,s=!1,n=!1){const[r,e]=p.useState(t&&s?"idle":void 0),[i,l]=p.useState(t);return t&&!i&&(l(!0),e("starting")),!t&&i&&r!=="ending"&&!n&&e("ending"),!t&&!i&&r==="ending"&&e(void 0),b(()=>{if(!t&&i&&r!=="ending"&&n){const u=f.request(()=>{e("ending")});return()=>{f.cancel(u)}}},[t,i,r,n]),b(()=>{if(!t||s)return;const u=f.request(()=>{e(void 0)});return()=>{f.cancel(u)}},[s,t]),b(()=>{if(!t||!s)return;t&&i&&r!=="idle"&&e("starting");const u=f.request(()=>{e("idle")});return()=>{f.cancel(u)}},[s,t,i,r]),{mounted:i,setMounted:l,transitionStatus:r}}const v="ArrowUp",B="ArrowDown",q="ArrowLeft",D="ArrowRight",_="Home",Y="End",Q=new Set([v,B,q,D,_,Y]),V="Shift",Z=[V,"Control","Alt","Meta"];function K(t){return S(t)&&t.tagName==="INPUT"}function tt(t){return!!(K(t)&&t.selectionStart!=null||S(t)&&t.tagName==="TEXTAREA")}function st(t,s,n,r){if(!t||!s||!s.scrollTo)return;let e=t.scrollLeft,i=t.scrollTop;const l=t.clientWidth<t.scrollWidth,u=t.clientHeight<t.scrollHeight;if(l&&r!=="vertical"){const o=A(t,s,"left"),a=h(t),c=h(s);n==="ltr"&&(o+s.offsetWidth+c.scrollMarginRight>t.scrollLeft+t.clientWidth-a.scrollPaddingRight?e=o+s.offsetWidth+c.scrollMarginRight-t.clientWidth+a.scrollPaddingRight:o-c.scrollMarginLeft<t.scrollLeft+a.scrollPaddingLeft&&(e=o-c.scrollMarginLeft-a.scrollPaddingLeft)),n==="rtl"&&(o-c.scrollMarginLeft<t.scrollLeft+a.scrollPaddingLeft?e=o-c.scrollMarginLeft-a.scrollPaddingLeft:o+s.offsetWidth+c.scrollMarginRight>t.scrollLeft+t.clientWidth-a.scrollPaddingRight&&(e=o+s.offsetWidth+c.scrollMarginRight-t.clientWidth+a.scrollPaddingRight))}if(u&&r!=="horizontal"){const o=A(t,s,"top"),a=h(t),c=h(s);o-c.scrollMarginTop<t.scrollTop+a.scrollPaddingTop?i=o-c.scrollMarginTop-a.scrollPaddingTop:o+s.offsetHeight+c.scrollMarginBottom>t.scrollTop+t.clientHeight-a.scrollPaddingBottom&&(i=o+s.offsetHeight+c.scrollMarginBottom-t.clientHeight+a.scrollPaddingBottom)}t.scrollTo({left:e,top:i,behavior:"auto"})}function A(t,s,n){const r=n==="left"?"offsetLeft":"offsetTop";let e=0;for(;s.offsetParent&&(e+=s[r],s.offsetParent!==t);)s=s.offsetParent;return e}function h(t){const s=getComputedStyle(t);return{scrollMarginTop:parseFloat(s.scrollMarginTop)||0,scrollMarginRight:parseFloat(s.scrollMarginRight)||0,scrollMarginBottom:parseFloat(s.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(s.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(s.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(s.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(s.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(s.scrollPaddingLeft)||0}}function et(t){return R(19)?t:t?"true":void 0}export{B as A,Q as C,Y as E,_ as H,Z as M,V as S,C as T,J as a,k as b,x as c,W as d,G as e,j as f,X as g,L as h,et as i,y as j,m as k,tt as l,v as m,q as n,D as o,f as p,w as r,st as s,$ as t,z as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as A,r as u,j as e,K as J,G as b,L as B,p as v,P as y,B as N,v as S,D as k,Q as C,H as f,I,J as g}from"./index-
|
|
1
|
+
import{R as A,r as u,j as e,K as J,G as b,L as B,p as v,P as y,B as N,v as S,D as k,Q as C,H as f,I,J as g}from"./index-C7KR1inc.js";import{u as L,a as E}from"./zod-BZsHesp0.js";import{L as j,I as w}from"./label-Blp9UOAu.js";import"./createBaseUIEventDetails-DxVYwN0n.js";function G(){const s=A.useLoaderData(),[t,o]=u.useState(!1);return s.ok?!!s.me&&(!s.invite.email||s.invite.email.toLowerCase()===s.me.toLowerCase())&&!t?e.jsx(F,{token:s.token,invite:s.invite,me:s.me,onOther:()=>o(!0)}):e.jsx(R,{token:s.token,invite:s.invite}):e.jsx(Y,{code:s.code,message:s.message})}function F({token:s,invite:t,me:o,onOther:i}){const d=v(),[r,x]=u.useState(""),[n,p]=u.useState(!1),a=t.org.name||"a studio",c=async()=>{x(""),p(!0);try{await S.acceptInvite({token:s,email:o}),k("in"),C.clear(),d({to:"/sites",replace:!0})}catch(l){if(l instanceof f&&l.code==="account_exists")return i();x(l instanceof f?l.message:"Could not reach the server. Try again."),p(!1)}};return e.jsx(b,{width:400,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:["Join ",a]}),e.jsxs("p",{className:"m-0 mt-1.5 text-muted-foreground",children:[t.invitedBy?`${t.invitedBy} invited you`:"You were invited"," to join ",a," as ",y(t.role),". You are signed in as"," ",e.jsx("span",{className:"break-all text-foreground",children:o}),"."]})]}),r&&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:r}),e.jsx(N,{type:"button",size:"lg",loading:n,onClick:c,children:n?"Joining…":`Join ${a}`}),!t.email&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx("button",{type:"button",onClick:i,className:"cursor-pointer border-0 bg-transparent p-0 text-foreground underline underline-offset-4",children:"Join with another address"})})]})})}function Y({code:s,message:t}){const{title:o,signIn:i}=J(s);return e.jsx(b,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:o}),e.jsx("p",{role:"alert",className:"m-0 text-muted-foreground",children:t}),i&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx(B,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Sign in"})})]})})}const P=I({name:g().trim().max(120).optional(),email:g().trim().email("An email address"),password:g().min(1,"A password")});function R({token:s,invite:t}){const o=v(),[i,d]=u.useState(""),[r,x]=u.useState(!1),{register:n,handleSubmit:p,formState:a}=L({resolver:E(P),defaultValues:{email:t.email??"",name:""}}),c=t.org.name||"a studio",l=p(async m=>{if(d(""),!r&&m.password.length<12){d("The password must be at least 12 characters. A short phrase of real words is fine.");return}try{await S.acceptInvite({token:s,password:m.password,...m.name?{name:m.name}:{},...t.email?{}:{email:m.email}}),k("in"),C.clear(),o({to:"/sites",replace:!0})}catch(h){h instanceof f&&h.code==="account_exists"&&x(!0),d(h instanceof f?h.message:"Could not reach the server. Try again.")}});return e.jsx(b,{width:400,children:e.jsxs("form",{onSubmit:l,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:[t.invitedBy?`${t.invitedBy} invited you`:"You were invited"," to join ",c," as ",y(t.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:a.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(j,{htmlFor:"email",children:"Email"}),e.jsx(w,{id:"email",type:"email",autoComplete:"username",readOnly:!!t.email,"aria-invalid":!!a.errors.email,...n("email")}),a.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:a.errors.email.message})]}),!r&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(j,{htmlFor:"name",children:["Your name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(w,{id:"name",autoComplete:"name",...n("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{htmlFor:"password",children:r?"Your password":"Choose a password"}),e.jsx(w,{id:"password",type:"password",autoComplete:r?"current-password":"new-password","aria-invalid":!!a.errors.password,...n("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(N,{type:"submit",size:"lg",loading:a.isSubmitting,children:a.isSubmitting?"Joining…":`Join ${c}`})]})]})})}export{G as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f,e as y,f as S,k as U,j as p,h}from"./index-
|
|
1
|
+
import{r as f,e as y,f as S,k as U,j as p,h}from"./index-C7KR1inc.js";import{h as K,e as $,j as q,A as z,m as G,o as H,k as J,l as O,c as Q,n as W,f as X}from"./createBaseUIEventDetails-DxVYwN0n.js";const Y=f.forwardRef(function(a,i){const{render:_,className:ee,id:E,name:b,value:n,disabled:F=!1,onValueChange:w,defaultValue:m,autoFocus:u=!1,style:te,...I}=a,{state:k,name:V,disabled:P,setTouched:g,setDirty:j,validityData:D,setFocused:l,setFilled:s,validationMode:N,validation:t}=K(),{clearErrors:T}=$(),o=P||F,v=V??b,L={...k,disabled:o},{labelId:M}=q(),x=z({id:E});y(()=>{const e=n!=null;t.inputRef.current?.value||e&&n!==""?s(!0):e&&n===""&&s(!1)},[t.inputRef,s,n]);const c=f.useRef(null);y(()=>{u&&c.current===G(H(c.current))&&l(!0)},[u,l]);const[A]=J({controlled:n,default:m,name:"FieldControl",state:"value"}),C=n!==void 0,R=C?A:void 0,B=S(()=>t.inputRef.current?.value);return O(t.inputRef,x,R,B,!o,b),U("input",a,{ref:[i,c],state:L,props:[{id:x,disabled:o,name:v,ref:t.inputRef,"aria-labelledby":M,autoFocus:u,...C?{value:R}:{defaultValue:m},onChange(e){const d=e.currentTarget.value;w?.(d,Q(W,e.nativeEvent)),j(d!==(D.initialValue??"")),s(d!==""),e.nativeEvent.defaultPrevented||(T(v),t.change(d))},onFocus(){l(!0)},onBlur(e){g(!0),l(!1),N==="onBlur"&&t.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName==="INPUT"&&e.key==="Enter"&&(g(!0),t.commit(e.currentTarget.value))}},I,e=>t.getValidationProps(o,e)],stateAttributesMapping:X})}),Z=f.forwardRef(function(a,i){return p.jsx(Y,{ref:i,...a})});function ie({className:r,type:a,...i}){return p.jsx(Z,{type:a,"data-slot":"input",className:h("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",r),...i})}function le({className:r,...a}){return p.jsx("label",{"data-slot":"label",className:h("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",r),...a})}export{ie as I,le as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as r,Q as u,d as s}from"./useBaseQuery-C-W7OQbv.js";import{F as t}from"./index-C7KR1inc.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{u as c,a as g,b as j,T as b,r as m,j as e,U as w,p as v,v as N,D as S,Q as y,H as L,G as u,B as E,V as k,L as A,W as C,I as R,J as F}from"./index-
|
|
1
|
+
import{u as c,a as g,b as j,T as b,r as m,j as e,U as w,p as v,v as N,D as S,Q as y,H as L,G as u,B as E,V as k,L as A,W as C,I as R,J as F}from"./index-C7KR1inc.js";import{u as B,a as I}from"./zod-BZsHesp0.js";import{L as l,I as d}from"./label-Blp9UOAu.js";import"./createBaseUIEventDetails-DxVYwN0n.js";function P(s){const t=c();return g(t.stores.location,j(s,t))}function J(){const s=b.useLoaderData(),t=c(),a=P({select:r=>w(r.hash)});return m.useEffect(()=>{a!==s.hash&&t.invalidate()},[a,s.hash,t]),s.ok?e.jsx(G,{token:s.token,email:s.email}):e.jsx(T,{code:s.code,message:s.message})}function T({code:s,message:t}){const{title:a,next:r}=k(s);return e.jsx(u,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:a}),e.jsx("p",{role:"alert",className:"m-0 text-muted-foreground",children:t}),e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx(A,{to:r==="sign-in"?"/sign-in":"/forgot",className:"text-foreground underline underline-offset-4",children:C[r]})})]})})}const D=R({password:F().min(12,"At least 12 characters")});function G({token:s,email:t}){const a=v(),[r,i]=m.useState(""),{register:x,handleSubmit:p,formState:o}=B({resolver:I(D)}),h=p(async({password:f})=>{i("");try{await N.confirmReset(s,f),S("in"),y.clear(),a({to:"/sites",replace:!0})}catch(n){i(n instanceof L?n.message:"Could not reach the server. Try again.")}});return e.jsx(u,{children:e.jsxs("form",{onSubmit:h,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:"Choose a new password"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"Setting it signs you in here, and signs you out everywhere the old one was used."})]}),r&&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:r}),e.jsxs("fieldset",{disabled:o.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(l,{htmlFor:"email",children:"Email"}),e.jsx(d,{id:"email",type:"email",autoComplete:"username",readOnly:!0,value:t})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(l,{htmlFor:"password",children:"New password"}),e.jsx(d,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!o.errors.password,...x("password")}),o.errors.password?e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:o.errors.password.message}):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(E,{type:"submit",size:"lg",loading:o.isSubmitting,children:o.isSubmitting?"Setting…":"Set the password and sign in"})]})]})})}export{J as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ae as r,j as e,L as a,O as o}from"./index-
|
|
1
|
+
import{ae as r,j as e,L as a,O as o}from"./index-C7KR1inc.js";import{u as d}from"./me-BK0rftp3.js";import"./useBaseQuery-C-W7OQbv.js";function u(){const{site:t}=r.useParams(),s=d().projects.find(n=>n.uid===t),i=s?.archived?"This site is archived. Its comments can be read; nothing new comes in and nothing can be changed.":s?.locked?"This site is read-only: the studio has more sites than its plan includes. Archive a site, or move to a plan with more.":null;return e.jsxs(e.Fragment,{children:[i&&e.jsxs("div",{role:"status",className:"mx-7 mt-5 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border bg-warn-soft px-4 py-2.5 text-[13px]",children:[e.jsx("span",{className:"flex-1",children:i}),e.jsx(a,{to:"/s/$site/settings",params:{site:t},className:"font-medium text-foreground underline underline-offset-2",children:s?.archived?"Restore it":"Site settings"})]}),e.jsx(o,{})]})}export{u as component};
|
package/static/dashboard/assets/{s._site.comments-DwPDdi_u.js → s._site.comments-DJI0OPtT.js}
RENAMED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import{c as re,r as x,i as
|
|
1
|
+
import{c as re,r as x,i as Ps,av as Bs,aw as _s,e as Qe,ax as Xe,ay as Fs,m as Ls,E as Os,k as is,j as e,az as Vs,g as qs,h as A,B as $,aA as ls,S as fe,s as Us,aB as Ks,ak as Ze,aC as Ye,aq as Ke,a7 as Be,a6 as ds,a9 as Ie,A as Me,ai as cs,H as Hs,aD as es,p as Ws,aE as Gs,aF as ss,aG as Js,aH as Qs,aI as Xs,aJ as Zs,aK as Ys,aL as et,aM as st,aN as tt,aO as nt,aP as at,q as ze,ab as qe,aQ as Ne,L as us,I as rt,ar as ts,J as pe,aR as ot,F as Te}from"./index-C7KR1inc.js";import{u as we}from"./useQuery-Cgt__oKH.js";import{C as ms}from"./check-BoeukqKC.js";import{f as it,e as lt,h as dt,j as ct,u as ns,k as ut,l as mt,c as ht,n as xt}from"./createBaseUIEventDetails-DxVYwN0n.js";import{v as pt,r as ft}from"./useScrollLock-BJQ8REVY.js";import{u as gt}from"./FieldItemContext-UklvviEG.js";import{u as bt}from"./useAriaLabelledBy-B7r0Y4KR.js";import{u as jt}from"./useValueChanged-Pz2Tfnzh.js";import{a as vt,u as yt,t as kt}from"./inertValue-CI-rS9np.js";import{D as te,e as ne,f as ae,h as he,i as $e,j as H,k as hs,E as as,l as Ee,m as J,S as Nt}from"./dropdown-menu-DJu3c_AK.js";import{L as He,I as Pe}from"./label-Blp9UOAu.js";import{A as ge,a as be}from"./avatar-D-xvBFxx.js";import{i as xs,j as ps,l as fs,k as gs,m as bs,n as js,X as wt}from"./dialog-DMLR5Ann.js";import{C as vs}from"./ConfirmDialog-InDeLqVY.js";import{C as Ce}from"./chevron-down-BI3rT8EZ.js";import{C as Ct}from"./copy-DvA576Ce.js";import{I as St}from"./image-off-rYr6mHjc.js";import{C as $t}from"./chevron-right-BA1nBLwE.js";import{I as Mt}from"./InstallTag-SFIkAvLJ.js";import{s as rs}from"./address-C-21UTZG.js";import{u as At}from"./me-BK0rftp3.js";import{A as Dt}from"./arrow-left-COavGffT.js";import"./useBaseQuery-C-W7OQbv.js";import"./CompositeList-BzeA8yRv.js";import"./getPseudoElementBounds-DzoINCkV.js";import"./CompositeItem-DBlbEmrq.js";import"./useCompositeItem-IXvKKl7V.js";import"./isElementDisabled-CwHw_lZC.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const Rt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],zt=re("columns-2",Rt);/**
|
|
7
7
|
* @license lucide-react v1.39.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const
|
|
11
|
+
*/const Tt=[["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"}]],It=re("ellipsis",Tt);/**
|
|
12
12
|
* @license lucide-react v1.39.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
16
|
+
*/const Et=[["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"}]],Pt=re("inbox",Et);/**
|
|
17
17
|
* @license lucide-react v1.39.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const Bt=[["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"}]],_t=re("list",Bt);/**
|
|
22
22
|
* @license lucide-react v1.39.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
26
|
+
*/const Ft=[["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"}]],Lt=re("pencil",Ft);/**
|
|
27
27
|
* @license lucide-react v1.39.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
31
|
+
*/const Ot=[["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"}]],Vt=re("rotate-cw",Ot);/**
|
|
32
32
|
* @license lucide-react v1.39.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const
|
|
36
|
+
*/const qt=[["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"}]],ys=re("trash-2",qt);/**
|
|
37
37
|
* @license lucide-react v1.39.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const
|
|
41
|
+
*/const Ut=[["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"}]],Kt=re("user-plus",Ut);/**
|
|
42
42
|
* @license lucide-react v1.39.0 - ISC
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const Kt=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Ht=re("user-round",Kt);function Wt(s){if(!s)return null;for(const n of s.elements){const r=n.tagName;if(r==="BUTTON"||r==="INPUT"){const o=n;if(o.type==="submit")return o}}return null}function ys(s){return{checked(n){return s.indeterminate?{}:n?{"data-checked":""}:{"data-unchecked":""}},...ot}}const Gt=x.createContext(void 0);function Jt(){return x.useContext(Gt)}const ks=x.createContext(void 0);function Qt(){const s=x.useContext(ks);if(s===void 0)throw new Error(Es(14));return s}const Xt="data-parent",Zt=x.forwardRef(function(n,r){const{checked:o,className:p,defaultChecked:l=!1,"aria-labelledby":c,disabled:y=!1,form:m,id:h,indeterminate:g=!1,inputRef:f,name:u,onCheckedChange:N,parent:a=!1,readOnly:w=!1,render:P,required:k=!1,uncheckedValue:b,value:z,nativeButton:T=!1,style:V,...M}=n,{clearErrors:v}=it(),{disabled:D,name:Q,setDirty:q,setFilled:U,setFocused:C,setTouched:I,state:L,validationMode:je,validityData:oe,validation:F}=lt(),ve=ft(),{labelId:d,controlId:O,registerControlId:R,getDescriptionProps:Ae}=dt(),E=Jt(),W=E?.allValues===void 0?void 0:E.parent,ie=W!==void 0,B=D||ve.disabled||E?.disabled||y,X=Q??u,_=z??X,De=ns(),Z=ns();let G=h||O;ie&&(a?G=Z:_!==void 0?G=`${W.id}-${_}`:G||=Z);let t={};ie&&(a?t=W.getParentProps():_!==void 0&&(t=W.getChildProps(_)));const{checked:i=o,indeterminate:S=g,onCheckedChange:Y,...le}=t,ee=E?.value,de=x.useRef(null),xe=Ps(()=>Symbol()),_e=x.useRef(!1),{getButtonProps:Ss,buttonRef:$s}=Bs({disabled:B,native:T}),ye=E?.validation??F,[K,Ms]=ct({controlled:_!==void 0&&ee!==void 0&&!a?ee.includes(_):i,default:l,name:"Checkbox",state:"checked"}),Fe=ie?!!i:K,ke=ie&&S||g;Qe(()=>{R!==Xe&&(_e.current=!0,R(xe.current,G))},[G,R,xe]),x.useEffect(()=>{const j=xe.current;return()=>{!_e.current||R===Xe||(_e.current=!1,R(j,void 0))}},[R,xe]),ut(de,De,K,void 0,!E&&!B,u);const ce=x.useRef(null),Ge=ye.registerInput,Je=E?_:void 0,As=x.useCallback(j=>Ge(j,{controlRef:de,value:Je}),[Ge,Je]),Ds=_s(f,ce,a?void 0:As),Rs=gt(c,d,ce,!T,G??void 0);Qe(()=>{ce.current&&(ce.current.indeterminate=ke,K&&U(!0))},[K,ke,U]),bt(K,()=>{E||(v(X),U(K),q(K!==oe.initialValue),ye.change(K))});const zs=Fs({checked:K,disabled:B,form:m,name:a?void 0:X,id:T?void 0:G??void 0,required:k,ref:Ds,style:X?xt:pt,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(j){if(j.nativeEvent.defaultPrevented)return;if(w){j.preventDefault();return}const se=j.currentTarget.checked,ue=mt(ht,j.nativeEvent);if(N?.(se,ue),!ue.isCanceled&&(Y?.(se,ue),!ue.isCanceled&&(Ms(se),_!==void 0&&E!==void 0&&!a&&!ie))){const me=se?[...E.value,_]:E.value.filter(Re=>Re!==_);E.setValue(me,ue)}},onClick(j){j.stopPropagation()},onFocus(){de.current?.focus()}},z!==void 0?{value:(E?K&&z:z)||""}:Ls,Ae,j=>ye.getValidationProps(B,j));x.useEffect(()=>{if(!W||_===void 0)return;const j=W.disabledStatesRef.current;return j.set(_,B),()=>{j.delete(_)}},[W,B,_]);const Le=x.useMemo(()=>({...L,checked:Fe,disabled:B,readOnly:w,required:k,indeterminate:ke}),[L,Fe,B,w,k,ke]),Ts=ys(Le),Is=os("span",n,{state:Le,ref:[$s,de,r],props:[{id:T?G??void 0:De,role:"checkbox","aria-checked":ke?"mixed":Fe,"aria-readonly":w||void 0,"aria-required":k||void 0,"aria-labelledby":Rs,[Xt]:a?"":void 0,onFocus(){B||C(!0)},onBlur(){const j=ce.current;j&&(I(!0),C(!1),je==="onBlur"&&ye.commit(E?ee:j.checked))},onKeyDown(j){if(j.key!=="Enter"||(j.preventBaseUIHandler(),j.defaultPrevented))return;const se=ce.current?.form??null,ue=j.currentTarget,me=j.nativeEvent,Re=j.preventDefault,Oe=me.preventDefault;let Ve=!1;j.preventDefault=()=>{Ve=!0,Re.call(j)},me.preventDefault=()=>{Ve=!0,Oe.call(me)},Oe.call(me),Vs(ue).queueMicrotask(()=>{j.preventDefault=Re,me.preventDefault=Oe,Ve||Wt(se)?.click()})},onClick(j){if(w||B)return;j.preventDefault();const se=ce.current;se&&Os(se,j)}},M,le,Ss,Ae,j=>ye.getValidationProps(B,j)],stateAttributesMapping:Ts});return e.jsxs(ks.Provider,{value:Le,children:[Is,!K&&!E&&X&&!a&&b!==void 0&&e.jsx("input",{type:"hidden",form:m,name:X,value:b,disabled:B}),e.jsx("input",{...zs,suppressHydrationWarning:!0})]})}),Yt=x.forwardRef(function(n,r){const{render:o,className:p,style:l,keepMounted:c=!1,...y}=n,m=Qt(),h=m.checked||m.indeterminate,{mounted:g,transitionStatus:f,setMounted:u}=jt(h),N=x.useRef(null),a={...m,transitionStatus:f};vt({open:h,ref:N,onComplete(){h||u(!1)}});const P={...ys(m),...yt},k=c||g,b=os("span",n,{ref:[r,N],state:a,stateAttributesMapping:P,props:y});return k?b:null});function en({className:s,...n}){return e.jsx(Zt,{"data-slot":"checkbox",className:A("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),...n,children:e.jsx(Yt,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:e.jsx(us,{})})})}function Ns({className:s,...n}){return e.jsx("textarea",{"data-slot":"textarea",className:A("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),...n})}function sn({rounds:s,active:n,onPick:r,onStart:o,starting:p}){const l=s.find(f=>f.number===n),c=(s[0]?.number??0)+1,[y,m]=x.useState(!1),[h,g]=x.useState("");return e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsxs(ne,{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(Ot,{className:"size-3.5"}),l?.name??`Round ${n}`,e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsxs(ae,{align:"start",className:"w-[260px]",children:[e.jsxs(he,{children:[e.jsx($e,{children:"Rounds"}),s.map(f=>e.jsxs(H,{onClick:()=>r(f.number),children:[e.jsx("span",{className:"truncate",children:f.name}),e.jsxs("span",{className:"ml-auto text-[11.5px] text-muted-foreground",children:[f.closed?"closed":"open",f.unresolved>0?` · ${f.unresolved} to go`:""]})]},f.id))]}),e.jsx(ms,{}),e.jsx(H,{onClick:()=>{g(`Round ${c}`),m(!0)},children:"Start a new round…"})]})]}),l&&e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[l.closed?"closed":"open",l.unresolved>0?` · ${l.unresolved} to go`:l.closed?"":" · all clear"]}),e.jsx(hs,{open:y,onOpenChange:m,children:e.jsx(xs,{children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),!(!h.trim()||p)&&(o(h.trim()),m(!1))},children:[e.jsxs(ps,{children:[e.jsx(fs,{children:"Start a new round"}),e.jsx(gs,{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(He,{htmlFor:"round-name",children:"Name"}),e.jsx(Pe,{id:"round-name",value:h,onChange:f=>g(f.target.value),autoFocus:!0})]}),e.jsxs(bs,{children:[e.jsx($,{type:"button",variant:"outline",onClick:()=>m(!1),children:"Cancel"}),e.jsx($,{type:"submit",disabled:!h.trim()||p,children:p?"Starting…":"Start the round"})]})]})})})]})}function ws({rounds:s,onMove:n,busy:r}){return s.length===0?null:e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx($,{variant:"outline",size:"sm",disabled:r}),children:"Move to round…"}),e.jsx(ae,{align:"start",className:"w-[240px]",children:e.jsxs(he,{children:[e.jsx($e,{children:"Move to round"}),s.map(o=>e.jsxs(H,{onClick:()=>n(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 tn={open:"Open",progress:"In progress",review:"In review",resolved:"Resolved"};function nn(s,n,r={}){const o=r.fence??((v,D)=>D),p=r.statusLabel??(v=>tn[v]??v),l=s.anchor??{},c=s.context??{},y=l.page,m=y?.route??s.route??"/",h=y?.origin??n.origin??"",g=y?.pathname??m,f=h?`${h}${g}`:g,u=typeof l.label=="string"?o("label",l.label):"",N=l.element??l,a=[];a.push(`# ${s.key}${u?` — ${u}`:""}`),a.push(""),a.push(`${n.name} · ${p(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: ${f}`),h&&a.push(`- Open on the page: ${h}${g}?${is("t")}=${encodeURIComponent(s.key)}`),u&&a.push(`- Element: ${u}`);const w=typeof l.css=="string"?l.css:typeof N.selector=="string"?N.selector:"";if(w&&a.push(`- Selector: \`${o("selector",w)}\``),typeof l.domid=="string"&&a.push(`- DOM id: \`#${o("selector",l.domid)}\``),typeof N.role=="string"){const v=typeof N.accessibleName=="string"?` “${o("label",N.accessibleName)}”`:"";a.push(`- Role: ${o("label",N.role)}${v}`)}typeof N.testId=="string"&&a.push(`- Test id: ${o("label",N.testId)}`);const P=l.text;P?.exact&&a.push(`- Text: “${o("label",P.exact)}”`),a.push(`- Anchor: ${s.anchorState??"unknown"}`),a.push(""),a.push("## What's wrong"),a.push("");const k=(s.comments??[]).filter(v=>v.body!==null);k.length===0&&a.push("> (no comment — a pin with no words)");for(const v of k){const D=v.author?.name?o("name",v.author.name):"Anonymous";a.push(`> **${D}${v.author?.kind==="agent"?" (agent)":""}** — ${v.createdAt.slice(0,16).replace("T"," ")}`);for(const Q of o("body",String(v.body)).split(`
|
|
46
|
+
*/const Ht=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Wt=re("user-round",Ht);function Gt(s){if(!s)return null;for(const n of s.elements){const r=n.tagName;if(r==="BUTTON"||r==="INPUT"){const o=n;if(o.type==="submit")return o}}return null}function ks(s){return{checked(n){return s.indeterminate?{}:n?{"data-checked":""}:{"data-unchecked":""}},...it}}const Jt=x.createContext(void 0);function Qt(){return x.useContext(Jt)}const Ns=x.createContext(void 0);function Xt(){const s=x.useContext(Ns);if(s===void 0)throw new Error(Ps(14));return s}const Zt="data-parent",Yt=x.forwardRef(function(n,r){const{checked:o,className:p,defaultChecked:l=!1,"aria-labelledby":c,disabled:y=!1,form:m,id:h,indeterminate:g=!1,inputRef:f,name:u,onCheckedChange:N,parent:a=!1,readOnly:w=!1,render:P,required:k=!1,uncheckedValue:b,value:z,nativeButton:T=!1,style:V,...M}=n,{clearErrors:v}=lt(),{disabled:D,name:Q,setDirty:q,setFilled:U,setFocused:C,setTouched:I,state:L,validationMode:je,validityData:oe,validation:F}=dt(),ve=gt(),{labelId:d,controlId:O,registerControlId:R,getDescriptionProps:Ae}=ct(),E=Qt(),W=E?.allValues===void 0?void 0:E.parent,ie=W!==void 0,B=D||ve.disabled||E?.disabled||y,X=Q??u,_=z??X,De=ns(),Z=ns();let G=h||O;ie&&(a?G=Z:_!==void 0?G=`${W.id}-${_}`:G||=Z);let t={};ie&&(a?t=W.getParentProps():_!==void 0&&(t=W.getChildProps(_)));const{checked:i=o,indeterminate:S=g,onCheckedChange:Y,...le}=t,ee=E?.value,de=x.useRef(null),xe=Bs(()=>Symbol()),_e=x.useRef(!1),{getButtonProps:$s,buttonRef:Ms}=_s({disabled:B,native:T}),ye=E?.validation??F,[K,As]=ut({controlled:_!==void 0&&ee!==void 0&&!a?ee.includes(_):i,default:l,name:"Checkbox",state:"checked"}),Fe=ie?!!i:K,ke=ie&&S||g;Qe(()=>{R!==Xe&&(_e.current=!0,R(xe.current,G))},[G,R,xe]),x.useEffect(()=>{const j=xe.current;return()=>{!_e.current||R===Xe||(_e.current=!1,R(j,void 0))}},[R,xe]),mt(de,De,K,void 0,!E&&!B,u);const ce=x.useRef(null),Ge=ye.registerInput,Je=E?_:void 0,Ds=x.useCallback(j=>Ge(j,{controlRef:de,value:Je}),[Ge,Je]),Rs=Fs(f,ce,a?void 0:Ds),zs=bt(c,d,ce,!T,G??void 0);Qe(()=>{ce.current&&(ce.current.indeterminate=ke,K&&U(!0))},[K,ke,U]),jt(K,()=>{E||(v(X),U(K),q(K!==oe.initialValue),ye.change(K))});const Ts=Ls({checked:K,disabled:B,form:m,name:a?void 0:X,id:T?void 0:G??void 0,required:k,ref:Rs,style:X?pt:ft,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(j){if(j.nativeEvent.defaultPrevented)return;if(w){j.preventDefault();return}const se=j.currentTarget.checked,ue=ht(xt,j.nativeEvent);if(N?.(se,ue),!ue.isCanceled&&(Y?.(se,ue),!ue.isCanceled&&(As(se),_!==void 0&&E!==void 0&&!a&&!ie))){const me=se?[...E.value,_]:E.value.filter(Re=>Re!==_);E.setValue(me,ue)}},onClick(j){j.stopPropagation()},onFocus(){de.current?.focus()}},z!==void 0?{value:(E?K&&z:z)||""}:Os,Ae,j=>ye.getValidationProps(B,j));x.useEffect(()=>{if(!W||_===void 0)return;const j=W.disabledStatesRef.current;return j.set(_,B),()=>{j.delete(_)}},[W,B,_]);const Le=x.useMemo(()=>({...L,checked:Fe,disabled:B,readOnly:w,required:k,indeterminate:ke}),[L,Fe,B,w,k,ke]),Is=ks(Le),Es=is("span",n,{state:Le,ref:[Ms,de,r],props:[{id:T?G??void 0:De,role:"checkbox","aria-checked":ke?"mixed":Fe,"aria-readonly":w||void 0,"aria-required":k||void 0,"aria-labelledby":zs,[Zt]:a?"":void 0,onFocus(){B||C(!0)},onBlur(){const j=ce.current;j&&(I(!0),C(!1),je==="onBlur"&&ye.commit(E?ee:j.checked))},onKeyDown(j){if(j.key!=="Enter"||(j.preventBaseUIHandler(),j.defaultPrevented))return;const se=ce.current?.form??null,ue=j.currentTarget,me=j.nativeEvent,Re=j.preventDefault,Oe=me.preventDefault;let Ve=!1;j.preventDefault=()=>{Ve=!0,Re.call(j)},me.preventDefault=()=>{Ve=!0,Oe.call(me)},Oe.call(me),qs(ue).queueMicrotask(()=>{j.preventDefault=Re,me.preventDefault=Oe,Ve||Gt(se)?.click()})},onClick(j){if(w||B)return;j.preventDefault();const se=ce.current;se&&Vs(se,j)}},M,le,$s,Ae,j=>ye.getValidationProps(B,j)],stateAttributesMapping:Is});return e.jsxs(Ns.Provider,{value:Le,children:[Es,!K&&!E&&X&&!a&&b!==void 0&&e.jsx("input",{type:"hidden",form:m,name:X,value:b,disabled:B}),e.jsx("input",{...Ts,suppressHydrationWarning:!0})]})}),en=x.forwardRef(function(n,r){const{render:o,className:p,style:l,keepMounted:c=!1,...y}=n,m=Xt(),h=m.checked||m.indeterminate,{mounted:g,transitionStatus:f,setMounted:u}=vt(h),N=x.useRef(null),a={...m,transitionStatus:f};yt({open:h,ref:N,onComplete(){h||u(!1)}});const P={...ks(m),...kt},k=c||g,b=is("span",n,{ref:[r,N],state:a,stateAttributesMapping:P,props:y});return k?b:null});function sn({className:s,...n}){return e.jsx(Yt,{"data-slot":"checkbox",className:A("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),...n,children:e.jsx(en,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:e.jsx(ms,{})})})}function ws({className:s,...n}){return e.jsx("textarea",{"data-slot":"textarea",className:A("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),...n})}function tn({rounds:s,active:n,onPick:r,onStart:o,starting:p}){const l=s.find(f=>f.number===n),c=(s[0]?.number??0)+1,[y,m]=x.useState(!1),[h,g]=x.useState("");return e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsxs(ne,{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(Vt,{className:"size-3.5"}),l?.name??`Round ${n}`,e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsxs(ae,{align:"start",className:"w-[260px]",children:[e.jsxs(he,{children:[e.jsx($e,{children:"Rounds"}),s.map(f=>e.jsxs(H,{onClick:()=>r(f.number),children:[e.jsx("span",{className:"truncate",children:f.name}),e.jsxs("span",{className:"ml-auto text-[11.5px] text-muted-foreground",children:[f.closed?"closed":"open",f.unresolved>0?` · ${f.unresolved} to go`:""]})]},f.id))]}),e.jsx(hs,{}),e.jsx(H,{onClick:()=>{g(`Round ${c}`),m(!0)},children:"Start a new round…"})]})]}),l&&e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[l.closed?"closed":"open",l.unresolved>0?` · ${l.unresolved} to go`:l.closed?"":" · all clear"]}),e.jsx(xs,{open:y,onOpenChange:m,children:e.jsx(ps,{children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),!(!h.trim()||p)&&(o(h.trim()),m(!1))},children:[e.jsxs(fs,{children:[e.jsx(gs,{children:"Start a new round"}),e.jsx(bs,{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(He,{htmlFor:"round-name",children:"Name"}),e.jsx(Pe,{id:"round-name",value:h,onChange:f=>g(f.target.value),autoFocus:!0})]}),e.jsxs(js,{children:[e.jsx($,{type:"button",variant:"outline",onClick:()=>m(!1),children:"Cancel"}),e.jsx($,{type:"submit",disabled:!h.trim()||p,children:p?"Starting…":"Start the round"})]})]})})})]})}function Cs({rounds:s,onMove:n,busy:r}){return s.length===0?null:e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx($,{variant:"outline",size:"sm",disabled:r}),children:"Move to round…"}),e.jsx(ae,{align:"start",className:"w-[240px]",children:e.jsxs(he,{children:[e.jsx($e,{children:"Move to round"}),s.map(o=>e.jsxs(H,{onClick:()=>n(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 nn={open:"Open",progress:"In progress",review:"In review",resolved:"Resolved"};function an(s,n,r={}){const o=r.fence??((v,D)=>D),p=r.statusLabel??(v=>nn[v]??v),l=s.anchor??{},c=s.context??{},y=l.page,m=y?.route??s.route??"/",h=y?.origin??n.origin??"",g=y?.pathname??m,f=h?`${h}${g}`:g,u=typeof l.label=="string"?o("label",l.label):"",N=l.element??l,a=[];a.push(`# ${s.key}${u?` — ${u}`:""}`),a.push(""),a.push(`${n.name} · ${p(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: ${f}`),h&&a.push(`- Open on the page: ${h}${g}?${ls("t")}=${encodeURIComponent(s.key)}`),u&&a.push(`- Element: ${u}`);const w=typeof l.css=="string"?l.css:typeof N.selector=="string"?N.selector:"";if(w&&a.push(`- Selector: \`${o("selector",w)}\``),typeof l.domid=="string"&&a.push(`- DOM id: \`#${o("selector",l.domid)}\``),typeof N.role=="string"){const v=typeof N.accessibleName=="string"?` “${o("label",N.accessibleName)}”`:"";a.push(`- Role: ${o("label",N.role)}${v}`)}typeof N.testId=="string"&&a.push(`- Test id: ${o("label",N.testId)}`);const P=l.text;P?.exact&&a.push(`- Text: “${o("label",P.exact)}”`),a.push(`- Anchor: ${s.anchorState??"unknown"}`),a.push(""),a.push("## What's wrong"),a.push("");const k=(s.comments??[]).filter(v=>v.body!==null);k.length===0&&a.push("> (no comment — a pin with no words)");for(const v of k){const D=v.author?.name?o("name",v.author.name):"Anonymous";a.push(`> **${D}${v.author?.kind==="agent"?" (agent)":""}** — ${v.createdAt.slice(0,16).replace("T"," ")}`);for(const Q of o("body",String(v.body)).split(`
|
|
47
47
|
`))a.push(`> ${Q}`);a.push(">")}a[a.length-1]===">"&&a.pop(),a.push(""),a.push("## Environment"),a.push("");const b=c.derived,z=c.viewport;(b?.browser||b?.os)&&a.push(`- Browser: ${[b.browser,b.os,b.device].filter(Boolean).join(" · ")}`),z?.w&&a.push(`- Viewport: ${z.w} × ${z.h}${z.dpr?` @${Math.round(z.dpr*10)/10}x`:""}`),c.prefersColorScheme&&a.push(`- Colour scheme: ${c.prefersColorScheme}`),c.language&&a.push(`- Language: ${c.language}`),c.ua&&a.push(`- User agent: ${o("label",String(c.ua))}`);const T=c.build;T&&Object.keys(T).length&&a.push(`- Build: ${Object.entries(T).map(([v,D])=>`${v}=${o("label",String(D))}`).join(", ")}`),a.push("");const V=c.breadcrumbs;if(V?.length){a.push(`## Breadcrumbs (${V.length}, oldest first)`),a.push("");for(const v of V)a.push(`- \`${String(v.t).slice(11,19)}\` ${v.type}${v.level?`/${v.level}`:""}: ${o("breadcrumb",String(v.message))}`);a.push("")}const M=s.attachments?.find(v=>v.kind==="screenshot")??s.attachments?.[0];if(M){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 v=M.url.startsWith("http")?M.url:`${n.dashboardOrigin??""}${M.url}`;a.push(``),a.push("")}return a.join(`
|
|
48
48
|
`).trimEnd()+`
|
|
49
|
-
`}function an(s,n){return nn(s,n,{statusLabel:r=>qs(r)?fe[r]:r})}function rn({thread:s,site:n,onStatus:r,onReply:o,replying:p,onClose:l,pool:c,onAssign:y,onAddPerson:m,trackers:h,onCreateIssue:g,creatingIssue:f,onEditComment:u,onDeleteComment:N,onDeleteThread:a,move:w,moderator:P=!0}){const k=s.anchor??{},b=s.context??{},z=typeof k.label=="string"?k.label:"",T=k.page,V=T?.route??s.route??"/",M=T?.origin??n.origin,v=M?`${M}${T?.pathname??V}?${is("t")}=${encodeURIComponent(s.key)}`:"",D=s.attachments?.find(d=>d.kind==="screenshot")??s.attachments?.[0],[Q,q]=x.useState(""),[U,C]=x.useState(""),[I,L]=x.useState(!1),[je,oe]=x.useState(!1),F=c.find(d=>d.isMe)?.id,ve=()=>{navigator.clipboard?.writeText(an(s,{name:n.name,...M?{origin:M}:{},dashboardOrigin:location.origin})),ds.success("Copied as a brief")};return e.jsxs("article",{className:"flex min-h-0 flex-1 flex-col","aria-label":`${s.key} — ${z||"a comment"}`,children:[e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border/60 px-4 py-2.5",children:[e.jsx("span",{className:"whitespace-nowrap font-mono text-[12px] text-muted-foreground",children:s.key}),e.jsx(ln,{status:s.status,onStatus:r}),e.jsx(hn,{assignee:s.assignee??null,pool:c,onAssign:y,onAddPerson:m}),(h??[]).map(d=>{const O=s.refs?.find(R=>R.provider===d&&R.kind===Us[d]&&R.status!=="detached");if(O){const R=d==="github"?`Issue #${O.externalId}`:d==="jira"?O.externalId:d==="slack"?"Slack message":d==="trello"?"Trello card":/\/issue\/([A-Z][A-Z0-9]*-\d+)/.exec(O.url)?.[1]??`${Ze[d]} issue`;return e.jsxs($,{variant:"ghost",size:"sm",render:e.jsx("a",{href:O.url,target:"_blank",rel:"noreferrer"}),children:[e.jsx(as,{}),R]},d)}return g?e.jsx($,{variant:"ghost",size:"sm",disabled:!!f,onClick:()=>g(d),children:f===d?d==="slack"?"Posting…":"Creating…":d==="slack"?"Post to Slack":d==="trello"?"Create Trello card":`Create ${Ze[d]} issue`},d):null}),e.jsx("div",{className:"flex-1"}),w&&e.jsx(ws,{rounds:w.rounds,onMove:w.onMove,busy:w.busy}),e.jsxs($,{variant:"ghost",size:"sm",onClick:ve,children:[e.jsx(wt,{}),"Copy as brief"]}),a&&e.jsx($,{variant:"ghost",size:"icon-sm","aria-label":`Delete ${s.key}`,title:"Delete this thread",onClick:()=>L(!0),children:e.jsx(vs,{})}),e.jsx($,{variant:"ghost",size:"icon-sm","aria-label":"Close",onClick:l,children:e.jsx(Nt,{})})]}),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:z||"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:V}),M&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("a",{href:`${M}${T?.pathname??V}`,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-brand hover:underline",children:[M.replace(/^https?:\/\//,""),e.jsx(as,{className:"size-3"})]})]}),v&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("a",{href:v,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(d=>d.body!==null).map(d=>e.jsx(on,{comment:d,reply:d!==s.comments[0],mine:Ye(d,F),...u?{onEdit:O=>u(d.id,O)}:{},...N&&(P||Ye(d,F))?{onDelete:()=>N(d.id)}:{}},d.id)),e.jsxs("form",{className:"flex gap-2.5",onSubmit:async d=>{d.preventDefault();const O=Q.trim();if(!(!O||p)){C("");try{await o(O),q("")}catch(R){C(R instanceof Error?R.message:"Could not send that reply.")}}},children:[e.jsx(ge,{className:"size-6 shrink-0",children:e.jsx(be,{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(Ns,{"aria-label":"Reply",placeholder:`Reply to ${s.createdBy.name||"the reviewer"}…`,value:Q,onChange:d=>q(d.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($,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("open"),children:"Reopen"}):e.jsxs(e.Fragment,{children:[s.status!=="review"&&e.jsx($,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("review"),children:"Mark in review"}),e.jsx($,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("resolved"),children:"Mark resolved"})]}),e.jsx($,{type:"submit",size:"sm",disabled:!Q.trim()||p,children:p?"Sending…":"Reply"})]})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx(Ke,{children:"Screenshot"}),D?e.jsxs(e.Fragment,{children:[e.jsx("a",{href:D.url,target:"_blank",rel:"noreferrer",className:"block overflow-hidden rounded-lg border border-border bg-background",children:e.jsx("img",{src:D.url,alt:`The page when ${s.key} was left`,width:D.width,height:D.height,loading:"lazy",className:"block h-auto w-full"})}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:[D.width??"?"," × ",D.height??"?",b.prefersColorScheme?` · ${b.prefersColorScheme}`:""," · taken at the click, ",Be(s.createdAt)," ·"," ",e.jsx("a",{href:D.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(Ct,{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(cn,{ctx:b})]}),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:[z&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Label"}),e.jsx("dd",{className:"m-0",children:z})]}),typeof k.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:k.css})]}),typeof k.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:["#",k.domid]})]}),typeof k.role=="string"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Role"}),e.jsxs("dd",{className:"m-0",children:[k.role,typeof k.accessibleName=="string"?` “${k.accessibleName}”`:""]})]}),k.text?.exact&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Text"}),e.jsxs("dd",{className:"m-0",children:["“",String(k.text.exact),"”"]})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Anchor"}),e.jsx("dd",{className:"m-0",children:e.jsx(dn,{state:s.anchorState})})]})]}),e.jsx(un,{ctx:b}),e.jsx(mn,{ctx:b})]}),a&&e.jsx(js,{open:I,onOpenChange:L,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:je,onConfirm:async()=>{oe(!0);try{await a(),L(!1)}catch{}finally{oe(!1)}}})]})}function on({comment:s,reply:n,mine:r,onEdit:o,onDelete:p}){const[l,c]=x.useState(!1),[y,m]=x.useState(""),[h,g]=x.useState(!1),[f,u]=x.useState(!1),[N,a]=x.useState(!1),w=r&&!!o,P=!!p,k=async()=>{const b=y.trim();if(!(!b||h||!o)){if(b===s.body){c(!1);return}g(!0);try{await o(b),c(!1)}catch{}finally{g(!1)}}};return e.jsxs("div",{className:"flex gap-2.5",children:[e.jsx(ge,{className:"size-6 shrink-0",children:e.jsx(be,{className:A("text-[10px] font-semibold",s.author.kind==="agent"?"bg-muted text-ink-soft":"bg-brand-soft text-brand"),children:Me(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:Be(s.createdAt)}),(w||P)&&!l&&e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx($,{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(Tt,{})}),e.jsxs(ae,{align:"end",className:"min-w-36",children:[w&&e.jsxs(H,{onClick:()=>{m(s.body??""),c(!0)},children:[e.jsx(Ft,{}),"Edit"]}),P&&e.jsxs(H,{variant:"destructive",onClick:()=>u(!0),children:[e.jsx(vs,{}),"Delete"]})]})]})]}),l?e.jsxs("form",{className:"mt-1 flex flex-col gap-2",onSubmit:b=>{b.preventDefault(),k()},children:[e.jsx(Ns,{"aria-label":"Edit your comment",value:y,autoFocus:!0,rows:3,disabled:h,onChange:b=>m(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),k()),b.key==="Escape"&&!h&&(b.preventDefault(),c(!1))}}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx($,{type:"button",variant:"ghost",size:"sm",disabled:h,onClick:()=>c(!1),children:"Cancel"}),e.jsx($,{type:"submit",size:"sm",loading:h,disabled:!y.trim(),children:h?"Saving…":"Save"})]})]}):e.jsx("p",{className:"m-0 whitespace-pre-wrap text-[13.5px] leading-normal",children:s.body})]}),P&&e.jsx(js,{open:f,onOpenChange:u,title:"Delete this comment?",description:n?"The reply is removed for everyone.":"The comment is removed for everyone. The pin and its replies stay.",confirmLabel:"Delete comment",busy:N,onConfirm:async()=>{a(!0);try{await p(),u(!1)}catch{}finally{a(!1)}}})]})}function ln({status:s,onStatus:n}){return e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx("button",{type:"button",className:"inline-flex items-center rounded-full","aria-label":"Status"}),children:e.jsx(ls,{status:s})}),e.jsx(ae,{align:"start",className:"w-[180px]",children:e.jsx(Ee,{value:s,onValueChange:r=>n(r),children:Ie.map(r=>e.jsx(J,{value:r,children:fe[r]},r))})})]})}function dn({state:s}){const n=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:A("rounded-full px-2 py-0.5 text-[11.5px] font-medium",n),children:r})}function cn({ctx:s}){const n=s.capture;if(!n)return null;const r=[];return n.screenshot&&n.screenshot!=="ok"&&r.push(`Screenshot ${n.screenshot}${n.reasons?.length?` — ${n.reasons.join("; ")}`:""}`),n.breadcrumbs&&n.breadcrumbs!=="ok"&&r.push(`Breadcrumbs ${n.breadcrumbs}`),n.blindSpots?.length&&r.push(`${n.blindSpots.length} blind spot${n.blindSpots.length===1?"":"s"}: ${n.blindSpots.join("; ")}`),n.droppedCategories?.length&&r.push(`Dropped: ${n.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 un({ctx:s}){const n=s.derived,r=s.viewport,o=s.build,p=[];return n?.browser||n?.os?p.push(["Browser",[n.browser,n.os,n.device].filter(Boolean).join(" · ")]):s.ua&&p.push(["User agent",String(s.ua)]),r?.w&&p.push(["Viewport",`${r.w} × ${r.h}${r.dpr?` @${Math.round(r.dpr*10)/10}x`:""}`]),s.language&&p.push(["Language",String(s.language)]),o&&Object.keys(o).length&&p.push(["Build",Object.entries(o).map(([l,c])=>`${l} ${String(c)}`).join(" · ")]),p.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)),ds.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:p.map(([l,c])=>e.jsxs("span",{className:"contents",children:[e.jsx("dt",{className:"text-muted-foreground",children:l}),e.jsx("dd",{className:A("m-0",l==="Build"&&"font-mono text-[12px] text-ink-soft"),children:c})]},l))})]}):null}function mn({ctx:s}){const n=s.breadcrumbs,[r,o]=x.useState(!1);if(!n?.length)return null;const p=n.filter(l=>l.level==="error"||l.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(St,{className:A("size-3.5 text-muted-foreground transition-transform",r&&"rotate-90")}),n.length," breadcrumb",n.length===1?"":"s",p>0?` · ${p} error${p===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:n.map((l,c)=>e.jsxs("li",{className:A("flex gap-2",(l.level==="error"||l.type==="error")&&"text-destructive"),children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:l.t.slice(11,19)}),e.jsxs("span",{className:"shrink-0 w-14 text-muted-foreground",children:[l.type,l.level?`/${l.level}`:""]}),e.jsx("span",{className:"min-w-0 break-words",children:l.message})]},c))})]})}function hn({assignee:s,pool:n,onAssign:r,onAddPerson:o}){const[p,l]=x.useState(!1),c=n.find(u=>u.isMe),y=n.filter(u=>u.isTeam),m=n.filter(u=>!u.isTeam&&!u.isAgent),h=n.filter(u=>!u.isTeam&&u.isAgent),g=u=>r({id:u.id,name:u.name,kind:u.kind,isTeam:u.isTeam}),f=u=>e.jsxs(H,{onClick:()=>g(u),children:[e.jsx(ge,{className:"size-4",children:e.jsx(be,{className:A("text-[8px] font-semibold",u.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(u.name,u.email)})}),e.jsx("span",{className:"truncate",children:u.isMe?`${u.name} (you)`:u.name}),s?.id===u.id&&e.jsx(us,{className:"ml-auto size-3.5"})]},u.id);return e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx($,{variant:"ghost",size:"sm","aria-label":s?`Assignee: ${s.name}`:"Assignee"}),children:s?e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"size-4",children:e.jsx(be,{className:A("text-[8px] font-semibold",s.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(s.name)})}),e.jsx("span",{className:"max-w-[150px] truncate",children:s.name})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ht,{}),"Assign"]})}),e.jsxs(ae,{align:"start",className:"min-w-56",children:[c&&s?.id!==c.id||s?e.jsxs(he,{children:[c&&s?.id!==c.id&&e.jsx(H,{onClick:()=>g(c),children:"Assign to me"}),s&&e.jsx(H,{onClick:()=>r(null),children:"Unassign"})]}):null,y.length>0&&e.jsxs(he,{children:[e.jsx($e,{children:"The studio"}),y.map(f)]}),m.length>0&&e.jsxs(he,{children:[e.jsx($e,{children:"People who commented"}),m.map(f)]}),h.length>0&&e.jsxs(he,{children:[e.jsx($e,{children:"Agents"}),h.map(f)]}),e.jsx(ms,{}),e.jsx(he,{children:e.jsxs(H,{onClick:()=>l(!0),children:[e.jsx(Ut,{}),"Add a person…"]})})]})]}),e.jsx(xn,{open:p,onOpenChange:l,onAdd:async u=>{const N=await o(u);g(N)}})]})}function xn({open:s,onOpenChange:n,onAdd:r}){const[o,p]=x.useState(""),[l,c]=x.useState(""),[y,m]=x.useState(!1),[h,g]=x.useState(""),f=async u=>{if(u.preventDefault(),!(!o.trim()||y)){m(!0),g("");try{await r({name:o.trim(),...l.trim()?{email:l.trim()}:{}}),p(""),c(""),n(!1)}catch(N){g(N instanceof Ks?N.message:"Could not add the person.")}finally{m(!1)}}};return e.jsx(hs,{open:s,onOpenChange:n,children:e.jsx(xs,{children:e.jsxs("form",{onSubmit:u=>void f(u),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(ps,{children:[e.jsx(fs,{children:"Add a person"}),e.jsx(gs,{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."})]}),h&&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:h}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(He,{htmlFor:"person-name",children:"Name"}),e.jsx(Pe,{id:"person-name",placeholder:"Sofia",value:o,onChange:u=>p(u.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(He,{htmlFor:"person-email",children:"Email (optional)"}),e.jsx(Pe,{id:"person-email",type:"email",placeholder:"sofia@acme.com",value:l,onChange:u=>c(u.target.value)})]}),e.jsxs(bs,{children:[e.jsx($,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),e.jsx($,{type:"submit",loading:y,disabled:!o.trim(),children:y?"Adding…":"Add and assign"})]})]})})})}at({thread:pe().optional(),status:pe().optional(),page:pe().optional(),q:pe().optional(),sort:ts(["newest","oldest"]).optional(),round:rt().int().positive().optional(),assignee:pe().optional(),by:pe().optional(),view:ts(["board"]).optional()});const Cs={open:"bg-status-open",progress:"bg-status-progress",review:"bg-status-review",resolved:"bg-status-resolved"};function Wn(){const{site:s}=es.useParams(),n=es.useSearch(),r=Hs(),o=Mt(),p=o.projects.find(t=>t.uid===s),l=we(Te.origins(s)),c=we(Te.rounds(s)),y=we(Te.assignees(s)),m=we(Te.siteIntegrations(s)),h=y.data?.data??[],g=h.find(t=>t.isMe)?.id,f=n.round??(c.data?Ws(c.data.data):void 0),u=(c.data?.data??[]).filter(t=>!t.archived||t.number===f),N=x.useMemo(()=>({...f!==void 0?{round:f}:{},...n.page?{route:n.page}:{},...n.q?{q:n.q}:{}}),[f,n.page,n.q]),a=we({...ss(s,N),enabled:c.isSuccess}),w=ss(s,N).queryKey,P=Gs(s,w),k=Js(w),b=Qs(s,w),z=Xs(s),T=Zs(s,w),V=Ys(s),M=et(s),v=st(w),D=tt(w),Q=nt(s,w),[q,U]=x.useState(new Set),C=t=>void r({to:"/s/$site/comments",params:{site:s},search:i=>({...i,...t}),replace:!0}),I=a.data?.data??[],L=x.useMemo(()=>new Set((n.status??"").split(",").filter(Boolean)),[n.status]),je=x.useMemo(()=>{const t=new Map;for(const i of I)t.set(i.status,(t.get(i.status)??0)+1);return t},[I]),oe=x.useMemo(()=>[...new Set(I.map(t=>We(t)))].sort(),[I]),F=x.useMemo(()=>{let t=L.size?I.filter(i=>L.has(i.status)):I;return n.assignee==="unassigned"?t=t.filter(i=>!i.assignee):n.assignee==="me"?t=t.filter(i=>!!g&&i.assignee?.id===g):n.assignee&&(t=t.filter(i=>i.assignee?.id===n.assignee)),n.by==="me"?t=t.filter(i=>!!g&&i.createdBy.id===g):n.by&&(t=t.filter(i=>rs(i.createdBy.name)===n.by)),n.sort==="oldest"&&(t=[...t].reverse()),t},[I,L,n.sort,n.assignee,n.by,g]),ve=x.useMemo(()=>{const t=new Map;for(const i of F){const S=We(i);t.has(S)||t.set(S,[]),t.get(S).push(i)}return[...t.entries()]},[F]),d=n.thread?I.find(t=>t.key===n.thread)??null:null,O=L.size>0||!!n.page||!!n.q||!!n.assignee||!!n.by,R=x.useMemo(()=>{const t=new Map;for(const i of I){if(i.createdBy.id&&i.createdBy.id===g)continue;const S=rs(i.createdBy.name);S&&!t.has(S)&&t.set(S,i.createdBy.name.trim())}return[...t].sort((i,S)=>i[1].localeCompare(S[1]))},[I,g]),Ae=u.filter(t=>t.number!==f&&t.unresolved>0),E=ze(o.user.role,"review"),W=ze(o.user.role,"moderate"),ie=t=>!!g&&t.comments.every(i=>i.body===null||i.author.id===g),B=E?u.filter(t=>!t.archived&&t.number!==f):[],X=(t,i)=>M.mutate({ids:t,round:i},{onSuccess:()=>{U(new Set),n.thread&&t.includes(d?.id??"")&&C({thread:void 0})}}),_=t=>{const i=new Set(L);i.has(t)?i.delete(t):i.add(t),C({status:[...i].join(",")||void 0})},De=async t=>{const i=[...q];U(new Set);for(const S of i)await P.mutateAsync({id:S,status:t}).catch(()=>{})};x.useEffect(()=>{const t=i=>{if(i.metaKey||i.ctrlKey||i.altKey)return;const S=i.target;if(S&&(S.closest("input,textarea,select,[contenteditable]")||S.isContentEditable))return;const Y=i.key.toLowerCase();if(Y!=="j"&&Y!=="k"&&Y!=="e"||F.length===0)return;if(i.preventDefault(),Y==="e"){if(!d)return;P.mutate({id:d.id,status:d.status==="resolved"?"open":"resolved"});return}const le=d?F.findIndex(xe=>xe.id===d.id):-1,ee=Y==="j"?Math.min(le+1,F.length-1):Math.max(le-1,0),de=F[le===-1?0:ee];de&&C({thread:de.key})};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)});const Z=n.view==="board",G=x.useMemo(()=>Ie.map(t=>({status:t,items:F.filter(i=>i.status===t)})),[F]);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:q.size>0?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-[13px] font-medium",children:[q.size," selected"]}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"Move to"}),Ie.map(t=>e.jsx($,{variant:"outline",size:"sm",onClick:()=>void De(t),children:fe[t]},t)),e.jsx(ws,{rounds:B,busy:M.isPending,onMove:t=>X([...q],t)}),e.jsx($,{variant:"ghost",size:"sm",onClick:()=>U(new Set),children:"Clear"})]}):e.jsxs(e.Fragment,{children:[u.length>0&&f!==void 0&&e.jsx(sn,{rounds:u,active:f,onPick:t=>C({round:t,thread:void 0}),onStart:t=>V.mutate(t,{onSuccess:i=>C({round:i.number,thread:void 0,status:void 0})}),starting:V.isPending}),e.jsx("span",{className:"mx-1 h-[18px] w-px bg-border"}),e.jsxs(Ue,{on:L.size===0,onClick:()=>C({status:void 0}),children:["All ",e.jsx("span",{className:"text-muted-foreground",children:I.length})]}),Ie.map(t=>e.jsxs(Ue,{on:L.has(t),onClick:()=>_(t),children:[e.jsx("span",{className:A("size-[7px] rounded-full",Cs[t])}),fe[t]," ",e.jsx("span",{className:"text-muted-foreground",children:je.get(t)??0})]},t)),e.jsx("div",{className:"flex-1"}),e.jsxs(Ue,{on:Z,onClick:()=>C({view:Z?void 0:"board"}),children:[Z?e.jsx(Bt,{className:"size-3.5"}):e.jsx(Rt,{className:"size-3.5"}),Z?"List":"Board"]}),e.jsx(fn,{value:n.q??"",onChange:t=>C({q:t||void 0})}),oe.length>1&&e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!!n.page)}),children:[n.page??"All pages",e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsxs(ae,{align:"end",children:[e.jsx(H,{onClick:()=>C({page:void 0}),children:"All pages"}),oe.map(t=>e.jsx(H,{onClick:()=>C({page:t}),children:e.jsx("span",{className:"font-mono text-[12px]",children:t})},t))]})]}),e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!!n.by),"aria-label":"Filter by who commented"}),children:[n.by==="me"?"By me":n.by?`By ${R.find(([t])=>t===n.by)?.[1]??"someone"}`:"Comments by",e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsx(ae,{align:"end",children:e.jsxs(Ee,{value:n.by??"any",onValueChange:t=>C({by:t==="any"?void 0:t}),children:[e.jsx(J,{value:"any",children:"Anyone"}),g&&e.jsx(J,{value:"me",children:"Me"}),R.map(([t,i])=>e.jsx(J,{value:t,children:i},t))]})})]}),e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!!n.assignee),"aria-label":"Filter by assignee"}),children:[pn(n.assignee,h),e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsx(ae,{align:"end",children:e.jsxs(Ee,{value:n.assignee??"any",onValueChange:t=>C({assignee:t==="any"?void 0:t}),children:[e.jsx(J,{value:"any",children:"Anyone"}),e.jsx(J,{value:"unassigned",children:"Unassigned"}),g&&e.jsx(J,{value:"me",children:"Me"}),h.filter(t=>!t.isMe).map(t=>e.jsx(J,{value:t.id,children:t.name},t.id))]})})]}),e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!1)}),children:[n.sort==="oldest"?"Oldest":"Newest",e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsx(ae,{align:"end",children:e.jsxs(Ee,{value:n.sort??"newest",onValueChange:t=>C({sort:t==="oldest"?"oldest":void 0}),children:[e.jsx(J,{value:"newest",children:"Newest first"}),e.jsx(J,{value:"oldest",children:"Oldest first"})]})})]})]})}),Ae.map(t=>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:()=>C({round:t.number,thread:void 0}),children:[e.jsxs("b",{className:"font-semibold",children:[t.unresolved," unresolved"]})," in ",t.name," — still open, not carried over."," ",e.jsx("span",{className:"text-brand",children:"Go there"})]},t.id)),e.jsxs("div",{className:A("grid min-h-0 flex-1",d?"grid-cols-1 lg:grid-cols-[minmax(0,1fr)_520px]":"grid-cols-1"),children:[e.jsxs("div",{className:A("min-h-0 overflow-auto lg:border-r lg:border-border",d&&"hidden lg:block"),children:[a.isPending&&e.jsx(bn,{}),a.isError&&e.jsx(qe,{title:"Could not load the comments",children:a.error.message}),a.isSuccess&&I.length===0&&!O&&e.jsx("div",{className:"mx-auto max-w-[560px] py-8",children:e.jsxs(qe,{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 ",p.name," it appears here, grouped by page."]}),e.jsx("div",{className:"mt-4 text-left",children:e.jsx($t,{uid:s})})]})}),a.isSuccess&&I.length>0&&F.length===0&&e.jsx(qe,{title:"Nothing matches",action:e.jsx($,{variant:"outline",size:"sm",onClick:()=>C({status:void 0,page:void 0,q:void 0,assignee:void 0,by:void 0}),children:"Show all"}),children:"No comment matches that filter."}),Z&&a.isSuccess&&F.length>0&&e.jsx(jn,{columns:G,uid:s,selectedId:d?.id??null,onMove:(t,i)=>P.mutate({id:t,status:i})}),!Z&&ve.map(([t,i])=>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:[t," ",e.jsxs("span",{className:"font-sans text-muted-foreground",children:["· ",i.length]})]}),i.map(S=>e.jsx(gn,{t:S,uid:s,on:d?.id===S.id,picked:q.has(S.id),picking:q.size>0,onPick:Y=>U(le=>{const ee=new Set(le);return Y?ee.add(S.id):ee.delete(S.id),ee})},S.id))]},t))]}),d&&e.jsxs("div",{className:"flex min-h-0 flex-col overflow-hidden bg-card",children:[e.jsx("div",{className:"lg:hidden",children:e.jsxs($,{variant:"ghost",size:"sm",className:"m-2",onClick:()=>C({thread:void 0}),children:[e.jsx(At,{}),"Back to the list"]})}),e.jsx(rn,{thread:d,site:{name:p.name,...l.data?.origins[0]?{origin:l.data.origins[0]}:{}},onStatus:t=>P.mutate({id:d.id,status:t}),onReply:t=>k.mutateAsync({id:d.id,body:t}),replying:k.isPending,pool:h,onAssign:t=>b.mutate({id:d.id,assignee:t}),onAddPerson:t=>z.mutateAsync(t),trackers:(m.data?.data??[]).map(t=>t.provider),...ze(o.user.role,"settings")?{onCreateIssue:t=>T.mutate({id:d.id,provider:t})}:{},creatingIssue:T.isPending?T.variables?.provider:void 0,onEditComment:(t,i)=>v.mutateAsync({threadId:d.id,commentId:t,body:i}),onDeleteComment:t=>D.mutateAsync({threadId:d.id,commentId:t}),moderator:W,...W||ze(o.user.role,"review")&&ie(d)?{onDeleteThread:async()=>{await Q.mutateAsync(d.id),C({thread:void 0})}}:{},...B.length?{move:{rounds:B,busy:M.isPending,onMove:t=>X([d.id],t)}}:{},onClose:()=>C({thread:void 0})})]})]})]})}function pn(s,n){return s?s==="unassigned"?"Unassigned":s==="me"?"Me":n.find(r=>r.id===s)?.name??"Assignee":"Assignee"}function rs(s){return s.trim().toLowerCase()}function We(s){return s.anchor?.page?.route??s.route??"/"}function Se(s){return A("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 Ue({on:s,onClick:n,children:r}){return e.jsx("button",{type:"button",className:Se(s),"aria-pressed":s,onClick:n,children:r})}function fn({value:s,onChange:n}){const[r,o]=x.useState(s);return e.jsxs("form",{className:"relative",onSubmit:p=>{p.preventDefault(),n(r.trim())},children:[e.jsx(kt,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),e.jsx(Pe,{type:"search","aria-label":"Search comments",placeholder:"Search",value:r,onChange:p=>o(p.target.value),onBlur:()=>r.trim()!==s&&n(r.trim()),className:"h-7 w-[170px] pl-7 text-[12.5px]"})]})}function gn({t:s,uid:n,on:r,picked:o,picking:p,onPick:l}){const c=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:A("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:A("flex items-center",!p&&"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),children:e.jsx(en,{checked:o,onCheckedChange:m=>l(!!m),"aria-label":`Select ${s.key}`})}),e.jsxs(cs,{to:"/s/$site/comments",params:{site:n},search:m=>({...m,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:[c,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(ge,{className:"size-5",title:`Assigned to ${s.assignee.name}`,children:e.jsx(be,{className:A("text-[9px] font-semibold",s.assignee.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(s.assignee.name)})}),e.jsx(ls,{status:s.status}),e.jsx("span",{className:"w-11 whitespace-nowrap text-right",children:Be(s.updatedAt)})]})]})]})}function bn(){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(Ne,{className:"h-3 w-16"})}),[70,55,80,62].map((s,n)=>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(Ne,{className:"h-3 w-10"}),e.jsx(Ne,{className:"h-3",style:{width:`${s}%`}}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(Ne,{className:"h-3 w-11"}),e.jsx(Ne,{className:"h-[18px] w-16 rounded-full"})]})]},n))]})}function jn({columns:s,uid:n,selectedId:r,onMove:o}){const[p,l]=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:c,items:y})=>e.jsxs("section",{"aria-label":fe[c],onDragOver:m=>{m.preventDefault(),l(c)},onDragLeave:()=>l(m=>m===c?null:m),onDrop:m=>{m.preventDefault(),l(null);const h=m.dataTransfer.getData("text/plain");h&&o(h,c)},className:A("flex w-[280px] shrink-0 flex-col rounded-lg border border-border bg-muted/40",p===c&&"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:A("size-[7px] rounded-full",Cs[c])}),fe[c],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(m=>e.jsxs(cs,{to:"/s/$site/comments",params:{site:n},search:h=>({...h,thread:m.key}),draggable:!0,onDragStart:h=>{h.dataTransfer.setData("text/plain",m.id),h.dataTransfer.effectAllowed="move"},className:A("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===m.id&&"border-brand ring-1 ring-brand"),children:[e.jsx("span",{className:"line-clamp-3 text-[13px]",children:m.comments[0]?.body??(typeof m.anchor?.label=="string"?m.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:m.key}),e.jsx("span",{className:"truncate",children:We(m)}),e.jsx("span",{className:"flex-1"}),m.assignee&&e.jsx(ge,{className:"size-4",title:`Assigned to ${m.assignee.name}`,children:e.jsx(be,{className:A("text-[8px] font-semibold",m.assignee.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(m.assignee.name)})}),e.jsx("span",{children:Be(m.updatedAt)})]})]},m.id))]})]},c))})}export{Wn as component,qs as isStatus};
|
|
49
|
+
`}function rn(s,n){return an(s,n,{statusLabel:r=>Us(r)?fe[r]:r})}function on({thread:s,site:n,onStatus:r,onReply:o,replying:p,onClose:l,pool:c,onAssign:y,onAddPerson:m,trackers:h,onCreateIssue:g,creatingIssue:f,onEditComment:u,onDeleteComment:N,onDeleteThread:a,move:w,moderator:P=!0}){const k=s.anchor??{},b=s.context??{},z=typeof k.label=="string"?k.label:"",T=k.page,V=T?.route??s.route??"/",M=T?.origin??n.origin,v=M?`${M}${T?.pathname??V}?${ls("t")}=${encodeURIComponent(s.key)}`:"",D=s.attachments?.find(d=>d.kind==="screenshot")??s.attachments?.[0],[Q,q]=x.useState(""),[U,C]=x.useState(""),[I,L]=x.useState(!1),[je,oe]=x.useState(!1),F=c.find(d=>d.isMe)?.id,ve=()=>{navigator.clipboard?.writeText(rn(s,{name:n.name,...M?{origin:M}:{},dashboardOrigin:location.origin})),cs.success("Copied as a brief")};return e.jsxs("article",{className:"flex min-h-0 flex-1 flex-col","aria-label":`${s.key} — ${z||"a comment"}`,children:[e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border/60 px-4 py-2.5",children:[e.jsx("span",{className:"whitespace-nowrap font-mono text-[12px] text-muted-foreground",children:s.key}),e.jsx(dn,{status:s.status,onStatus:r}),e.jsx(xn,{assignee:s.assignee??null,pool:c,onAssign:y,onAddPerson:m}),(h??[]).map(d=>{const O=s.refs?.find(R=>R.provider===d&&R.kind===Ks[d]&&R.status!=="detached");if(O){const R=d==="github"?`Issue #${O.externalId}`:d==="jira"?O.externalId:d==="slack"?"Slack message":d==="trello"?"Trello card":/\/issue\/([A-Z][A-Z0-9]*-\d+)/.exec(O.url)?.[1]??`${Ze[d]} issue`;return e.jsxs($,{variant:"ghost",size:"sm",render:e.jsx("a",{href:O.url,target:"_blank",rel:"noreferrer"}),children:[e.jsx(as,{}),R]},d)}return g?e.jsx($,{variant:"ghost",size:"sm",disabled:!!f,onClick:()=>g(d),children:f===d?d==="slack"?"Posting…":"Creating…":d==="slack"?"Post to Slack":d==="trello"?"Create Trello card":`Create ${Ze[d]} issue`},d):null}),e.jsx("div",{className:"flex-1"}),w&&e.jsx(Cs,{rounds:w.rounds,onMove:w.onMove,busy:w.busy}),e.jsxs($,{variant:"ghost",size:"sm",onClick:ve,children:[e.jsx(Ct,{}),"Copy as brief"]}),a&&e.jsx($,{variant:"ghost",size:"icon-sm","aria-label":`Delete ${s.key}`,title:"Delete this thread",onClick:()=>L(!0),children:e.jsx(ys,{})}),e.jsx($,{variant:"ghost",size:"icon-sm","aria-label":"Close",onClick:l,children:e.jsx(wt,{})})]}),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:z||"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:V}),M&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("a",{href:`${M}${T?.pathname??V}`,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-brand hover:underline",children:[M.replace(/^https?:\/\//,""),e.jsx(as,{className:"size-3"})]})]}),v&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("a",{href:v,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(d=>d.body!==null).map(d=>e.jsx(ln,{comment:d,reply:d!==s.comments[0],mine:Ye(d,F),...u?{onEdit:O=>u(d.id,O)}:{},...N&&(P||Ye(d,F))?{onDelete:()=>N(d.id)}:{}},d.id)),e.jsxs("form",{className:"flex gap-2.5",onSubmit:async d=>{d.preventDefault();const O=Q.trim();if(!(!O||p)){C("");try{await o(O),q("")}catch(R){C(R instanceof Error?R.message:"Could not send that reply.")}}},children:[e.jsx(ge,{className:"size-6 shrink-0",children:e.jsx(be,{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(ws,{"aria-label":"Reply",placeholder:`Reply to ${s.createdBy.name||"the reviewer"}…`,value:Q,onChange:d=>q(d.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($,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("open"),children:"Reopen"}):e.jsxs(e.Fragment,{children:[s.status!=="review"&&e.jsx($,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("review"),children:"Mark in review"}),e.jsx($,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("resolved"),children:"Mark resolved"})]}),e.jsx($,{type:"submit",size:"sm",disabled:!Q.trim()||p,children:p?"Sending…":"Reply"})]})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx(Ke,{children:"Screenshot"}),D?e.jsxs(e.Fragment,{children:[e.jsx("a",{href:D.url,target:"_blank",rel:"noreferrer",className:"block overflow-hidden rounded-lg border border-border bg-background",children:e.jsx("img",{src:D.url,alt:`The page when ${s.key} was left`,width:D.width,height:D.height,loading:"lazy",className:"block h-auto w-full"})}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:[D.width??"?"," × ",D.height??"?",b.prefersColorScheme?` · ${b.prefersColorScheme}`:""," · taken at the click, ",Be(s.createdAt)," ·"," ",e.jsx("a",{href:D.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(St,{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(un,{ctx:b})]}),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:[z&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Label"}),e.jsx("dd",{className:"m-0",children:z})]}),typeof k.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:k.css})]}),typeof k.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:["#",k.domid]})]}),typeof k.role=="string"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Role"}),e.jsxs("dd",{className:"m-0",children:[k.role,typeof k.accessibleName=="string"?` “${k.accessibleName}”`:""]})]}),k.text?.exact&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Text"}),e.jsxs("dd",{className:"m-0",children:["“",String(k.text.exact),"”"]})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Anchor"}),e.jsx("dd",{className:"m-0",children:e.jsx(cn,{state:s.anchorState})})]})]}),e.jsx(mn,{ctx:b}),e.jsx(hn,{ctx:b})]}),a&&e.jsx(vs,{open:I,onOpenChange:L,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:je,onConfirm:async()=>{oe(!0);try{await a(),L(!1)}catch{}finally{oe(!1)}}})]})}function ln({comment:s,reply:n,mine:r,onEdit:o,onDelete:p}){const[l,c]=x.useState(!1),[y,m]=x.useState(""),[h,g]=x.useState(!1),[f,u]=x.useState(!1),[N,a]=x.useState(!1),w=r&&!!o,P=!!p,k=async()=>{const b=y.trim();if(!(!b||h||!o)){if(b===s.body){c(!1);return}g(!0);try{await o(b),c(!1)}catch{}finally{g(!1)}}};return e.jsxs("div",{className:"flex gap-2.5",children:[e.jsx(ge,{className:"size-6 shrink-0",children:e.jsx(be,{className:A("text-[10px] font-semibold",s.author.kind==="agent"?"bg-muted text-ink-soft":"bg-brand-soft text-brand"),children:Me(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:Be(s.createdAt)}),(w||P)&&!l&&e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx($,{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(It,{})}),e.jsxs(ae,{align:"end",className:"min-w-36",children:[w&&e.jsxs(H,{onClick:()=>{m(s.body??""),c(!0)},children:[e.jsx(Lt,{}),"Edit"]}),P&&e.jsxs(H,{variant:"destructive",onClick:()=>u(!0),children:[e.jsx(ys,{}),"Delete"]})]})]})]}),l?e.jsxs("form",{className:"mt-1 flex flex-col gap-2",onSubmit:b=>{b.preventDefault(),k()},children:[e.jsx(ws,{"aria-label":"Edit your comment",value:y,autoFocus:!0,rows:3,disabled:h,onChange:b=>m(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),k()),b.key==="Escape"&&!h&&(b.preventDefault(),c(!1))}}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx($,{type:"button",variant:"ghost",size:"sm",disabled:h,onClick:()=>c(!1),children:"Cancel"}),e.jsx($,{type:"submit",size:"sm",loading:h,disabled:!y.trim(),children:h?"Saving…":"Save"})]})]}):e.jsx("p",{className:"m-0 whitespace-pre-wrap text-[13.5px] leading-normal",children:s.body})]}),P&&e.jsx(vs,{open:f,onOpenChange:u,title:"Delete this comment?",description:n?"The reply is removed for everyone.":"The comment is removed for everyone. The pin and its replies stay.",confirmLabel:"Delete comment",busy:N,onConfirm:async()=>{a(!0);try{await p(),u(!1)}catch{}finally{a(!1)}}})]})}function dn({status:s,onStatus:n}){return e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx("button",{type:"button",className:"inline-flex items-center rounded-full","aria-label":"Status"}),children:e.jsx(ds,{status:s})}),e.jsx(ae,{align:"start",className:"w-[180px]",children:e.jsx(Ee,{value:s,onValueChange:r=>n(r),children:Ie.map(r=>e.jsx(J,{value:r,children:fe[r]},r))})})]})}function cn({state:s}){const n=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:A("rounded-full px-2 py-0.5 text-[11.5px] font-medium",n),children:r})}function un({ctx:s}){const n=s.capture;if(!n)return null;const r=[];return n.screenshot&&n.screenshot!=="ok"&&r.push(`Screenshot ${n.screenshot}${n.reasons?.length?` — ${n.reasons.join("; ")}`:""}`),n.breadcrumbs&&n.breadcrumbs!=="ok"&&r.push(`Breadcrumbs ${n.breadcrumbs}`),n.blindSpots?.length&&r.push(`${n.blindSpots.length} blind spot${n.blindSpots.length===1?"":"s"}: ${n.blindSpots.join("; ")}`),n.droppedCategories?.length&&r.push(`Dropped: ${n.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 mn({ctx:s}){const n=s.derived,r=s.viewport,o=s.build,p=[];return n?.browser||n?.os?p.push(["Browser",[n.browser,n.os,n.device].filter(Boolean).join(" · ")]):s.ua&&p.push(["User agent",String(s.ua)]),r?.w&&p.push(["Viewport",`${r.w} × ${r.h}${r.dpr?` @${Math.round(r.dpr*10)/10}x`:""}`]),s.language&&p.push(["Language",String(s.language)]),o&&Object.keys(o).length&&p.push(["Build",Object.entries(o).map(([l,c])=>`${l} ${String(c)}`).join(" · ")]),p.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)),cs.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:p.map(([l,c])=>e.jsxs("span",{className:"contents",children:[e.jsx("dt",{className:"text-muted-foreground",children:l}),e.jsx("dd",{className:A("m-0",l==="Build"&&"font-mono text-[12px] text-ink-soft"),children:c})]},l))})]}):null}function hn({ctx:s}){const n=s.breadcrumbs,[r,o]=x.useState(!1);if(!n?.length)return null;const p=n.filter(l=>l.level==="error"||l.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($t,{className:A("size-3.5 text-muted-foreground transition-transform",r&&"rotate-90")}),n.length," breadcrumb",n.length===1?"":"s",p>0?` · ${p} error${p===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:n.map((l,c)=>e.jsxs("li",{className:A("flex gap-2",(l.level==="error"||l.type==="error")&&"text-destructive"),children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:l.t.slice(11,19)}),e.jsxs("span",{className:"shrink-0 w-14 text-muted-foreground",children:[l.type,l.level?`/${l.level}`:""]}),e.jsx("span",{className:"min-w-0 break-words",children:l.message})]},c))})]})}function xn({assignee:s,pool:n,onAssign:r,onAddPerson:o}){const[p,l]=x.useState(!1),c=n.find(u=>u.isMe),y=n.filter(u=>u.isTeam),m=n.filter(u=>!u.isTeam&&!u.isAgent),h=n.filter(u=>!u.isTeam&&u.isAgent),g=u=>r({id:u.id,name:u.name,kind:u.kind,isTeam:u.isTeam}),f=u=>e.jsxs(H,{onClick:()=>g(u),children:[e.jsx(ge,{className:"size-4",children:e.jsx(be,{className:A("text-[8px] font-semibold",u.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(u.name,u.email)})}),e.jsx("span",{className:"truncate",children:u.isMe?`${u.name} (you)`:u.name}),s?.id===u.id&&e.jsx(ms,{className:"ml-auto size-3.5"})]},u.id);return e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx($,{variant:"ghost",size:"sm","aria-label":s?`Assignee: ${s.name}`:"Assignee"}),children:s?e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"size-4",children:e.jsx(be,{className:A("text-[8px] font-semibold",s.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(s.name)})}),e.jsx("span",{className:"max-w-[150px] truncate",children:s.name})]}):e.jsxs(e.Fragment,{children:[e.jsx(Wt,{}),"Assign"]})}),e.jsxs(ae,{align:"start",className:"min-w-56",children:[c&&s?.id!==c.id||s?e.jsxs(he,{children:[c&&s?.id!==c.id&&e.jsx(H,{onClick:()=>g(c),children:"Assign to me"}),s&&e.jsx(H,{onClick:()=>r(null),children:"Unassign"})]}):null,y.length>0&&e.jsxs(he,{children:[e.jsx($e,{children:"The studio"}),y.map(f)]}),m.length>0&&e.jsxs(he,{children:[e.jsx($e,{children:"People who commented"}),m.map(f)]}),h.length>0&&e.jsxs(he,{children:[e.jsx($e,{children:"Agents"}),h.map(f)]}),e.jsx(hs,{}),e.jsx(he,{children:e.jsxs(H,{onClick:()=>l(!0),children:[e.jsx(Kt,{}),"Add a person…"]})})]})]}),e.jsx(pn,{open:p,onOpenChange:l,onAdd:async u=>{const N=await o(u);g(N)}})]})}function pn({open:s,onOpenChange:n,onAdd:r}){const[o,p]=x.useState(""),[l,c]=x.useState(""),[y,m]=x.useState(!1),[h,g]=x.useState(""),f=async u=>{if(u.preventDefault(),!(!o.trim()||y)){m(!0),g("");try{await r({name:o.trim(),...l.trim()?{email:l.trim()}:{}}),p(""),c(""),n(!1)}catch(N){g(N instanceof Hs?N.message:"Could not add the person.")}finally{m(!1)}}};return e.jsx(xs,{open:s,onOpenChange:n,children:e.jsx(ps,{children:e.jsxs("form",{onSubmit:u=>void f(u),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(fs,{children:[e.jsx(gs,{children:"Add a person"}),e.jsx(bs,{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."})]}),h&&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:h}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(He,{htmlFor:"person-name",children:"Name"}),e.jsx(Pe,{id:"person-name",placeholder:"Sofia",value:o,onChange:u=>p(u.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(He,{htmlFor:"person-email",children:"Email (optional)"}),e.jsx(Pe,{id:"person-email",type:"email",placeholder:"sofia@acme.com",value:l,onChange:u=>c(u.target.value)})]}),e.jsxs(js,{children:[e.jsx($,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),e.jsx($,{type:"submit",loading:y,disabled:!o.trim(),children:y?"Adding…":"Add and assign"})]})]})})})}rt({thread:pe().optional(),status:pe().optional(),page:pe().optional(),q:pe().optional(),sort:ts(["newest","oldest"]).optional(),round:ot().int().positive().optional(),assignee:pe().optional(),by:pe().optional(),view:ts(["board"]).optional()});const Ss={open:"bg-status-open",progress:"bg-status-progress",review:"bg-status-review",resolved:"bg-status-resolved"};function Jn(){const{site:s}=es.useParams(),n=es.useSearch(),r=Ws(),o=At(),p=o.projects.find(t=>t.uid===s),l=we(Te.origins(s)),c=we(Te.rounds(s)),y=we(Te.assignees(s)),m=we(Te.siteIntegrations(s)),h=y.data?.data??[],g=h.find(t=>t.isMe)?.id,f=n.round??(c.data?Gs(c.data.data):void 0),u=(c.data?.data??[]).filter(t=>!t.archived||t.number===f),N=x.useMemo(()=>({...f!==void 0?{round:f}:{},...n.page?{route:n.page}:{},...n.q?{q:n.q}:{}}),[f,n.page,n.q]),a=we({...ss(s,N),enabled:c.isSuccess}),w=ss(s,N).queryKey,P=Js(s,w),k=Qs(w),b=Xs(s,w),z=Zs(s),T=Ys(s,w),V=et(s),M=st(s),v=tt(w),D=nt(w),Q=at(s,w),[q,U]=x.useState(new Set),C=t=>void r({to:"/s/$site/comments",params:{site:s},search:i=>({...i,...t}),replace:!0}),I=a.data?.data??[],L=x.useMemo(()=>new Set((n.status??"").split(",").filter(Boolean)),[n.status]),je=x.useMemo(()=>{const t=new Map;for(const i of I)t.set(i.status,(t.get(i.status)??0)+1);return t},[I]),oe=x.useMemo(()=>[...new Set(I.map(t=>We(t)))].sort(),[I]),F=x.useMemo(()=>{let t=L.size?I.filter(i=>L.has(i.status)):I;return n.assignee==="unassigned"?t=t.filter(i=>!i.assignee):n.assignee==="me"?t=t.filter(i=>!!g&&i.assignee?.id===g):n.assignee&&(t=t.filter(i=>i.assignee?.id===n.assignee)),n.by==="me"?t=t.filter(i=>!!g&&i.createdBy.id===g):n.by&&(t=t.filter(i=>os(i.createdBy.name)===n.by)),n.sort==="oldest"&&(t=[...t].reverse()),t},[I,L,n.sort,n.assignee,n.by,g]),ve=x.useMemo(()=>{const t=new Map;for(const i of F){const S=We(i);t.has(S)||t.set(S,[]),t.get(S).push(i)}return[...t.entries()]},[F]),d=n.thread?I.find(t=>t.key===n.thread)??null:null,O=L.size>0||!!n.page||!!n.q||!!n.assignee||!!n.by,R=x.useMemo(()=>{const t=new Map;for(const i of I){if(i.createdBy.id&&i.createdBy.id===g)continue;const S=os(i.createdBy.name);S&&!t.has(S)&&t.set(S,i.createdBy.name.trim())}return[...t].sort((i,S)=>i[1].localeCompare(S[1]))},[I,g]),Ae=u.filter(t=>t.number!==f&&t.unresolved>0),E=ze(o.user.role,"review"),W=ze(o.user.role,"moderate"),ie=t=>!!g&&t.comments.every(i=>i.body===null||i.author.id===g),B=E?u.filter(t=>!t.archived&&t.number!==f):[],X=(t,i)=>M.mutate({ids:t,round:i},{onSuccess:()=>{U(new Set),n.thread&&t.includes(d?.id??"")&&C({thread:void 0})}}),_=t=>{const i=new Set(L);i.has(t)?i.delete(t):i.add(t),C({status:[...i].join(",")||void 0})},De=async t=>{const i=[...q];U(new Set);for(const S of i)await P.mutateAsync({id:S,status:t}).catch(()=>{})};x.useEffect(()=>{const t=i=>{if(i.metaKey||i.ctrlKey||i.altKey)return;const S=i.target;if(S&&(S.closest("input,textarea,select,[contenteditable]")||S.isContentEditable))return;const Y=i.key.toLowerCase();if(Y!=="j"&&Y!=="k"&&Y!=="e"||F.length===0)return;if(i.preventDefault(),Y==="e"){if(!d)return;P.mutate({id:d.id,status:d.status==="resolved"?"open":"resolved"});return}const le=d?F.findIndex(xe=>xe.id===d.id):-1,ee=Y==="j"?Math.min(le+1,F.length-1):Math.max(le-1,0),de=F[le===-1?0:ee];de&&C({thread:de.key})};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)});const Z=n.view==="board",G=x.useMemo(()=>Ie.map(t=>({status:t,items:F.filter(i=>i.status===t)})),[F]);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:q.size>0?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-[13px] font-medium",children:[q.size," selected"]}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"Move to"}),Ie.map(t=>e.jsx($,{variant:"outline",size:"sm",onClick:()=>void De(t),children:fe[t]},t)),e.jsx(Cs,{rounds:B,busy:M.isPending,onMove:t=>X([...q],t)}),e.jsx($,{variant:"ghost",size:"sm",onClick:()=>U(new Set),children:"Clear"})]}):e.jsxs(e.Fragment,{children:[u.length>0&&f!==void 0&&e.jsx(tn,{rounds:u,active:f,onPick:t=>C({round:t,thread:void 0}),onStart:t=>V.mutate(t,{onSuccess:i=>C({round:i.number,thread:void 0,status:void 0})}),starting:V.isPending}),e.jsx("span",{className:"mx-1 h-[18px] w-px bg-border"}),e.jsxs(Ue,{on:L.size===0,onClick:()=>C({status:void 0}),children:["All ",e.jsx("span",{className:"text-muted-foreground",children:I.length})]}),Ie.map(t=>e.jsxs(Ue,{on:L.has(t),onClick:()=>_(t),children:[e.jsx("span",{className:A("size-[7px] rounded-full",Ss[t])}),fe[t]," ",e.jsx("span",{className:"text-muted-foreground",children:je.get(t)??0})]},t)),e.jsx("div",{className:"flex-1"}),e.jsxs(Ue,{on:Z,onClick:()=>C({view:Z?void 0:"board"}),children:[Z?e.jsx(_t,{className:"size-3.5"}):e.jsx(zt,{className:"size-3.5"}),Z?"List":"Board"]}),e.jsx(gn,{value:n.q??"",onChange:t=>C({q:t||void 0})}),oe.length>1&&e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!!n.page)}),children:[n.page??"All pages",e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsxs(ae,{align:"end",children:[e.jsx(H,{onClick:()=>C({page:void 0}),children:"All pages"}),oe.map(t=>e.jsx(H,{onClick:()=>C({page:t}),children:e.jsx("span",{className:"font-mono text-[12px]",children:t})},t))]})]}),e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!!n.by),"aria-label":"Filter by who commented"}),children:[n.by==="me"?"By me":n.by?`By ${R.find(([t])=>t===n.by)?.[1]??"someone"}`:"Comments by",e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsx(ae,{align:"end",children:e.jsxs(Ee,{value:n.by??"any",onValueChange:t=>C({by:t==="any"?void 0:t}),children:[e.jsx(J,{value:"any",children:"Anyone"}),g&&e.jsx(J,{value:"me",children:"Me"}),R.map(([t,i])=>e.jsx(J,{value:t,children:i},t))]})})]}),e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!!n.assignee),"aria-label":"Filter by assignee"}),children:[fn(n.assignee,h),e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsx(ae,{align:"end",children:e.jsxs(Ee,{value:n.assignee??"any",onValueChange:t=>C({assignee:t==="any"?void 0:t}),children:[e.jsx(J,{value:"any",children:"Anyone"}),e.jsx(J,{value:"unassigned",children:"Unassigned"}),g&&e.jsx(J,{value:"me",children:"Me"}),h.filter(t=>!t.isMe).map(t=>e.jsx(J,{value:t.id,children:t.name},t.id))]})})]}),e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!1)}),children:[n.sort==="oldest"?"Oldest":"Newest",e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsx(ae,{align:"end",children:e.jsxs(Ee,{value:n.sort??"newest",onValueChange:t=>C({sort:t==="oldest"?"oldest":void 0}),children:[e.jsx(J,{value:"newest",children:"Newest first"}),e.jsx(J,{value:"oldest",children:"Oldest first"})]})})]})]})}),Ae.map(t=>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:()=>C({round:t.number,thread:void 0}),children:[e.jsxs("b",{className:"font-semibold",children:[t.unresolved," unresolved"]})," in ",t.name," — still open, not carried over."," ",e.jsx("span",{className:"text-brand",children:"Go there"})]},t.id)),e.jsxs("div",{className:A("grid min-h-0 flex-1",d?"grid-cols-1 lg:grid-cols-[minmax(0,1fr)_520px]":"grid-cols-1"),children:[e.jsxs("div",{className:A("min-h-0 overflow-auto lg:border-r lg:border-border",d&&"hidden lg:block"),children:[a.isPending&&e.jsx(jn,{}),a.isError&&e.jsx(qe,{title:"Could not load the comments",children:a.error.message}),a.isSuccess&&I.length===0&&!O&&e.jsx("div",{className:"mx-auto max-w-[560px] py-8",children:e.jsxs(qe,{icon:e.jsx(Pt,{className:"size-5"}),title:"No comments yet",children:[e.jsxs("p",{className:"m-0",children:["When someone leaves a comment on ",p.name," it appears here, grouped by page."]}),e.jsx("div",{className:"mt-4 text-left",children:e.jsx(Mt,{uid:s})})]})}),a.isSuccess&&I.length>0&&F.length===0&&e.jsx(qe,{title:"Nothing matches",action:e.jsx($,{variant:"outline",size:"sm",onClick:()=>C({status:void 0,page:void 0,q:void 0,assignee:void 0,by:void 0}),children:"Show all"}),children:"No comment matches that filter."}),Z&&a.isSuccess&&F.length>0&&e.jsx(vn,{columns:G,uid:s,selectedId:d?.id??null,onMove:(t,i)=>P.mutate({id:t,status:i})}),!Z&&ve.map(([t,i])=>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:[t," ",e.jsxs("span",{className:"font-sans text-muted-foreground",children:["· ",i.length]})]}),i.map(S=>e.jsx(bn,{t:S,uid:s,on:d?.id===S.id,picked:q.has(S.id),picking:q.size>0,onPick:Y=>U(le=>{const ee=new Set(le);return Y?ee.add(S.id):ee.delete(S.id),ee})},S.id))]},t))]}),d&&e.jsxs("div",{className:"flex min-h-0 flex-col overflow-hidden bg-card",children:[e.jsx("div",{className:"lg:hidden",children:e.jsxs($,{variant:"ghost",size:"sm",className:"m-2",onClick:()=>C({thread:void 0}),children:[e.jsx(Dt,{}),"Back to the list"]})}),e.jsx(on,{thread:d,site:{name:p.name,...rs(l.data)?{origin:rs(l.data)}:{}},onStatus:t=>P.mutate({id:d.id,status:t}),onReply:t=>k.mutateAsync({id:d.id,body:t}),replying:k.isPending,pool:h,onAssign:t=>b.mutate({id:d.id,assignee:t}),onAddPerson:t=>z.mutateAsync(t),trackers:(m.data?.data??[]).map(t=>t.provider),...ze(o.user.role,"settings")?{onCreateIssue:t=>T.mutate({id:d.id,provider:t})}:{},creatingIssue:T.isPending?T.variables?.provider:void 0,onEditComment:(t,i)=>v.mutateAsync({threadId:d.id,commentId:t,body:i}),onDeleteComment:t=>D.mutateAsync({threadId:d.id,commentId:t}),moderator:W,...W||ze(o.user.role,"review")&&ie(d)?{onDeleteThread:async()=>{await Q.mutateAsync(d.id),C({thread:void 0})}}:{},...B.length?{move:{rounds:B,busy:M.isPending,onMove:t=>X([d.id],t)}}:{},onClose:()=>C({thread:void 0})})]})]})]})}function fn(s,n){return s?s==="unassigned"?"Unassigned":s==="me"?"Me":n.find(r=>r.id===s)?.name??"Assignee":"Assignee"}function os(s){return s.trim().toLowerCase()}function We(s){return s.anchor?.page?.route??s.route??"/"}function Se(s){return A("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 Ue({on:s,onClick:n,children:r}){return e.jsx("button",{type:"button",className:Se(s),"aria-pressed":s,onClick:n,children:r})}function gn({value:s,onChange:n}){const[r,o]=x.useState(s);return e.jsxs("form",{className:"relative",onSubmit:p=>{p.preventDefault(),n(r.trim())},children:[e.jsx(Nt,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),e.jsx(Pe,{type:"search","aria-label":"Search comments",placeholder:"Search",value:r,onChange:p=>o(p.target.value),onBlur:()=>r.trim()!==s&&n(r.trim()),className:"h-7 w-[170px] pl-7 text-[12.5px]"})]})}function bn({t:s,uid:n,on:r,picked:o,picking:p,onPick:l}){const c=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:A("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:A("flex items-center",!p&&"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),children:e.jsx(sn,{checked:o,onCheckedChange:m=>l(!!m),"aria-label":`Select ${s.key}`})}),e.jsxs(us,{to:"/s/$site/comments",params:{site:n},search:m=>({...m,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:[c,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(ge,{className:"size-5",title:`Assigned to ${s.assignee.name}`,children:e.jsx(be,{className:A("text-[9px] font-semibold",s.assignee.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(s.assignee.name)})}),e.jsx(ds,{status:s.status}),e.jsx("span",{className:"w-11 whitespace-nowrap text-right",children:Be(s.updatedAt)})]})]})]})}function jn(){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(Ne,{className:"h-3 w-16"})}),[70,55,80,62].map((s,n)=>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(Ne,{className:"h-3 w-10"}),e.jsx(Ne,{className:"h-3",style:{width:`${s}%`}}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(Ne,{className:"h-3 w-11"}),e.jsx(Ne,{className:"h-[18px] w-16 rounded-full"})]})]},n))]})}function vn({columns:s,uid:n,selectedId:r,onMove:o}){const[p,l]=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:c,items:y})=>e.jsxs("section",{"aria-label":fe[c],onDragOver:m=>{m.preventDefault(),l(c)},onDragLeave:()=>l(m=>m===c?null:m),onDrop:m=>{m.preventDefault(),l(null);const h=m.dataTransfer.getData("text/plain");h&&o(h,c)},className:A("flex w-[280px] shrink-0 flex-col rounded-lg border border-border bg-muted/40",p===c&&"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:A("size-[7px] rounded-full",Ss[c])}),fe[c],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(m=>e.jsxs(us,{to:"/s/$site/comments",params:{site:n},search:h=>({...h,thread:m.key}),draggable:!0,onDragStart:h=>{h.dataTransfer.setData("text/plain",m.id),h.dataTransfer.effectAllowed="move"},className:A("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===m.id&&"border-brand ring-1 ring-brand"),children:[e.jsx("span",{className:"line-clamp-3 text-[13px]",children:m.comments[0]?.body??(typeof m.anchor?.label=="string"?m.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:m.key}),e.jsx("span",{className:"truncate",children:We(m)}),e.jsx("span",{className:"flex-1"}),m.assignee&&e.jsx(ge,{className:"size-4",title:`Assigned to ${m.assignee.name}`,children:e.jsx(be,{className:A("text-[8px] font-semibold",m.assignee.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(m.assignee.name)})}),e.jsx("span",{children:Be(m.updatedAt)})]})]},m.id))]})]},c))})}export{Jn as component,Us as isStatus};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aX as S,r as g,j as e,a4 as P,B as v,_ as R,ab as E,aY as F,q as M,a7 as T,h as U,aZ as $,F as C,ad as B,L as z,I as H,J as k}from"./index-C7KR1inc.js";import{u as A}from"./useQuery-Cgt__oKH.js";import{u as Y,a as q,C as D}from"./zod-BZsHesp0.js";import{P as I}from"./Picker-B42iZVoy.js";import{X as V,i as X,j as J,l as K,k as O,m as Q,n as Z}from"./dialog-DMLR5Ann.js";import{L as N,I as _}from"./label-Blp9UOAu.js";import{T as G,a as W,b as L,c as f,d as ee,e as j}from"./table-CMT1vo3l.js";import{C as se}from"./ConfirmDialog-InDeLqVY.js";import{C as te}from"./CopyButton-CuM8jLD2.js";import{s as ae}from"./address-C-21UTZG.js";import{u as ne}from"./me-BK0rftp3.js";import{C as re}from"./check-BoeukqKC.js";import{U as ie}from"./users-bHIFUIgt.js";import{P as oe}from"./plus-DZmzLC79.js";import"./useBaseQuery-C-W7OQbv.js";import"./chevron-down-BI3rT8EZ.js";import"./useScrollLock-BJQ8REVY.js";import"./inertValue-CI-rS9np.js";import"./createBaseUIEventDetails-DxVYwN0n.js";import"./isElementDisabled-CwHw_lZC.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-Pz2Tfnzh.js";import"./getPseudoElementBounds-DzoINCkV.js";import"./CompositeList-BzeA8yRv.js";import"./copy-DvA576Ce.js";function Me(){const{site:s}=S.useParams(),{site:l}=S.useRouteContext(),r=A(C.links(s)),d=A(C.origins(s)),[p,m]=g.useState(!1),[t,a]=g.useState(null);g.useEffect(()=>a(null),[s]);const i=r.data?.data??[],o=ae(d.data),c=d.isSuccess&&!o,x=t?o?`${o}/${t.fragment}`:t.fragment:"",b=e.jsxs(v,{onClick:()=>m(!0),children:[e.jsx(oe,{}),"Add reviewer"]});return e.jsxs("div",{className:"p-7",children:[e.jsx(P,{title:"Reviewers",sub:`Each reviewer gets their own link to ${l.name}`,actions:b}),t&&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(re,{className:"size-4 shrink-0 text-ok"}),e.jsxs("div",{className:"shrink-0",children:[e.jsxs("b",{className:"font-semibold",children:[t.name," added."]})," ",e.jsx("span",{className:"text-ink-soft",children:o?"Share this link — it is shown once.":"Put your site's address in front of this, then share it — 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:x}),e.jsx(te,{text:x,label:"Copy link",withText:!0}),e.jsx(v,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss",onClick:()=>a(null),children:e.jsx(V,{})})]}),r.isSuccess&&i.length===0?e.jsx(R,{className:"max-w-[1040px]",children:e.jsx(E,{icon:e.jsx(ie,{className:"size-5"}),title:"No reviewers yet",action:b,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(G,{children:[e.jsx(W,{children:e.jsxs(L,{children:[e.jsx(f,{children:"Name"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Uses"}),e.jsx(f,{children:"Last seen"}),e.jsx(f,{className:"w-0"})]})}),e.jsx(ee,{children:i.map(u=>e.jsx(de,{link:u,uid:s,onRevoked:()=>a(w=>w?.id===u.id?null:w)},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(me,{uid:s,open:p,onOpenChange:m,onMinted:a,noAddress:c})]})}function de({link:s,uid:l,onRevoked:r}){const d=F(l),p=M(ne().user.role,"settings"),[m,t]=g.useState(!1),a=!!s.revokedAt,i=!a&&new Date(s.expiresAt).getTime()<=Date.now(),o=a||i,c=Math.max(0,Math.ceil((new Date(s.expiresAt).getTime()-Date.now())/864e5));return e.jsxs(L,{className:U(o&&"text-muted-foreground"),children:[e.jsx(j,{className:"font-medium",children:s.name}),e.jsx(j,{children:a?e.jsxs("span",{children:["Revoked ",T(s.revokedAt)]}):i?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:[!a&&p&&e.jsx(v,{variant:"ghost",size:"sm",onClick:()=>t(!0),children:"Revoke"}),e.jsx(se,{open:m,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:d.isPending,onConfirm:()=>{t(!1),r(),d.mutate(s.id)}})]})]})}const le=H({name:k().trim().min(1,"Their name"),days:k(),roundId:k().optional()});function me({uid:s,open:l,onOpenChange:r,onMinted:d,noAddress:p}){const m=$(s),t=A({...C.rounds(s),enabled:l}),[a,i]=g.useState(""),{register:o,handleSubmit:c,formState:x,reset:b,control:u}=Y({resolver:q(le),defaultValues:{days:"14",roundId:""}}),w=c(async n=>{i("");const h=Number(n.days);try{const y=await m.mutateAsync({name:n.name,...Number.isFinite(h)&&h>0?{expiresAt:new Date(Date.now()+h*864e5).toISOString()}:{},...n.roundId?{roundId:n.roundId}:{}});d(y),b(),r(!1)}catch(y){i(B(y))}});return e.jsx(X,{open:l,onOpenChange:r,children:e.jsx(J,{children:e.jsxs("form",{onSubmit:w,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(K,{children:[e.jsx(O,{children:"New reviewer"}),e.jsx(Q,{children:"Your client's name, as you will see it on their comments. A link is generated once and shown to you once."})]}),p&&e.jsxs("p",{className:"m-0 rounded-md border border-border bg-warn-soft px-3 py-2 text-[13px]",children:["This site has no address yet, so the link will be only its last part, to put after the site's address yourself."," ",e.jsx(z,{to:"/s/$site/settings",params:{site:s},className:"font-medium text-brand hover:underline",children:"Add its domain in Site settings"})," ","first for a whole 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(N,{htmlFor:"reviewer-name",children:"Name"}),e.jsx(_,{id:"reviewer-name",placeholder:"Marta, Kilnwork","aria-invalid":!!x.errors.name,...o("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(N,{htmlFor:"reviewer-days",children:"Link expires in"}),e.jsx(D,{control:u,name:"days",render:({field:n})=>e.jsx(I,{id:"reviewer-days",value:String(n.value),onChange:n.onChange,options:[{value:"7",label:"7 days"},{value:"14",label:"14 days"},{value:"30",label:"30 days"},{value:"90",label:"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.jsx(D,{control:u,name:"roundId",render:({field:n})=>e.jsx(I,{id:"reviewer-round",value:n.value??"",onChange:n.onChange,options:[{value:"",label:"Any round"},...t.data.data.map(h=>({value:h.id,label:h.name}))]})})]}),e.jsxs(Z,{children:[e.jsx(v,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(v,{type:"submit",loading:x.isSubmitting,children:x.isSubmitting?"Adding…":"Add reviewer"})]})]})})})}export{Me as component};
|