@vibeflow-tools/cli 0.9.0 → 0.9.1

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.
@@ -1615,7 +1615,7 @@ npm run dev (NODE_ENV=development)
1615
1615
  next dev (or: npm run dev)
1616
1616
 
1617
1617
  # Vite
1618
- npm run dev (NODE_ENV=development)`)),rows.push(el("div",{className:"rq-note"},"Dev mode enables React debug stacks (_debugStack) and source maps. No Babel plugins or extra config required \u2014 file + line are resolved automatically via source maps."))),rows)}async function showPopover(element,x,y){if(!state.root)return;state.popover&&(state.popover.remove(),state.popover=null);let pointer=await buildSourcePointerAsync(element),selector=pointer.selector,cssSelector=buildCssSelector(element),displayName=pointer.display,targetIcon=el("div",{className:"popover-target-icon"},"\u2B21"),targetName=el("div",{className:"popover-target-name"},displayName.slice(0,50)),reactQuality=detectReactQuality(),showBadge=reactQuality!=="not-react"&&reactQuality!=="full",qualityTooltip={none:"React production build \u2014 no component context available (click to learn more)",partial:"React partial context \u2014 component name only, no source file (click to learn more)",full:"Drag to move","not-react":"Drag to move"},dragHandleClass=showBadge?`popover-drag-handle popover-drag-handle--quality-${reactQuality}`:"popover-drag-handle",dragHandle=el("div",{className:dragHandleClass,title:qualityTooltip[reactQuality]??"Drag to move"});if(showBadge)dragHandle.appendChild(document.createTextNode("\u26A0"));else{let gripSvg=document.createElementNS("http://www.w3.org/2000/svg","svg");gripSvg.setAttribute("width","12"),gripSvg.setAttribute("height","16"),gripSvg.setAttribute("viewBox","0 0 12 16"),gripSvg.setAttribute("fill","currentColor"),gripSvg.setAttribute("aria-hidden","true");let gripDots=[[3,3],[9,3],[3,8],[9,8],[3,13],[9,13]];for(let[cx,cy]of gripDots){let circle=document.createElementNS("http://www.w3.org/2000/svg","circle");circle.setAttribute("cx",String(cx)),circle.setAttribute("cy",String(cy)),circle.setAttribute("r","1.5"),gripSvg.appendChild(circle)}dragHandle.appendChild(gripSvg)}let header=el("div",{className:"popover-header"},targetIcon,targetName,dragHandle),sourceRow=el("div",{className:"popover-source"});if(pointer.file){let label=pointer.file.replace(/\\/g,"/").split("/").slice(-2).join("/")+(pointer.line!=null?`:${pointer.line}`:""),srcLink=el("a",{href:`vscode://file${pointer.file}${pointer.line!=null?`:${pointer.line}`:""}`,target:"_blank",title:pointer.file},label);pointer.component?sourceRow.append(srcLink,el("span",{className:"popover-source-sep"}," \xB7 \u2B21 "+pointer.component)):sourceRow.appendChild(srcLink)}else pointer.component&&sourceRow.appendChild(el("span",null,"\u2B21 "+pointer.component));let titleInput=el("input",{type:"text",placeholder:"Task title..."}),textarea=el("textarea",{placeholder:"Describe your feedback..."}),typePicker=buildTypePickerEl("Task"),titleRow=el("div",{className:"popover-title-row"},typePicker.el,titleInput),body=el("div",{className:"popover-body"},titleRow,textarea),btnSave=el("button",{className:"btn-primary"},"Save"),btnCancel=el("button",null,"Cancel"),spacer=el("div",{className:"popover-actions-spacer"}),actions=el("div",{className:"popover-actions"},btnSave,btnCancel,spacer),popover=el("div",{className:"vibeflow-popover"},header,sourceRow,body,actions);state.popover=popover,showBadge&&!hasShownQualityModal()&&(markQualityModalShown(),window.setTimeout(()=>showReactQualityModal(reactQuality),200)),showBadge&&dragHandle.addEventListener("click",e=>{e.stopPropagation(),showReactQualityModal(reactQuality)}),popover.addEventListener("click",e=>{var _a;e.target.closest(".type-picker")||(_a=popover.querySelector(".type-picker-dropdown"))==null||_a.classList.remove("open")});let posX=x!==void 0?x:element.getBoundingClientRect().left,posY=y!==void 0?y:element.getBoundingClientRect().bottom+8;popover.style.left=`${Math.min(posX,window.innerWidth-620)}px`,popover.style.top=`${Math.min(posY,window.innerHeight-350)}px`;let dragState=null;dragHandle.addEventListener("pointerdown",e=>{e.preventDefault(),dragHandle.setPointerCapture(e.pointerId),dragState={startX:e.clientX,startY:e.clientY,origLeft:parseInt(popover.style.left,10)||0,origTop:parseInt(popover.style.top,10)||0},popover.classList.add("popover-dragging")}),dragHandle.addEventListener("pointermove",e=>{if(!dragState)return;let dx=e.clientX-dragState.startX,dy=e.clientY-dragState.startY,maxX=window.innerWidth-(popover.offsetWidth||480),maxY=window.innerHeight-(popover.offsetHeight||250);popover.style.left=`${Math.max(0,Math.min(maxX,dragState.origLeft+dx))}px`,popover.style.top=`${Math.max(0,Math.min(maxY,dragState.origTop+dy))}px`}),dragHandle.addEventListener("pointerup",()=>{dragState=null,popover.classList.remove("popover-dragging")}),dragHandle.addEventListener("pointercancel",()=>{dragState=null,popover.classList.remove("popover-dragging")}),state.root.appendChild(popover),titleInput.focus(),btnSave.addEventListener("click",()=>{var _a,_b;let text=textarea.value.trim(),rawTitle=titleInput.value.trim();if(!rawTitle){titleInput.classList.remove("input-error"),titleInput.offsetWidth,titleInput.classList.add("input-error"),titleInput.focus();let clear=()=>{titleInput.classList.remove("input-error"),titleInput.removeEventListener("input",clear)};titleInput.addEventListener("input",clear);return}let title=rawTitle;if(!text&&!title)return;let rawInnerText=((_a=element.innerText)==null?void 0:_a.trim())??"",capturedHtmlText=rawInnerText?rawInnerText.slice(0,300):void 0,selectedType=typePicker.getValue(),desc=text||title;if(selectedType==="Bug"){let logs=getRecordedLogs();logs&&(desc+=logs)}submitTask(selector,cssSelector,title,desc,void 0,{file:pointer.file,line:pointer.line,col:pointer.col,component:pointer.component},selectedType||void 0,capturedHtmlText),(_b=state.popover)==null||_b.remove(),state.popover=null,clearAnnotateHighlight(),flashOverlayTrigger()}),btnCancel.addEventListener("click",()=>{var _a;(_a=state.popover)==null||_a.remove(),state.popover=null,clearAnnotateHighlight()})}function toggleSidebar(){fetchTasks()}function hasPrototypingApi2(){return typeof window<"u"&&"__vf_prototyping"in window}function openPrototypingPanel2(){let api=window.__vf_prototyping;api==null||api.openPanel()}function showContextMenu(element,x,y){if(hideContextMenu(),state.disabled)return;let displayName=buildSourcePointer(element).display;if(setAnnotateHighlight(element),!state.root)return;let menu=el("div",{className:"vibeflow-context-menu"});menu.style.left=`${Math.min(x,window.innerWidth-220)}px`,menu.style.top=`${Math.min(y,window.innerHeight-200)}px`;let annotateBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F4DD}"),`Annotate "${displayName.slice(0,30)}"`);annotateBtn.addEventListener("click",()=>{hideContextMenu(!0),showPopover(element,x,y)}),menu.appendChild(annotateBtn);let inspectBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F50D}"),"Inspect selector");if(inspectBtn.addEventListener("click",()=>{hideContextMenu(),buildSourcePointerAsync(element).then(ptr=>showInspectModal(element,ptr))}),menu.appendChild(inspectBtn),hasPrototypingApi2()){let prototypingBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F3A8}"),"Prototyping");prototypingBtn.addEventListener("click",()=>{hideContextMenu(),openPrototypingPanel2()}),menu.appendChild(prototypingBtn)}if((()=>{try{return localStorage.getItem(TRIGGER_HIDDEN_KEY)==="1"}catch{return!1}})()){let showBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F441}"),"Show Vibeflow");showBtn.addEventListener("click",()=>{hideContextMenu(),showOverlayTrigger()}),menu.appendChild(showBtn)}else{let hideBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F441}"),"Hide Vibeflow");hideBtn.addEventListener("click",()=>{hideContextMenu(),hideOverlayTrigger()}),menu.appendChild(hideBtn)}let disableBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F6AB}"),"Disable Vibeflow");disableBtn.addEventListener("click",()=>{hideContextMenu(),disableVibeflowOverlay()}),menu.appendChild(disableBtn),state.contextMenu=menu,state.root.appendChild(menu),setTimeout(()=>{document.addEventListener("click",()=>hideContextMenu(),{once:!0})},0)}function hideContextMenu(keepHighlight){state.contextMenu&&(state.contextMenu.remove(),state.contextMenu=null),keepHighlight||clearAnnotateHighlight()}function setupKeyboardShortcuts(host){document.addEventListener("keydown",e=>{e.altKey&&e.key==="a"&&(e.preventDefault(),toggleAnnotationMode(host)),e.altKey&&e.key==="s"&&(e.preventDefault(),toggleSidebar()),e.key==="Escape"&&(state.contextMenu?hideContextMenu():state.popover?(state.popover.remove(),state.popover=null,clearAnnotateHighlight()):state.annotationMode?toggleAnnotationMode(host):state.sidebarPinned&&void 0)},!0)}function toggleAnnotationMode(host){state.annotationMode=!state.annotationMode,document.body.classList.toggle("vibeflow-overlay-active",state.annotationMode),state.annotationMode,state.annotationMode?startAnnotationHover(host):(stopAnnotationHover(host),state.popover&&(state.popover.remove(),state.popover=null))}function setupContextMenuListener(host){document.addEventListener("contextmenu",e=>{let target=e.target;!target||target===document.body||target===document.documentElement||e.composedPath().indexOf(host)===-1&&(e.preventDefault(),showContextMenu(target,e.clientX,e.clientY))},!0)}function setupClickToAnnotate(host){document.addEventListener("click",e=>{if(!state.annotationMode||e.composedPath().indexOf(host)!==-1)return;let target=e.target;!target||target===document.body||target===document.documentElement||(e.preventDefault(),e.stopPropagation(),showPopover(target,e.clientX,e.clientY))},!0)}function setupSpaNavigation(onRouteChange){let _protoOrigPush=history.pushState.bind(history);history.pushState=(...args)=>{_protoOrigPush(...args),onRouteChange()};let _protoOrigReplace=history.replaceState.bind(history);history.replaceState=(...args)=>{_protoOrigReplace(...args),onRouteChange()},window.addEventListener("popstate",onRouteChange),window.addEventListener("hashchange",onRouteChange)}var import_react26=__toESM(require_react(),1),import_client=__toESM(require_client(),1);function main(){startRecording();let selfScript=document.querySelector("script[data-board-id]")??document.querySelector('script[src*="vibeflow-overlay"]');selfScript&&!selfScript.hasAttribute("data-vibeflow-overlay")&&selfScript.setAttribute("data-vibeflow-overlay",""),selfScript!=null&&selfScript.dataset.boardId&&!PROTO_CONFIG.boardId&&(PROTO_CONFIG.boardId=selfScript.dataset.boardId);let globalBoardId=window.__PROTO_BOARD_ID;if(globalBoardId&&!PROTO_CONFIG.boardId&&(PROTO_CONFIG.boardId=globalBoardId),selfScript!=null&&selfScript.dataset.overlayApiKey&&!PROTO_CONFIG.overlayApiKey&&(PROTO_CONFIG.overlayApiKey=selfScript.dataset.overlayApiKey),document.getElementById("vibeflow-studio-root"))return;try{localStorage.removeItem(TRIGGER_HIDDEN_KEY)}catch{}let{host,root}=setupShadowDom();state.host=host,state.root=root,loadPrefs();let indicatorContainer=el("div",{className:"vibeflow-indicators"});state.indicatorContainer=indicatorContainer,root.appendChild(indicatorContainer);let reactContainer=document.createElement("div");reactContainer.className="vibeflow-react-root",root.appendChild(reactContainer),(0,import_client.createRoot)(reactContainer).render(import_react26.default.createElement(OverlayApp,{onOpenKanban:()=>{if(PROTO_CONFIG.boardId){let origin=new URL(PROTO_CONFIG.apiUrl).origin;window.open(`${origin}/kanban?board=${encodeURIComponent(PROTO_CONFIG.boardId)}`,"_blank","noopener")}else if(PROTO_CONFIG.wsUrl){let kanbanUrl=PROTO_CONFIG.apiUrl.replace("/api/tasks","/kanban");window.open(kanbanUrl,"_blank","noopener")}},onSubmitTask:(selector,cssSelector,title,description,status,type,meta)=>{submitTask(selector,cssSelector,title,description,status,meta,type)}})),state.onTasksFetched=()=>{renderIndicators()},state.onTasksUpdatedMessage=fetchTasks,connectWS(),setupWsVisibilityReconnect(),fetchTasks(),fetchPages(),setupKeyboardShortcuts(host),setupContextMenuListener(host),setupClickToAnnotate(host),setupIndicatorScrollRefresh(),setupInteractionDebounce(host),setupClickOutsideTooltipClose(host),setupSpaNavigation(()=>{location.href!==state.currentHref&&(state.currentHref=location.href,renderIndicators())})}main();})();
1618
+ npm run dev (NODE_ENV=development)`)),rows.push(el("div",{className:"rq-note"},"Dev mode enables React debug stacks (_debugStack) and source maps. No Babel plugins or extra config required \u2014 file + line are resolved automatically via source maps."))),rows)}async function showPopover(element,x,y){if(!state.root)return;state.popover&&(state.popover.remove(),state.popover=null);let pointer=await buildSourcePointerAsync(element),selector=pointer.selector,cssSelector=buildCssSelector(element),displayName=pointer.display,targetIcon=el("div",{className:"popover-target-icon"},"\u2B21"),targetName=el("div",{className:"popover-target-name"},displayName.slice(0,50)),reactQuality=detectReactQuality(),showBadge=reactQuality!=="not-react"&&reactQuality!=="full",qualityTooltip={none:"React production build \u2014 no component context available (click to learn more)",partial:"React partial context \u2014 component name only, no source file (click to learn more)",full:"Drag to move","not-react":"Drag to move"},dragHandleClass=showBadge?`popover-drag-handle popover-drag-handle--quality-${reactQuality}`:"popover-drag-handle",dragHandle=el("div",{className:dragHandleClass,title:qualityTooltip[reactQuality]??"Drag to move"});if(showBadge)dragHandle.appendChild(document.createTextNode("\u26A0"));else{let gripSvg=document.createElementNS("http://www.w3.org/2000/svg","svg");gripSvg.setAttribute("width","12"),gripSvg.setAttribute("height","16"),gripSvg.setAttribute("viewBox","0 0 12 16"),gripSvg.setAttribute("fill","currentColor"),gripSvg.setAttribute("aria-hidden","true");let gripDots=[[3,3],[9,3],[3,8],[9,8],[3,13],[9,13]];for(let[cx,cy]of gripDots){let circle=document.createElementNS("http://www.w3.org/2000/svg","circle");circle.setAttribute("cx",String(cx)),circle.setAttribute("cy",String(cy)),circle.setAttribute("r","1.5"),gripSvg.appendChild(circle)}dragHandle.appendChild(gripSvg)}let header=el("div",{className:"popover-header"},targetIcon,targetName,dragHandle),sourceRow=el("div",{className:"popover-source"});if(pointer.file){let label=pointer.file.replace(/\\/g,"/").split("/").slice(-2).join("/")+(pointer.line!=null?`:${pointer.line}`:""),srcLink=el("a",{href:`vscode://file${pointer.file}${pointer.line!=null?`:${pointer.line}`:""}`,target:"_blank",title:pointer.file},label);pointer.component?sourceRow.append(srcLink,el("span",{className:"popover-source-sep"}," \xB7 \u2B21 "+pointer.component)):sourceRow.appendChild(srcLink)}else pointer.component&&sourceRow.appendChild(el("span",null,"\u2B21 "+pointer.component));let titleInput=el("input",{type:"text",placeholder:"Task title..."}),textarea=el("textarea",{placeholder:"Describe your feedback..."}),typePicker=buildTypePickerEl("Task"),titleRow=el("div",{className:"popover-title-row"},typePicker.el,titleInput),body=el("div",{className:"popover-body"},titleRow,textarea),btnSave=el("button",{className:"btn-primary"},"Save"),btnCancel=el("button",null,"Cancel"),spacer=el("div",{className:"popover-actions-spacer"}),actions=el("div",{className:"popover-actions"},btnSave,btnCancel,spacer),popover=el("div",{className:"vibeflow-popover"},header,sourceRow,body,actions);state.popover=popover,showBadge&&!hasShownQualityModal()&&(markQualityModalShown(),window.setTimeout(()=>showReactQualityModal(reactQuality),200)),showBadge&&dragHandle.addEventListener("click",e=>{e.stopPropagation(),showReactQualityModal(reactQuality)}),popover.addEventListener("click",e=>{var _a;e.target.closest(".type-picker")||(_a=popover.querySelector(".type-picker-dropdown"))==null||_a.classList.remove("open")});let posX=x!==void 0?x:element.getBoundingClientRect().left,posY=y!==void 0?y:element.getBoundingClientRect().bottom+8;popover.style.left=`${Math.min(posX,window.innerWidth-620)}px`,popover.style.top=`${Math.min(posY,window.innerHeight-350)}px`;let dragState=null;dragHandle.addEventListener("pointerdown",e=>{e.preventDefault(),dragHandle.setPointerCapture(e.pointerId),dragState={startX:e.clientX,startY:e.clientY,origLeft:parseInt(popover.style.left,10)||0,origTop:parseInt(popover.style.top,10)||0},popover.classList.add("popover-dragging")}),dragHandle.addEventListener("pointermove",e=>{if(!dragState)return;let dx=e.clientX-dragState.startX,dy=e.clientY-dragState.startY,maxX=window.innerWidth-(popover.offsetWidth||480),maxY=window.innerHeight-(popover.offsetHeight||250);popover.style.left=`${Math.max(0,Math.min(maxX,dragState.origLeft+dx))}px`,popover.style.top=`${Math.max(0,Math.min(maxY,dragState.origTop+dy))}px`}),dragHandle.addEventListener("pointerup",()=>{dragState=null,popover.classList.remove("popover-dragging")}),dragHandle.addEventListener("pointercancel",()=>{dragState=null,popover.classList.remove("popover-dragging")}),state.root.appendChild(popover),titleInput.focus(),btnSave.addEventListener("click",()=>{var _a,_b;let text=textarea.value.trim(),rawTitle=titleInput.value.trim();if(!rawTitle){titleInput.classList.remove("input-error"),titleInput.offsetWidth,titleInput.classList.add("input-error"),titleInput.focus();let clear=()=>{titleInput.classList.remove("input-error"),titleInput.removeEventListener("input",clear)};titleInput.addEventListener("input",clear);return}let title=rawTitle;if(!text&&!title)return;let rawInnerText=((_a=element.innerText)==null?void 0:_a.trim())??"",capturedHtmlText=rawInnerText?rawInnerText.slice(0,300):void 0,selectedType=typePicker.getValue(),desc=text||title;if(selectedType==="Bug"){let logs=getRecordedLogs();logs&&(desc+=logs)}submitTask(selector,cssSelector,title,desc,void 0,{file:pointer.file,line:pointer.line,col:pointer.col,component:pointer.component},selectedType||void 0,capturedHtmlText),(_b=state.popover)==null||_b.remove(),state.popover=null,clearAnnotateHighlight(),flashOverlayTrigger()}),btnCancel.addEventListener("click",()=>{var _a;(_a=state.popover)==null||_a.remove(),state.popover=null,clearAnnotateHighlight()})}function toggleSidebar(){fetchTasks()}function hasPrototypingApi2(){return typeof window<"u"&&"__vf_prototyping"in window}function openPrototypingPanel2(){let api=window.__vf_prototyping;api==null||api.openPanel()}function showContextMenu(element,x,y){if(hideContextMenu(),state.disabled)return;let displayName=buildSourcePointer(element).display;if(setAnnotateHighlight(element),!state.root)return;let menu=el("div",{className:"vibeflow-context-menu"});menu.style.left=`${Math.min(x,window.innerWidth-220)}px`,menu.style.top=`${Math.min(y,window.innerHeight-200)}px`;let annotateBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F4DD}"),`Annotate "${displayName.slice(0,30)}"`);annotateBtn.addEventListener("click",()=>{hideContextMenu(!0),showPopover(element,x,y)}),menu.appendChild(annotateBtn);let inspectBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F50D}"),"Inspect selector");if(inspectBtn.addEventListener("click",()=>{hideContextMenu(),buildSourcePointerAsync(element).then(ptr=>showInspectModal(element,ptr))}),menu.appendChild(inspectBtn),hasPrototypingApi2()){let prototypingBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F3A8}"),"Prototyping");prototypingBtn.addEventListener("click",()=>{hideContextMenu(),openPrototypingPanel2()}),menu.appendChild(prototypingBtn)}if((()=>{try{return localStorage.getItem(TRIGGER_HIDDEN_KEY)==="1"}catch{return!1}})()){let showBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F441}"),"Show Vibeflow");showBtn.addEventListener("click",()=>{hideContextMenu(),showOverlayTrigger()}),menu.appendChild(showBtn)}else{let hideBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F441}"),"Hide Vibeflow");hideBtn.addEventListener("click",()=>{hideContextMenu(),hideOverlayTrigger()}),menu.appendChild(hideBtn)}let disableBtn=el("button",null,el("span",{className:"menu-icon"},"\u{1F6AB}"),"Disable Vibeflow");disableBtn.addEventListener("click",()=>{hideContextMenu(),disableVibeflowOverlay()}),menu.appendChild(disableBtn),state.contextMenu=menu,state.root.appendChild(menu),setTimeout(()=>{document.addEventListener("click",()=>hideContextMenu(),{once:!0})},0)}function hideContextMenu(keepHighlight){state.contextMenu&&(state.contextMenu.remove(),state.contextMenu=null),keepHighlight||clearAnnotateHighlight()}function setupKeyboardShortcuts(host){document.addEventListener("keydown",e=>{e.altKey&&e.key==="a"&&(e.preventDefault(),toggleAnnotationMode(host)),e.altKey&&e.key==="s"&&(e.preventDefault(),toggleSidebar()),e.key==="Escape"&&(state.contextMenu?hideContextMenu():state.popover?(state.popover.remove(),state.popover=null,clearAnnotateHighlight()):state.annotationMode?toggleAnnotationMode(host):state.sidebarPinned&&void 0)},!0)}function toggleAnnotationMode(host){state.annotationMode=!state.annotationMode,document.body.classList.toggle("vibeflow-overlay-active",state.annotationMode),state.annotationMode,state.annotationMode?startAnnotationHover(host):(stopAnnotationHover(host),state.popover&&(state.popover.remove(),state.popover=null))}function setupContextMenuListener(host){document.addEventListener("contextmenu",e=>{let target=e.target;!target||!(target instanceof Element)||target===document.body||target===document.documentElement||e.composedPath().indexOf(host)===-1&&(e.preventDefault(),showContextMenu(target,e.clientX,e.clientY))},!0)}function setupClickToAnnotate(host){document.addEventListener("click",e=>{if(!state.annotationMode||e.composedPath().indexOf(host)!==-1)return;let target=e.target;!target||!(target instanceof Element)||target===document.body||target===document.documentElement||(e.preventDefault(),e.stopPropagation(),showPopover(target,e.clientX,e.clientY))},!0)}function setupSpaNavigation(onRouteChange){let _protoOrigPush=history.pushState.bind(history);history.pushState=(...args)=>{_protoOrigPush(...args),onRouteChange()};let _protoOrigReplace=history.replaceState.bind(history);history.replaceState=(...args)=>{_protoOrigReplace(...args),onRouteChange()},window.addEventListener("popstate",onRouteChange),window.addEventListener("hashchange",onRouteChange)}var import_react26=__toESM(require_react(),1),import_client=__toESM(require_client(),1);function main(){startRecording();let selfScript=document.querySelector("script[data-board-id]")??document.querySelector('script[src*="vibeflow-overlay"]');selfScript&&!selfScript.hasAttribute("data-vibeflow-overlay")&&selfScript.setAttribute("data-vibeflow-overlay",""),selfScript!=null&&selfScript.dataset.boardId&&!PROTO_CONFIG.boardId&&(PROTO_CONFIG.boardId=selfScript.dataset.boardId);let globalBoardId=window.__PROTO_BOARD_ID;if(globalBoardId&&!PROTO_CONFIG.boardId&&(PROTO_CONFIG.boardId=globalBoardId),selfScript!=null&&selfScript.dataset.overlayApiKey&&!PROTO_CONFIG.overlayApiKey&&(PROTO_CONFIG.overlayApiKey=selfScript.dataset.overlayApiKey),document.getElementById("vibeflow-studio-root"))return;try{localStorage.removeItem(TRIGGER_HIDDEN_KEY)}catch{}let{host,root}=setupShadowDom();state.host=host,state.root=root,loadPrefs();let indicatorContainer=el("div",{className:"vibeflow-indicators"});state.indicatorContainer=indicatorContainer,root.appendChild(indicatorContainer);let reactContainer=document.createElement("div");reactContainer.className="vibeflow-react-root",root.appendChild(reactContainer),(0,import_client.createRoot)(reactContainer).render(import_react26.default.createElement(OverlayApp,{onOpenKanban:()=>{if(PROTO_CONFIG.boardId){let origin=new URL(PROTO_CONFIG.apiUrl).origin;window.open(`${origin}/kanban?board=${encodeURIComponent(PROTO_CONFIG.boardId)}`,"_blank","noopener")}else if(PROTO_CONFIG.wsUrl){let kanbanUrl=PROTO_CONFIG.apiUrl.replace("/api/tasks","/kanban");window.open(kanbanUrl,"_blank","noopener")}},onSubmitTask:(selector,cssSelector,title,description,status,type,meta)=>{submitTask(selector,cssSelector,title,description,status,meta,type)}})),state.onTasksFetched=()=>{renderIndicators()},state.onTasksUpdatedMessage=fetchTasks,connectWS(),setupWsVisibilityReconnect(),fetchTasks(),fetchPages(),setupKeyboardShortcuts(host),setupContextMenuListener(host),setupClickToAnnotate(host),setupIndicatorScrollRefresh(),setupInteractionDebounce(host),setupClickOutsideTooltipClose(host),setupSpaNavigation(()=>{location.href!==state.currentHref&&(state.currentHref=location.href,renderIndicators())})}main();})();
1619
1619
  /*! Bundled license information:
1620
1620
 
1621
1621
  react/cjs/react.production.min.js: