use-chisel 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/hosted-entry.js +4 -133
- package/dist/index.js +5 -168
- package/dist/review-content-entry.js +2 -2
- package/dist/review-entry.js +3 -3
- package/dist/workspace-entry.js +7 -346
- package/package.json +4 -4
- package/dist/persistence.d.ts +0 -30
- package/dist/review/media-lightbox.d.ts +0 -8
- package/dist/theme.d.ts +0 -1
- package/dist/workspace/area.d.ts +0 -10
- package/dist/workspace/color-picker.d.ts +0 -6
- package/dist/workspace/color.d.ts +0 -9
- package/dist/workspace/comment-drag-handle.d.ts +0 -3
- package/dist/workspace/composer-position.d.ts +0 -13
- package/dist/workspace/confirmation.d.ts +0 -11
- package/dist/workspace/hover-dismiss.d.ts +0 -4
- package/dist/workspace/mode-shortcuts.d.ts +0 -1
- package/dist/workspace/page-control.d.ts +0 -7
- package/dist/workspace/preview-navigation.d.ts +0 -4
- package/dist/workspace/thread-morph.d.ts +0 -1
package/dist/workspace-entry.js
CHANGED
|
@@ -1,352 +1,13 @@
|
|
|
1
|
-
"use client";import{jsx as u,jsxs as x,Fragment as ga}from"react/jsx-runtime";import{useEffect as Pe,useLayoutEffect as za,useRef as W,useState as R}from"react";import{forwardRef as zo,createElement as No}from"react";var yt=a=>a?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function vt(a,t,r=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:yt(a),size:24,node:t,...r.length>0?{aliases:r}:{}}}var Pt=a=>{let t="",r=!1;for(let o of a){if(o==="-"||o==="_"||o<=" "){r=t.length>0;continue}t.length===0?t+=o.toLowerCase():t+=r?o.toUpperCase():o,r=!1}return t};var Dt=a=>{let t=Pt(a);return t.charAt(0).toUpperCase()+t.slice(1)};import{forwardRef as Eo,createElement as Rt}from"react";var ea=(...a)=>a.filter((t,r,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===r).join(" ").trim();var Fe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function ja(a){return a!=null}function At(a,t={}){let r=t.attributeNames??{},o=S=>r[S]??S,l=a.size??a.width??Fe.width,f=a.size??a.height??Fe.height,i=a.aliases?.filter(S=>typeof S=="string"&&S.trim()!=="").map(S=>`lucide-${S}`)??[],p=[...a.name?[`lucide-${a.name}`]:[],...i],C=t.className?.split(" ").filter(Boolean)??[],v=t.includeDefaultClasses===!1?ea(...C):ea("lucide",...p,...C),w=t.absoluteStrokeWidth?Number(t.strokeWidth??Fe["stroke-width"])*Number(a.size??a.width??Fe.width)/Number(t.size??t.width??Fe.width):t.strokeWidth??Fe["stroke-width"];return["svg",{...Object.entries(Fe).reduce((S,[b,T])=>(S[o(b)]=T,S),{}),..."color"in t&&t.color&&{[o("stroke")]:t.color},..."size"in t&&ja(t.size)&&{[o("width")]:t.size,[o("height")]:t.size},..."width"in t&&ja(t.width)&&{[o("width")]:t.width},..."height"in t&&ja(t.height)&&{[o("height")]:t.height},[o("stroke-width")]:w,...v&&{[o("class")]:v},[o("viewBox")]:`0 0 ${l} ${f}`,...t.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},a.node.map(S=>{let[b,T,E]=S,j=t.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...T}:T;return E?[b,j,E]:[b,j]})]}function Bt(a,t={}){return At(a,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var Mt=a=>{for(let t in a)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};import{createContext as Uo,useContext as Ho,useMemo as Sr,createElement as wr}from"react";var Oo=Uo({});var Ft=()=>Ho(Oo);var Tt=Eo(({color:a,size:t,width:r,height:o,strokeWidth:l,absoluteStrokeWidth:f,nonScalingStroke:i,className:p="",children:C,iconNode:v=[],icon:w={node:v,aliases:[],size:24},...P},S)=>{let{size:b=24,strokeWidth:T=2,absoluteStrokeWidth:E=!1,nonScalingStroke:j=!1,color:_="currentColor",className:de=""}=Ft()??{},A=!!C||Mt(P),[N,c,g=[]]=Bt(w,{color:a??_,width:r??t??b,height:o??t??b,strokeWidth:l??T,absoluteStrokeWidth:f??E,nonScalingStroke:i??j,className:ea(de,p),hasA11yProp:A,attributes:P});return Rt(N,{ref:S,...c},[...g.map(([le,m])=>Rt(le,m)),...Array.isArray(C)?C:[C]])});function k(a,t=[],r=[]){let o=typeof a=="string"?vt(a,t,r):a,l=zo(({className:f,...i},p)=>No(Tt,{ref:p,icon:o,className:f,...i}));return o.name&&(l.displayName=Dt(o.name)),l}var qt={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};qt.node;var aa=k(qt);var Ut={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};Ut.node;var ta=k(Ut);var Ht={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};Ht.node;var Oe=k(Ht);var Ot={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};Ot.node;var oa=k(Ot);var Et={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};Et.node;var Ee=k(Et);var zt={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};zt.node;var Re=k(zt);var Nt={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};Nt.node;var ra=k(Nt);var Gt={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};Gt.node;var da=k(Gt);var Wt={name:"grip-horizontal",size:24,node:[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]};Wt.node;var la=k(Wt);var Vt={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};Vt.node;var ua=k(Vt);var Xt={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};Xt.node;var Te=k(Xt);var Kt={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};Kt.node;var sa=k(Kt);var $t={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};$t.node;var Ke=k($t);var Zt={name:"mouse-pointer-2",size:24,node:[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]};Zt.node;var ia=k(Zt);var jt={name:"pencil",size:24,node:[["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"}]]};jt.node;var $e=k(jt);var _t={name:"pipette",size:24,node:[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]};_t.node;var fa=k(_t);var Jt={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};Jt.node;var na=k(Jt);var Qt={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};Qt.node;var ca=k(Qt);var Yt={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};Yt.node;var ze=k(Yt);var eo={name:"trash",size:24,node:[["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"}]],aliases:["trash-2"]};eo.node;var qe=k(eo);var ao={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};ao.node;var pa=k(ao);import{jsx as F,jsxs as re,Fragment as Xo}from"react/jsx-runtime";import{useEffect as io,useId as Ko,useState as ve}from"react";import{jsx as xe,jsxs as ma}from"react/jsx-runtime";import{useEffect as Go,useRef as oo,useState as Ze}from"react";import{createPortal as Wo}from"react-dom";function to(a,t,r,o=1){a/=255,t/=255,r/=255;let l=Math.max(a,t,r),f=Math.min(a,t,r),i=l-f;return{h:(i?l===a?((t-r)/i+6)%6:l===t?(r-a)/i+2:(a-t)/i+4:0)*60,s:l?i/l:0,v:l,a:o}}function Ba({h:a,s:t,v:r,a:o}){let l=f=>{let i=(f+a/60)%6;return Math.round(255*r*(1-t*Math.max(0,Math.min(i,4-i,1)))).toString(16).padStart(2,"0")};return`#${l(5)}${l(3)}${l(1)}${o<1?Math.round(o*255).toString(16).padStart(2,"0"):""}`}function Ma(a){if(typeof document<"u"){let t=document.createElement("canvas");t.width=t.height=1;let r=t.getContext("2d");if(r){r.fillStyle=a,r.fillRect(0,0,1,1);let[o,l,f,i]=r.getImageData(0,0,1,1).data;return to(o,l,f,i/255)}}return to(0,0,0)}function _a({label:a,value:t,onChange:r,disabled:o}){let l=oo(null),f=oo(null),[i,p]=Ze(null),[C,v]=Ze({h:0,s:0,v:0,a:1}),[w,P]=Ze(""),[S,b]=Ze(!1),[T,E]=Ze(!1),[j,_]=Ze(!1);function de(){p(null)}Go(()=>{if(!i)return;let c=q=>{!f.current?.contains(q.target)&&!l.current?.contains(q.target)&&de()},g=q=>{q.key==="Escape"&&(q.preventDefault(),q.stopPropagation(),de(),l.current?.focus())},le=l.current?.getBoundingClientRect(),m=q=>{if(f.current?.contains(q.target))return;let X=l.current?.getBoundingClientRect();(X?.top!==le?.top||X?.left!==le?.left)&&de()};return document.addEventListener("pointerdown",c),document.addEventListener("keydown",g,!0),window.addEventListener("resize",de),document.addEventListener("scroll",m,!0),f.current?.querySelector("input")?.focus({preventScroll:!0}),()=>{document.removeEventListener("pointerdown",c),document.removeEventListener("keydown",g,!0),window.removeEventListener("resize",de),document.removeEventListener("scroll",m,!0)}},[i]);function A(c){c.a===0&&(c={...c,a:1}),v(c);let g=Ba(c);P(g.slice(1).toUpperCase()),b(!1),r(g)}function N(c){let g=c.currentTarget.getBoundingClientRect();A({...C,s:Math.max(0,Math.min(1,(c.clientX-g.left)/g.width)),v:1-Math.max(0,Math.min(1,(c.clientY-g.top)/g.height))})}return ma("div",{className:"comment-box-color",children:[xe("button",{ref:l,className:"comment-color-trigger",type:"button","aria-label":`${a} picker`,"aria-haspopup":"dialog","aria-expanded":!!i,disabled:o,onClick:()=>{if(i){de();return}let c=Ma(t);v(c),P(Ba(c).slice(1).toUpperCase()),b(!1),E("EyeDropper"in window);let g=l.current.getBoundingClientRect();p({left:Math.max(8,Math.min(g.right-256,window.innerWidth-264)),top:Math.max(8,Math.min(g.bottom+8,window.innerHeight-330))})},children:xe("span",{style:{background:t}})}),xe("span",{className:"comment-color-value",title:t,children:t}),i&&Wo(ma("div",{ref:f,className:"chisel-color-picker",role:"dialog","aria-label":`${a} color picker`,style:i,onKeyDown:c=>{if(c.key!=="Tab")return;let g=Array.from(f.current.querySelectorAll("button:not(:disabled), input:not(:disabled)"));c.shiftKey&&document.activeElement===g[0]?(c.preventDefault(),g[g.length-1]?.focus()):!c.shiftKey&&document.activeElement===g[g.length-1]&&(c.preventDefault(),g[0]?.focus())},children:[ma("div",{className:"chisel-color-plane",style:{backgroundColor:`hsl(${C.h} 100% 50%)`},onPointerDown:c=>{c.currentTarget.setPointerCapture(c.pointerId),N(c)},onPointerMove:c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&N(c)},children:[xe("span",{className:"chisel-color-thumb",style:{left:`${C.s*100}%`,top:`${(1-C.v)*100}%`,background:Ba({...C,a:1})}}),xe("input",{className:"chisel-color-accessible",type:"range","aria-label":`${a} saturation`,min:0,max:100,value:Math.round(C.s*100),onChange:c=>A({...C,s:Number(c.target.value)/100})}),xe("input",{className:"chisel-color-accessible",type:"range","aria-label":`${a} brightness`,min:0,max:100,value:Math.round(C.v*100),onChange:c=>A({...C,v:Number(c.target.value)/100})})]}),ma("div",{className:"chisel-color-tools",children:[xe("input",{className:"chisel-color-hue",type:"range","aria-label":`${a} hue`,min:0,max:360,value:Math.round(C.h),style:{"--hue":`hsl(${C.h} 100% 50%)`},onChange:c=>A({...C,h:Number(c.target.value)})}),xe("button",{type:"button","aria-label":`Pick ${a.toLowerCase()} from screen`,title:T?"Pick a color from the screen":"Screen color picker is not supported in this browser",disabled:!T||j,onClick:async()=>{let c=window.EyeDropper;if(c){_(!0);try{let g=await new c().open();f.current&&A(Ma(g.sRGBHex))}catch{}finally{_(!1)}}},children:xe(fa,{size:18})})]}),ma("label",{className:"chisel-color-hex",children:["HEX",xe("input",{"aria-label":`${a} hex`,value:w,maxLength:9,spellCheck:!1,"aria-invalid":S,onChange:c=>{let g=c.target.value.replace(/^#/,"");P(g);let le=/^(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(g);if(b(!le),le){let m=Ma(`#${g}`);v(m),r(`#${g}`)}}})]}),S&&xe("span",{className:"chisel-color-error",role:"status",children:"Enter a valid hex color."})]}),document.body)]})}import{jsx as ro}from"react/jsx-runtime";import{useRef as Vo}from"react";function ha({onMoveStart:a}){let t=Vo(null);function r(o,l,f){let i=o.closest(".comment-box,.comment-thread"),p=i?.closest(".feedback-viewport");if(!i||!p)return;let C=p.getBoundingClientRect(),v=i.getBoundingClientRect();for(let[w,P]of[["x",Math.max(C.left+8-v.left,Math.min(l,C.right-8-v.right))],["y",Math.max(C.top+8-v.top,Math.min(f,C.bottom-8-v.bottom))]]){let S=`--comment-drag-${w}`;i.style.setProperty(S,`${(parseFloat(i.style.getPropertyValue(S))||0)+P}px`)}}return ro("button",{type:"button",className:"comment-window-drag","aria-label":"Move comment window",title:"Drag to move \xB7 Arrow keys to nudge",onPointerDown:o=>{!o.isPrimary||o.button!==0||(o.preventDefault(),a?.(),o.currentTarget.closest(".comment-box,.comment-thread")?.getAnimations().forEach(l=>l.cancel()),o.currentTarget.setPointerCapture(o.pointerId),t.current={id:o.pointerId,x:o.clientX,y:o.clientY},o.currentTarget.dataset.dragging="true")},onPointerMove:o=>{let l=t.current;!l||l.id!==o.pointerId||(r(o.currentTarget,o.clientX-l.x,o.clientY-l.y),l.x=o.clientX,l.y=o.clientY)},onPointerUp:o=>{o.currentTarget.hasPointerCapture(o.pointerId)&&o.currentTarget.releasePointerCapture(o.pointerId)},onLostPointerCapture:o=>{t.current=null,delete o.currentTarget.dataset.dragging},onKeyDown:o=>{let l={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[o.key];if(!l)return;o.preventDefault(),o.stopPropagation(),a?.();let f=o.shiftKey?40:10;r(o.currentTarget,l[0]*f,l[1]*f)},children:ro(la,{size:16,"aria-hidden":"true"})})}function lo(a,t,r,o){let l={[a]:t},f=r.find(i=>i!==a);if(!f||!r.includes(a))return l;if(r.includes("width")){let i=parseFloat(o.width)/parseFloat(o.height),p=parseFloat(t);if(!Number.isFinite(i)||i<=0||!Number.isFinite(p))return l;l[f]=`${a==="width"?p/i:p*i}px`}else l[f]=t;return l}var uo=new Set(["color","background-color","opacity","font-family","font-size","font-weight","border-color","border-width","width","height",...["padding","margin"].flatMap(a=>["top","right","bottom","left"].map(t=>`${a}-${t}`))]);function so(a,t){let r={...a},o={...a};for(let l of Array.isArray(t)?t:[])!l||!Object.prototype.hasOwnProperty.call(a,l.property)||typeof l.before!="string"||typeof l.after!="string"||l.property!=="text"&&(!uo.has(l.property)||!CSS.supports(l.property,l.after))||(r[l.property]=l.before,o[l.property]=l.after);return{initial:r,values:o}}function Fa(a,t){if(!Array.isArray(t))return()=>{};let r=a.style,o=a.getAttribute("style"),l=a.textContent,f=!1;for(let p of t)!p||typeof p.after!="string"||(p.property==="text"&&!a.children.length?(a.textContent=p.after,f=!0):r&&uo.has(p.property)&&CSS.supports(p.property,p.after)&&r.setProperty(p.property,p.after,"important"));let i=!1;return()=>{i||(i=!0,o===null?a.removeAttribute("style"):a.setAttribute("style",o),f&&!a.children.length&&(a.textContent=l))}}var no=[["Text color","color","color"],["Background","background-color","color"],["Opacity","opacity","number"],["Font","font-family","font"],["Font size","font-size","number"],["Font weight","font-weight","weight"],["Border color","border-color","color"],["Border width","border-width","number"]],$o=["top","bottom","left","right"],fo=[{label:"Size",pairs:[["width","height"]]},...["padding","margin"].map(a=>({label:a[0].toUpperCase()+a.slice(1),pairs:[[`${a}-top`,`${a}-bottom`],[`${a}-left`,`${a}-right`]]}))];function Zo(a){let t=a.ownerDocument.defaultView.getComputedStyle(a);return Object.fromEntries([["text",a.children.length?"":a.textContent??""],...["width","height"].map(r=>[r,t.getPropertyValue(r)]),...no.map(([,r])=>[r,t.getPropertyValue(r)]),...["padding","margin"].flatMap(r=>$o.map(o=>[`${r}-${o}`,t.getPropertyValue(`${r}-${o}`)]))])}function Ja({target:a,text:t,onText:r,onCancel:o,onPost:l,style:f,changes:i=[],editing:p=!1,commentId:C,renderComposer:v,hasExistingAttachments:w=!1,onDraftChange:P,hidden:S=!1}){let[b]=ve(()=>so(a?Zo(a):{},i)),T=b.initial,[E,j]=ve(b.values),[_]=ve(()=>({style:a?.getAttribute("style")??null,text:a?.textContent??null})),[de,A]=ve({}),[N,c]=ve(!1),[g]=ve(t),[le,m]=ve(!1),[z,q]=ve(""),[X,De]=ve(!1),$=Ko();function ue(){a&&(_.style===null?a.removeAttribute("style"):a.setAttribute("style",_.style),a.children.length||a.replaceChildren(a.ownerDocument.createTextNode(_.text??"")))}function K(){ue(),o()}io(()=>(a&&Fa(a,i),ue),[a,_]);function ge(U,J){if(!a)return;if(U==="text"){j(D=>({...D,text:J})),a.children.length||a.replaceChildren(a.ownerDocument.createTextNode(J));return}let fe=fo.flatMap(D=>D.pairs).find(D=>D.includes(U)&&de[D.join(":")]),Q=fe?lo(U,J,fe,T):{[U]:J};j(D=>({...D,...Q}));for(let[D,B]of Object.entries(Q))CSS.supports(D,B)&&a.style.setProperty(D,B,"important")}let Ae=Object.entries(E).some(([U,J])=>J!==T[U]),We=!!(t.trim()||Ae||le||p&&t!==g);io(()=>(P?.(We),()=>P?.(!1)),[We,P]);async function ae(U=t,J,fe,Q){if(N||!U.trim()&&!fe?.length&&!w)return!1;let D=Object.entries(E).filter(([B,L])=>L!==T[B]).map(([B,L])=>({property:B,before:T[B],after:L}));if(D.some(B=>B.property!=="text"&&!CSS.supports(B.property,B.after)))return q("Check the style values before posting."),!1;c(!0),q("");try{let B=await l(D,U.trimEnd(),J,fe,Q);return B?K():q("Could not post. Your changes are still here; please try again."),B}catch{return q("Could not post. Please try again."),!1}finally{c(!1)}}let je=(U,J=!1,fe=!1,Q)=>re(Xo,{children:[re("div",{className:"comment-box-prompt",children:[a&&F("button",{type:"button",className:"comment-box-symbol","aria-label":"Comment settings",title:"Comment settings","aria-expanded":X,"aria-controls":$,disabled:N,onClick:()=>De(D=>!D),children:F(ze,{})}),U]}),a&&re("div",{className:"comment-box-settings",id:$,hidden:!X,children:[re("div",{className:"comment-box-element",children:[re("code",{children:["<",a.tagName.toLowerCase(),">"]}),Ae&&F("span",{className:"comment-box-preview-status",role:"status",children:"Unsaved preview"}),F(ha,{})]}),re("fieldset",{className:"comment-box-properties",disabled:N||!X,children:[re("label",{className:"comment-box-row",children:[F("span",{children:"Text"}),F("input",{"aria-label":"Element text",value:E.text,disabled:!!a.children.length,title:a.children.length?"Select a text-only element to change its text":void 0,onChange:D=>ge("text",D.target.value)})]}),["Typography","Appearance"].map(D=>re("div",{className:"comment-box-control-group",children:[F("h3",{children:D}),no.filter(([,B])=>D==="Typography"===["color","font-family","font-size","font-weight"].includes(B)).map(([B,L,ie])=>re("div",{className:"comment-box-row",children:[F("span",{children:B}),ie==="color"?X&&F(_a,{label:B,value:E[L],disabled:N,onChange:M=>ge(L,M)}):ie==="font"?F("select",{"aria-label":B,value:E[L],onChange:M=>ge(L,M.target.value),children:Array.from(new Set([T[L],"Arial, sans-serif","Georgia, serif","system-ui","monospace"])).map(M=>F("option",{value:M,children:M},M))}):ie==="weight"?F("select",{"aria-label":B,value:E[L],onChange:M=>ge(L,M.target.value),children:Array.from(new Set([T[L],...[100,200,300,400,500,600,700,800,900].map(String)])).map(M=>F("option",{children:M},M))}):re("div",{className:"comment-box-number",children:[F("input",{type:"number","aria-label":B,value:Number.isFinite(parseFloat(E[L]))?parseFloat(E[L]):"",min:0,max:L==="opacity"?1:void 0,step:"any",onChange:M=>ge(L,M.target.value+(L==="opacity"?"":"px"))}),L!=="opacity"&&F("span",{children:"px"})]})]},L))]},D)),fo.map(D=>re("details",{className:"comment-box-group",open:!0,children:[re("summary",{children:[D.label,F(Ee,{size:12,"aria-hidden":"true"})]}),D.pairs.map(B=>{let L=B.join(":"),ie=D.label==="Size"?"Lock aspect ratio":`Link ${D.label.toLowerCase()} ${B[0].split("-")[1]} and ${B[1].split("-")[1]}`;return re("div",{className:"comment-box-pair",children:[F("button",{className:"comment-box-link",type:"button","aria-label":ie,title:ie,"aria-pressed":!!de[L],onClick:()=>A(M=>({...M,[L]:!M[L]})),children:F(ua,{size:12})}),B.map(M=>{let Ve=M.includes("-")?M.split("-")[1]:M;return re("label",{className:"comment-box-row",children:[F("span",{children:Ve[0].toUpperCase()+Ve.slice(1)}),re("span",{className:"comment-box-number",children:[F("input",{type:"number",step:"any",min:M.startsWith("margin-")?void 0:0,"aria-label":M.replace("-"," ").replace(/^width$/,"Width").replace(/^height$/,"Height"),value:Number.isFinite(parseFloat(E[M]))?parseFloat(E[M]):"",onChange:Ga=>ge(M,`${Ga.target.value}px`)}),F("span",{children:"px"})]})]},M)})]},L)})]},D.label))]})]}),z&&F("p",{className:"comment-box-error",role:"alert",children:z}),re("footer",{className:"comment-box-footer",children:[F("button",{type:"button",className:"comment-box-cancel",onClick:K,disabled:N,children:"Cancel"}),F("span",{}),Q,F("button",{type:"submit",className:"comment-box-submit","aria-label":p?"Save comment":"Post comment",title:p?"Save comment":"Post comment",disabled:N||fe||!t.trim()&&!J&&!w,children:N?F("span",{className:"comment-box-saving"}):F(Oe,{})})]})]}),se=`comment-box${v?" comment-box-native":""}`,_e=U=>{U.key==="Escape"&&!N&&(U.preventDefault(),U.stopPropagation(),K())};return v?F("div",{className:se,hidden:S,"data-settings-open":X,style:f,onKeyDown:_e,children:v({text:t,onText:r,disabled:N,commentId:C,onAttachmentDraftChange:m,onSubmit:ae,renderContent:je})}):F("form",{className:se,hidden:S,"data-settings-open":X,style:f,"aria-label":p?"Edit comment":"New comment",onKeyDown:_e,onSubmit:U=>{U.preventDefault(),ae()},children:je(F("input",{"aria-label":"Comment",placeholder:"Leave a comment\u2026",value:t,onChange:U=>r(U.target.value),autoFocus:!0,maxLength:4e3,required:!0,disabled:N}))})}import{jsx as Le,jsxs as Ge,Fragment as jo}from"react/jsx-runtime";import{useEffect as _o,useLayoutEffect as Jo,useRef as Ta,useState as qa}from"react";function Ne(a,t,r="/"){if(!a.trim())return null;try{let o=new URL(a.trim(),new URL(r,t)),l=decodeURIComponent(o.pathname);return!/^https?:$/.test(o.protocol)||o.origin!==t||o.username||o.password||/^\/(chisel|feedback)(\/|$)/.test(l)?null:o.pathname+o.search+o.hash}catch{return null}}function Ra(a){return a.split(/[?#]/,1)[0]}function Qa(a){try{let{pathname:t,search:r,hash:o}=a.location;return t.startsWith("/")?t+r+o:null}catch{return null}}function co(a,t){let r;try{r=a.history}catch{return()=>{}}let o=r.pushState,l=r.replaceState,f=!0,i=()=>{let v=Qa(a);f&&v!==null&&t(v)},p=function(...v){o.apply(this,v),i()},C=function(...v){l.apply(this,v),i()};return r.pushState=p,r.replaceState=C,a.addEventListener("popstate",i),a.addEventListener("hashchange",i),i(),()=>{f=!1,r.pushState===p&&(r.pushState=o),r.replaceState===C&&(r.replaceState=l),a.removeEventListener("popstate",i),a.removeEventListener("hashchange",i)}}function Ya({path:a,routes:t,disabled:r,onNavigate:o,onOpen:l}){let f=Ta(null),i=Ta(null),p=Ta(null),C=Ta(!1),[v,w]=qa(!1),[P,S]=qa(""),[b,T]=qa(!1),[E,j]=qa(""),_=Ra(a),de=[...new Set([a,...t].map(Ra))],A=P.trim();if(/^https?:\/\//i.test(A))try{let m=new URL(A);m.origin===window.location.origin&&(A=m.pathname)}catch{}else A=Ra(A);let N=A.toLocaleLowerCase(),c=de.filter(m=>m.toLocaleLowerCase().includes(N));function g(m=!1){f.current&&(f.current.open=!1),w(!1),m&&i.current?.focus({preventScroll:!0})}Jo(()=>{if(!v)return;let m=()=>{let z=f.current,q=z?.closest(".feedback-sidebar-panel");z&&q&&z.style.setProperty("--feedback-page-space",`${Math.max(0,z.getBoundingClientRect().top-q.getBoundingClientRect().top-12)}px`)};return m(),p.current?.focus(),p.current?.select(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[v]),_o(()=>{if(!v)return;let m=X=>{!C.current&&!f.current?.contains(X.target)&&g()},z=X=>{X.key!=="Escape"||C.current||(X.preventDefault(),X.stopPropagation(),g(!0))},q=()=>{C.current||g()};return document.addEventListener("pointerdown",m),document.addEventListener("keydown",z,!0),window.addEventListener("blur",q),()=>{document.removeEventListener("pointerdown",m),document.removeEventListener("keydown",z,!0),window.removeEventListener("blur",q)}},[v]);async function le(m){if(!(r||C.current)){C.current=!0,T(!0),j("");try{await o(m)&&g(!0)}catch(z){j(z instanceof Error&&z.message?z.message:"This page could not be opened. Try again.")}finally{C.current=!1,T(!1)}}}return Ge("details",{ref:f,className:"feedback-page-control",onToggle:m=>w(m.currentTarget.open),children:[Ge("summary",{ref:i,"aria-label":`Current page: ${a}`,"aria-disabled":r||b,tabIndex:r||b?-1:0,onClick:m=>{m.preventDefault(),!(r||b||!f.current)&&(f.current.open?g():(S(""),j(""),l?.(),f.current.open=!0,w(!0)))},children:[Le(da,{"aria-hidden":"true"}),Le("span",{title:a,children:a}),Le(oa,{className:"feedback-page-chevron","aria-hidden":"true"})]}),Ge("div",{className:"feedback-page-popover",children:[Ge("form",{className:"feedback-page-form",onSubmit:m=>{m.preventDefault(),le(P)},children:[Le("input",{ref:p,"aria-label":"Page URL or path",value:P,placeholder:"Enter a URL or path",autoComplete:"off",autoCapitalize:"off",spellCheck:!1,disabled:r||b,onChange:m=>{S(m.target.value),j("")}}),Le("button",{type:"submit","aria-label":"Go to page",title:"Go to page","aria-busy":b,disabled:r||b||!P.trim(),children:Le(aa,{"aria-hidden":"true"})})]}),E&&Le("p",{className:"feedback-page-error",role:"alert",children:E}),Ge("nav",{className:"feedback-page-routes","aria-label":"Known pages",children:[c.map(m=>Ge("button",{type:"button",title:m,"aria-current":m===_?"page":void 0,disabled:r||b,onClick:()=>{m===_?g(!0):le(m)},children:[Le("span",{children:N?Ge(jo,{children:[m.slice(0,m.toLocaleLowerCase().indexOf(N)),Le("mark",{children:m.slice(m.toLocaleLowerCase().indexOf(N),m.toLocaleLowerCase().indexOf(N)+A.length)}),m.slice(m.toLocaleLowerCase().indexOf(N)+A.length)]}):m}),m===_&&Le(Oe,{"aria-hidden":"true"})]},m)),!c.length&&Le("p",{className:"feedback-page-empty",children:"No matching pages"})]})]})]})}import{jsx as xa,jsxs as po}from"react/jsx-runtime";import{useEffect as mo,useRef as et,useState as Qo}from"react";function Yo({request:a,finish:t,returnFocus:r}){let o=et(null);return mo(()=>(o.current?.showModal(),()=>r?.focus({preventScroll:!0})),[]),po("dialog",{ref:o,className:"feedback-confirmation","aria-labelledby":"feedback-confirmation-title","aria-describedby":"feedback-confirmation-description",onCancel:l=>{l.preventDefault(),t(!1)},children:[xa("h2",{id:"feedback-confirmation-title",children:a.title}),xa("p",{id:"feedback-confirmation-description",children:a.description}),po("div",{children:[xa("button",{type:"button",autoFocus:!0,onClick:()=>t(!1),children:"Cancel"}),xa("button",{type:"button","data-danger":a.danger,onClick:()=>t(!0),children:a.action})]})]})}function ho(){let[a,t]=Qo(null),r=et(null),o=et(null);mo(()=>()=>o.current?.(!1),[]);function l(i){o.current?.(i),o.current=null,t(null)}function f(i){return o.current?Promise.resolve(!1):(r.current=document.activeElement,t(i),new Promise(p=>{o.current=p}))}return{confirm:f,dialog:a&&xa(Yo,{request:a,finish:l,returnFocus:r.current})}}function xo(a){if(!(a.defaultPrevented||a.repeat||a.isComposing||a.ctrlKey||a.metaKey||a.altKey||a.composedPath().some(r=>{let o=r;return o.nodeType===1&&(o.isContentEditable||o.closest('input,textarea,select,[role="textbox"],[role="combobox"],[contenteditable]:not([contenteditable="false"])'))})))switch(a.key.toLowerCase()){case"c":return a.shiftKey?"toggle-comments":"comment";case"e":return"edit";case"v":return"view"}}function Lo(a){let t,r=()=>clearTimeout(t);return{cancel:r,schedule(){r(),t=setTimeout(a,70)}}}function go(a,t,r){let p=(j,_)=>Math.max(8,Math.min(j,_)),C=a.x+36+8,v=a.x+-4-8-t.width,w=r.width-t.width-8,P=Math.max(0,r.height-16);if(C<=w||v>=8)return{left:p(C<=w?C:v,w),top:p(a.y,r.height-Math.min(t.height,P)-8),maxHeight:P};let S=p(a.y+36+8,r.height-8),b=p(a.y+-4-8,r.height-8),T=r.height-S-8,E=b-8;return T>=E?{left:p(a.x+-4,w),top:S,maxHeight:T}:{left:p(a.x+-4,w),top:b-Math.min(t.height,E),maxHeight:E}}function at(a,t,r){let o=null;try{o=a.selector?t?.querySelector(a.selector)??null:null}catch{}let l=o?.getBoundingClientRect(),f=a.relative;return l&&f&&l.width&&l.height?{left:l.left+l.width*f.x,top:l.top+l.height*f.y,width:l.width*f.width,height:l.height*f.height}:{left:a.x-r.x,top:a.y-r.y,width:a.width,height:a.height}}var Ua=new WeakMap;function Ha(a,t=!1,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||!a.animate)return r?.cancel(),null;let o=r?.playState==="running",l=window.getComputedStyle(a);if(a.dataset.expanded==="true"){let S={opacity:0,transform:"translateY(4px)"},b={opacity:1,transform:"translateY(0px)"},T=o?{opacity:l.opacity,transform:l.transform}:t?b:S;return r?.cancel(),a.animate([T,t?S:b],{duration:t?100:140,easing:"cubic-bezier(.4,0,.2,1)"})}let f=a.querySelector(".feedback-hover-preview"),i=Ua.get(a)??{width:a.offsetWidth,height:a.offsetHeight,content:f,contentWidth:f?.style.width??""},p={width:`${(Number(a.dataset.pinWidth)||40)-8}px`,height:"32px",opacity:0,transform:`translate(${Number(a.dataset.pinX)-a.offsetLeft}px, ${Number(a.dataset.pinY)-a.offsetTop}px)`,borderRadius:"16px 16px 16px 0px"},C={width:`${i.width}px`,height:`${i.height}px`,opacity:1,transform:"translate(0px, 0px)",borderRadius:l.borderRadius},v=o?{width:l.width,height:l.height,opacity:l.opacity,transform:l.transform,borderRadius:l.borderRadius}:t?C:p;f&&(f.style.width=`${i.width-(parseFloat(l.borderLeftWidth)||0)-(parseFloat(l.borderRightWidth)||0)}px`),r?.cancel();let w=a.animate([{...v,overflow:"hidden"},{...t?p:C,overflow:"hidden"}],{duration:t?120:140,easing:"cubic-bezier(.4,0,.2,1)",fill:t?"forwards":"none"});i.animation=w,Ua.set(a,i);let P=()=>{Ua.get(a)?.animation===w&&(i.content&&(i.content.style.width=i.contentWidth),Ua.delete(a))};return w.finished.then(()=>{t||P()},P),w}import{jsx as er}from"react/jsx-runtime";var Io=`
|
|
2
|
-
:
|
|
3
|
-
.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box{color-scheme:light;--chisel-ui-panel-shadow:0 4px 20px rgba(0,0,0,.08);--chisel-ui-canvas:#f7f7f7;--chisel-ui-surface:#ffffff;--chisel-ui-raised:#f5f5f5;--chisel-ui-inset:#eeeeee;--chisel-ui-hover:#f0f0f0;--chisel-ui-selected:#eaeaea;--chisel-ui-border:#e2e2e2;--chisel-ui-border-strong:#c4c4c4;--chisel-ui-text:#242424;--chisel-ui-secondary:#626262;--chisel-ui-muted:#686868;--chisel-ui-focus:#2468d3;--chisel-ui-accent-text:#2468d3;--chisel-ui-accent-surface:#edf4ff;--chisel-ui-action:#242424;--chisel-ui-action-text:#ffffff;--chisel-ui-danger:#b33737;--chisel-ui-avatar:#ededed;--chisel-ui-avatar-text:#565656;--chisel-ui-scrollbar:#c2c2c2;--chisel-ui-checker-light:#e5e5e5;--chisel-ui-checker-dark:#c7c7c7;}
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box{--chisel-ui-font:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;--chisel-ui-space:4px;--chisel-ui-control:40px;--chisel-ui-radius:8px;--chisel-ui-text-size:13px;--chisel-ui-small:12px;--chisel-ui-motion:120ms cubic-bezier(.2,0,0,1);--chisel-ui-popover-shadow:0 2px 6px #0000000f,0 12px 36px #0000001f;}
|
|
8
|
-
@media(prefers-color-scheme:dark){.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box{--chisel-ui-popover-shadow:0 0 0 1px #ffffff0d,0 4px 12px #0003,0 16px 40px #0004;}}
|
|
9
|
-
`;var ar=`
|
|
10
|
-
.feedback-confirmation{width:360px;max-width:calc(100vw - 32px);padding:24px;border:0;border-radius:16px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);box-shadow:var(--chisel-ui-popover-shadow);font:14px var(--chisel-ui-font)}
|
|
11
|
-
.feedback-confirmation::backdrop{background:#0005}
|
|
12
|
-
.feedback-confirmation h2{margin:0 0 8px;font-size:16px;font-weight:600}
|
|
13
|
-
.feedback-confirmation p{margin:0;color:var(--chisel-ui-secondary);line-height:1.6;text-wrap:pretty}
|
|
14
|
-
.feedback-confirmation>div{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}
|
|
15
|
-
.feedback-confirmation button{min-height:40px;padding:0 16px;border:0;border-radius:8px;background:var(--chisel-ui-raised);color:var(--chisel-ui-text)}
|
|
16
|
-
.feedback-confirmation button[data-danger=true]{background:var(--chisel-ui-danger);color:var(--chisel-ui-surface)}
|
|
17
|
-
|
|
18
|
-
${Io}
|
|
19
|
-
.feedback-shell,.feedback-shell *{box-sizing:border-box}
|
|
20
|
-
.feedback-shell{font-synthesis:none;-webkit-font-smoothing:antialiased;position:fixed;inset:0;background:var(--chisel-ui-canvas);color:var(--chisel-ui-text);z-index:999999;font-family:var(--chisel-ui-font);font-size:13px;letter-spacing:0}
|
|
21
|
-
.feedback-avatar{overflow:hidden}
|
|
22
|
-
.feedback-account{position:relative}
|
|
23
|
-
.feedback-account summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:40px;min-height:40px}
|
|
24
|
-
.feedback-account summary::-webkit-details-marker{display:none}
|
|
25
|
-
.feedback-account>div{position:absolute;right:0;top:44px;z-index:20;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);border:0;box-shadow:var(--chisel-ui-popover-shadow);border-radius:12px;padding:16px;min-width:220px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:8px;overflow-wrap:anywhere}
|
|
26
|
-
.feedback-account[open]>div{transform-origin:top right;animation:chisel-account-in 160ms cubic-bezier(.2,0,0,1)}
|
|
27
|
-
@keyframes chisel-account-in{from{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
|
|
28
|
-
@media(prefers-reduced-motion:reduce){.feedback-account[open]>div{animation:none}}
|
|
29
|
-
.feedback-account>div>span{color:var(--chisel-ui-muted);font-size:12px;line-height:1.5}
|
|
30
|
-
.feedback-account button:hover{background:var(--chisel-ui-hover)}
|
|
31
|
-
.feedback-account button{display:flex;align-items:center;gap:8px;color:var(--chisel-ui-text);background:transparent;border:0;min-height:40px;padding:8px;border-radius:8px}
|
|
32
|
-
.chisel-sign-in{min-height:100dvh;display:grid;place-items:center;padding:24px;background:var(--chisel-ui-canvas);color:var(--chisel-ui-text);font-family:var(--chisel-ui-font)}
|
|
33
|
-
.chisel-sign-in section{width:100%;max-width:360px;text-align:left}
|
|
34
|
-
.chisel-sign-in-brand{font-size:24px;letter-spacing:-.8px}
|
|
35
|
-
.chisel-sign-in h1{font-size:24px;font-weight:500;letter-spacing:-.4px;line-height:1.25;margin:32px 0 8px}
|
|
36
|
-
.chisel-sign-in p{font-size:14px;line-height:1.6;color:var(--chisel-ui-secondary);margin:12px 0 24px}
|
|
37
|
-
.chisel-sign-in button{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:44px;padding:12px;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text);border:0;border-radius:8px;cursor:pointer}
|
|
38
|
-
.chisel-sign-in button:disabled{opacity:.5;cursor:not-allowed}
|
|
39
|
-
.chisel-sign-in a{display:inline-flex;align-items:center;min-height:40px;margin-top:16px;font-size:13px;color:var(--chisel-ui-secondary)}
|
|
40
|
-
.chisel-sign-in [role=alert]{color:var(--chisel-ui-danger)}
|
|
41
|
-
.chisel-spin{animation:chisel-spin 1s linear infinite}
|
|
42
|
-
@keyframes chisel-spin{to{transform:rotate(360deg)}
|
|
43
|
-
}
|
|
44
|
-
@media(prefers-reduced-motion:reduce){.chisel-spin{animation:none}
|
|
45
|
-
}
|
|
46
|
-
.feedback-sidebar[hidden]{display:none}
|
|
47
|
-
.feedback-comment-layer[hidden]{display:none}
|
|
48
|
-
.feedback-shell.comments-hidden .feedback-canvas{height:100%;flex:1}
|
|
49
|
-
.feedback-shell.is-editing .feedback-canvas{height:100%;flex:1}
|
|
50
|
-
.feedback-comment-area{position:absolute;pointer-events:none;z-index:1;border:2px solid var(--chisel-ui-focus);background:color-mix(in srgb,var(--chisel-ui-focus) 8%,transparent);border-radius:4px}
|
|
51
|
-
.feedback-element-box{position:absolute;pointer-events:none;z-index:1;border:1px solid var(--chisel-ui-focus);background:color-mix(in srgb,var(--chisel-ui-focus) 4%,transparent);box-sizing:border-box}
|
|
52
|
-
.feedback-element-box.is-selected{border-width:2px;background:color-mix(in srgb,var(--chisel-ui-focus) 6%,transparent)}
|
|
53
|
-
.feedback-thread-popup{max-height:calc(100% - 16px);overflow:auto}
|
|
54
|
-
.feedback-thread-popup[hidden]{display:none}
|
|
55
|
-
.feedback-thread-message,.feedback-thread-replies{overflow-wrap:anywhere;line-height:1.6;margin:0}
|
|
56
|
-
.feedback-thread-replies{max-height:140px;overflow:auto}
|
|
57
|
-
.feedback-thread-actions{display:flex;justify-content:space-between;align-items:center;margin-top:8px;gap:8px}
|
|
58
|
-
.feedback-thread-actions .feedback-resolve{margin:0;font-size:11px;padding:8px}
|
|
59
|
-
.feedback-composer-heading>button{display:grid;place-items:center;width:24px;height:24px;border-radius:4px}
|
|
60
|
-
.feedback-composer-heading>button:hover{background:var(--chisel-ui-raised)}
|
|
61
|
-
.feedback-shell button,.feedback-shell input,.feedback-shell textarea{font:inherit}
|
|
62
|
-
.feedback-shell button{cursor:pointer}
|
|
63
|
-
.feedback-shell button:disabled{cursor:not-allowed}
|
|
64
|
-
.feedback-shell :where(button,summary){-webkit-tap-highlight-color:transparent}
|
|
65
|
-
.feedback-workspace{display:flex;height:100%}
|
|
66
|
-
.feedback-canvas{position:relative;flex:1;min-width:0;padding:0}
|
|
67
|
-
.feedback-viewport{position:relative;height:100%;overflow:hidden;background:white;border:0;border-radius:0}
|
|
68
|
-
.feedback-viewport iframe{width:100%;height:100%;border:0;display:block}
|
|
69
|
-
.feedback-pin{position:absolute;transform:translate(-4px,-4px);width:40px;height:40px;display:grid;place-items:center;padding:8px;border-radius:50% 50% 50% 0;background:transparent;color:var(--chisel-ui-text);border:0;box-sizing:border-box;z-index:2}
|
|
70
|
-
.feedback-comment-layer[data-hover-preview=true] .feedback-pin:not(.selected){z-index:5}
|
|
71
|
-
.feedback-pin:before{content:"";position:absolute;inset:4px;border:1px solid var(--chisel-ui-border);border-radius:inherit;background:var(--chisel-ui-surface);box-shadow:0 2px 7px #0002;z-index:-1}
|
|
72
|
-
|
|
73
|
-
.feedback-pin .feedback-avatar{width:24px;height:24px;font-size:12px}
|
|
74
|
-
.feedback-pin-group{display:flex;width:auto;border-radius:20px 20px 20px 0}
|
|
75
|
-
.feedback-pin-group .feedback-avatar+.feedback-avatar{margin-left:-4px}
|
|
76
|
-
.feedback-pin .feedback-avatar img{width:100%;height:100%;object-fit:cover}
|
|
77
|
-
.feedback-pin .feedback-pin-more{font-size:9px;font-variant-numeric:tabular-nums}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.feedback-toolbar{position:absolute;z-index:2;bottom:17px;left:50%;transform:translateX(-50%);display:flex;padding:4px;gap:4px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);border:0;border-radius:999px;box-shadow:var(--chisel-ui-popover-shadow)}
|
|
81
|
-
.feedback-toolbar button{border:1px solid transparent;background:transparent;color:var(--chisel-ui-muted);height:var(--chisel-ui-control);padding:0 16px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:999px;white-space:nowrap;transition:background-color var(--chisel-ui-motion),color var(--chisel-ui-motion),border-color var(--chisel-ui-motion)}
|
|
82
|
-
.feedback-toolbar button:hover{background:var(--chisel-ui-raised);color:var(--chisel-ui-text)}
|
|
83
|
-
.feedback-toolbar button[aria-pressed=true]{background:var(--chisel-ui-raised);color:var(--chisel-ui-text);border-color:transparent}
|
|
84
|
-
.feedback-collaboration{display:flex;align-items:center;gap:8px;min-height:32px;margin-bottom:8px;color:var(--chisel-ui-muted);font-size:12px}
|
|
85
|
-
.feedback-reviewers{display:flex;flex:1;min-width:0;overflow:hidden}
|
|
86
|
-
.feedback-reviewers .feedback-avatar{width:24px;height:24px}
|
|
87
|
-
.feedback-reviewers .feedback-avatar+.feedback-avatar{margin-left:-4px}
|
|
88
|
-
.feedback-reviewers img{width:100%;height:100%;object-fit:cover}
|
|
89
|
-
.feedback-unread-count,.feedback-unread-label{color:var(--chisel-ui-accent-text);font-size:12px;font-variant-numeric:tabular-nums}
|
|
90
|
-
.feedback-unread-label{display:inline}
|
|
91
|
-
@media(prefers-reduced-motion:reduce){.feedback-toolbar button,.feedback-comment{transition:none}
|
|
92
|
-
}
|
|
93
|
-
.feedback-shell button svg,.feedback-shell summary svg{width:16px;height:16px;stroke-width:1.75;flex-shrink:0}
|
|
94
|
-
.feedback-primary,.feedback-resolve,.feedback-thread form button{display:inline-flex;align-items:center;justify-content:center;gap:6px}
|
|
95
|
-
.feedback-sidebar{--feedback-panel-divider:var(--chisel-ui-border);--feedback-panel-shadow:var(--chisel-ui-panel-shadow);width:400px;flex-shrink:0;padding:0;background:transparent;color:var(--chisel-ui-text);border:0;display:flex;flex-direction:column;min-height:0;font-family:var(--chisel-ui-font);font-size:13px;letter-spacing:0;-webkit-font-smoothing:antialiased;color-scheme:inherit}
|
|
96
|
-
|
|
97
|
-
.feedback-sidebar-panel{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:16px 20px 0;border:0;border-radius:0;background:var(--chisel-ui-surface)}
|
|
98
|
-
.feedback-search{display:flex;align-items:center;gap:8px;min-height:40px;margin-bottom:8px;padding:0 8px;border-radius:8px;background:transparent;color:var(--chisel-ui-muted)}
|
|
99
|
-
.feedback-search svg{flex-shrink:0}
|
|
100
|
-
.feedback-shell .feedback-search input{min-width:0;min-height:40px;padding:0;border:0;background:transparent;font-size:13px}
|
|
101
|
-
.feedback-search input::placeholder{color:var(--chisel-ui-muted)}
|
|
102
|
-
.feedback-search:hover{background:var(--chisel-ui-raised)}
|
|
103
|
-
.feedback-page-control{position:relative;flex-shrink:0;margin:8px 0}
|
|
104
|
-
.feedback-page-control:last-child{margin-bottom:16px}
|
|
105
|
-
.feedback-page-control+.feedback-review-invite{padding-top:0}
|
|
106
|
-
.feedback-page-control>summary{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 8px;border-radius:8px;list-style:none;color:var(--chisel-ui-secondary);cursor:pointer}
|
|
107
|
-
.feedback-page-control>summary::-webkit-details-marker{display:none}
|
|
108
|
-
.feedback-page-control>summary:hover,.feedback-page-control[open]>summary{background:var(--chisel-ui-raised);color:var(--chisel-ui-text)}
|
|
109
|
-
.feedback-page-control>summary[aria-disabled=true]{opacity:.5;cursor:default}
|
|
110
|
-
.feedback-page-control>summary>span,.feedback-page-routes button>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;font:12px/20px ui-monospace,SFMono-Regular,monospace}
|
|
111
|
-
.feedback-page-chevron{transform:rotate(180deg);transition:transform var(--chisel-ui-motion)}
|
|
112
|
-
.feedback-page-control[open] .feedback-page-chevron{transform:rotate(0)}
|
|
113
|
-
.feedback-page-popover{position:absolute;bottom:calc(100% + 4px);left:0;right:0;z-index:30;display:flex;flex-direction:column;gap:6px;max-height:var(--feedback-page-space,320px);overflow:auto;padding:8px;border-radius:12px;background:var(--chisel-ui-surface);box-shadow:var(--chisel-ui-popover-shadow)}
|
|
114
|
-
.feedback-page-form{display:flex;flex-shrink:0;align-items:center;gap:4px;border-radius:8px;background:var(--chisel-ui-raised)}
|
|
115
|
-
.feedback-shell .feedback-page-form input{flex:1;min-width:0;min-height:40px;padding:0 10px;border:0;border-radius:8px;background:transparent;font-size:13px}
|
|
116
|
-
.feedback-page-form button{display:grid;place-items:center;flex-shrink:0;width:40px;min-height:40px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--chisel-ui-text)}
|
|
117
|
-
.feedback-page-routes{display:flex;flex-direction:column;gap:2px;min-height:0;max-height:min(240px,30dvh);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--chisel-ui-scrollbar) transparent}
|
|
118
|
-
.feedback-page-routes button{display:flex;align-items:center;gap:8px;width:100%;min-height:40px;padding:0 8px;border:0;border-radius:8px;background:transparent;color:var(--chisel-ui-secondary)}
|
|
119
|
-
.feedback-page-routes button[aria-current=page]{background:var(--chisel-ui-selected);color:var(--chisel-ui-text)}
|
|
120
|
-
.feedback-page-routes mark{background:var(--chisel-ui-selected);color:var(--chisel-ui-text);border-radius:2px;font-weight:700}
|
|
121
|
-
.feedback-page-empty{margin:0;padding:10px 8px;color:var(--chisel-ui-secondary);font-size:12px}
|
|
122
|
-
.feedback-page-control button:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
123
|
-
.feedback-page-control button:disabled{opacity:.5}
|
|
124
|
-
.feedback-page-control button:active{transform:scale(.96)}
|
|
125
|
-
.feedback-page-error{margin:0;padding:4px 8px;color:var(--chisel-ui-danger);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
|
|
126
|
-
@media(pointer:coarse){.feedback-page-control>summary,.feedback-page-control button,.feedback-shell .feedback-page-form input{min-height:44px}.feedback-page-form button{width:44px}}
|
|
127
|
-
@media(prefers-reduced-motion:reduce){.feedback-page-chevron{transition:none}}
|
|
128
|
-
.feedback-sidebar-title{min-height:40px;padding:0;margin-bottom:12px;border:0;display:flex;align-items:center;justify-content:space-between;gap:6px}
|
|
129
|
-
.feedback-sidebar h1{font:600 15px/22px var(--chisel-ui-font);letter-spacing:-.01em;margin:0;color:var(--chisel-ui-text)}
|
|
130
|
-
.feedback-sidebar h1 span{font:500 12px ui-monospace,SFMono-Regular,Menlo,monospace;font-variant-numeric:tabular-nums;margin-left:6px;color:var(--chisel-ui-muted)}
|
|
131
|
-
.feedback-avatar{width:27px;height:27px;background:var(--chisel-ui-avatar);color:var(--chisel-ui-avatar-text);border:0;display:inline-flex;justify-content:center;align-items:center;border-radius:50%;font-size:11px;flex-shrink:0}
|
|
132
|
-
.feedback-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex-shrink:0;gap:6px;margin:0 0 8px;padding:4px;border-radius:12px;background:var(--chisel-ui-raised)}
|
|
133
|
-
.feedback-tabs button{position:relative;min-width:0;min-height:40px;background:transparent;border:0;border-radius:8px;color:var(--chisel-ui-secondary);padding:0 12px;font-size:13px;font-weight:500;transition:background-color var(--chisel-ui-motion),color var(--chisel-ui-motion),box-shadow var(--chisel-ui-motion)}
|
|
134
|
-
.feedback-tabs button+button::before{content:"";position:absolute;left:-3.5px;top:50%;width:1px;height:16px;transform:translateY(-50%);background:var(--chisel-ui-border);pointer-events:none}
|
|
135
|
-
.feedback-tabs button:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
136
|
-
.feedback-tabs button[aria-pressed=true]{color:var(--chisel-ui-text);background:var(--chisel-ui-surface);box-shadow:0 1px 3px #0000000d,0 0 0 1px var(--chisel-ui-border)}
|
|
137
|
-
@media(prefers-reduced-motion:reduce){.feedback-tabs button{transition:none}}
|
|
138
|
-
.feedback-comment-list{flex:1;min-height:0;overflow:auto;padding:0;scrollbar-width:thin;scrollbar-color:var(--chisel-ui-scrollbar) transparent}
|
|
139
|
-
.feedback-comment{border:0;border-radius:8px;padding:16px 8px;margin-bottom:8px;background:transparent;transition:background-color var(--chisel-ui-motion)}
|
|
140
|
-
.feedback-comment:hover{background:var(--chisel-ui-raised)}
|
|
141
|
-
.feedback-comment.active{background:var(--chisel-ui-raised)}
|
|
142
|
-
.feedback-comment-main{display:flex;flex-direction:column;align-items:stretch;gap:8px;border:0;background:none;text-align:left;width:100%;min-height:40px;padding:0;color:inherit}
|
|
143
|
-
.feedback-comment-heading{display:flex;align-items:center;gap:10px}
|
|
144
|
-
.feedback-comment-identity{flex:1;min-width:0}
|
|
145
|
-
.feedback-comment-activity{display:flex;align-items:center;gap:8px;margin-left:38px;margin-top:4px}
|
|
146
|
-
.feedback-comment-heading>.feedback-avatar{width:28px;height:28px}
|
|
147
|
-
.feedback-comment-heading img{width:100%;height:100%;object-fit:cover}
|
|
148
|
-
.feedback-comment-avatars{display:flex;gap:4px}
|
|
149
|
-
.feedback-comment-avatars .feedback-avatar{width:20px;height:20px;font-size:10px}
|
|
150
|
-
.feedback-comment-avatars img{width:100%;height:100%;object-fit:cover}
|
|
151
|
-
.feedback-comment-unread-dot{width:8px;height:8px;flex-shrink:0;border-radius:50%;background:var(--chisel-ui-focus)}
|
|
152
|
-
.feedback-comment-status{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--chisel-ui-muted);font-size:12px;line-height:1.5}
|
|
153
|
-
.feedback-comment-meta{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;font-size:13px;line-height:1.5}
|
|
154
|
-
.feedback-comment-meta strong{font-weight:500;overflow-wrap:anywhere}
|
|
155
|
-
.feedback-comment-meta time{color:var(--chisel-ui-muted);font-size:12px;font-variant-numeric:tabular-nums}
|
|
156
|
-
.feedback-comment-body{display:block;margin-left:38px;line-height:1.5;overflow-wrap:anywhere;color:var(--chisel-ui-text);font-size:14px;white-space:pre-wrap}
|
|
157
|
-
.feedback-comment-reply-count{color:var(--chisel-ui-secondary);font-size:12px;line-height:1.5}
|
|
158
|
-
.feedback-comment-path{font:inherit;color:inherit}
|
|
159
|
-
.feedback-empty{padding:24px 8px;color:var(--chisel-ui-muted)}
|
|
160
|
-
.feedback-empty>span{display:none}
|
|
161
|
-
.feedback-empty h2{font:500 14px var(--chisel-ui-font);color:var(--chisel-ui-secondary);margin:0 0 6px}
|
|
162
|
-
.feedback-empty p{font-size:13px;line-height:1.6;color:var(--chisel-ui-muted);margin:0}
|
|
163
|
-
.feedback-review-invite{border:0;padding:16px 0;color:var(--chisel-ui-secondary)}
|
|
164
|
-
.feedback-review-invite summary{display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;font-size:13px;padding:10px 8px;min-height:40px;border-radius:8px}
|
|
165
|
-
.feedback-review-invite summary::-webkit-details-marker{display:none}
|
|
166
|
-
.feedback-review-invite[open]>summary svg{transform:rotate(90deg)}
|
|
167
|
-
.feedback-review-invite summary:hover{background:var(--chisel-ui-hover)}
|
|
168
|
-
.feedback-review-invite form{display:flex;flex-direction:column;gap:10px;margin-top:10px}
|
|
169
|
-
.feedback-review-invite .feedback-primary{width:100%;align-self:stretch}
|
|
170
|
-
.feedback-review-invite label{display:flex;flex-direction:column;gap:6px;font-size:11px}
|
|
171
|
-
.feedback-review-invite p{font-size:12px;line-height:1.5;margin:0}
|
|
172
|
-
.feedback-composer{position:absolute;z-index:3;width:288px;background:var(--chisel-ui-surface);padding:14px;border:0;border-radius:16px;box-shadow:var(--chisel-ui-popover-shadow);display:flex;flex-direction:column;gap:10px}
|
|
173
|
-
.feedback-composer-heading{display:flex;align-items:center;justify-content:space-between;font-weight:bold}
|
|
174
|
-
.feedback-composer-heading button{border:0;background:none;font-size:21px}
|
|
175
|
-
.feedback-shell input,.feedback-shell textarea{border:1px solid var(--chisel-ui-border);border-radius:4px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);padding:9px;width:100%;box-sizing:border-box}
|
|
176
|
-
.feedback-shell textarea{resize:none;min-height:70px}
|
|
177
|
-
.feedback-primary{min-height:40px;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text);border:0;padding:0 12px;border-radius:8px;align-self:flex-end}
|
|
178
|
-
.feedback-thread{margin-top:16px}
|
|
179
|
-
.feedback-thread form button,.feedback-resolve{background:var(--chisel-ui-surface);border:1px solid var(--chisel-ui-border);border-radius:4px;padding:7px 10px;margin-top:8px}
|
|
180
|
-
.feedback-resolve{color:var(--chisel-ui-text)}
|
|
181
|
-
.feedback-reply{border-left:2px solid var(--chisel-ui-border);padding-left:10px}
|
|
182
|
-
.feedback-error{color:var(--chisel-ui-danger);padding:0 8px;margin:0 0 16px;line-height:1.5;font-size:13px}
|
|
183
|
-
.feedback-comment-list>p[role=status]{margin:0;padding:24px 8px;color:var(--chisel-ui-secondary);line-height:1.5;font-size:13px}
|
|
184
|
-
@media(max-width:760px){.feedback-workspace{flex-direction:column}
|
|
185
|
-
.feedback-canvas{height:48%;flex:none;padding:0}
|
|
186
|
-
.feedback-sidebar{width:100%;height:auto;flex:1;padding:0}
|
|
187
|
-
.feedback-sidebar-panel{border:0}
|
|
188
|
-
.feedback-sidebar-title{min-height:44px}
|
|
189
|
-
.feedback-tabs{margin-bottom:8px}
|
|
190
|
-
.feedback-tabs button{min-height:44px;padding:0 8px}
|
|
191
|
-
.feedback-empty{padding:12px}
|
|
192
|
-
.feedback-empty>span{display:none}
|
|
193
|
-
.feedback-toolbar{bottom:10px}
|
|
194
|
-
.feedback-comment{padding:14px 8px}
|
|
195
|
-
}
|
|
196
|
-
.comment-box{position:absolute;z-index:4;display:flex;flex-direction:column;width:344px;max-width:calc(100% - 16px);height:auto;max-height:calc(100% - 16px);padding:0;overflow:hidden;border:0;border-radius:16px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);box-shadow:var(--chisel-ui-popover-shadow);font:12px var(--chisel-ui-font);color-scheme:inherit}
|
|
197
|
-
.comment-box[data-settings-open=true]{height:440px}
|
|
198
|
-
.comment-box-settings{display:flex;flex-direction:column;flex:1;min-height:0}
|
|
199
|
-
.comment-box-settings[hidden]{display:none}
|
|
200
|
-
.comment-box[hidden],.comment-thread form[hidden]{display:none}
|
|
201
|
-
.comment-box-draft-pin{pointer-events:none}
|
|
202
|
-
.comment-box-prompt{display:flex;align-items:center;gap:9px;min-height:44px;padding:8px 12px;flex-shrink:0}
|
|
203
|
-
.comment-box-symbol{position:relative;border:0;padding:0;display:grid;place-items:center;background:transparent;border-radius:8px;width:40px;height:40px;flex-shrink:0}
|
|
204
|
-
|
|
205
|
-
.comment-box-symbol[aria-expanded=true]{background:var(--chisel-ui-selected)}
|
|
206
|
-
.comment-box-symbol:hover{background:var(--chisel-ui-hover)}
|
|
207
|
-
.comment-box-symbol svg{width:14px;height:14px;color:var(--chisel-ui-text)}
|
|
208
|
-
.comment-box .comment-box-prompt input{border:0;border-radius:0;background:none;box-shadow:none;padding:0;color:var(--chisel-ui-text);font:13px var(--chisel-ui-font);outline:none;width:100%;min-width:0}
|
|
209
|
-
.comment-box-prompt input::placeholder{color:var(--chisel-ui-muted)}
|
|
210
|
-
.comment-box-element{display:flex;align-items:center;justify-content:space-between;background:var(--chisel-ui-raised);color:var(--chisel-ui-muted);min-height:28px;padding:0 15px;flex-shrink:0}
|
|
211
|
-
.comment-box-element code{font:12px monospace}
|
|
212
|
-
.comment-box-element svg{color:var(--chisel-ui-muted)}
|
|
213
|
-
.comment-box,.comment-thread{translate:var(--comment-drag-x,0px) var(--comment-drag-y,0px)}
|
|
214
|
-
.feedback-shell .comment-window-drag{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;padding:0;border:0;border-radius:var(--chisel-ui-radius);background:transparent;color:var(--chisel-ui-muted);cursor:grab;touch-action:none;user-select:none}
|
|
215
|
-
.feedback-shell .comment-window-drag:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
216
|
-
.feedback-shell .comment-window-drag[data-dragging=true]{cursor:grabbing}
|
|
217
|
-
.comment-box-element .comment-window-drag{margin-left:auto;margin-right:-8px}
|
|
218
|
-
.feedback-thread-header>.comment-window-drag{margin-right:auto}
|
|
219
|
-
.comment-box-preview-status{margin-left:auto;margin-right:8px;font:12px var(--chisel-ui-font);color:var(--chisel-ui-accent-text)}
|
|
220
|
-
.comment-box-properties{flex:1;min-height:0;min-width:0;border:0;margin:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--chisel-ui-scrollbar) transparent;padding:4px 15px 9px;position:relative}
|
|
221
|
-
.comment-box-row{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--chisel-ui-secondary)}
|
|
222
|
-
.comment-box-row>span{white-space:nowrap}
|
|
223
|
-
.comment-box .comment-box-row input,.comment-box select{border:0;background:var(--chisel-ui-raised);color:var(--chisel-ui-secondary);border-radius:8px;min-width:0;width:128px;height:var(--chisel-ui-control);font:12px var(--chisel-ui-font);padding:4px 8px;text-overflow:ellipsis}
|
|
224
|
-
.comment-box input:disabled{opacity:.35}
|
|
225
|
-
.comment-box-number{display:flex;align-items:center;border:0;background:var(--chisel-ui-raised);border-radius:8px;width:128px;flex-shrink:0;height:var(--chisel-ui-control);padding-right:8px;color:var(--chisel-ui-muted)}
|
|
226
|
-
.comment-box .comment-box-number input{border:0;width:100%;height:40px;background:transparent;box-shadow:none}
|
|
227
|
-
.comment-box-number input::-webkit-inner-spin-button,.comment-box-spacing input::-webkit-inner-spin-button{-webkit-appearance:none}
|
|
228
|
-
.comment-box-number>span{font:11px monospace}
|
|
229
|
-
.comment-box select{appearance:auto}
|
|
230
|
-
.comment-box-color{display:flex;align-items:center;gap:8px;border:0;width:142px;height:var(--chisel-ui-control);border-radius:7px;padding:3px 4px;min-width:0}
|
|
231
|
-
.comment-color-trigger{position:relative;display:grid;place-items:center;width:24px;height:24px;flex-shrink:0;padding:0;border:0;border-radius:4px;background:repeating-conic-gradient(var(--chisel-ui-checker-light) 0% 25%,var(--chisel-ui-checker-dark) 0% 50%) 50%/8px 8px}
|
|
232
|
-
.comment-color-trigger:after{content:"";position:absolute;inset:-8px;border-radius:inherit}
|
|
233
|
-
.comment-color-trigger>span{display:block;width:100%;height:100%;border-radius:inherit;box-shadow:inset 0 0 0 1px var(--chisel-ui-border)}
|
|
234
|
-
@media(pointer:coarse){.comment-color-trigger:after{inset:-10px}}
|
|
235
|
-
.comment-color-value{font:12px monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--chisel-ui-secondary)}
|
|
236
|
-
.chisel-color-picker,.chisel-color-picker *{box-sizing:border-box}
|
|
237
|
-
.chisel-color-picker{position:fixed;z-index:1000001;width:256px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;padding:16px;border:0;border-radius:16px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);font:12px var(--chisel-ui-font);box-shadow:var(--chisel-ui-popover-shadow);color-scheme:inherit}
|
|
238
|
-
.chisel-color-plane{position:relative;height:160px;margin:0 0 14px;border-radius:10px;touch-action:none;cursor:crosshair;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,transparent)}
|
|
239
|
-
.chisel-color-thumb{position:absolute;width:19px;height:19px;border:2px solid #fff;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;box-shadow:0 1px 5px #0004}
|
|
240
|
-
.chisel-color-tools{display:flex;gap:12px;align-items:center;margin-bottom:14px}
|
|
241
|
-
.chisel-color-hue{appearance:none;-webkit-appearance:none;flex:1;min-width:0;height:40px;border:12px solid transparent;background-clip:padding-box;border-radius:20px;margin:0;background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red);cursor:pointer}
|
|
242
|
-
.chisel-color-hue::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:20px;height:20px;border:2px solid #fff;border-radius:50%;background:var(--hue);box-shadow:0 1px 4px #0004}
|
|
243
|
-
.chisel-color-hue::-moz-range-thumb{width:16px;height:16px;border:2px solid #fff;border-radius:50%;background:var(--hue);box-shadow:0 1px 4px #0004}
|
|
244
|
-
.chisel-color-tools button{display:grid;place-items:center;flex-shrink:0;width:44px;height:40px;padding:0;background:var(--chisel-ui-raised);border:0;border-radius:8px;color:var(--chisel-ui-text);cursor:pointer}
|
|
245
|
-
.chisel-color-tools button:disabled{opacity:.35;cursor:not-allowed}
|
|
246
|
-
.chisel-color-hex{display:flex;flex-direction:column;gap:8px;color:var(--chisel-ui-secondary);font-size:11px}
|
|
247
|
-
.chisel-color-hex input{width:100%;height:40px;border:0;border-radius:8px;padding:7px 9px;background:var(--chisel-ui-raised);color:var(--chisel-ui-text);font:13px monospace}
|
|
248
|
-
.chisel-color-hex input[aria-invalid=true]{outline:2px solid var(--chisel-ui-danger)}
|
|
249
|
-
.chisel-color-error{display:block;color:var(--chisel-ui-danger);font-size:11px;margin-top:6px}
|
|
250
|
-
.chisel-color-accessible{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);border:0}
|
|
251
|
-
.comment-box-control-group{margin-top:20px}
|
|
252
|
-
.comment-box-control-group h3{font:500 12px/18px var(--chisel-ui-font);margin:0 0 8px;color:var(--chisel-ui-text)}
|
|
253
|
-
.comment-box-group{border:0;margin-top:20px;padding-top:0}
|
|
254
|
-
.comment-box-group summary{list-style:none;display:flex;align-items:center;gap:6px;min-height:40px;color:var(--chisel-ui-secondary);cursor:pointer}
|
|
255
|
-
.comment-box-group summary::-webkit-details-marker{display:none}
|
|
256
|
-
.comment-box-group[open] summary svg{transform:rotate(90deg)}
|
|
257
|
-
.comment-box-pair{position:relative;padding:2px 0}
|
|
258
|
-
.comment-box-pair .comment-box-row{min-height:44px}
|
|
259
|
-
.comment-box-link{position:absolute;left:42%;top:50%;transform:translate(-50%,-50%);border:0;background:var(--chisel-ui-surface);color:var(--chisel-ui-muted);border-radius:50%;width:40px;height:40px;display:grid;place-items:center;z-index:1}
|
|
260
|
-
.comment-box-link:before{content:none}
|
|
261
|
-
.comment-box-link svg{padding:0}
|
|
262
|
-
.comment-box-link:hover{background:var(--chisel-ui-hover)}
|
|
263
|
-
.comment-box-link[aria-pressed=true]{color:var(--chisel-ui-accent-text);background:var(--chisel-ui-accent-surface)}
|
|
264
|
-
.comment-box-link[aria-pressed=true]:before{border-color:var(--chisel-ui-focus)}
|
|
265
|
-
.comment-box-number{font-variant-numeric:tabular-nums}
|
|
266
|
-
.comment-box .comment-box-number input::-webkit-inner-spin-button{-webkit-appearance:none}
|
|
267
|
-
.comment-box-footer{height:56px;min-height:56px;display:flex;align-items:center;gap:8px;padding:8px;border:0}
|
|
268
|
-
.comment-box-footer>span{flex:1}
|
|
269
|
-
.comment-box-footer button{display:grid;place-items:center;border:0;background:none;color:var(--chisel-ui-text);height:40px;width:40px}
|
|
270
|
-
.comment-box-footer .comment-box-cancel:hover{background:var(--chisel-ui-hover)}
|
|
271
|
-
.comment-box-footer .comment-box-cancel{width:auto;padding:0 9px;font:13px var(--chisel-ui-font);border:0;border-radius:8px;background:transparent}
|
|
272
|
-
.comment-box-footer .comment-box-submit{width:40px;border-radius:8px;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text)}
|
|
273
|
-
.comment-box-footer .comment-box-submit:disabled{opacity:.4;cursor:not-allowed}
|
|
274
|
-
.comment-box-error{margin:0;padding:0 12px 8px;flex-shrink:0;font-size:11px;line-height:1.5;color:var(--chisel-ui-danger)}
|
|
275
|
-
.comment-box-saving{width:12px;height:12px;border:1px solid var(--chisel-ui-border-strong);border-top-color:transparent;border-radius:50%;animation:chisel-spin 1s linear infinite}
|
|
276
|
-
.feedback-composer.comment-thread{width:400px;max-width:calc(100% - 16px);gap:0;border-radius:16px;background:var(--chisel-ui-surface);border-color:var(--chisel-ui-border);color:var(--chisel-ui-text);padding:0;box-shadow:var(--chisel-ui-popover-shadow);color-scheme:inherit;overflow:hidden auto;scrollbar-width:thin}
|
|
277
|
-
.feedback-thread-header{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:56px;padding:8px 12px 4px 20px;border:0;flex-shrink:0}
|
|
278
|
-
.comment-thread .feedback-thread-summary{width:100%;padding:16px}
|
|
279
|
-
.comment-thread .feedback-thread-summary:empty{display:none}
|
|
280
|
-
.comment-thread .feedback-thread-replies{width:100%;padding:0 16px}
|
|
281
|
-
.comment-thread form{width:100%;padding:16px}
|
|
282
|
-
.feedback-composer.comment-thread[data-expanded=false]{width:240px;max-width:calc(100% - 16px);border-radius:16px 16px 16px 0;overflow:hidden}
|
|
283
|
-
.feedback-thread-content{display:flex;flex-direction:column;flex-shrink:0;width:100%}
|
|
284
|
-
.feedback-thread-content[hidden]{display:none}
|
|
285
|
-
.feedback-hover-preview{display:flex;align-items:flex-start;gap:10px;flex-shrink:0;width:100%;padding:12px;border:0;border-radius:inherit;background:transparent;color:var(--chisel-ui-text);text-align:left;font:12px/16px var(--chisel-ui-font)}
|
|
286
|
-
.feedback-hover-preview>.feedback-avatar{width:24px;height:24px;font-size:12px}
|
|
287
|
-
.feedback-hover-preview img{width:100%;height:100%;object-fit:cover}
|
|
288
|
-
.feedback-hover-copy{flex:1;min-width:0}
|
|
289
|
-
.feedback-hover-byline{display:flex;align-items:baseline;gap:4px;white-space:nowrap;overflow:hidden}
|
|
290
|
-
.feedback-hover-byline strong{font-weight:500;overflow:hidden;text-overflow:ellipsis}
|
|
291
|
-
.feedback-hover-byline time{color:var(--chisel-ui-muted);font-size:11px;flex-shrink:0}
|
|
292
|
-
.feedback-hover-message{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
|
|
293
|
-
.feedback-pin.selected:before{border-color:var(--chisel-ui-focus)}
|
|
294
|
-
.comment-thread .feedback-thread-summary,.comment-thread .feedback-thread-replies,.comment-thread form{width:100%;flex-shrink:0}
|
|
295
|
-
.comment-thread .feedback-preview{white-space:nowrap}
|
|
296
|
-
.feedback-thread-summary{display:flex;align-items:flex-start;gap:8px;flex-shrink:0}
|
|
297
|
-
.feedback-thread-summary,.feedback-thread-reply{position:relative}
|
|
298
|
-
.feedback-message-edit{display:grid;place-items:center;width:40px;height:40px;flex-shrink:0;padding:0;border:0;border-radius:8px;background:transparent;color:var(--chisel-ui-secondary);opacity:0;transition:opacity 120ms,background 120ms}
|
|
299
|
-
.feedback-thread-summary:hover .feedback-message-edit,.feedback-thread-reply:hover .feedback-message-edit,.feedback-message-edit:focus-visible{opacity:1}
|
|
300
|
-
.feedback-message-edit:hover{background:var(--chisel-ui-hover)}
|
|
301
|
-
@media(hover:none){.feedback-message-edit{opacity:1}}
|
|
302
|
-
.feedback-thread-summary-button{display:flex;align-items:flex-start;gap:10px;flex:1;min-width:0;border:0;padding:0;text-align:left;background:transparent;color:inherit}
|
|
303
|
-
.feedback-thread-summary-button>.feedback-avatar{width:26px;height:26px;flex-shrink:0;margin-top:1px;font-size:10px}
|
|
304
|
-
.feedback-thread-summary-copy{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
|
|
305
|
-
.feedback-thread-byline{display:flex;align-items:baseline;gap:7px;min-width:0;flex-wrap:wrap}
|
|
306
|
-
.feedback-thread-byline strong{font-size:13px;font-weight:600;line-height:1.4;overflow-wrap:anywhere}
|
|
307
|
-
.feedback-thread-byline time{font-size:12px;color:var(--chisel-ui-muted);white-space:nowrap}
|
|
308
|
-
.feedback-thread-summary .feedback-thread-message{font-size:14px;line-height:1.5;color:var(--chisel-ui-text);overflow-wrap:anywhere}
|
|
309
|
-
.comment-thread[data-expanded=false] .feedback-thread-message{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
|
|
310
|
-
.feedback-thread-reply-count{font-size:12px;line-height:1.4;color:var(--chisel-ui-muted)}
|
|
311
|
-
.feedback-thread-close{display:grid;place-items:center;flex-shrink:0;width:24px;height:24px;border:0;border-radius:6px;background:none;color:var(--chisel-ui-muted);padding:4px}
|
|
312
|
-
.feedback-thread-header-actions{display:flex;gap:4px;flex-shrink:0}
|
|
313
|
-
.feedback-thread-header-actions .feedback-thread-close{position:relative;width:40px;height:40px}
|
|
314
|
-
|
|
315
|
-
.feedback-thread-header-actions .feedback-thread-delete:hover{color:var(--chisel-ui-danger)}
|
|
316
|
-
.feedback-thread-close:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
317
|
-
.feedback-thread-reply{display:flex;align-items:flex-start;gap:10px;padding:16px 0;border:0}
|
|
318
|
-
.feedback-thread-reply>.feedback-avatar{width:24px;height:24px;font-size:10px}
|
|
319
|
-
.feedback-thread-reply>div{flex:1;min-width:0}
|
|
320
|
-
.feedback-thread-reply strong{font-size:13px;font-weight:600}
|
|
321
|
-
.feedback-thread-reply p{font-size:14px;line-height:1.5;margin:4px 0 0;color:var(--chisel-ui-secondary)}
|
|
322
|
-
.comment-thread form{padding-top:16px;border:0}
|
|
323
|
-
.feedback-shell .comment-thread textarea{background:var(--chisel-ui-raised);color:var(--chisel-ui-text);border:1px solid var(--chisel-ui-border);border-radius:9px;min-height:40px;max-height:min(240px,40dvh);padding:10px 12px;font-size:14px;line-height:1.5;resize:none;overflow-y:auto}
|
|
324
|
-
.comment-thread .feedback-thread-actions{margin-top:6px}
|
|
325
|
-
.comment-thread .feedback-primary{border-radius:50%;width:40px;height:40px;padding:0;font-size:0;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text);margin:0;transition:opacity 150ms,transform 150ms}
|
|
326
|
-
.comment-thread .feedback-primary:disabled{opacity:.35;cursor:not-allowed}
|
|
327
|
-
.comment-thread .feedback-primary:not(:disabled):active{transform:scale(.96)}
|
|
328
|
-
.comment-thread .feedback-resolve{background:transparent;color:var(--chisel-ui-secondary);border:0;border-radius:6px;padding:6px;font-size:12px;min-height:40px}
|
|
329
|
-
.comment-thread .feedback-resolve:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
330
|
-
@media(prefers-reduced-motion:reduce){.comment-thread .feedback-primary{transition:none}}
|
|
331
|
-
@media(prefers-reduced-motion:reduce){.comment-box-saving{animation:none}
|
|
332
|
-
}
|
|
333
|
-
.comment-thread .feedback-preview{display:inline-flex;align-items:center;gap:6px;align-self:flex-start;min-height:40px;margin-left:36px;padding:5px 9px;border:1px solid var(--chisel-ui-border);border-radius:6px;background:var(--chisel-ui-raised);color:var(--chisel-ui-secondary);font-size:11px}
|
|
334
|
-
.comment-thread .feedback-preview[aria-pressed=true]{border-color:var(--chisel-ui-focus);background:var(--chisel-ui-accent-surface)}
|
|
335
|
-
.comment-thread .feedback-preview:disabled{opacity:.5;cursor:not-allowed}
|
|
336
|
-
.feedback-proposal-actions{display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding:0 12px 8px}
|
|
337
|
-
.comment-thread .feedback-proposal-actions .feedback-preview{margin:0;padding:0 8px;border:0;border-radius:8px;background:transparent;font-size:12px;min-height:40px}
|
|
338
|
-
.comment-thread .feedback-proposal-actions .feedback-preview:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
339
|
-
.comment-thread .feedback-proposal-actions .feedback-preview[aria-pressed=true]{background:var(--chisel-ui-accent-surface);color:var(--chisel-ui-accent-text)}
|
|
340
|
-
@media(pointer:coarse){.feedback-toolbar button{height:44px}.feedback-tabs button,.feedback-account summary{min-width:44px}.feedback-review-invite summary{min-height:44px}.feedback-pin:after{content:"";position:absolute;inset:-2px;border-radius:inherit}.feedback-account summary,.feedback-review-invite button,.feedback-shell .feedback-primary{min-height:44px}.feedback-shell .comment-window-drag,.feedback-thread-header-actions .feedback-thread-close{width:44px;height:44px}.comment-box-footer{height:60px;min-height:60px}.comment-box-footer button{height:44px;width:44px}.comment-box-footer .comment-box-submit{width:44px}}
|
|
341
|
-
@media(forced-colors:active){.feedback-sidebar-panel,.comment-box,.feedback-composer.comment-thread,.feedback-confirmation,.feedback-account>div{border:1px solid CanvasText;box-shadow:none;background:Canvas;color:CanvasText}.feedback-shell button[aria-pressed=true]{outline:1px solid Highlight;outline-offset:-2px}.feedback-shell input,.feedback-shell textarea,.comment-box-number{border:1px solid CanvasText}.feedback-avatar{border:1px solid CanvasText}}
|
|
342
|
-
|
|
343
|
-
`;function tt(){return er("style",{children:ar})}function ot(a,t){if(t.type==="create")return t.comment;let r=a.find(o=>o.id===t.id);if(!r)throw new Error("This comment no longer exists. Reload and try again.");switch(t.type){case"edit":return{...r,text:t.text,changes:t.changes,...t.body===void 0?{}:{body:t.body}};case"edit_reply":return{...r,replies:r.replies.map(o=>typeof o!="string"&&o.id===t.replyId?{...o,text:t.text,body:t.body}:o)};case"resolve":return{...r,resolved:t.resolved};case"reply":return{...r,replies:[...r.replies,t.reply]}}}function La(a,t){return a.some(r=>r.id===t.id)?a.map(r=>r.id===t.id?t:r):[...a,t]}function Oa(a,t){return a.filter(r=>r.id!==t)}function Ea(a){let t=new Map;for(let r of[a,...a.replies]){if(typeof r=="string")continue;let o=r.authorId?`id:${r.authorId}`:`name:${r.author}`;t.has(o)||t.set(o,{author:r.author,authorImage:r.authorImage})}return[...t.values()]}function Co(a,t,r){let o=r.trim().toLocaleLowerCase();return a.filter(l=>(t==="all"||l.resolved===(t==="resolved"))&&[l.text,l.author,l.path,...(l.attachments??[]).map(f=>f.name),...l.replies.map(f=>typeof f=="string"?f:`${f.author} ${f.text}`)].some(f=>f.toLocaleLowerCase().includes(o)))}function bo(a,t=Date.now()){let r=Math.max(0,t-Date.parse(a));if(!Number.isFinite(r))return"";if(r<6e4)return"Just now";let[o,l]=r<36e5?["minute",6e4]:r<864e5?["hour",36e5]:["day",864e5];return new Intl.RelativeTimeFormat(void 0,{numeric:"always"}).format(-Math.floor(r/l),o)}var rt="chisel-feedback-v1",Na=process.env.NODE_ENV!=="production";function ko(a,t){let r=`<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 40 40"><defs><filter id="shadow" x="-25%" y="-25%" width="150%" height="150%"><feDropShadow dx="0" dy="2" stdDeviation="2" flood-opacity=".16"/></filter></defs><path d="M4 20a16 16 0 1 1 16 16H4Z" fill="${a}" stroke="${t}" filter="url(#shadow)"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(r)}") 3 3, crosshair`}function dt(a){for(let r of["data-chisel-id","data-ai-edit","data-component","id"]){let o=a.getAttribute(r);if(o){let l=`[${r}="${CSS.escape(o)}"]`,f=a.ownerDocument.querySelectorAll(l);if(f.length===1&&f[0]===a)return l}}let t=a.parentElement;return t?`${dt(t)} > :nth-child(${Array.from(t.children).indexOf(a)+1})`:a.tagName.toLowerCase()}function So({user:a,validateSession:t,signOut:r,commentStore:o,canManageComments:l=!1,getReviewLink:f,collaboration:i,commentUI:p}){let{confirm:C,dialog:v}=ho(),w=W(null),[P,S]=R([]),[b,T]=R("/"),[E,j]=R(["/"]),[_,de]=R([]),[A,N]=R(Na?"edit":"comment"),c=W(A),g=W(null),le=W(null),m=W(null),z=W(!1),q=W(null),X=W(""),De=W(!1),$=W(!1),ue=W(null),K=W(null),ge=W(null),[Ae,We]=R(null),[ae,je]=R(!1),[se,_e]=R(!1),U=W(se);U.current=se;let[J,fe]=R(null),[Q,D]=R(null),B=W(Q);B.current=Q;let[L,ie]=R(null),M=W(L),Ve=W(!1);M.current=L;let[Ga,me]=R(null),[lt,Ia]=R(void 0),[Z,yo]=R(null),[vo,Ue]=R(null),[Po,Xe]=R(""),[Be,pe]=R(""),[Y,Se]=R(null);Pe(()=>{Se(null),$.current=!1},[Q]);let[Je,Do]=R("open"),[Ca,Ao]=R(""),[ut,te]=R(""),[st,ba]=R(!!o),[Ie,ka]=R(!1),[we,it]=R(null),[Wa,ft]=R(null),[nt,Bo]=R(""),[Sa,ct]=R(!1),[pt,wa]=R(""),Ce=W(!1),He=W(0),Qe=W(null),mt=W(!1),Va=W(null),[Ye,ht]=R({x:0,y:0});X.current=Be,K.current||(K.current=Lo(()=>{let e=document.activeElement,d=g.current?.contains(e)&&e?.matches('input,textarea,[contenteditable="true"]');!q.current||X.current.trim()||De.current||$.current||d||gt()}));let s=P.find(e=>e.id===Q),ya=we?.type==="resolve"&&we.id===s?.id?we:null,xt=ya?ya.resolved?"Resolving thread\u2026":"Reopening thread\u2026":s?.resolved?"Reopen thread":"Resolve thread";async function Lt(e=!1){if(!(!f||Sa)){ct(!0),wa("");try{let d=await f(e);Bo(d);try{await navigator.clipboard.writeText(d),wa(e?"New link copied. The previous link no longer accepts new reviewers.":"Link copied. Your client can sign in with any Google account.")}catch{wa("Select and copy the review link below.")}}catch{wa("The review link could not be created. Please try again.")}finally{ct(!1)}}}async function gt(){if((X.current.trim()||De.current||$.current)&&!await ne()||(K.current?.cancel(),q.current=null,z.current))return;z.current=!0;let e=g.current?Ha(g.current,!0,m.current):null;m.current=e;let d=()=>{!z.current||m.current!==e||(z.current=!1,ye(),D(null),pe(""))};e?e.finished.then(d,()=>{}):d()}function Xa(){K.current?.cancel(),z.current&&(z.current=!1,m.current=g.current?Ha(g.current,!1,m.current):null)}function va(){m.current?.cancel(),m.current=null,z.current=!1,je(!0)}async function It(e){if(!await ne()||Ce.current)return;let d=null;try{d=e.selector?Z?.querySelector(e.selector)??null:null}catch{}if(!d){te("This element is no longer on the page. Its changes cannot be edited.");return}ye(),K.current?.cancel(),pe(""),ue.current=null,fe(e.id),Xe(e.text),ie(e)}function Ct(e){K.current?.cancel(),!(L||e.path!==b||(Be.trim()||De.current||$.current)&&Q!==e.id)&&(Q===e.id&&ae||(q.current=e.id,Da(e,!0)))}function ye(){ge.current?.(),ge.current=null,We(null)}async function ne(){return!Ce.current&&(!(M.current&&Ve.current)&&!X.current.trim()&&!De.current&&!$.current||await C({title:"Discard this draft?",description:"Your comment and unsaved preview changes will be discarded.",action:"Discard draft",danger:!0}))}async function Pa(e){if(e===c.current||!await ne())return;K.current?.cancel(),q.current=null,ye(),N(e),c.current=e,ie(null),fe(null),me(null),e==="comment"&&_e(!1);let d=w.current?.contentDocument;d?.documentElement&&(d.documentElement.dataset.chiselMode=e,w.current?.contentWindow?.dispatchEvent(new Event("chisel:mode")));let n=new URL(window.location.href);n.searchParams.set("mode",e),window.history.replaceState(window.history.state,"",n)}function Mo(){let e=w.current?.contentDocument;if(!e)return;let d=Array.from(e.querySelectorAll("a[href]:not([download])"),n=>Ne(n.href,window.location.origin));de([...new Set(d.filter(n=>n!==null))])}async function Fo(e){let d=Ne(e,window.location.origin,b);if(!d)throw new Error("Enter a page path or URL from this site.");if(d===b)return!0;if(!await ne())return!1;let n=w.current?.contentWindow;return n?(K.current?.cancel(),q.current=null,ye(),ie(null),fe(null),D(null),me(null),Ue(null),Xe(""),pe(""),Qe.current=null,ue.current=null,Ve.current=!1,De.current=!1,n.location.assign(d),!0):!1}function ce(e){if(e.area){let I=at(e.area,Z,Ye);return{rect:void 0,x:I.left,y:I.top}}let d=null;try{d=e.selector?Z?.querySelector(e.selector)??null:null}catch{}let n=d?.getBoundingClientRect();return{rect:n,x:n?n.left+n.width*(e.offsetX??0):e.x-Ye.x,y:n?n.top+n.height*(e.offsetY??0):e.y-Ye.y}}async function Da(e,d=!1){let n=Ne(e.path,window.location.origin);if(!n){te("This comment's page cannot be opened in the preview.");return}if(!d&&!await ne()||(Xa(),d||i?.markRead(e.id),d||(va(),q.current=null),Q===e.id&&b===e.path))return;je(!d),ye(),D(e.id),ie(null),me(null),Ue(e),pe(""),ue.current=null;let I=w.current?.contentDocument;if(I?.documentElement&&e.selector&&(I.documentElement.dataset.chiselSelection=e.selector),b!==n){w.current?.contentWindow?.location.assign(n);return}let V=ce(e);d||w.current?.contentWindow?.scrollTo({top:Math.max(0,V.y+Ye.y-180),behavior:"smooth"})}async function be(e,d=[]){if(Ce.current)return!1;Ce.current=!0,ka(!0),it(e),++He.current;let n=e.type==="create"?e.comment.id:e.id,I=P.find(ee=>ee.id===n),V=!1;try{if(e.type==="create"||e.type==="reply"){let H=e.type==="create"?{...e.comment,body:e.body,attachments:d,pending:!0}:ot(P,{...e,reply:{...e.reply,body:e.body,attachments:d,date:new Date().toISOString(),pending:!0}});S(he=>La(he,{...H,pending:!0})),ba(!1),te(""),V=!0}if(!await t())throw new Error("Your session has expired. Reload this page to sign in again.");let ee=o?await o.mutate(e):ot(P,e);return++He.current,o||localStorage.setItem(rt,JSON.stringify(La(P,ee))),S(H=>La(H,ee)),ba(!1),te(""),!0}catch(ee){return V&&S(H=>I?La(H,I):Oa(H,n)),te(ee instanceof Error?ee.message:"Your comment could not be saved. Your draft is still here; please try again."),!1}finally{Ce.current=!1,ka(!1),it(null)}}async function Ro(e){if(!(Ce.current||!await C({title:"Delete this comment?",description:"The comment and all its replies will be permanently deleted.",action:"Delete comment",danger:!0}))){Ce.current=!0,ka(!0),ft(e.id),te(""),++He.current;try{if(!await t()){te("Your session has expired. Reload this page to sign in again.");return}if(o){if(!o.delete)throw new Error("Comment deletion is unavailable");await o.delete(e.id)}else localStorage.setItem(rt,JSON.stringify(Oa(P,e.id)));++He.current,B.current===e.id&&(ye(),D(null),pe(""),Ue(null)),S(d=>Oa(d,e.id)),te("")}catch{te("The comment could not be deleted. Please try again.")}finally{Ce.current=!1,ka(!1),ft(null)}}}function Ka(){let e=w.current?.contentDocument,d=w.current?.contentWindow;if(!e?.documentElement||!d)return;let n=Qa(d);if(n===null||e===Va.current)return;if(Va.current=null,!mt.current){if(mt.current=!0,!o)try{let O=JSON.parse(localStorage.getItem(rt)||"[]");if(!Array.isArray(O)||O.some(ke=>typeof ke.id!="string"||typeof ke.text!="string"||!Array.isArray(ke.replies)))throw Error();S(O)}catch{te("Saved comments could not be loaded.")}let h=new URLSearchParams(window.location.search).get("mode"),y=h==="browse"?"view":h;y&&["edit","comment","view"].includes(y)&&(y!=="edit"||Na)&&(N(y),c.current=y);let G=new URLSearchParams(window.location.search).get("path");if(G){let O=Ne(G,window.location.origin);if(!O)te("That preview page is invalid. Enter a URL from this site.");else if(O!==n){if(O.split("#")[0]!==n.split("#")[0]){Va.current=e,d.location.replace(O);return}d.location.replace(O),n=O}}}if(T(n),yo(e),!d.chiselReady){e.addEventListener("chisel:ready",Ka,{once:!0});return}let I=e.documentElement;if(I.dataset.feedbackBound)return;I.dataset.feedbackBound="true";let V=e.createElement("style");V.textContent=`
|
|
344
|
-
html[data-chisel-mode="comment"]:not([data-chisel-comments-hidden="true"]) { --chisel-comment-cursor:${ko("#ffffff","#e2e2e2")};cursor:var(--chisel-comment-cursor) !important; }
|
|
1
|
+
"use client";import{useEffect as Ae,useLayoutEffect as Wa,useRef as W,useState as T}from"react";import{forwardRef as ko,createElement as So}from"react";var At=a=>a?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function Dt(a,t,r=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:At(a),size:24,node:t,...r.length>0?{aliases:r}:{}}}var Mt=a=>{let t="",r=!1;for(let o of a){if(o==="-"||o==="_"||o<=" "){r=t.length>0;continue}t.length===0?t+=o.toLowerCase():t+=r?o.toUpperCase():o,r=!1}return t};var Bt=a=>{let t=Mt(a);return t.charAt(0).toUpperCase()+t.slice(1)};import{forwardRef as bo,createElement as Ut}from"react";var ta=(...a)=>a.filter((t,r,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===r).join(" ").trim();var Re={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function Qa(a){return a!=null}function Ft(a,t={}){let r=t.attributeNames??{},o=w=>r[w]??w,l=a.size??a.width??Re.width,f=a.size??a.height??Re.height,i=a.aliases?.filter(w=>typeof w=="string"&&w.trim()!=="").map(w=>`lucide-${w}`)??[],p=[...a.name?[`lucide-${a.name}`]:[],...i],C=t.className?.split(" ").filter(Boolean)??[],v=t.includeDefaultClasses===!1?ta(...C):ta("lucide",...p,...C),y=t.absoluteStrokeWidth?Number(t.strokeWidth??Re["stroke-width"])*Number(a.size??a.width??Re.width)/Number(t.size??t.width??Re.width):t.strokeWidth??Re["stroke-width"];return["svg",{...Object.entries(Re).reduce((w,[b,q])=>(w[o(b)]=q,w),{}),..."color"in t&&t.color&&{[o("stroke")]:t.color},..."size"in t&&Qa(t.size)&&{[o("width")]:t.size,[o("height")]:t.size},..."width"in t&&Qa(t.width)&&{[o("width")]:t.width},..."height"in t&&Qa(t.height)&&{[o("height")]:t.height},[o("stroke-width")]:y,...v&&{[o("class")]:v},[o("viewBox")]:`0 0 ${l} ${f}`,...t.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},a.node.map(w=>{let[b,q,O]=w,J=t.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...q}:q;return O?[b,J,O]:[b,J]})]}function Rt(a,t={}){return Ft(a,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var Tt=a=>{for(let t in a)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};import{createContext as go,useContext as Io,useMemo as vr,createElement as Pr}from"react";var Co=go({});var qt=()=>Io(Co);var Ht=bo(({color:a,size:t,width:r,height:o,strokeWidth:l,absoluteStrokeWidth:f,nonScalingStroke:i,className:p="",children:C,iconNode:v=[],icon:y={node:v,aliases:[],size:24},...P},w)=>{let{size:b=24,strokeWidth:q=2,absoluteStrokeWidth:O=!1,nonScalingStroke:J=!1,color:_="currentColor",className:de=""}=qt()??{},D=!!C||Tt(P),[N,c,g=[]]=Rt(y,{color:a??_,width:r??t??b,height:o??t??b,strokeWidth:l??q,absoluteStrokeWidth:f??O,nonScalingStroke:i??J,className:ta(de,p),hasA11yProp:D,attributes:P});return Ut(N,{ref:w,...c},[...g.map(([le,m])=>Ut(le,m)),...Array.isArray(C)?C:[C]])});function k(a,t=[],r=[]){let o=typeof a=="string"?Dt(a,t,r):a,l=ko(({className:f,...i},p)=>So(Ht,{ref:p,icon:o,className:f,...i}));return o.name&&(l.displayName=Bt(o.name)),l}var wo={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]},oa=k(wo);var yo={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]},ra=k(yo);var vo={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]},Oe=k(vo);var Po={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]},da=k(Po);var Ao={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]},ze=k(Ao);var Do={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]},Te=k(Do);var Mo={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]},la=k(Mo);var Bo={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]},ua=k(Bo);var Fo={name:"grip-horizontal",size:24,node:[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]},sa=k(Fo);var Ro={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]},ia=k(Ro);var To={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]},qe=k(To);var qo={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]},fa=k(qo);var Uo={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]},$e=k(Uo);var Ho={name:"mouse-pointer-2",size:24,node:[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]},na=k(Ho);var Eo={name:"pencil",size:24,node:[["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"}]]},Ze=k(Eo);var Oo={name:"pipette",size:24,node:[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]},ca=k(Oo);var zo={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]},pa=k(zo);var No={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]},ma=k(No);var Wo={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]},Ne=k(Wo);var Go={name:"trash",size:24,node:[["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"}]],aliases:["trash-2"]},Ue=k(Go);var Vo={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]},ha=k(Vo);import{useEffect as Vt,useId as Zo,useState as Pe}from"react";import{useEffect as Xo,useRef as Ot,useState as Je}from"react";import{createPortal as Ko}from"react-dom";function Et(a,t,r,o=1){a/=255,t/=255,r/=255;let l=Math.max(a,t,r),f=Math.min(a,t,r),i=l-f;return{h:(i?l===a?((t-r)/i+6)%6:l===t?(r-a)/i+2:(a-t)/i+4:0)*60,s:l?i/l:0,v:l,a:o}}function Fa({h:a,s:t,v:r,a:o}){let l=f=>{let i=(f+a/60)%6;return Math.round(255*r*(1-t*Math.max(0,Math.min(i,4-i,1)))).toString(16).padStart(2,"0")};return`#${l(5)}${l(3)}${l(1)}${o<1?Math.round(o*255).toString(16).padStart(2,"0"):""}`}function Ra(a){if(typeof document<"u"){let t=document.createElement("canvas");t.width=t.height=1;let r=t.getContext("2d");if(r){r.fillStyle=a,r.fillRect(0,0,1,1);let[o,l,f,i]=r.getImageData(0,0,1,1).data;return Et(o,l,f,i/255)}}return Et(0,0,0)}import{jsx as xe,jsxs as xa}from"react/jsx-runtime";function Ya({label:a,value:t,onChange:r,disabled:o}){let l=Ot(null),f=Ot(null),[i,p]=Je(null),[C,v]=Je({h:0,s:0,v:0,a:1}),[y,P]=Je(""),[w,b]=Je(!1),[q,O]=Je(!1),[J,_]=Je(!1);function de(){p(null)}Xo(()=>{if(!i)return;let c=U=>{!f.current?.contains(U.target)&&!l.current?.contains(U.target)&&de()},g=U=>{U.key==="Escape"&&(U.preventDefault(),U.stopPropagation(),de(),l.current?.focus())},le=l.current?.getBoundingClientRect(),m=U=>{if(f.current?.contains(U.target))return;let V=l.current?.getBoundingClientRect();(V?.top!==le?.top||V?.left!==le?.left)&&de()};return document.addEventListener("pointerdown",c),document.addEventListener("keydown",g,!0),window.addEventListener("resize",de),document.addEventListener("scroll",m,!0),f.current?.querySelector("input")?.focus({preventScroll:!0}),()=>{document.removeEventListener("pointerdown",c),document.removeEventListener("keydown",g,!0),window.removeEventListener("resize",de),document.removeEventListener("scroll",m,!0)}},[i]);function D(c){c.a===0&&(c={...c,a:1}),v(c);let g=Fa(c);P(g.slice(1).toUpperCase()),b(!1),r(g)}function N(c){let g=c.currentTarget.getBoundingClientRect();D({...C,s:Math.max(0,Math.min(1,(c.clientX-g.left)/g.width)),v:1-Math.max(0,Math.min(1,(c.clientY-g.top)/g.height))})}return xa("div",{className:"comment-box-color",children:[xe("button",{ref:l,className:"comment-color-trigger",type:"button","aria-label":`${a} picker`,"aria-haspopup":"dialog","aria-expanded":!!i,disabled:o,onClick:()=>{if(i){de();return}let c=Ra(t);v(c),P(Fa(c).slice(1).toUpperCase()),b(!1),O("EyeDropper"in window);let g=l.current.getBoundingClientRect();p({left:Math.max(8,Math.min(g.right-256,window.innerWidth-264)),top:Math.max(8,Math.min(g.bottom+8,window.innerHeight-330))})},children:xe("span",{style:{background:t}})}),xe("span",{className:"comment-color-value",title:t,children:t}),i&&Ko(xa("div",{ref:f,className:"chisel-color-picker",role:"dialog","aria-label":`${a} color picker`,style:i,onKeyDown:c=>{if(c.key!=="Tab")return;let g=Array.from(f.current.querySelectorAll("button:not(:disabled), input:not(:disabled)"));c.shiftKey&&document.activeElement===g[0]?(c.preventDefault(),g[g.length-1]?.focus()):!c.shiftKey&&document.activeElement===g[g.length-1]&&(c.preventDefault(),g[0]?.focus())},children:[xa("div",{className:"chisel-color-plane",style:{backgroundColor:`hsl(${C.h} 100% 50%)`},onPointerDown:c=>{c.currentTarget.setPointerCapture(c.pointerId),N(c)},onPointerMove:c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&N(c)},children:[xe("span",{className:"chisel-color-thumb",style:{left:`${C.s*100}%`,top:`${(1-C.v)*100}%`,background:Fa({...C,a:1})}}),xe("input",{className:"chisel-color-accessible",type:"range","aria-label":`${a} saturation`,min:0,max:100,value:Math.round(C.s*100),onChange:c=>D({...C,s:Number(c.target.value)/100})}),xe("input",{className:"chisel-color-accessible",type:"range","aria-label":`${a} brightness`,min:0,max:100,value:Math.round(C.v*100),onChange:c=>D({...C,v:Number(c.target.value)/100})})]}),xa("div",{className:"chisel-color-tools",children:[xe("input",{className:"chisel-color-hue",type:"range","aria-label":`${a} hue`,min:0,max:360,value:Math.round(C.h),style:{"--hue":`hsl(${C.h} 100% 50%)`},onChange:c=>D({...C,h:Number(c.target.value)})}),xe("button",{type:"button","aria-label":`Pick ${a.toLowerCase()} from screen`,title:q?"Pick a color from the screen":"Screen color picker is not supported in this browser",disabled:!q||J,onClick:async()=>{let c=window.EyeDropper;if(c){_(!0);try{let g=await new c().open();f.current&&D(Ra(g.sRGBHex))}catch{}finally{_(!1)}}},children:xe(ca,{size:18})})]}),xa("label",{className:"chisel-color-hex",children:["HEX",xe("input",{"aria-label":`${a} hex`,value:y,maxLength:9,spellCheck:!1,"aria-invalid":w,onChange:c=>{let g=c.target.value.replace(/^#/,"");P(g);let le=/^(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(g);if(b(!le),le){let m=Ra(`#${g}`);v(m),r(`#${g}`)}}})]}),w&&xe("span",{className:"chisel-color-error",role:"status",children:"Enter a valid hex color."})]}),document.body)]})}import{useRef as $o}from"react";import{jsx as zt}from"react/jsx-runtime";function La({onMoveStart:a}){let t=$o(null);function r(o,l,f){let i=o.closest(".comment-box,.comment-thread"),p=i?.closest(".feedback-viewport");if(!i||!p)return;let C=p.getBoundingClientRect(),v=i.getBoundingClientRect();for(let[y,P]of[["x",Math.max(C.left+8-v.left,Math.min(l,C.right-8-v.right))],["y",Math.max(C.top+8-v.top,Math.min(f,C.bottom-8-v.bottom))]]){let w=`--comment-drag-${y}`;i.style.setProperty(w,`${(parseFloat(i.style.getPropertyValue(w))||0)+P}px`)}}return zt("button",{type:"button",className:"comment-window-drag","aria-label":"Move comment window",title:"Drag to move \xB7 Arrow keys to nudge",onPointerDown:o=>{!o.isPrimary||o.button!==0||(o.preventDefault(),a?.(),o.currentTarget.closest(".comment-box,.comment-thread")?.getAnimations().forEach(l=>l.cancel()),o.currentTarget.setPointerCapture(o.pointerId),t.current={id:o.pointerId,x:o.clientX,y:o.clientY},o.currentTarget.dataset.dragging="true")},onPointerMove:o=>{let l=t.current;!l||l.id!==o.pointerId||(r(o.currentTarget,o.clientX-l.x,o.clientY-l.y),l.x=o.clientX,l.y=o.clientY)},onPointerUp:o=>{o.currentTarget.hasPointerCapture(o.pointerId)&&o.currentTarget.releasePointerCapture(o.pointerId)},onLostPointerCapture:o=>{t.current=null,delete o.currentTarget.dataset.dragging},onKeyDown:o=>{let l={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[o.key];if(!l)return;o.preventDefault(),o.stopPropagation(),a?.();let f=o.shiftKey?40:10;r(o.currentTarget,l[0]*f,l[1]*f)},children:zt(sa,{size:16,"aria-hidden":"true"})})}function Nt(a,t,r,o){let l={[a]:t},f=r.find(i=>i!==a);if(!f||!r.includes(a))return l;if(r.includes("width")){let i=parseFloat(o.width)/parseFloat(o.height),p=parseFloat(t);if(!Number.isFinite(i)||i<=0||!Number.isFinite(p))return l;l[f]=`${a==="width"?p/i:p*i}px`}else l[f]=t;return l}var Wt=new Set(["color","background-color","opacity","font-family","font-size","font-weight","border-color","border-width","width","height",...["padding","margin"].flatMap(a=>["top","right","bottom","left"].map(t=>`${a}-${t}`))]);function Gt(a,t){let r={...a},o={...a};for(let l of Array.isArray(t)?t:[])!l||!Object.prototype.hasOwnProperty.call(a,l.property)||typeof l.before!="string"||typeof l.after!="string"||l.property!=="text"&&(!Wt.has(l.property)||!CSS.supports(l.property,l.after))||(r[l.property]=l.before,o[l.property]=l.after);return{initial:r,values:o}}function Ta(a,t){if(!Array.isArray(t))return()=>{};let r=a.style,o=a.getAttribute("style"),l=a.textContent,f=!1;for(let p of t)!p||typeof p.after!="string"||(p.property==="text"&&!a.children.length?(a.textContent=p.after,f=!0):r&&Wt.has(p.property)&&CSS.supports(p.property,p.after)&&r.setProperty(p.property,p.after,"important"));let i=!1;return()=>{i||(i=!0,o===null?a.removeAttribute("style"):a.setAttribute("style",o),f&&!a.children.length&&(a.textContent=l))}}import{Fragment as Qo,jsx as R,jsxs as re}from"react/jsx-runtime";var Kt=[["Text color","color","color"],["Background","background-color","color"],["Opacity","opacity","number"],["Font","font-family","font"],["Font size","font-size","number"],["Font weight","font-weight","weight"],["Border color","border-color","color"],["Border width","border-width","number"]],Jo=["top","bottom","left","right"],Xt=[{label:"Size",pairs:[["width","height"]]},...["padding","margin"].map(a=>({label:a[0].toUpperCase()+a.slice(1),pairs:[[`${a}-top`,`${a}-bottom`],[`${a}-left`,`${a}-right`]]}))];function _o(a){let t=a.ownerDocument.defaultView.getComputedStyle(a);return Object.fromEntries([["text",a.children.length?"":a.textContent??""],...["width","height"].map(r=>[r,t.getPropertyValue(r)]),...Kt.map(([,r])=>[r,t.getPropertyValue(r)]),...["padding","margin"].flatMap(r=>Jo.map(o=>[`${r}-${o}`,t.getPropertyValue(`${r}-${o}`)]))])}function ja({target:a,text:t,onText:r,onCancel:o,onPost:l,style:f,changes:i=[],editing:p=!1,commentId:C,renderComposer:v,hasExistingAttachments:y=!1,onDraftChange:P,hidden:w=!1}){let[b]=Pe(()=>Gt(a?_o(a):{},i)),q=b.initial,[O,J]=Pe(b.values),[_]=Pe(()=>({style:a?.getAttribute("style")??null,text:a?.textContent??null})),[de,D]=Pe({}),[N,c]=Pe(!1),[g]=Pe(t),[le,m]=Pe(!1),[z,U]=Pe(""),[V,De]=Pe(!1),K=Zo();function ue(){a&&(_.style===null?a.removeAttribute("style"):a.setAttribute("style",_.style),a.children.length||a.replaceChildren(a.ownerDocument.createTextNode(_.text??"")))}function X(){ue(),o()}Vt(()=>(a&&Ta(a,i),ue),[a,_]);function ge(H,Q){if(!a)return;if(H==="text"){J(A=>({...A,text:Q})),a.children.length||a.replaceChildren(a.ownerDocument.createTextNode(Q));return}let fe=Xt.flatMap(A=>A.pairs).find(A=>A.includes(H)&&de[A.join(":")]),Y=fe?Nt(H,Q,fe,q):{[H]:Q};J(A=>({...A,...Y}));for(let[A,M]of Object.entries(Y))CSS.supports(A,M)&&a.style.setProperty(A,M,"important")}let Me=Object.entries(O).some(([H,Q])=>Q!==q[H]),Ve=!!(t.trim()||Me||le||p&&t!==g);Vt(()=>(P?.(Ve),()=>P?.(!1)),[Ve,P]);async function ae(H=t,Q,fe,Y){if(N||!H.trim()&&!fe?.length&&!y)return!1;let A=Object.entries(O).filter(([M,L])=>L!==q[M]).map(([M,L])=>({property:M,before:q[M],after:L}));if(A.some(M=>M.property!=="text"&&!CSS.supports(M.property,M.after)))return U("Check the style values before posting."),!1;c(!0),U("");try{let M=await l(A,H.trimEnd(),Q,fe,Y);return M?X():U("Could not post. Your changes are still here; please try again."),M}catch{return U("Could not post. Please try again."),!1}finally{c(!1)}}let _e=(H,Q=!1,fe=!1,Y)=>re(Qo,{children:[re("div",{className:"comment-box-prompt",children:[a&&R("button",{type:"button",className:"comment-box-symbol","aria-label":"Comment settings",title:"Comment settings","aria-expanded":V,"aria-controls":K,disabled:N,onClick:()=>De(A=>!A),children:R(Ne,{})}),H]}),a&&re("div",{className:"comment-box-settings",id:K,hidden:!V,children:[re("div",{className:"comment-box-element",children:[re("code",{children:["<",a.tagName.toLowerCase(),">"]}),Me&&R("span",{className:"comment-box-preview-status",role:"status",children:"Unsaved preview"}),R(La,{})]}),re("fieldset",{className:"comment-box-properties",disabled:N||!V,children:[re("label",{className:"comment-box-row",children:[R("span",{children:"Text"}),R("input",{"aria-label":"Element text",value:O.text,disabled:!!a.children.length,title:a.children.length?"Select a text-only element to change its text":void 0,onChange:A=>ge("text",A.target.value)})]}),["Typography","Appearance"].map(A=>re("div",{className:"comment-box-control-group",children:[R("h3",{children:A}),Kt.filter(([,M])=>A==="Typography"===["color","font-family","font-size","font-weight"].includes(M)).map(([M,L,ie])=>re("div",{className:"comment-box-row",children:[R("span",{children:M}),ie==="color"?V&&R(Ya,{label:M,value:O[L],disabled:N,onChange:B=>ge(L,B)}):ie==="font"?R("select",{"aria-label":M,value:O[L],onChange:B=>ge(L,B.target.value),children:Array.from(new Set([q[L],"Arial, sans-serif","Georgia, serif","system-ui","monospace"])).map(B=>R("option",{value:B,children:B},B))}):ie==="weight"?R("select",{"aria-label":M,value:O[L],onChange:B=>ge(L,B.target.value),children:Array.from(new Set([q[L],...[100,200,300,400,500,600,700,800,900].map(String)])).map(B=>R("option",{children:B},B))}):re("div",{className:"comment-box-number",children:[R("input",{type:"number","aria-label":M,value:Number.isFinite(parseFloat(O[L]))?parseFloat(O[L]):"",min:0,max:L==="opacity"?1:void 0,step:"any",onChange:B=>ge(L,B.target.value+(L==="opacity"?"":"px"))}),L!=="opacity"&&R("span",{children:"px"})]})]},L))]},A)),Xt.map(A=>re("details",{className:"comment-box-group",open:!0,children:[re("summary",{children:[A.label,R(ze,{size:12,"aria-hidden":"true"})]}),A.pairs.map(M=>{let L=M.join(":"),ie=A.label==="Size"?"Lock aspect ratio":`Link ${A.label.toLowerCase()} ${M[0].split("-")[1]} and ${M[1].split("-")[1]}`;return re("div",{className:"comment-box-pair",children:[R("button",{className:"comment-box-link",type:"button","aria-label":ie,title:ie,"aria-pressed":!!de[L],onClick:()=>D(B=>({...B,[L]:!B[L]})),children:R(ia,{size:12})}),M.map(B=>{let Xe=B.includes("-")?B.split("-")[1]:B;return re("label",{className:"comment-box-row",children:[R("span",{children:Xe[0].toUpperCase()+Xe.slice(1)}),re("span",{className:"comment-box-number",children:[R("input",{type:"number",step:"any",min:B.startsWith("margin-")?void 0:0,"aria-label":B.replace("-"," ").replace(/^width$/,"Width").replace(/^height$/,"Height"),value:Number.isFinite(parseFloat(O[B]))?parseFloat(O[B]):"",onChange:Va=>ge(B,`${Va.target.value}px`)}),R("span",{children:"px"})]})]},B)})]},L)})]},A.label))]})]}),z&&R("p",{className:"comment-box-error",role:"alert",children:z}),re("footer",{className:"comment-box-footer",children:[R("button",{type:"button",className:"comment-box-cancel",onClick:X,disabled:N,children:"Cancel"}),R("span",{}),Y,R("button",{type:"submit",className:"comment-box-submit","aria-label":p?"Save comment":"Post comment",title:p?"Save comment":"Post comment",disabled:N||fe||!t.trim()&&!Q&&!y,children:N?R("span",{className:"comment-box-saving"}):R(Oe,{})})]})]}),se=`comment-box${v?" comment-box-native":""}`,Qe=H=>{H.key==="Escape"&&!N&&(H.preventDefault(),H.stopPropagation(),X())};return v?R("div",{className:se,hidden:w,"data-settings-open":V,style:f,onKeyDown:Qe,children:v({text:t,onText:r,disabled:N,commentId:C,onAttachmentDraftChange:m,onSubmit:ae,renderContent:_e})}):R("form",{className:se,hidden:w,"data-settings-open":V,style:f,"aria-label":p?"Edit comment":"New comment",onKeyDown:Qe,onSubmit:H=>{H.preventDefault(),ae()},children:_e(R("input",{"aria-label":"Comment",placeholder:"Leave a comment\u2026",value:t,onChange:H=>r(H.target.value),autoFocus:!0,maxLength:4e3,required:!0,disabled:N}))})}import{useEffect as Yo,useLayoutEffect as jo,useRef as Ua,useState as Ha}from"react";function We(a,t,r="/"){if(!a.trim())return null;try{let o=new URL(a.trim(),new URL(r,t)),l=decodeURIComponent(o.pathname);return!/^https?:$/.test(o.protocol)||o.origin!==t||o.username||o.password||/^\/(chisel|feedback)(\/|$)/.test(l)?null:o.pathname+o.search+o.hash}catch{return null}}function qa(a){return a.split(/[?#]/,1)[0]}function et(a){try{let{pathname:t,search:r,hash:o}=a.location;return t.startsWith("/")?t+r+o:null}catch{return null}}function $t(a,t){let r;try{r=a.history}catch{return()=>{}}let o=r.pushState,l=r.replaceState,f=!0,i=()=>{let v=et(a);f&&v!==null&&t(v)},p=function(...v){o.apply(this,v),i()},C=function(...v){l.apply(this,v),i()};return r.pushState=p,r.replaceState=C,a.addEventListener("popstate",i),a.addEventListener("hashchange",i),i(),()=>{f=!1,r.pushState===p&&(r.pushState=o),r.replaceState===C&&(r.replaceState=l),a.removeEventListener("popstate",i),a.removeEventListener("hashchange",i)}}import{Fragment as er,jsx as Le,jsxs as Ge}from"react/jsx-runtime";function at({path:a,routes:t,disabled:r,onNavigate:o,onOpen:l}){let f=Ua(null),i=Ua(null),p=Ua(null),C=Ua(!1),[v,y]=Ha(!1),[P,w]=Ha(""),[b,q]=Ha(!1),[O,J]=Ha(""),_=qa(a),de=[...new Set([a,...t].map(qa))],D=P.trim();if(/^https?:\/\//i.test(D))try{let m=new URL(D);m.origin===window.location.origin&&(D=m.pathname)}catch{}else D=qa(D);let N=D.toLocaleLowerCase(),c=de.filter(m=>m.toLocaleLowerCase().includes(N));function g(m=!1){f.current&&(f.current.open=!1),y(!1),m&&i.current?.focus({preventScroll:!0})}jo(()=>{if(!v)return;let m=()=>{let z=f.current,U=z?.closest(".feedback-sidebar-panel");z&&U&&z.style.setProperty("--feedback-page-space",`${Math.max(0,z.getBoundingClientRect().top-U.getBoundingClientRect().top-12)}px`)};return m(),p.current?.focus(),p.current?.select(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[v]),Yo(()=>{if(!v)return;let m=V=>{!C.current&&!f.current?.contains(V.target)&&g()},z=V=>{V.key!=="Escape"||C.current||(V.preventDefault(),V.stopPropagation(),g(!0))},U=()=>{C.current||g()};return document.addEventListener("pointerdown",m),document.addEventListener("keydown",z,!0),window.addEventListener("blur",U),()=>{document.removeEventListener("pointerdown",m),document.removeEventListener("keydown",z,!0),window.removeEventListener("blur",U)}},[v]);async function le(m){if(!(r||C.current)){C.current=!0,q(!0),J("");try{await o(m)&&g(!0)}catch(z){J(z instanceof Error&&z.message?z.message:"This page could not be opened. Try again.")}finally{C.current=!1,q(!1)}}}return Ge("details",{ref:f,className:"feedback-page-control",onToggle:m=>y(m.currentTarget.open),children:[Ge("summary",{ref:i,"aria-label":`Current page: ${a}`,"aria-disabled":r||b,tabIndex:r||b?-1:0,onClick:m=>{m.preventDefault(),!(r||b||!f.current)&&(f.current.open?g():(w(""),J(""),l?.(),f.current.open=!0,y(!0)))},children:[Le(ua,{"aria-hidden":"true"}),Le("span",{title:a,children:a}),Le(da,{className:"feedback-page-chevron","aria-hidden":"true"})]}),Ge("div",{className:"feedback-page-popover",children:[Ge("form",{className:"feedback-page-form",onSubmit:m=>{m.preventDefault(),le(P)},children:[Le("input",{ref:p,"aria-label":"Page URL or path",value:P,placeholder:"Enter a URL or path",autoComplete:"off",autoCapitalize:"off",spellCheck:!1,disabled:r||b,onChange:m=>{w(m.target.value),J("")}}),Le("button",{type:"submit","aria-label":"Go to page",title:"Go to page","aria-busy":b,disabled:r||b||!P.trim(),children:Le(oa,{"aria-hidden":"true"})})]}),O&&Le("p",{className:"feedback-page-error",role:"alert",children:O}),Ge("nav",{className:"feedback-page-routes","aria-label":"Known pages",children:[c.map(m=>Ge("button",{type:"button",title:m,"aria-current":m===_?"page":void 0,disabled:r||b,onClick:()=>{m===_?g(!0):le(m)},children:[Le("span",{children:N?Ge(er,{children:[m.slice(0,m.toLocaleLowerCase().indexOf(N)),Le("mark",{children:m.slice(m.toLocaleLowerCase().indexOf(N),m.toLocaleLowerCase().indexOf(N)+D.length)}),m.slice(m.toLocaleLowerCase().indexOf(N)+D.length)]}):m}),m===_&&Le(Oe,{"aria-hidden":"true"})]},m)),!c.length&&Le("p",{className:"feedback-page-empty",children:"No matching pages"})]})]})]})}import{useEffect as Jt,useRef as tt,useState as ar}from"react";import{jsx as ga,jsxs as Zt}from"react/jsx-runtime";function tr({request:a,finish:t,returnFocus:r}){let o=tt(null);return Jt(()=>(o.current?.showModal(),()=>r?.focus({preventScroll:!0})),[]),Zt("dialog",{ref:o,className:"feedback-confirmation","aria-labelledby":"feedback-confirmation-title","aria-describedby":"feedback-confirmation-description",onCancel:l=>{l.preventDefault(),t(!1)},children:[ga("h2",{id:"feedback-confirmation-title",children:a.title}),ga("p",{id:"feedback-confirmation-description",children:a.description}),Zt("div",{children:[ga("button",{type:"button",autoFocus:!0,onClick:()=>t(!1),children:"Cancel"}),ga("button",{type:"button","data-danger":a.danger,onClick:()=>t(!0),children:a.action})]})]})}function _t(){let[a,t]=ar(null),r=tt(null),o=tt(null);Jt(()=>()=>o.current?.(!1),[]);function l(i){o.current?.(i),o.current=null,t(null)}function f(i){return o.current?Promise.resolve(!1):(r.current=document.activeElement,t(i),new Promise(p=>{o.current=p}))}return{confirm:f,dialog:a&&ga(tr,{request:a,finish:l,returnFocus:r.current})}}function Qt(a){if(!(a.defaultPrevented||a.repeat||a.isComposing||a.ctrlKey||a.metaKey||a.altKey||a.composedPath().some(r=>{let o=r;return o.nodeType===1&&(o.isContentEditable||o.closest('input,textarea,select,[role="textbox"],[role="combobox"],[contenteditable]:not([contenteditable="false"])'))})))switch(a.key.toLowerCase()){case"c":return a.shiftKey?"toggle-comments":"comment";case"e":return"edit";case"v":return"view"}}function Yt(a){let t,r=()=>clearTimeout(t);return{cancel:r,schedule(){r(),t=setTimeout(a,70)}}}function jt(a,t,r){let p=(J,_)=>Math.max(8,Math.min(J,_)),C=a.x+36+8,v=a.x+-4-8-t.width,y=r.width-t.width-8,P=Math.max(0,r.height-16);if(C<=y||v>=8)return{left:p(C<=y?C:v,y),top:p(a.y,r.height-Math.min(t.height,P)-8),maxHeight:P};let w=p(a.y+36+8,r.height-8),b=p(a.y+-4-8,r.height-8),q=r.height-w-8,O=b-8;return q>=O?{left:p(a.x+-4,y),top:w,maxHeight:q}:{left:p(a.x+-4,y),top:b-Math.min(t.height,O),maxHeight:O}}function ot(a,t,r){let o=null;try{o=a.selector?t?.querySelector(a.selector)??null:null}catch{}let l=o?.getBoundingClientRect(),f=a.relative;return l&&f&&l.width&&l.height?{left:l.left+l.width*f.x,top:l.top+l.height*f.y,width:l.width*f.width,height:l.height*f.height}:{left:a.x-r.x,top:a.y-r.y,width:a.width,height:a.height}}var Ea=new WeakMap;function Oa(a,t=!1,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||!a.animate)return r?.cancel(),null;let o=r?.playState==="running",l=window.getComputedStyle(a);if(a.dataset.expanded==="true"){let w={opacity:0,transform:"translateY(4px)"},b={opacity:1,transform:"translateY(0px)"},q=o?{opacity:l.opacity,transform:l.transform}:t?b:w;return r?.cancel(),a.animate([q,t?w:b],{duration:t?100:140,easing:"cubic-bezier(.4,0,.2,1)"})}let f=a.querySelector(".feedback-hover-preview"),i=Ea.get(a)??{width:a.offsetWidth,height:a.offsetHeight,content:f,contentWidth:f?.style.width??""},p={width:`${(Number(a.dataset.pinWidth)||40)-8}px`,height:"32px",opacity:0,transform:`translate(${Number(a.dataset.pinX)-a.offsetLeft}px, ${Number(a.dataset.pinY)-a.offsetTop}px)`,borderRadius:"16px 16px 16px 0px"},C={width:`${i.width}px`,height:`${i.height}px`,opacity:1,transform:"translate(0px, 0px)",borderRadius:l.borderRadius},v=o?{width:l.width,height:l.height,opacity:l.opacity,transform:l.transform,borderRadius:l.borderRadius}:t?C:p;f&&(f.style.width=`${i.width-(parseFloat(l.borderLeftWidth)||0)-(parseFloat(l.borderRightWidth)||0)}px`),r?.cancel();let y=a.animate([{...v,overflow:"hidden"},{...t?p:C,overflow:"hidden"}],{duration:t?120:140,easing:"cubic-bezier(.4,0,.2,1)",fill:t?"forwards":"none"});i.animation=y,Ea.set(a,i);let P=()=>{Ea.get(a)?.animation===y&&(i.content&&(i.content.style.width=i.contentWidth),Ea.delete(a))};return y.finished.then(()=>{t||P()},P),y}var eo=`:is(.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box) :focus{outline:none}.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box{color-scheme:light;--chisel-ui-panel-shadow:0 4px 20px rgba(0,0,0,.08);--chisel-ui-canvas:#f7f7f7;--chisel-ui-surface:#ffffff;--chisel-ui-raised:#f5f5f5;--chisel-ui-inset:#eeeeee;--chisel-ui-hover:#f0f0f0;--chisel-ui-selected:#eaeaea;--chisel-ui-border:#e2e2e2;--chisel-ui-border-strong:#c4c4c4;--chisel-ui-text:#242424;--chisel-ui-secondary:#626262;--chisel-ui-muted:#686868;--chisel-ui-focus:#2468d3;--chisel-ui-accent-text:#2468d3;--chisel-ui-accent-surface:#edf4ff;--chisel-ui-action:#242424;--chisel-ui-action-text:#ffffff;--chisel-ui-danger:#b33737;--chisel-ui-avatar:#ededed;--chisel-ui-avatar-text:#565656;--chisel-ui-scrollbar:#c2c2c2;--chisel-ui-checker-light:#e5e5e5;--chisel-ui-checker-dark:#c7c7c7}@media(prefers-color-scheme:dark){.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box{color-scheme:dark;--chisel-ui-panel-shadow:0 4px 20px #0003;--chisel-ui-canvas:#171717;--chisel-ui-surface:#222222;--chisel-ui-raised:#2a2a2a;--chisel-ui-inset:#191919;--chisel-ui-hover:#303030;--chisel-ui-selected:#383838;--chisel-ui-border:#3c3c3c;--chisel-ui-border-strong:#555555;--chisel-ui-text:#ededed;--chisel-ui-secondary:#b7b7b7;--chisel-ui-muted:#a5a5a5;--chisel-ui-focus:#8bb9ff;--chisel-ui-accent-text:#8bb9ff;--chisel-ui-accent-surface:#253447;--chisel-ui-action:#ededed;--chisel-ui-action-text:#111111;--chisel-ui-danger:#ffa5a5;--chisel-ui-avatar:#383838;--chisel-ui-avatar-text:#cccccc;--chisel-ui-scrollbar:#50504d;--chisel-ui-checker-light:#555555;--chisel-ui-checker-dark:#333333}}.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box{--chisel-ui-font:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;--chisel-ui-space:4px;--chisel-ui-control:40px;--chisel-ui-radius:8px;--chisel-ui-text-size:13px;--chisel-ui-small:12px;--chisel-ui-motion:.12s cubic-bezier(.2,0,0,1);--chisel-ui-popover-shadow:0 2px 6px #0000000f,0 12px 36px #0000001f}@media(prefers-color-scheme:dark){.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box{--chisel-ui-popover-shadow:0 0 0 1px #ffffff0d,0 4px 12px #0003,0 16px 40px #0004}}
|
|
2
|
+
`;import{jsx as rr}from"react/jsx-runtime";var or=`.feedback-confirmation{width:360px;max-width:calc(100vw - 32px);padding:24px;border:0;border-radius:16px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);box-shadow:var(--chisel-ui-popover-shadow);font:14px var(--chisel-ui-font)}.feedback-confirmation::backdrop{background:#0005}.feedback-confirmation h2{margin:0 0 8px;font-size:16px;font-weight:600}.feedback-confirmation p{margin:0;color:var(--chisel-ui-secondary);line-height:1.6;text-wrap:pretty}.feedback-confirmation>div{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}.feedback-confirmation button{min-height:40px;padding:0 16px;border:0;border-radius:8px;background:var(--chisel-ui-raised);color:var(--chisel-ui-text)}.feedback-confirmation button[data-danger=true]{background:var(--chisel-ui-danger);color:var(--chisel-ui-surface)}
|
|
3
|
+
`+eo+`.feedback-shell,.feedback-shell *{box-sizing:border-box}.feedback-shell{font-synthesis:none;-webkit-font-smoothing:antialiased;position:fixed;inset:0;background:var(--chisel-ui-canvas);color:var(--chisel-ui-text);z-index:999999;font-family:var(--chisel-ui-font);font-size:13px;letter-spacing:0}.feedback-avatar{overflow:hidden}.feedback-account{position:relative}.feedback-account summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:40px;min-height:40px}.feedback-account summary::-webkit-details-marker{display:none}.feedback-account>div{position:absolute;right:0;top:44px;z-index:20;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);border:0;box-shadow:var(--chisel-ui-popover-shadow);border-radius:12px;padding:16px;min-width:220px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:8px;overflow-wrap:anywhere}.feedback-account[open]>div{transform-origin:top right;animation:chisel-account-in .16s cubic-bezier(.2,0,0,1)}@keyframes chisel-account-in{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.feedback-account[open]>div{animation:none}}.feedback-account>div>span{color:var(--chisel-ui-muted);font-size:12px;line-height:1.5}.feedback-account button:hover{background:var(--chisel-ui-hover)}.feedback-account button{display:flex;align-items:center;gap:8px;color:var(--chisel-ui-text);background:transparent;border:0;min-height:40px;padding:8px;border-radius:8px}.chisel-sign-in{min-height:100dvh;display:grid;place-items:center;padding:24px;background:var(--chisel-ui-canvas);color:var(--chisel-ui-text);font-family:var(--chisel-ui-font)}.chisel-sign-in section{width:100%;max-width:360px;text-align:left}.chisel-sign-in-brand{font-size:24px;letter-spacing:-.8px}.chisel-sign-in h1{font-size:24px;font-weight:500;letter-spacing:-.4px;line-height:1.25;margin:32px 0 8px}.chisel-sign-in p{font-size:14px;line-height:1.6;color:var(--chisel-ui-secondary);margin:12px 0 24px}.chisel-sign-in button{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:44px;padding:12px;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text);border:0;border-radius:8px;cursor:pointer}.chisel-sign-in button:disabled{opacity:.5;cursor:not-allowed}.chisel-sign-in a{display:inline-flex;align-items:center;min-height:40px;margin-top:16px;font-size:13px;color:var(--chisel-ui-secondary)}.chisel-sign-in [role=alert]{color:var(--chisel-ui-danger)}.chisel-spin{animation:chisel-spin 1s linear infinite}@keyframes chisel-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.chisel-spin{animation:none}}.feedback-sidebar[hidden],.feedback-comment-layer[hidden]{display:none}.feedback-shell.comments-hidden .feedback-canvas,.feedback-shell.is-editing .feedback-canvas{height:100%;flex:1}.feedback-comment-area{position:absolute;pointer-events:none;z-index:1;border:2px solid var(--chisel-ui-focus);background:color-mix(in srgb,var(--chisel-ui-focus) 8%,transparent);border-radius:4px}.feedback-element-box{position:absolute;pointer-events:none;z-index:1;border:1px solid var(--chisel-ui-focus);background:color-mix(in srgb,var(--chisel-ui-focus) 4%,transparent);box-sizing:border-box}.feedback-element-box.is-selected{border-width:2px;background:color-mix(in srgb,var(--chisel-ui-focus) 6%,transparent)}.feedback-thread-popup{max-height:calc(100% - 16px);overflow:auto}.feedback-thread-popup[hidden]{display:none}.feedback-thread-message,.feedback-thread-replies{overflow-wrap:anywhere;line-height:1.6;margin:0}.feedback-thread-replies{max-height:140px;overflow:auto}.feedback-thread-actions{display:flex;justify-content:space-between;align-items:center;margin-top:8px;gap:8px}.feedback-thread-actions .feedback-resolve{margin:0;font-size:11px;padding:8px}.feedback-composer-heading>button{display:grid;place-items:center;width:24px;height:24px;border-radius:4px}.feedback-composer-heading>button:hover{background:var(--chisel-ui-raised)}.feedback-shell button,.feedback-shell input,.feedback-shell textarea{font:inherit}.feedback-shell button{cursor:pointer}.feedback-shell button:disabled{cursor:not-allowed}.feedback-shell :where(button,summary){-webkit-tap-highlight-color:transparent}.feedback-workspace{display:flex;height:100%}.feedback-canvas{position:relative;flex:1;min-width:0;padding:0}.feedback-viewport{position:relative;height:100%;overflow:hidden;background:#fff;border:0;border-radius:0}.feedback-viewport iframe{width:100%;height:100%;border:0;display:block}.feedback-pin{position:absolute;transform:translate(-4px,-4px);width:40px;height:40px;display:grid;place-items:center;padding:8px;border-radius:50% 50% 50% 0;background:transparent;color:var(--chisel-ui-text);border:0;box-sizing:border-box;z-index:2}.feedback-comment-layer[data-hover-preview=true] .feedback-pin:not(.selected){z-index:5}.feedback-pin:before{content:"";position:absolute;inset:4px;border:1px solid var(--chisel-ui-border);border-radius:inherit;background:var(--chisel-ui-surface);box-shadow:0 2px 7px #0002;z-index:-1}.feedback-pin .feedback-avatar{width:24px;height:24px;font-size:12px}.feedback-pin-group{display:flex;width:auto;border-radius:20px 20px 20px 0}.feedback-pin-group .feedback-avatar+.feedback-avatar{margin-left:-4px}.feedback-pin .feedback-avatar img{width:100%;height:100%;object-fit:cover}.feedback-pin .feedback-pin-more{font-size:9px;font-variant-numeric:tabular-nums}.feedback-toolbar{position:absolute;z-index:2;bottom:17px;left:50%;transform:translate(-50%);display:flex;padding:4px;gap:4px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);border:0;border-radius:999px;box-shadow:var(--chisel-ui-popover-shadow)}.feedback-toolbar button{border:1px solid transparent;background:transparent;color:var(--chisel-ui-muted);height:var(--chisel-ui-control);padding:0 16px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:999px;white-space:nowrap;transition:background-color var(--chisel-ui-motion),color var(--chisel-ui-motion),border-color var(--chisel-ui-motion)}.feedback-toolbar button:hover{background:var(--chisel-ui-raised);color:var(--chisel-ui-text)}.feedback-toolbar button[aria-pressed=true]{background:var(--chisel-ui-raised);color:var(--chisel-ui-text);border-color:transparent}.feedback-collaboration{display:flex;align-items:center;gap:8px;min-height:32px;margin-bottom:8px;color:var(--chisel-ui-muted);font-size:12px}.feedback-reviewers{display:flex;flex:1;min-width:0;overflow:hidden}.feedback-reviewers .feedback-avatar{width:24px;height:24px}.feedback-reviewers .feedback-avatar+.feedback-avatar{margin-left:-4px}.feedback-reviewers img{width:100%;height:100%;object-fit:cover}.feedback-unread-count,.feedback-unread-label{color:var(--chisel-ui-accent-text);font-size:12px;font-variant-numeric:tabular-nums}.feedback-unread-label{display:inline}@media(prefers-reduced-motion:reduce){.feedback-toolbar button,.feedback-comment{transition:none}}.feedback-shell button svg,.feedback-shell summary svg{width:16px;height:16px;stroke-width:1.75;flex-shrink:0}.feedback-primary,.feedback-resolve,.feedback-thread form button{display:inline-flex;align-items:center;justify-content:center;gap:6px}.feedback-sidebar{--feedback-panel-divider:var(--chisel-ui-border);--feedback-panel-shadow:var(--chisel-ui-panel-shadow);width:400px;flex-shrink:0;padding:0;background:transparent;color:var(--chisel-ui-text);border:0;display:flex;flex-direction:column;min-height:0;font-family:var(--chisel-ui-font);font-size:13px;letter-spacing:0;-webkit-font-smoothing:antialiased;color-scheme:inherit}.feedback-sidebar-panel{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:16px 20px 0;border:0;border-radius:0;background:var(--chisel-ui-surface)}.feedback-search{display:flex;align-items:center;gap:8px;min-height:40px;margin-bottom:8px;padding:0 8px;border-radius:8px;background:transparent;color:var(--chisel-ui-muted)}.feedback-search svg{flex-shrink:0}.feedback-shell .feedback-search input{min-width:0;min-height:40px;padding:0;border:0;background:transparent;font-size:13px}.feedback-search input::placeholder{color:var(--chisel-ui-muted)}.feedback-search:hover{background:var(--chisel-ui-raised)}.feedback-page-control{position:relative;flex-shrink:0;margin:8px 0}.feedback-page-control:last-child{margin-bottom:16px}.feedback-page-control+.feedback-review-invite{padding-top:0}.feedback-page-control>summary{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 8px;border-radius:8px;list-style:none;color:var(--chisel-ui-secondary);cursor:pointer}.feedback-page-control>summary::-webkit-details-marker{display:none}.feedback-page-control>summary:hover,.feedback-page-control[open]>summary{background:var(--chisel-ui-raised);color:var(--chisel-ui-text)}.feedback-page-control>summary[aria-disabled=true]{opacity:.5;cursor:default}.feedback-page-control>summary>span,.feedback-page-routes button>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;font:12px/20px ui-monospace,SFMono-Regular,monospace}.feedback-page-chevron{transform:rotate(180deg);transition:transform var(--chisel-ui-motion)}.feedback-page-control[open] .feedback-page-chevron{transform:rotate(0)}.feedback-page-popover{position:absolute;bottom:calc(100% + 4px);left:0;right:0;z-index:30;display:flex;flex-direction:column;gap:6px;max-height:var(--feedback-page-space,320px);overflow:auto;padding:8px;border-radius:12px;background:var(--chisel-ui-surface);box-shadow:var(--chisel-ui-popover-shadow)}.feedback-page-form{display:flex;flex-shrink:0;align-items:center;gap:4px;border-radius:8px;background:var(--chisel-ui-raised)}.feedback-shell .feedback-page-form input{flex:1;min-width:0;min-height:40px;padding:0 10px;border:0;border-radius:8px;background:transparent;font-size:13px}.feedback-page-form button{display:grid;place-items:center;flex-shrink:0;width:40px;min-height:40px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--chisel-ui-text)}.feedback-page-routes{display:flex;flex-direction:column;gap:2px;min-height:0;max-height:min(240px,30dvh);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--chisel-ui-scrollbar) transparent}.feedback-page-routes button{display:flex;align-items:center;gap:8px;width:100%;min-height:40px;padding:0 8px;border:0;border-radius:8px;background:transparent;color:var(--chisel-ui-secondary)}.feedback-page-routes button[aria-current=page]{background:var(--chisel-ui-selected);color:var(--chisel-ui-text)}.feedback-page-routes mark{background:var(--chisel-ui-selected);color:var(--chisel-ui-text);border-radius:2px;font-weight:700}.feedback-page-empty{margin:0;padding:10px 8px;color:var(--chisel-ui-secondary);font-size:12px}.feedback-page-control button:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}.feedback-page-control button:disabled{opacity:.5}.feedback-page-control button:active{transform:scale(.96)}.feedback-page-error{margin:0;padding:4px 8px;color:var(--chisel-ui-danger);font-size:12px;line-height:1.5;overflow-wrap:anywhere}@media(pointer:coarse){.feedback-page-control>summary,.feedback-page-control button,.feedback-shell .feedback-page-form input{min-height:44px}.feedback-page-form button{width:44px}}@media(prefers-reduced-motion:reduce){.feedback-page-chevron{transition:none}}.feedback-sidebar-title{min-height:40px;padding:0;margin-bottom:12px;border:0;display:flex;align-items:center;justify-content:space-between;gap:6px}.feedback-sidebar h1{font:600 15px/22px var(--chisel-ui-font);letter-spacing:-.01em;margin:0;color:var(--chisel-ui-text)}.feedback-sidebar h1 span{font:500 12px ui-monospace,SFMono-Regular,Menlo,monospace;font-variant-numeric:tabular-nums;margin-left:6px;color:var(--chisel-ui-muted)}.feedback-avatar{width:27px;height:27px;background:var(--chisel-ui-avatar);color:var(--chisel-ui-avatar-text);border:0;display:inline-flex;justify-content:center;align-items:center;border-radius:50%;font-size:11px;flex-shrink:0}.feedback-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex-shrink:0;gap:6px;margin:0 0 8px;padding:4px;border-radius:12px;background:var(--chisel-ui-raised)}.feedback-tabs button{position:relative;min-width:0;min-height:40px;background:transparent;border:0;border-radius:8px;color:var(--chisel-ui-secondary);padding:0 12px;font-size:13px;font-weight:500;transition:background-color var(--chisel-ui-motion),color var(--chisel-ui-motion),box-shadow var(--chisel-ui-motion)}.feedback-tabs button+button:before{content:"";position:absolute;left:-3.5px;top:50%;width:1px;height:16px;transform:translateY(-50%);background:var(--chisel-ui-border);pointer-events:none}.feedback-tabs button:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}.feedback-tabs button[aria-pressed=true]{color:var(--chisel-ui-text);background:var(--chisel-ui-surface);box-shadow:0 1px 3px #0000000d,0 0 0 1px var(--chisel-ui-border)}@media(prefers-reduced-motion:reduce){.feedback-tabs button{transition:none}}.feedback-comment-list{flex:1;min-height:0;overflow:auto;padding:0;scrollbar-width:thin;scrollbar-color:var(--chisel-ui-scrollbar) transparent}.feedback-comment{border:0;border-radius:8px;padding:16px 8px;margin-bottom:8px;background:transparent;transition:background-color var(--chisel-ui-motion)}.feedback-comment:hover,.feedback-comment.active{background:var(--chisel-ui-raised)}.feedback-comment-main{display:flex;flex-direction:column;align-items:stretch;gap:8px;border:0;background:none;text-align:left;width:100%;min-height:40px;padding:0;color:inherit}.feedback-comment-heading{display:flex;align-items:center;gap:10px}.feedback-comment-identity{flex:1;min-width:0}.feedback-comment-activity{display:flex;align-items:center;gap:8px;margin-left:38px;margin-top:4px}.feedback-comment-heading>.feedback-avatar{width:28px;height:28px}.feedback-comment-heading img{width:100%;height:100%;object-fit:cover}.feedback-comment-avatars{display:flex;gap:4px}.feedback-comment-avatars .feedback-avatar{width:20px;height:20px;font-size:10px}.feedback-comment-avatars img{width:100%;height:100%;object-fit:cover}.feedback-comment-unread-dot{width:8px;height:8px;flex-shrink:0;border-radius:50%;background:var(--chisel-ui-focus)}.feedback-comment-status{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--chisel-ui-muted);font-size:12px;line-height:1.5}.feedback-comment-meta{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;font-size:13px;line-height:1.5}.feedback-comment-meta strong{font-weight:500;overflow-wrap:anywhere}.feedback-comment-meta time{color:var(--chisel-ui-muted);font-size:12px;font-variant-numeric:tabular-nums}.feedback-comment-body{display:block;margin-left:38px;line-height:1.5;overflow-wrap:anywhere;color:var(--chisel-ui-text);font-size:14px;white-space:pre-wrap}.feedback-comment-reply-count{color:var(--chisel-ui-secondary);font-size:12px;line-height:1.5}.feedback-comment-path{font:inherit;color:inherit}.feedback-empty{padding:24px 8px;color:var(--chisel-ui-muted)}.feedback-empty>span{display:none}.feedback-empty h2{font:500 14px var(--chisel-ui-font);color:var(--chisel-ui-secondary);margin:0 0 6px}.feedback-empty p{font-size:13px;line-height:1.6;color:var(--chisel-ui-muted);margin:0}.feedback-review-invite{border:0;padding:16px 0;color:var(--chisel-ui-secondary)}.feedback-review-invite summary{display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;font-size:13px;padding:10px 8px;min-height:40px;border-radius:8px}.feedback-review-invite summary::-webkit-details-marker{display:none}.feedback-review-invite[open]>summary svg{transform:rotate(90deg)}.feedback-review-invite summary:hover{background:var(--chisel-ui-hover)}.feedback-review-invite form{display:flex;flex-direction:column;gap:10px;margin-top:10px}.feedback-review-invite .feedback-primary{width:100%;align-self:stretch}.feedback-review-invite label{display:flex;flex-direction:column;gap:6px;font-size:11px}.feedback-review-invite p{font-size:12px;line-height:1.5;margin:0}.feedback-composer{position:absolute;z-index:3;width:288px;background:var(--chisel-ui-surface);padding:14px;border:0;border-radius:16px;box-shadow:var(--chisel-ui-popover-shadow);display:flex;flex-direction:column;gap:10px}.feedback-composer-heading{display:flex;align-items:center;justify-content:space-between;font-weight:700}.feedback-composer-heading button{border:0;background:none;font-size:21px}.feedback-shell input,.feedback-shell textarea{border:1px solid var(--chisel-ui-border);border-radius:4px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);padding:9px;width:100%;box-sizing:border-box}.feedback-shell textarea{resize:none;min-height:70px}.feedback-primary{min-height:40px;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text);border:0;padding:0 12px;border-radius:8px;align-self:flex-end}.feedback-thread{margin-top:16px}.feedback-thread form button,.feedback-resolve{background:var(--chisel-ui-surface);border:1px solid var(--chisel-ui-border);border-radius:4px;padding:7px 10px;margin-top:8px}.feedback-resolve{color:var(--chisel-ui-text)}.feedback-reply{border-left:2px solid var(--chisel-ui-border);padding-left:10px}.feedback-error{color:var(--chisel-ui-danger);padding:0 8px;margin:0 0 16px;line-height:1.5;font-size:13px}.feedback-comment-list>p[role=status]{margin:0;padding:24px 8px;color:var(--chisel-ui-secondary);line-height:1.5;font-size:13px}@media(max-width:760px){.feedback-workspace{flex-direction:column}.feedback-canvas{height:48%;flex:none;padding:0}.feedback-sidebar{width:100%;height:auto;flex:1;padding:0}.feedback-sidebar-panel{border:0}.feedback-sidebar-title{min-height:44px}.feedback-tabs{margin-bottom:8px}.feedback-tabs button{min-height:44px;padding:0 8px}.feedback-empty{padding:12px}.feedback-empty>span{display:none}.feedback-toolbar{bottom:10px}.feedback-comment{padding:14px 8px}}.comment-box{position:absolute;z-index:4;display:flex;flex-direction:column;width:344px;max-width:calc(100% - 16px);height:auto;max-height:calc(100% - 16px);padding:0;overflow:hidden;border:0;border-radius:16px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);box-shadow:var(--chisel-ui-popover-shadow);font:12px var(--chisel-ui-font);color-scheme:inherit}.comment-box[data-settings-open=true]{height:440px}.comment-box-settings{display:flex;flex-direction:column;flex:1;min-height:0}.comment-box-settings[hidden],.comment-box[hidden],.comment-thread form[hidden]{display:none}.comment-box-draft-pin{pointer-events:none}.comment-box-prompt{display:flex;align-items:center;gap:9px;min-height:44px;padding:8px 12px;flex-shrink:0}.comment-box-symbol{position:relative;border:0;padding:0;display:grid;place-items:center;background:transparent;border-radius:8px;width:40px;height:40px;flex-shrink:0}.comment-box-symbol[aria-expanded=true]{background:var(--chisel-ui-selected)}.comment-box-symbol:hover{background:var(--chisel-ui-hover)}.comment-box-symbol svg{width:14px;height:14px;color:var(--chisel-ui-text)}.comment-box .comment-box-prompt input{border:0;border-radius:0;background:none;box-shadow:none;padding:0;color:var(--chisel-ui-text);font:13px var(--chisel-ui-font);outline:none;width:100%;min-width:0}.comment-box-prompt input::placeholder{color:var(--chisel-ui-muted)}.comment-box-element{display:flex;align-items:center;justify-content:space-between;background:var(--chisel-ui-raised);color:var(--chisel-ui-muted);min-height:28px;padding:0 15px;flex-shrink:0}.comment-box-element code{font:12px monospace}.comment-box-element svg{color:var(--chisel-ui-muted)}.comment-box,.comment-thread{translate:var(--comment-drag-x,0px) var(--comment-drag-y,0px)}.feedback-shell .comment-window-drag{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;padding:0;border:0;border-radius:var(--chisel-ui-radius);background:transparent;color:var(--chisel-ui-muted);cursor:grab;touch-action:none;user-select:none}.feedback-shell .comment-window-drag:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}.feedback-shell .comment-window-drag[data-dragging=true]{cursor:grabbing}.comment-box-element .comment-window-drag{margin-left:auto;margin-right:-8px}.feedback-thread-header>.comment-window-drag{margin-right:auto}.comment-box-preview-status{margin-left:auto;margin-right:8px;font:12px var(--chisel-ui-font);color:var(--chisel-ui-accent-text)}.comment-box-properties{flex:1;min-height:0;min-width:0;border:0;margin:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--chisel-ui-scrollbar) transparent;padding:4px 15px 9px;position:relative}.comment-box-row{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--chisel-ui-secondary)}.comment-box-row>span{white-space:nowrap}.comment-box .comment-box-row input,.comment-box select{border:0;background:var(--chisel-ui-raised);color:var(--chisel-ui-secondary);border-radius:8px;min-width:0;width:128px;height:var(--chisel-ui-control);font:12px var(--chisel-ui-font);padding:4px 8px;text-overflow:ellipsis}.comment-box input:disabled{opacity:.35}.comment-box-number{display:flex;align-items:center;border:0;background:var(--chisel-ui-raised);border-radius:8px;width:128px;flex-shrink:0;height:var(--chisel-ui-control);padding-right:8px;color:var(--chisel-ui-muted)}.comment-box .comment-box-number input{border:0;width:100%;height:40px;background:transparent;box-shadow:none}.comment-box-number input::-webkit-inner-spin-button,.comment-box-spacing input::-webkit-inner-spin-button{-webkit-appearance:none}.comment-box-number>span{font:11px monospace}.comment-box select{appearance:auto}.comment-box-color{display:flex;align-items:center;gap:8px;border:0;width:142px;height:var(--chisel-ui-control);border-radius:7px;padding:3px 4px;min-width:0}.comment-color-trigger{position:relative;display:grid;place-items:center;width:24px;height:24px;flex-shrink:0;padding:0;border:0;border-radius:4px;background:repeating-conic-gradient(var(--chisel-ui-checker-light) 0% 25%,var(--chisel-ui-checker-dark) 0% 50%) 50%/8px 8px}.comment-color-trigger:after{content:"";position:absolute;inset:-8px;border-radius:inherit}.comment-color-trigger>span{display:block;width:100%;height:100%;border-radius:inherit;box-shadow:inset 0 0 0 1px var(--chisel-ui-border)}@media(pointer:coarse){.comment-color-trigger:after{inset:-10px}}.comment-color-value{font:12px monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--chisel-ui-secondary)}.chisel-color-picker,.chisel-color-picker *{box-sizing:border-box}.chisel-color-picker{position:fixed;z-index:1000001;width:256px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;padding:16px;border:0;border-radius:16px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);font:12px var(--chisel-ui-font);box-shadow:var(--chisel-ui-popover-shadow);color-scheme:inherit}.chisel-color-plane{position:relative;height:160px;margin:0 0 14px;border-radius:10px;touch-action:none;cursor:crosshair;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,transparent)}.chisel-color-thumb{position:absolute;width:19px;height:19px;border:2px solid #fff;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;box-shadow:0 1px 5px #0004}.chisel-color-tools{display:flex;gap:12px;align-items:center;margin-bottom:14px}.chisel-color-hue{appearance:none;-webkit-appearance:none;flex:1;min-width:0;height:40px;border:12px solid transparent;background-clip:padding-box;border-radius:20px;margin:0;background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red);cursor:pointer}.chisel-color-hue::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:20px;height:20px;border:2px solid #fff;border-radius:50%;background:var(--hue);box-shadow:0 1px 4px #0004}.chisel-color-hue::-moz-range-thumb{width:16px;height:16px;border:2px solid #fff;border-radius:50%;background:var(--hue);box-shadow:0 1px 4px #0004}.chisel-color-tools button{display:grid;place-items:center;flex-shrink:0;width:44px;height:40px;padding:0;background:var(--chisel-ui-raised);border:0;border-radius:8px;color:var(--chisel-ui-text);cursor:pointer}.chisel-color-tools button:disabled{opacity:.35;cursor:not-allowed}.chisel-color-hex{display:flex;flex-direction:column;gap:8px;color:var(--chisel-ui-secondary);font-size:11px}.chisel-color-hex input{width:100%;height:40px;border:0;border-radius:8px;padding:7px 9px;background:var(--chisel-ui-raised);color:var(--chisel-ui-text);font:13px monospace}.chisel-color-hex input[aria-invalid=true]{outline:2px solid var(--chisel-ui-danger)}.chisel-color-error{display:block;color:var(--chisel-ui-danger);font-size:11px;margin-top:6px}.chisel-color-accessible{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);border:0}.comment-box-control-group{margin-top:20px}.comment-box-control-group h3{font:500 12px/18px var(--chisel-ui-font);margin:0 0 8px;color:var(--chisel-ui-text)}.comment-box-group{border:0;margin-top:20px;padding-top:0}.comment-box-group summary{list-style:none;display:flex;align-items:center;gap:6px;min-height:40px;color:var(--chisel-ui-secondary);cursor:pointer}.comment-box-group summary::-webkit-details-marker{display:none}.comment-box-group[open] summary svg{transform:rotate(90deg)}.comment-box-pair{position:relative;padding:2px 0}.comment-box-pair .comment-box-row{min-height:44px}.comment-box-link{position:absolute;left:42%;top:50%;transform:translate(-50%,-50%);border:0;background:var(--chisel-ui-surface);color:var(--chisel-ui-muted);border-radius:50%;width:40px;height:40px;display:grid;place-items:center;z-index:1}.comment-box-link:before{content:none}.comment-box-link svg{padding:0}.comment-box-link:hover{background:var(--chisel-ui-hover)}.comment-box-link[aria-pressed=true]{color:var(--chisel-ui-accent-text);background:var(--chisel-ui-accent-surface)}.comment-box-link[aria-pressed=true]:before{border-color:var(--chisel-ui-focus)}.comment-box-number{font-variant-numeric:tabular-nums}.comment-box .comment-box-number input::-webkit-inner-spin-button{-webkit-appearance:none}.comment-box-footer{height:56px;min-height:56px;display:flex;align-items:center;gap:8px;padding:8px;border:0}.comment-box-footer>span{flex:1}.comment-box-footer button{display:grid;place-items:center;border:0;background:none;color:var(--chisel-ui-text);height:40px;width:40px}.comment-box-footer .comment-box-cancel:hover{background:var(--chisel-ui-hover)}.comment-box-footer .comment-box-cancel{width:auto;padding:0 9px;font:13px var(--chisel-ui-font);border:0;border-radius:8px;background:transparent}.comment-box-footer .comment-box-submit{width:40px;border-radius:8px;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text)}.comment-box-footer .comment-box-submit:disabled{opacity:.4;cursor:not-allowed}.comment-box-error{margin:0;padding:0 12px 8px;flex-shrink:0;font-size:11px;line-height:1.5;color:var(--chisel-ui-danger)}.comment-box-saving{width:12px;height:12px;border:1px solid var(--chisel-ui-border-strong);border-top-color:transparent;border-radius:50%;animation:chisel-spin 1s linear infinite}.feedback-composer.comment-thread{width:400px;max-width:calc(100% - 16px);gap:0;border-radius:16px;background:var(--chisel-ui-surface);border-color:var(--chisel-ui-border);color:var(--chisel-ui-text);padding:0;box-shadow:var(--chisel-ui-popover-shadow);color-scheme:inherit;overflow:hidden auto;scrollbar-width:thin}.feedback-thread-header{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:56px;padding:8px 12px 4px 20px;border:0;flex-shrink:0}.comment-thread .feedback-thread-summary{width:100%;padding:16px}.comment-thread .feedback-thread-summary:empty{display:none}.comment-thread .feedback-thread-replies{width:100%;padding:0 16px}.comment-thread form{width:100%;padding:16px}.feedback-composer.comment-thread[data-expanded=false]{width:240px;max-width:calc(100% - 16px);border-radius:16px 16px 16px 0;overflow:hidden}.feedback-thread-content{display:flex;flex-direction:column;flex-shrink:0;width:100%}.feedback-thread-content[hidden]{display:none}.feedback-hover-preview{display:flex;align-items:flex-start;gap:10px;flex-shrink:0;width:100%;padding:12px;border:0;border-radius:inherit;background:transparent;color:var(--chisel-ui-text);text-align:left;font:12px/16px var(--chisel-ui-font)}.feedback-hover-preview>.feedback-avatar{width:24px;height:24px;font-size:12px}.feedback-hover-preview img{width:100%;height:100%;object-fit:cover}.feedback-hover-copy{flex:1;min-width:0}.feedback-hover-byline{display:flex;align-items:baseline;gap:4px;white-space:nowrap;overflow:hidden}.feedback-hover-byline strong{font-weight:500;overflow:hidden;text-overflow:ellipsis}.feedback-hover-byline time{color:var(--chisel-ui-muted);font-size:11px;flex-shrink:0}.feedback-hover-message{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.feedback-pin.selected:before{border-color:var(--chisel-ui-focus)}.comment-thread .feedback-thread-summary,.comment-thread .feedback-thread-replies,.comment-thread form{width:100%;flex-shrink:0}.comment-thread .feedback-preview{white-space:nowrap}.feedback-thread-summary{display:flex;align-items:flex-start;gap:8px;flex-shrink:0}.feedback-thread-summary,.feedback-thread-reply{position:relative}.feedback-message-edit{display:grid;place-items:center;width:40px;height:40px;flex-shrink:0;padding:0;border:0;border-radius:8px;background:transparent;color:var(--chisel-ui-secondary);opacity:0;transition:opacity .12s,background .12s}.feedback-thread-summary:hover .feedback-message-edit,.feedback-thread-reply:hover .feedback-message-edit,.feedback-message-edit:focus-visible{opacity:1}.feedback-message-edit:hover{background:var(--chisel-ui-hover)}@media(hover:none){.feedback-message-edit{opacity:1}}.feedback-thread-summary-button{display:flex;align-items:flex-start;gap:10px;flex:1;min-width:0;border:0;padding:0;text-align:left;background:transparent;color:inherit}.feedback-thread-summary-button>.feedback-avatar{width:26px;height:26px;flex-shrink:0;margin-top:1px;font-size:10px}.feedback-thread-summary-copy{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}.feedback-thread-byline{display:flex;align-items:baseline;gap:7px;min-width:0;flex-wrap:wrap}.feedback-thread-byline strong{font-size:13px;font-weight:600;line-height:1.4;overflow-wrap:anywhere}.feedback-thread-byline time{font-size:12px;color:var(--chisel-ui-muted);white-space:nowrap}.feedback-thread-summary .feedback-thread-message{font-size:14px;line-height:1.5;color:var(--chisel-ui-text);overflow-wrap:anywhere}.comment-thread[data-expanded=false] .feedback-thread-message{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.feedback-thread-reply-count{font-size:12px;line-height:1.4;color:var(--chisel-ui-muted)}.feedback-thread-close{display:grid;place-items:center;flex-shrink:0;width:24px;height:24px;border:0;border-radius:6px;background:none;color:var(--chisel-ui-muted);padding:4px}.feedback-thread-header-actions{display:flex;gap:4px;flex-shrink:0}.feedback-thread-header-actions .feedback-thread-close{position:relative;width:40px;height:40px}.feedback-thread-header-actions .feedback-thread-delete:hover{color:var(--chisel-ui-danger)}.feedback-thread-close:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}.feedback-thread-reply{display:flex;align-items:flex-start;gap:10px;padding:16px 0;border:0}.feedback-thread-reply>.feedback-avatar{width:24px;height:24px;font-size:10px}.feedback-thread-reply>div{flex:1;min-width:0}.feedback-thread-reply strong{font-size:13px;font-weight:600}.feedback-thread-reply p{font-size:14px;line-height:1.5;margin:4px 0 0;color:var(--chisel-ui-secondary)}.comment-thread form{padding-top:16px;border:0}.feedback-shell .comment-thread textarea{background:var(--chisel-ui-raised);color:var(--chisel-ui-text);border:1px solid var(--chisel-ui-border);border-radius:9px;min-height:40px;max-height:min(240px,40dvh);padding:10px 12px;font-size:14px;line-height:1.5;resize:none;overflow-y:auto}.comment-thread .feedback-thread-actions{margin-top:6px}.comment-thread .feedback-primary{border-radius:50%;width:40px;height:40px;padding:0;font-size:0;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text);margin:0;transition:opacity .15s,transform .15s}.comment-thread .feedback-primary:disabled{opacity:.35;cursor:not-allowed}.comment-thread .feedback-primary:not(:disabled):active{transform:scale(.96)}.comment-thread .feedback-resolve{background:transparent;color:var(--chisel-ui-secondary);border:0;border-radius:6px;padding:6px;font-size:12px;min-height:40px}.comment-thread .feedback-resolve:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}@media(prefers-reduced-motion:reduce){.comment-thread .feedback-primary{transition:none}}@media(prefers-reduced-motion:reduce){.comment-box-saving{animation:none}}.comment-thread .feedback-preview{display:inline-flex;align-items:center;gap:6px;align-self:flex-start;min-height:40px;margin-left:36px;padding:5px 9px;border:1px solid var(--chisel-ui-border);border-radius:6px;background:var(--chisel-ui-raised);color:var(--chisel-ui-secondary);font-size:11px}.comment-thread .feedback-preview[aria-pressed=true]{border-color:var(--chisel-ui-focus);background:var(--chisel-ui-accent-surface)}.comment-thread .feedback-preview:disabled{opacity:.5;cursor:not-allowed}.feedback-proposal-actions{display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding:0 12px 8px}.comment-thread .feedback-proposal-actions .feedback-preview{margin:0;padding:0 8px;border:0;border-radius:8px;background:transparent;font-size:12px;min-height:40px}.comment-thread .feedback-proposal-actions .feedback-preview:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}.comment-thread .feedback-proposal-actions .feedback-preview[aria-pressed=true]{background:var(--chisel-ui-accent-surface);color:var(--chisel-ui-accent-text)}@media(pointer:coarse){.feedback-toolbar button{height:44px}.feedback-tabs button,.feedback-account summary{min-width:44px}.feedback-review-invite summary{min-height:44px}.feedback-pin:after{content:"";position:absolute;inset:-2px;border-radius:inherit}.feedback-account summary,.feedback-review-invite button,.feedback-shell .feedback-primary{min-height:44px}.feedback-shell .comment-window-drag,.feedback-thread-header-actions .feedback-thread-close{width:44px;height:44px}.comment-box-footer{height:60px;min-height:60px}.comment-box-footer button{height:44px;width:44px}.comment-box-footer .comment-box-submit{width:44px}}@media(forced-colors:active){.feedback-sidebar-panel,.comment-box,.feedback-composer.comment-thread,.feedback-confirmation,.feedback-account>div{border:1px solid CanvasText;box-shadow:none;background:Canvas;color:CanvasText}.feedback-shell button[aria-pressed=true]{outline:1px solid Highlight;outline-offset:-2px}.feedback-shell input,.feedback-shell textarea,.comment-box-number,.feedback-avatar{border:1px solid CanvasText}}
|
|
4
|
+
`;function rt(){return rr("style",{children:or})}function dt(a,t){if(t.type==="create")return t.comment;let r=a.find(o=>o.id===t.id);if(!r)throw new Error("This comment no longer exists. Reload and try again.");switch(t.type){case"edit":return{...r,text:t.text,changes:t.changes,...t.body===void 0?{}:{body:t.body}};case"edit_reply":return{...r,replies:r.replies.map(o=>typeof o!="string"&&o.id===t.replyId?{...o,text:t.text,body:t.body}:o)};case"resolve":return{...r,resolved:t.resolved};case"reply":return{...r,replies:[...r.replies,t.reply]}}}function Ia(a,t){return a.some(r=>r.id===t.id)?a.map(r=>r.id===t.id?t:r):[...a,t]}function za(a,t){return a.filter(r=>r.id!==t)}function Na(a){let t=new Map;for(let r of[a,...a.replies]){if(typeof r=="string")continue;let o=r.authorId?`id:${r.authorId}`:`name:${r.author}`;t.has(o)||t.set(o,{author:r.author,authorImage:r.authorImage})}return[...t.values()]}function ao(a,t,r){let o=r.trim().toLocaleLowerCase();return a.filter(l=>(t==="all"||l.resolved===(t==="resolved"))&&(!o||[l.text,l.author,l.path,...(l.attachments??[]).map(f=>f.name),...l.replies.map(f=>typeof f=="string"?f:`${f.author} ${f.text}`)].some(f=>f.toLocaleLowerCase().includes(o))))}function to(a,t=Date.now()){let r=Math.max(0,t-Date.parse(a));if(!Number.isFinite(r))return"";if(r<6e4)return"Just now";let[o,l]=r<36e5?["minute",6e4]:r<864e5?["hour",36e5]:["day",864e5];return new Intl.RelativeTimeFormat(void 0,{numeric:"always"}).format(-Math.floor(r/l),o)}import{Fragment as Ca,jsx as u,jsxs as x}from"react/jsx-runtime";var lt="chisel-feedback-v1",Ga=process.env.NODE_ENV!=="production";function oo(a,t){let r=`<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 40 40"><defs><filter id="shadow" x="-25%" y="-25%" width="150%" height="150%"><feDropShadow dx="0" dy="2" stdDeviation="2" flood-opacity=".16"/></filter></defs><path d="M4 20a16 16 0 1 1 16 16H4Z" fill="${a}" stroke="${t}" filter="url(#shadow)"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(r)}") 3 3, crosshair`}function ut(a){for(let r of["data-chisel-id","data-ai-edit","data-component","id"]){let o=a.getAttribute(r);if(o){let l=`[${r}="${CSS.escape(o)}"]`,f=a.ownerDocument.querySelectorAll(l);if(f.length===1&&f[0]===a)return l}}let t=a.parentElement;return t?`${ut(t)} > :nth-child(${Array.from(t.children).indexOf(a)+1})`:a.tagName.toLowerCase()}function ro({user:a,validateSession:t,signOut:r,commentStore:o,canManageComments:l=!1,getReviewLink:f,collaboration:i,commentUI:p}){let{confirm:C,dialog:v}=_t(),y=W(null),[P,w]=T([]),[b,q]=T("/"),[O,J]=T(["/"]),[_,de]=T([]),[D,N]=T(Ga?"edit":"comment"),c=W(D),g=W(null),le=W(null),m=W(null),z=W(!1),U=W(null),V=W(""),De=W(!1),K=W(!1),ue=W(null),X=W(null),ge=W(null),[Me,Ve]=T(null),[ae,_e]=T(!1),[se,Qe]=T(!1),H=W(se);H.current=se;let[Q,fe]=T(null),[Y,A]=T(null),M=W(Y);M.current=Y;let[L,ie]=T(null),B=W(L),Xe=W(!1);B.current=L;let[Va,he]=T(null),[st,ba]=T(void 0),[$,uo]=T(null),[so,He]=T(null),[io,Ke]=T(""),[Be,me]=T(""),[j,we]=T(null);Ae(()=>{we(null),K.current=!1},[Y]);let[Ye,fo]=T("open"),[ka,no]=T(""),[it,te]=T(""),[ft,Sa]=T(!!o),[Ie,wa]=T(!1),[ye,nt]=T(null),[Xa,ct]=T(null),[pt,co]=T(""),[ya,mt]=T(!1),[ht,va]=T(""),Ce=W(!1),Ee=W(0),je=W(null),xt=W(!1),Ka=W(null),[ea,Lt]=T({x:0,y:0});V.current=Be,X.current||(X.current=Yt(()=>{let e=document.activeElement,d=g.current?.contains(e)&&e?.matches('input,textarea,[contenteditable="true"]');!U.current||V.current.trim()||De.current||K.current||d||Ct()}));let s=P.find(e=>e.id===Y),Pa=ye?.type==="resolve"&&ye.id===s?.id?ye:null,gt=Pa?Pa.resolved?"Resolving thread\u2026":"Reopening thread\u2026":s?.resolved?"Reopen thread":"Resolve thread";async function It(e=!1){if(!(!f||ya)){mt(!0),va("");try{let d=await f(e);co(d);try{await navigator.clipboard.writeText(d),va(e?"New link copied. The previous link no longer accepts new reviewers.":"Link copied. Your client can sign in with any Google account.")}catch{va("Select and copy the review link below.")}}catch{va("The review link could not be created. Please try again.")}finally{mt(!1)}}}async function Ct(){if((V.current.trim()||De.current||K.current)&&!await ce()||(X.current?.cancel(),U.current=null,z.current))return;z.current=!0;let e=g.current?Oa(g.current,!0,m.current):null;m.current=e;let d=()=>{!z.current||m.current!==e||(z.current=!1,ve(),A(null),me(""))};e?e.finished.then(d,()=>{}):d()}function $a(){X.current?.cancel(),z.current&&(z.current=!1,m.current=g.current?Oa(g.current,!1,m.current):null)}function Aa(){m.current?.cancel(),m.current=null,z.current=!1,_e(!0)}async function bt(e){if(!await ce()||Ce.current)return;let d=null;try{d=e.selector?$?.querySelector(e.selector)??null:null}catch{}if(!d){te("This element is no longer on the page. Its changes cannot be edited.");return}ve(),X.current?.cancel(),me(""),ue.current=null,fe(e.id),Ke(e.text),ie(e)}function kt(e){X.current?.cancel(),!(L||e.path!==b||(Be.trim()||De.current||K.current)&&Y!==e.id)&&(Y===e.id&&ae||(U.current=e.id,Ma(e,!0)))}function ve(){ge.current?.(),ge.current=null,Ve(null)}async function ce(){return!Ce.current&&(!(B.current&&Xe.current)&&!V.current.trim()&&!De.current&&!K.current||await C({title:"Discard this draft?",description:"Your comment and unsaved preview changes will be discarded.",action:"Discard draft",danger:!0}))}async function Da(e){if(e===c.current||!await ce())return;X.current?.cancel(),U.current=null,ve(),N(e),c.current=e,ie(null),fe(null),he(null),e==="comment"&&Qe(!1);let d=y.current?.contentDocument;d?.documentElement&&(d.documentElement.dataset.chiselMode=e,y.current?.contentWindow?.dispatchEvent(new Event("chisel:mode")));let n=new URL(window.location.href);n.searchParams.set("mode",e),window.history.replaceState(window.history.state,"",n)}function po(){let e=y.current?.contentDocument;if(!e)return;let d=Array.from(e.querySelectorAll("a[href]:not([download])"),n=>We(n.href,window.location.origin));de([...new Set(d.filter(n=>n!==null))])}async function mo(e){let d=We(e,window.location.origin,b);if(!d)throw new Error("Enter a page path or URL from this site.");if(d===b)return!0;if(!await ce())return!1;let n=y.current?.contentWindow;return n?(X.current?.cancel(),U.current=null,ve(),ie(null),fe(null),A(null),he(null),He(null),Ke(""),me(""),je.current=null,ue.current=null,Xe.current=!1,De.current=!1,n.location.assign(d),!0):!1}function pe(e){if(e.area){let I=ot(e.area,$,ea);return{rect:void 0,x:I.left,y:I.top}}let d=null;try{d=e.selector?$?.querySelector(e.selector)??null:null}catch{}let n=d?.getBoundingClientRect();return{rect:n,x:n?n.left+n.width*(e.offsetX??0):e.x-ea.x,y:n?n.top+n.height*(e.offsetY??0):e.y-ea.y}}async function Ma(e,d=!1){let n=We(e.path,window.location.origin);if(!n){te("This comment's page cannot be opened in the preview.");return}if(!d&&!await ce()||($a(),d||i?.markRead(e.id),d||(Aa(),U.current=null),Y===e.id&&b===e.path))return;_e(!d),ve(),A(e.id),ie(null),he(null),He(e),me(""),ue.current=null;let I=y.current?.contentDocument;if(I?.documentElement&&e.selector&&(I.documentElement.dataset.chiselSelection=e.selector),b!==n){y.current?.contentWindow?.location.assign(n);return}let G=pe(e);d||y.current?.contentWindow?.scrollTo({top:Math.max(0,G.y+ea.y-180),behavior:"smooth"})}async function be(e,d=[]){if(Ce.current)return!1;Ce.current=!0,wa(!0),nt(e),++Ee.current;let n=e.type==="create"?e.comment.id:e.id,I=P.find(ee=>ee.id===n),G=!1;try{if(e.type==="create"||e.type==="reply"){let Z=e.type==="create"?{...e.comment,body:e.body,attachments:d,pending:!0}:dt(P,{...e,reply:{...e.reply,body:e.body,attachments:d,date:new Date().toISOString(),pending:!0}});w(ke=>Ia(ke,{...Z,pending:!0})),Sa(!1),te(""),G=!0}if(!await t())throw new Error("Your session has expired. Reload this page to sign in again.");let ee=o?await o.mutate(e):dt(P,e);return++Ee.current,o||localStorage.setItem(lt,JSON.stringify(Ia(P,ee))),w(Z=>Ia(Z,ee)),Sa(!1),te(""),!0}catch(ee){return G&&w(Z=>I?Ia(Z,I):za(Z,n)),te(ee instanceof Error?ee.message:"Your comment could not be saved. Your draft is still here; please try again."),!1}finally{Ce.current=!1,wa(!1),nt(null)}}async function ho(e){if(!(Ce.current||!await C({title:"Delete this comment?",description:"The comment and all its replies will be permanently deleted.",action:"Delete comment",danger:!0}))){Ce.current=!0,wa(!0),ct(e.id),te(""),++Ee.current;try{if(!await t()){te("Your session has expired. Reload this page to sign in again.");return}if(o){if(!o.delete)throw new Error("Comment deletion is unavailable");await o.delete(e.id)}else localStorage.setItem(lt,JSON.stringify(za(P,e.id)));++Ee.current,M.current===e.id&&(ve(),A(null),me(""),He(null)),w(d=>za(d,e.id)),te("")}catch{te("The comment could not be deleted. Please try again.")}finally{Ce.current=!1,wa(!1),ct(null)}}}function Za(){let e=y.current?.contentDocument,d=y.current?.contentWindow;if(!e?.documentElement||!d)return;let n=et(d);if(n===null||e===Ka.current)return;if(Ka.current=null,!xt.current){if(xt.current=!0,!o)try{let E=JSON.parse(localStorage.getItem(lt)||"[]");if(!Array.isArray(E)||E.some(Se=>typeof Se.id!="string"||typeof Se.text!="string"||!Array.isArray(Se.replies)))throw Error();w(E)}catch{te("Saved comments could not be loaded.")}let h=new URLSearchParams(window.location.search).get("mode"),S=h==="browse"?"view":h;S&&["edit","comment","view"].includes(S)&&(S!=="edit"||Ga)&&(N(S),c.current=S);let F=new URLSearchParams(window.location.search).get("path");if(F){let E=We(F,window.location.origin);if(!E)te("That preview page is invalid. Enter a URL from this site.");else if(E!==n){if(E.split("#")[0]!==n.split("#")[0]){Ka.current=e,d.location.replace(E);return}d.location.replace(E),n=E}}}if(q(n),uo(e),!d.chiselReady){e.addEventListener("chisel:ready",Za,{once:!0});return}let I=e.documentElement;if(I.dataset.feedbackBound)return;I.dataset.feedbackBound="true";let G=e.createElement("style");G.textContent=`
|
|
5
|
+
html[data-chisel-mode="comment"]:not([data-chisel-comments-hidden="true"]) { --chisel-comment-cursor:${oo("#ffffff","#e2e2e2")};cursor:var(--chisel-comment-cursor) !important; }
|
|
345
6
|
html[data-chisel-mode="comment"]:not([data-chisel-comments-hidden="true"]) :not([data-chisel-root], [data-chisel-root] *) { cursor:var(--chisel-comment-cursor) !important; }
|
|
346
7
|
html[data-chisel-mode="comment"] [data-chisel-root] { cursor:auto; }
|
|
347
8
|
html[data-chisel-mode="comment"]:not([data-chisel-comments-hidden="true"]) :not([data-chisel-root], [data-chisel-root] *) { user-select:none !important; -webkit-user-select:none !important; }
|
|
348
9
|
@media(prefers-color-scheme:dark) {
|
|
349
|
-
html[data-chisel-mode="comment"]:not([data-chisel-comments-hidden="true"]) { --chisel-comment-cursor:${
|
|
10
|
+
html[data-chisel-mode="comment"]:not([data-chisel-comments-hidden="true"]) { --chisel-comment-cursor:${oo("#222222","#3c3c3c")}; }
|
|
350
11
|
}
|
|
351
12
|
html[data-chisel-mode="edit"] .chisel-panel-inner { border-radius:0;box-shadow:none; }
|
|
352
13
|
@media(min-width:761px) {
|
|
@@ -358,7 +19,7 @@ ${Io}
|
|
|
358
19
|
@media(max-width:760px) {
|
|
359
20
|
html[data-chisel-mode="edit"] .chisel-panel { left:0;right:0;bottom:0; }
|
|
360
21
|
}
|
|
361
|
-
`,e.head.append(V),I.dataset.chiselMode=c.current,I.dataset.chiselCommentsHidden=String(U.current),d.dispatchEvent(new Event("chisel:mode")),d.addEventListener("chisel:selection",h=>{let y=h.detail;Ue(y),y.selector&&(I.dataset.chiselSelection=y.selector)});let ee=()=>ht({x:d.scrollX,y:d.scrollY});ee(),d.addEventListener("scroll",ee),d.addEventListener("resize",()=>{me(null),ee()}),e.addEventListener("scroll",()=>{me(null),ee()},!0),e.addEventListener("mousemove",h=>{let y=h.target;me(c.current==="comment"&&!U.current&&y?.nodeType===1?y.getBoundingClientRect():null)},!0),e.addEventListener("mouseleave",()=>me(null));let H=null,he=!1,Aa=null;e.addEventListener("keydown",h=>{if(h.key==="Escape"&&H){Aa=H.pointerId,H=null,Ia(void 0),h.preventDefault(),h.stopPropagation();return}h.key==="Escape"&&!Ce.current&&(ie(null),D(null),me(null),Ue(null),delete I.dataset.chiselSelection)}),e.addEventListener("dragstart",h=>{c.current==="comment"&&!U.current&&!h.target?.closest("[data-chisel-root]")&&h.preventDefault()},!0),e.addEventListener("pointerdown",h=>{let y=h.target;if(!(c.current!=="comment"||U.current||h.pointerType!=="mouse"||h.button!==0||!y||y.closest("[data-chisel-root]"))){H={x:h.clientX+d.scrollX,y:h.clientY+d.scrollY,clientX:h.clientX,clientY:h.clientY,target:y,pointerId:h.pointerId,moved:!1},h.preventDefault(),h.stopPropagation();try{y.setPointerCapture(h.pointerId)}catch{}}},!0);function St(h,y){let G=h.clientX+d.scrollX,O=h.clientY+d.scrollY;return{x:Math.min(y.x,G),y:Math.min(y.y,O),width:Math.abs(G-y.x),height:Math.abs(O-y.y)}}e.addEventListener("pointermove",h=>{!H||h.pointerId!==H.pointerId||!H.moved&&Math.hypot(h.clientX-H.clientX,h.clientY-H.clientY)<6||(H.moved=!0,h.preventDefault(),h.stopPropagation(),me(null),Ia(St(h,H)))},!0),e.addEventListener("pointercancel",()=>{H=null,Aa=null,Ia(void 0)},!0),e.addEventListener("pointerup",async h=>{if(Aa===h.pointerId){Aa=null,he=!0,setTimeout(()=>{he=!1},0),h.preventDefault(),h.stopPropagation();return}let y=H;if(H=null,!y||h.pointerId!==y.pointerId||!y.moved)return;he=!0,setTimeout(()=>{he=!1},0),h.preventDefault(),h.stopPropagation();let G=St(h,y);if(Ia(void 0),c.current!=="comment"||U.current||G.width<1||G.height<1||!await ne())return;let O=y.target,ke=e.elementFromPoint(h.clientX,h.clientY);for(;O&&(!ke||!O.contains(ke));)O=O.parentElement;let oe=O?.getBoundingClientRect(),Me=G.x-d.scrollX,Za=G.y-d.scrollY,To=O&&O!==e.body&&O!==I&&oe&&oe.width>0&&oe.height>0&&Me>=oe.left&&Za>=oe.top&&Me+G.width<=oe.right&&Za+G.height<=oe.bottom,qo={...G,...To&&oe?{selector:dt(O),relative:{x:(Me-oe.left)/oe.width,y:(Za-oe.top)/oe.height,width:G.width/oe.width,height:G.height/oe.height}}:{}},wt={x:G.x,y:G.y,area:qo};ye(),delete I.dataset.chiselSelection,D(null),Xe(""),me(null),Ue(wt),fe(null),Qe.current=crypto.randomUUID(),ie(wt)},!0),e.addEventListener("click",async h=>{if(he){h.preventDefault(),h.stopImmediatePropagation();return}let y=h.target;if(!y||y.nodeType!==1||y.closest("[data-chisel-root]")||c.current==="view"||c.current==="comment"&&U.current)return;let G=y.getBoundingClientRect(),O=G.width?(h.clientX-G.left)/G.width:-1,ke=G.height?(h.clientY-G.top)/G.height:-1,oe=y!==e.body&&y!==I&&O>=0&&O<=1&&ke>=0&&ke<=1,Me={x:h.clientX+d.scrollX,y:h.clientY+d.scrollY,...oe?{selector:dt(y),tag:y.tagName.toLowerCase(),offsetX:O,offsetY:ke}:{}};c.current==="comment"&&(h.preventDefault(),h.stopImmediatePropagation(),!await ne())||(ye(),Ue(Me),Me.selector?I.dataset.chiselSelection=Me.selector:delete I.dataset.chiselSelection,c.current!=="edit"&&(h.preventDefault(),h.stopImmediatePropagation(),D(null),Xe(""),me(null),fe(null),Qe.current=crypto.randomUUID(),ie(Me)))},!0)}Pe(()=>{let e=Z?.defaultView;if(e)return co(e,d=>{if(!Ne(d,window.location.origin))return;T(d),j(I=>I.includes(d)?I:[...I,d]);let n=new URL(window.location.href);d==="/"?n.searchParams.delete("path"):n.searchParams.set("path",d),window.history.replaceState(window.history.state,"",n)})},[Z]),Pe(()=>{Z&&(Z.documentElement.dataset.chiselCommentsHidden=String(se))},[se,Z]),Pe(()=>()=>K.current?.cancel(),[]),Pe(()=>{if(!o)return;let e=!1,d,n=()=>{clearTimeout(d),d=setTimeout(()=>{d=void 0,I()},1e4)},I=async()=>{if(e||document.visibilityState==="hidden")return;if(Ce.current){n();return}clearTimeout(d),d=void 0;let H=++He.current;try{let he=await o.list();!e&&H===He.current&&(clearTimeout(d),d=void 0,S(he),ba(!1),te(""))}catch{!e&&H===He.current&&(ba(!1),te("Shared comments could not be loaded. Check your connection; retrying automatically."),n())}};I();let V=o.subscribe?.(()=>{I()}),ee=o.subscribe?void 0:window.setInterval(()=>{I()},1e4);return window.addEventListener("focus",I),document.addEventListener("visibilitychange",I),()=>{e=!0,clearTimeout(d),V?.(),window.clearInterval(ee),window.removeEventListener("focus",I),document.removeEventListener("visibilitychange",I)}},[o]);let bt=i?.setPage;Pe(()=>{bt?.(b)},[b,bt]),za(()=>{let e=le.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight+e.offsetHeight-e.clientHeight}px`)},[Be,ae,s?.id,se,A,b]),za(()=>{let e=w.current?.parentElement,d=e?.querySelector(".comment-box");if(!L||!e||!d||se)return;let n=()=>{let V=go(ce(L),{width:d.offsetWidth,height:d.offsetHeight},{width:e.clientWidth,height:e.clientHeight});d.style.left=`${V.left}px`,d.style.top=`${V.top}px`,d.style.maxHeight=`${V.maxHeight}px`};n();let I=new ResizeObserver(n);return I.observe(d),I.observe(e),()=>I.disconnect()}),za(()=>{let e=g.current;if(!e||se||m.current?.playState==="running")return;let d=e.parentElement?.parentElement,n=d?.clientHeight??356,I=d?.clientWidth??416,V=Number(e.dataset.pinX),ee=Number(e.dataset.pinY),H=ae?Math.max(8,Math.min(ee-40,n-Math.min(340,n-16)-8)):Math.max(8,Math.min(ee+32-e.offsetHeight,n-e.offsetHeight-8)),he=ae?V+44:V;e.style.left=`${Math.max(8,Math.min(he,I-e.offsetWidth-8))}px`,e.style.top=`${H}px`,e.style.maxHeight=`${n-H-8}px`}),za(()=>(z.current=!1,m.current=g.current&&!se?Ha(g.current):null,()=>{z.current=!1,m.current?.cancel()}),[s?.id,!!L,A,se,b]),Pe(()=>{w.current?.contentDocument?.readyState==="complete"&&Ka()},[]),Pe(()=>{let e=d=>{if(document.querySelector('dialog[open], [aria-modal="true"]'))return;let n=xo(d);if(!(!n||n===c.current||n==="edit"&&!Na)){if(d.preventDefault(),d.stopPropagation(),n==="toggle-comments"){K.current?.cancel(),ye(),_e(I=>!I);return}Pa(n)}};return document.addEventListener("keydown",e,!0),Z?.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0),Z?.removeEventListener("keydown",e,!0)}},[Z]),Pe(()=>{if(!s||Ae!==s.id||L||A==="edit"||s.path!==b||!s.selector||!Z)return;let e;try{e=Z.querySelector(s.selector)}catch{e=null}if(!e){We(null),te("This element is no longer on the page. Its saved changes cannot be previewed.");return}let d=Fa(e,s.changes??[]);return ge.current=d,ht({x:e.ownerDocument.defaultView.scrollX,y:e.ownerDocument.defaultView.scrollY}),d},[Ae,s,L,A,b,Z]);let $a=Wa?P.filter(e=>e.id!==Wa):P,kt=Co($a,Je,Ca);return x("main",{"aria-label":"Chisel workspace",className:`feedback-shell ${p?.className??""} ${A==="edit"?"is-editing":""} ${se?"comments-hidden":""}`,children:[u(tt,{}),v,x("div",{className:"feedback-workspace",children:[x("section",{className:"feedback-canvas","aria-label":"Website preview",children:[x("div",{className:"feedback-viewport",children:[u("iframe",{ref:w,src:"/",title:"Website for feedback",onLoad:Ka}),x("div",{className:"feedback-comment-layer","data-hover-preview":!!(s&&!ae&&!L),hidden:se,children:[(lt||L?.area||!L&&s?.area)&&(()=>{let e=at(lt||L?.area||s?.area,Z,Ye);return u("div",{className:"feedback-comment-area","data-testid":"comment-area",style:{left:e.left,top:e.top,width:e.width,height:e.height}})})(),L&&we?.type!=="create"&&u("span",{className:"feedback-pin comment-box-draft-pin","aria-hidden":"true",style:{left:ce(L).x,top:ce(L).y}}),s&&!L&&A!=="edit"&&s.path===b&&x("section",{ref:g,hidden:Wa===s.id,"data-pin-x":ce(s).x,"data-pin-y":ce(s).y,"data-pin-width":40+(Math.min(Ea(s).length,4)-1)*20,"data-expanded":ae,onPointerEnter:()=>{z.current||K.current?.cancel()},onPointerMove:Xa,onPointerLeave:()=>K.current?.schedule(),onFocus:Xa,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||K.current?.schedule()},"data-native-ui":!!p,className:"feedback-composer feedback-thread-popup comment-thread",role:"dialog","aria-label":"Comment thread",style:{left:`clamp(8px, ${ce(s).x-4}px, calc(100% - 408px))`,top:`clamp(8px, ${ce(s).y-4}px, calc(100% - ${ae?340:128}px))`},children:[!ae&&x("button",{type:"button",className:"feedback-hover-preview","aria-label":`Expand comment: ${s.text||s.attachments?.map(e=>e.name).join(", ")}`,onClick:()=>{Da(s)},children:[u("span",{className:"feedback-avatar",children:s.authorImage?u("img",{src:s.authorImage,alt:"",width:24,height:24}):s.author.slice(0,1).toUpperCase()}),x("span",{className:"feedback-hover-copy",children:[x("span",{className:"feedback-hover-byline",children:[u("strong",{children:s.author}),u("time",{dateTime:s.date,children:bo(s.date)})]}),u("span",{className:"feedback-hover-message",children:s.text||s.attachments?.map(e=>e.name).join(", ")})]})]}),x("div",{className:"feedback-thread-content",hidden:!ae,children:[x("header",{className:"feedback-thread-header",children:[u(ha,{onMoveStart:()=>{q.current=null,K.current?.cancel(),va()}}),x("div",{className:"feedback-thread-header-actions",children:[u("button",{className:"feedback-thread-close",type:"button",title:xt,"aria-label":xt,"aria-busy":!!ya,disabled:Ie||!!o&&!l&&s.authorId!==a.id,onClick:()=>{be({type:"resolve",id:s.id,resolved:!s.resolved})},children:ya?u(Te,{size:18,className:"chisel-spin"}):s.resolved?u(na,{size:18}):u(Re,{size:18})}),(!o||o.delete)&&(!o||s.authorId===a.id||l)&&u("button",{className:"feedback-thread-close feedback-thread-delete",type:"button",title:"Delete comment","aria-label":"Delete comment",disabled:Ie,onClick:()=>{Ro(s)},children:u(qe,{size:16})}),u("button",{className:"feedback-thread-close",type:"button",title:"Close thread","aria-label":"Close thread",onClick:gt,children:u(pa,{size:18})})]})]}),x("div",{className:"feedback-thread-summary",children:[!p&&Y&&Y.id===s.id?x("form",{onSubmit:async e=>{e.preventDefault(),await be({type:"edit",id:s.id,text:Y.text.trimEnd(),changes:s.changes??[]})&&($.current=!1,Se(null))},children:[u("textarea",{"aria-label":"Edit comment",value:Y.text,onChange:e=>{$.current=e.target.value!==Y.original,Se({...Y,text:e.target.value})}}),u("button",{type:"button",onClick:async()=>{$.current&&!await ne()||($.current=!1,Se(null))},children:"Cancel"}),s.selector&&u("button",{type:"button",onClick:()=>{It(s)},children:"Edit styles"}),u("button",{type:"submit",disabled:Ie||!Y.text.trim()&&!s.attachments?.length,children:"Save"})]}):!p&&x("button",{type:"button",className:"feedback-thread-summary-button","aria-label":`Expand comment: ${s.text}`,"aria-expanded":ae,onClick:va,children:[u("span",{className:"feedback-avatar",children:s.authorImage?u("img",{src:s.authorImage,alt:"",width:27,height:27}):s.author.slice(0,1).toUpperCase()}),x("span",{className:"feedback-thread-summary-copy",children:[x("span",{className:"feedback-thread-byline",children:[u("strong",{children:s.author}),u("time",{dateTime:s.date,children:new Date(s.date).toLocaleDateString(void 0,{month:"short",day:"numeric"})})]}),u("span",{className:"feedback-thread-message",children:s.text}),!ae&&u("span",{className:"feedback-thread-reply-count",children:s.replies.length?`${s.replies.length} ${s.replies.length===1?"reply":"replies"}`:"Reply\u2026"})]})]}),!p&&s.authorId===a.id&&Y?.id!==s.id&&u("button",{className:"feedback-message-edit",type:"button",title:"Edit comment","aria-label":"Edit comment",disabled:Ie,onClick:async()=>{await ne()&&(pe(""),$.current=!1,Se({id:s.id,text:s.text,original:s.text}))},children:u($e,{size:16})})]}),!!s.changes?.length&&u("div",{className:"feedback-proposal-actions",children:x("button",{type:"button",className:"feedback-preview","aria-pressed":Ae===s.id,disabled:!s.selector,onClick:()=>{te(""),We(Ae===s.id?null:s.id)},children:[u(ra,{size:16}),Ae===s.id?"Exit preview":"Preview changes"]})}),(ae||p)&&u(ga,{children:p?p.renderThread({comment:s,expanded:ae,reply:Be,saving:Ie,submittingReply:we?.type==="reply"&&we.id===s.id,userId:a.id,onEditDraftChange:e=>{$.current=e},onDiscardEdit:ne,onBeginEdit:async()=>await ne()?(pe(""),ue.current=null,!0):!1,onEditStyles:s.selector?()=>{It(s)}:void 0,onEdit:(e,d,n)=>be(e?{type:"edit_reply",id:s.id,replyId:e,text:d,body:n}:{type:"edit",id:s.id,text:d,changes:s.changes??[],body:n}),canResolve:!o||l||s.authorId===a.id,replyAuthor:a,onAttachmentDraftChange:e=>{De.current=e},onReplyText:e=>{pe(e),ue.current=null},onReply:async(e,d,n,I)=>{if(!e.trim()&&!n?.length)return!1;let V=await be({type:"reply",id:s.id,body:d,attachmentTokens:n,reply:{id:ue.current??(ue.current=crypto.randomUUID()),text:e.trimEnd(),author:a.name,authorId:a.id,authorImage:a.image}},I);return V&&(pe(""),ue.current=null),V},onResolve:()=>{be({type:"resolve",id:s.id,resolved:!s.resolved})},onExpand:va}):x(ga,{children:[u("div",{className:"feedback-thread-replies",children:s.replies.map((e,d)=>x("div",{className:"feedback-thread-reply",children:[u("span",{className:"feedback-avatar","aria-hidden":"true",children:(typeof e=="string"?"?":e.author.slice(0,1)).toUpperCase()}),x("div",{children:[typeof e!="string"&&u("strong",{children:e.author}),typeof e!="string"&&Y&&Y.id===e.id?x("form",{onSubmit:async n=>{n.preventDefault(),await be({type:"edit_reply",id:s.id,replyId:Y.id,text:Y.text.trimEnd()})&&($.current=!1,Se(null))},children:[u("textarea",{"aria-label":"Edit comment",value:Y.text,onChange:n=>{$.current=n.target.value!==Y.original,Se({...Y,text:n.target.value})}}),u("button",{type:"button",onClick:async()=>{$.current&&!await ne()||($.current=!1,Se(null))},children:"Cancel"}),u("button",{type:"submit",disabled:Ie||!Y.text.trim()&&!e.attachments?.length,children:"Save"})]}):u("p",{children:typeof e=="string"?e:e.text})]}),typeof e!="string"&&e.id&&e.authorId===a.id&&Y?.id!==e.id&&u("button",{className:"feedback-message-edit",type:"button",title:"Edit comment","aria-label":"Edit comment",disabled:Ie,onClick:async()=>{await ne()&&(pe(""),$.current=!1,Se({id:e.id,text:e.text,original:e.text}))},children:u($e,{size:16})})]},d))}),x("form",{hidden:we?.type==="reply"&&we.id===s.id,onSubmit:async e=>{e.preventDefault(),Be.trim()&&await be({type:"reply",id:s.id,reply:{id:ue.current??(ue.current=crypto.randomUUID()),text:Be.trimEnd(),author:a.name,authorId:a.id,authorImage:a.image}})&&(pe(""),ue.current=null)},children:[u("textarea",{ref:le,"aria-label":"Reply",rows:1,placeholder:"Write a reply\u2026",value:Be,maxLength:4e3,onChange:e=>{pe(e.target.value),ue.current=null},disabled:Ie,required:!0}),u("div",{className:"feedback-thread-actions",children:x("button",{type:"submit",className:"feedback-primary",disabled:Ie||!Be.trim(),"aria-label":"Reply",children:["Reply ",u(ta,{})]})})]})]})})]})]},s.id),A==="comment"&&[Ga,ce(L??s??vo??{x:0,y:0}).rect].map((e,d)=>e&&u("div",{"data-testid":d===0?"element-hover":"element-selection",className:`feedback-element-box ${d===1?"is-selected":""}`,style:{left:e.left,top:e.top,width:e.width,height:e.height}},d)),A!=="edit"&&$a.filter(e=>e.path===b&&!e.resolved).map(e=>{let d=Ea(e);return x("button",{"aria-label":`Open comment: ${e.text}`,title:d.map(n=>n.author).join(", "),className:`feedback-pin ${d.length>1?"feedback-pin-group":""} ${Q===e.id?"selected":""}`,onPointerEnter:n=>{n.pointerType!=="touch"&&Ct(e)},onPointerLeave:()=>K.current?.schedule(),style:{left:ce(e).x,top:ce(e).y},onClick:()=>Da(e),children:[d.slice(0,3).map((n,I)=>u("span",{className:"feedback-avatar","aria-hidden":"true",children:n.authorImage?u("img",{src:n.authorImage,alt:"",width:24,height:24}):n.author.slice(0,1).toUpperCase()},I)),d.length>3&&x("span",{className:"feedback-avatar feedback-pin-more","aria-hidden":"true",children:["+",d.length-3]})]},e.id)}),L&&Z&&u(Ja,{target:L.selector?Z.querySelector(L.selector):null,text:Po,onText:Xe,onDraftChange:e=>{Ve.current=e},hidden:we?.type==="create",editing:!!J,commentId:J??void 0,renderComposer:p?.renderComposer,changes:P.find(e=>e.id===J)?.changes,hasExistingAttachments:!!P.find(e=>e.id===J)?.attachments?.length,onCancel:()=>{ie(null),Xe(""),fe(null)},onPost:(e,d,n,I,V)=>J?be({type:"edit",id:J,text:d,changes:e,body:n,attachmentTokens:I}):be({type:"create",body:n,attachmentTokens:I,comment:{id:Qe.current??(Qe.current=crypto.randomUUID()),path:b,...L,text:d,author:a.name,authorId:a.id,authorImage:a.image,date:new Date().toISOString(),resolved:!1,replies:[],changes:e}},V),style:{left:ce(L).x+44,top:ce(L).y}},`${L.selector}:${L.x}:${L.y}`)]})]}),x("div",{className:"feedback-toolbar","aria-label":"Preview mode",children:[Na&&x("button",{title:"Edit styles","aria-keyshortcuts":"E","aria-pressed":A==="edit",onClick:()=>Pa("edit"),children:[u(ze,{}),u("span",{children:"Edit"})]}),x("button",{title:"Add comments","aria-keyshortcuts":"C","aria-pressed":A==="comment",onClick:()=>Pa("comment"),children:[u(Ke,{}),u("span",{children:"Comment"})]}),x("button",{title:"View website","aria-keyshortcuts":"V","aria-pressed":A==="view",onClick:()=>Pa("view"),children:[u(ia,{}),u("span",{children:"View"})]})]})]}),u("aside",{className:"feedback-sidebar",hidden:A==="edit"||se,children:x("div",{className:"feedback-sidebar-panel",children:[x("div",{className:"feedback-sidebar-title",children:[x("h1",{children:["Comments ",u("span",{children:$a.length})]}),x("details",{className:"feedback-account",children:[u("summary",{title:`Signed in as ${a.name}`,"aria-label":`Account: ${a.name}`,children:u("span",{className:"feedback-avatar",children:a.image?u("img",{src:a.image,alt:"",width:27,height:27}):a.name.slice(0,1).toUpperCase()})}),x("div",{children:[u("strong",{children:a.name}),u("span",{children:a.email}),x("button",{onClick:async()=>{try{await r(),window.location.reload()}catch{te("Sign out failed. Please try again.")}},children:[u(sa,{}),"Sign out"]})]})]})]}),x("label",{className:"feedback-search",children:[u(ca,{"aria-hidden":"true",size:18}),u("input",{type:"search","aria-label":"Search comments",placeholder:"Search",value:Ca,onChange:e=>Ao(e.target.value)})]}),i&&(i.status!=="connected"||i.participants.length>0||i.unreadThreadIds.length>0)&&x("div",{className:"feedback-collaboration","aria-label":"Review activity",children:[i.status!=="connected"&&u("span",{role:"status",children:i.status==="connecting"||i.status==="initial"?"Connecting\u2026":"Reconnecting\u2026"}),u("div",{className:"feedback-reviewers",children:i.participants.map(e=>u("span",{className:"feedback-avatar",title:`${e.name} \xB7 ${e.path}`,"aria-label":`${e.name} is reviewing ${e.path}`,children:e.image?u("img",{src:e.image,alt:"",width:24,height:24}):e.name.slice(0,1).toUpperCase()},e.id))}),i.unreadThreadIds.length>0&&x("span",{className:"feedback-unread-count",children:[i.unreadThreadIds.length," unread"]})]}),u("div",{className:"feedback-tabs",role:"group","aria-label":"Filter comments",children:["open","resolved","all"].map(e=>u("button",{"aria-pressed":Je===e,onClick:()=>Do(e),children:e[0].toUpperCase()+e.slice(1)},e))}),ut&&u("p",{role:"alert",className:"feedback-error",children:ut}),x("div",{className:"feedback-comment-list",children:[kt.map(e=>u("article",{onPointerEnter:d=>{d.pointerType!=="touch"&&Ct(e)},onPointerLeave:()=>K.current?.schedule(),className:`feedback-comment ${Q===e.id?"active":""}`,children:x("button",{className:"feedback-comment-main","aria-pressed":Q===e.id,onClick:()=>Da(e),children:[x("span",{className:"feedback-comment-heading",children:[u("span",{className:"feedback-avatar",children:e.authorImage?u("img",{src:e.authorImage,alt:"",width:28,height:28}):e.author.slice(0,1).toUpperCase()}),x("span",{className:"feedback-comment-identity",children:[x("span",{className:"feedback-comment-meta",children:[u("strong",{children:e.author}),e.pending?u("span",{role:"status",children:"Sending\u2026"}):u("time",{dateTime:e.date,children:new Date(e.date).toLocaleDateString(void 0,{month:"short",day:"numeric"})})]}),x("span",{className:"feedback-comment-status",children:[Je==="all"&&x(ga,{children:[e.resolved?"Resolved":"Open",u("span",{"aria-hidden":"true",children:" \xB7 "})]}),u("span",{className:"feedback-comment-path",title:e.path,children:e.path})]})]}),i?.unreadThreadIds.includes(e.id)&&u("span",{className:"feedback-comment-unread-dot","aria-hidden":"true"})]}),u("span",{className:"feedback-comment-body",children:e.text||e.attachments?.map(d=>d.name).join(", ")}),(e.replies.length>0||i?.unreadThreadIds.includes(e.id))&&x("span",{className:"feedback-comment-activity",children:[e.replies.length>0&&x(ga,{children:[u("span",{className:"feedback-comment-avatars",children:Ea(e).slice(1,4).map((d,n)=>u("span",{className:"feedback-avatar",title:d.author,children:d.authorImage?u("img",{src:d.authorImage,alt:"",width:20,height:20}):d.author.slice(0,1).toUpperCase()},n))}),x("span",{className:"feedback-comment-reply-count",children:[e.replies.length," ",e.replies.length===1?"reply":"replies"]})]}),i?.unreadThreadIds.includes(e.id)&&u("span",{className:"feedback-unread-label",children:e.replies.length?"New replies":"Unread"})]})]})},e.id)),st&&u("p",{role:"status",children:"Loading shared comments\u2026"}),!st&&!kt.length&&x("div",{className:"feedback-empty",children:[u("span",{children:u(Ke,{size:30})}),u("h2",{children:Ca.trim()?"No matching comments":Je==="resolved"?"Nothing resolved yet":"No comments yet"}),u("p",{children:Ca.trim()?"Try another name, phrase, or page.":Je==="resolved"?"Resolved threads will appear here.":"Click anywhere on the page to leave your first comment."})]})]}),u(Ya,{path:b,disabled:Ie||!Z,onNavigate:Fo,onOpen:Mo,routes:[...new Set([b,...E,..._,...P.map(e=>e.path)])].filter(e=>Z&&Ne(e,window.location.origin)).sort((e,d)=>e.localeCompare(d))}),f&&l&&x("details",{className:"feedback-review-invite",children:[x("summary",{children:[u(Ee,{"aria-hidden":"true"}),"Share review link"]}),x("form",{onSubmit:e=>{e.preventDefault(),Lt()},children:[u("p",{children:"Anyone with this link can sign in and review this website."}),u("button",{type:"submit",className:"feedback-primary",disabled:Sa,children:Sa?"Preparing link\u2026":"Copy review link"}),nt&&x(ga,{children:[u("input",{"aria-label":"Review link",value:nt,readOnly:!0,onFocus:e=>e.currentTarget.select()}),u("button",{type:"button",onClick:()=>{Lt(!0)},disabled:Sa,children:"Replace invitation link"}),u("p",{children:"Replacing the link blocks new joins through the old link. Existing reviewers keep access."})]}),pt&&u("p",{role:"status",children:pt})]})]})]})})]})]})}import{jsx as tr}from"react/jsx-runtime";import{useEffect as wo,useSyncExternalStore as or}from"react";import{Chisel as rr}from"use-chisel";function dr(a){return window.addEventListener("chisel:mode",a),()=>window.removeEventListener("chisel:mode",a)}function lr(){try{return window.self!==window.top&&window.parent.location.origin===window.location.origin&&window.parent.location.pathname==="/chisel"?document.documentElement.dataset.chiselMode??"view":"site"}catch{return"site"}}function ur({projectName:a="Chisel"}){let t=or(dr,lr,()=>"site");return wo(()=>{process.env.NEXT_PUBLIC_CHISEL_ENABLED!=="0"&&(window.chiselReady=!0,document.dispatchEvent(new Event("chisel:ready")))},[]),wo(()=>{if(t!=="edit")return;let r=window.setTimeout(()=>window.dispatchEvent(new Event("chisel:select")),50);return()=>window.clearTimeout(r)},[t]),t==="site"||process.env.NODE_ENV==="production"||process.env.NEXT_PUBLIC_CHISEL_ENABLED==="0"?null:tr(rr,{embedded:!0,enabled:t==="edit",projectName:a})}export{ur as ChiselPreview,So as ChiselWorkspace,tt as ChiselWorkspaceStyles};
|
|
22
|
+
`,e.head.append(G),I.dataset.chiselMode=c.current,I.dataset.chiselCommentsHidden=String(H.current),d.dispatchEvent(new Event("chisel:mode")),d.addEventListener("chisel:selection",h=>{let S=h.detail;He(S),S.selector&&(I.dataset.chiselSelection=S.selector)});let ee=()=>Lt({x:d.scrollX,y:d.scrollY});ee(),d.addEventListener("scroll",ee),d.addEventListener("resize",()=>{he(null),ee()}),e.addEventListener("scroll",()=>{he(null),ee()},!0);let Z=null,ke=null,yt=()=>{Z!==null&&d.cancelAnimationFrame(Z),Z=null,ke=null,he(null)};e.addEventListener("mousemove",h=>{ke=h.target,Z===null&&(Z=d.requestAnimationFrame(()=>{Z=null;let S=c.current==="comment"&&!H.current&&ke?.nodeType===1?ke.getBoundingClientRect():null;he(F=>F?.left===S?.left&&F?.top===S?.top&&F?.width===S?.width&&F?.height===S?.height?F:S)}))},!0),e.addEventListener("mouseleave",yt),d.addEventListener("pagehide",yt);let ne=null,aa=!1,Ba=null;e.addEventListener("keydown",h=>{if(h.key==="Escape"&&ne){Ba=ne.pointerId,ne=null,ba(void 0),h.preventDefault(),h.stopPropagation();return}h.key==="Escape"&&!Ce.current&&(ie(null),A(null),he(null),He(null),delete I.dataset.chiselSelection)}),e.addEventListener("dragstart",h=>{c.current==="comment"&&!H.current&&!h.target?.closest("[data-chisel-root]")&&h.preventDefault()},!0),e.addEventListener("pointerdown",h=>{let S=h.target;if(!(c.current!=="comment"||H.current||h.pointerType!=="mouse"||h.button!==0||!S||S.closest("[data-chisel-root]"))){ne={x:h.clientX+d.scrollX,y:h.clientY+d.scrollY,clientX:h.clientX,clientY:h.clientY,target:S,pointerId:h.pointerId,moved:!1},h.preventDefault(),h.stopPropagation();try{S.setPointerCapture(h.pointerId)}catch{}}},!0);function vt(h,S){let F=h.clientX+d.scrollX,E=h.clientY+d.scrollY;return{x:Math.min(S.x,F),y:Math.min(S.y,E),width:Math.abs(F-S.x),height:Math.abs(E-S.y)}}e.addEventListener("pointermove",h=>{!ne||h.pointerId!==ne.pointerId||!ne.moved&&Math.hypot(h.clientX-ne.clientX,h.clientY-ne.clientY)<6||(ne.moved=!0,h.preventDefault(),h.stopPropagation(),he(null),ba(vt(h,ne)))},!0),e.addEventListener("pointercancel",()=>{ne=null,Ba=null,ba(void 0)},!0),e.addEventListener("pointerup",async h=>{if(Ba===h.pointerId){Ba=null,aa=!0,setTimeout(()=>{aa=!1},0),h.preventDefault(),h.stopPropagation();return}let S=ne;if(ne=null,!S||h.pointerId!==S.pointerId||!S.moved)return;aa=!0,setTimeout(()=>{aa=!1},0),h.preventDefault(),h.stopPropagation();let F=vt(h,S);if(ba(void 0),c.current!=="comment"||H.current||F.width<1||F.height<1||!await ce())return;let E=S.target,Se=e.elementFromPoint(h.clientX,h.clientY);for(;E&&(!Se||!E.contains(Se));)E=E.parentElement;let oe=E?.getBoundingClientRect(),Fe=F.x-d.scrollX,_a=F.y-d.scrollY,xo=E&&E!==e.body&&E!==I&&oe&&oe.width>0&&oe.height>0&&Fe>=oe.left&&_a>=oe.top&&Fe+F.width<=oe.right&&_a+F.height<=oe.bottom,Lo={...F,...xo&&oe?{selector:ut(E),relative:{x:(Fe-oe.left)/oe.width,y:(_a-oe.top)/oe.height,width:F.width/oe.width,height:F.height/oe.height}}:{}},Pt={x:F.x,y:F.y,area:Lo};ve(),delete I.dataset.chiselSelection,A(null),Ke(""),he(null),He(Pt),fe(null),je.current=crypto.randomUUID(),ie(Pt)},!0),e.addEventListener("click",async h=>{if(aa){h.preventDefault(),h.stopImmediatePropagation();return}let S=h.target;if(!S||S.nodeType!==1||S.closest("[data-chisel-root]")||c.current==="view"||c.current==="comment"&&H.current)return;let F=S.getBoundingClientRect(),E=F.width?(h.clientX-F.left)/F.width:-1,Se=F.height?(h.clientY-F.top)/F.height:-1,oe=S!==e.body&&S!==I&&E>=0&&E<=1&&Se>=0&&Se<=1,Fe={x:h.clientX+d.scrollX,y:h.clientY+d.scrollY,...oe?{selector:ut(S),tag:S.tagName.toLowerCase(),offsetX:E,offsetY:Se}:{}};c.current==="comment"&&(h.preventDefault(),h.stopImmediatePropagation(),!await ce())||(ve(),He(Fe),Fe.selector?I.dataset.chiselSelection=Fe.selector:delete I.dataset.chiselSelection,c.current!=="edit"&&(h.preventDefault(),h.stopImmediatePropagation(),A(null),Ke(""),he(null),fe(null),je.current=crypto.randomUUID(),ie(Fe)))},!0)}Ae(()=>{let e=$?.defaultView;if(e)return $t(e,d=>{if(!We(d,window.location.origin))return;q(d),J(I=>I.includes(d)?I:[...I,d]);let n=new URL(window.location.href);d==="/"?n.searchParams.delete("path"):n.searchParams.set("path",d),window.history.replaceState(window.history.state,"",n)})},[$]),Ae(()=>{$&&($.documentElement.dataset.chiselCommentsHidden=String(se))},[se,$]),Ae(()=>()=>X.current?.cancel(),[]),Ae(()=>{if(!o)return;let e=!1,d,n=()=>{clearTimeout(d),d=setTimeout(()=>{d=void 0,I()},1e4)},I=async()=>{if(e||document.visibilityState==="hidden")return;if(Ce.current){n();return}clearTimeout(d),d=void 0;let Z=++Ee.current;try{let ke=await o.list();!e&&Z===Ee.current&&(clearTimeout(d),d=void 0,w(ke),Sa(!1),te(""))}catch{!e&&Z===Ee.current&&(Sa(!1),te("Shared comments could not be loaded. Check your connection; retrying automatically."),n())}};I();let G=o.subscribe?.(()=>{I()}),ee=o.subscribe?void 0:window.setInterval(()=>{I()},1e4);return window.addEventListener("focus",I),document.addEventListener("visibilitychange",I),()=>{e=!0,clearTimeout(d),G?.(),window.clearInterval(ee),window.removeEventListener("focus",I),document.removeEventListener("visibilitychange",I)}},[o]);let St=i?.setPage;Ae(()=>{St?.(b)},[b,St]),Wa(()=>{let e=le.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight+e.offsetHeight-e.clientHeight}px`)},[Be,ae,s?.id,se,D,b]),Wa(()=>{let e=y.current?.parentElement,d=e?.querySelector(".comment-box");if(!L||!e||!d||se)return;let n=()=>{let G=jt(pe(L),{width:d.offsetWidth,height:d.offsetHeight},{width:e.clientWidth,height:e.clientHeight});d.style.left=`${G.left}px`,d.style.top=`${G.top}px`,d.style.maxHeight=`${G.maxHeight}px`};n();let I=new ResizeObserver(n);return I.observe(d),I.observe(e),()=>I.disconnect()}),Wa(()=>{let e=g.current;if(!e||se||m.current?.playState==="running")return;let d=e.parentElement?.parentElement,n=d?.clientHeight??356,I=d?.clientWidth??416,G=Number(e.dataset.pinX),ee=Number(e.dataset.pinY),Z=ae?Math.max(8,Math.min(ee-40,n-Math.min(340,n-16)-8)):Math.max(8,Math.min(ee+32-e.offsetHeight,n-e.offsetHeight-8)),ke=ae?G+44:G;e.style.left=`${Math.max(8,Math.min(ke,I-e.offsetWidth-8))}px`,e.style.top=`${Z}px`,e.style.maxHeight=`${n-Z-8}px`}),Wa(()=>(z.current=!1,m.current=g.current&&!se?Oa(g.current):null,()=>{z.current=!1,m.current?.cancel()}),[s?.id,!!L,D,se,b]),Ae(()=>{y.current?.contentDocument?.readyState==="complete"&&Za()},[]),Ae(()=>{let e=d=>{if(document.querySelector('dialog[open], [aria-modal="true"]'))return;let n=Qt(d);if(!(!n||n===c.current||n==="edit"&&!Ga)){if(d.preventDefault(),d.stopPropagation(),n==="toggle-comments"){X.current?.cancel(),ve(),Qe(I=>!I);return}Da(n)}};return document.addEventListener("keydown",e,!0),$?.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0),$?.removeEventListener("keydown",e,!0)}},[$]),Ae(()=>{if(!s||Me!==s.id||L||D==="edit"||s.path!==b||!s.selector||!$)return;let e;try{e=$.querySelector(s.selector)}catch{e=null}if(!e){Ve(null),te("This element is no longer on the page. Its saved changes cannot be previewed.");return}let d=Ta(e,s.changes??[]);return ge.current=d,Lt({x:e.ownerDocument.defaultView.scrollX,y:e.ownerDocument.defaultView.scrollY}),d},[Me,s,L,D,b,$]);let Ja=Xa?P.filter(e=>e.id!==Xa):P,wt=ao(Ja,Ye,ka);return x("main",{"aria-label":"Chisel workspace",className:`feedback-shell ${p?.className??""} ${D==="edit"?"is-editing":""} ${se?"comments-hidden":""}`,children:[u(rt,{}),v,x("div",{className:"feedback-workspace",children:[x("section",{className:"feedback-canvas","aria-label":"Website preview",children:[x("div",{className:"feedback-viewport",children:[u("iframe",{ref:y,src:"/",title:"Website for feedback",onLoad:Za}),x("div",{className:"feedback-comment-layer","data-hover-preview":!!(s&&!ae&&!L),hidden:se,children:[(st||L?.area||!L&&s?.area)&&(()=>{let e=ot(st||L?.area||s?.area,$,ea);return u("div",{className:"feedback-comment-area","data-testid":"comment-area",style:{left:e.left,top:e.top,width:e.width,height:e.height}})})(),L&&ye?.type!=="create"&&u("span",{className:"feedback-pin comment-box-draft-pin","aria-hidden":"true",style:{left:pe(L).x,top:pe(L).y}}),s&&!L&&D!=="edit"&&s.path===b&&x("section",{ref:g,hidden:Xa===s.id,"data-pin-x":pe(s).x,"data-pin-y":pe(s).y,"data-pin-width":40+(Math.min(Na(s).length,4)-1)*20,"data-expanded":ae,onPointerEnter:()=>{z.current||X.current?.cancel()},onPointerMove:$a,onPointerLeave:()=>X.current?.schedule(),onFocus:$a,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||X.current?.schedule()},"data-native-ui":!!p,className:"feedback-composer feedback-thread-popup comment-thread",role:"dialog","aria-label":"Comment thread",style:{left:`clamp(8px, ${pe(s).x-4}px, calc(100% - 408px))`,top:`clamp(8px, ${pe(s).y-4}px, calc(100% - ${ae?340:128}px))`},children:[!ae&&x("button",{type:"button",className:"feedback-hover-preview","aria-label":`Expand comment: ${s.text||s.attachments?.map(e=>e.name).join(", ")}`,onClick:()=>{Ma(s)},children:[u("span",{className:"feedback-avatar",children:s.authorImage?u("img",{src:s.authorImage,alt:"",width:24,height:24}):s.author.slice(0,1).toUpperCase()}),x("span",{className:"feedback-hover-copy",children:[x("span",{className:"feedback-hover-byline",children:[u("strong",{children:s.author}),u("time",{dateTime:s.date,children:to(s.date)})]}),u("span",{className:"feedback-hover-message",children:s.text||s.attachments?.map(e=>e.name).join(", ")})]})]}),x("div",{className:"feedback-thread-content",hidden:!ae,children:[x("header",{className:"feedback-thread-header",children:[u(La,{onMoveStart:()=>{U.current=null,X.current?.cancel(),Aa()}}),x("div",{className:"feedback-thread-header-actions",children:[u("button",{className:"feedback-thread-close",type:"button",title:gt,"aria-label":gt,"aria-busy":!!Pa,disabled:Ie||!!o&&!l&&s.authorId!==a.id,onClick:()=>{be({type:"resolve",id:s.id,resolved:!s.resolved})},children:Pa?u(qe,{size:18,className:"chisel-spin"}):s.resolved?u(pa,{size:18}):u(Te,{size:18})}),(!o||o.delete)&&(!o||s.authorId===a.id||l)&&u("button",{className:"feedback-thread-close feedback-thread-delete",type:"button",title:"Delete comment","aria-label":"Delete comment",disabled:Ie,onClick:()=>{ho(s)},children:u(Ue,{size:16})}),u("button",{className:"feedback-thread-close",type:"button",title:"Close thread","aria-label":"Close thread",onClick:Ct,children:u(ha,{size:18})})]})]}),x("div",{className:"feedback-thread-summary",children:[!p&&j&&j.id===s.id?x("form",{onSubmit:async e=>{e.preventDefault(),await be({type:"edit",id:s.id,text:j.text.trimEnd(),changes:s.changes??[]})&&(K.current=!1,we(null))},children:[u("textarea",{"aria-label":"Edit comment",value:j.text,onChange:e=>{K.current=e.target.value!==j.original,we({...j,text:e.target.value})}}),u("button",{type:"button",onClick:async()=>{K.current&&!await ce()||(K.current=!1,we(null))},children:"Cancel"}),s.selector&&u("button",{type:"button",onClick:()=>{bt(s)},children:"Edit styles"}),u("button",{type:"submit",disabled:Ie||!j.text.trim()&&!s.attachments?.length,children:"Save"})]}):!p&&x("button",{type:"button",className:"feedback-thread-summary-button","aria-label":`Expand comment: ${s.text}`,"aria-expanded":ae,onClick:Aa,children:[u("span",{className:"feedback-avatar",children:s.authorImage?u("img",{src:s.authorImage,alt:"",width:27,height:27}):s.author.slice(0,1).toUpperCase()}),x("span",{className:"feedback-thread-summary-copy",children:[x("span",{className:"feedback-thread-byline",children:[u("strong",{children:s.author}),u("time",{dateTime:s.date,children:new Date(s.date).toLocaleDateString(void 0,{month:"short",day:"numeric"})})]}),u("span",{className:"feedback-thread-message",children:s.text}),!ae&&u("span",{className:"feedback-thread-reply-count",children:s.replies.length?`${s.replies.length} ${s.replies.length===1?"reply":"replies"}`:"Reply\u2026"})]})]}),!p&&s.authorId===a.id&&j?.id!==s.id&&u("button",{className:"feedback-message-edit",type:"button",title:"Edit comment","aria-label":"Edit comment",disabled:Ie,onClick:async()=>{await ce()&&(me(""),K.current=!1,we({id:s.id,text:s.text,original:s.text}))},children:u(Ze,{size:16})})]}),!!s.changes?.length&&u("div",{className:"feedback-proposal-actions",children:x("button",{type:"button",className:"feedback-preview","aria-pressed":Me===s.id,disabled:!s.selector,onClick:()=>{te(""),Ve(Me===s.id?null:s.id)},children:[u(la,{size:16}),Me===s.id?"Exit preview":"Preview changes"]})}),(ae||p)&&u(Ca,{children:p?p.renderThread({comment:s,expanded:ae,reply:Be,saving:Ie,submittingReply:ye?.type==="reply"&&ye.id===s.id,userId:a.id,onEditDraftChange:e=>{K.current=e},onDiscardEdit:ce,onBeginEdit:async()=>await ce()?(me(""),ue.current=null,!0):!1,onEditStyles:s.selector?()=>{bt(s)}:void 0,onEdit:(e,d,n)=>be(e?{type:"edit_reply",id:s.id,replyId:e,text:d,body:n}:{type:"edit",id:s.id,text:d,changes:s.changes??[],body:n}),canResolve:!o||l||s.authorId===a.id,replyAuthor:a,onAttachmentDraftChange:e=>{De.current=e},onReplyText:e=>{me(e),ue.current=null},onReply:async(e,d,n,I)=>{if(!e.trim()&&!n?.length)return!1;let G=await be({type:"reply",id:s.id,body:d,attachmentTokens:n,reply:{id:ue.current??(ue.current=crypto.randomUUID()),text:e.trimEnd(),author:a.name,authorId:a.id,authorImage:a.image}},I);return G&&(me(""),ue.current=null),G},onResolve:()=>{be({type:"resolve",id:s.id,resolved:!s.resolved})},onExpand:Aa}):x(Ca,{children:[u("div",{className:"feedback-thread-replies",children:s.replies.map((e,d)=>x("div",{className:"feedback-thread-reply",children:[u("span",{className:"feedback-avatar","aria-hidden":"true",children:(typeof e=="string"?"?":e.author.slice(0,1)).toUpperCase()}),x("div",{children:[typeof e!="string"&&u("strong",{children:e.author}),typeof e!="string"&&j&&j.id===e.id?x("form",{onSubmit:async n=>{n.preventDefault(),await be({type:"edit_reply",id:s.id,replyId:j.id,text:j.text.trimEnd()})&&(K.current=!1,we(null))},children:[u("textarea",{"aria-label":"Edit comment",value:j.text,onChange:n=>{K.current=n.target.value!==j.original,we({...j,text:n.target.value})}}),u("button",{type:"button",onClick:async()=>{K.current&&!await ce()||(K.current=!1,we(null))},children:"Cancel"}),u("button",{type:"submit",disabled:Ie||!j.text.trim()&&!e.attachments?.length,children:"Save"})]}):u("p",{children:typeof e=="string"?e:e.text})]}),typeof e!="string"&&e.id&&e.authorId===a.id&&j?.id!==e.id&&u("button",{className:"feedback-message-edit",type:"button",title:"Edit comment","aria-label":"Edit comment",disabled:Ie,onClick:async()=>{await ce()&&(me(""),K.current=!1,we({id:e.id,text:e.text,original:e.text}))},children:u(Ze,{size:16})})]},d))}),x("form",{hidden:ye?.type==="reply"&&ye.id===s.id,onSubmit:async e=>{e.preventDefault(),Be.trim()&&await be({type:"reply",id:s.id,reply:{id:ue.current??(ue.current=crypto.randomUUID()),text:Be.trimEnd(),author:a.name,authorId:a.id,authorImage:a.image}})&&(me(""),ue.current=null)},children:[u("textarea",{ref:le,"aria-label":"Reply",rows:1,placeholder:"Write a reply\u2026",value:Be,maxLength:4e3,onChange:e=>{me(e.target.value),ue.current=null},disabled:Ie,required:!0}),u("div",{className:"feedback-thread-actions",children:x("button",{type:"submit",className:"feedback-primary",disabled:Ie||!Be.trim(),"aria-label":"Reply",children:["Reply ",u(ra,{})]})})]})]})})]})]},s.id),D==="comment"&&[Va,pe(L??s??so??{x:0,y:0}).rect].map((e,d)=>e&&u("div",{"data-testid":d===0?"element-hover":"element-selection",className:`feedback-element-box ${d===1?"is-selected":""}`,style:{left:e.left,top:e.top,width:e.width,height:e.height}},d)),D!=="edit"&&Ja.filter(e=>e.path===b&&!e.resolved).map(e=>{let d=Na(e);return x("button",{"aria-label":`Open comment: ${e.text}`,title:d.map(n=>n.author).join(", "),className:`feedback-pin ${d.length>1?"feedback-pin-group":""} ${Y===e.id?"selected":""}`,onPointerEnter:n=>{n.pointerType!=="touch"&&kt(e)},onPointerLeave:()=>X.current?.schedule(),style:{left:pe(e).x,top:pe(e).y},onClick:()=>Ma(e),children:[d.slice(0,3).map((n,I)=>u("span",{className:"feedback-avatar","aria-hidden":"true",children:n.authorImage?u("img",{src:n.authorImage,alt:"",width:24,height:24}):n.author.slice(0,1).toUpperCase()},I)),d.length>3&&x("span",{className:"feedback-avatar feedback-pin-more","aria-hidden":"true",children:["+",d.length-3]})]},e.id)}),L&&$&&u(ja,{target:L.selector?$.querySelector(L.selector):null,text:io,onText:Ke,onDraftChange:e=>{Xe.current=e},hidden:ye?.type==="create",editing:!!Q,commentId:Q??void 0,renderComposer:p?.renderComposer,changes:P.find(e=>e.id===Q)?.changes,hasExistingAttachments:!!P.find(e=>e.id===Q)?.attachments?.length,onCancel:()=>{ie(null),Ke(""),fe(null)},onPost:(e,d,n,I,G)=>Q?be({type:"edit",id:Q,text:d,changes:e,body:n,attachmentTokens:I}):be({type:"create",body:n,attachmentTokens:I,comment:{id:je.current??(je.current=crypto.randomUUID()),path:b,...L,text:d,author:a.name,authorId:a.id,authorImage:a.image,date:new Date().toISOString(),resolved:!1,replies:[],changes:e}},G),style:{left:pe(L).x+44,top:pe(L).y}},`${L.selector}:${L.x}:${L.y}`)]})]}),x("div",{className:"feedback-toolbar","aria-label":"Preview mode",children:[Ga&&x("button",{title:"Edit styles","aria-keyshortcuts":"E","aria-pressed":D==="edit",onClick:()=>Da("edit"),children:[u(Ne,{}),u("span",{children:"Edit"})]}),x("button",{title:"Add comments","aria-keyshortcuts":"C","aria-pressed":D==="comment",onClick:()=>Da("comment"),children:[u($e,{}),u("span",{children:"Comment"})]}),x("button",{title:"View website","aria-keyshortcuts":"V","aria-pressed":D==="view",onClick:()=>Da("view"),children:[u(na,{}),u("span",{children:"View"})]})]})]}),u("aside",{className:"feedback-sidebar",hidden:D==="edit"||se,children:x("div",{className:"feedback-sidebar-panel",children:[x("div",{className:"feedback-sidebar-title",children:[x("h1",{children:["Comments ",u("span",{children:Ja.length})]}),x("details",{className:"feedback-account",children:[u("summary",{title:`Signed in as ${a.name}`,"aria-label":`Account: ${a.name}`,children:u("span",{className:"feedback-avatar",children:a.image?u("img",{src:a.image,alt:"",width:27,height:27}):a.name.slice(0,1).toUpperCase()})}),x("div",{children:[u("strong",{children:a.name}),u("span",{children:a.email}),x("button",{onClick:async()=>{try{await r(),window.location.reload()}catch{te("Sign out failed. Please try again.")}},children:[u(fa,{}),"Sign out"]})]})]})]}),x("label",{className:"feedback-search",children:[u(ma,{"aria-hidden":"true",size:18}),u("input",{type:"search","aria-label":"Search comments",placeholder:"Search",value:ka,onChange:e=>no(e.target.value)})]}),i&&(i.status!=="connected"||i.participants.length>0||i.unreadThreadIds.length>0)&&x("div",{className:"feedback-collaboration","aria-label":"Review activity",children:[i.status!=="connected"&&u("span",{role:"status",children:i.status==="connecting"||i.status==="initial"?"Connecting\u2026":"Reconnecting\u2026"}),u("div",{className:"feedback-reviewers",children:i.participants.map(e=>u("span",{className:"feedback-avatar",title:`${e.name} \xB7 ${e.path}`,"aria-label":`${e.name} is reviewing ${e.path}`,children:e.image?u("img",{src:e.image,alt:"",width:24,height:24}):e.name.slice(0,1).toUpperCase()},e.id))}),i.unreadThreadIds.length>0&&x("span",{className:"feedback-unread-count",children:[i.unreadThreadIds.length," unread"]})]}),u("div",{className:"feedback-tabs",role:"group","aria-label":"Filter comments",children:["open","resolved","all"].map(e=>u("button",{"aria-pressed":Ye===e,onClick:()=>fo(e),children:e[0].toUpperCase()+e.slice(1)},e))}),it&&u("p",{role:"alert",className:"feedback-error",children:it}),x("div",{className:"feedback-comment-list",children:[wt.map(e=>u("article",{onPointerEnter:d=>{d.pointerType!=="touch"&&kt(e)},onPointerLeave:()=>X.current?.schedule(),className:`feedback-comment ${Y===e.id?"active":""}`,children:x("button",{className:"feedback-comment-main","aria-pressed":Y===e.id,onClick:()=>Ma(e),children:[x("span",{className:"feedback-comment-heading",children:[u("span",{className:"feedback-avatar",children:e.authorImage?u("img",{src:e.authorImage,alt:"",width:28,height:28}):e.author.slice(0,1).toUpperCase()}),x("span",{className:"feedback-comment-identity",children:[x("span",{className:"feedback-comment-meta",children:[u("strong",{children:e.author}),e.pending?u("span",{role:"status",children:"Sending\u2026"}):u("time",{dateTime:e.date,children:new Date(e.date).toLocaleDateString(void 0,{month:"short",day:"numeric"})})]}),x("span",{className:"feedback-comment-status",children:[Ye==="all"&&x(Ca,{children:[e.resolved?"Resolved":"Open",u("span",{"aria-hidden":"true",children:" \xB7 "})]}),u("span",{className:"feedback-comment-path",title:e.path,children:e.path})]})]}),i?.unreadThreadIds.includes(e.id)&&u("span",{className:"feedback-comment-unread-dot","aria-hidden":"true"})]}),u("span",{className:"feedback-comment-body",children:e.text||e.attachments?.map(d=>d.name).join(", ")}),(e.replies.length>0||i?.unreadThreadIds.includes(e.id))&&x("span",{className:"feedback-comment-activity",children:[e.replies.length>0&&x(Ca,{children:[u("span",{className:"feedback-comment-avatars",children:Na(e).slice(1,4).map((d,n)=>u("span",{className:"feedback-avatar",title:d.author,children:d.authorImage?u("img",{src:d.authorImage,alt:"",width:20,height:20}):d.author.slice(0,1).toUpperCase()},n))}),x("span",{className:"feedback-comment-reply-count",children:[e.replies.length," ",e.replies.length===1?"reply":"replies"]})]}),i?.unreadThreadIds.includes(e.id)&&u("span",{className:"feedback-unread-label",children:e.replies.length?"New replies":"Unread"})]})]})},e.id)),ft&&u("p",{role:"status",children:"Loading shared comments\u2026"}),!ft&&!wt.length&&x("div",{className:"feedback-empty",children:[u("span",{children:u($e,{size:30})}),u("h2",{children:ka.trim()?"No matching comments":Ye==="resolved"?"Nothing resolved yet":"No comments yet"}),u("p",{children:ka.trim()?"Try another name, phrase, or page.":Ye==="resolved"?"Resolved threads will appear here.":"Click anywhere on the page to leave your first comment."})]})]}),u(at,{path:b,disabled:Ie||!$,onNavigate:mo,onOpen:po,routes:[...new Set([b,...O,..._,...P.map(e=>e.path)])].filter(e=>$&&We(e,window.location.origin)).sort((e,d)=>e.localeCompare(d))}),f&&l&&x("details",{className:"feedback-review-invite",children:[x("summary",{children:[u(ze,{"aria-hidden":"true"}),"Share review link"]}),x("form",{onSubmit:e=>{e.preventDefault(),It()},children:[u("p",{children:"Anyone with this link can sign in and review this website."}),u("button",{type:"submit",className:"feedback-primary",disabled:ya,children:ya?"Preparing link\u2026":"Copy review link"}),pt&&x(Ca,{children:[u("input",{"aria-label":"Review link",value:pt,readOnly:!0,onFocus:e=>e.currentTarget.select()}),u("button",{type:"button",onClick:()=>{It(!0)},disabled:ya,children:"Replace invitation link"}),u("p",{children:"Replacing the link blocks new joins through the old link. Existing reviewers keep access."})]}),ht&&u("p",{role:"status",children:ht})]})]})]})})]})]})}import{useEffect as lo,useSyncExternalStore as dr}from"react";import{Chisel as lr}from"use-chisel";import{jsx as fr}from"react/jsx-runtime";function ur(a){return window.addEventListener("chisel:mode",a),()=>window.removeEventListener("chisel:mode",a)}function sr(){try{return window.self!==window.top&&window.parent.location.origin===window.location.origin&&window.parent.location.pathname==="/chisel"?document.documentElement.dataset.chiselMode??"view":"site"}catch{return"site"}}function ir({projectName:a="Chisel"}){let t=dr(ur,sr,()=>"site");return lo(()=>{process.env.NEXT_PUBLIC_CHISEL_ENABLED!=="0"&&(window.chiselReady=!0,document.dispatchEvent(new Event("chisel:ready")))},[]),lo(()=>{if(t!=="edit")return;let r=window.setTimeout(()=>window.dispatchEvent(new Event("chisel:select")),50);return()=>window.clearTimeout(r)},[t]),t==="site"||process.env.NODE_ENV==="production"||process.env.NEXT_PUBLIC_CHISEL_ENABLED==="0"?null:fr(lr,{embedded:!0,enabled:t==="edit",projectName:a})}export{ir as ChiselPreview,ro as ChiselWorkspace,rt as ChiselWorkspaceStyles};
|
|
362
23
|
/*! Bundled license information:
|
|
363
24
|
|
|
364
25
|
lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs:
|