@1agh/maude 0.39.1 → 0.41.0

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 (137) hide show
  1. package/README.md +1 -1
  2. package/apps/studio/ai-banner.tsx +2 -2
  3. package/apps/studio/annotations-context-toolbar.tsx +44 -1
  4. package/apps/studio/annotations-layer.tsx +306 -5
  5. package/apps/studio/annotations-model.ts +107 -6
  6. package/apps/studio/api.ts +1316 -67
  7. package/apps/studio/artboard-marquee.tsx +1 -1
  8. package/apps/studio/bin/_canvas-rects-playwright.mjs +55 -0
  9. package/apps/studio/bin/_canvas-rects-static.mjs +166 -0
  10. package/apps/studio/bin/_fetch-asset.mjs +556 -0
  11. package/apps/studio/bin/_html-playwright.mjs +9 -1
  12. package/apps/studio/bin/_pdf-playwright.mjs +8 -1
  13. package/apps/studio/bin/_png-playwright.mjs +8 -1
  14. package/apps/studio/bin/_pw-launch.mjs +54 -0
  15. package/apps/studio/bin/_svg-playwright.mjs +8 -1
  16. package/apps/studio/bin/_video-playwright.mjs +452 -0
  17. package/apps/studio/bin/annotate.mjs +576 -34
  18. package/apps/studio/bin/canvas-rects.sh +152 -0
  19. package/apps/studio/bin/fetch-asset.sh +34 -0
  20. package/apps/studio/bin/prep.sh +8 -1
  21. package/apps/studio/bin/read-annotations.mjs +138 -7
  22. package/apps/studio/bin/smoke.sh +42 -6
  23. package/apps/studio/build.ts +21 -0
  24. package/apps/studio/canvas-comment-mount.tsx +138 -4
  25. package/apps/studio/canvas-edit.ts +2625 -111
  26. package/apps/studio/canvas-lib.tsx +238 -2
  27. package/apps/studio/canvas-list-watch.ts +6 -2
  28. package/apps/studio/canvas-shell.tsx +514 -20
  29. package/apps/studio/client/app.jsx +2480 -52
  30. package/apps/studio/client/comments-overlay.css +130 -126
  31. package/apps/studio/client/github.js +15 -0
  32. package/apps/studio/client/panels/TimelinePanel.jsx +860 -0
  33. package/apps/studio/client/panels/timeline-parse.js +229 -0
  34. package/apps/studio/client/panels/timeline-snap.js +55 -0
  35. package/apps/studio/client/styles/3-shell-maude.css +155 -0
  36. package/apps/studio/comments-overlay.tsx +148 -41
  37. package/apps/studio/config.schema.json +14 -0
  38. package/apps/studio/context-menu.tsx +16 -6
  39. package/apps/studio/context.ts +113 -1
  40. package/apps/studio/contextual-toolbar.tsx +262 -4
  41. package/apps/studio/cursors-overlay.tsx +4 -4
  42. package/apps/studio/dist/client.bundle.js +89 -17
  43. package/apps/studio/dist/comment-mount.js +59 -1
  44. package/apps/studio/dist/runtime/.min-sizes.json +11 -1
  45. package/apps/studio/dist/runtime/@remotion_media.js +491 -0
  46. package/apps/studio/dist/runtime/@remotion_player.js +56 -0
  47. package/apps/studio/dist/runtime/@remotion_transitions.js +300 -0
  48. package/apps/studio/dist/runtime/@remotion_transitions_clock-wipe.js +1 -0
  49. package/apps/studio/dist/runtime/@remotion_transitions_fade.js +1 -0
  50. package/apps/studio/dist/runtime/@remotion_transitions_flip.js +1 -0
  51. package/apps/studio/dist/runtime/@remotion_transitions_none.js +1 -0
  52. package/apps/studio/dist/runtime/@remotion_transitions_slide.js +1 -0
  53. package/apps/studio/dist/runtime/@remotion_transitions_wipe.js +1 -0
  54. package/apps/studio/dist/runtime/REMOTION-LICENSE.md +28 -0
  55. package/apps/studio/dist/runtime/remotion.js +42 -0
  56. package/apps/studio/dist/styles.css +1 -1
  57. package/apps/studio/dom-selection.ts +127 -1
  58. package/apps/studio/drag-state.ts +24 -0
  59. package/apps/studio/equal-spacing-detector.ts +205 -0
  60. package/apps/studio/export-dialog.tsx +1 -1
  61. package/apps/studio/exporters/_browser-bundles.ts +117 -0
  62. package/apps/studio/exporters/_runtime.ts +69 -0
  63. package/apps/studio/exporters/html.ts +4 -3
  64. package/apps/studio/exporters/index.ts +28 -2
  65. package/apps/studio/exporters/pdf.ts +4 -3
  66. package/apps/studio/exporters/png.ts +5 -3
  67. package/apps/studio/exporters/pptx.ts +6 -4
  68. package/apps/studio/exporters/svg.ts +9 -5
  69. package/apps/studio/exporters/video-encode-lib.ts +200 -0
  70. package/apps/studio/exporters/video-render-lib.ts +108 -0
  71. package/apps/studio/exporters/video.ts +184 -0
  72. package/apps/studio/history.ts +47 -1
  73. package/apps/studio/http.ts +758 -27
  74. package/apps/studio/input-router.tsx +19 -1
  75. package/apps/studio/marquee-overlay.tsx +1 -1
  76. package/apps/studio/measure-overlay.tsx +241 -0
  77. package/apps/studio/participants-chrome.tsx +3 -3
  78. package/apps/studio/runtime-bundle.ts +30 -0
  79. package/apps/studio/server.ts +34 -9
  80. package/apps/studio/sizing-mode.ts +117 -0
  81. package/apps/studio/spacing-handles.ts +166 -0
  82. package/apps/studio/test/annotate-write.test.ts +890 -0
  83. package/apps/studio/test/annotations-roundtrip.test.ts +47 -0
  84. package/apps/studio/test/camera-reveal.test.tsx +173 -0
  85. package/apps/studio/test/canvas-create-api.test.ts +76 -0
  86. package/apps/studio/test/canvas-edit.test.ts +140 -0
  87. package/apps/studio/test/canvas-list-watch.test.ts +49 -0
  88. package/apps/studio/test/canvas-media-drop.test.ts +30 -1
  89. package/apps/studio/test/canvas-origin-gate.test.ts +54 -0
  90. package/apps/studio/test/canvas-rects.test.ts +198 -0
  91. package/apps/studio/test/clip-addressing.test.ts +732 -0
  92. package/apps/studio/test/comments-overlay.test.ts +117 -0
  93. package/apps/studio/test/config-reload.test.ts +230 -0
  94. package/apps/studio/test/dns-rebinding-guard.test.ts +74 -0
  95. package/apps/studio/test/dom-selection.test.ts +130 -0
  96. package/apps/studio/test/edit-css-occurrence.test.ts +81 -0
  97. package/apps/studio/test/edit-persistence.test.ts +91 -0
  98. package/apps/studio/test/edit-scope-api.test.ts +115 -0
  99. package/apps/studio/test/element-resize.test.ts +136 -0
  100. package/apps/studio/test/element-structural-api.test.ts +360 -0
  101. package/apps/studio/test/element-structural-edit.test.ts +233 -0
  102. package/apps/studio/test/equal-spacing-detector.test.ts +165 -1
  103. package/apps/studio/test/exporters/runtime.test.ts +59 -0
  104. package/apps/studio/test/file-lock.test.ts +84 -0
  105. package/apps/studio/test/fixtures/video-comp-fixture.tsx +82 -0
  106. package/apps/studio/test/history-rollback.test.ts +26 -0
  107. package/apps/studio/test/knob-props-authored.test.ts +87 -0
  108. package/apps/studio/test/read-annotations.test.ts +154 -0
  109. package/apps/studio/test/sizing-mode.test.ts +102 -0
  110. package/apps/studio/test/spacing-handles.test.ts +138 -0
  111. package/apps/studio/test/specimen-select.test.ts +88 -0
  112. package/apps/studio/test/timeline-parse.test.ts +127 -0
  113. package/apps/studio/test/timeline-snap.test.ts +85 -0
  114. package/apps/studio/test/tool-palette-insert-anchor.test.ts +84 -0
  115. package/apps/studio/test/undo-sequence-byte-compare.test.ts +211 -0
  116. package/apps/studio/test/video-asset.test.ts +163 -0
  117. package/apps/studio/test/video-comp-fixture.test.ts +50 -0
  118. package/apps/studio/test/video-comp.test.ts +168 -0
  119. package/apps/studio/test/video-render-bridge.test.ts +149 -0
  120. package/apps/studio/tool-palette.tsx +122 -2
  121. package/apps/studio/undo-hud.tsx +2 -2
  122. package/apps/studio/use-annotation-resize.tsx +6 -3
  123. package/apps/studio/use-canvas-media-drop.tsx +66 -4
  124. package/apps/studio/use-element-resize.tsx +732 -0
  125. package/apps/studio/use-keyboard-discipline.tsx +205 -15
  126. package/apps/studio/use-selection-set.tsx +14 -0
  127. package/apps/studio/use-spacing-handles.tsx +388 -0
  128. package/apps/studio/video-comp.tsx +444 -0
  129. package/apps/studio/whats-new.json +55 -0
  130. package/apps/studio/ws.ts +5 -0
  131. package/cli/commands/design.mjs +6 -1
  132. package/cli/commands/design.test.mjs +49 -1
  133. package/cli/lib/fetch-asset.test.mjs +213 -0
  134. package/package.json +8 -8
  135. package/plugins/design/dependencies.json +10 -2
  136. package/plugins/design/templates/_shell.html +25 -2
  137. package/plugins/design/templates/design-system-inspiration/_MAPPING.md +1 -1
@@ -1 +1,59 @@
1
- import{Component as bQ,createElement as k,Fragment as xQ,useCallback as UJ,useEffect as p,useMemo as vQ,useRef as S,useState as KJ}from"react";import{createRoot as RQ}from"react-dom/client";import{useCallback as T,useEffect as y,useMemo as u,useRef as b,useState as v}from"react";import*as l from"lib0/decoding";import*as m from"lib0/encoding";import{createContext as hJ,useCallback as rQ,useContext as fJ,useEffect as iQ,useMemo as cQ,useReducer as lQ,useRef as aQ,useState as oQ}from"react";import{Awareness as sQ,applyAwarenessUpdate as tQ,encodeAwarenessUpdate as eQ}from"y-protocols/awareness";import{readSyncMessage as QZ,writeSyncStep1 as ZZ,writeUpdate as $Z}from"y-protocols/sync";import*as pJ from"yjs";import{jsx as zZ}from"react/jsx-runtime";var mJ=hJ(null);function FJ(){return fJ(mJ)}import{createContext as uJ,useCallback as h,useContext as o,useEffect as dJ,useMemo as rJ,useRef as iJ,useState as cJ}from"react";import{jsx as a,Fragment as oJ}from"react/jsx-runtime";var i=uJ(null);function f(J){return J.id?`id:${J.id}`:`sel:${J.selector}`}function HJ(J){let Z=[],Q=new Set;for(let $ of J){let z=f($);if(Q.has(z))continue;Q.add(z),Z.push($)}return Z}var lJ=50;function aJ({children:J,postTarget:Z}){let[Q,$]=cJ([]),z=iJ(null),W=h((X)=>{if(z.current)clearTimeout(z.current);z.current=setTimeout(()=>{z.current=null;let Y=Z??(typeof window<"u"?window.parent:null);if(!Y)return;let j=X.length===0?null:X.length===1?X[0]??null:X;try{Y.postMessage({dgn:"select-set",selection:j},"*")}catch{}},lJ)},[Z]);dJ(()=>()=>{if(z.current)clearTimeout(z.current)},[]);let U=h((X)=>{let Y=HJ(Array.isArray(X)?X:[X]);$(Y),W(Y)},[W]),q=h((X)=>{let Y=Array.isArray(X)?X:[X];$((j)=>{let _=HJ([...j,...Y]);return W(_),_})},[W]),G=h((X)=>{let Y=f(X);$((j)=>{let _=j.filter((I)=>f(I)!==Y);return W(_),_})},[W]),F=h((X)=>{let Y=f(X);$((j)=>{let _=j.some((I)=>f(I)===Y)?j.filter((I)=>f(I)!==Y):[...j,X];return W(_),_})},[W]),D=h(()=>{$([]),W([])},[W]),K=rJ(()=>({selected:Q,replace:U,add:q,remove:G,toggle:F,clear:D}),[Q,U,q,G,F,D]);return a(i.Provider,{value:K,children:J})}function PJ({children:J}){if(o(i))return a(oJ,{children:J});return a(aJ,{children:J})}function LJ(){let J=o(i);if(!J)throw Error("useSelectionSet must be used inside <SelectionSetProvider>");return J}function MJ(){return o(i)}import{jsx as N,jsxs as E}from"react/jsx-runtime";var nJ="/_client/comments-overlay.css";function sJ(){if(typeof document>"u")return;if(document.getElementById("cm-overlay-css"))return;let J=document.createElement("link");J.id="cm-overlay-css",J.rel="stylesheet",J.href=nJ,document.head.appendChild(J)}function tJ(){if(typeof window>"u")return null;try{let J=window.location.pathname;if(J==="/_canvas-shell.html"||J==="/_canvas-shell"){let Z=new URLSearchParams(window.location.search),Q=Z.get("canvas")??"",$=(Z.get("designRel")??".design").replace(/^\/+|\/+$/g,"");return Q?`${$}/${Q}`:null}return decodeURIComponent(J).replace(/^\//,"")}catch{return null}}function s(J,Z){if(!J)return null;let Q=null;try{let z=document.querySelectorAll(J),W=Z&&Z>0&&Z<z.length?Z:0;Q=z[W]??z[0]??null}catch{return null}if(!Q?.isConnected)return null;let $=Q.getBoundingClientRect();if($.width===0&&$.height===0)return null;return{x:$.left,y:$.top,w:$.width,h:$.height}}function IJ(){sJ();let J=MJ(),[Z,Q]=v([]),[$,z]=v(null),[W,U]=v(null),q=u(()=>tJ(),[]);y(()=>{if(typeof document>"u")return;let B=document.getElementById("dgn-pin-layer");if(!B)return;let H=B.style.display;return B.style.display="none",()=>{B.style.display=H}},[]);let G=T((B)=>{if(!J)return;if(!B?.selector){J.clear();return}let H=B.selector.match(/data-cd-id="([^"]+)"/),M=H?H[1]:void 0,O,x;try{let P=document.querySelector(B.selector);if(P)O=P.tagName.toLowerCase(),x=(P.getAttribute("class")??"").split(/\s+/).filter((A)=>A&&!A.startsWith("dgn-")&&!A.startsWith("dc-cv-")).join(" ")}catch{}J.replace({file:q??void 0,id:M,selector:B.selector,tag:O,classes:x,bounds:B.bounds??void 0})},[J,q]),F=b(Z);F.current=Z;let D=FJ();y(()=>{if(!D)return;let B=D.doc.getArray("comments"),H=()=>{Q(B.toArray())};if(B.length>0)H();return B.observe(H),()=>{try{B.unobserve(H)}catch{}}},[D]),y(()=>{if(typeof window>"u")return;let B=(H)=>{let M=H.data;if(!M||typeof M!=="object"||!M.dgn)return;if(M.dgn==="comments-set"&&Array.isArray(M.comments))Q(M.comments);else if(M.dgn==="comment-focus"){let O=typeof M.id==="string"?M.id:null;z(O);let x=O?F.current.find((P)=>P.id===O):void 0;G(x)}};return window.addEventListener("message",B),()=>window.removeEventListener("message",B)},[G]),y(()=>{if(typeof document>"u")return;let B=(H)=>{let M=H.detail;if(!M?.selection)return;U({selection:M.selection,clientX:typeof M.clientX==="number"?M.clientX:0,clientY:typeof M.clientY==="number"?M.clientY:0})};return document.addEventListener("cm:open-composer",B),()=>document.removeEventListener("cm:open-composer",B)},[]);let K=T(()=>{if(U(null),typeof window>"u")return;try{window.parent.postMessage({dgn:"force-clear"},"*")}catch{}},[]),X=T((B)=>{if(!W)return;let H=W.selection,M={file:H.file,selector:H.selector,index:H.index,dom_path:H.dom_path,tag:H.tag,classes:H.classes,bounds:H.bounds,html_excerpt:H.html,text:B};if(typeof window>"u")return;try{window.parent.postMessage({dgn:"comment-submit",payload:M},"*")}catch{}K()},[W,K]);y(()=>{if(!q)return;let B=!1;return(async()=>{try{let H=await fetch(`/_comments?file=${encodeURIComponent(q)}`);if(!H.ok)return;let M=await H.json();if(B)return;if(Array.isArray(M.comments))Q((O)=>O.length===0?M.comments??[]:O)}catch{}})(),()=>{B=!0}},[q]);let Y=u(()=>{return Z.slice().sort((H,M)=>H.created.localeCompare(M.created)).filter((H)=>H.status!=="resolved")},[Z]),j=u(()=>{let B=new Map;return Z.slice().sort((M,O)=>M.created.localeCompare(O.created)).forEach((M,O)=>{B.set(M.id,O+1)}),B},[Z]),_=T((B)=>{if(z(B),G(Z.find((H)=>H.id===B)),typeof window>"u")return;try{window.parent.postMessage({dgn:"comment-click",id:B},"*")}catch{}},[Z,G]),I=T((B,H)=>{if(typeof window>"u")return;try{window.parent.postMessage({dgn:"comment-patch",id:B,patch:H},"*")}catch{}},[]),V=T((B)=>{if(typeof window>"u")return;try{window.parent.postMessage({dgn:"comment-delete",id:B},"*")}catch{}z((H)=>H===B?null:H)},[]),L=T(async(B,H)=>{if(typeof fetch>"u")return!1;try{let M=await fetch(`/_api/comments/${encodeURIComponent(B)}/reply`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:H})});if(!M.ok)return!1;let O=await M.json();return Q((x)=>x.map((P)=>P.id===O.id?O:P)),!0}catch{return!1}},[]);return E("div",{className:"cm-layer","aria-hidden":!1,children:[Y.map((B)=>{let H=j.get(B.id)??0;return N(QQ,{comment:B,sequence:H,focused:$===B.id,onClick:_},B.id)}),W?N(ZQ,{state:W,onSubmit:X,onCancel:K}):null,(()=>{if(!$)return null;let B=Y.find((H)=>H.id===$);if(!B)return null;return N($Q,{comment:B,sequence:j.get(B.id)??0,onClose:()=>{z(null),J?.clear()},onPatch:(H)=>I(B.id,H),onDelete:()=>V(B.id),onReply:(H)=>L(B.id,H)})})()]})}var n=null;async function eJ(){if(!n)n=(async()=>{try{let J=await fetch("/_api/git-committers");if(!J.ok)return[];let Z=await J.json();return Array.isArray(Z.committers)?Z.committers:[]}catch{return[]}})();return n}function jJ(J){return(J.trim().split(/\s+/)[0]??"").replace(/[^\w.-]/g,"").toLowerCase()}function JQ(J,Z){if(Z<=0||Z>J.length)return null;let Q=Z-1;while(Q>=0){let $=J[Q]??"";if($==="@"){let z=Q>0?J[Q-1]:"";if(Q===0||/\s/.test(z??"")){let W=J.slice(Q+1,Z);return{start:Q,end:Z,query:W}}return null}if(!/[\w.-]/.test($))return null;Q-=1}return null}function AJ({className:J,value:Z,onChange:Q,onKeyDown:$,placeholder:z,rows:W,disabled:U,textareaRef:q,ariaLabel:G}){let F=b(null),D=T((P)=>{if(F.current=P,q)q.current=P},[q]),[K,X]=v([]),[Y,j]=v(null),[_,I]=v(0),V=T(()=>{if(K.length>0)return;eJ().then((P)=>X(P))},[K.length]),L=u(()=>{if(!Y)return[];let P=Y.query.toLowerCase();return(!P?K:K.filter((g)=>g.name.toLowerCase().includes(P)||g.email.toLowerCase().includes(P))).slice(0,8)},[Y,K]),B=T((P)=>{let A=P.selectionStart??P.value.length,g=JQ(P.value,A);j(g),I(0)},[]),H=T((P)=>{Q(P.target.value),B(P.target)},[Q,B]),M=T((P)=>{if(!Y)return;let A=F.current;if(!A)return;let g=`@${jJ(P.name)}`,c=`${Z.slice(0,Y.start)}${g} ${Z.slice(Y.end)}`;Q(c),j(null);let DJ=Y.start+g.length+1;requestAnimationFrame(()=>{A.focus(),A.setSelectionRange(DJ,DJ)})},[Y,Z,Q]),O=T((P)=>{if(Y&&L.length>0){if(P.key==="ArrowDown"){P.preventDefault(),I((A)=>(A+1)%L.length);return}if(P.key==="ArrowUp"){P.preventDefault(),I((A)=>(A-1+L.length)%L.length);return}if(P.key==="Enter"||P.key==="Tab"){P.preventDefault();let A=L[_]??L[0];if(A)M(A);return}if(P.key==="Escape"){P.preventDefault(),j(null);return}}$?.(P)},[Y,L,_,M,$]),x=T((P)=>{B(P.currentTarget)},[B]);return E("div",{style:{position:"relative"},children:[N("textarea",{ref:D,className:J,value:Z,placeholder:z,rows:W,disabled:U,"aria-label":G,onChange:H,onKeyDown:O,onFocus:V,onSelect:x,onClick:x}),Y&&L.length>0?N("ul",{className:"cm-mention-popup",role:"listbox","aria-label":"Mention suggestions",style:{left:0,top:"100%"},children:L.map((P,A)=>{return E("li",{role:"option","aria-selected":A===_,className:"cm-mention-popup__item",onMouseEnter:()=>I(A),onMouseDown:(c)=>{c.preventDefault(),M(P)},children:[E("span",{className:"cm-mention-popup__name",children:["@",jJ(P.name)]}),N("span",{className:"cm-mention-popup__email",children:P.email})]},`${P.name}-${P.email}`)})}):null]})}function QQ({comment:J,sequence:Z,focused:Q,onClick:$}){let z=b(null),W=b(null);y(()=>{let G=()=>{W.current=null;let F=z.current;if(!F)return;let D=s(J.selector,J.index);if(!D&&J.bounds)D={x:J.bounds.x,y:J.bounds.y,w:J.bounds.w,h:J.bounds.h};if(!D){F.style.display="none",W.current=requestAnimationFrame(G);return}F.style.display="grid";let K=Math.round(D.x+D.w-12),X=Math.round(D.y-12);F.style.left=`${K}px`,F.style.top=`${X}px`,W.current=requestAnimationFrame(G)};return W.current=requestAnimationFrame(G),()=>{if(W.current!=null)cancelAnimationFrame(W.current)}},[J.selector,J.bounds,J.index]);let U=J.author?.trim()||"unknown",q=`Comment ${Z} by ${U}`;return N("button",{ref:z,type:"button",className:"cm-pin","data-resolved":J.status==="resolved"?"true":"false","data-focused":Q?"true":"false","data-comment-pin":J.id,"aria-label":q,"aria-expanded":Q,title:J.text.slice(0,200),onClick:(G)=>{G.preventDefault(),G.stopPropagation(),$(J.id)},children:Z})}function ZQ({state:J,onSubmit:Z,onCancel:Q}){let[$,z]=v(""),W=b(null),U=b(null),q=b(null);y(()=>{let K=()=>{q.current=null;let X=U.current;if(!X)return;let Y=WQ(J);X.style.left=`${Math.round(Y.x)}px`,X.style.top=`${Math.round(Y.y)}px`,q.current=requestAnimationFrame(K)};return q.current=requestAnimationFrame(K),()=>{if(q.current!=null)cancelAnimationFrame(q.current)}},[J]),y(()=>{W.current?.focus()},[]);let G=T(()=>{let K=$.trim();if(!K)return;Z(K)},[$,Z]),F=T((K)=>{if(K.key==="Escape"){K.preventDefault(),Q();return}if((K.metaKey||K.ctrlKey)&&K.key==="Enter")K.preventDefault(),G()},[Q,G]),D=u(()=>{let K=J.selection.selector||"";if(!K)return J.selection.tag||"canvas";let X=K.match(/data-cd-id="([^"]+)"/);if(X)return`cd:${X[1]}`;return K.length>36?`${K.slice(0,33)}…`:K},[J.selection]);return E("div",{ref:U,className:"cm-composer",role:"dialog","aria-label":"New comment",onClick:(K)=>K.stopPropagation(),onPointerDown:(K)=>K.stopPropagation(),children:[E("div",{className:"cm-composer__head",children:[N("span",{children:"New comment"}),N("span",{className:"cm-composer__selector",children:D})]}),N(AJ,{textareaRef:W,className:"cm-composer__textarea",value:$,placeholder:"Type a comment. ⌘↵ to save · Esc to cancel · @name to tag",onChange:z,onKeyDown:F,rows:3,ariaLabel:"Comment body"}),E("div",{className:"cm-composer__actions",children:[N("button",{type:"button",className:"cm-btn",onClick:Q,children:"Cancel"}),N("button",{type:"button",className:"cm-btn cm-btn--primary",disabled:!$.trim(),onClick:G,children:"Save"})]})]})}function $Q({comment:J,sequence:Z,onClose:Q,onPatch:$,onDelete:z,onReply:W}){let U=b(null),q=b(null),G=b(null),[F,D]=v(""),[K,X]=v(!1);y(()=>{let V=()=>{G.current=null;let L=U.current;if(!L)return;let B=zQ(J);L.style.left=`${Math.round(B.x)}px`,L.style.top=`${Math.round(B.y)}px`,G.current=requestAnimationFrame(V)};return G.current=requestAnimationFrame(V),()=>{if(G.current!=null)cancelAnimationFrame(G.current)}},[J]),y(()=>{U.current?.focus();let V=J.id;return()=>{document.querySelector(`[data-comment-pin="${V}"]`)?.focus()}},[J.id]),y(()=>{if(typeof document>"u")return;let V=(L)=>{if(L.key!=="Escape")return;let B=U.current;if(!B)return;if(B.contains(L.target)||document.activeElement===B)L.preventDefault(),Q()};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[Q]);let Y=T(async()=>{let V=F.trim();if(!V||K)return;X(!0);let L=await W(V);if(X(!1),L)D(""),q.current?.focus()},[F,K,W]),j=T((V)=>{if((V.metaKey||V.ctrlKey)&&V.key==="Enter")V.preventDefault(),Y()},[Y]),_=`cm-thread-head-${J.id}`,I=VQ(J.selector,"");return E("div",{ref:U,className:"cm-thread",role:"dialog","aria-labelledby":_,tabIndex:-1,onClick:(V)=>V.stopPropagation(),onPointerDown:(V)=>V.stopPropagation(),children:[E("div",{className:"cm-thread__head",id:_,children:[E("div",{className:"cm-thread__head-row",children:[N("span",{className:"cm-thread__seq","aria-hidden":"true",children:Z}),N("span",{className:"cm-thread__author",children:J.author?.trim()||"unknown"}),N("span",{className:"cm-thread__time",children:_J(J.created)}),N("button",{type:"button",className:"cm-thread__close","aria-label":"Close thread",title:"Close · Esc",onClick:Q,children:"×"})]}),I?N("code",{className:"cm-thread__selector",children:I}):null]}),N("div",{className:"cm-thread__body",children:NJ(J.text)}),(J.thread??[]).map((V)=>E("div",{className:"cm-thread__reply",children:[E("div",{className:"cm-thread__reply-head",children:[N("span",{className:"cm-thread__reply-author",children:V.author?.trim()||"unknown"}),N("span",{className:"cm-thread__reply-time",children:_J(V.created)})]}),N("div",{className:"cm-thread__reply-body",children:NJ(V.body)})]},V.id)),E("div",{className:"cm-thread__reply-form",children:[N(AJ,{textareaRef:q,className:"cm-thread__reply-textarea",value:F,placeholder:"Reply… ⌘↵ to send · @name to tag",onChange:D,onKeyDown:j,rows:2,ariaLabel:"Reply",disabled:K}),N("div",{className:"cm-thread__reply-actions",children:N("button",{type:"button",className:"cm-btn cm-btn--primary",disabled:!F.trim()||K,onClick:()=>void Y(),children:"Send"})})]}),E("div",{className:"cm-thread__actions",children:[J.status==="resolved"?N("button",{type:"button",className:"cm-btn",onClick:()=>$({status:"open"}),children:"↺ Reopen"}):N("button",{type:"button",className:"cm-btn cm-btn--primary",onClick:()=>{$({status:"resolved"}),Q()},children:"✓ Resolve"}),N("button",{type:"button",className:"cm-btn cm-btn--danger",onClick:()=>{z(),Q()},children:"Delete"})]})]})}function NJ(J){if(!J)return null;let Z=/(@[\w][\w.-]*)/g;return J.split(Z).map(($,z)=>{let W=`${z}:${$}`;if(z%2===1)return N("strong",{"data-mention":"true",children:$},W);return N("span",{children:$},W)})}function _J(J){if(!J)return"";let Z=Date.parse(J);if(!Number.isFinite(Z))return"";let Q=Math.round((Date.now()-Z)/1000);if(Q<60)return`${Math.max(Q,0)}s ago`;if(Q<3600)return`${Math.round(Q/60)}m ago`;if(Q<86400)return`${Math.round(Q/3600)}h ago`;return`${Math.round(Q/86400)}d ago`}function VQ(J,Z){if(!J)return Z;let Q=J.match(/data-cd-id="([^"]+)"/);if(Q)return`cd:${Q[1]}`;return J.length>36?`${J.slice(0,33)}…`:J}function zQ(J){let Z=J.selector?s(J.selector,J.index):null;if(Z)return{x:Z.x+Z.w-12,y:Z.y+16};if(J.bounds)return{x:J.bounds.x+J.bounds.w-12,y:J.bounds.y+16};return{x:16,y:16}}function WQ(J){if(J.clientX||J.clientY)return{x:J.clientX,y:J.clientY+8};if(J.selection.selector){let Z=s(J.selection.selector,J.selection.index);if(Z)return{x:Z.x,y:Z.y+Z.h+8}}return{x:16,y:16}}function t(){if(typeof window>"u")return;try{let J=window.location.pathname;if(J==="/_canvas-shell.html"||J==="/_canvas-shell"){let Z=new URLSearchParams(window.location.search),Q=Z.get("canvas")??"",$=(Z.get("designRel")??".design").replace(/^\/+|\/+$/g,"");return Q?`${$}/${Q}`:void 0}return decodeURIComponent(J).replace(/^\//,"")}catch{return}}function e(J){if(!J)return"";return(J.getAttribute("class")??"").trim().split(/\s+/).filter((Z)=>Z&&!Z.startsWith("dgn-")&&!Z.startsWith("dc-cv-")).join(" ")}function BQ(J,Z){if(!J)return"";let Q=(J.innerText||J.textContent||"").replace(/\s+/g," ").trim();return Q.length>Z?`${Q.slice(0,Z-1)}…`:Q}function qQ(J){if(!J)return"";let Z=[],Q=J;while(Q&&Q.nodeType===1&&Z.length<8){let $=Q.getAttribute?.("data-dc-element");if($){Z.unshift(`[data-dc-element="${$}"]`);break}let z=Q.getAttribute?.("data-dc-screen");if(z){Z.unshift(`[data-dc-screen="${z}"]`);break}let W=Q.nodeName.toLowerCase();if(Q.id){W=`#${Q.id}`,Z.unshift(W);break}let U=e(Q).split(/\s+/).filter(Boolean).slice(0,2);if(U.length)W+=`.${U.join(".")}`;let q=1,G=Q.previousElementSibling;while(G)q++,G=G.previousElementSibling;W+=`:nth-child(${q})`,Z.unshift(W),Q=Q.parentElement}return Z.join(" > ")}function GQ(J){let Z=[],Q=J;while(Q&&Q.nodeType===1&&Z.length<8){let $=Q.nodeName.toLowerCase(),z=Q.getAttribute?.("data-dc-element"),W=Q.getAttribute?.("data-dc-screen");if(z)$+=`[data-dc-element="${z}"]`;else if(W)$+=`[data-dc-screen="${W}"]`;else if(Q.id)$+=`#${Q.id}`;let U=e(Q).split(/\s+/).filter(Boolean).slice(0,2);if(U.length&&!z&&!W)$+=`.${U.join(".")}`;Z.unshift($),Q=Q.parentElement}return Z}function UQ(J,Z){return Z?`[data-dc-screen="${Z}"] [data-cd-id="${J}"]`:`[data-cd-id="${J}"]`}function KQ(J,Z,Q){if(!Q)return 0;try{let $=J.querySelectorAll(Z);for(let z=0;z<$.length;z++)if($[z]===Q)return z}catch{}return 0}var OJ=["display","flex-direction","align-items","justify-content","gap","font-family","color","font-size","font-weight","line-height","letter-spacing","text-align","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","width","height","max-width","background-color","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius","border-width","border-style","border-color","box-shadow","opacity"],XQ=/^(style|class|data-cd-id|data-dc-|data-dcid$)/;function YQ(J){if(!J||typeof window>"u"||!window.getComputedStyle)return{authored:{},computed:{},customStyles:{},attrs:{}};try{let Z=J.style,Q=window.getComputedStyle(J),$={},z={},W=new Set(OJ);for(let F of OJ){let D=Z.getPropertyValue(F);if(D)$[F]=D.trim();let K=Q.getPropertyValue(F);if(K)z[F]=K.trim()}let U=/^(margin|padding|border)(-|$)/,q={};for(let F=0;F<Z.length;F++){let D=Z.item(F);if(!D||W.has(D)||U.test(D))continue;let K=Z.getPropertyValue(D);if(K)q[D]=K.trim()}let G={};for(let F of Array.from(J.attributes)){if(XQ.test(F.name))continue;G[F.name]=F.value}return{authored:$,computed:z,customStyles:q,attrs:G}}catch{return{authored:{},computed:{},customStyles:{},attrs:{}}}}function TJ(J,Z){let Q=J.el,$=Q&&Q.getBoundingClientRect?Q.getBoundingClientRect():null,z=J.cdId,W=z?UQ(z,J.artboardId):J.artboardId?`[data-dc-screen="${J.artboardId}"]`:qQ(Q),U=z&&typeof document<"u"?KQ(document,W,Q):0;return{file:Z??t(),id:z??void 0,selector:W,artboardId:J.artboardId,index:U,tag:Q?.tagName.toLowerCase()??"",classes:e(Q),text:BQ(Q,240),dom_path:GQ(Q),bounds:$?{x:Math.round($.left),y:Math.round($.top),w:Math.round($.width),h:Math.round($.height)}:null,html:Q?(Q.outerHTML??"").slice(0,4000):"",...YQ(Q)}}import{useEffect as DQ}from"react";var FQ=new Set(["pen","highlighter","shape","rect","ellipse","arrow","sticky","text","section","eraser"]);function EJ(J){return FQ.has(J)}var JJ=(J)=>!!(J.metaKey||J.ctrlKey);function d(J){if(J.type==="keydown"){if(J.isEditable)return{kind:"no-op"};if(J.metaKey||J.ctrlKey||J.altKey){if(J.key==="Escape")return{kind:"escape"};let Q=(J.key||"").toLowerCase();if(!J.altKey&&(J.metaKey||J.ctrlKey)){if(Q==="z"&&J.shiftKey)return{kind:"redo"};if(Q==="z")return{kind:"undo"};if(Q==="y"&&!J.shiftKey)return{kind:"redo"}}return{kind:"no-op"}}let Z=(J.key||"").toLowerCase();if(Z==="v")return{kind:"tool",tool:"move"};if(Z==="h")return{kind:"tool",tool:"hand"};if(Z==="c")return{kind:"tool",tool:"comment"};if(Z==="b")return{kind:"tool",tool:"pen"};if(Z==="i")return{kind:"tool",tool:"highlighter"};if(Z==="r"||Z==="o")return{kind:"tool",tool:"shape"};if(Z==="a")return{kind:"tool",tool:"arrow"};if(Z==="n")return{kind:"tool",tool:"sticky"};if(Z==="t")return{kind:"tool",tool:"text"};if(Z==="s"&&J.shiftKey)return{kind:"tool",tool:"section"};if(Z==="e")return{kind:"tool",tool:"eraser"};if(J.key==="Escape")return{kind:"escape"};return{kind:"no-op"}}if(J.type==="contextmenu")return{kind:"context-menu",clientX:J.clientX??0,clientY:J.clientY??0};if(J.type==="pointermove"){if(EJ(J.activeTool))return{kind:"no-op"};if(J.activeTool==="hand")return{kind:"no-op"};if(J.activeTool==="comment")return{kind:"hover",deep:!0,clientX:J.clientX??0,clientY:J.clientY??0};if(!JJ(J))return{kind:"no-op"};return{kind:"hover",deep:!0,clientX:J.clientX??0,clientY:J.clientY??0}}if(J.type==="pointerdown"){if(J.button===2)return{kind:"context-menu",clientX:J.clientX??0,clientY:J.clientY??0};if(J.button===1||J.spaceHeld)return{kind:"no-op"};if(J.button!==0)return{kind:"no-op"};if(EJ(J.activeTool)&&!JJ(J))return{kind:"no-op"};if(J.activeTool==="comment")return{kind:"drop-comment",clientX:J.clientX??0,clientY:J.clientY??0};if(J.activeTool==="hand")return{kind:"no-op"};if(!JJ(J))return{kind:"no-op"};return{kind:"select",mode:!!J.shiftKey?"add":"replace",deep:!0,clientX:J.clientX??0,clientY:J.clientY??0}}return{kind:"no-op"}}function HQ(J){if(!J||!J.tagName)return!1;let Z=J,Q=Z.tagName;if(Q==="INPUT"||Q==="TEXTAREA"||Q==="SELECT")return!0;if(Z.isContentEditable)return!0;return!1}function QJ(J){if(!J||!J.closest)return!1;return!!J.closest(".cm-composer, .cm-thread, .cm-mention-popup, .cm-pin")}function wJ(J){let{hostRef:Z,getActiveTool:Q,isSpaceHeld:$,callbacks:z,enabled:W=!0,claimableActions:U}=J;DQ(()=>{if(!W)return;let q=Z.current;if(!q)return;let G=(V)=>U&&V.kind!=="no-op"&&!U.has(V.kind)?{kind:"no-op"}:V,F=(V)=>{switch(V.kind){case"hover":z.onHover?.(V);break;case"select":z.onSelect?.(V);break;case"drop-comment":z.onDropComment?.(V);break;case"context-menu":z.onContextMenu?.(V);break;case"tool":z.onTool?.(V);break;case"escape":z.onEscape?.();break;case"undo":z.onUndo?.();break;case"redo":z.onRedo?.();break;case"no-op":break}},D=(V)=>{let L=G(d({type:"pointermove",button:V.button,metaKey:V.metaKey,ctrlKey:V.ctrlKey,shiftKey:V.shiftKey,altKey:V.altKey,clientX:V.clientX,clientY:V.clientY,spaceHeld:$?.()??!1,activeTool:Q()}));F(L)},K=(V)=>{if(QJ(V.target))return;let L=G(d({type:"pointerdown",button:V.button,metaKey:V.metaKey,ctrlKey:V.ctrlKey,shiftKey:V.shiftKey,altKey:V.altKey,clientX:V.clientX,clientY:V.clientY,spaceHeld:$?.()??!1,activeTool:Q()}));if(L.kind!=="no-op")V.preventDefault(),V.stopImmediatePropagation();F(L)},X=(V)=>{if(QJ(V.target))return;if(G(d({type:"pointerdown",button:V.button,metaKey:V.metaKey,ctrlKey:V.ctrlKey,shiftKey:V.shiftKey,altKey:V.altKey,clientX:V.clientX,clientY:V.clientY,spaceHeld:$?.()??!1,activeTool:Q()})).kind!=="no-op")V.preventDefault(),V.stopImmediatePropagation()},Y=(V)=>{if(QJ(V.target))return;let L=Q(),B=V.metaKey||V.ctrlKey,H=L==="comment"?"drop-comment":L==="move"&&B&&V.button===0?"select":V.button===2?"context-menu":null;if(H&&(!U||U.has(H)))V.preventDefault(),V.stopImmediatePropagation()},j=(V)=>{let L=G(d({type:"contextmenu",clientX:V.clientX,clientY:V.clientY,metaKey:V.metaKey,ctrlKey:V.ctrlKey,shiftKey:V.shiftKey,altKey:V.altKey,activeTool:Q()}));if(L.kind==="no-op")return;V.preventDefault(),V.stopImmediatePropagation(),F(L)},_=(V)=>{let L=G(d({type:"keydown",key:V.key,metaKey:V.metaKey,ctrlKey:V.ctrlKey,shiftKey:V.shiftKey,altKey:V.altKey,isEditable:HQ(V.target),activeTool:Q()}));if(L.kind==="tool"||L.kind==="escape"||L.kind==="undo"||L.kind==="redo")V.preventDefault();F(L)};q.addEventListener("pointermove",D,{passive:!0}),q.addEventListener("pointerdown",K,{capture:!0}),q.addEventListener("mousedown",X,{capture:!0}),q.addEventListener("click",Y,{capture:!0}),q.addEventListener("contextmenu",j,{capture:!0});let I=q.ownerDocument??document;return I.addEventListener("keydown",_,!0),()=>{q.removeEventListener("pointermove",D),q.removeEventListener("pointerdown",K,{capture:!0}),q.removeEventListener("mousedown",X,{capture:!0}),q.removeEventListener("click",Y,{capture:!0}),q.removeEventListener("contextmenu",j,{capture:!0}),I.removeEventListener("keydown",_,!0)}},[W,Z,Q,$,z,U])}function ZJ(J,Z,Q,$){let z=J.elementFromPoint(Z,Q);if(!z)return null;if(z.closest?.(".dc-mm, .dc-zoom-tb, .dc-tool-palette, .dc-context-menu, .dc-cv-group-bbox"))return null;let W=z.closest?.("[data-dc-screen]")??null,U=W?.getAttribute("data-dc-screen")??null,q=z.closest?.(".dc-artboard-body")??null;if(!q){if(W&&U)return{el:W,cdId:null,artboardId:U};return null}if(z===q){if(W&&U)return{el:W,cdId:null,artboardId:U};return null}if($.deep){let X=z.getAttribute?.("data-cd-id")??null;return{el:z,cdId:X,artboardId:U}}let G=z,F=null;while(G&&G!==q){if(G.hasAttribute?.("data-cd-id"))F=G;G=G.parentElement}let D=F??z,K=D.getAttribute?.("data-cd-id")??null;return{el:D,cdId:K,artboardId:U}}import{createContext as OQ,useCallback as WJ,useContext as kJ,useEffect as TQ,useMemo as EQ,useState as BJ}from"react";function R(J,Z,Q,$){return`url("data:image/svg+xml,${encodeURIComponent(J.trim())}") ${Z} ${Q}, ${$}`}var VJ="width='24' height='24' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'",zJ="#1f1f1f",$J="stroke='#ffffff' stroke-linejoin='round' stroke-linecap='round'";function C(J,Z,Q){let $=Q?`<g transform='${Q}'>`:"";return`<svg ${VJ}>${$}<path fill='#ffffff' d='${J}'/><path fill='${zJ}' d='${Z}'/>${Q?"</g>":""}</svg>`}var yJ="translate(0,32) scale(1,-1)",PQ=R(C("M10.25 8.25 L10.05 8.65 10 9 10 23.1 10.05 23.4 10.25 23.75 10.8 24 11.45 23.85 11.6 23.7 11.75 23.45 14.65 19.8 14.85 19.65 14.95 19.5 15.4 19.2 15.95 19.1 21.05 19.1 21.2 19.1 21.35 19.05 21.65 18.9 21.9 18.6 22 18.3 22 17.9 21.9 17.65 21.75 17.35 21.65 17.3 21.55 17.15 11.5 8.25 11.25 8.05 10.95 8 10.6 8.05 10.25 8.25 M9.15 6.6 L9.7 6.25 10 6.15 10.95 6 11.9 6.15 13 6.9 22.9 15.65 23 15.8 23.2 15.95 23.75 16.75 24 17.9 24 18.3 23.9 18.95 23.8 19.25 23.6 19.7 23.1 20.35 22.75 20.6 22.1 20.9 22.05 20.95 22 20.95 21.2 21.1 21.05 21.1 16.2 21.1 16.1 21.25 16.05 21.25 13.4 24.6 13.05 25.15 12.9 25.3 12.55 25.55 Q11.6 26.15 10.55 26 L10.5 26 Q9.65 25.85 9 25.3 L8.45 24.65 8.4 24.5 8.15 24.05 8 23.1 8 9 Q8 8.45 8.15 8.05 L8.25 7.75 8.45 7.35 9.15 6.6","M10.25 8.25 L10.6 8.05 10.95 8 11.25 8.05 11.5 8.25 21.55 17.15 21.65 17.3 21.75 17.35 21.9 17.65 22 17.9 22 18.3 21.9 18.6 21.65 18.9 21.35 19.05 21.2 19.1 21.05 19.1 15.95 19.1 15.4 19.2 14.95 19.5 14.85 19.65 14.65 19.8 11.75 23.45 11.6 23.7 11.45 23.85 10.8 24 10.25 23.75 10.05 23.4 10 23.1 10 9 10.05 8.65 10.25 8.25"),8,5,"default"),LQ=R(C("M28.55 17.8 Q29.4 20.3 28.75 22.8 L28.7 23 28.15 24.55 28.05 24.75 Q26.4 28.2 22.75 29.4 L22.45 29.5 18 29.9 17.75 29.85 Q15.8 29.25 13.8 28.1 L13.45 27.95 Q12 27.05 10.35 26.8 L10.25 26.75 7.9 26.7 7.8 26.7 Q6.1 26.9 4.8 25.8 L4.75 25.8 4.65 25.7 4.6 25.65 Q3.25 24.5 3.05 22.85 L3 22.75 Q2.8 20.95 4 19.5 5.05 18.15 6.75 17.95 L8.4 17.9 7.5 15.55 7.3 15.2 7.2 15 5 10.95 Q3.9 9.15 4.3 7.75 L4.4 7.5 Q4.75 6.15 6.45 5.2 9 3.65 11 5 11.05 4.1 11.5 3.45 12.15 2.1 14.2 1.6 L14.35 1.6 Q18.05 0.6 19.6 4.4 L19.65 4.55 Q20.75 3.65 22.7 3.75 L22.75 3.75 Q26.75 4 27 8.15 L27 8.25 27 8.35 27 8.45 Q26.9 10.75 27.1 12.6 27.15 14.65 28.2 16.75 L28.55 17.8 M26.65 18.4 L26.1 16.8 26.1 16.85 Q24.8 13.7 25 8.35 L25 8.25 Q24.85 5.9 22.6 5.75 20.7 5.65 20.4 7.35 L20.1 7.95 19.5 8.2 18.85 8.05 18.45 7.5 17.75 5.15 Q16.85 2.95 14.7 3.55 L14.65 3.55 Q12.55 4.05 13.15 6.15 L13.85 8.75 13.75 9.45 13.25 9.95 12.55 9.95 12 9.55 10.9 7.7 Q9.5 5.7 7.45 6.9 6.5 7.45 6.25 8.15 6.1 8.9 6.7 9.85 9.2 13.9 10.8 18.65 L10.8 19.3 10.4 19.8 9.75 19.95 Q8.35 19.8 6.95 19.95 6.1 20.05 5.55 20.75 4.9 21.55 5 22.55 5.15 23.55 6 24.2 L6.05 24.25 Q6.75 24.85 7.65 24.7 L7.7 24.7 10.65 24.8 Q12.7 25.15 14.45 26.2 L14.5 26.2 Q16.4 27.35 18.3 27.9 L22.05 27.5 22.1 27.5 Q24.95 26.55 26.25 23.85 L26.8 22.3 Q27.3 20.35 26.65 18.4","M26.65 18.4 Q27.3 20.35 26.8 22.3 L26.25 23.85 Q24.95 26.55 22.1 27.5 L22.05 27.5 18.3 27.9 Q16.4 27.35 14.5 26.2 L14.45 26.2 Q12.7 25.15 10.65 24.8 L7.7 24.7 7.65 24.7 Q6.75 24.85 6.05 24.25 L6 24.2 Q5.15 23.55 5 22.55 4.9 21.55 5.55 20.75 6.1 20.05 6.95 19.95 8.35 19.8 9.75 19.95 L10.4 19.8 10.8 19.3 10.8 18.65 Q9.2 13.9 6.7 9.85 6.1 8.9 6.25 8.15 6.5 7.45 7.45 6.9 9.5 5.7 10.9 7.7 L12 9.55 12.55 9.95 13.25 9.95 13.75 9.45 13.85 8.75 13.15 6.15 Q12.55 4.05 14.65 3.55 L14.7 3.55 Q16.85 2.95 17.75 5.15 L18.45 7.5 18.85 8.05 19.5 8.2 20.1 7.95 20.4 7.35 Q20.7 5.65 22.6 5.75 24.85 5.9 25 8.25 L25 8.35 Q24.8 13.7 26.1 16.85 L26.1 16.8 26.65 18.4"),12,12,"grab"),MQ=R(C("M28 14 Q28 9.85 24.45 6.9 20.95 4 16 4 11.05 4 7.5 6.9 L7.45 7 Q4 9.9 4 14 4 18.15 7.55 21.05 L7.5 21.05 Q9.2 22.45 11.2 23.2 L15.3 27.3 16 27.6 16.7 27.3 20.85 23.2 Q22.7 22.45 24.3 21.15 L24.45 21.05 Q28 18.15 28 14 M25.75 5.35 Q30.05 8.95 30 14 30.05 19.05 25.75 22.6 L25.4 22.85 Q23.8 24.1 22 24.9 L18.1 28.75 18.15 28.75 Q17.2 29.6 16 29.6 14.8 29.6 13.85 28.75 L13.9 28.75 10 24.9 6.6 22.85 6.25 22.6 Q1.95 19.05 2 14 1.95 8.95 6.25 5.35 10.3 2 16 2 21.7 2 25.75 5.35","M28 14 Q28 18.15 24.45 21.05 L24.3 21.15 Q22.7 22.45 20.85 23.2 L16.7 27.3 16 27.6 15.3 27.3 11.2 23.2 Q9.2 22.45 7.5 21.05 L7.55 21.05 Q4 18.15 4 14 4 9.9 7.45 7 L7.5 6.9 Q11.05 4 16 4 20.95 4 24.45 6.9 28 9.85 28 14"),12,21,"crosshair"),jQ=R(C("M4 13.1 L4 6 Q4 5.15 4.6 4.6 5.15 4 6 4 L13.1 4 Q13.95 4 14.55 4.6 L28.65 18.75 Q29.8 19.9 29.75 21.45 L29.75 21.6 29.75 21.7 Q29.75 23.2 28.7 24.35 L24.45 28.65 24.35 28.75 Q23.15 29.85 21.65 29.8 L21.55 29.8 21.4 29.8 Q20.2 29.8 19.25 29.15 L18 29.35 Q16.6 29.4 15.25 28 L15.2 27.95 8.2 20.95 Q7.6 20.35 7.6 19.55 7.6 18.7 8.2 18.1 L4.6 14.5 Q4 13.9 4 13.1 M19.5 26.65 L20.1 27.25 Q20.7 27.85 21.5 27.8 22.35 27.85 23 27.25 L27.25 22.95 Q27.8 22.35 27.75 21.55 27.8 20.75 27.2 20.15 L13.1 6 6 6 6 13.1 12.35 19.45 9.6 19.5 16.65 26.55 Q18.05 28.05 19.5 26.65 M8.05 12.3 L8 8 12.25 8.05 13.8 9.6 9.6 13.85 8.05 12.3 M15.25 11.05 L23 18.8 18.8 23.05 11.05 15.3 15.25 11.05","M15.25 11.05 L11.05 15.3 18.8 23.05 23 18.8 15.25 11.05 M12.35 19.45 L6 13.1 6 6 13.1 6 27.2 20.15 Q27.8 20.75 27.75 21.55 27.8 22.35 27.25 22.95 L23 27.25 Q22.35 27.85 21.5 27.8 20.7 27.85 20.1 27.25 L19.5 26.65 12.35 19.45 M8.05 12.3 L9.6 13.85 13.8 9.6 12.25 8.05 8 8 8.05 12.3",yJ),6,18,"crosshair"),NQ=R(C("M5.15 10.85 Q4 9.65 4 8.1 L4 7.95 4 7.85 Q3.95 6.2 5.1 5.15 6.25 4 7.85 4 L7.95 4 8.1 4 Q9.65 4 10.85 5.15 L11 5.3 14.3 5.25 Q15.15 5.25 15.75 5.85 L29.9 20 Q31 21.15 31 22.75 L31 22.85 31 23 Q31.05 24.5 29.9 25.7 L29.55 25.95 25.65 29.9 25.65 29.95 Q24.45 31.1 22.75 31.1 21.2 31.15 20 29.95 L5.85 15.8 Q5.25 15.2 5.25 14.35 L5.25 10.95 5.15 10.85 M19.95 24.2 L18.55 22.8 22.8 18.55 24.2 19.95 19.95 24.2 M28.45 21.4 L14.3 7.25 10.15 7.3 9.4 6.55 Q8.8 5.95 7.95 6 7.1 5.95 6.5 6.55 5.95 7.1 6 7.95 5.95 8.8 6.55 9.4 L7.25 10.1 7.25 14.35 21.4 28.5 Q22 29.1 22.75 29.1 23.6 29.1 24.2 28.5 L28.45 24.25 Q29.05 23.65 29 22.85 29.05 22 28.45 21.4 M9.25 13.5 L9.25 9.3 13.5 9.25 14.3 10.05 10.05 14.3 9.25 13.5 M17.15 21.4 L11.5 15.75 15.75 11.5 21.4 17.15 17.15 21.4","M17.15 21.4 L21.4 17.15 15.75 11.5 11.5 15.75 17.15 21.4 M28.45 21.4 Q29.05 22 29 22.85 29.05 23.65 28.45 24.25 L24.2 28.5 Q23.6 29.1 22.75 29.1 22 29.1 21.4 28.5 L7.25 14.35 7.25 10.1 6.55 9.4 Q5.95 8.8 6 7.95 5.95 7.1 6.5 6.55 7.1 5.95 7.95 6 8.8 5.95 9.4 6.55 L10.15 7.3 14.3 7.25 28.45 21.4 M19.95 24.2 L24.2 19.95 22.8 18.55 18.55 22.8 19.95 24.2 M9.25 13.5 L10.05 14.3 14.3 10.05 13.5 9.25 9.25 9.3 9.25 13.5",yJ),6,18,"crosshair"),r=R(C("M17 2 Q18.2 2 19.15 2.9 20 3.8 20 5 L20 12 27 12 Q28.2 12 29.15 12.9 30 13.8 30 15 L30 17 Q30 18.2 29.15 19.15 28.2 20 27 20 L20 20 20 27 Q20 28.2 19.15 29.15 18.2 30 17 30 L15 30 Q13.8 30 12.9 29.15 12 28.2 12 27 L12 20 5 20 Q3.8 20 2.9 19.15 2 18.2 2 17 L2 15 Q2 13.8 2.9 12.9 3.8 12 5 12 L12 12 12 5 Q12 3.8 12.9 2.9 13.8 2 15 2 L17 2 M14 27 L14.3 27.7 Q14.6 28 15 28 L17 28 17.7 27.7 18 27 18 18.05 18.05 18 27 18 Q27.4 18 27.7 17.7 L28 17 28 15 27.7 14.3 Q27.4 14 27 14 L18 14 18 5 17.7 4.3 17 4 15 4 Q14.6 4 14.3 4.3 14 4.6 14 5 L14 14 5 14 Q4.6 14 4.3 14.3 4 14.6 4 15 L4 17 Q4 17.4 4.3 17.7 4.6 18 5 18 L14 18 14 27","M14 27 L14 18 5 18 Q4.6 18 4.3 17.7 4 17.4 4 17 L4 15 Q4 14.6 4.3 14.3 4.6 14 5 14 L14 14 14 5 Q14 4.6 14.3 4.3 14.6 4 15 4 L17 4 17.7 4.3 18 5 18 14 27 14 Q27.4 14 27.7 14.3 L28 15 28 17 27.7 17.7 Q27.4 18 27 18 L18.05 18 18 18.05 18 27 17.7 27.7 17 28 15 28 Q14.6 28 14.3 27.7 L14 27"),12,12,"crosshair"),_Q=R(C("M3.9 11.35 Q2.3 12.5 3.7 13.9 L16.4 26.65 Q17.85 28.05 19.45 26.9 L27.65 21.15 Q29.3 20 27.85 18.6 L15.15 5.85 Q13.75 4.45 12.1 5.6 L3.9 11.35 M1.05 12.4 Q1 10.95 2.75 9.75 L10.95 4 10.95 3.95 Q14 1.85 16.6 4.45 L29.3 17.2 Q30.8 18.65 30.55 20.1 30.55 21.55 28.8 22.8 L20.6 28.55 20.65 28.55 Q17.7 30.65 15 28.1 L15 28.05 2.3 15.3 2.3 15.35 Q0.8 13.85 1.05 12.4 M13.5 7 L19.85 13.35 11.65 19.15 5.3 12.75 13.5 7","M13.5 7 L5.3 12.75 11.65 19.15 19.85 13.35 13.5 7 M3.9 11.35 L12.1 5.6 Q13.75 4.45 15.15 5.85 L27.85 18.6 Q29.3 20 27.65 21.15 L19.45 26.9 Q17.85 28.05 16.4 26.65 L3.7 13.9 Q2.3 12.5 3.9 11.35"),6,14,"cell"),IQ=R(`<svg ${VJ}><path d='M16 4V28M11 4H21M11 28H21' fill='none' ${$J} stroke-width='5'/><path d='M16 4V28M11 4H21M11 28H21' fill='none' stroke='${zJ}' stroke-width='2.25' stroke-linecap='round'/></svg>`,12,12,"text"),AQ=R(`<svg ${VJ}><path d='M6 5H21L26 10V27H6Z' fill='${zJ}' ${$J} stroke-width='2.5'/><path d='M21 5V11H26' fill='none' ${$J} stroke-width='2.25'/></svg>`,5,5,"crosshair"),w=Object.freeze({move:PQ,hand:LQ,comment:MQ,pen:jQ,section:r,highlighter:NQ,shape:r,rect:r,ellipse:r,sticky:AQ,arrow:r,text:IQ,eraser:_Q});import{jsx as qJ,Fragment as kQ}from"react/jsx-runtime";var wQ=Object.freeze([{id:"move",label:"Move",shortcut:"V",cursor:w.move},{id:"hand",label:"Hand",shortcut:"H",cursor:w.hand},{id:"comment",label:"Comment",shortcut:"C",cursor:w.comment},{id:"pen",label:"Pen",shortcut:"B",cursor:w.pen},{id:"highlighter",label:"Highlighter",shortcut:"I",cursor:w.highlighter},{id:"shape",label:"Shape",shortcut:"R",cursor:w.shape},{id:"sticky",label:"Sticky",shortcut:"N",cursor:w.sticky},{id:"section",label:"Section",shortcut:"⇧S",cursor:w.shape},{id:"arrow",label:"Arrow",shortcut:"A",cursor:w.arrow},{id:"text",label:"Text",shortcut:"T",cursor:w.text},{id:"eraser",label:"Eraser",shortcut:"E",cursor:w.eraser}]),GJ=OQ(null);function yQ({children:J,tools:Z=wQ,initial:Q="move"}){let[$,z]=BJ(Q),[W,U]=BJ(()=>({tool:null,locked:!1})),q=WJ((Y)=>{z(Y),U((j)=>j.locked&&j.tool===Y?j:{tool:null,locked:!1})},[]),G=WJ((Y)=>{U((j)=>{if(j.locked&&j.tool===Y)return{tool:null,locked:!1};return{tool:Y,locked:!0}}),z(Y)},[]),F=WJ(()=>{U({tool:null,locked:!1})},[]),[D,K]=BJ("rounded");TQ(()=>{if(typeof document>"u")return;let Y=Z.find((I)=>I.id===$);if(!Y)return;let j=document.body.style.cursor;document.body.style.cursor=Y.cursor;let _=document.getElementById("dc-tool-cursor");if(!_)_=document.createElement("style"),_.id="dc-tool-cursor",document.head.appendChild(_);if(_.textContent=`* { cursor: ${Y.cursor} !important; }`,typeof window<"u"&&window.parent&&window.parent!==window)try{window.parent.postMessage({dgn:"tool-cursor",tool:$},"*")}catch{}return()=>{document.body.style.cursor=j;let I=document.getElementById("dc-tool-cursor");if(I)I.textContent=""}},[$,Z]);let X=EQ(()=>({tool:$,setTool:q,tools:Z,sticky:W,toggleSticky:G,clearSticky:F,shapeKind:D,setShapeKind:K}),[$,q,Z,W,G,F,D]);return qJ(GJ.Provider,{value:X,children:J})}function bJ({children:J}){if(kJ(GJ))return qJ(kQ,{children:J});return qJ(yQ,{children:J})}function xJ(){let J=kJ(GJ);if(!J)throw Error("useToolMode must be used inside <ToolProvider>");return J}import{jsx as YJ,jsxs as uQ}from"react/jsx-runtime";var gQ=new Set(["drop-comment","tool","escape","hover"]);function XJ(){return typeof document<"u"&&!document.querySelector(".dc-canvas")}function gJ(J,Z){if(typeof document>"u")return null;let Q=document.elementFromPoint(J,Z);if(!Q)return null;if(Q.closest(".cm-composer, .cm-thread, .cm-mention-popup, .cm-pin, [data-mc-hover-halo]"))return null;let $=Q.tagName;if($==="HTML"||$==="BODY")return null;return Q}function CQ({children:J,file:Z}){let{tool:Q,setTool:$}=xJ(),z=LJ(),W=S(null),[U,q]=KJ(null),G=S(Q);G.current=Q;let F=vQ(()=>()=>G.current,[]);return p(()=>{if(Q!=="comment")q(null)},[Q]),p(()=>{let D=W.current;if(D)D.setAttribute("data-active-tool",Q);if(typeof document<"u"&&document.body)document.body.setAttribute("data-active-tool",Q);return()=>{D?.removeAttribute("data-active-tool")}},[Q]),p(()=>{if(typeof window>"u")return;let D=(K)=>{let X=K.data;if(!X||typeof X!=="object"||X.dgn!=="tool-set")return;if(typeof X.tool==="string")$(X.tool)};return window.addEventListener("message",D),()=>window.removeEventListener("message",D)},[$]),wJ({hostRef:W,getActiveTool:F,claimableActions:gQ,callbacks:{onHover:({clientX:D,clientY:K})=>{if(G.current!=="comment"||!XJ()){q(null);return}let X=gJ(D,K);q((Y)=>Y===X?Y:X)},onTool:({tool:D})=>$(D),onEscape:()=>{if(G.current!=="move")$("move");if(q(null),z.clear(),typeof window<"u")try{window.parent.postMessage({dgn:"force-clear"},"*")}catch{}},onDropComment:({clientX:D,clientY:K})=>hQ(D,K,z,Z)}}),uQ("div",{"data-mc-host":!0,ref:W,style:{display:"contents"},children:[J,U?YJ(SQ,{el:U}):null,YJ(IJ,{})]})}function SQ({el:J}){let Z=S(null),Q=S(J);Q.current=J;let $=S(null);return p(()=>{let z=()=>{$.current=null;let W=Z.current,U=Q.current;if(W&&U?.isConnected){let q=U.getBoundingClientRect();if(q.width===0&&q.height===0)W.style.display="none";else W.style.display="block",W.style.left=`${Math.round(q.left)}px`,W.style.top=`${Math.round(q.top)}px`,W.style.width=`${Math.round(q.width)}px`,W.style.height=`${Math.round(q.height)}px`}else if(W)W.style.display="none";$.current=requestAnimationFrame(z)};return $.current=requestAnimationFrame(z),()=>{if($.current!=null)cancelAnimationFrame($.current)}},[]),YJ("div",{ref:Z,"aria-hidden":"true","data-mc-hover-halo":"",style:{position:"fixed",display:"none",pointerEvents:"none",zIndex:2147483646,border:"2px solid var(--maude-hud-accent, #d63b1f)",borderRadius:"3px",boxSizing:"border-box"}})}function hQ(J,Z,Q,$){if(typeof document>"u")return;let z=ZJ(document,J,Z,{deep:!0});if(!z)z=ZJ(document,J,Z,{deep:!1});if(!z&&!XJ()&&typeof document.elementsFromPoint==="function"){let U=document.elementsFromPoint(J,Z);for(let q of U){let G=q.closest?.("[data-cd-id]");if(!G)continue;if(!G.closest(".dc-artboard-body"))continue;let F=G.closest("[data-dc-screen]");z={el:G,cdId:G.getAttribute("data-cd-id"),artboardId:F?.getAttribute("data-dc-screen")??null};break}}if(!z&&XJ()){let U=gJ(J,Z);if(U)z={el:U,cdId:U.getAttribute("data-cd-id"),artboardId:null}}if(!z){let U={file:$,id:void 0,selector:"",artboardId:null,tag:"",classes:"",text:"",dom_path:[],bounds:{x:J-12,y:Z-12,w:24,h:24},html:""};vJ(U,J,Z);return}let W=TJ(z,$);Q.replace(W),vJ(W,J,Z)}function vJ(J,Z,Q){if(typeof document<"u")try{document.dispatchEvent(new CustomEvent("cm:open-composer",{detail:{selection:J,clientX:Z,clientY:Q}}))}catch{}if(typeof window<"u")try{window.parent.postMessage({dgn:"comment-compose",selection:J},"*")}catch{}}function CJ(J,Z){return k(bJ,null,k(PJ,null,k(CQ,{file:Z},k(J))))}function kZ(J,Z){let Q=RQ(Z.rootEl);if(!Z.commentsEnabled){Q.render(k(J));return}let $=Z.file??t();Q.render(k(mQ,{initialCanvas:J,file:$}))}var RJ="__maudeCanvasRuntime";function fQ({Canvas:J,file:Z,onOk:Q}){return p(()=>{Q()},[]),CJ(J,Z)}class SJ extends bQ{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(){this.props.onError()}componentDidUpdate(J){if(J.attempt!==this.props.attempt&&this.state.hasError)this.setState({hasError:!1})}render(){if(this.state.hasError)return this.props.fallback();return this.props.children}}function pQ({message:J}){return k("div",{className:"dc-hmr-holding",role:"status","aria-live":"polite",title:J?`Holding last working render — ${J}`:"Holding last working render"},"⏸ build error — držím poslední funkční verzi")}function mQ({initialCanvas:J,file:Z}){let[{canvas:Q,attempt:$},z]=KJ({canvas:J,attempt:0}),[W,U]=KJ({on:!1}),q=S(null),G=S(Q);G.current=Q,p(()=>{let X={remount:(Y)=>z((j)=>({canvas:Y,attempt:j.attempt+1})),setHolding:(Y,j)=>U(Y?{on:!0,message:j}:{on:!1})};return window[RJ]=X,()=>{window[RJ]=void 0}},[]);let F=UJ(()=>{q.current=G.current,U((X)=>X.on?{on:!1}:X)},[]),D=UJ(()=>{U({on:!0,message:"render error"})},[]),K=UJ(()=>{let X=q.current;return X?CJ(X,Z):null},[Z]);return k(xQ,null,k(SJ,{attempt:$,onError:D,fallback:K},k(fQ,{key:$,Canvas:Q,file:Z,onOk:F})),W.on?k(pQ,{message:W.message}):null)}export{kZ as mountCanvas,SJ as CanvasErrorBoundary};
1
+ import{Component as _0,createElement as h,Fragment as A0,useCallback as k7,useEffect as p,useMemo as I0,useRef as u,useState as $7}from"react";import{createRoot as O0}from"react-dom/client";import{useCallback as E,useEffect as S,useMemo as s,useRef as g,useState as m}from"react";function z7(){if(typeof window>"u")return;try{let Q=window.location.pathname;if(Q==="/_canvas-shell.html"||Q==="/_canvas-shell"){let $=new URLSearchParams(window.location.search),J=$.get("canvas")??"",V=($.get("designRel")??".design").replace(/^\/+|\/+$/g,"");return J?`${V}/${J}`:void 0}return decodeURIComponent(Q).replace(/^\//,"")}catch{return}}function Z7(Q){if(!Q)return"";return(Q.getAttribute("class")??"").trim().split(/\s+/).filter(($)=>$&&!$.startsWith("dgn-")&&!$.startsWith("dc-cv-")).join(" ")}function FQ(Q,$){if(!Q)return"";let J=(Q.innerText||Q.textContent||"").replace(/\s+/g," ").trim();return J.length>$?`${J.slice(0,$-1)}…`:J}function DQ(Q){if(!Q)return"";let $=[],J=Q;while(J&&J.nodeType===1&&$.length<8){let V=J.getAttribute?.("data-dc-element");if(V){$.unshift(`[data-dc-element="${V}"]`);break}let q=J.getAttribute?.("data-dc-screen");if(q){$.unshift(`[data-dc-screen="${q}"]`);break}let B=J.nodeName.toLowerCase();if(J.id){B=`#${J.id}`,$.unshift(B);break}let K=Z7(J).split(/\s+/).filter(Boolean).slice(0,2);if(K.length)B+=`.${K.join(".")}`;let X=1,F=J.previousElementSibling;while(F)X++,F=F.previousElementSibling;B+=`:nth-child(${X})`,$.unshift(B),J=J.parentElement}return $.join(" > ")}function C7(Q){let $=[],J=Q;while(J&&J.nodeType===1&&$.length<8){let V=J.nodeName.toLowerCase(),q=J.getAttribute?.("data-dc-element"),B=J.getAttribute?.("data-dc-screen");if(q)V+=`[data-dc-element="${q}"]`;else if(B)V+=`[data-dc-screen="${B}"]`;else if(J.id)V+=`#${J.id}`;let K=Z7(J).split(/\s+/).filter(Boolean).slice(0,2);if(K.length&&!q&&!B)V+=`.${K.join(".")}`;$.unshift(V),J=J.parentElement}return $}function LQ(Q){return Q.replace(/[^a-zA-Z0-9_-]/g,($)=>`\\${$}`)}function v7(Q,$){return $?`[data-dc-screen="${$}"] [data-cd-id="${Q}"]`:`[data-cd-id="${Q}"]`}function R7(Q,$,J){if(!J)return 0;try{let V=Q.querySelectorAll($);for(let q=0;q<V.length;q++)if(V[q]===J)return q}catch{}return 0}function S7(Q,$,J){if(!$||!J)return 0;return R7(Q,`[data-cd-id="${LQ($)}"]`,J)}function X7(Q,$){let J=(V)=>{try{let q=Q.querySelectorAll(V);if(!q.length)return null;let B=$.index&&$.index>0&&$.index<q.length?$.index:0;return q[B]??q[0]}catch{return null}};if($.id){let V=J(v7($.id,$.artboardId));if(V)return V}if($.selector)return J($.selector);return null}function PQ(Q,$){let J=0,V=Math.min(Q.length,$.length);for(let q=1;q<=V;q++){if(Q[Q.length-q]!==$[$.length-q])break;J++}return J}function g7(Q,$){let J=$.dom_path,V=($.tag||"").toLowerCase();if(!J||J.length===0||!V)return null;let q=Q;if($.artboardId){let F=Q.querySelector(`[data-dc-screen="${$.artboardId}"]`);if(F)q=F}let B=($.classes||"").split(/\s+/).filter(Boolean),K=null,X=0;for(let F of Array.from(q.querySelectorAll("[data-cd-id]"))){if(F.tagName.toLowerCase()!==V)continue;let j=PQ(C7(F),J);if(j===0)continue;let N=Z7(F).split(/\s+/).filter(Boolean),U=B.filter((H)=>N.includes(H)).length,G=j*10+U;if(G>X)X=G,K=F}return K}var x7=["display","flex-direction","flex-wrap","align-items","justify-content","gap","flex","flex-grow","flex-shrink","flex-basis","align-self","font-family","color","font-size","font-weight","line-height","letter-spacing","text-align","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","width","height","min-width","min-height","max-width","max-height","background-color","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius","border-width","border-style","border-color","box-shadow","opacity","position","top","right","bottom","left","z-index","transform","transform-origin","font-style","text-transform","text-decoration","white-space","overflow","object-fit","aspect-ratio","object-position"],jQ=/^(style|class|data-cd-id|data-dc-|data-dcid$)/;function MQ(Q){if(!Q||typeof window>"u"||!window.getComputedStyle)return{authored:{},computed:{},customStyles:{},attrs:{}};try{let $=Q.style,J=window.getComputedStyle(Q),V={},q={},B=new Set(x7);for(let G of x7){let H=$.getPropertyValue(G);if(H)V[G]=H.trim();let Y=J.getPropertyValue(G);if(Y)q[G]=Y.trim()}let K=/^(margin|padding|border)(-|$)/,X={};for(let G=0;G<$.length;G++){let H=$.item(G);if(!H||B.has(H)||K.test(H))continue;let Y=$.getPropertyValue(H);if(Y)X[H]=Y.trim()}let F={};for(let G of Array.from(Q.attributes)){if(jQ.test(G.name))continue;F[G.name]=G.value}let j=Q.parentElement,N=j?window.getComputedStyle(j).display:"",U=j&&(N==="flex"||N==="inline-flex")?window.getComputedStyle(j).flexDirection:"";return{authored:V,computed:q,customStyles:X,attrs:F,parentDisplay:N,parentFlexDirection:U}}catch{return{authored:{},computed:{},customStyles:{},attrs:{}}}}function Y7(Q,$){let J=Q.el,V=J&&J.getBoundingClientRect?J.getBoundingClientRect():null,q=Q.cdId,B=q?v7(q,Q.artboardId):Q.artboardId?`[data-dc-screen="${Q.artboardId}"]`:DQ(J),K=q&&typeof document<"u"?R7(document,B,J):0;return{file:$??z7(),id:q??void 0,selector:B,artboardId:Q.artboardId,index:K,tag:J?.tagName.toLowerCase()??"",classes:Z7(J),text:FQ(J,240),dom_path:C7(J),bounds:V?{x:Math.round(V.left),y:Math.round(V.top),w:Math.round(V.width),h:Math.round(V.height)}:null,worldW:J instanceof HTMLElement?Math.round(J.offsetWidth):void 0,worldH:J instanceof HTMLElement?Math.round(J.offsetHeight):void 0,html:J?(J.outerHTML??"").slice(0,4000):"",...MQ(J)}}import*as H7 from"lib0/decoding";import*as a from"lib0/encoding";import{createContext as NQ,useCallback as h0,useContext as _Q,useEffect as f0,useMemo as p0,useReducer as u0,useRef as m0,useState as d0}from"react";import{Awareness as c0,applyAwarenessUpdate as l0,encodeAwarenessUpdate as r0}from"y-protocols/awareness";import{readSyncMessage as o0,writeSyncStep1 as a0,writeUpdate as s0}from"y-protocols/sync";import*as AQ from"yjs";import{jsx as e0}from"react/jsx-runtime";var IQ=NQ(null);function h7(){return _Q(IQ)}import{createContext as OQ,useCallback as l,useContext as D7,useEffect as TQ,useMemo as EQ,useRef as kQ,useState as wQ}from"react";import{jsx as F7,Fragment as xQ}from"react/jsx-runtime";var q7=OQ(null);function r(Q){return Q.id?`id:${Q.id}`:`sel:${Q.selector}`}function f7(Q){let $=[],J=new Set;for(let V of Q){let q=r(V);if(J.has(q))continue;J.add(q),$.push(V)}return $}var yQ=50;function bQ({children:Q,postTarget:$}){let[J,V]=wQ([]),q=kQ(null),B=l((G)=>{if(q.current)clearTimeout(q.current);q.current=setTimeout(()=>{q.current=null;let H=$??(typeof window<"u"?window.parent:null);if(!H)return;let Y=G.length===0?null:G.length===1?G[0]??null:G;try{H.postMessage({dgn:"select-set",selection:Y},"*")}catch{}},yQ)},[$]);TQ(()=>()=>{if(q.current)clearTimeout(q.current)},[]);let K=l((G)=>{let H=f7(Array.isArray(G)?G:[G]);V(H),B(H)},[B]),X=l((G)=>{let H=Array.isArray(G)?G:[G];V((Y)=>{let L=f7([...Y,...H]);return B(L),L})},[B]),F=l((G)=>{let H=r(G);V((Y)=>{let L=Y.filter((_)=>r(_)!==H);return B(L),L})},[B]),j=l((G)=>{let H=r(G);V((Y)=>{let L=Y.some((_)=>r(_)===H)?Y.filter((_)=>r(_)!==H):[...Y,G];return B(L),L})},[B]),N=l(()=>{V([]),B([])},[B]),U=EQ(()=>({selected:J,replace:K,add:X,remove:F,toggle:j,clear:N}),[J,K,X,F,j,N]);return F7(q7.Provider,{value:U,children:Q})}function p7({children:Q}){if(D7(q7))return F7(xQ,{children:Q});return F7(bQ,{children:Q})}function B7(){let Q=D7(q7);if(!Q)throw Error("useSelectionSet must be used inside <SelectionSetProvider>");return Q}function u7(){return D7(q7)}import{jsx as O,jsxs as k}from"react/jsx-runtime";var CQ="/_client/comments-overlay.css";function vQ(){if(typeof document>"u")return;if(document.getElementById("cm-overlay-css"))return;let Q=document.createElement("link");Q.id="cm-overlay-css",Q.rel="stylesheet",Q.href=CQ,document.head.appendChild(Q)}function RQ(){if(typeof window>"u")return null;try{let Q=window.location.pathname;if(Q==="/_canvas-shell.html"||Q==="/_canvas-shell"){let $=new URLSearchParams(window.location.search),J=$.get("canvas")??"",V=($.get("designRel")??".design").replace(/^\/+|\/+$/g,"");return J?`${V}/${J}`:null}return decodeURIComponent(Q).replace(/^\//,"")}catch{return null}}function SQ(Q){if(!Q.selector)return null;let $=null;try{let J=document.querySelectorAll(Q.selector),V=Q.index&&Q.index>0&&Q.index<J.length?Q.index:0;$=J[V]??J[0]??null}catch{$=null}if($&&Q.tag&&$.tagName.toLowerCase()!==Q.tag.toLowerCase())$=null;if(!$&&Q.dom_path?.length){let J=Q.selector.match(/data-dc-screen="([^"]+)"/)?.[1];$=g7(document,{artboardId:J,tag:Q.tag,classes:Q.classes,dom_path:Q.dom_path})}return $}function P7(Q){let $=SQ(Q);if(!$?.isConnected)return null;let J=$.getBoundingClientRect();if(J.width===0&&J.height===0)return null;return{x:J.left,y:J.top,w:J.width,h:J.height}}function c7(Q,$){let V=typeof window<"u"?window.innerWidth:Q.x+$.w,q=typeof window<"u"?window.innerHeight:Q.y+$.h,B=Q.x;if(B+$.w+8>V){let X=Q.x-$.w;B=X>=8?X:Math.max(8,V-$.w-8)}let K=Q.y;if(K+$.h+8>q){let X=Q.y-$.h;K=X>=8?X:Math.max(8,q-$.h-8)}return{x:B,y:K}}function l7(){vQ();let Q=u7(),[$,J]=m([]),[V,q]=m(null),[B,K]=m(null),X=s(()=>RQ(),[]);S(()=>{if(typeof document>"u")return;let W=document.getElementById("dgn-pin-layer");if(!W)return;let D=W.style.display;return W.style.display="none",()=>{W.style.display=D}},[]);let F=E((W)=>{if(!Q)return;if(!W?.selector){Q.clear();return}let D=W.selector.match(/data-cd-id="([^"]+)"/),M=D?D[1]:void 0,A,T;try{let P=document.querySelector(W.selector);if(P)A=P.tagName.toLowerCase(),T=(P.getAttribute("class")??"").split(/\s+/).filter((I)=>I&&!I.startsWith("dgn-")&&!I.startsWith("dc-cv-")).join(" ")}catch{}Q.replace({file:X??void 0,id:M,selector:W.selector,tag:A,classes:T,bounds:W.bounds??void 0})},[Q,X]),j=g($);j.current=$;let N=h7();S(()=>{if(!N)return;let W=N.doc.getArray("comments"),D=()=>{J(W.toArray())};if(W.length>0)D();return W.observe(D),()=>{try{W.unobserve(D)}catch{}}},[N]),S(()=>{if(typeof window>"u")return;let W=(D)=>{let M=D.data;if(!M||typeof M!=="object"||!M.dgn)return;if(M.dgn==="comments-set"&&Array.isArray(M.comments))J(M.comments);else if(M.dgn==="comment-focus"){let A=typeof M.id==="string"?M.id:null;q(A);let T=A?j.current.find((P)=>P.id===A):void 0;F(T)}};return window.addEventListener("message",W),()=>window.removeEventListener("message",W)},[F]),S(()=>{if(typeof document>"u")return;let W=(D)=>{let M=D.detail;if(!M?.selection)return;K({selection:M.selection,clientX:typeof M.clientX==="number"?M.clientX:0,clientY:typeof M.clientY==="number"?M.clientY:0})};return document.addEventListener("cm:open-composer",W),()=>document.removeEventListener("cm:open-composer",W)},[]);let U=E(()=>{if(K(null),typeof window>"u")return;try{window.parent.postMessage({dgn:"force-clear"},"*")}catch{}},[]),G=E((W)=>{if(!B)return;let D=B.selection,M={file:D.file,selector:D.selector,index:D.index,dom_path:D.dom_path,tag:D.tag,classes:D.classes,bounds:D.bounds,html_excerpt:D.html,text:W};if(typeof window>"u")return;try{window.parent.postMessage({dgn:"comment-submit",payload:M},"*")}catch{}U()},[B,U]);S(()=>{if(!X)return;let W=!1;return(async()=>{try{let D=await fetch(`/_comments?file=${encodeURIComponent(X)}`);if(!D.ok)return;let M=await D.json();if(W)return;if(Array.isArray(M.comments))J((A)=>A.length===0?M.comments??[]:A)}catch{}})(),()=>{W=!0}},[X]);let H=s(()=>{return $.slice().sort((D,M)=>D.created.localeCompare(M.created)).filter((D)=>D.status!=="resolved")},[$]),Y=s(()=>{let W=new Map;return $.slice().sort((M,A)=>M.created.localeCompare(A.created)).forEach((M,A)=>{W.set(M.id,A+1)}),W},[$]),L=E((W)=>{if(q(W),F($.find((D)=>D.id===W)),typeof window>"u")return;try{window.parent.postMessage({dgn:"comment-click",id:W},"*")}catch{}},[$,F]),_=E((W,D)=>{if(typeof window>"u")return;try{window.parent.postMessage({dgn:"comment-patch",id:W,patch:D},"*")}catch{}},[]),Z=E((W)=>{if(typeof window>"u")return;try{window.parent.postMessage({dgn:"comment-delete",id:W},"*")}catch{}q((D)=>D===W?null:D)},[]),z=E(async(W,D)=>{if(typeof fetch>"u")return!1;try{let M=await fetch(`/_api/comments/${encodeURIComponent(W)}/reply`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:D})});if(!M.ok)return!1;let A=await M.json();return J((T)=>T.map((P)=>P.id===A.id?A:P)),!0}catch{return!1}},[]);return k("div",{className:"cm-layer","aria-hidden":!1,children:[H.map((W)=>{let D=Y.get(W.id)??0;return O(pQ,{comment:W,sequence:D,focused:V===W.id,onClick:L,onOrphaned:Z},W.id)}),B?O(uQ,{state:B,onSubmit:G,onCancel:U}):null,(()=>{if(!V)return null;let W=H.find((D)=>D.id===V);if(!W)return null;return O(mQ,{comment:W,sequence:Y.get(W.id)??0,onClose:()=>{q(null),Q?.clear()},onPatch:(D)=>_(W.id,D),onDelete:()=>Z(W.id),onReply:(D)=>z(W.id,D)})})()]})}var L7=null;async function gQ(){if(!L7)L7=(async()=>{try{let Q=await fetch("/_api/git-committers");if(!Q.ok)return[];let $=await Q.json();return Array.isArray($.committers)?$.committers:[]}catch{return[]}})();return L7}function m7(Q){return(Q.trim().split(/\s+/)[0]??"").replace(/[^\w.-]/g,"").toLowerCase()}function hQ(Q,$){if($<=0||$>Q.length)return null;let J=$-1;while(J>=0){let V=Q[J]??"";if(V==="@"){let q=J>0?Q[J-1]:"";if(J===0||/\s/.test(q??"")){let B=Q.slice(J+1,$);return{start:J,end:$,query:B}}return null}if(!/[\w.-]/.test(V))return null;J-=1}return null}function r7({className:Q,value:$,onChange:J,onKeyDown:V,placeholder:q,rows:B,disabled:K,textareaRef:X,ariaLabel:F}){let j=g(null),N=E((P)=>{if(j.current=P,X)X.current=P},[X]),[U,G]=m([]),[H,Y]=m(null),[L,_]=m(0),Z=E(()=>{if(U.length>0)return;gQ().then((P)=>G(P))},[U.length]),z=s(()=>{if(!H)return[];let P=H.query.toLowerCase();return(!P?U:U.filter((w)=>w.name.toLowerCase().includes(P)||w.email.toLowerCase().includes(P))).slice(0,8)},[H,U]),W=E((P)=>{let I=P.selectionStart??P.value.length,w=hQ(P.value,I);Y(w),_(0)},[]),D=E((P)=>{J(P.target.value),W(P.target)},[J,W]),M=E((P)=>{if(!H)return;let I=j.current;if(!I)return;let w=`@${m7(P.name)}`,f=`${$.slice(0,H.start)}${w} ${$.slice(H.end)}`;J(f),Y(null);let x=H.start+w.length+1;requestAnimationFrame(()=>{I.focus(),I.setSelectionRange(x,x)})},[H,$,J]),A=E((P)=>{if(H&&z.length>0){if(P.key==="ArrowDown"){P.preventDefault(),_((I)=>(I+1)%z.length);return}if(P.key==="ArrowUp"){P.preventDefault(),_((I)=>(I-1+z.length)%z.length);return}if(P.key==="Enter"||P.key==="Tab"){P.preventDefault();let I=z[L]??z[0];if(I)M(I);return}if(P.key==="Escape"){P.preventDefault(),Y(null);return}}V?.(P)},[H,z,L,M,V]),T=E((P)=>{W(P.currentTarget)},[W]);return k("div",{style:{position:"relative"},children:[O("textarea",{ref:N,className:Q,value:$,placeholder:q,rows:B,disabled:K,"aria-label":F,onChange:D,onKeyDown:A,onFocus:Z,onSelect:T,onClick:T}),H&&z.length>0?O("ul",{className:"cm-mention-popup",role:"listbox","aria-label":"Mention suggestions",style:{left:0,top:"100%"},children:z.map((P,I)=>{return k("li",{role:"option","aria-selected":I===L,className:"cm-mention-popup__item",onMouseEnter:()=>_(I),onMouseDown:(f)=>{f.preventDefault(),M(P)},children:[k("span",{className:"cm-mention-popup__name",children:["@",m7(P.name)]}),O("span",{className:"cm-mention-popup__email",children:P.email})]},`${P.name}-${P.email}`)})}):null]})}var fQ=3000;function pQ({comment:Q,sequence:$,focused:J,onClick:V,onOrphaned:q}){let B=g(null),K=g(null),X=g(null);S(()=>{let N=()=>{K.current=null;let U=B.current;if(!U)return;let G=P7(Q);if(G)X.current=null;else{if(X.current==null)X.current=Date.now();else if(Date.now()-X.current>fQ)q(Q.id);if(Q.bounds)G={x:Q.bounds.x,y:Q.bounds.y,w:Q.bounds.w,h:Q.bounds.h}}if(!G){U.style.display="none",K.current=requestAnimationFrame(N);return}U.style.display="grid";let H=Math.round(G.x+G.w-12),Y=Math.round(G.y-12);U.style.left=`${H}px`,U.style.top=`${Y}px`,K.current=requestAnimationFrame(N)};return K.current=requestAnimationFrame(N),()=>{if(K.current!=null)cancelAnimationFrame(K.current)}},[Q,q]);let F=Q.author?.trim()||"unknown",j=`Comment ${$} by ${F}`;return O("button",{ref:B,type:"button",className:"cm-pin","data-resolved":Q.status==="resolved"?"true":"false","data-focused":J?"true":"false","data-comment-pin":Q.id,"aria-label":j,"aria-expanded":J,title:Q.text.slice(0,200),onClick:(N)=>{N.preventDefault(),N.stopPropagation(),V(Q.id)},children:$})}function uQ({state:Q,onSubmit:$,onCancel:J}){let[V,q]=m(""),B=g(null),K=g(null),X=g(null);S(()=>{let U=()=>{X.current=null;let G=K.current;if(!G)return;let H=cQ(Q),Y=c7(H,{w:G.offsetWidth,h:G.offsetHeight});G.style.left=`${Math.round(Y.x)}px`,G.style.top=`${Math.round(Y.y)}px`,X.current=requestAnimationFrame(U)};return X.current=requestAnimationFrame(U),()=>{if(X.current!=null)cancelAnimationFrame(X.current)}},[Q]),S(()=>{B.current?.focus()},[]);let F=E(()=>{let U=V.trim();if(!U)return;$(U)},[V,$]),j=E((U)=>{if(U.key==="Escape"){U.preventDefault(),J();return}if((U.metaKey||U.ctrlKey)&&U.key==="Enter")U.preventDefault(),F()},[J,F]),N=s(()=>{let U=Q.selection.selector||"";if(!U)return Q.selection.tag||"canvas";let G=U.match(/data-cd-id="([^"]+)"/);if(G)return`cd:${G[1]}`;return U.length>36?`${U.slice(0,33)}…`:U},[Q.selection]);return k("div",{ref:K,className:"cm-composer",role:"dialog","aria-label":"New comment",onClick:(U)=>U.stopPropagation(),onPointerDown:(U)=>U.stopPropagation(),children:[k("div",{className:"cm-composer__head",children:[O("span",{children:"New comment"}),O("span",{className:"cm-composer__selector",children:N})]}),O(r7,{textareaRef:B,className:"cm-composer__textarea",value:V,placeholder:"Type a comment. ⌘↵ to save · Esc to cancel · @name to tag",onChange:q,onKeyDown:j,rows:3,ariaLabel:"Comment body"}),k("div",{className:"cm-composer__actions",children:[O("button",{type:"button",className:"cm-btn",onClick:J,children:"Cancel"}),O("button",{type:"button",className:"cm-btn cm-btn--primary",disabled:!V.trim(),onClick:F,children:"Save"})]})]})}function mQ({comment:Q,sequence:$,onClose:J,onPatch:V,onDelete:q,onReply:B}){let K=g(null),X=g(null),F=g(null),[j,N]=m(""),[U,G]=m(!1);S(()=>{let Z=()=>{F.current=null;let z=K.current;if(!z)return;let W=iQ(Q),D=c7(W,{w:z.offsetWidth,h:z.offsetHeight});z.style.left=`${Math.round(D.x)}px`,z.style.top=`${Math.round(D.y)}px`,F.current=requestAnimationFrame(Z)};return F.current=requestAnimationFrame(Z),()=>{if(F.current!=null)cancelAnimationFrame(F.current)}},[Q]),S(()=>{K.current?.focus();let Z=Q.id;return()=>{document.querySelector(`[data-comment-pin="${Z}"]`)?.focus()}},[Q.id]),S(()=>{if(typeof document>"u")return;let Z=(z)=>{if(z.key!=="Escape")return;let W=K.current;if(!W)return;if(W.contains(z.target)||document.activeElement===W)z.preventDefault(),J()};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[J]);let H=E(async()=>{let Z=j.trim();if(!Z||U)return;G(!0);let z=await B(Z);if(G(!1),z)N(""),X.current?.focus()},[j,U,B]),Y=E((Z)=>{if((Z.metaKey||Z.ctrlKey)&&Z.key==="Enter")Z.preventDefault(),H()},[H]),L=`cm-thread-head-${Q.id}`,_=dQ(Q.selector,"");return k("div",{ref:K,className:"cm-thread",role:"dialog","aria-labelledby":L,tabIndex:-1,onClick:(Z)=>Z.stopPropagation(),onPointerDown:(Z)=>Z.stopPropagation(),children:[k("div",{className:"cm-thread__head",id:L,children:[k("div",{className:"cm-thread__head-row",children:[O("span",{className:"cm-thread__seq","aria-hidden":"true",children:$}),O("span",{className:"cm-thread__author",children:Q.author?.trim()||"unknown"}),O("span",{className:"cm-thread__time",children:i7(Q.created)}),O("button",{type:"button",className:"cm-thread__close","aria-label":"Close thread",title:"Close · Esc",onClick:J,children:"×"})]}),_?O("code",{className:"cm-thread__selector",children:_}):null]}),O("div",{className:"cm-thread__body",children:d7(Q.text)}),(Q.thread??[]).map((Z)=>k("div",{className:"cm-thread__reply",children:[k("div",{className:"cm-thread__reply-head",children:[O("span",{className:"cm-thread__reply-author",children:Z.author?.trim()||"unknown"}),O("span",{className:"cm-thread__reply-time",children:i7(Z.created)})]}),O("div",{className:"cm-thread__reply-body",children:d7(Z.body)})]},Z.id)),k("div",{className:"cm-thread__reply-form",children:[O(r7,{textareaRef:X,className:"cm-thread__reply-textarea",value:j,placeholder:"Reply… ⌘↵ to send · @name to tag",onChange:N,onKeyDown:Y,rows:2,ariaLabel:"Reply",disabled:U}),O("div",{className:"cm-thread__reply-actions",children:O("button",{type:"button",className:"cm-btn cm-btn--primary",disabled:!j.trim()||U,onClick:()=>void H(),children:"Send"})})]}),k("div",{className:"cm-thread__actions",children:[Q.status==="resolved"?O("button",{type:"button",className:"cm-btn",onClick:()=>V({status:"open"}),children:"↺ Reopen"}):O("button",{type:"button",className:"cm-btn cm-btn--primary",onClick:()=>{V({status:"resolved"}),J()},children:"✓ Resolve"}),O("button",{type:"button",className:"cm-btn cm-btn--danger",onClick:()=>{q(),J()},children:"Delete"})]})]})}function d7(Q){if(!Q)return null;let $=/(@[\w][\w.-]*)/g;return Q.split($).map((V,q)=>{let B=`${q}:${V}`;if(q%2===1)return O("strong",{"data-mention":"true",children:V},B);return O("span",{children:V},B)})}function i7(Q){if(!Q)return"";let $=Date.parse(Q);if(!Number.isFinite($))return"";let J=Math.round((Date.now()-$)/1000);if(J<60)return`${Math.max(J,0)}s ago`;if(J<3600)return`${Math.round(J/60)}m ago`;if(J<86400)return`${Math.round(J/3600)}h ago`;return`${Math.round(J/86400)}d ago`}function dQ(Q,$){if(!Q)return $;let J=Q.match(/data-cd-id="([^"]+)"/);if(J)return`cd:${J[1]}`;return Q.length>36?`${Q.slice(0,33)}…`:Q}function iQ(Q){let $=Q.selector?P7(Q):null;if($)return{x:$.x+$.w-12,y:$.y+16};if(Q.bounds)return{x:Q.bounds.x+Q.bounds.w-12,y:Q.bounds.y+16};return{x:16,y:16}}function cQ(Q){if(Q.clientX||Q.clientY)return{x:Q.clientX,y:Q.clientY+8};if(Q.selection.selector){let $=P7(Q.selection);if($)return{x:$.x,y:$.y+$.h+8}}return{x:16,y:16}}import{useEffect as lQ}from"react";var rQ=new Set(["pen","highlighter","shape","rect","ellipse","arrow","sticky","text","section","eraser"]);function n7(Q){return rQ.has(Q)}var j7=(Q)=>!!(Q.metaKey||Q.ctrlKey);function t(Q){if(Q.type==="keydown"){if(Q.isEditable)return{kind:"no-op"};if(Q.metaKey||Q.ctrlKey||Q.altKey){if(Q.key==="Escape")return{kind:"escape"};let J=(Q.key||"").toLowerCase();if(!Q.altKey&&(Q.metaKey||Q.ctrlKey)){if(J==="z"&&Q.shiftKey)return{kind:"redo"};if(J==="z")return{kind:"undo"};if(J==="y"&&!Q.shiftKey)return{kind:"redo"}}return{kind:"no-op"}}let $=(Q.key||"").toLowerCase();if($==="v")return{kind:"tool",tool:"move"};if($==="h")return{kind:"tool",tool:"hand"};if($==="c")return{kind:"tool",tool:"comment"};if($==="b")return{kind:"tool",tool:"pen"};if($==="i")return{kind:"tool",tool:"highlighter"};if($==="r"||$==="o")return{kind:"tool",tool:"shape"};if($==="a")return{kind:"tool",tool:"arrow"};if($==="n")return{kind:"tool",tool:"sticky"};if($==="t")return{kind:"tool",tool:"text"};if($==="s"&&Q.shiftKey)return{kind:"tool",tool:"section"};if($==="e")return{kind:"tool",tool:"eraser"};if(Q.key==="Escape")return{kind:"escape"};return{kind:"no-op"}}if(Q.type==="contextmenu")return{kind:"context-menu",clientX:Q.clientX??0,clientY:Q.clientY??0};if(Q.type==="pointermove"){if(n7(Q.activeTool))return{kind:"no-op"};if(Q.activeTool==="hand")return{kind:"no-op"};if(Q.activeTool==="comment")return{kind:"hover",deep:!0,clientX:Q.clientX??0,clientY:Q.clientY??0};if(!j7(Q))return{kind:"no-op"};return{kind:"hover",deep:!0,clientX:Q.clientX??0,clientY:Q.clientY??0}}if(Q.type==="pointerdown"){if(Q.button===2)return{kind:"context-menu",clientX:Q.clientX??0,clientY:Q.clientY??0};if(Q.button===1||Q.spaceHeld)return{kind:"no-op"};if(Q.button!==0)return{kind:"no-op"};if(n7(Q.activeTool)&&!j7(Q))return{kind:"no-op"};if(Q.activeTool==="comment")return{kind:"drop-comment",clientX:Q.clientX??0,clientY:Q.clientY??0};if(Q.activeTool==="hand")return{kind:"no-op"};if(!j7(Q))return{kind:"no-op"};return{kind:"select",mode:!!Q.shiftKey?"add":"replace",deep:!0,clientX:Q.clientX??0,clientY:Q.clientY??0}}return{kind:"no-op"}}function nQ(Q){if(!Q||!Q.tagName)return!1;let $=Q,J=$.tagName;if(J==="INPUT"||J==="TEXTAREA"||J==="SELECT")return!0;if($.isContentEditable)return!0;return!1}function e(Q){if(!Q||!Q.closest)return!1;return!!Q.closest(".cm-composer, .cm-thread, .cm-mention-popup, .cm-pin, [data-mediaref-player]")}function o7(Q){let{hostRef:$,getActiveTool:J,isSpaceHeld:V,callbacks:q,enabled:B=!0,claimableActions:K}=Q;lQ(()=>{if(!B)return;let X=$.current;if(!X)return;let F=(Z)=>K&&Z.kind!=="no-op"&&!K.has(Z.kind)?{kind:"no-op"}:Z,j=(Z)=>{switch(Z.kind){case"hover":q.onHover?.(Z);break;case"select":q.onSelect?.(Z);break;case"drop-comment":q.onDropComment?.(Z);break;case"context-menu":q.onContextMenu?.(Z);break;case"tool":q.onTool?.(Z);break;case"escape":q.onEscape?.();break;case"undo":q.onUndo?.();break;case"redo":q.onRedo?.();break;case"no-op":break}},N=(Z)=>{let z=F(t({type:"pointermove",button:Z.button,metaKey:Z.metaKey,ctrlKey:Z.ctrlKey,shiftKey:Z.shiftKey,altKey:Z.altKey,clientX:Z.clientX,clientY:Z.clientY,spaceHeld:V?.()??!1,activeTool:J()}));j(z)},U=(Z)=>{if(e(Z.target))return;let z=F(t({type:"pointerdown",button:Z.button,metaKey:Z.metaKey,ctrlKey:Z.ctrlKey,shiftKey:Z.shiftKey,altKey:Z.altKey,clientX:Z.clientX,clientY:Z.clientY,spaceHeld:V?.()??!1,activeTool:J()}));if(z.kind!=="no-op")Z.preventDefault(),Z.stopImmediatePropagation();j(z)},G=(Z)=>{if(e(Z.target))return;let z=F(t({type:"pointerdown",button:Z.button,metaKey:Z.metaKey,ctrlKey:Z.ctrlKey,shiftKey:Z.shiftKey,altKey:Z.altKey,clientX:Z.clientX,clientY:Z.clientY,spaceHeld:V?.()??!1,activeTool:J()}));if(z.kind!=="no-op"){if(Z.preventDefault(),Z.stopImmediatePropagation(),z.kind==="select")try{window.focus()}catch{}}},H=(Z)=>{if(e(Z.target))return;let z=J(),W=Z.metaKey||Z.ctrlKey,D=z==="comment"?"drop-comment":z==="move"&&W&&Z.button===0?"select":Z.button===2?"context-menu":null;if(D&&(!K||K.has(D)))Z.preventDefault(),Z.stopImmediatePropagation()},Y=(Z)=>{let z=F(t({type:"contextmenu",clientX:Z.clientX,clientY:Z.clientY,metaKey:Z.metaKey,ctrlKey:Z.ctrlKey,shiftKey:Z.shiftKey,altKey:Z.altKey,activeTool:J()}));if(z.kind==="no-op")return;Z.preventDefault(),Z.stopImmediatePropagation(),j(z)},L=(Z)=>{let z=F(t({type:"keydown",key:Z.key,metaKey:Z.metaKey,ctrlKey:Z.ctrlKey,shiftKey:Z.shiftKey,altKey:Z.altKey,isEditable:nQ(Z.target),activeTool:J()}));if(z.kind==="tool"||z.kind==="escape"||z.kind==="undo"||z.kind==="redo")Z.preventDefault();j(z)};X.addEventListener("pointermove",N,{passive:!0}),X.addEventListener("pointerdown",U,{capture:!0}),X.addEventListener("mousedown",G,{capture:!0}),X.addEventListener("click",H,{capture:!0}),X.addEventListener("contextmenu",Y,{capture:!0});let _=X.ownerDocument??document;return _.addEventListener("keydown",L,!0),()=>{X.removeEventListener("pointermove",N),X.removeEventListener("pointerdown",U,{capture:!0}),X.removeEventListener("mousedown",G,{capture:!0}),X.removeEventListener("click",H,{capture:!0}),X.removeEventListener("contextmenu",Y,{capture:!0}),_.removeEventListener("keydown",L,!0)}},[B,$,J,V,q,K])}function M7(Q,$,J,V){let q=Q.elementFromPoint($,J);if(!q)return null;if(q.closest?.(".dc-mm, .dc-zoom-tb, .dc-tool-palette, .dc-context-menu, .dc-cv-group-bbox"))return null;let B=q.closest?.("[data-dc-screen]")??null,K=B?.getAttribute("data-dc-screen")??null,X=q.closest?.(".dc-artboard-body")??null;if(!X){if(B&&K)return{el:B,cdId:null,artboardId:K};return null}if(q===X){if(B&&K)return{el:B,cdId:null,artboardId:K};return null}if(V.deep){let G=q.getAttribute?.("data-cd-id")??null;return{el:q,cdId:G,artboardId:K}}let F=q,j=null;while(F&&F!==X){if(F.hasAttribute?.("data-cd-id"))j=F;F=F.parentElement}let N=j??q,U=N.getAttribute?.("data-cd-id")??null;return{el:N,cdId:U,artboardId:K}}import{useCallback as U0,useEffect as QQ,useRef as W7}from"react";var oQ=!1;function a7(){return oQ}import{createContext as Z0,useCallback as I7,useContext as t7,useEffect as q0,useMemo as B0,useState as O7}from"react";function d(Q,$,J,V){return`url("data:image/svg+xml,${encodeURIComponent(Q.trim())}") ${$} ${J}, ${V}`}var _7="width='24' height='24' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'",A7="#1f1f1f",N7="stroke='#ffffff' stroke-linejoin='round' stroke-linecap='round'";function i(Q,$,J){let V=J?`<g transform='${J}'>`:"";return`<svg ${_7}>${V}<path fill='#ffffff' d='${Q}'/><path fill='${A7}' d='${$}'/>${J?"</g>":""}</svg>`}var s7="translate(0,32) scale(1,-1)",aQ=d(i("M10.25 8.25 L10.05 8.65 10 9 10 23.1 10.05 23.4 10.25 23.75 10.8 24 11.45 23.85 11.6 23.7 11.75 23.45 14.65 19.8 14.85 19.65 14.95 19.5 15.4 19.2 15.95 19.1 21.05 19.1 21.2 19.1 21.35 19.05 21.65 18.9 21.9 18.6 22 18.3 22 17.9 21.9 17.65 21.75 17.35 21.65 17.3 21.55 17.15 11.5 8.25 11.25 8.05 10.95 8 10.6 8.05 10.25 8.25 M9.15 6.6 L9.7 6.25 10 6.15 10.95 6 11.9 6.15 13 6.9 22.9 15.65 23 15.8 23.2 15.95 23.75 16.75 24 17.9 24 18.3 23.9 18.95 23.8 19.25 23.6 19.7 23.1 20.35 22.75 20.6 22.1 20.9 22.05 20.95 22 20.95 21.2 21.1 21.05 21.1 16.2 21.1 16.1 21.25 16.05 21.25 13.4 24.6 13.05 25.15 12.9 25.3 12.55 25.55 Q11.6 26.15 10.55 26 L10.5 26 Q9.65 25.85 9 25.3 L8.45 24.65 8.4 24.5 8.15 24.05 8 23.1 8 9 Q8 8.45 8.15 8.05 L8.25 7.75 8.45 7.35 9.15 6.6","M10.25 8.25 L10.6 8.05 10.95 8 11.25 8.05 11.5 8.25 21.55 17.15 21.65 17.3 21.75 17.35 21.9 17.65 22 17.9 22 18.3 21.9 18.6 21.65 18.9 21.35 19.05 21.2 19.1 21.05 19.1 15.95 19.1 15.4 19.2 14.95 19.5 14.85 19.65 14.65 19.8 11.75 23.45 11.6 23.7 11.45 23.85 10.8 24 10.25 23.75 10.05 23.4 10 23.1 10 9 10.05 8.65 10.25 8.25"),8,5,"default"),sQ=d(i("M28.55 17.8 Q29.4 20.3 28.75 22.8 L28.7 23 28.15 24.55 28.05 24.75 Q26.4 28.2 22.75 29.4 L22.45 29.5 18 29.9 17.75 29.85 Q15.8 29.25 13.8 28.1 L13.45 27.95 Q12 27.05 10.35 26.8 L10.25 26.75 7.9 26.7 7.8 26.7 Q6.1 26.9 4.8 25.8 L4.75 25.8 4.65 25.7 4.6 25.65 Q3.25 24.5 3.05 22.85 L3 22.75 Q2.8 20.95 4 19.5 5.05 18.15 6.75 17.95 L8.4 17.9 7.5 15.55 7.3 15.2 7.2 15 5 10.95 Q3.9 9.15 4.3 7.75 L4.4 7.5 Q4.75 6.15 6.45 5.2 9 3.65 11 5 11.05 4.1 11.5 3.45 12.15 2.1 14.2 1.6 L14.35 1.6 Q18.05 0.6 19.6 4.4 L19.65 4.55 Q20.75 3.65 22.7 3.75 L22.75 3.75 Q26.75 4 27 8.15 L27 8.25 27 8.35 27 8.45 Q26.9 10.75 27.1 12.6 27.15 14.65 28.2 16.75 L28.55 17.8 M26.65 18.4 L26.1 16.8 26.1 16.85 Q24.8 13.7 25 8.35 L25 8.25 Q24.85 5.9 22.6 5.75 20.7 5.65 20.4 7.35 L20.1 7.95 19.5 8.2 18.85 8.05 18.45 7.5 17.75 5.15 Q16.85 2.95 14.7 3.55 L14.65 3.55 Q12.55 4.05 13.15 6.15 L13.85 8.75 13.75 9.45 13.25 9.95 12.55 9.95 12 9.55 10.9 7.7 Q9.5 5.7 7.45 6.9 6.5 7.45 6.25 8.15 6.1 8.9 6.7 9.85 9.2 13.9 10.8 18.65 L10.8 19.3 10.4 19.8 9.75 19.95 Q8.35 19.8 6.95 19.95 6.1 20.05 5.55 20.75 4.9 21.55 5 22.55 5.15 23.55 6 24.2 L6.05 24.25 Q6.75 24.85 7.65 24.7 L7.7 24.7 10.65 24.8 Q12.7 25.15 14.45 26.2 L14.5 26.2 Q16.4 27.35 18.3 27.9 L22.05 27.5 22.1 27.5 Q24.95 26.55 26.25 23.85 L26.8 22.3 Q27.3 20.35 26.65 18.4","M26.65 18.4 Q27.3 20.35 26.8 22.3 L26.25 23.85 Q24.95 26.55 22.1 27.5 L22.05 27.5 18.3 27.9 Q16.4 27.35 14.5 26.2 L14.45 26.2 Q12.7 25.15 10.65 24.8 L7.7 24.7 7.65 24.7 Q6.75 24.85 6.05 24.25 L6 24.2 Q5.15 23.55 5 22.55 4.9 21.55 5.55 20.75 6.1 20.05 6.95 19.95 8.35 19.8 9.75 19.95 L10.4 19.8 10.8 19.3 10.8 18.65 Q9.2 13.9 6.7 9.85 6.1 8.9 6.25 8.15 6.5 7.45 7.45 6.9 9.5 5.7 10.9 7.7 L12 9.55 12.55 9.95 13.25 9.95 13.75 9.45 13.85 8.75 13.15 6.15 Q12.55 4.05 14.65 3.55 L14.7 3.55 Q16.85 2.95 17.75 5.15 L18.45 7.5 18.85 8.05 19.5 8.2 20.1 7.95 20.4 7.35 Q20.7 5.65 22.6 5.75 24.85 5.9 25 8.25 L25 8.35 Q24.8 13.7 26.1 16.85 L26.1 16.8 26.65 18.4"),12,12,"grab"),tQ=d(i("M28 14 Q28 9.85 24.45 6.9 20.95 4 16 4 11.05 4 7.5 6.9 L7.45 7 Q4 9.9 4 14 4 18.15 7.55 21.05 L7.5 21.05 Q9.2 22.45 11.2 23.2 L15.3 27.3 16 27.6 16.7 27.3 20.85 23.2 Q22.7 22.45 24.3 21.15 L24.45 21.05 Q28 18.15 28 14 M25.75 5.35 Q30.05 8.95 30 14 30.05 19.05 25.75 22.6 L25.4 22.85 Q23.8 24.1 22 24.9 L18.1 28.75 18.15 28.75 Q17.2 29.6 16 29.6 14.8 29.6 13.85 28.75 L13.9 28.75 10 24.9 6.6 22.85 6.25 22.6 Q1.95 19.05 2 14 1.95 8.95 6.25 5.35 10.3 2 16 2 21.7 2 25.75 5.35","M28 14 Q28 18.15 24.45 21.05 L24.3 21.15 Q22.7 22.45 20.85 23.2 L16.7 27.3 16 27.6 15.3 27.3 11.2 23.2 Q9.2 22.45 7.5 21.05 L7.55 21.05 Q4 18.15 4 14 4 9.9 7.45 7 L7.5 6.9 Q11.05 4 16 4 20.95 4 24.45 6.9 28 9.85 28 14"),12,21,"crosshair"),eQ=d(i("M4 13.1 L4 6 Q4 5.15 4.6 4.6 5.15 4 6 4 L13.1 4 Q13.95 4 14.55 4.6 L28.65 18.75 Q29.8 19.9 29.75 21.45 L29.75 21.6 29.75 21.7 Q29.75 23.2 28.7 24.35 L24.45 28.65 24.35 28.75 Q23.15 29.85 21.65 29.8 L21.55 29.8 21.4 29.8 Q20.2 29.8 19.25 29.15 L18 29.35 Q16.6 29.4 15.25 28 L15.2 27.95 8.2 20.95 Q7.6 20.35 7.6 19.55 7.6 18.7 8.2 18.1 L4.6 14.5 Q4 13.9 4 13.1 M19.5 26.65 L20.1 27.25 Q20.7 27.85 21.5 27.8 22.35 27.85 23 27.25 L27.25 22.95 Q27.8 22.35 27.75 21.55 27.8 20.75 27.2 20.15 L13.1 6 6 6 6 13.1 12.35 19.45 9.6 19.5 16.65 26.55 Q18.05 28.05 19.5 26.65 M8.05 12.3 L8 8 12.25 8.05 13.8 9.6 9.6 13.85 8.05 12.3 M15.25 11.05 L23 18.8 18.8 23.05 11.05 15.3 15.25 11.05","M15.25 11.05 L11.05 15.3 18.8 23.05 23 18.8 15.25 11.05 M12.35 19.45 L6 13.1 6 6 13.1 6 27.2 20.15 Q27.8 20.75 27.75 21.55 27.8 22.35 27.25 22.95 L23 27.25 Q22.35 27.85 21.5 27.8 20.7 27.85 20.1 27.25 L19.5 26.65 12.35 19.45 M8.05 12.3 L9.6 13.85 13.8 9.6 12.25 8.05 8 8 8.05 12.3",s7),6,18,"crosshair"),Q0=d(i("M5.15 10.85 Q4 9.65 4 8.1 L4 7.95 4 7.85 Q3.95 6.2 5.1 5.15 6.25 4 7.85 4 L7.95 4 8.1 4 Q9.65 4 10.85 5.15 L11 5.3 14.3 5.25 Q15.15 5.25 15.75 5.85 L29.9 20 Q31 21.15 31 22.75 L31 22.85 31 23 Q31.05 24.5 29.9 25.7 L29.55 25.95 25.65 29.9 25.65 29.95 Q24.45 31.1 22.75 31.1 21.2 31.15 20 29.95 L5.85 15.8 Q5.25 15.2 5.25 14.35 L5.25 10.95 5.15 10.85 M19.95 24.2 L18.55 22.8 22.8 18.55 24.2 19.95 19.95 24.2 M28.45 21.4 L14.3 7.25 10.15 7.3 9.4 6.55 Q8.8 5.95 7.95 6 7.1 5.95 6.5 6.55 5.95 7.1 6 7.95 5.95 8.8 6.55 9.4 L7.25 10.1 7.25 14.35 21.4 28.5 Q22 29.1 22.75 29.1 23.6 29.1 24.2 28.5 L28.45 24.25 Q29.05 23.65 29 22.85 29.05 22 28.45 21.4 M9.25 13.5 L9.25 9.3 13.5 9.25 14.3 10.05 10.05 14.3 9.25 13.5 M17.15 21.4 L11.5 15.75 15.75 11.5 21.4 17.15 17.15 21.4","M17.15 21.4 L21.4 17.15 15.75 11.5 11.5 15.75 17.15 21.4 M28.45 21.4 Q29.05 22 29 22.85 29.05 23.65 28.45 24.25 L24.2 28.5 Q23.6 29.1 22.75 29.1 22 29.1 21.4 28.5 L7.25 14.35 7.25 10.1 6.55 9.4 Q5.95 8.8 6 7.95 5.95 7.1 6.5 6.55 7.1 5.95 7.95 6 8.8 5.95 9.4 6.55 L10.15 7.3 14.3 7.25 28.45 21.4 M19.95 24.2 L24.2 19.95 22.8 18.55 18.55 22.8 19.95 24.2 M9.25 13.5 L10.05 14.3 14.3 10.05 13.5 9.25 9.25 9.3 9.25 13.5",s7),6,18,"crosshair"),Q7=d(i("M17 2 Q18.2 2 19.15 2.9 20 3.8 20 5 L20 12 27 12 Q28.2 12 29.15 12.9 30 13.8 30 15 L30 17 Q30 18.2 29.15 19.15 28.2 20 27 20 L20 20 20 27 Q20 28.2 19.15 29.15 18.2 30 17 30 L15 30 Q13.8 30 12.9 29.15 12 28.2 12 27 L12 20 5 20 Q3.8 20 2.9 19.15 2 18.2 2 17 L2 15 Q2 13.8 2.9 12.9 3.8 12 5 12 L12 12 12 5 Q12 3.8 12.9 2.9 13.8 2 15 2 L17 2 M14 27 L14.3 27.7 Q14.6 28 15 28 L17 28 17.7 27.7 18 27 18 18.05 18.05 18 27 18 Q27.4 18 27.7 17.7 L28 17 28 15 27.7 14.3 Q27.4 14 27 14 L18 14 18 5 17.7 4.3 17 4 15 4 Q14.6 4 14.3 4.3 14 4.6 14 5 L14 14 5 14 Q4.6 14 4.3 14.3 4 14.6 4 15 L4 17 Q4 17.4 4.3 17.7 4.6 18 5 18 L14 18 14 27","M14 27 L14 18 5 18 Q4.6 18 4.3 17.7 4 17.4 4 17 L4 15 Q4 14.6 4.3 14.3 4.6 14 5 14 L14 14 14 5 Q14 4.6 14.3 4.3 14.6 4 15 4 L17 4 17.7 4.3 18 5 18 14 27 14 Q27.4 14 27.7 14.3 L28 15 28 17 27.7 17.7 Q27.4 18 27 18 L18.05 18 18 18.05 18 27 17.7 27.7 17 28 15 28 Q14.6 28 14.3 27.7 L14 27"),12,12,"crosshair"),$0=d(i("M3.9 11.35 Q2.3 12.5 3.7 13.9 L16.4 26.65 Q17.85 28.05 19.45 26.9 L27.65 21.15 Q29.3 20 27.85 18.6 L15.15 5.85 Q13.75 4.45 12.1 5.6 L3.9 11.35 M1.05 12.4 Q1 10.95 2.75 9.75 L10.95 4 10.95 3.95 Q14 1.85 16.6 4.45 L29.3 17.2 Q30.8 18.65 30.55 20.1 30.55 21.55 28.8 22.8 L20.6 28.55 20.65 28.55 Q17.7 30.65 15 28.1 L15 28.05 2.3 15.3 2.3 15.35 Q0.8 13.85 1.05 12.4 M13.5 7 L19.85 13.35 11.65 19.15 5.3 12.75 13.5 7","M13.5 7 L5.3 12.75 11.65 19.15 19.85 13.35 13.5 7 M3.9 11.35 L12.1 5.6 Q13.75 4.45 15.15 5.85 L27.85 18.6 Q29.3 20 27.65 21.15 L19.45 26.9 Q17.85 28.05 16.4 26.65 L3.7 13.9 Q2.3 12.5 3.9 11.35"),6,14,"cell"),J0=d(`<svg ${_7}><path d='M16 4V28M11 4H21M11 28H21' fill='none' ${N7} stroke-width='5'/><path d='M16 4V28M11 4H21M11 28H21' fill='none' stroke='${A7}' stroke-width='2.25' stroke-linecap='round'/></svg>`,12,12,"text"),V0=d(`<svg ${_7}><path d='M6 5H21L26 10V27H6Z' fill='${A7}' ${N7} stroke-width='2.5'/><path d='M21 5V11H26' fill='none' ${N7} stroke-width='2.25'/></svg>`,5,5,"crosshair"),R=Object.freeze({move:aQ,hand:sQ,comment:tQ,pen:eQ,section:Q7,highlighter:Q0,shape:Q7,rect:Q7,ellipse:Q7,sticky:V0,arrow:Q7,text:J0,eraser:$0});import{jsx as T7,Fragment as K0}from"react/jsx-runtime";var G0=Object.freeze([{id:"move",label:"Move",shortcut:"V",cursor:R.move},{id:"hand",label:"Hand",shortcut:"H",cursor:R.hand},{id:"comment",label:"Comment",shortcut:"C",cursor:R.comment},{id:"pen",label:"Pen",shortcut:"B",cursor:R.pen},{id:"highlighter",label:"Highlighter",shortcut:"I",cursor:R.highlighter},{id:"shape",label:"Shape",shortcut:"R",cursor:R.shape},{id:"sticky",label:"Sticky",shortcut:"N",cursor:R.sticky},{id:"section",label:"Section",shortcut:"⇧S",cursor:R.shape},{id:"arrow",label:"Arrow",shortcut:"A",cursor:R.arrow},{id:"text",label:"Text",shortcut:"T",cursor:R.text},{id:"eraser",label:"Eraser",shortcut:"E",cursor:R.eraser}]),E7=Z0(null);function W0({children:Q,tools:$=G0,initial:J="move"}){let[V,q]=O7(J),[B,K]=O7(()=>({tool:null,locked:!1})),X=I7((H)=>{q(H),K((Y)=>Y.locked&&Y.tool===H?Y:{tool:null,locked:!1})},[]),F=I7((H)=>{K((Y)=>{if(Y.locked&&Y.tool===H)return{tool:null,locked:!1};return{tool:H,locked:!0}}),q(H)},[]),j=I7(()=>{K({tool:null,locked:!1})},[]),[N,U]=O7("rounded");q0(()=>{if(typeof document>"u")return;let H=$.find((_)=>_.id===V);if(!H)return;let Y=document.body.style.cursor;document.body.style.cursor=H.cursor;let L=document.getElementById("dc-tool-cursor");if(!L)L=document.createElement("style"),L.id="dc-tool-cursor",document.head.appendChild(L);if(L.textContent=`* { cursor: ${H.cursor} !important; }`,typeof window<"u"&&window.parent&&window.parent!==window)try{window.parent.postMessage({dgn:"tool-cursor",tool:V},"*")}catch{}return()=>{document.body.style.cursor=Y;let _=document.getElementById("dc-tool-cursor");if(_)_.textContent=""}},[V,$]);let G=B0(()=>({tool:V,setTool:X,tools:$,sticky:B,toggleSticky:F,clearSticky:j,shapeKind:N,setShapeKind:U}),[V,X,$,B,F,j,N]);return T7(E7.Provider,{value:G,children:Q})}function e7({children:Q}){if(t7(E7))return T7(K0,{children:Q});return T7(W0,{children:Q})}function G7(){let Q=t7(E7);if(!Q)throw Error("useToolMode must be used inside <ToolProvider>");return Q}import{jsx as N0}from"react/jsx-runtime";var z0=`
2
+ .dc-el-resize-handle {
3
+ position: fixed;
4
+ width: 8px;
5
+ height: 8px;
6
+ background: var(--maude-hud-accent, oklch(0.680 0.180 268));
7
+ border: 1px solid var(--maude-hud-accent-fg, oklch(0.180 0.030 268));
8
+ border-radius: 3px;
9
+ z-index: 6;
10
+ pointer-events: auto;
11
+ touch-action: none;
12
+ opacity: 0;
13
+ transition: opacity 120ms cubic-bezier(0.4, 0, 0.2, 1);
14
+ }
15
+ .dc-el-resize-handle[data-corner="nw"], .dc-el-resize-handle[data-corner="se"] { cursor: nwse-resize !important; }
16
+ .dc-el-resize-handle[data-corner="ne"], .dc-el-resize-handle[data-corner="sw"] { cursor: nesw-resize !important; }
17
+ .dc-el-resize-handle[data-corner="n"], .dc-el-resize-handle[data-corner="s"] { cursor: ns-resize !important; width: 14px; height: 6px; }
18
+ .dc-el-resize-handle[data-corner="e"], .dc-el-resize-handle[data-corner="w"] { cursor: ew-resize !important; width: 6px; height: 14px; }
19
+ /* Rotation lives in INVISIBLE zones just outside each CORNER (FigJam / mirrors
20
+ the annotation .dc-annot-rotate-zone) — the cursor flips to a rotate glyph and
21
+ dragging turns the element. z-index BELOW the corner squares so the resize
22
+ square wins on the inner overlap; the surrounding ring rotates. */
23
+ .dc-el-resize-handle[data-corner^="rot-"] {
24
+ width: 20px; height: 20px;
25
+ background: transparent !important;
26
+ border: none !important;
27
+ border-radius: 0 !important;
28
+ z-index: 5;
29
+ cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='white' stroke-width='4' d='M4.8 13 A6 6 0 1 1 15.2 13 M2.2 10.8 L4.8 13 L7.4 10.9 M12.6 10.9 L15.2 13 L17.8 10.8'/%3E%3Cpath stroke='black' stroke-width='1.8' d='M4.8 13 A6 6 0 1 1 15.2 13 M2.2 10.8 L4.8 13 L7.4 10.9 M12.6 10.9 L15.2 13 L17.8 10.8'/%3E%3C/g%3E%3C/svg%3E") 10 10, alias !important;
30
+ }
31
+ /* Task L7 — live W×H (+ X,Y for an out-of-flow edge drag) readout pill, shown
32
+ only WHILE a resize is in flight (see the tick() gate below). */
33
+ .dc-el-resize-readout {
34
+ position: fixed;
35
+ transform: translate(-50%, 12px);
36
+ font-family: var(--maude-chrome-font-mono, ui-monospace, SFMono-Regular, monospace);
37
+ font-size: 11px;
38
+ padding: 3px 7px;
39
+ background: var(--maude-hud-accent, oklch(0.680 0.180 268));
40
+ color: var(--maude-hud-accent-fg, oklch(0.180 0.030 268));
41
+ border-radius: 4px;
42
+ letter-spacing: 0.02em;
43
+ white-space: nowrap;
44
+ font-variant-numeric: tabular-nums;
45
+ z-index: 6;
46
+ pointer-events: none;
47
+ opacity: 0;
48
+ transition: opacity 120ms cubic-bezier(0.4, 0, 0.2, 1);
49
+ }
50
+ /* INV-2 — reveal/settle collapses to 1ms, same idiom as every other overlay
51
+ stylesheet in this codebase (equal-spacing-handles.tsx, etc). This overlay
52
+ is mounted inside the canvas iframe's OWN document, which never loads the
53
+ shell's 1-tokens-maude.css — the prefers-reduced-motion guard has to be
54
+ re-declared per injected stylesheet, it doesn't cascade in from the shell.
55
+ Comment stays backtick-free — it lives inside the template literal. */
56
+ @media (prefers-reduced-motion: reduce) {
57
+ .dc-el-resize-handle, .dc-el-resize-readout { transition-duration: 1ms; }
58
+ }
59
+ `.trim();function X0(){if(typeof document>"u")return;if(document.getElementById("dc-el-resize-css"))return;let Q=document.createElement("style");Q.id="dc-el-resize-css",Q.textContent=z0,document.head.appendChild(Q)}var Y0=["nw","n","ne","e","se","s","sw","w"];function H0(Q){return{movesLeft:Q==="nw"||Q==="w"||Q==="sw",movesRight:Q==="ne"||Q==="e"||Q==="se",movesTop:Q==="nw"||Q==="n"||Q==="ne",movesBottom:Q==="sw"||Q==="s"||Q==="se"}}var n=(Q)=>Math.round(Q*100)/100,K7=1;function F0(Q,$,J,V,q,B){let{movesLeft:K,movesRight:X,movesTop:F,movesBottom:j}=H0(Q),N=q.center,U=$.w,G=$.h;if(X)U=$.w+(N?2*J:J);else if(K)U=$.w-(N?2*J:J);if(j)G=$.h+(N?2*V:V);else if(F)G=$.h-(N?2*V:V);if(q.aspect&&$.w>0&&$.h>0){let Y=$.w/$.h;if((K||X)&&(F||j)){let _=Math.abs(U-$.w)/$.w,Z=Math.abs(G-$.h)/$.h;if(_>=Z)G=U/Y;else U=G*Y}else if(K||X)G=U/Y;else if(F||j)U=G*Y}if(U<K7)U=K7;if(G<K7)G=K7;let H={width:n(U),height:n(G)};if(N){if(B.canMoveLeft&&(K||X))H.left=n($.left+($.w-U)/2);if(B.canMoveTop&&(F||j))H.top=n($.top+($.h-G)/2)}else{if(B.canMoveLeft&&K)H.left=n($.left+$.w-U);if(B.canMoveTop&&F)H.top=n($.top+$.h-G)}return H}function $Q(Q){if(!Q||Q==="none")return 0;let $=/matrix\(([^)]+)\)/.exec(Q);if(!$)return 0;let J=$[1].split(",").map(Number),V=J[0]??1,q=J[1]??0;return Math.round(Math.atan2(q,V)*(180/Math.PI)*100)/100}function D0(Q){if(!Q||Q==="none")return 1;let $=/matrix\(([^)]+)\)/.exec(Q);if(!$)return 1;let J=$[1].split(",").map(Number),V=J[0]??1,q=J[1]??0,B=Math.hypot(V,q);return B>0?B:1}function JQ(Q,$,J){let V=J*Math.PI/180,q=Math.cos(V),B=Math.sin(V);return[Q*q-$*B,Q*B+$*q]}function VQ(Q,$,J,V){return Math.atan2(V-$,J-Q)}function L0(Q,$,J,V){let q=Q+(J-$)*(180/Math.PI);while(q>180)q-=360;while(q<=-180)q+=360;if(V)q=Math.round(q/15)*15;return Math.round(q*100)/100}function P0(Q,$){let J={width:`${$.width}px`,height:`${$.height}px`};if(typeof $.left==="number")J.left=`${$.left}px`;if(typeof $.top==="number")J.top=`${$.top}px`;try{window.parent.postMessage({dgn:"resize-request",id:Q.cdId,patch:J,before:Q.before,idIndex:Q.idIndex},"*")}catch{}}function j0(Q,$){if(!Q.artboardId)return;try{window.parent.postMessage({dgn:"resize-artboard-request",artboardId:Q.artboardId,width:$.width,height:$.height},"*")}catch{}}function M0(Q,$){try{window.parent.postMessage({dgn:"resize-request",id:Q.cdId,patch:{transform:$},before:Q.before,idIndex:Q.idIndex},"*")}catch{}}function ZQ(){X0();let{selected:Q}=B7(),{tool:$}=G7(),J=W7(null),V=W7(null),q=W7(null),B=W7(null),K=Q.length===1?Q[0]:null,X=K&&typeof K.id==="string"?K.id:null,F=K&&!X&&typeof K.artboardId==="string"?K.artboardId:null,j=$==="move"&&(!!X||!!F);QQ(()=>{let U=J.current;if(!U)return;let G=()=>{for(let Y of Array.from(U.children)){let L=Y;L.style.opacity="0",L.style.pointerEvents="none"}};if(!j||!K){G();return}let H=()=>{if(V.current=null,a7()){G(),V.current=requestAnimationFrame(H);return}let Y=X7(document,K);if(!Y){G(),V.current=requestAnimationFrame(H);return}let L=Y.getBoundingClientRect();if(L.width<=0&&L.height<=0){G(),V.current=requestAnimationFrame(H);return}let _=F?["e","s","se"]:Y0,Z=F?[]:["rot-nw","rot-ne","rot-sw","rot-se"],z=_.length+Z.length+1;while(U.children.length<z)U.appendChild(document.createElement("div"));while(U.children.length>z)U.lastChild&&U.removeChild(U.lastChild);let W=L.left+L.width/2,D=L.top+L.height/2,M=$Q(getComputedStyle(Y).transform),A=Y.closest(".dc-world"),T=A?D0(getComputedStyle(A).transform):1,P=Y.offsetWidth*T/2,I=Y.offsetHeight*T/2,w={nw:[-P,-I],n:[0,-I],ne:[P,-I],e:[P,0],se:[P,I],s:[0,I],sw:[-P,I],w:[-P,0],"rot-nw":[-P,-I],"rot-ne":[P,-I],"rot-sw":[-P,I],"rot-se":[P,I]},f=[...Z,..._];for(let C=0;C<f.length;C++){let v=f[C],b=U.children[C],[c,V7]=w[v]??[0,0],[KQ,UQ]=JQ(c,V7,M),zQ=W+KQ,XQ=D+UQ,U7=v.startsWith("rot-"),y7=v==="n"||v==="s",b7=v==="e"||v==="w",YQ=U7?10:y7?7:b7?3:4,HQ=U7?10:y7?3:b7?7:4;b.className="dc-el-resize-handle",b.dataset.corner=v,b.style.opacity="1",b.style.pointerEvents="auto",b.style.left=`${Math.round(zQ-YQ)}px`,b.style.top=`${Math.round(XQ-HQ)}px`,b.style.transform=U7?"":`rotate(${M}deg)`}let x=U.children[f.length],y=q.current;if(y&&y.el===Y&&!y.corner.startsWith("rot-")){let C=y.lastResult?.width??Y.offsetWidth,v=y.lastResult?.height??Y.offsetHeight,b=`${Math.round(C)} × ${Math.round(v)}`,c=y.lastResult?.left,V7=y.lastResult?.top;if(typeof c==="number"||typeof V7==="number")b+=` · ${Math.round(c??y.start.left)}, ${Math.round(V7??y.start.top)}`;x.className="dc-el-resize-readout",x.textContent=b,x.style.opacity="1",x.style.left=`${Math.round(W)}px`,x.style.top=`${Math.round(D+I)}px`}else x.style.opacity="0";V.current=requestAnimationFrame(H)};return V.current=requestAnimationFrame(H),()=>{if(V.current!=null)cancelAnimationFrame(V.current)}},[j,K,F]);let N=U0((U,G)=>{if(U.el.style.width=`${G.width}px`,U.el.style.height=`${G.height}px`,typeof G.left==="number")U.el.style.left=`${G.left}px`;if(typeof G.top==="number")U.el.style.top=`${G.top}px`;U.lastResult=G},[]);return QQ(()=>{let U=J.current;if(!U)return;let G=(Z,z)=>{let[W,D]=JQ(z.clientX-Z.startClientX,z.clientY-Z.startClientY,-Z.angle);return F0(Z.corner,Z.start,W/Z.elZoom,D/Z.elZoom,{aspect:!!z.shiftKey,center:!Z.artboardId&&!!z.altKey},Z.flags)},H=(Z)=>{let z=Z.target;if(!z?.classList.contains("dc-el-resize-handle"))return;let W=z.dataset.corner;if(!W||!K)return;let D=typeof K.id==="string"?K.id:null,M=!D&&typeof K.artboardId==="string"?K.artboardId:null;if(!D&&!M)return;let A=X7(document,K);if(!A)return;Z.preventDefault(),Z.stopPropagation();let T=A.getBoundingClientRect(),P=A.offsetWidth?T.width/A.offsetWidth:1,I=getComputedStyle(A),w=!M&&(I.position==="absolute"||I.position==="fixed"),f=M?Number.NaN:Number.parseFloat(A.style.left),x=M?Number.NaN:Number.parseFloat(A.style.top),y=M?0:$Q(I.transform),C=P>0?P:1,v=T.left+T.width/2,b=T.top+T.height/2,c={pointerId:Z.pointerId,corner:W,el:A,cdId:D??"",artboardId:M,idIndex:D?S7(document,D,A):0,startClientX:Z.clientX,startClientY:Z.clientY,elZoom:C,angle:y,cx:v,cy:b,rotStartPointer:VQ(v,b,Z.clientX,Z.clientY),start:{w:(y?A.offsetWidth:T.width/C)||T.width/C,h:(y?A.offsetHeight:T.height/C)||T.height/C,left:f,top:x},flags:{canMoveLeft:w&&Number.isFinite(f),canMoveTop:w&&Number.isFinite(x)},before:{width:A.style.width||null,height:A.style.height||null,left:A.style.left||null,top:A.style.top||null,transform:A.style.transform||null},lastResult:null,lastTransform:null};q.current=c;try{z.setPointerCapture(Z.pointerId)}catch{}},Y=(Z)=>{let z=q.current;if(!z||Z.pointerId!==z.pointerId)return;if(Z.preventDefault(),z.corner.startsWith("rot-")){let D=`rotate(${L0(z.angle,z.rotStartPointer,VQ(z.cx,z.cy,Z.clientX,Z.clientY),!!Z.shiftKey)}deg)`;z.el.style.transform=D,z.lastTransform=D;return}N(z,G(z,Z))},L=(Z)=>{let z=q.current;if(!z||Z.pointerId!==z.pointerId)return;if(q.current=null,z.corner.startsWith("rot-")){let M=z.lastTransform;if(!M||M===z.before.transform)return;B.current={el:z.el,before:z.before},M0(z,M);return}let W=z.lastResult??G(z,Z);if(!(`${W.width}px`!==z.before.width||`${W.height}px`!==z.before.height||typeof W.left==="number"&&`${W.left}px`!==z.before.left||typeof W.top==="number"&&`${W.top}px`!==z.before.top))return;if(B.current={el:z.el,before:z.before},z.artboardId)j0(z,W);else P0(z,W)},_=(Z)=>{let z=Z.data;if(z?.dgn!=="resize-failed"&&z?.dgn!=="resize-artboard-failed")return;if(Z.source!==window.parent)return;let W=B.current;if(!W)return;if(W.el.style.width=W.before.width??"",W.el.style.height=W.before.height??"",W.before.left!==null||W.el.style.left)W.el.style.left=W.before.left??"";if(W.before.top!==null||W.el.style.top)W.el.style.top=W.before.top??"";if(W.before.transform!==null||W.el.style.transform)W.el.style.transform=W.before.transform??"";B.current=null};return U.addEventListener("pointerdown",H),window.addEventListener("pointermove",Y),window.addEventListener("pointerup",L),window.addEventListener("pointercancel",L),window.addEventListener("message",_),()=>{U.removeEventListener("pointerdown",H),window.removeEventListener("pointermove",Y),window.removeEventListener("pointerup",L),window.removeEventListener("pointercancel",L),window.removeEventListener("message",_)}},[K,N]),N0("div",{ref:J,"aria-hidden":"true"})}import{jsx as o,jsxs as R0}from"react/jsx-runtime";var T0=new Set(["drop-comment","tool","escape","hover"]);function J7(){return typeof document<"u"&&!document.querySelector(".dc-canvas")}function w7(Q,$){if(typeof document>"u")return null;let J=document.elementFromPoint(Q,$);if(!J)return null;if(J.closest(".cm-composer, .cm-thread, .cm-mention-popup, .cm-pin, [data-mc-hover-halo], [data-mc-selection-halo], .dc-el-resize-handle"))return null;let V=J.tagName;if(V==="HTML"||V==="BODY")return null;return J}function E0(Q,$){let J=w7(Q,$);if(!J)return null;return J.closest("[data-cd-id]")??J}function k0({children:Q,file:$}){let{tool:J,setTool:V}=G7(),q=B7(),B=u(null),[K,X]=$7(null),F=u(J);F.current=J;let j=I0(()=>()=>F.current,[]);p(()=>{if(J!=="comment")X(null)},[J]);let[N,U]=$7(null),[G,H]=$7(!1);return p(()=>{let Y=()=>H(J7());Y();let L=requestAnimationFrame(Y),_=setTimeout(Y,120);return()=>{cancelAnimationFrame(L),clearTimeout(_)}},[]),p(()=>{if(typeof document>"u")return;let Y=(L)=>{if(L.button!==0||!(L.metaKey||L.ctrlKey))return;if(!J7())return;if(e(L.target))return;let _=E0(L.clientX,L.clientY);if(!_)return;L.preventDefault(),L.stopImmediatePropagation();let Z=_.getAttribute("data-cd-id"),z=Y7({el:_,cdId:Z,artboardId:null});if(L.shiftKey)q.add(z);else q.replace(z);U(_)};return document.addEventListener("pointerdown",Y,!0),()=>document.removeEventListener("pointerdown",Y,!0)},[q]),p(()=>{if(q.selected.length===0)U(null)},[q.selected]),p(()=>{let Y=B.current;if(Y)Y.setAttribute("data-active-tool",J);if(typeof document<"u"&&document.body)document.body.setAttribute("data-active-tool",J);return()=>{Y?.removeAttribute("data-active-tool")}},[J]),p(()=>{if(typeof window>"u")return;let Y=(L)=>{let _=L.data;if(!_||typeof _!=="object"||_.dgn!=="tool-set")return;if(typeof _.tool==="string")V(_.tool)};return window.addEventListener("message",Y),()=>window.removeEventListener("message",Y)},[V]),o7({hostRef:B,getActiveTool:j,claimableActions:T0,callbacks:{onHover:({clientX:Y,clientY:L})=>{if(F.current!=="comment"||!J7()){X(null);return}let _=w7(Y,L);X((Z)=>Z===_?Z:_)},onTool:({tool:Y})=>V(Y),onEscape:()=>{if(F.current!=="move")V("move");if(X(null),q.clear(),typeof window<"u")try{window.parent.postMessage({dgn:"force-clear"},"*")}catch{}},onDropComment:({clientX:Y,clientY:L})=>b0(Y,L,q,$)}}),R0("div",{"data-mc-host":!0,ref:B,style:{display:"contents"},children:[Q,K?o(y0,{el:K}):null,N?o(w0,{el:N}):null,G?o(ZQ,{}):null,o(l7,{})]})}function w0({el:Q}){let $=u(null),J=u(Q);J.current=Q;let V=u(null);return p(()=>{let q=()=>{V.current=null;let B=$.current,K=J.current;if(B&&K?.isConnected){let X=K.getBoundingClientRect();if(X.width===0&&X.height===0)B.style.display="none";else B.style.display="block",B.style.left=`${Math.round(X.left)}px`,B.style.top=`${Math.round(X.top)}px`,B.style.width=`${Math.round(X.width)}px`,B.style.height=`${Math.round(X.height)}px`}else if(B)B.style.display="none";V.current=requestAnimationFrame(q)};return V.current=requestAnimationFrame(q),()=>{if(V.current!=null)cancelAnimationFrame(V.current)}},[]),o("div",{ref:$,"aria-hidden":"true","data-mc-selection-halo":"",style:{position:"fixed",display:"none",pointerEvents:"none",zIndex:2147483645,border:"1.5px solid var(--maude-hud-accent, oklch(0.680 0.180 268))",borderRadius:"3px",boxSizing:"border-box"}})}function y0({el:Q}){let $=u(null),J=u(Q);J.current=Q;let V=u(null);return p(()=>{let q=()=>{V.current=null;let B=$.current,K=J.current;if(B&&K?.isConnected){let X=K.getBoundingClientRect();if(X.width===0&&X.height===0)B.style.display="none";else B.style.display="block",B.style.left=`${Math.round(X.left)}px`,B.style.top=`${Math.round(X.top)}px`,B.style.width=`${Math.round(X.width)}px`,B.style.height=`${Math.round(X.height)}px`}else if(B)B.style.display="none";V.current=requestAnimationFrame(q)};return V.current=requestAnimationFrame(q),()=>{if(V.current!=null)cancelAnimationFrame(V.current)}},[]),o("div",{ref:$,"aria-hidden":"true","data-mc-hover-halo":"",style:{position:"fixed",display:"none",pointerEvents:"none",zIndex:2147483646,border:"2px solid var(--maude-hud-accent, #d63b1f)",borderRadius:"3px",boxSizing:"border-box"}})}function b0(Q,$,J,V){if(typeof document>"u")return;let q=M7(document,Q,$,{deep:!0});if(!q)q=M7(document,Q,$,{deep:!1});if(!q&&!J7()&&typeof document.elementsFromPoint==="function"){let K=document.elementsFromPoint(Q,$);for(let X of K){let F=X.closest?.("[data-cd-id]");if(!F)continue;if(!F.closest(".dc-artboard-body"))continue;let j=F.closest("[data-dc-screen]");q={el:F,cdId:F.getAttribute("data-cd-id"),artboardId:j?.getAttribute("data-dc-screen")??null};break}}if(!q&&J7()){let K=w7(Q,$);if(K)q={el:K,cdId:K.getAttribute("data-cd-id"),artboardId:null}}if(!q){let K={file:V,id:void 0,selector:"",artboardId:null,tag:"",classes:"",text:"",dom_path:[],bounds:{x:Q-12,y:$-12,w:24,h:24},html:""};qQ(K,Q,$);return}let B=Y7(q,V);J.replace(B),qQ(B,Q,$)}function qQ(Q,$,J){if(typeof document<"u")try{document.dispatchEvent(new CustomEvent("cm:open-composer",{detail:{selection:Q,clientX:$,clientY:J}}))}catch{}if(typeof window<"u")try{window.parent.postMessage({dgn:"comment-compose",selection:Q},"*")}catch{}}function GQ(Q,$){return h(e7,null,h(p7,null,h(k0,{file:$},h(Q))))}function C3(Q,$){let J=O0($.rootEl);if(!$.commentsEnabled){J.render(h(Q));return}let V=$.file??z7();J.render(h(v0,{initialCanvas:Q,file:V}))}var BQ="__maudeCanvasRuntime";function x0({Canvas:Q,file:$,onOk:J}){return p(()=>{J()},[]),GQ(Q,$)}class WQ extends _0{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(){this.props.onError()}componentDidUpdate(Q){if(Q.attempt!==this.props.attempt&&this.state.hasError)this.setState({hasError:!1})}render(){if(this.state.hasError)return this.props.fallback();return this.props.children}}function C0({message:Q}){return h("div",{className:"dc-hmr-holding",role:"status","aria-live":"polite",title:Q?`Holding last working render — ${Q}`:"Holding last working render"},"⏸ build error — držím poslední funkční verzi")}function v0({initialCanvas:Q,file:$}){let[{canvas:J,attempt:V},q]=$7({canvas:Q,attempt:0}),[B,K]=$7({on:!1}),X=u(null),F=u(J);F.current=J,p(()=>{let G={remount:(H)=>q((Y)=>({canvas:H,attempt:Y.attempt+1})),setHolding:(H,Y)=>K(H?{on:!0,message:Y}:{on:!1})};return window[BQ]=G,()=>{window[BQ]=void 0}},[]);let j=k7(()=>{X.current=F.current,K((G)=>G.on?{on:!1}:G)},[]),N=k7(()=>{K({on:!0,message:"render error"})},[]),U=k7(()=>{let G=X.current;return G?GQ(G,$):null},[$]);return h(A0,null,h(WQ,{attempt:V,onError:N,fallback:U},h(x0,{key:V,Canvas:J,file:$,onOk:j})),B.on?h(C0,{message:B.message}):null)}export{E0 as pickSpecimenSelectEl,C3 as mountCanvas,J7 as isBareSpecimen,WQ as CanvasErrorBoundary};
@@ -12,5 +12,15 @@
12
12
  "y-protocols_sync.js": 1000,
13
13
  "y-protocols_awareness.js": 3500,
14
14
  "lib0_decoding.js": 5500,
15
- "lib0_encoding.js": 5500
15
+ "lib0_encoding.js": 5500,
16
+ "remotion.js": 134000,
17
+ "@remotion_media.js": 337000,
18
+ "@remotion_player.js": 60000,
19
+ "@remotion_transitions.js": 40000,
20
+ "@remotion_transitions_fade.js": 400,
21
+ "@remotion_transitions_slide.js": 900,
22
+ "@remotion_transitions_wipe.js": 1500,
23
+ "@remotion_transitions_flip.js": 700,
24
+ "@remotion_transitions_clock-wipe.js": 36000,
25
+ "@remotion_transitions_none.js": 300
16
26
  }