@popmelt.com/core 0.32.0 → 0.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +1 -1
  2. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  3. package/codex-plugin/.codex-plugin/plugin.json +1 -1
  4. package/dist/{ParticipantRuntime-5K4XILTY.mjs → ParticipantRuntime-M762IJI2.mjs} +1 -1
  5. package/dist/{PopmeltTasteConnectedPane-7YIHIFPE.mjs → PopmeltTasteConnectedPane-ZW47K7VZ.mjs} +1 -1
  6. package/dist/{ThreadErrorCard-WZ2UBVWE.mjs → ThreadErrorCard-OMXKVZY4.mjs} +1 -1
  7. package/dist/bridge-entry.mjs +1 -2
  8. package/dist/{browser-runtime-UVEA7O7K.mjs → browser-runtime-VHGXBZA5.mjs} +1 -1
  9. package/dist/browser.mjs +1 -1
  10. package/dist/{chunk-EUWNUQGJ.mjs → chunk-3GHVZGWO.mjs} +3 -3
  11. package/dist/chunk-45JUZT7H.mjs +2 -0
  12. package/dist/{chunk-VMQD7UGC.mjs → chunk-5HNQZ6TH.mjs} +1 -1
  13. package/dist/chunk-ABX3VAYF.mjs +317 -0
  14. package/dist/{chunk-GNZ73T3H.mjs → chunk-B2MFT2SV.mjs} +1 -1
  15. package/dist/{chunk-IPR652AZ.mjs → chunk-K63SG2J5.mjs} +1 -1
  16. package/dist/{chunk-67CZ5WTY.mjs → chunk-KAKYUYLC.mjs} +87 -86
  17. package/dist/{chunk-D32YV5O6.mjs → chunk-MZNY6VXR.mjs} +1 -1
  18. package/dist/chunk-WL62X74S.mjs +342 -0
  19. package/dist/{chunk-UGGB6HDI.mjs → chunk-YHSHUWWI.mjs} +1 -1
  20. package/dist/cli.mjs +29 -29
  21. package/dist/codex-note-context-NGOK23TK.mjs +2 -0
  22. package/dist/{codex-project-MKH6TO5W.mjs → codex-project-EMYHOQCC.mjs} +1 -1
  23. package/dist/index.mjs +1 -1
  24. package/dist/{peer-client-FJGBXESA.mjs → peer-client-6FUDDS46.mjs} +1 -1
  25. package/dist/plugin-astro.mjs +1 -1
  26. package/dist/plugin-nuxt.mjs +1 -1
  27. package/dist/plugin-vite.mjs +1 -1
  28. package/dist/server.mjs +5 -5
  29. package/package.json +1 -1
  30. package/dist/chunk-AEOT7B5I.mjs +0 -2
  31. package/dist/chunk-GTQSZVCQ.mjs +0 -334
  32. package/dist/chunk-KHQZYGU3.mjs +0 -317
  33. package/dist/codex-note-context-VSQVT5ZL.mjs +0 -2
  34. /package/dist/{chunk-V44RIEET.mjs → chunk-2RRYBN2J.mjs} +0 -0
  35. /package/dist/{chunk-4JG6IVUU.mjs → chunk-VAPWW76T.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import{c as He,b as En}from"./chunk-4LHTPRFY.mjs";import{a as Cn}from"./chunk-F6AMPRUB.mjs";import{j as St,a as Q,f as An,i as We,g as Rn,h as It}from"./chunk-EXDOFFFJ.mjs";import{b as je,g as Ye,e as qe}from"./chunk-V44RIEET.mjs";import{a as Nn,b as Ln}from"./chunk-LVEMYZOA.mjs";import{a as Mt,d as Ee,v as On,h as Dn,i as Tt,c as Ce,f as Ae,b as kt,e as $n,g as _n}from"./chunk-RCVAPQ7X.mjs";import{Clock as Et,OctagonAlert as Fn,MessageCircleQuestionMark as Pn,TriangleAlert as zn,Reply as Bn,Eye as Hn,SendHorizontal as Re,CornerDownLeft as Wn}from"lucide-react";import{createContext as Ke,useContext as de,useState as re,useEffect as V,useLayoutEffect as Ct,useId as jn,useRef as le,useMemo as Yn,useCallback as qn,useReducer as Kn,useSyncExternalStore as Un}from"react";import{jsxs as R,jsx as x,Fragment as W}from"react/jsx-runtime";var Ne=new Set,Le;function Ue(e){if(Ne.add(e),!Le){let t=new Map,n=new Map,i="",o=!0,r=!0,a=!1,l=!0,d=0,s=()=>{let h=new Set,u=new Map,f=y=>{if(h.add(y),!t.has(y)){let m=new MutationObserver(k=>{let w=k.filter(v=>!(v.target.nodeType===1?v.target:v.target.parentElement)?.closest("[data-devtools]"));w.length&&(o=!0),w.some(v=>v.type==="childList")&&(r=!0)});m.observe(y,{subtree:!0,childList:!0,characterData:!0,attributes:!0});let g=()=>{o=!0};y.addEventListener("scroll",g,!0),y.addEventListener("load",g,!0),t.set(y,()=>{m.disconnect(),y.removeEventListener("scroll",g,!0),y.removeEventListener("load",g,!0)})}for(let m of y.querySelectorAll("*")){if(m.shadowRoot&&!m.closest("[data-devtools]")&&f(m.shadowRoot),m.localName!=="iframe"||m.closest("[data-devtools],[data-popmelt-peer-surface]"))continue;let g=kt(m);u.set(m,g),g&&f(g)}};f(document);for(let[y,m]of t)h.has(y)||(m(),t.delete(y));n=u,r=!1,o=!0},c=()=>{if(!l)return;(r||[...n].some(([f,y])=>kt(f)!==y))&&s();let h=[];for(let[f,y]of n){let m=f.getBoundingClientRect();h.push(y?.URL,m.x,m.y,m.width,m.height,y?.defaultView?.scrollX,y?.defaultView?.scrollY)}let u=JSON.stringify(h);if((o||u!==i)&&(o=!1,i=u,a))for(let f of Ne)f();a=!0,l&&(d=requestAnimationFrame(c))};c(),Le=()=>{l=!1,cancelAnimationFrame(d);for(let h of t.values())h()}}return()=>{Ne.delete(e),Ne.size||(Le?.(),Le=void 0)}}var xe=Ke(!0);function Xe(e,t){let n=e.match(/^oklch\(([^)]+)\)$/i);if(n)return`oklch(${n[1]} / ${t})`;let i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(i){let o=parseInt(i[1],16),r=parseInt(i[2],16),a=parseInt(i[3],16);return`rgba(${o}, ${r}, ${a}, ${t})`}return`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`}function At(e,t){let n=Rn(e),i=t.toLowerCase(),o=-1;for(let r=n.length-1;r>=0;r--){let a=n[r].name;if(a===t){let l=It(n[r].fiber)??e;return{name:t,path:n.map(d=>d.name),depthIndex:r,rootElement:l}}if(o===-1){let l=a.toLowerCase();(l.length>=4&&i.includes(l)||i.length>=4&&l.includes(i))&&(o=r)}}if(o>=0){let r=It(n[o].fiber)??e;return{name:t,path:n.map(a=>a.name),depthIndex:o,rootElement:r}}return null}function Xn(e){let t=Oe(),n=[],i=new Set,o=t.currentNode;for(;o=t.nextNode();){let r=At(o,e);r&&!i.has(r.rootElement)&&(i.add(r.rootElement),n.push(r))}return n}function Qn(e){let t=new Map;if(e.size===0)return t;let n=new Set(e),i=Oe(),o=new Set,r=i.currentNode;for(;(r=i.nextNode())&&n.size>0;)for(let a of n){let l=At(r,a);if(!l||o.has(l.rootElement))continue;o.add(l.rootElement);let d=l.rootElement.getBoundingClientRect();t.set(a,d.top+window.scrollY),n.delete(a);break}for(let a of n)t.set(a,1/0);return t}function Oe(){return document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return e.closest("#devtools-toolbar, #devtools-canvas, #devtools-scrim, [data-popmelt-panel]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}})}function q(e,t){return e.style.getPropertyValue(t)!==""}function Vn(e,t=30){if(e<=0)return[];let n=[],i=Oe(),o=.5,r=i.currentNode;for(;(r=i.nextNode())&&n.length<t;){let a=r,l=a.getBoundingClientRect();if(l.bottom<-50||l.top>window.innerHeight+50||l.right<-50||l.left>window.innerWidth+50||l.width<1||l.height<1)continue;let d=getComputedStyle(a);!q(a,"padding-top")&&Math.abs((parseFloat(d.paddingTop)||0)-e)<o&&n.push({element:a,property:"padding-top"}),!q(a,"padding-bottom")&&Math.abs((parseFloat(d.paddingBottom)||0)-e)<o&&n.length<t&&n.push({element:a,property:"padding-bottom"}),!q(a,"padding-left")&&Math.abs((parseFloat(d.paddingLeft)||0)-e)<o&&n.length<t&&n.push({element:a,property:"padding-left"}),!q(a,"padding-right")&&Math.abs((parseFloat(d.paddingRight)||0)-e)<o&&n.length<t&&n.push({element:a,property:"padding-right"}),!q(a,"margin-top")&&Math.abs((parseFloat(d.marginTop)||0)-e)<o&&n.length<t&&n.push({element:a,property:"margin-top"}),!q(a,"margin-bottom")&&Math.abs((parseFloat(d.marginBottom)||0)-e)<o&&n.length<t&&n.push({element:a,property:"margin-bottom"}),!q(a,"margin-left")&&Math.abs((parseFloat(d.marginLeft)||0)-e)<o&&n.length<t&&n.push({element:a,property:"margin-left"}),!q(a,"margin-right")&&Math.abs((parseFloat(d.marginRight)||0)-e)<o&&n.length<t&&n.push({element:a,property:"margin-right"});let s=d.display;if((s.includes("flex")||s.includes("grid"))&&n.length<t){let c=q(a,"gap"),h=parseFloat(d.gap)||0,u=parseFloat(d.rowGap)||0,f=parseFloat(d.columnGap)||0;!c&&Math.abs(h-e)<o?n.push({element:a,property:"gap"}):!q(a,"row-gap")&&Math.abs(u-e)<o?n.push({element:a,property:"row-gap"}):!q(a,"column-gap")&&Math.abs(f-e)<o&&n.push({element:a,property:"column-gap"})}}return n}function Gn(e){return typeof e=="string"?{value:e}:e}var Rt={gap:["gap","row-gap","column-gap"],padding:["padding-top","padding-bottom","padding-left","padding-right"],margin:["margin-top","margin-bottom","margin-left","margin-right"]};function Nt(e,t){let n=Rt[t];return n?n.includes(e):!1}function Jn(e,t){let n=e.split(/\s+/);for(let i of n){if(i===t)return!0;let o=i.lastIndexOf(":");if(o>=0&&i.slice(o+1)===t)return!0}return!1}function Zn(e){let t=e.lastIndexOf(":"),n=t>=0?e.slice(t+1):e,i=n.indexOf("-");if(i<0)return null;let o=n.slice(0,i),r={gap:"gap","gap-x":"column-gap","gap-y":"row-gap",p:"padding",pt:"padding-top",pb:"padding-bottom",pl:"padding-left",pr:"padding-right",px:"padding-left",py:"padding-top",m:"margin",mt:"margin-top",mb:"margin-bottom",ml:"margin-left",mr:"margin-right",mx:"margin-left",my:"margin-top"},a=n.slice(0,n.indexOf("-",i+1)>0?n.indexOf("-",i+1):i);return r[a]??r[o]??null}function eo(e,t=30){let n=parseFloat(e.value);if(isNaN(n)||n<=0)return[];if(e.bindings&&e.bindings.length>0){let o=[],r=Oe(),a=r.currentNode;for(;(a=r.nextNode())&&o.length<t;){let l=a,d=l.getBoundingClientRect();if(d.bottom<-50||d.top>window.innerHeight+50||d.right<-50||d.left>window.innerWidth+50||d.width<1||d.height<1)continue;let s=l.className;if(typeof s=="string")for(let c of e.bindings){if(!Jn(s,c))continue;let h=Zn(c);if(h&&!(e.property&&!Nt(h,e.property))){o.push({element:l,property:h});break}}}return o}let i=Vn(n,t*2);return e.property?i.filter(o=>Nt(o.property,e.property)).slice(0,t):i.slice(0,t)}function to(e,t){let n=new Set,i=we(t);for(let o of e){let r=Lt[o.property];if(!r)continue;let a=o.element.className;if(typeof a=="string")for(let l of r){let d=`${l}-${i}`;for(let s of a.split(/\s+/)){let c=s.lastIndexOf(":"),h=c>=0?s.slice(c+1):s;if(h===d){n.add(h);break}}}}return[...n]}function no(e){let t=new Set;for(let n of e)for(let[i,o]of Object.entries(Rt))if(o.includes(n.property)){t.add(i);break}if(t.size===1)return[...t][0]}function oo(e,t,n){if(t===n)return e;let i=we(t),o=we(n);return e.map(r=>{let a=r.lastIndexOf("-");if(a<0)return r;let l=r.slice(0,a),d=r.slice(a+1);return d===i||d===`[${t}px]`?`${l}-${o}`:r})}var io={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",12:"3",16:"4",20:"5",24:"6",28:"7",32:"8",40:"10",48:"12",64:"16",80:"20",96:"24"};function we(e){return io[e]??`[${e}px]`}var Lt={"padding-top":["pt","py","p"],"padding-bottom":["pb","py","p"],"padding-left":["pl","px","p"],"padding-right":["pr","px","p"],"margin-top":["mt","my","m"],"margin-bottom":["mb","my","m"],"margin-left":["ml","mx","m"],"margin-right":["mr","mx","m"],gap:["gap"],"row-gap":["gap-y","gap"],"column-gap":["gap-x","gap"]};function ao(e,t,n,i){let o=Lt[t];if(!o)return null;let r=we(n);for(let a of o){let l=new RegExp("(?:^|\\s)((?:[\\w-]+:)*"+a+"-(?:"+ro(r)+"|\\["+n+"px\\]))(?:\\s|$)"),d=e.match(l);if(d?.[1]){let s=we(i),c=d[1].lastIndexOf(":"),h=c>=0?d[1].slice(0,c+1):"";return{matched:d[1],suggested:`${h}${a}-${s}`}}}return null}function ro(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lo(e,t,n){let i=new Set,o=[];for(let r of e){let a=Q(r.element),l=`${a}::${r.property}`;if(i.has(l))continue;i.add(l);let d=An(r.element),s=r.element.className||"",c=ao(s,r.property,t,n);o.push({selector:a,reactComponent:d?.name,className:s,property:r.property,matchedClass:c?.matched,suggestedClass:c?.suggested})}return o}function so(e){let t=window.getComputedStyle(e).display;return t==="flex"||t==="inline-flex"||t==="grid"||t==="inline-grid"}function po(e){let t=window.getComputedStyle(e);return{row:parseFloat(t.rowGap)||0,column:parseFloat(t.columnGap)||0}}function co(e){let t=[];for(let n of e){let i=t.find(o=>o.axis!==n.axis?!1:n.axis==="row"?Math.abs(o.y-n.y)<2&&Math.abs(o.h-n.h)<2:Math.abs(o.x-n.x)<2&&Math.abs(o.w-n.w)<2);if(i)if(n.axis==="row"){let o=Math.min(i.x,n.x),r=Math.max(i.x+i.w,n.x+n.w);i.x=o,i.w=r-o}else{let o=Math.min(i.y,n.y),r=Math.max(i.y+i.h,n.y+n.h);i.y=o,i.h=r-o}else t.push({...n})}return t}function uo(e){let t=Array.from(e.children).filter(l=>{if(!(l instanceof HTMLElement))return!1;let d=window.getComputedStyle(l);return d.display!=="none"&&d.position!=="absolute"&&d.position!=="fixed"});if(t.length<2)return[];let n=[],i=e.getBoundingClientRect(),o=window.getComputedStyle(e).flexDirection,r=o==="column"||o==="column-reverse",a=6;for(let l=0;l<t.length-1;l++){let d=t[l].getBoundingClientRect(),s=t[l+1].getBoundingClientRect();if(s.left>d.right+.5&&n.push({axis:"column",x:d.right,y:i.top,w:s.left-d.right,h:i.height}),s.top>d.bottom+.5&&n.push({axis:"row",x:i.left,y:d.bottom,w:i.width,h:s.top-d.bottom}),!(s.left>d.right+.5)&&!(s.top>d.bottom+.5))if(r){let c=(d.bottom+s.top)/2;n.push({axis:"row",x:i.left,y:c-a/2,w:i.width,h:a})}else{let c=(d.right+s.left)/2;n.push({axis:"column",x:c-a/2,y:i.top,w:a,h:i.height})}}return co(n)}function fo(e,t){let n=window.getComputedStyle(e),i=n.display;if(i!=="flex"&&i!=="inline-flex")return!1;let o=n.justifyContent;if(o!=="space-between"&&o!=="space-around"&&o!=="space-evenly"&&o!=="stretch")return!1;let r=n.flexDirection;return!(t!==(r==="column"||r==="column-reverse"?"row":"column")||parseFloat(t==="row"?n.rowGap:n.columnGap)>0)}function ho(e){let t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function go(e){let t=window.getComputedStyle(e);return{top:parseFloat(t.marginTop)||0,right:parseFloat(t.marginRight)||0,bottom:parseFloat(t.marginBottom)||0,left:parseFloat(t.marginLeft)||0}}function Ot(e){let t=window.getComputedStyle(e);return{topLeft:t.borderTopLeftRadius,topRight:t.borderTopRightRadius,bottomRight:t.borderBottomRightRadius,bottomLeft:t.borderBottomLeftRadius}}function Dt(e){let t=window.getComputedStyle(e);return{"top-left":parseFloat(t.borderTopLeftRadius)||0,"top-right":parseFloat(t.borderTopRightRadius)||0,"bottom-right":parseFloat(t.borderBottomRightRadius)||0,"bottom-left":parseFloat(t.borderBottomLeftRadius)||0}}function mo(e){for(let t of e.childNodes)if(t.nodeType===Node.TEXT_NODE&&(t.textContent||"").trim().length>0)return!0;return!1}function yo(e){let t=document.createRange(),n=!1;for(let c of e.childNodes)c.nodeType===Node.TEXT_NODE&&(c.textContent||"").trim().length>0&&(n||(t.setStart(c,0),n=!0),t.setEnd(c,c.textContent?.length??0));if(!n)return null;let i=t.getBoundingClientRect(),o=window.getComputedStyle(e),r=parseFloat(o.fontSize)||16,a=parseFloat(o.lineHeight);isNaN(a)&&(a=r*1.2);let l=Math.max(1,t.getClientRects().length),d=Math.max(i.height,l*a),s=(d-i.height)/2;return new DOMRect(i.x,i.y-s,i.width,d)}function xo(e){let t=window.getComputedStyle(e),n=parseFloat(t.fontSize)||16,i=parseFloat(t.lineHeight);return isNaN(i)&&(i=n*1.2),{fontSize:n,lineHeight:i}}function wo(e){let t=e.startsWith("top-");return{top:t?4:12,right:4,bottom:t?12:4,left:4}}function vo({hasCommentEntry:e,stagedChangeCount:t}){return e&&t===0?2:6}function bo({annotationNumber:e,stickerCount:t,interactionEpisodeStepCount:n,hasStatus:i,hasSend:o,controlGap:r}){let a=16+Math.max(1,e===void 0?0:String(e).length)*7.2,l=t*28-Math.max(0,t-1)*2,d=n>0?32+String(n).length*7.2:0,s=28,c=t>0?l+(d>0?d-2:0)+(o?s-2:0):0,h=[t>0?c:0,t===0?d:0,t===0&&o?s:0,i?s:0].filter(u=>u>0);return a+h.reduce((u,f)=>u+f,0)+h.length*r}function So(e,t,n){let i=e.horizontalAlignment==="right"?e.left-t:e.left;return{left:i,top:e.top,right:i+t,bottom:e.top+n}}function Io(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Mo(e,t,n){let i=Math.max(0,e.left+t-n);return Math.max(0,t-e.right)<i?"right":"left"}function $t(e,t,n,i,o=0,r=Number.POSITIVE_INFINITY){if(e.height>=i)return{anchor:"top-left",horizontalAlignment:"left",left:e.left+8,top:e.top+8};let a=Mo(e,o,r);return e.top>=t+n?{anchor:a==="right"?"top-right":"top-left",horizontalAlignment:a,left:a==="right"?e.right:e.left,top:e.top-t-n}:{anchor:a==="right"?"bottom-right":"bottom-left",horizontalAlignment:a,left:a==="right"?e.right:e.left,top:e.bottom+n}}function Qe(e){return e.left+e.width}function De(e){return e.top+e.height}function Ve(e,t){if(e.length===0)return t;let n=Math.min(...e.map(a=>a.left)),i=Math.min(...e.map(a=>a.top)),o=Math.max(...e.map(Qe)),r=Math.max(...e.map(De));return{left:n,top:i,width:o-n,height:r-i}}function Ge(e){let t=[...e].sort((i,o)=>i.top-o.top||i.left-o.left),n=[];for(let i of t){let o=i.top+i.height/2,r=n.find(c=>{let h=c.top+c.height/2;return Math.abs(o-h)<=Math.max(c.height,i.height)*.4});if(!r){n.push({...i});continue}let a=Math.min(r.left,i.left),l=Math.min(r.top,i.top),d=Math.max(Qe(r),Qe(i)),s=Math.max(De(r),De(i));r.left=a,r.top=l,r.width=d-a,r.height=s-l}return n.sort((i,o)=>i.top-o.top||i.left-o.left)}function To({display:e,fragmentRects:t,elementRect:n,parentContentRect:i}){let o=Ge(t),r=Ve(o,n);if(!(e==="inline"&&o.length>1&&i&&i.width>0))return{textRect:r,boundaryRect:n,boundaryRects:[n],firstLineIndent:0};let a=o[0],l={left:i.left,top:a.top,width:i.width,height:Math.max(r.height,De(r)-a.top)},d=Math.max(0,Math.min(l.width,a.left-l.left));return{textRect:r,boundaryRect:Ve(o,n),boundaryRects:o,flowRect:l,firstLineIndent:d}}var Je=new WeakMap;function ko(e){let t={listeners:new Set,rafId:null,schedule:()=>{t.rafId===null&&(t.rafId=e.requestAnimationFrame(()=>{t.rafId=null;for(let n of t.listeners)n()}))}};return Je.set(e,t),e.addEventListener("scroll",t.schedule,{passive:!0,capture:!0}),e.addEventListener("resize",t.schedule),t}function _t(e,t=window){let n=Je.get(t)??ko(t);return n.listeners.add(e),()=>{n.listeners.delete(e)&&(n.listeners.size>0||(t.removeEventListener("scroll",n.schedule,!0),t.removeEventListener("resize",n.schedule),n.rafId!==null&&t.cancelAnimationFrame(n.rafId),Je.delete(t)))}}var se={topLeft:"0px",topRight:"0px",bottomRight:"0px",bottomLeft:"0px"};function Ft(e,t){return e.radii.topLeft!==t.radii.topLeft||e.radii.topRight!==t.radii.topRight||e.radii.bottomRight!==t.radii.bottomRight||e.radii.bottomLeft!==t.radii.bottomLeft||e.outline!==t.outline||e.fragments.length!==t.fragments.length?!1:e.fragments.every((n,i)=>{let o=t.fragments[i];return!!o&&n.left===o.left&&n.top===o.top&&n.width===o.width&&n.height===o.height})}function Pt(e){if(!e.isConnected||!Dn(e.ownerDocument))return{fragments:[],radii:se};let t=Tt(Ee(e),e.ownerDocument);if(Mt(e.ownerDocument)&&(!t.width||!t.height))return{fragments:[],radii:se};if(e.getAttribute("data-popmelt-subject-projection")==="true")return{fragments:[{left:t.left,top:t.top,width:t.width,height:t.height}],radii:se,outline:e.getAttribute("data-popmelt-subject-outline")??void 0};let n=Array.from(e.getClientRects()).map(i=>Tt(Ce(i,e.ownerDocument),e.ownerDocument)).filter(i=>i.width>0&&i.height>0).map(i=>({left:i.left,top:i.top,width:i.width,height:i.height}));return{fragments:Ge(n.length>0?n:[{left:t.left,top:t.top,width:t.width,height:t.height}]),radii:Ot(e)}}function zt({element:e,projectedRect:t,isSelected:n=!1,elementInfo:i,color:o="#3b82f6",annotationNumber:r,changeCount:a,hideTooltip:l=!1,hideOutline:d=!1,hideFill:s=!1,fillOpacity:c=.05,subjectRegistry:h,railGap:u=2,railHeight:f=22,railWidth:y=0,renderRail:m,refreshKey:g,outlineZIndex:k=9996,onActivate:w,onRemove:v}){let I=de(xe),[b,C]=re({fragments:[],radii:se});V(()=>{if(!I)return;if(!e){C({fragments:[],radii:se});return}let P=null,H=()=>{let ee=Pt(e);C(Te=>Ft(Te,ee)?Te:ee)},E=()=>{P===null&&(P=requestAnimationFrame(()=>{P=null,H()}))};H();let fe=e.getAttribute("data-popmelt-subject-projection")==="true"&&!!h,he=fe?h.subscribeFrame(H):void 0,ge=fe||typeof ResizeObserver>"u"?null:new ResizeObserver(E);ge?.observe(e);let B=fe?null:new MutationObserver(E);B?.observe(e,{attributes:!0,attributeFilter:["style","class"]});let ae=_t(H,e.ownerDocument.defaultView??window),me=Mt(e.ownerDocument)?Ue(H):void 0;return()=>{ae(),me?.(),he?.(),ge?.disconnect(),B?.disconnect(),P!==null&&cancelAnimationFrame(P)}},[I,e,h]),Ct(()=>{if(!I||!e||g===void 0)return;let P=Pt(e);C(H=>Ft(H,P)?H:P)},[I,e,g]);let{fragments:N,radii:z}=t?{fragments:[t],radii:se}:b;if(N.length===0||!e&&!t)return null;let A=Ve(N,N[0]),T=e?.tagName.toLowerCase()??"",X=e?.id?`#${e.id}`:"",oe=e&&e.classList.length>0?"."+Array.from(e.classList).slice(0,2).join("."):"",ie=i?.reactComponent,Se=e?.getAttribute("data-popmelt-subject-adapter"),Ie=e?.getAttribute("data-popmelt-subject-label"),Pe=Se&&Ie?`<${Ie}>`:ie?`<${ie}> ${T}${X}${oe}`:`${T}${X}${oe}`,Z=$t({left:A.left,right:A.left+A.width,top:A.top,bottom:A.top+A.height,height:A.height},f,u,window.innerHeight,y,window.innerWidth),Me={zIndex:9997,display:"flex",alignItems:"center",gap:6,backgroundColor:o,color:"#fff",fontSize:12,fontFamily:je,lineHeight:"14px",padding:"4px 8px",borderRadius:8,pointerEvents:"none",whiteSpace:"nowrap",maxWidth:400,position:"fixed",top:Z.top,left:Z.left},ze=!l&&R("div",{ref:P=>{e&&Nn(e,P)},"data-devtools":"tooltip",style:Me,children:[r!==void 0&&R("span",{children:[r,"."]}),x("span",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:1,minWidth:0},children:Pe}),a!==void 0&&a>0&&R("span",{style:{opacity:.8},children:["(",a," ",a===1?"change":"changes",")"]})]});return R(W,{children:[!d&&N.map((P,H)=>x("div",{"data-devtools":"highlight",onContextMenu:v?E=>{E.preventDefault(),E.stopPropagation(),v()}:void 0,role:w?"button":void 0,tabIndex:w?0:void 0,"aria-label":w?"Open annotation thread":void 0,onPointerDown:w?E=>{E.preventDefault(),E.stopPropagation()}:void 0,onClick:w?E=>{E.preventDefault(),E.stopPropagation(),w()}:void 0,onKeyDown:w?E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),E.stopPropagation(),w())}:void 0,style:{position:"fixed",top:P.top,left:P.left,width:P.width,height:P.height,pointerEvents:w||v?"auto":"none",cursor:w?"pointer":void 0,zIndex:k,overflow:"visible"},children:x("div",{style:b.outline?{position:"absolute",inset:0,pointerEvents:"none"}:{position:"absolute",inset:0,boxSizing:"border-box",backgroundColor:s?"transparent":Xe(o,c),borderColor:o,borderStyle:n?"solid":"dashed",borderWidth:1,borderTopLeftRadius:z.topLeft,borderTopRightRadius:z.topRight,borderBottomRightRadius:z.bottomRight,borderBottomLeftRadius:z.bottomLeft,pointerEvents:"none"},children:b.outline?x("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%",style:{display:"block",overflow:"visible"},"aria-hidden":"true",children:x("polygon",{points:b.outline,fill:s?"transparent":Xe(o,c),stroke:o,strokeWidth:1,strokeDasharray:n?void 0:"4 3",vectorEffect:"non-scaling-stroke"})}):null})},`${P.left}:${P.top}:${H}`)),m?m(Z,A):ze]})}function Bt(e){return e==="bottom-left"?[2,8,8,8]:e==="bottom-right"?[8,2,8,8]:e==="top-right"?[8,8,2,8]:[8,8,8,2]}function Eo(e){return Bt(e).map(t=>`${t}px`).join(" ")}var ve=1.1666666666666667,Ht=2048;function Ze(e){return e.length>Ht?`${e.slice(0,Ht)}\u2026`:e}function Co(e,t,n){let i=Ze(t);if(!i||e.measureText(i).width<=n)return[i];let o=i.split(/\s+/),r=[],a="";for(let l of o){let d=a?`${a} ${l}`:l;a&&e.measureText(d).width>n?(r.push(a),a=l):a=d}return a&&r.push(a),r.length>0?r:[i]}function Ao(e,t,n){return t.flatMap(i=>Co(e,i,n))}var ne=je,et=400,Wt=16,tt=60,Ro=12,nt=16;function jt(e){let t=window.innerWidth-e-Wt;return Math.max(tt,Math.min(et,t))}function ot(e,t,n){let i=Ze(t);if(i===t&&e.measureText(i).width<=n)return i;let o="\u2026",r=0,a=i.endsWith(o)?i.length-1:i.length;for(;r<a;){let l=Math.ceil((r+a)/2);e.measureText(i.slice(0,l)+o).width<=n?r=l:a=l-1}return r>0?i.slice(0,r)+o:o}function No(e,t,n){if(e===void 0||t===void 0||n.avoidLeft===void 0&&n.avoidRight===void 0)return!0;let i=typeof window<"u"?window.innerWidth:9999,o=n.avoidLeft??0,r=n.avoidRight??i;return e+t>o&&e<r}function Yt(e,t,n,i,o){let r=typeof window<"u"?window.innerHeight:9999,a=0,l=r;n&&No(i,o,n)&&(a=n.avoidTop??a,l=n.avoidBottom??l);let d=Math.max(a,l-t);return Math.max(a,Math.min(e,d))}function qt(e,t=12,n,i){let o=t*ve+8,r=e.y-4,a=e.x-8,l=Yt(r,o,n,a,i);return l===r?e:{...e,y:l+4}}function Lo(e,t,n,i,o=12,r,a,l,d="#dddddd",s,c=!1){if(!n)return;let h=o*ve,u=n.replace(/\n/g," "),f=r!==void 0?r+". "+u:u;e.font=`${o}px ${ne}`,e.textBaseline="middle";let y=a!==void 0?Math.min(et,Math.max(tt,window.innerWidth-a-Wt)):et,m=c?nt:0,g=ot(e,f,Math.max(tt,y-m)),k=e.measureText(g).width,w=m+k,v=qt(t,o,l,w+16);e.fillStyle=i;let I=v.x-8,b=v.y-4,C=w+16,N=h+8;e.beginPath(),e.roundRect(I,b,C,N,Bt(s)),e.fill();let z=v.y+h/2;if(c){let A=v.x,T=z-Ro/2;e.strokeStyle=d,e.lineWidth=1.5,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(A+7.5,T+4),e.lineTo(A+10.5,T+6.5),e.lineTo(A+7.5,T+9),e.moveTo(A+1.5,T+1.5),e.lineTo(A+1.5,T+4.5),e.quadraticCurveTo(A+1.5,T+6.5,A+3.5,T+6.5),e.lineTo(A+10.5,T+6.5),e.stroke()}e.fillStyle=d,e.fillText(g,v.x+m,z)}function Oo(e,t,n){let i=e.filter(o=>!o.captured&&o.selector===t&&(!o.pathname||o.pathname===n));return i.length?{type:"MODIFY_TEXT_CONTENTS",payload:i.map(o=>({...o,modified:o.original}))}:null}function Kt(e,t){return e.type!=="text"?!1:(e.groupId?t.filter(n=>n.groupId===e.groupId):[e]).every(n=>(n.status??"pending")==="pending"&&!n.threadId)}var Ut=Ke(0),it=`
2
+ import{c as He,b as En}from"./chunk-4LHTPRFY.mjs";import{a as Cn}from"./chunk-F6AMPRUB.mjs";import{j as St,a as Q,f as An,i as We,g as Rn,h as It}from"./chunk-EXDOFFFJ.mjs";import{b as je,g as Ye,e as qe}from"./chunk-2RRYBN2J.mjs";import{a as Nn,b as Ln}from"./chunk-LVEMYZOA.mjs";import{a as Mt,d as Ee,v as On,h as Dn,i as Tt,c as Ce,f as Ae,b as kt,e as $n,g as _n}from"./chunk-RCVAPQ7X.mjs";import{Clock as Et,OctagonAlert as Fn,MessageCircleQuestionMark as Pn,TriangleAlert as zn,Reply as Bn,Eye as Hn,SendHorizontal as Re,CornerDownLeft as Wn}from"lucide-react";import{createContext as Ke,useContext as de,useState as re,useEffect as V,useLayoutEffect as Ct,useId as jn,useRef as le,useMemo as Yn,useCallback as qn,useReducer as Kn,useSyncExternalStore as Un}from"react";import{jsxs as R,jsx as x,Fragment as W}from"react/jsx-runtime";var Ne=new Set,Le;function Ue(e){if(Ne.add(e),!Le){let t=new Map,n=new Map,i="",o=!0,r=!0,a=!1,l=!0,d=0,s=()=>{let h=new Set,u=new Map,f=y=>{if(h.add(y),!t.has(y)){let m=new MutationObserver(k=>{let w=k.filter(v=>!(v.target.nodeType===1?v.target:v.target.parentElement)?.closest("[data-devtools]"));w.length&&(o=!0),w.some(v=>v.type==="childList")&&(r=!0)});m.observe(y,{subtree:!0,childList:!0,characterData:!0,attributes:!0});let g=()=>{o=!0};y.addEventListener("scroll",g,!0),y.addEventListener("load",g,!0),t.set(y,()=>{m.disconnect(),y.removeEventListener("scroll",g,!0),y.removeEventListener("load",g,!0)})}for(let m of y.querySelectorAll("*")){if(m.shadowRoot&&!m.closest("[data-devtools]")&&f(m.shadowRoot),m.localName!=="iframe"||m.closest("[data-devtools],[data-popmelt-peer-surface]"))continue;let g=kt(m);u.set(m,g),g&&f(g)}};f(document);for(let[y,m]of t)h.has(y)||(m(),t.delete(y));n=u,r=!1,o=!0},c=()=>{if(!l)return;(r||[...n].some(([f,y])=>kt(f)!==y))&&s();let h=[];for(let[f,y]of n){let m=f.getBoundingClientRect();h.push(y?.URL,m.x,m.y,m.width,m.height,y?.defaultView?.scrollX,y?.defaultView?.scrollY)}let u=JSON.stringify(h);if((o||u!==i)&&(o=!1,i=u,a))for(let f of Ne)f();a=!0,l&&(d=requestAnimationFrame(c))};c(),Le=()=>{l=!1,cancelAnimationFrame(d);for(let h of t.values())h()}}return()=>{Ne.delete(e),Ne.size||(Le?.(),Le=void 0)}}var xe=Ke(!0);function Xe(e,t){let n=e.match(/^oklch\(([^)]+)\)$/i);if(n)return`oklch(${n[1]} / ${t})`;let i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(i){let o=parseInt(i[1],16),r=parseInt(i[2],16),a=parseInt(i[3],16);return`rgba(${o}, ${r}, ${a}, ${t})`}return`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`}function At(e,t){let n=Rn(e),i=t.toLowerCase(),o=-1;for(let r=n.length-1;r>=0;r--){let a=n[r].name;if(a===t){let l=It(n[r].fiber)??e;return{name:t,path:n.map(d=>d.name),depthIndex:r,rootElement:l}}if(o===-1){let l=a.toLowerCase();(l.length>=4&&i.includes(l)||i.length>=4&&l.includes(i))&&(o=r)}}if(o>=0){let r=It(n[o].fiber)??e;return{name:t,path:n.map(a=>a.name),depthIndex:o,rootElement:r}}return null}function Xn(e){let t=Oe(),n=[],i=new Set,o=t.currentNode;for(;o=t.nextNode();){let r=At(o,e);r&&!i.has(r.rootElement)&&(i.add(r.rootElement),n.push(r))}return n}function Qn(e){let t=new Map;if(e.size===0)return t;let n=new Set(e),i=Oe(),o=new Set,r=i.currentNode;for(;(r=i.nextNode())&&n.size>0;)for(let a of n){let l=At(r,a);if(!l||o.has(l.rootElement))continue;o.add(l.rootElement);let d=l.rootElement.getBoundingClientRect();t.set(a,d.top+window.scrollY),n.delete(a);break}for(let a of n)t.set(a,1/0);return t}function Oe(){return document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return e.closest("#devtools-toolbar, #devtools-canvas, #devtools-scrim, [data-popmelt-panel]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}})}function q(e,t){return e.style.getPropertyValue(t)!==""}function Vn(e,t=30){if(e<=0)return[];let n=[],i=Oe(),o=.5,r=i.currentNode;for(;(r=i.nextNode())&&n.length<t;){let a=r,l=a.getBoundingClientRect();if(l.bottom<-50||l.top>window.innerHeight+50||l.right<-50||l.left>window.innerWidth+50||l.width<1||l.height<1)continue;let d=getComputedStyle(a);!q(a,"padding-top")&&Math.abs((parseFloat(d.paddingTop)||0)-e)<o&&n.push({element:a,property:"padding-top"}),!q(a,"padding-bottom")&&Math.abs((parseFloat(d.paddingBottom)||0)-e)<o&&n.length<t&&n.push({element:a,property:"padding-bottom"}),!q(a,"padding-left")&&Math.abs((parseFloat(d.paddingLeft)||0)-e)<o&&n.length<t&&n.push({element:a,property:"padding-left"}),!q(a,"padding-right")&&Math.abs((parseFloat(d.paddingRight)||0)-e)<o&&n.length<t&&n.push({element:a,property:"padding-right"}),!q(a,"margin-top")&&Math.abs((parseFloat(d.marginTop)||0)-e)<o&&n.length<t&&n.push({element:a,property:"margin-top"}),!q(a,"margin-bottom")&&Math.abs((parseFloat(d.marginBottom)||0)-e)<o&&n.length<t&&n.push({element:a,property:"margin-bottom"}),!q(a,"margin-left")&&Math.abs((parseFloat(d.marginLeft)||0)-e)<o&&n.length<t&&n.push({element:a,property:"margin-left"}),!q(a,"margin-right")&&Math.abs((parseFloat(d.marginRight)||0)-e)<o&&n.length<t&&n.push({element:a,property:"margin-right"});let s=d.display;if((s.includes("flex")||s.includes("grid"))&&n.length<t){let c=q(a,"gap"),h=parseFloat(d.gap)||0,u=parseFloat(d.rowGap)||0,f=parseFloat(d.columnGap)||0;!c&&Math.abs(h-e)<o?n.push({element:a,property:"gap"}):!q(a,"row-gap")&&Math.abs(u-e)<o?n.push({element:a,property:"row-gap"}):!q(a,"column-gap")&&Math.abs(f-e)<o&&n.push({element:a,property:"column-gap"})}}return n}function Gn(e){return typeof e=="string"?{value:e}:e}var Rt={gap:["gap","row-gap","column-gap"],padding:["padding-top","padding-bottom","padding-left","padding-right"],margin:["margin-top","margin-bottom","margin-left","margin-right"]};function Nt(e,t){let n=Rt[t];return n?n.includes(e):!1}function Jn(e,t){let n=e.split(/\s+/);for(let i of n){if(i===t)return!0;let o=i.lastIndexOf(":");if(o>=0&&i.slice(o+1)===t)return!0}return!1}function Zn(e){let t=e.lastIndexOf(":"),n=t>=0?e.slice(t+1):e,i=n.indexOf("-");if(i<0)return null;let o=n.slice(0,i),r={gap:"gap","gap-x":"column-gap","gap-y":"row-gap",p:"padding",pt:"padding-top",pb:"padding-bottom",pl:"padding-left",pr:"padding-right",px:"padding-left",py:"padding-top",m:"margin",mt:"margin-top",mb:"margin-bottom",ml:"margin-left",mr:"margin-right",mx:"margin-left",my:"margin-top"},a=n.slice(0,n.indexOf("-",i+1)>0?n.indexOf("-",i+1):i);return r[a]??r[o]??null}function eo(e,t=30){let n=parseFloat(e.value);if(isNaN(n)||n<=0)return[];if(e.bindings&&e.bindings.length>0){let o=[],r=Oe(),a=r.currentNode;for(;(a=r.nextNode())&&o.length<t;){let l=a,d=l.getBoundingClientRect();if(d.bottom<-50||d.top>window.innerHeight+50||d.right<-50||d.left>window.innerWidth+50||d.width<1||d.height<1)continue;let s=l.className;if(typeof s=="string")for(let c of e.bindings){if(!Jn(s,c))continue;let h=Zn(c);if(h&&!(e.property&&!Nt(h,e.property))){o.push({element:l,property:h});break}}}return o}let i=Vn(n,t*2);return e.property?i.filter(o=>Nt(o.property,e.property)).slice(0,t):i.slice(0,t)}function to(e,t){let n=new Set,i=we(t);for(let o of e){let r=Lt[o.property];if(!r)continue;let a=o.element.className;if(typeof a=="string")for(let l of r){let d=`${l}-${i}`;for(let s of a.split(/\s+/)){let c=s.lastIndexOf(":"),h=c>=0?s.slice(c+1):s;if(h===d){n.add(h);break}}}}return[...n]}function no(e){let t=new Set;for(let n of e)for(let[i,o]of Object.entries(Rt))if(o.includes(n.property)){t.add(i);break}if(t.size===1)return[...t][0]}function oo(e,t,n){if(t===n)return e;let i=we(t),o=we(n);return e.map(r=>{let a=r.lastIndexOf("-");if(a<0)return r;let l=r.slice(0,a),d=r.slice(a+1);return d===i||d===`[${t}px]`?`${l}-${o}`:r})}var io={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",12:"3",16:"4",20:"5",24:"6",28:"7",32:"8",40:"10",48:"12",64:"16",80:"20",96:"24"};function we(e){return io[e]??`[${e}px]`}var Lt={"padding-top":["pt","py","p"],"padding-bottom":["pb","py","p"],"padding-left":["pl","px","p"],"padding-right":["pr","px","p"],"margin-top":["mt","my","m"],"margin-bottom":["mb","my","m"],"margin-left":["ml","mx","m"],"margin-right":["mr","mx","m"],gap:["gap"],"row-gap":["gap-y","gap"],"column-gap":["gap-x","gap"]};function ao(e,t,n,i){let o=Lt[t];if(!o)return null;let r=we(n);for(let a of o){let l=new RegExp("(?:^|\\s)((?:[\\w-]+:)*"+a+"-(?:"+ro(r)+"|\\["+n+"px\\]))(?:\\s|$)"),d=e.match(l);if(d?.[1]){let s=we(i),c=d[1].lastIndexOf(":"),h=c>=0?d[1].slice(0,c+1):"";return{matched:d[1],suggested:`${h}${a}-${s}`}}}return null}function ro(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lo(e,t,n){let i=new Set,o=[];for(let r of e){let a=Q(r.element),l=`${a}::${r.property}`;if(i.has(l))continue;i.add(l);let d=An(r.element),s=r.element.className||"",c=ao(s,r.property,t,n);o.push({selector:a,reactComponent:d?.name,className:s,property:r.property,matchedClass:c?.matched,suggestedClass:c?.suggested})}return o}function so(e){let t=window.getComputedStyle(e).display;return t==="flex"||t==="inline-flex"||t==="grid"||t==="inline-grid"}function po(e){let t=window.getComputedStyle(e);return{row:parseFloat(t.rowGap)||0,column:parseFloat(t.columnGap)||0}}function co(e){let t=[];for(let n of e){let i=t.find(o=>o.axis!==n.axis?!1:n.axis==="row"?Math.abs(o.y-n.y)<2&&Math.abs(o.h-n.h)<2:Math.abs(o.x-n.x)<2&&Math.abs(o.w-n.w)<2);if(i)if(n.axis==="row"){let o=Math.min(i.x,n.x),r=Math.max(i.x+i.w,n.x+n.w);i.x=o,i.w=r-o}else{let o=Math.min(i.y,n.y),r=Math.max(i.y+i.h,n.y+n.h);i.y=o,i.h=r-o}else t.push({...n})}return t}function uo(e){let t=Array.from(e.children).filter(l=>{if(!(l instanceof HTMLElement))return!1;let d=window.getComputedStyle(l);return d.display!=="none"&&d.position!=="absolute"&&d.position!=="fixed"});if(t.length<2)return[];let n=[],i=e.getBoundingClientRect(),o=window.getComputedStyle(e).flexDirection,r=o==="column"||o==="column-reverse",a=6;for(let l=0;l<t.length-1;l++){let d=t[l].getBoundingClientRect(),s=t[l+1].getBoundingClientRect();if(s.left>d.right+.5&&n.push({axis:"column",x:d.right,y:i.top,w:s.left-d.right,h:i.height}),s.top>d.bottom+.5&&n.push({axis:"row",x:i.left,y:d.bottom,w:i.width,h:s.top-d.bottom}),!(s.left>d.right+.5)&&!(s.top>d.bottom+.5))if(r){let c=(d.bottom+s.top)/2;n.push({axis:"row",x:i.left,y:c-a/2,w:i.width,h:a})}else{let c=(d.right+s.left)/2;n.push({axis:"column",x:c-a/2,y:i.top,w:a,h:i.height})}}return co(n)}function fo(e,t){let n=window.getComputedStyle(e),i=n.display;if(i!=="flex"&&i!=="inline-flex")return!1;let o=n.justifyContent;if(o!=="space-between"&&o!=="space-around"&&o!=="space-evenly"&&o!=="stretch")return!1;let r=n.flexDirection;return!(t!==(r==="column"||r==="column-reverse"?"row":"column")||parseFloat(t==="row"?n.rowGap:n.columnGap)>0)}function ho(e){let t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function go(e){let t=window.getComputedStyle(e);return{top:parseFloat(t.marginTop)||0,right:parseFloat(t.marginRight)||0,bottom:parseFloat(t.marginBottom)||0,left:parseFloat(t.marginLeft)||0}}function Ot(e){let t=window.getComputedStyle(e);return{topLeft:t.borderTopLeftRadius,topRight:t.borderTopRightRadius,bottomRight:t.borderBottomRightRadius,bottomLeft:t.borderBottomLeftRadius}}function Dt(e){let t=window.getComputedStyle(e);return{"top-left":parseFloat(t.borderTopLeftRadius)||0,"top-right":parseFloat(t.borderTopRightRadius)||0,"bottom-right":parseFloat(t.borderBottomRightRadius)||0,"bottom-left":parseFloat(t.borderBottomLeftRadius)||0}}function mo(e){for(let t of e.childNodes)if(t.nodeType===Node.TEXT_NODE&&(t.textContent||"").trim().length>0)return!0;return!1}function yo(e){let t=document.createRange(),n=!1;for(let c of e.childNodes)c.nodeType===Node.TEXT_NODE&&(c.textContent||"").trim().length>0&&(n||(t.setStart(c,0),n=!0),t.setEnd(c,c.textContent?.length??0));if(!n)return null;let i=t.getBoundingClientRect(),o=window.getComputedStyle(e),r=parseFloat(o.fontSize)||16,a=parseFloat(o.lineHeight);isNaN(a)&&(a=r*1.2);let l=Math.max(1,t.getClientRects().length),d=Math.max(i.height,l*a),s=(d-i.height)/2;return new DOMRect(i.x,i.y-s,i.width,d)}function xo(e){let t=window.getComputedStyle(e),n=parseFloat(t.fontSize)||16,i=parseFloat(t.lineHeight);return isNaN(i)&&(i=n*1.2),{fontSize:n,lineHeight:i}}function wo(e){let t=e.startsWith("top-");return{top:t?4:12,right:4,bottom:t?12:4,left:4}}function vo({hasCommentEntry:e,stagedChangeCount:t}){return e&&t===0?2:6}function bo({annotationNumber:e,stickerCount:t,interactionEpisodeStepCount:n,hasStatus:i,hasSend:o,controlGap:r}){let a=16+Math.max(1,e===void 0?0:String(e).length)*7.2,l=t*28-Math.max(0,t-1)*2,d=n>0?32+String(n).length*7.2:0,s=28,c=t>0?l+(d>0?d-2:0)+(o?s-2:0):0,h=[t>0?c:0,t===0?d:0,t===0&&o?s:0,i?s:0].filter(u=>u>0);return a+h.reduce((u,f)=>u+f,0)+h.length*r}function So(e,t,n){let i=e.horizontalAlignment==="right"?e.left-t:e.left;return{left:i,top:e.top,right:i+t,bottom:e.top+n}}function Io(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Mo(e,t,n){let i=Math.max(0,e.left+t-n);return Math.max(0,t-e.right)<i?"right":"left"}function $t(e,t,n,i,o=0,r=Number.POSITIVE_INFINITY){if(e.height>=i)return{anchor:"top-left",horizontalAlignment:"left",left:e.left+8,top:e.top+8};let a=Mo(e,o,r);return e.top>=t+n?{anchor:a==="right"?"top-right":"top-left",horizontalAlignment:a,left:a==="right"?e.right:e.left,top:e.top-t-n}:{anchor:a==="right"?"bottom-right":"bottom-left",horizontalAlignment:a,left:a==="right"?e.right:e.left,top:e.bottom+n}}function Qe(e){return e.left+e.width}function De(e){return e.top+e.height}function Ve(e,t){if(e.length===0)return t;let n=Math.min(...e.map(a=>a.left)),i=Math.min(...e.map(a=>a.top)),o=Math.max(...e.map(Qe)),r=Math.max(...e.map(De));return{left:n,top:i,width:o-n,height:r-i}}function Ge(e){let t=[...e].sort((i,o)=>i.top-o.top||i.left-o.left),n=[];for(let i of t){let o=i.top+i.height/2,r=n.find(c=>{let h=c.top+c.height/2;return Math.abs(o-h)<=Math.max(c.height,i.height)*.4});if(!r){n.push({...i});continue}let a=Math.min(r.left,i.left),l=Math.min(r.top,i.top),d=Math.max(Qe(r),Qe(i)),s=Math.max(De(r),De(i));r.left=a,r.top=l,r.width=d-a,r.height=s-l}return n.sort((i,o)=>i.top-o.top||i.left-o.left)}function To({display:e,fragmentRects:t,elementRect:n,parentContentRect:i}){let o=Ge(t),r=Ve(o,n);if(!(e==="inline"&&o.length>1&&i&&i.width>0))return{textRect:r,boundaryRect:n,boundaryRects:[n],firstLineIndent:0};let a=o[0],l={left:i.left,top:a.top,width:i.width,height:Math.max(r.height,De(r)-a.top)},d=Math.max(0,Math.min(l.width,a.left-l.left));return{textRect:r,boundaryRect:Ve(o,n),boundaryRects:o,flowRect:l,firstLineIndent:d}}var Je=new WeakMap;function ko(e){let t={listeners:new Set,rafId:null,schedule:()=>{t.rafId===null&&(t.rafId=e.requestAnimationFrame(()=>{t.rafId=null;for(let n of t.listeners)n()}))}};return Je.set(e,t),e.addEventListener("scroll",t.schedule,{passive:!0,capture:!0}),e.addEventListener("resize",t.schedule),t}function _t(e,t=window){let n=Je.get(t)??ko(t);return n.listeners.add(e),()=>{n.listeners.delete(e)&&(n.listeners.size>0||(t.removeEventListener("scroll",n.schedule,!0),t.removeEventListener("resize",n.schedule),n.rafId!==null&&t.cancelAnimationFrame(n.rafId),Je.delete(t)))}}var se={topLeft:"0px",topRight:"0px",bottomRight:"0px",bottomLeft:"0px"};function Ft(e,t){return e.radii.topLeft!==t.radii.topLeft||e.radii.topRight!==t.radii.topRight||e.radii.bottomRight!==t.radii.bottomRight||e.radii.bottomLeft!==t.radii.bottomLeft||e.outline!==t.outline||e.fragments.length!==t.fragments.length?!1:e.fragments.every((n,i)=>{let o=t.fragments[i];return!!o&&n.left===o.left&&n.top===o.top&&n.width===o.width&&n.height===o.height})}function Pt(e){if(!e.isConnected||!Dn(e.ownerDocument))return{fragments:[],radii:se};let t=Tt(Ee(e),e.ownerDocument);if(Mt(e.ownerDocument)&&(!t.width||!t.height))return{fragments:[],radii:se};if(e.getAttribute("data-popmelt-subject-projection")==="true")return{fragments:[{left:t.left,top:t.top,width:t.width,height:t.height}],radii:se,outline:e.getAttribute("data-popmelt-subject-outline")??void 0};let n=Array.from(e.getClientRects()).map(i=>Tt(Ce(i,e.ownerDocument),e.ownerDocument)).filter(i=>i.width>0&&i.height>0).map(i=>({left:i.left,top:i.top,width:i.width,height:i.height}));return{fragments:Ge(n.length>0?n:[{left:t.left,top:t.top,width:t.width,height:t.height}]),radii:Ot(e)}}function zt({element:e,projectedRect:t,isSelected:n=!1,elementInfo:i,color:o="#3b82f6",annotationNumber:r,changeCount:a,hideTooltip:l=!1,hideOutline:d=!1,hideFill:s=!1,fillOpacity:c=.05,subjectRegistry:h,railGap:u=2,railHeight:f=22,railWidth:y=0,renderRail:m,refreshKey:g,outlineZIndex:k=9996,onActivate:w,onRemove:v}){let I=de(xe),[b,C]=re({fragments:[],radii:se});V(()=>{if(!I)return;if(!e){C({fragments:[],radii:se});return}let P=null,H=()=>{let ee=Pt(e);C(Te=>Ft(Te,ee)?Te:ee)},E=()=>{P===null&&(P=requestAnimationFrame(()=>{P=null,H()}))};H();let fe=e.getAttribute("data-popmelt-subject-projection")==="true"&&!!h,he=fe?h.subscribeFrame(H):void 0,ge=fe||typeof ResizeObserver>"u"?null:new ResizeObserver(E);ge?.observe(e);let B=fe?null:new MutationObserver(E);B?.observe(e,{attributes:!0,attributeFilter:["style","class"]});let ae=_t(H,e.ownerDocument.defaultView??window),me=Mt(e.ownerDocument)?Ue(H):void 0;return()=>{ae(),me?.(),he?.(),ge?.disconnect(),B?.disconnect(),P!==null&&cancelAnimationFrame(P)}},[I,e,h]),Ct(()=>{if(!I||!e||g===void 0)return;let P=Pt(e);C(H=>Ft(H,P)?H:P)},[I,e,g]);let{fragments:N,radii:z}=t?{fragments:[t],radii:se}:b;if(N.length===0||!e&&!t)return null;let A=Ve(N,N[0]),T=e?.tagName.toLowerCase()??"",X=e?.id?`#${e.id}`:"",oe=e&&e.classList.length>0?"."+Array.from(e.classList).slice(0,2).join("."):"",ie=i?.reactComponent,Se=e?.getAttribute("data-popmelt-subject-adapter"),Ie=e?.getAttribute("data-popmelt-subject-label"),Pe=Se&&Ie?`<${Ie}>`:ie?`<${ie}> ${T}${X}${oe}`:`${T}${X}${oe}`,Z=$t({left:A.left,right:A.left+A.width,top:A.top,bottom:A.top+A.height,height:A.height},f,u,window.innerHeight,y,window.innerWidth),Me={zIndex:9997,display:"flex",alignItems:"center",gap:6,backgroundColor:o,color:"#fff",fontSize:12,fontFamily:je,lineHeight:"14px",padding:"4px 8px",borderRadius:8,pointerEvents:"none",whiteSpace:"nowrap",maxWidth:400,position:"fixed",top:Z.top,left:Z.left},ze=!l&&R("div",{ref:P=>{e&&Nn(e,P)},"data-devtools":"tooltip",style:Me,children:[r!==void 0&&R("span",{children:[r,"."]}),x("span",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:1,minWidth:0},children:Pe}),a!==void 0&&a>0&&R("span",{style:{opacity:.8},children:["(",a," ",a===1?"change":"changes",")"]})]});return R(W,{children:[!d&&N.map((P,H)=>x("div",{"data-devtools":"highlight",onContextMenu:v?E=>{E.preventDefault(),E.stopPropagation(),v()}:void 0,role:w?"button":void 0,tabIndex:w?0:void 0,"aria-label":w?"Open annotation thread":void 0,onPointerDown:w?E=>{E.preventDefault(),E.stopPropagation()}:void 0,onClick:w?E=>{E.preventDefault(),E.stopPropagation(),w()}:void 0,onKeyDown:w?E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),E.stopPropagation(),w())}:void 0,style:{position:"fixed",top:P.top,left:P.left,width:P.width,height:P.height,pointerEvents:w||v?"auto":"none",cursor:w?"pointer":void 0,zIndex:k,overflow:"visible"},children:x("div",{style:b.outline?{position:"absolute",inset:0,pointerEvents:"none"}:{position:"absolute",inset:0,boxSizing:"border-box",backgroundColor:s?"transparent":Xe(o,c),borderColor:o,borderStyle:n?"solid":"dashed",borderWidth:1,borderTopLeftRadius:z.topLeft,borderTopRightRadius:z.topRight,borderBottomRightRadius:z.bottomRight,borderBottomLeftRadius:z.bottomLeft,pointerEvents:"none"},children:b.outline?x("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%",style:{display:"block",overflow:"visible"},"aria-hidden":"true",children:x("polygon",{points:b.outline,fill:s?"transparent":Xe(o,c),stroke:o,strokeWidth:1,strokeDasharray:n?void 0:"4 3",vectorEffect:"non-scaling-stroke"})}):null})},`${P.left}:${P.top}:${H}`)),m?m(Z,A):ze]})}function Bt(e){return e==="bottom-left"?[2,8,8,8]:e==="bottom-right"?[8,2,8,8]:e==="top-right"?[8,8,2,8]:[8,8,8,2]}function Eo(e){return Bt(e).map(t=>`${t}px`).join(" ")}var ve=1.1666666666666667,Ht=2048;function Ze(e){return e.length>Ht?`${e.slice(0,Ht)}\u2026`:e}function Co(e,t,n){let i=Ze(t);if(!i||e.measureText(i).width<=n)return[i];let o=i.split(/\s+/),r=[],a="";for(let l of o){let d=a?`${a} ${l}`:l;a&&e.measureText(d).width>n?(r.push(a),a=l):a=d}return a&&r.push(a),r.length>0?r:[i]}function Ao(e,t,n){return t.flatMap(i=>Co(e,i,n))}var ne=je,et=400,Wt=16,tt=60,Ro=12,nt=16;function jt(e){let t=window.innerWidth-e-Wt;return Math.max(tt,Math.min(et,t))}function ot(e,t,n){let i=Ze(t);if(i===t&&e.measureText(i).width<=n)return i;let o="\u2026",r=0,a=i.endsWith(o)?i.length-1:i.length;for(;r<a;){let l=Math.ceil((r+a)/2);e.measureText(i.slice(0,l)+o).width<=n?r=l:a=l-1}return r>0?i.slice(0,r)+o:o}function No(e,t,n){if(e===void 0||t===void 0||n.avoidLeft===void 0&&n.avoidRight===void 0)return!0;let i=typeof window<"u"?window.innerWidth:9999,o=n.avoidLeft??0,r=n.avoidRight??i;return e+t>o&&e<r}function Yt(e,t,n,i,o){let r=typeof window<"u"?window.innerHeight:9999,a=0,l=r;n&&No(i,o,n)&&(a=n.avoidTop??a,l=n.avoidBottom??l);let d=Math.max(a,l-t);return Math.max(a,Math.min(e,d))}function qt(e,t=12,n,i){let o=t*ve+8,r=e.y-4,a=e.x-8,l=Yt(r,o,n,a,i);return l===r?e:{...e,y:l+4}}function Lo(e,t,n,i,o=12,r,a,l,d="#dddddd",s,c=!1){if(!n)return;let h=o*ve,u=n.replace(/\n/g," "),f=r!==void 0?r+". "+u:u;e.font=`${o}px ${ne}`,e.textBaseline="middle";let y=a!==void 0?Math.min(et,Math.max(tt,window.innerWidth-a-Wt)):et,m=c?nt:0,g=ot(e,f,Math.max(tt,y-m)),k=e.measureText(g).width,w=m+k,v=qt(t,o,l,w+16);e.fillStyle=i;let I=v.x-8,b=v.y-4,C=w+16,N=h+8;e.beginPath(),e.roundRect(I,b,C,N,Bt(s)),e.fill();let z=v.y+h/2;if(c){let A=v.x,T=z-Ro/2;e.strokeStyle=d,e.lineWidth=1.5,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(A+7.5,T+4),e.lineTo(A+10.5,T+6.5),e.lineTo(A+7.5,T+9),e.moveTo(A+1.5,T+1.5),e.lineTo(A+1.5,T+4.5),e.quadraticCurveTo(A+1.5,T+6.5,A+3.5,T+6.5),e.lineTo(A+10.5,T+6.5),e.stroke()}e.fillStyle=d,e.fillText(g,v.x+m,z)}function Oo(e,t,n){let i=e.filter(o=>!o.captured&&o.selector===t&&(!o.pathname||o.pathname===n));return i.length?{type:"MODIFY_TEXT_CONTENTS",payload:i.map(o=>({...o,modified:o.original}))}:null}function Kt(e,t){return e.type!=="text"?!1:(e.groupId?t.filter(n=>n.groupId===e.groupId):[e]).every(n=>(n.status??"pending")==="pending"&&!n.threadId)}var Ut=Ke(0),it=`
3
3
  0%, 100% { translate: 0 0; }
4
4
  20% { translate: -4px 0; }
5
5
  45% { translate: 4px 0; }
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{A as p}from"./chunk-GNZ73T3H.mjs";import{j as m}from"./chunk-EXDOFFFJ.mjs";var o=!1,f=()=>o;function E(c){o=!0;let t=null,r=!1,a=e=>{let n=e.composedPath()[0];return n instanceof Element&&(n.id==="devtools-canvas"||!p(n)&&!n.closest("[data-taste-editor], [data-taste-navigation]"))},i=e=>{e.preventDefault(),e.stopImmediatePropagation()},l=e=>{t=null,!(e.button!==0||!a(e))&&(t={x:e.clientX,y:e.clientY},r=!1,i(e))},d=e=>{t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>5&&(r=!0)},u=e=>{t&&i(e)},s=e=>{if(!a(e)||e.button!==0){t=null;return}i(e);let n=!!(t&&!r);if(t=null,!n)return;let w=m(e.clientX,e.clientY);w&&c(w)},v=()=>{t=null};return window.addEventListener("pointerdown",l,!0),window.addEventListener("pointermove",d,!0),window.addEventListener("pointerup",u,!0),window.addEventListener("pointercancel",v,!0),window.addEventListener("click",s,!0),()=>{o=!1,window.removeEventListener("pointerdown",l,!0),window.removeEventListener("pointermove",d,!0),window.removeEventListener("pointerup",u,!0),window.removeEventListener("pointercancel",v,!0),window.removeEventListener("click",s,!0)}}export{f as a,E as b};
2
+ import{A as p}from"./chunk-B2MFT2SV.mjs";import{j as m}from"./chunk-EXDOFFFJ.mjs";var o=!1,f=()=>o;function E(c){o=!0;let t=null,r=!1,a=e=>{let n=e.composedPath()[0];return n instanceof Element&&(n.id==="devtools-canvas"||!p(n)&&!n.closest("[data-taste-editor], [data-taste-navigation]"))},i=e=>{e.preventDefault(),e.stopImmediatePropagation()},l=e=>{t=null,!(e.button!==0||!a(e))&&(t={x:e.clientX,y:e.clientY},r=!1,i(e))},d=e=>{t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>5&&(r=!0)},u=e=>{t&&i(e)},s=e=>{if(!a(e)||e.button!==0){t=null;return}i(e);let n=!!(t&&!r);if(t=null,!n)return;let w=m(e.clientX,e.clientY);w&&c(w)},v=()=>{t=null};return window.addEventListener("pointerdown",l,!0),window.addEventListener("pointermove",d,!0),window.addEventListener("pointerup",u,!0),window.addEventListener("pointercancel",v,!0),window.addEventListener("click",s,!0),()=>{o=!1,window.removeEventListener("pointerdown",l,!0),window.removeEventListener("pointermove",d,!0),window.removeEventListener("pointerup",u,!0),window.removeEventListener("pointercancel",v,!0),window.removeEventListener("click",s,!0)}}export{f as a,E as b};