@ytspar/devbar 1.12.0 → 1.12.1-canary.5f2060e
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.
|
@@ -439,5 +439,5 @@ ${JSON.stringify(l,null,2)}
|
|
|
439
439
|
`;function ou(A,n={}){let{format:o="jpeg",quality:l=.7}=n;return o==="png"?A.toDataURL("image/png"):A.toDataURL("image/jpeg",l)}function V9(){if(document.getElementById(ry))return()=>{};let n=document.createElement("style");return n.id=ry,n.textContent=K9,document.head.appendChild(n),()=>{n.remove()}}function iu(A={}){document.body.classList.add("devbar-capturing"),document.activeElement instanceof HTMLElement&&document.activeElement.blur();let n=A.hideDevbar?V9():null;return()=>{n?.(),document.body.classList.remove("devbar-capturing")}}function su(A){return new Promise(n=>setTimeout(n,A))}async function Rp(A){return new Promise((n,o)=>{A.toBlob(async l=>{if(!l){o(new Error("Failed to create blob from canvas"));return}try{await navigator.clipboard.write([new ClipboardItem({"image/png":l})]),n()}catch(c){o(c)}},"image/png")})}function ny(A,n,o){let l=new Blob([n],{type:o}),c=URL.createObjectURL(l),m=document.createElement("a");m.href=c,m.download=A,m.click(),URL.revokeObjectURL(c)}function Ay(A,n){let o=document.createElement("a");o.href=n,o.download=A,o.click()}function lu(A,n){if(mA(A.options.saveLocation,A.sweetlinkConnected)==="local"&&A.ws?.readyState===WebSocket.OPEN)A[n.savingFlag]=!0,A.render(),A.ws.send(JSON.stringify({type:n.type,data:n.data}));else{let l=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);ny(`${n.downloadFilename}-${l}.md`,n.downloadContent,n.downloadMimeType),A.handleNotification(n.notificationKey,n.notificationMessage,ZA)}}function ay(A,n){return{logging:!1,useCORS:!0,allowTaint:!0,scale:A,windowWidth:window.innerWidth,windowHeight:window.innerHeight,scrollX:n?-window.scrollX:0,scrollY:n?-window.scrollY:0,ignoreElements:o=>o.hasAttribute("data-devbar"),onclone:(o,l)=>{let c=document.createElement("style");c.textContent=["*, *::before, *::after {"," animation: none !important;"," mix-blend-mode: normal !important;","}"].join(`
|
|
440
440
|
`),l.ownerDocument.head.appendChild(c)}}}function G9(A,n){let o=window.innerWidth*n,l=window.innerHeight*n,c=window.scrollX*n,m=window.scrollY*n;if(A.width<=o&&A.height<=l)return A;let g=document.createElement("canvas");g.width=o,g.height=l;let v=g.getContext("2d");return v?(v.drawImage(A,c,m,o,l,0,0,o,l),g):A}async function oy(A,n){try{await navigator.clipboard.writeText(n),A.copiedPath=!0,A.copiedPathTimeout&&clearTimeout(A.copiedPathTimeout),A.copiedPathTimeout=setTimeout(()=>{A.copiedPath=!1,A.render()},$d),A.render()}catch(o){console.error("[GlobalDevBar] Failed to copy path:",o)}}async function iy(A,n=!1){if(A.capturing)return;let o=mA(A.options.saveLocation,A.sweetlinkConnected);if(!n&&o==="local"&&!A.sweetlinkConnected)return;let l=null;try{A.capturing=!0,A.render(),l=iu(),await su(ef);let m=await(await ei())(document.body,ay(tf,n));l(),l=null;let g=n?G9(m,tf):m;if(n)try{await Rp(g),A.copiedToClipboard=!0,A.render(),A.screenshotTimeout&&clearTimeout(A.screenshotTimeout),A.screenshotTimeout=setTimeout(()=>{A.copiedToClipboard=!1,A.render()},$d)}catch(v){console.error("[GlobalDevBar] Failed to copy to clipboard:",v)}else{let v=ou(g,{format:"jpeg",quality:A.options.screenshotQuality});if(o==="local"&&A.ws?.readyState===WebSocket.OPEN){let B={};A.lcpValue!==null&&(B.lcp=Math.round(A.lcpValue)),A.clsValue>0&&(B.cls=A.clsValue),A.inpValue>0&&(B.inp=Math.round(A.inpValue));let C=performance.getEntriesByType("paint").find(T=>T.name==="first-contentful-paint");C&&(B.fcp=Math.round(C.startTime));let E=0,D=performance.getEntriesByType("navigation")[0];D&&(E+=D.transferSize||0),performance.getEntriesByType("resource").forEach(T=>{E+=T.transferSize||0}),A.ws.send(JSON.stringify({type:"save-screenshot",data:{screenshot:v,width:g.width,height:g.height,logs:A.consoleLogs,url:window.location.href,timestamp:Date.now(),webVitals:Object.keys(B).length>0?B:void 0,pageSize:E>0?E:void 0}}))}else{let B=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);Ay(`devbar-screenshot-${B}.jpg`,v),A.handleNotification("screenshot","screenshot downloaded",ZA)}}}catch(c){console.error("[GlobalDevBar] Screenshot failed:",c),l&&l()}finally{A.capturing=!1,A.render()}}async function j9(A){if(A.designReviewInProgress||!A.sweetlinkConnected)return;let n=null;try{A.designReviewInProgress=!0,A.designReviewError=null,A.designReviewErrorTimeout&&(clearTimeout(A.designReviewErrorTimeout),A.designReviewErrorTimeout=null),A.render(),n=iu(),await su(ef);let l=await(await ei())(document.body,ay(1,!1));n(),n=null;let c=ou(l,{format:"png"});A.ws?.readyState===WebSocket.OPEN&&A.ws.send(JSON.stringify({type:"design-review-screenshot",data:{screenshot:c,width:l.width,height:l.height,logs:A.consoleLogs,url:window.location.href,timestamp:Date.now()}}))}catch(o){console.error("[GlobalDevBar] Design review failed:",o),n&&n(),A.designReviewInProgress=!1,A.render()}}function sy(A){A.sweetlinkConnected&&(A.ws?.readyState===WebSocket.OPEN&&A.ws.send(JSON.stringify({type:"check-api-key"})),qt(A),A.showDesignReviewConfirm=!0,A.render())}function ly(A){if(!A.apiKeyStatus?.pricing)return null;let n=window.innerWidth,o=window.innerHeight,l=Math.ceil(n*o/750),c=500,m=1500,g=l+c,{input:v,output:B}=A.apiKeyStatus.pricing,C=g/1e6*v,E=m/1e6*B,D=C+E;return{tokens:g+m,cost:D<.01?"<$0.01":`~$${D.toFixed(2)}`}}function uy(A){A.showDesignReviewConfirm=!1,A.apiKeyStatus=null,A.render()}function cy(A){A.showDesignReviewConfirm=!1,j9(A)}function Op(A,n){let o=A[n];qt(A),A[n]=!o,A.render()}function dy(A){Op(A,"showOutlineModal")}function fy(A){Op(A,"showSchemaModal")}function py(A){Op(A,"showA11yModal")}function hy(A,n){if(A.savingA11yAudit)return;let o=qs(n);lu(A,{type:"save-a11y",data:{markdown:o,url:window.location.href,title:document.title,timestamp:Date.now()},savingFlag:"savingA11yAudit",downloadFilename:"a11y-audit",downloadContent:o,downloadMimeType:"text/markdown",notificationKey:"a11y",notificationMessage:"a11y report downloaded"})}function my(A){if(A.savingOutline)return;let n=DA(),o=Yn(n);lu(A,{type:"save-outline",data:{outline:n,markdown:o,url:window.location.href,title:document.title,timestamp:Date.now()},savingFlag:"savingOutline",downloadFilename:"outline",downloadContent:o,downloadMimeType:"text/markdown",notificationKey:"outline",notificationMessage:"outline downloaded"})}function kp(A){return A.length===0?"_No logs_":A.map(n=>`- **[${new Date(n.timestamp).toLocaleTimeString()}]** \`${n.level}\` ${n.message}`).join(`
|
|
441
441
|
`)}function gy(A,n){if(A.savingConsoleLogs)return;let o=kp(n);lu(A,{type:"save-console-logs",data:{logs:n,markdown:o,url:window.location.href,title:document.title,timestamp:Date.now()},savingFlag:"savingConsoleLogs",downloadFilename:"console-logs",downloadContent:o,downloadMimeType:"text/markdown",notificationKey:"consoleLogs",notificationMessage:"console logs downloaded"})}function vy(A){if(A.savingSchema)return;let n=QA(),o=ri(n),l=ti(),c=SA(n,{missingTags:o,favicons:l});lu(A,{type:"save-schema",data:{schema:n,markdown:c,url:window.location.href,title:document.title,timestamp:Date.now()},savingFlag:"savingSchema",downloadFilename:"schema",downloadContent:c,downloadMimeType:"text/markdown",notificationKey:"schema",notificationMessage:"schema downloaded"})}function ni(A,n,o){if(df(o)){A.addSuccess(`${n} simulated`,o),A.addWarning(zw());return}let l=o.endsWith("downloaded");A.addSuccess(l?`${n} downloaded!`:`${n} saved!`,l?void 0:o)}function Jn(A,n,o,l){let m={error:"error",warn:"warning",info:"info"}[n],g=A.consoleFilter===n,v=document.createElement("span");return v.className="devbar-badge",Object.assign(v.style,{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"18px",height:"18px",padding:"0 5px",borderRadius:"9999px",backgroundColor:l,color:"#fff",fontSize:"0.625rem",fontWeight:"600",cursor:"pointer",boxShadow:g?`0 0 8px ${ee(l,80)}`:"none"}),v.textContent=o>99?"99+":String(o),$r(A,v,()=>`${o} console ${m}${o===1?"":"s"} (click to view)`),v.onclick=()=>{let B=A.consoleFilter===n?null:n;qt(A),A.consoleFilter=B,A.render()},v}function uu(A,n){let o=document.createElement("button");o.type="button",o.setAttribute("aria-label","Screenshot");let l=A.copiedToClipboard||A.copiedPath||A.lastScreenshot,c=A.capturing,m=mA(A.options.saveLocation,A.sweetlinkConnected),g=m==="local"&&!A.sweetlinkConnected&&!l;return Zr(A,o,n,(v,B)=>{if(A.copiedToClipboard){B.addSuccess("Copied to clipboard!");return}if(A.copiedPath){B.addSuccess("Path copied to clipboard!");return}if(A.lastScreenshot){let C=A.lastScreenshot;if(df(C)){ni(B,"Screenshot",C);return}if(C.endsWith("downloaded"))B.addSuccess("Screenshot downloaded!");else{B.addSuccess("Screenshot saved!",C);let D=document.createElement("div");Object.assign(D.style,{color:n,cursor:"pointer",fontSize:"0.625rem",marginTop:"6px",opacity:"0.8",transition:"opacity 150ms"}),D.textContent="copy path",D.onmouseenter=()=>{D.style.opacity="1"},D.onmouseleave=()=>{D.style.opacity="0.8"},D.onclick=async T=>{T.stopPropagation();try{await navigator.clipboard.writeText(C),D.textContent="\u2713 copied!",D.style.cursor="default",D.onclick=null}catch{D.textContent="\xD7 failed to copy",D.style.color=H.error}},v.appendChild(D)}return}if(B.addTitle("Screenshot"),B.addSectionHeader("Actions"),m==="local"&&!A.sweetlinkConnected)B.addShortcut("Shift+Click","Copy to clipboard"),B.addWarning("Sweetlink not connected. Switch save method to Auto or Download.");else{let C=m==="local"?"Save to file":"Download";B.addShortcut("Click",C),B.addShortcut("Shift+Click","Copy to clipboard"),B.addShortcut("Alt+Click","HiFi screenshot (pixel-perfect via daemon)"),B.addSectionHeader("Keyboard"),B.addShortcut("Cmd or Ctrl+Shift+S",C),B.addShortcut("Cmd or Ctrl+Shift+C","Copy")}}),Object.assign(o.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",minWidth:"24px",minHeight:"24px",flexShrink:"0",borderRadius:"50%",border:"1px solid",borderColor:l?n:ee(n,50),backgroundColor:l?ee(n,20):"transparent",color:l?n:ee(n,60),cursor:c?"not-allowed":"pointer",opacity:g?"0.4":"1",transition:"all 150ms"}),o.disabled=c,o.onclick=v=>{if(v.altKey){if(!A.ws||!A.sweetlinkConnected)return;A.ws.send(JSON.stringify({type:"hifi-screenshot"})),A.capturing=!0,A.render();return}A.lastScreenshot&&!v.shiftKey?oy(A,A.lastScreenshot):A.handleScreenshot(v.shiftKey)},A.copiedToClipboard||A.copiedPath||A.lastScreenshot?(o.textContent="\u2713",o.style.fontSize="0.6rem"):A.capturing?(o.textContent="...",o.style.fontSize="0.5rem"):o.appendChild(Mr("M19.844 7.938H7.938v11.905m0 11.113v11.906h11.905m23.019-11.906v11.906H30.956m11.906-23.018V7.938H30.956",{viewBox:"0 0 50.8 50.8",stroke:!0,strokeWidth:"4",children:[{type:"circle",cx:"25.4",cy:"25.4",r:"8.731"}]})),o}function wy(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label","AI Design Review");let o=!!A.designReviewError,l=A.designReviewInProgress||!!A.lastDesignReview||o,c=A.designReviewInProgress||!A.sweetlinkConnected,m=o?H.error:Pe.review;return Zr(A,n,m,(g,v)=>{if(A.designReviewInProgress){v.addProgress("AI Design Review in progress...");return}if(A.designReviewError){v.addError("Design review failed",A.designReviewError);return}if(A.lastDesignReview){ni(v,"Design review",A.lastDesignReview);return}v.addTitle("AI Design Review"),v.addDescription("Captures screenshot and sends to Claude for design analysis."),v.addSectionHeader("Requirements"),v.addShortcut("API Key","ANTHROPIC_API_KEY"),en()&&v.addWarning("Demo mode: no Claude request will be sent."),A.sweetlinkConnected||v.addWarning("Sweetlink not connected")}),Object.assign(n.style,Hr(m,l,c)),A.sweetlinkConnected||(n.style.opacity="0.5"),n.disabled=c,n.onclick=()=>sy(A),A.designReviewInProgress?(n.textContent="~",n.style.fontSize="0.5rem",n.style.animation="pulse 1s infinite"):A.designReviewError?(n.textContent="\xD7",n.style.fontSize="0.875rem",n.style.fontWeight="bold"):A.lastDesignReview?(n.textContent="v",n.style.fontSize="0.5rem"):n.appendChild(Mr("M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z",{fill:!0})),n}function by(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label","Document Outline");let o=A.showOutlineModal||!!A.lastOutline;return Zr(A,n,Pe.outline,(l,c)=>{if(A.lastOutline){ni(c,"Outline",A.lastOutline);return}c.addTitle("Document Outline"),c.addDescription("View page heading structure and save as markdown."),en()&&c.addWarning("Demo mode: save actions return example paths only."),A.options.saveLocation==="local"&&!A.sweetlinkConnected&&c.addWarning("Sweetlink not connected. Switch save method to Auto or Download.")}),Object.assign(n.style,Hr(Pe.outline,o,!1)),n.onclick=()=>dy(A),A.lastOutline?(n.textContent="v",n.style.fontSize="0.5rem"):n.appendChild(Mr("M3 4h18v2H3V4zm0 7h12v2H3v-2zm0 7h18v2H3v-2z",{fill:!0})),n}function By(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label","Page Schema");let o=A.showSchemaModal||!!A.lastSchema;return Zr(A,n,Pe.schema,(l,c)=>{if(A.lastSchema){ni(c,"Schema",A.lastSchema);return}c.addTitle("Page Schema"),c.addDescription("View JSON-LD, Open Graph, and other structured data."),en()&&c.addWarning("Demo mode: save actions return example paths only."),A.options.saveLocation==="local"&&!A.sweetlinkConnected&&c.addWarning("Sweetlink not connected. Switch save method to Auto or Download.")}),Object.assign(n.style,Hr(Pe.schema,o,!1)),n.onclick=()=>fy(A),A.lastSchema?(n.textContent="v",n.style.fontSize="0.5rem"):n.appendChild(Mr("M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z",{fill:!0})),n}function yy(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label","Accessibility Audit");let o=A.showA11yModal||!!A.lastA11yAudit;return Zr(A,n,Pe.a11y,(l,c)=>{if(A.lastA11yAudit){ni(c,"A11y report",A.lastA11yAudit);return}c.addTitle("Accessibility Audit"),c.addDescription("Run axe-core audit to check WCAG compliance."),en()&&c.addWarning("Demo mode: save actions return example paths only."),A.options.saveLocation==="local"&&!A.sweetlinkConnected&&c.addWarning("Sweetlink not connected. Switch save method to Auto or Download.")}),n.addEventListener("mouseenter",()=>Iw(),{once:!0}),Object.assign(n.style,Hr(Pe.a11y,o,!1)),n.onclick=()=>py(A),A.lastA11yAudit?(n.textContent="v",n.style.fontSize="0.5rem"):n.appendChild(Mr("M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z",{fill:!0})),n}function Cy(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label","Ruler");let o=A.rulerMode;return Zr(A,n,Pe.ruler,(l,c)=>{o?(c.addTitle("Ruler Mode Active"),c.addDescription("Click elements to pin measurements. Press Esc or click here to exit.")):(c.addTitle("Ruler"),c.addDescription("Measure element dimensions and positions on page."))}),Object.assign(n.style,Hr(Pe.ruler,o,!1)),n.onclick=()=>{A.rulerMode?(A.rulerMode=!1,A.rulerCleanup&&(A.rulerCleanup(),A.rulerCleanup=null)):(qt(A),A.rulerMode=!0,A.rulerCleanup=tb(A)),A.render()},o?(n.textContent="\u2716",n.style.fontSize="0.5rem"):n.appendChild(Mr("M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0zM14.5 12.5l2-2M11.5 9.5l2-2M8.5 6.5l2-2M17.5 15.5l2-2",{stroke:!0,strokeWidth:"2"})),n}function Ey(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label",A.recordingActive?"Stop Recording":"Start Recording");let o=A.recordingActive;if(Zr(A,n,Pe.error,(l,c)=>{if(o){let m=A.recordingStartedAt?((Date.now()-A.recordingStartedAt)/1e3).toFixed(0):"0";c.addTitle(`Recording: ${m}s`),c.addShortcut("Click","Stop recording & open viewer")}else A.lastViewerPath?(en()?(c.addSuccess("Demo recording simulated",A.lastViewerPath),c.addWarning("Demo only: no recording file was written.")):c.addSuccess("Last session recorded"),c.addShortcut("Click","Start new recording"),c.addShortcut("Shift+Click","Open last viewer")):(c.addTitle("Session Recording"),c.addShortcut("Click","Start recording (video + actions)"),en()&&c.addWarning("Demo mode: no video or action manifest will be recorded."))}),Object.assign(n.style,{...Hr("#ef4444",o,!1),borderColor:o?"#ef4444":ee("#ef4444",50),backgroundColor:o?ee("#ef4444",20):"transparent",color:o?"#ef4444":ee("#ef4444",60),...o&&{animation:"devbar-pulse 1.5s ease-in-out infinite"}}),n.onclick=l=>{if(l.shiftKey&&A.lastViewerPath&&!o){window.open(A.lastViewerPath,"_blank");return}if(!(!A.ws||!A.sweetlinkConnected))if(o){let c=window.open("about:blank","_blank");A.pendingViewerWindow=c,A.ws.send(JSON.stringify({type:"record-stop"})),A.recordingTimer&&clearInterval(A.recordingTimer),A.recordingActive=!1,A.recordingTimer=null,A.recordingStartedAt=null,A.render()}else A.ws.send(JSON.stringify({type:"record-start"})),A.recordingActive=!0,A.recordingStartedAt=Date.now(),A.recordingSessionId=null,A.recordingTimer=setInterval(()=>A.render(),1e3),A.render()},o){let l=document.createElement("span");Object.assign(l.style,{display:"block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#ef4444"}),n.appendChild(l)}else{let l=document.createElement("span");Object.assign(l.style,{display:"block",width:"8px",height:"8px",borderRadius:"50%",border:"2px solid currentColor"}),n.appendChild(l)}return n}function xy(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label",A.demoActive?"Demo in progress":"Start Demo");let o=A.demoActive;return Zr(A,n,Pe.info,(l,c)=>{o?(c.addTitle(`Demo: "${A.demoTitle??"Untitled"}"`),c.addShortcut(`${A.demoSectionCount} sections`,""),c.addShortcut("Click","Add screenshot to demo")):(c.addTitle("Demo Document"),c.addShortcut("Click","Start demo (prompts for title)"),en()&&c.addWarning("Demo mode: no markdown document will be written."))}),Object.assign(n.style,{...Hr(Pe.info,o,!1)}),n.onclick=()=>{if(!(!A.ws||!A.sweetlinkConnected))if(o)A.ws.send(JSON.stringify({type:"demo-screenshot"})),A.demoSectionCount++,A.render();else{let l=prompt("Demo title:");if(!l)return;A.ws.send(JSON.stringify({type:"demo-init",data:{title:l}})),A.demoActive=!0,A.demoTitle=l,A.demoSectionCount=0,A.render()}},o?(n.textContent=String(A.demoSectionCount),n.style.fontSize="0.6rem"):n.appendChild(Mr("M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",{stroke:!0,strokeWidth:"2"})),n}function cu(A){let n=document.createElement("button");n.type="button",n.setAttribute("data-testid","devbar-settings-button"),n.setAttribute("aria-label","Settings"),Zr(A,n,H.textSecondary,(c,m)=>{m.addTitle("Settings"),m.addSectionHeader("Keyboard"),m.addShortcut("Cmd or Ctrl+Shift+M","Toggle compact mode")});let o=A.showSettingsPopover,l=H.textSecondary;return Object.assign(n.style,Hr(l,o,!1)),n.onclick=()=>{let c=A.showSettingsPopover;qt(A),A.showSettingsPopover=!c,A.render()},n.appendChild(Mr("M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",{stroke:!0,children:[{type:"circle",cx:"12",cy:"12",r:"3"}]})),n}function Fy(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label",A.compactMode?"Switch to expanded mode":"Switch to compact mode");let o=A.compactMode,{accentColor:l}=A.options,c=H.textSecondary;Object.assign(n.style,Hr(c,!1,!1)),n.style.borderColor=ee(l,38),$r(A,n,()=>o?"Expand (Cmd or Ctrl+Shift+M)":"Compact (Cmd or Ctrl+Shift+M)",{onEnter:()=>{n.style.borderColor=l,n.style.backgroundColor=ee(l,13),n.style.color=c},onLeave:()=>{n.style.borderColor=ee(l,38),n.style.backgroundColor="transparent",n.style.color=ee(c,60)}}),n.onclick=()=>{A.toggleCompactMode()};let m=o?"9 18 15 12 9 6":"15 18 9 12 15 6";return n.appendChild(Mr("",{stroke:!0,children:[{type:"polyline",points:m}]})),n}function Dy(A,n=[]){if(!A.container)return;let{position:o,accentColor:l}=A.options,{errorCount:c,warningCount:m,infoCount:g}=A.getLogCounts(),v={"bottom-left":{bottom:"20px",left:"80px"},"bottom-right":{bottom:"20px",right:"16px"},"top-left":{top:"20px",left:"80px"},"top-right":{top:"20px",right:"16px"},"bottom-center":{bottom:"12px",left:"50%",transform:"translateX(-50%)"}},B=v[o]??v["bottom-left"],C=A.container;n.length>0?C.dataset.devbarCustomControls="true":delete C.dataset.devbarCustomControls,A.resetPositionStyles(C),Object.assign(C.style,{position:"fixed",...B,zIndex:"9999",backgroundColor:"var(--devbar-color-bg-card)",border:`1px solid ${l}`,borderRadius:"20px",color:l,boxShadow:`${bt.shadows.dropToolbar}, 0 0 0 1px ${ee(l,10)}`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",padding:"6px 10px",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px",boxSizing:"border-box",maxWidth:o==="bottom-center"?"calc(100vw - 32px)":"calc(100vw - 96px)",minWidth:"0",fontFamily:Bt,fontSize:"0.6875rem"});let E=Ys(A),D=E.querySelector(".devbar-conn-dot");if($r(A,E,()=>ta(A.sweetlinkConnected)),E.onclick=k=>{k.stopPropagation(),Bo(A,D),A.collapsed=!0,A.debug.state("Collapsed DevBar from compact mode"),A.render()},C.appendChild(E),c>0&&C.appendChild(Jn(A,"error",c,Pe.error)),m>0&&C.appendChild(Jn(A,"warn",m,Pe.warning)),g>0&&C.appendChild(Jn(A,"info",g,Pe.info)),A.options.showScreenshot&&C.appendChild(uu(A,l)),C.appendChild(cu(A)),n.length>0){let k=A.options.accentColor;for(let V of n)C.appendChild(yo(V,k))}let T=document.createElement("button");T.type="button",Object.assign(T.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",borderRadius:"50%",border:`1px solid ${ee(l,38)}`,backgroundColor:"transparent",color:ee(l,60),cursor:"pointer",fontSize:"0.5rem",transition:"all 150ms"}),T.textContent="\u27EB",$r(A,T,()=>"Expand DevBar",{onEnter:()=>{T.style.backgroundColor=ee(l,13),T.style.borderColor=l,T.style.color=l},onLeave:()=>{T.style.backgroundColor="transparent",T.style.borderColor=ee(l,38),T.style.color=ee(l,60)}}),T.onclick=()=>{A.toggleCompactMode()},C.appendChild(T)}function ba(A,n,o={}){let l=typeof window<"u"?window.location.href:"unknown",c=typeof window<"u"?`${window.innerWidth}x${window.innerHeight} @${window.devicePixelRatio||1}x`:"unknown",m=A.lastScreenshot??"not captured yet",g=o.artifactPath??"not saved yet",v=`Run pnpm sweetlink inspect --url ${l} before acting to refresh @e refs.`,B=[`# ${n}`,`- URL: ${l}`,`- Viewport: ${c}`,`- Screenshot: ${m}`,`- Artifact: ${g}`,`- Refs: ${v}`];return o.observation&&B.push(`- Observation: ${o.observation}`),{title:"Agent Context",items:[{label:"URL",value:l},{label:"Viewport",value:c},{label:"Screenshot",value:m},{label:"Artifact",value:g},{label:"Refs",value:v}],copyText:B.join(`
|
|
442
|
-
`)}}function Qy(A,n){let o=A.consoleFilter;if(!o)return;let l=n.getLogs().filter(k=>k.level===o),m={error:Pe.error,warn:Pe.warning,info:Pe.info}[o],v={error:"Errors",warn:"Warnings",info:"Info"}[o],B=()=>{A.consoleFilter=null,A.render()},C=Ln(B),E=Hn(m,`Console ${v}`),D=rn({color:m,title:`Console ${v} (${l.length})`,onClose:B,onCopyMd:async()=>{await navigator.clipboard.writeText(kp(l))},onSave:()=>gy(A,l),onClear:()=>A.clearConsoleLogs(),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingConsoleLogs,savedPath:A.lastConsoleLogs,evidenceContext:ba(A,`Console ${v}`,{artifactPath:A.lastConsoleLogs,observation:`${l.length} ${o} log${l.length===1?"":"s"} in the current filter.`})});E.appendChild(D);let T=nn();l.length===0?T.appendChild(gA(`No ${o}s recorded`)):W9(T,l,m),E.appendChild(T),C.appendChild(E),A.overlayElement=C,document.body.appendChild(C),Mn(E)}function W9(A,n,o){n.forEach((l,c)=>{let m=document.createElement("div");Object.assign(m.style,{padding:"8px 14px",borderBottom:c<n.length-1?`1px solid ${H.borderSubtle}`:"none"});let g=document.createElement("span");Object.assign(g.style,{color:H.textMuted,fontSize:"0.625rem",marginRight:"8px"}),g.textContent=new Date(l.timestamp).toLocaleTimeString(),m.appendChild(g);let v=document.createElement("span");Object.assign(v.style,{color:o,fontSize:"0.6875rem",wordBreak:"break-word",whiteSpace:"pre-wrap"}),v.textContent=l.message,m.appendChild(v),A.appendChild(m)})}function q9(A,n,o){if(A.lastDotPosition&&!o){let g=n.endsWith("right"),v;return g?v=n.startsWith("top")?{top:"20px",right:"16px"}:{bottom:"20px",right:"16px"}:v={top:`${A.lastDotPosition.top-15}px`,left:`${A.lastDotPosition.left-19}px`},A.lastDotPosition=null,v}let m={"bottom-left":{bottom:"20px",left:"80px"},"bottom-right":{bottom:"20px",right:"16px"},"top-left":{top:"20px",left:"80px"},"top-right":{top:"20px",right:"16px"},"bottom-center":{bottom:"12px",left:"50%",transform:"translateX(-50%)"}};return m[n]??m["bottom-left"]}function z9(A,n,o,l,c){A.resetPositionStyles(n);let m=A.options.sizeOverrides,g="fit-content",v="auto",B=c?"calc(100vw - 32px)":"calc(100vw - 96px)";Object.assign(n.style,{position:"fixed",...o,zIndex:"9999",backgroundColor:"var(--devbar-color-bg-card)",border:`1px solid ${l}`,borderRadius:"12px",color:H.primary,boxShadow:`${bt.shadows.dropToolbar}, 0 0 0 1px ${ee(l,10)}`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxSizing:"border-box",width:m?.width??g,maxWidth:m?.maxWidth??B,minWidth:m?.minWidth??v,cursor:"default"}),n.ondblclick=C=>{if(C.target?.closest("button, input, select, a"))return;let D=n.querySelector(".devbar-status span span");D&&Bo(A,D),A.collapsed=!0,A.debug.state("Collapsed DevBar (double-click)"),A.render()}}function X9(){let A=document.createElement("div");return A.className="devbar-main",Object.assign(A.style,{display:"flex",alignItems:"center",alignContent:"flex-start",justifyContent:"flex-start",gap:"0.5rem",padding:"0.5rem 0.75rem",minWidth:"0",boxSizing:"border-box",fontFamily:Bt,fontSize:"0.6875rem",lineHeight:"1rem"}),A}function Y9(A){let n=Ys(A);return $r(A,n,()=>ta(A.sweetlinkConnected,"click to minimize")),n.onclick=o=>{o.stopPropagation(),Bo(A,n),A.collapsed=!0,A.debug.state("Collapsed DevBar (connection dot click)"),A.render()},n}function J9(A,n){let o=document.createElement("div");return o.className="devbar-info",Object.assign(o.style,{display:"flex",alignItems:"center",gap:"0.5rem",textTransform:"uppercase",letterSpacing:"0.05em",flexShrink:"1",minWidth:"0",overflow:"visible"}),n.breakpoint&&A.breakpointInfo&&$9(A,o),A.perfStats&&e7(A,o,n),o}function $9(A,n){if(!A.breakpointInfo)return;let o=A.breakpointInfo.tailwindBreakpoint,l=Vs[o],c=document.createElement("span");c.className="devbar-item",Object.assign(c.style,{opacity:"0.9",cursor:"default"}),Ww(A,c,o,A.breakpointInfo.dimensions,l?.label||"");let m=o;o!=="base"&&(m=o==="sm"?`${o} - ${A.breakpointInfo.dimensions.split("x")[0]}`:`${o} - ${A.breakpointInfo.dimensions}`),c.textContent=m,n.appendChild(c)}function Z9(A){return{fcp:{label:"FCP",value:A.fcp,title:"First Contentful Paint (FCP)",description:"Time until the first text or image renders on screen.",thresholds:{good:"<1.8s",needsWork:"1.8-3s",poor:">3s"}},lcp:{label:"LCP",value:A.lcp,title:"Largest Contentful Paint (LCP)",description:"Time until the largest visible element renders on screen.",thresholds:{good:"<2.5s",needsWork:"2.5-4s",poor:">4s"}},cls:{label:"CLS",value:A.cls,title:"Cumulative Layout Shift (CLS)",description:"Visual stability score. Higher values mean more unexpected layout shifts.",thresholds:{good:"<0.1",needsWork:"0.1-0.25",poor:">0.25"}},inp:{label:"INP",value:A.inp,title:"Interaction to Next Paint (INP)",description:"Responsiveness to user input. Measures the longest interaction delay.",thresholds:{good:"<200ms",needsWork:"200-500ms",poor:">500ms"}},pageSize:{label:"",value:A.totalSize,title:"Total Page Size",description:"Compressed/transferred size including HTML, CSS, JS, images, and other resources."}}}function e7(A,n,o){if(!A.perfStats)return;let{visible:l,hidden:c}=kw(A),m=Z9(A.perfStats),g=()=>{let B=document.createElement("span");B.style.opacity="0.4",B.textContent="|",n.appendChild(B)};for(let B of l){if(!o[B])continue;let C=m[B];g();let E=document.createElement("span");E.className="devbar-item",Object.assign(E.style,{opacity:B==="pageSize"?"0.7":"0.85",cursor:"default"}),E.textContent=C.label?`${C.label} ${C.value}`:C.value,C.thresholds?jw(A,E,C.title,C.description,C.thresholds):qw(A,E,C.title,C.description),n.appendChild(E)}let v=c.filter(B=>o[B]);v.length>0&&(g(),t7(A,n,v,m))}function t7(A,n,o,l){let c=document.createElement("span");c.className="devbar-item devbar-clickable",Object.assign(c.style,{opacity:"0.7",cursor:"pointer",padding:"0 2px"}),c.textContent="\xB7\xB7\xB7",Vw(A,c,m=>{ea(A,m,"More Metrics");let g=document.createElement("div");Object.assign(g.style,{display:"flex",flexDirection:"column",gap:"6px",marginTop:"8px"});for(let v of o){let B=l[v],C=document.createElement("div");Object.assign(C.style,{display:"flex",justifyContent:"space-between",gap:"12px"});let E=document.createElement("span");Object.assign(E.style,{color:H.textMuted}),E.textContent=B.title.split("(")[0].trim();let D=document.createElement("span");Object.assign(D.style,{color:H.text,fontWeight:"500"}),D.textContent=B.value,C.appendChild(E),C.appendChild(D),g.appendChild(C)}m.appendChild(g)}),n.appendChild(c)}function r7(A,n,o,l,c,m){let g=Y9(A),v=document.createElement("div");v.className="devbar-status",Object.assign(v.style,{display:"flex",alignItems:"center",gap:"0.5rem",flexWrap:"nowrap",flexShrink:"1",minWidth:"0"}),v.appendChild(g);let B=J9(A,n);return v.appendChild(B),o&&(l>0&&v.appendChild(Jn(A,"error",l,Pe.error)),c>0&&v.appendChild(Jn(A,"warn",c,Pe.warning)),m>0&&v.appendChild(Jn(A,"info",m,Pe.info))),v}function n7(A,n,o){let l=document.createElement("div");return l.className="devbar-actions",n&&l.appendChild(uu(A,o)),l.appendChild(wy(A)),l.appendChild(by(A)),l.appendChild(By(A)),l.appendChild(yy(A)),l.appendChild(Cy(A)),l.appendChild(Ey(A)),l.appendChild(xy(A)),l.appendChild(cu(A)),l.appendChild(Fy(A)),l}function A7(A,n){if(A.length===0)return null;let o=document.createElement("div");o.className="devbar-custom-controls",Object.assign(o.style,{display:"flex",flexWrap:"wrap",alignItems:"center",alignContent:"flex-start",justifyContent:"flex-start",gap:"0.5rem",padding:"0 0.75rem 0.5rem 0.75rem",borderTop:`1px solid ${ee(n,19)}`,marginTop:"0",paddingTop:"0.5rem",width:"100%",maxWidth:"100%",minWidth:"0",overflow:"visible",boxSizing:"border-box",fontFamily:Bt,fontSize:"0.6875rem"});let l=A.filter(m=>!m.group),c=new Map;for(let m of A){if(!m.group)continue;let g=c.get(m.group)??[];g.push(m),c.set(m.group,g)}for(let m of l)o.appendChild(yo(m,n));for(let[m,g]of c){let v=document.createElement("span");v.className="devbar-custom-group-label",Object.assign(v.style,{color:ee(n,50),fontSize:"0.5625rem",textTransform:"uppercase",letterSpacing:"0.05em",flex:"0 1 auto",minWidth:"0",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginLeft:l.length>0||[...c.keys()].indexOf(m)>0?"0.25rem":"0"}),v.textContent=m,o.appendChild(v);for(let B of g)o.appendChild(yo(B,n))}return o}function Sy(A,n){if(!A.container)return;let{position:o,accentColor:l,showMetrics:c,showScreenshot:m,showConsoleBadges:g}=A.options,{errorCount:v,warningCount:B,infoCount:C}=A.getLogCounts(),E=o==="bottom-center",D=A.container;n.length>0?D.dataset.devbarCustomControls="true":delete D.dataset.devbarCustomControls;let T=q9(A,o,E);z9(A,D,T,l,E);let k=X9(),V=r7(A,c,g,v,B,C);k.appendChild(V);let W=n7(A,m,l);k.appendChild(W),D.appendChild(k);let q=A7(n,l);q&&D.appendChild(q)}function Iy(A){let n=DA(),o=Pe.outline,l=()=>{A.showOutlineModal=!1,A.render()},c=Ln(l),m=Hn(o,"Document Outline"),g=rn({color:o,title:"Document Outline",onClose:l,onCopyMd:async()=>{let B=Yn(n);await navigator.clipboard.writeText(B)},onSave:()=>my(A),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingOutline,savedPath:A.lastOutline,evidenceContext:ba(A,"Document Outline",{artifactPath:A.lastOutline,observation:`${n.length} top-level semantic node${n.length===1?"":"s"} found.`})});m.appendChild(g);let v=nn();n.length===0?v.appendChild(gA("No semantic elements found in this document")):_y(n,v,0,{lastHeadingLevel:0}),m.appendChild(v),c.appendChild(m),A.overlayElement=c,document.body.appendChild(c),Mn(m)}function _y(A,n,o,l){for(let c of A){let m=c.category==="heading"&&c.level>0,g=m&&c.level>l.lastHeadingLevel+1;m&&(l.lastHeadingLevel=c.level);let v=document.createElement("div");if(Object.assign(v.style,{padding:`4px 0 4px ${o*16}px`}),g){let T=document.createElement("span");Object.assign(T.style,{color:H.error,fontSize:"0.625rem",marginRight:"4px"}),T.textContent="\u26A0",T.title=`Heading level skipped (expected h${c.level-1} or higher before h${c.level})`,v.appendChild(T)}let B=document.createElement("span"),C=rf[c.category||"other"]||rf.other;if(Object.assign(B.style,{color:g?H.error:C,fontSize:"0.6875rem",fontWeight:"500"}),B.textContent=`<${c.tagName}>`,v.appendChild(B),c.category){let T=document.createElement("span");Object.assign(T.style,{color:H.textMuted,fontSize:"0.625rem",marginLeft:"6px"}),T.textContent=`[${c.category}]`,v.appendChild(T)}let E=document.createElement("span");Object.assign(E.style,{color:H.textSecondary,fontSize:"0.6875rem",marginLeft:"8px"});let D=c.text.length>60?`${c.text.slice(0,60)}...`:c.text;if(E.textContent=D,v.appendChild(E),c.id){let T=document.createElement("span");Object.assign(T.style,{color:H.textSecondary,fontSize:"0.625rem",marginLeft:"6px"}),T.textContent=`#${c.id}`,v.appendChild(T)}n.appendChild(v),c.children.length>0&&_y(c.children,n,o+1,l)}}function Ry(A){let n=QA(),o=Pe.schema,l=()=>{A.showSchemaModal=!1,A.render()},c=Ln(l),m=Hn(o,"Page Schema"),g=ri(n),v=ti(),B=rn({color:o,title:"Page Schema",onClose:l,onCopyMd:async()=>{let D=SA(n,{missingTags:g,favicons:v});await navigator.clipboard.writeText(D)},onSave:()=>vy(A),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingSchema,savedPath:A.lastSchema,evidenceContext:ba(A,"Page Schema",{artifactPath:A.lastSchema,observation:g.length?`${g.length} recommended metadata item${g.length===1?"":"s"} missing.`:"Schema evidence captured for this page."})});m.appendChild(B);let C=nn();n.jsonLd.length>0||Object.keys(n.openGraph).length>0||Object.keys(n.twitter).length>0||Object.keys(n.metaTags).length>0||v.length>0||g.length>0?(g.length>0&&d7(C,g),du(C,"Open Graph",n.openGraph,H.info),du(C,"Twitter Cards",n.twitter,H.cyan),v.length>0&&u7(C,v),du(C,"JSON-LD",n.jsonLd,o),du(C,"Meta Tags",n.metaTags,H.textMuted)):C.appendChild(gA("No structured data found on this page")),m.appendChild(C),c.appendChild(m),A.overlayElement=c,document.body.appendChild(c),Mn(m)}function Hp(A,n,o,l){let c=document.createElement("div");Object.assign(c.style,{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",paddingBottom:"6px",borderBottom:`1px solid ${ee(o,19)}`});let m=document.createElement("h3");Object.assign(m.style,{color:o,fontSize:"0.8125rem",fontWeight:"600",margin:"0"}),m.textContent=n,c.appendChild(m);let g=document.createElement("span");Object.assign(g.style,{color:ee(o,80),fontSize:"0.5625rem",backgroundColor:ee(o,9),padding:"1px 6px",borderRadius:"8px",letterSpacing:"0.03em"}),g.textContent=String(l),c.appendChild(g),A.appendChild(c)}function du(A,n,o,l){let c=Array.isArray(o)?o.length:Object.keys(o).length;if(c===0)return;let m=document.createElement("div");m.style.marginBottom="20px",Hp(m,n,l,c),Array.isArray(o)?a7(m,o,l):i7(m,o),A.appendChild(m)}function a7(A,n,o){n.forEach((l,c)=>{let m=document.createElement("div");m.style.marginBottom="10px";let g=l,v=typeof g?.["@type"]=="string"?g["@type"]:null,B=document.createElement("div");Object.assign(B.style,{display:"flex",alignItems:"center",gap:"6px",marginBottom:"4px"});let C=document.createElement("span");if(Object.assign(C.style,{color:H.textSecondary,fontSize:"0.6875rem"}),C.textContent=`Schema ${c+1}`,B.appendChild(C),v){let D=document.createElement("span");Object.assign(D.style,{color:ee(o,80),fontSize:"0.5625rem",backgroundColor:ee(o,8),border:`1px solid ${ee(o,15)}`,padding:"0 5px",borderRadius:"3px"}),D.textContent=v,B.appendChild(D)}m.appendChild(B);let E=document.createElement("pre");Object.assign(E.style,{backgroundColor:"rgba(0, 0, 0, 0.25)",borderRadius:"4px",borderLeft:`2px solid ${ee(o,31)}`,padding:"10px 10px 10px 12px",fontSize:"0.625rem",margin:"0",whiteSpace:"pre-wrap",wordBreak:"break-word"}),o7(E,JSON.stringify(l,null,2)),m.appendChild(E),A.appendChild(m)})}function o7(A,n){let o={key:H.primary,string:H.warning,number:H.purple,boolean:H.info,nullVal:H.error,punct:H.textMuted},l=/("(?:\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*")(\s*:)?|(\btrue\b|\bfalse\b)|(\bnull\b)|(-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)|([{}[\],])|(\s+)/g;for(let c of n.matchAll(l)){let[,m,g,v,B,C,E,D]=c;if(D)A.appendChild(document.createTextNode(D));else if(m!==void 0){let T=document.createElement("span");if(T.style.color=g?o.key:o.string,T.textContent=m,A.appendChild(T),g){let k=document.createElement("span");k.style.color=o.punct,k.textContent=":",A.appendChild(k)}}else if(v){let T=document.createElement("span");T.style.color=o.boolean,T.textContent=v,A.appendChild(T)}else if(B){let T=document.createElement("span");T.style.color=o.nullVal,T.textContent=B,A.appendChild(T)}else if(C){let T=document.createElement("span");T.style.color=o.number,T.textContent=C,A.appendChild(T)}else if(E){let T=document.createElement("span");T.style.color=o.punct,T.textContent=E,A.appendChild(T)}}}function i7(A,n){Object.entries(n).forEach(([l,c],m)=>{let g=_p(l),v=document.createElement("div");Object.assign(v.style,{display:"flex",padding:g?"6px 8px":"3px 8px",alignItems:"flex-start",borderRadius:"3px",backgroundColor:m%2===0?"rgba(255, 255, 255, 0.02)":"transparent"});let B=document.createElement("span");if(Object.assign(B.style,{color:H.textSecondary,fontSize:"0.6875rem",width:"120px",minWidth:"120px",maxWidth:"120px",flexShrink:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingTop:g?"2px":"0"}),B.textContent=l,l.length>18&&(B.title=l),v.appendChild(B),g&&c){let C=document.createElement("div");Object.assign(C.style,{flex:"1",minWidth:"0"});let E=document.createElement("div");Object.assign(E.style,{display:"inline-block",padding:"4px",backgroundColor:"rgba(0, 0, 0, 0.2)",border:"1px solid rgba(255, 255, 255, 0.06)",borderRadius:"4px",marginBottom:"4px",minHeight:"60px",minWidth:"80px"});let D=document.createElement("img");Object.assign(D.style,{width:"200px",height:"120px",objectFit:"contain",borderRadius:"2px",display:"block"}),D.src=c,D.alt=l,D.onerror=()=>{E.style.display="none"},D.onload=()=>{D.naturalWidth&&(T.textContent=`${D.naturalWidth}\xD7${D.naturalHeight}`)},E.appendChild(D),C.appendChild(E);let T=document.createElement("div");Object.assign(T.style,{color:H.textMuted,fontSize:"0.5625rem",minHeight:"0.75rem",letterSpacing:"0.02em"}),C.appendChild(T);let k=document.createElement("div");Object.assign(k.style,{color:H.textMuted,fontSize:"0.5625rem",wordBreak:"break-all",opacity:"0.7"}),k.textContent=c,C.appendChild(k),v.appendChild(C)}else{let C=document.createElement("span");Object.assign(C.style,{color:H.text,fontSize:"0.6875rem",flex:"1",wordBreak:"break-word",whiteSpace:"pre-wrap",opacity:"0.85"}),C.textContent=String(c),v.appendChild(C)}A.appendChild(v)})}function s7(A,n){let o=parseInt(n||"",10);return A.includes("apple")?{text:"Apple home screen",color:H.info}:n==="any"||A.includes("svg")?{text:"Scalable (any)",color:H.cyan}:o>=192?{text:"Android / PWA",color:H.primary}:o>=48?{text:"Taskbar / shortcut",color:H.purple}:o>0?{text:"Browser tab",color:H.textSecondary}:{text:"General",color:H.textMuted}}function l7(A,n){let o=s7(A.label,A.size),l=document.createElement("div");Object.assign(l.style,{display:"flex",alignItems:"center",padding:"6px 8px",gap:"10px",borderRadius:"3px",backgroundColor:n%2===0?"rgba(255, 255, 255, 0.02)":"transparent"});let c=document.createElement("div");Object.assign(c.style,{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.25)",border:"1px solid rgba(255, 255, 255, 0.06)",borderRadius:"4px",flexShrink:"0"});let m=document.createElement("img");Object.assign(m.style,{width:"22px",height:"22px",objectFit:"contain"}),m.src=A.url,m.alt=A.label,m.onerror=()=>{c.style.opacity="0.3"},c.appendChild(m),l.appendChild(c);let g=document.createElement("div");Object.assign(g.style,{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",gap:"2px"});let v=document.createElement("div");Object.assign(v.style,{display:"flex",alignItems:"center",gap:"6px"});let B=document.createElement("span");Object.assign(B.style,{color:H.text,fontSize:"0.6875rem",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),B.textContent=A.label,A.label.length>24&&(B.title=A.label),v.appendChild(B);let C=document.createElement("span");Object.assign(C.style,{color:o.color,fontSize:"0.5rem",backgroundColor:ee(o.color,7),padding:"1px 6px",borderRadius:"6px",letterSpacing:"0.03em",whiteSpace:"nowrap",flexShrink:"0"}),C.textContent=o.text,v.appendChild(C),g.appendChild(v);let E=document.createElement("div");if(Object.assign(E.style,{display:"flex",alignItems:"center",gap:"6px",fontSize:"0.5625rem",color:H.textMuted}),A.size){let V=document.createElement("span");V.textContent=A.size,V.style.opacity="0.8",E.appendChild(V)}let D=document.createElement("span");D.style.letterSpacing="0.02em",E.appendChild(D),m.onload=()=>{if(m.naturalWidth){let V=`${m.naturalWidth}\xD7${m.naturalHeight}`;A.size?D.textContent=`\u2192 ${V}`:D.textContent=V}};let T=document.createElement("span");T.textContent="\xB7",T.style.opacity="0.4",E.appendChild(T);let k=document.createElement("span");return Object.assign(k.style,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",opacity:"0.6"}),k.textContent=A.url,k.title=A.url,E.appendChild(k),g.appendChild(E),l.appendChild(g),l}function u7(A,n){let o=H.purple,l=document.createElement("div");l.style.marginBottom="20px",Hp(l,"Favicons",o,n.length),n.forEach((c,m)=>{l.appendChild(l7(c,m))}),A.appendChild(l)}function Uy(A,n){let o=document.createElement("span");return Object.assign(o.style,{color:n,fontSize:"0.5625rem",backgroundColor:ee(n,8),padding:"2px 8px",borderRadius:"8px",letterSpacing:"0.03em"}),o.textContent=A,o}function c7(A,n){let o=document.createElement("div");return Object.assign(o.style,{display:"flex",alignItems:"center",padding:"4px 8px",gap:"8px",borderRadius:"3px",backgroundColor:A%2===0?"rgba(255, 255, 255, 0.02)":"transparent",...n?{borderLeft:`2px solid ${ee(n,25)}`}:{}}),o}function Lp(A,n){let o=document.createElement("span");return Object.assign(o.style,n),o.textContent=A,o}function d7(A,n){let o=document.createElement("div");o.style.marginBottom="20px";let l=n.filter(v=>v.severity==="error").length,c=n.length-l,g=l>0?H.error:H.warning;if(Hp(o,"Missing Tags",g,n.length),l>0||c>0){let v=document.createElement("div");Object.assign(v.style,{display:"flex",gap:"8px",marginBottom:"8px"}),l>0&&v.appendChild(Uy(`${l} error${l>1?"s":""}`,H.error)),c>0&&v.appendChild(Uy(`${c} warning${c>1?"s":""}`,H.warning)),o.appendChild(v)}n.forEach((v,B)=>{let C=v.severity==="error",E=C?H.error:H.warning,D=c7(B,E),T=Lp(C?"\u2718":"\u26A0",{fontSize:"0.625rem",flexShrink:"0",width:"14px",textAlign:"center",color:E});D.appendChild(T),D.appendChild(Lp(v.tag,{color:H.text,fontSize:"0.6875rem",width:"120px",minWidth:"120px",flexShrink:"0",fontWeight:"500"})),D.appendChild(Lp(v.hint,{color:H.textMuted,fontSize:"0.6875rem",flex:"1",opacity:"0.85"})),o.appendChild(D)}),A.appendChild(o)}function Oy(A){let n=Pe.a11y,o=()=>{A.showA11yModal=!1,A.render()},l=Ln(o),c=Hn(n,"Accessibility Audit");f7(c,n,o,A),l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),Mn(c),Ws().then(m=>{if(!A.showA11yModal)return;let g=qs(m);hf(c);let v=m.violations.length,B=v===0?"Accessibility Audit \u2014 No Issues":`Accessibility Audit \u2014 ${v} Violation${v===1?"":"s"}`,C=rn({color:n,title:B,onClose:o,onCopyMd:async()=>{await navigator.clipboard.writeText(g)},onSave:()=>hy(A,m),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingA11yAudit,savedPath:A.lastA11yAudit,evidenceContext:ba(A,B,{artifactPath:A.lastA11yAudit,observation:v===0?`${m.passes.length} axe rule${m.passes.length===1?"":"s"} passed.`:`${v} accessibility violation${v===1?"":"s"} found.`})});c.appendChild(C);let E=nn();p7(E,m,n),c.appendChild(E)}).catch(m=>{if(!A.showA11yModal)return;hf(c);let g=rn({color:H.error,title:"Accessibility Audit \u2014 Error",onClose:o,onCopyMd:async()=>{},sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation});c.appendChild(g);let v=nn();v.appendChild(ra(H.error,"Audit Failed",`${m instanceof Error?m.message:"Unknown error"}`)),c.appendChild(v)})}function f7(A,n,o,l){let c=nn(),m=document.createElement("div");Object.assign(m.style,{textAlign:"center",padding:"40px",color:H.textSecondary,fontSize:"0.875rem"}),m.textContent="Running accessibility audit...",m.style.animation="pulse 1.5s ease-in-out infinite",c.appendChild(m);let g=rn({color:n,title:"Accessibility Audit",onClose:o,onCopyMd:async()=>{},sweetlinkConnected:l.sweetlinkConnected,saveLocation:l.options.saveLocation});A.appendChild(g),A.appendChild(c)}function p7(A,n,o){if(h7(A,n,o),n.violations.length===0){let l=document.createElement("div");if(Object.assign(l.style,{textAlign:"center",padding:"40px",color:H.primary,fontSize:"0.875rem"}),l.textContent="No accessibility violations found!",A.appendChild(l),n.passes.length>0){let c=document.createElement("div");Object.assign(c.style,{textAlign:"center",color:H.textMuted,fontSize:"0.75rem",marginTop:"8px"}),c.textContent=`${n.passes.length} rules passed`,A.appendChild(c)}}else{let l=of(n.violations),c=document.createElement("div");Object.assign(c.style,{display:"flex",gap:"12px",marginBottom:"16px",padding:"10px 12px",backgroundColor:ee(o,6),border:`1px solid ${ee(o,19)}`,borderRadius:"6px",flexWrap:"wrap"});for(let g of["critical","serious","moderate","minor"]){if(l[g]===0)continue;let v=document.createElement("span"),B=lf(g);Object.assign(v.style,{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"0.6875rem",fontWeight:"600",color:B});let C=document.createElement("span");Object.assign(C.style,{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:B}),v.appendChild(C),v.appendChild(document.createTextNode(`${l[g]} ${g}`)),c.appendChild(v)}A.appendChild(c);let m=sf(n.violations);for(let[g,v]of m)v.length!==0&&g7(A,g,v)}}function h7(A,n,o){let l=[`${n.passes.length} axe rule${n.passes.length===1?"":"s"} passed`,`${n.violations.length} violation${n.violations.length===1?"":"s"} found`,"current DOM, focus semantics, names, landmarks, forms, and color contrast where browser APIs expose enough paint data"];A.appendChild(ra(o,"What was checked",l.join(" \xB7 ")))}function Ty(A){let n=document.createElement("div");return Object.assign(n.style,{padding:"3px 6px",marginBottom:"2px",backgroundColor:"rgba(0,0,0,0.2)",borderRadius:"3px",fontSize:"0.625rem",color:H.textSecondary,fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),n.textContent=A.html.length>100?`${A.html.slice(0,100)}...`:A.html,n.title=A.html,n}function m7(A,n){let o=document.createElement("div");Object.assign(o.style,{marginBottom:"12px",padding:"10px 12px",backgroundColor:ee(n,3),border:`1px solid ${ee(n,13)}`,borderRadius:"6px"});let l=document.createElement("div");Object.assign(l.style,{color:n,fontSize:"0.6875rem",fontWeight:"600",marginBottom:"4px"}),l.textContent=A.id,o.appendChild(l);let c=document.createElement("div");Object.assign(c.style,{color:H.text,fontSize:"0.75rem",marginBottom:"4px"}),c.textContent=A.help,o.appendChild(c);let m=document.createElement("div");Object.assign(m.style,{color:H.textSecondary,fontSize:"0.6875rem",marginBottom:"6px"}),m.textContent=A.description,o.appendChild(m);let g=document.createElement("div");Object.assign(g.style,{color:H.textMuted,fontSize:"0.625rem",marginBottom:"4px"}),g.textContent=`${A.nodes.length} element${A.nodes.length===1?"":"s"} affected`,o.appendChild(g);let v=document.createElement("div");Object.assign(v.style,{marginTop:"6px"});let B=A.nodes.slice(0,3);for(let C of B)v.appendChild(Ty(C));if(A.nodes.length>3){let C=document.createElement("button");Object.assign(C.style,{background:"none",border:"none",color:n,fontSize:"0.625rem",cursor:"pointer",padding:"2px 0",fontFamily:Bt}),C.textContent=`+ ${A.nodes.length-3} more`,C.onclick=()=>{C.remove();for(let E of A.nodes.slice(3))v.appendChild(Ty(E))},v.appendChild(C)}return o.appendChild(v),o}function g7(A,n,o){let l=lf(n),c=document.createElement("div");c.style.marginBottom="20px";let m=document.createElement("h3");Object.assign(m.style,{color:l,fontSize:"0.8125rem",fontWeight:"600",marginBottom:"10px",borderBottom:`1px solid ${ee(l,25)}`,paddingBottom:"6px",textTransform:"capitalize"}),m.textContent=`${n} (${o.length})`,c.appendChild(m);for(let g of o)c.appendChild(m7(g,l));A.appendChild(c)}function ky(A){let n=Pe.review,o=()=>uy(A),l=Ln(o),c=Hn(n,"AI Design Review");c.style.maxWidth="450px",c.appendChild(rn({color:n,title:"AI Design Review",onClose:o}));let m=nn();if(Object.assign(m.style,{color:H.text,fontSize:"0.8125rem",lineHeight:"1.6"}),A.apiKeyStatus===null?m.appendChild(gA("Checking API key configuration...")):A.apiKeyStatus.configured?m.appendChild(w7(A)):m.appendChild(v7()),c.appendChild(m),A.apiKeyStatus?.configured){let g=document.createElement("div");Object.assign(g.style,{display:"flex",justifyContent:"flex-end",gap:"10px",padding:"14px 18px",borderTop:`1px solid ${H.border}`});let v=tn({color:n,text:"Run Review",padding:"8px 16px"});v.style.backgroundColor=ee(n,13),v.onclick=()=>cy(A),g.appendChild(v),c.appendChild(g)}l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),Mn(c)}function v7(){let A=document.createElement("div");A.appendChild(ra(H.error,"API Key Not Configured","The ANTHROPIC_API_KEY environment variable is not set."));let n=document.createElement("div");Object.assign(n.style,{marginBottom:"12px"});let o=document.createElement("div");return Object.assign(o.style,{color:H.textSecondary,fontWeight:"600",marginBottom:"8px"}),o.textContent="To configure:",n.appendChild(o),[{text:"1. Get an API key from console.anthropic.com",highlight:!1},{text:"2. Add to your .env file:",highlight:!1},{text:" ANTHROPIC_API_KEY=sk-ant-...",highlight:!0},{text:"3. Restart your dev server",highlight:!1}].forEach(({text:c,highlight:m})=>{let g=document.createElement("div");Object.assign(g.style,{color:m?H.primary:H.textMuted,fontSize:"0.75rem",marginBottom:"4px",fontFamily:Bt}),g.textContent=c,n.appendChild(g)}),A.appendChild(n),A}function w7(A){let n=document.createElement("div");Object.assign(n.style,{marginBottom:"16px"});let o=document.createElement("p");Object.assign(o.style,{color:H.textSecondary,marginBottom:"12px"}),o.textContent="This will capture a screenshot and send it to Claude for design analysis.",n.appendChild(o);let l=ly(A);if(l){let c=ra(H.primary,"Estimated Cost",[]);c.style.marginBottom="0",c.style.padding="12px";let m=document.createElement("div");Object.assign(m.style,{display:"flex",justifyContent:"space-between",color:H.textSecondary,fontSize:"0.75rem"});let g=document.createElement("span");g.textContent=`~${l.tokens.toLocaleString()} tokens`,m.appendChild(g);let v=document.createElement("span");Object.assign(v.style,{color:H.warning,fontWeight:"600"}),v.textContent=l.cost,m.appendChild(v),c.appendChild(m),n.appendChild(c)}if(A.apiKeyStatus?.model){let c=document.createElement("div");Object.assign(c.style,{color:H.textMuted,fontSize:"0.6875rem",marginTop:"12px"}),c.textContent=`Model: ${A.apiKeyStatus.model}`,n.appendChild(c)}return n}function Ly(A){let n=A.settingsManager.getSettings();A.themeMode=A.forcedThemeMode??n.themeMode,A.forcedThemeMode&&n.themeMode!==A.forcedThemeMode&&A.settingsManager.saveSettingsNow({themeMode:A.forcedThemeMode}),js(Gs(A.themeMode)),A.debug.state("Theme loaded",{mode:A.themeMode}),typeof window<"u"&&window.matchMedia&&(A.themeMediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),A.themeMediaHandler=()=>{A.themeMode==="system"&&(js(Gs(A.themeMode)),A.debug.state("System theme changed",{effectiveTheme:go(A.themeMode)}),window.dispatchEvent(new CustomEvent("devbar-theme-change",{detail:{mode:A.themeMode}})),A.render())},A.themeMediaQuery.addEventListener("change",A.themeMediaHandler))}function Hy(A){let n=A.settingsManager.getSettings();A.compactMode=n.compactMode,A.debug.state("Compact mode loaded",{compactMode:A.compactMode})}function fu(A,n){let o=A.forcedThemeMode??n;A.themeMode=o,A.settingsManager.saveSettings({themeMode:o}),Cw(o),js(Gs(o)),A.debug.state("Theme mode changed",{mode:o,effectiveTheme:go(o)}),typeof window<"u"&&window.dispatchEvent(new CustomEvent("devbar-theme-change",{detail:{mode:o}})),A.render()}function My(A){let{position:n,accentColor:o}=A.options,l=document.createElement("div");l.setAttribute("data-devbar","true"),l.setAttribute("data-devbar-overlay","true"),Object.assign(l.style,{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",zIndex:"10003"}),l.onclick=k=>{k.target===l&&(A.showSettingsPopover=!1,A.render())};let c=document.createElement("div");c.setAttribute("data-devbar","true"),c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true"),c.setAttribute("aria-label","Settings"),c.tabIndex=-1;let m=n.startsWith("top"),g=480,v=16,B;if(A.container&&window.innerWidth>640){let k=A.container.getBoundingClientRect(),V=k.left+k.width/2;B=Math.max(v,Math.min(V-g/2,window.innerWidth-g-v))}else B=Math.max(v,(window.innerWidth-g)/2);Object.assign(c.style,{position:"fixed",[m?"top":"bottom"]:"70px",left:`${B}px`,zIndex:"10003",backgroundColor:"var(--devbar-color-bg-elevated)",border:`1px solid ${o}`,borderRadius:"8px",boxShadow:`${bt.shadows.dropLg}, 0 0 0 1px ${ee(o,20)}`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",width:`${g}px`,maxWidth:"calc(100vw - 32px)",maxHeight:"calc(100vh - 100px)",overflowY:"auto",fontFamily:Bt}),c.appendChild(b7(A));let C=document.createElement("div");C.className="devbar-settings-grid",Object.assign(C.style,{display:"grid",gridTemplateColumns:"1fr 1fr"});let E=H.textSecondary,D=document.createElement("div");Object.assign(D.style,{borderRight:`1px solid ${ee(E,13)}`}),D.appendChild(B7(A)),D.appendChild(y7(A)),C.appendChild(D);let T=document.createElement("div");T.appendChild(S7(A)),T.appendChild(T7(A)),C.appendChild(T),c.appendChild(C),c.appendChild(I7(A)),l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),c.focus()}function b7(A){let{accentColor:n}=A.options,o=document.createElement("div");Object.assign(o.style,{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",borderBottom:`1px solid ${ee(n,19)}`,position:"sticky",top:"0",backgroundColor:"var(--devbar-color-bg-elevated)",zIndex:"1"});let l=document.createElement("span");return Object.assign(l.style,{color:n,fontSize:"0.75rem",fontWeight:"600"}),l.textContent="Settings",o.appendChild(l),o.appendChild(Eo(()=>{A.showSettingsPopover=!1,A.render()})),o}function B7(A){let{accentColor:n}=A.options,o=!!A.forcedThemeMode,l=pu("Theme");hu(l,o?`Theme is controlled by the host app: ${A.forcedThemeMode}.`:"Follow OS/browser preference, force dark, or force light while reviewing.");let c=document.createElement("div");return Object.assign(c.style,{display:"flex",gap:"6px"}),["system","dark","light"].forEach(g=>{let v=Ny({label:g,isActive:A.themeMode===g,accentColor:n,disabled:o&&g!==A.forcedThemeMode,disabledTitle:"Theme controlled by host app",onClick:()=>fu(A,g)});v.style.textTransform="capitalize",c.appendChild(v)}),l.appendChild(c),l}function y7(A){let n=pu("Display & appearance");return hu(n,"Change where DevBar lives and how evidence captures are rendered."),n.appendChild(C7(A)),n.appendChild(E7(A)),n.appendChild(x7(A)),n.appendChild(Q7(A)),n}function C7(A){let{accentColor:n}=A.options,o=H.textSecondary,l=document.createElement("div");Object.assign(l.style,{marginBottom:"10px"});let c=document.createElement("div");Object.assign(c.style,{color:H.text,fontSize:"0.6875rem",marginBottom:"6px"}),c.textContent="Position",l.appendChild(c);let m=document.createElement("div");return Object.assign(m.style,{position:"relative",width:"100%",height:"70px",backgroundColor:"var(--devbar-color-bg-input)",border:`1px solid ${ee(o,19)}`,borderRadius:"4px"}),[{value:"top-left",style:{top:"6px",left:"6px"},title:"Top Left"},{value:"top-right",style:{top:"6px",right:"6px"},title:"Top Right"},{value:"bottom-left",style:{bottom:"6px",left:"6px"},title:"Bottom Left"},{value:"bottom-right",style:{bottom:"6px",right:"6px"},title:"Bottom Right"},{value:"bottom-center",style:{bottom:"6px",left:"50%",transform:"translateX(-50%)"},title:"Bottom Center"}].forEach(({value:v,style:B,title:C})=>{let E=document.createElement("button");E.setAttribute("data-position",v);let D=A.options.position===v;Object.assign(E.style,{position:"absolute",width:"24px",height:"6px",backgroundColor:D?n:H.textMuted,border:`1px solid ${D?n:H.textMuted}`,borderRadius:"2px",cursor:"pointer",padding:"0",transition:"all 150ms",boxShadow:D?`0 0 8px ${ee(n,38)}`:"none",opacity:D?"1":"0.5",...B}),E.title=C,E.onclick=()=>{A.options.position=v,A.settingsManager.saveSettings({position:v}),A.render()},E.onmouseenter=()=>{D||(E.style.backgroundColor=n,E.style.borderColor=n,E.style.boxShadow=`0 0 6px ${ee(n,25)}`,E.style.opacity="1")},E.onmouseleave=()=>{D||(E.style.backgroundColor=H.textMuted,E.style.borderColor=H.textMuted,E.style.boxShadow="none",E.style.opacity="0.5")},m.appendChild(E)}),l.appendChild(m),l}function E7(A){let{accentColor:n}=A.options,o=document.createDocumentFragment();o.appendChild(Ai("Compact Mode",A.compactMode,n,()=>{A.toggleCompactMode()}));let l=document.createElement("div");return Object.assign(l.style,{color:H.textMuted,fontSize:"0.5625rem",marginTop:"2px",marginBottom:"8px"}),l.textContent="Keyboard: Cmd or Ctrl+Shift+M",o.appendChild(l),o}function x7(A){let n=document.createElement("div");Object.assign(n.style,{marginBottom:"6px"});let o=document.createElement("div");Object.assign(o.style,{color:H.text,fontSize:"0.6875rem",marginBottom:"6px"}),o.textContent="Accent Color",n.appendChild(o);let l=document.createElement("div");Object.assign(l.style,{display:"flex",gap:"6px",flexWrap:"wrap",alignItems:"center"});let c=A.options.accentColor,m=c===H.primary,v=!vf.some(B=>B.value===c)&&!m;if(vf.forEach(({name:B,value:C})=>{let E=document.createElement("button"),D=c===C||m&&B==="Emerald";Object.assign(E.style,{width:"24px",height:"24px",borderRadius:"50%",backgroundColor:C,border:D?"2px solid #fff":"2px solid transparent",cursor:"pointer",transition:"all 150ms",boxShadow:D?`0 0 8px ${C}`:"none"}),E.title=B,E.onclick=()=>{A.options.accentColor=C,A.settingsManager.saveSettings({accentColor:C}),A.render()},l.appendChild(E)}),v){let B=document.createElement("button");B.type="button",B.setAttribute("data-accent-reset","true"),B.title=`Custom color (${c}). Click to reset to theme default.`,Object.assign(B.style,{marginLeft:"4px",padding:"2px 8px",borderRadius:"10px",border:`1px dashed ${c}`,backgroundColor:"transparent",color:c,fontSize:"0.625rem",fontFamily:Bt,cursor:"pointer",lineHeight:"1.4"}),B.textContent="custom \xB7 reset",B.onclick=()=>{let C=Co.accentColor;A.options.accentColor=C,A.settingsManager.saveSettings({accentColor:C}),A.render()},l.appendChild(B)}return n.appendChild(l),n}function F7(A,n){return[`#${A}::-webkit-slider-thumb {`," -webkit-appearance: none;"," width: 12px; height: 12px;"," border-radius: 50%;",` background: ${n};`,` border: 2px solid ${H.bg};`,` box-shadow: 0 0 4px ${ee(n,50)};`," cursor: grab;","}",`#${A}::-webkit-slider-thumb:active { cursor: grabbing; }`,`#${A}::-moz-range-thumb {`," width: 12px; height: 12px;"," border-radius: 50%;",` background: ${n};`,` border: 2px solid ${H.bg};`,` box-shadow: 0 0 4px ${ee(n,50)};`," cursor: grab;","}",`#${A}::-webkit-slider-runnable-track { background: transparent; }`,`#${A}::-moz-range-track { background: transparent; }`].join(`
|
|
442
|
+
`)}}function Qy(A,n){let o=A.consoleFilter;if(!o)return;let l=n.getLogs().filter(k=>k.level===o),m={error:Pe.error,warn:Pe.warning,info:Pe.info}[o],v={error:"Errors",warn:"Warnings",info:"Info"}[o],B=()=>{A.consoleFilter=null,A.render()},C=Ln(B),E=Hn(m,`Console ${v}`),D=rn({color:m,title:`Console ${v} (${l.length})`,onClose:B,onCopyMd:async()=>{await navigator.clipboard.writeText(kp(l))},onSave:()=>gy(A,l),onClear:()=>A.clearConsoleLogs(),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingConsoleLogs,savedPath:A.lastConsoleLogs,evidenceContext:ba(A,`Console ${v}`,{artifactPath:A.lastConsoleLogs,observation:`${l.length} ${o} log${l.length===1?"":"s"} in the current filter.`})});E.appendChild(D);let T=nn();l.length===0?T.appendChild(gA(`No ${o}s recorded`)):W9(T,l,m),E.appendChild(T),C.appendChild(E),A.overlayElement=C,document.body.appendChild(C),Mn(E)}function W9(A,n,o){n.forEach((l,c)=>{let m=document.createElement("div");Object.assign(m.style,{padding:"8px 14px",borderBottom:c<n.length-1?`1px solid ${H.borderSubtle}`:"none"});let g=document.createElement("span");Object.assign(g.style,{color:H.textMuted,fontSize:"0.625rem",marginRight:"8px"}),g.textContent=new Date(l.timestamp).toLocaleTimeString(),m.appendChild(g);let v=document.createElement("span");Object.assign(v.style,{color:o,fontSize:"0.6875rem",wordBreak:"break-word",whiteSpace:"pre-wrap"}),v.textContent=l.message,m.appendChild(v),A.appendChild(m)})}function q9(A,n,o){if(A.lastDotPosition&&!o){let g=n.endsWith("right"),v;return g?v=n.startsWith("top")?{top:"20px",right:"16px"}:{bottom:"20px",right:"16px"}:v={top:`${A.lastDotPosition.top-15}px`,left:`${A.lastDotPosition.left-19}px`},A.lastDotPosition=null,v}let m={"bottom-left":{bottom:"20px",left:"80px"},"bottom-right":{bottom:"20px",right:"16px"},"top-left":{top:"20px",left:"80px"},"top-right":{top:"20px",right:"16px"},"bottom-center":{bottom:"12px",left:"50%",transform:"translateX(-50%)"}};return m[n]??m["bottom-left"]}function z9(A,n,o,l,c){A.resetPositionStyles(n);let m=A.options.sizeOverrides,g="fit-content",v="auto",B=c?"calc(100vw - 32px)":"calc(100vw - 96px)";Object.assign(n.style,{position:"fixed",...o,zIndex:"9999",backgroundColor:"var(--devbar-color-bg-card)",border:`1px solid ${l}`,borderRadius:"12px",color:l,boxShadow:`${bt.shadows.dropToolbar}, 0 0 0 1px ${ee(l,10)}`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxSizing:"border-box",width:m?.width??g,maxWidth:m?.maxWidth??B,minWidth:m?.minWidth??v,cursor:"default"}),n.ondblclick=C=>{if(C.target?.closest("button, input, select, a"))return;let D=n.querySelector(".devbar-status span span");D&&Bo(A,D),A.collapsed=!0,A.debug.state("Collapsed DevBar (double-click)"),A.render()}}function X9(){let A=document.createElement("div");return A.className="devbar-main",Object.assign(A.style,{display:"flex",alignItems:"center",alignContent:"flex-start",justifyContent:"flex-start",gap:"0.5rem",padding:"0.5rem 0.75rem",minWidth:"0",boxSizing:"border-box",fontFamily:Bt,fontSize:"0.6875rem",lineHeight:"1rem"}),A}function Y9(A){let n=Ys(A);return $r(A,n,()=>ta(A.sweetlinkConnected,"click to minimize")),n.onclick=o=>{o.stopPropagation(),Bo(A,n),A.collapsed=!0,A.debug.state("Collapsed DevBar (connection dot click)"),A.render()},n}function J9(A,n){let o=document.createElement("div");return o.className="devbar-info",Object.assign(o.style,{display:"flex",alignItems:"center",gap:"0.5rem",textTransform:"uppercase",letterSpacing:"0.05em",flexShrink:"1",minWidth:"0",overflow:"visible"}),n.breakpoint&&A.breakpointInfo&&$9(A,o),A.perfStats&&e7(A,o,n),o}function $9(A,n){if(!A.breakpointInfo)return;let o=A.breakpointInfo.tailwindBreakpoint,l=Vs[o],c=document.createElement("span");c.className="devbar-item",Object.assign(c.style,{opacity:"0.9",cursor:"default"}),Ww(A,c,o,A.breakpointInfo.dimensions,l?.label||"");let m=o;o!=="base"&&(m=o==="sm"?`${o} - ${A.breakpointInfo.dimensions.split("x")[0]}`:`${o} - ${A.breakpointInfo.dimensions}`),c.textContent=m,n.appendChild(c)}function Z9(A){return{fcp:{label:"FCP",value:A.fcp,title:"First Contentful Paint (FCP)",description:"Time until the first text or image renders on screen.",thresholds:{good:"<1.8s",needsWork:"1.8-3s",poor:">3s"}},lcp:{label:"LCP",value:A.lcp,title:"Largest Contentful Paint (LCP)",description:"Time until the largest visible element renders on screen.",thresholds:{good:"<2.5s",needsWork:"2.5-4s",poor:">4s"}},cls:{label:"CLS",value:A.cls,title:"Cumulative Layout Shift (CLS)",description:"Visual stability score. Higher values mean more unexpected layout shifts.",thresholds:{good:"<0.1",needsWork:"0.1-0.25",poor:">0.25"}},inp:{label:"INP",value:A.inp,title:"Interaction to Next Paint (INP)",description:"Responsiveness to user input. Measures the longest interaction delay.",thresholds:{good:"<200ms",needsWork:"200-500ms",poor:">500ms"}},pageSize:{label:"",value:A.totalSize,title:"Total Page Size",description:"Compressed/transferred size including HTML, CSS, JS, images, and other resources."}}}function e7(A,n,o){if(!A.perfStats)return;let{visible:l,hidden:c}=kw(A),m=Z9(A.perfStats),g=()=>{let B=document.createElement("span");B.style.opacity="0.4",B.textContent="|",n.appendChild(B)};for(let B of l){if(!o[B])continue;let C=m[B];g();let E=document.createElement("span");E.className="devbar-item",Object.assign(E.style,{opacity:B==="pageSize"?"0.7":"0.85",cursor:"default"}),E.textContent=C.label?`${C.label} ${C.value}`:C.value,C.thresholds?jw(A,E,C.title,C.description,C.thresholds):qw(A,E,C.title,C.description),n.appendChild(E)}let v=c.filter(B=>o[B]);v.length>0&&(g(),t7(A,n,v,m))}function t7(A,n,o,l){let c=document.createElement("span");c.className="devbar-item devbar-clickable",Object.assign(c.style,{opacity:"0.7",cursor:"pointer",padding:"0 2px"}),c.textContent="\xB7\xB7\xB7",Vw(A,c,m=>{ea(A,m,"More Metrics");let g=document.createElement("div");Object.assign(g.style,{display:"flex",flexDirection:"column",gap:"6px",marginTop:"8px"});for(let v of o){let B=l[v],C=document.createElement("div");Object.assign(C.style,{display:"flex",justifyContent:"space-between",gap:"12px"});let E=document.createElement("span");Object.assign(E.style,{color:H.textMuted}),E.textContent=B.title.split("(")[0].trim();let D=document.createElement("span");Object.assign(D.style,{color:H.text,fontWeight:"500"}),D.textContent=B.value,C.appendChild(E),C.appendChild(D),g.appendChild(C)}m.appendChild(g)}),n.appendChild(c)}function r7(A,n,o,l,c,m){let g=Y9(A),v=document.createElement("div");v.className="devbar-status",Object.assign(v.style,{display:"flex",alignItems:"center",gap:"0.5rem",flexWrap:"nowrap",flexShrink:"1",minWidth:"0"}),v.appendChild(g);let B=J9(A,n);return v.appendChild(B),o&&(l>0&&v.appendChild(Jn(A,"error",l,Pe.error)),c>0&&v.appendChild(Jn(A,"warn",c,Pe.warning)),m>0&&v.appendChild(Jn(A,"info",m,Pe.info))),v}function n7(A,n,o){let l=document.createElement("div");return l.className="devbar-actions",n&&l.appendChild(uu(A,o)),l.appendChild(wy(A)),l.appendChild(by(A)),l.appendChild(By(A)),l.appendChild(yy(A)),l.appendChild(Cy(A)),l.appendChild(Ey(A)),l.appendChild(xy(A)),l.appendChild(cu(A)),l.appendChild(Fy(A)),l}function A7(A,n){if(A.length===0)return null;let o=document.createElement("div");o.className="devbar-custom-controls",Object.assign(o.style,{display:"flex",flexWrap:"wrap",alignItems:"center",alignContent:"flex-start",justifyContent:"flex-start",gap:"0.5rem",padding:"0 0.75rem 0.5rem 0.75rem",borderTop:`1px solid ${ee(n,19)}`,marginTop:"0",paddingTop:"0.5rem",width:"100%",maxWidth:"100%",minWidth:"0",overflow:"visible",boxSizing:"border-box",fontFamily:Bt,fontSize:"0.6875rem"});let l=A.filter(m=>!m.group),c=new Map;for(let m of A){if(!m.group)continue;let g=c.get(m.group)??[];g.push(m),c.set(m.group,g)}for(let m of l)o.appendChild(yo(m,n));for(let[m,g]of c){let v=document.createElement("span");v.className="devbar-custom-group-label",Object.assign(v.style,{color:ee(n,50),fontSize:"0.5625rem",textTransform:"uppercase",letterSpacing:"0.05em",flex:"0 1 auto",minWidth:"0",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginLeft:l.length>0||[...c.keys()].indexOf(m)>0?"0.25rem":"0"}),v.textContent=m,o.appendChild(v);for(let B of g)o.appendChild(yo(B,n))}return o}function Sy(A,n){if(!A.container)return;let{position:o,accentColor:l,showMetrics:c,showScreenshot:m,showConsoleBadges:g}=A.options,{errorCount:v,warningCount:B,infoCount:C}=A.getLogCounts(),E=o==="bottom-center",D=A.container;n.length>0?D.dataset.devbarCustomControls="true":delete D.dataset.devbarCustomControls;let T=q9(A,o,E);z9(A,D,T,l,E);let k=X9(),V=r7(A,c,g,v,B,C);k.appendChild(V);let W=n7(A,m,l);k.appendChild(W),D.appendChild(k);let q=A7(n,l);q&&D.appendChild(q)}function Iy(A){let n=DA(),o=Pe.outline,l=()=>{A.showOutlineModal=!1,A.render()},c=Ln(l),m=Hn(o,"Document Outline"),g=rn({color:o,title:"Document Outline",onClose:l,onCopyMd:async()=>{let B=Yn(n);await navigator.clipboard.writeText(B)},onSave:()=>my(A),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingOutline,savedPath:A.lastOutline,evidenceContext:ba(A,"Document Outline",{artifactPath:A.lastOutline,observation:`${n.length} top-level semantic node${n.length===1?"":"s"} found.`})});m.appendChild(g);let v=nn();n.length===0?v.appendChild(gA("No semantic elements found in this document")):_y(n,v,0,{lastHeadingLevel:0}),m.appendChild(v),c.appendChild(m),A.overlayElement=c,document.body.appendChild(c),Mn(m)}function _y(A,n,o,l){for(let c of A){let m=c.category==="heading"&&c.level>0,g=m&&c.level>l.lastHeadingLevel+1;m&&(l.lastHeadingLevel=c.level);let v=document.createElement("div");if(Object.assign(v.style,{padding:`4px 0 4px ${o*16}px`}),g){let T=document.createElement("span");Object.assign(T.style,{color:H.error,fontSize:"0.625rem",marginRight:"4px"}),T.textContent="\u26A0",T.title=`Heading level skipped (expected h${c.level-1} or higher before h${c.level})`,v.appendChild(T)}let B=document.createElement("span"),C=rf[c.category||"other"]||rf.other;if(Object.assign(B.style,{color:g?H.error:C,fontSize:"0.6875rem",fontWeight:"500"}),B.textContent=`<${c.tagName}>`,v.appendChild(B),c.category){let T=document.createElement("span");Object.assign(T.style,{color:H.textMuted,fontSize:"0.625rem",marginLeft:"6px"}),T.textContent=`[${c.category}]`,v.appendChild(T)}let E=document.createElement("span");Object.assign(E.style,{color:H.textSecondary,fontSize:"0.6875rem",marginLeft:"8px"});let D=c.text.length>60?`${c.text.slice(0,60)}...`:c.text;if(E.textContent=D,v.appendChild(E),c.id){let T=document.createElement("span");Object.assign(T.style,{color:H.textSecondary,fontSize:"0.625rem",marginLeft:"6px"}),T.textContent=`#${c.id}`,v.appendChild(T)}n.appendChild(v),c.children.length>0&&_y(c.children,n,o+1,l)}}function Ry(A){let n=QA(),o=Pe.schema,l=()=>{A.showSchemaModal=!1,A.render()},c=Ln(l),m=Hn(o,"Page Schema"),g=ri(n),v=ti(),B=rn({color:o,title:"Page Schema",onClose:l,onCopyMd:async()=>{let D=SA(n,{missingTags:g,favicons:v});await navigator.clipboard.writeText(D)},onSave:()=>vy(A),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingSchema,savedPath:A.lastSchema,evidenceContext:ba(A,"Page Schema",{artifactPath:A.lastSchema,observation:g.length?`${g.length} recommended metadata item${g.length===1?"":"s"} missing.`:"Schema evidence captured for this page."})});m.appendChild(B);let C=nn();n.jsonLd.length>0||Object.keys(n.openGraph).length>0||Object.keys(n.twitter).length>0||Object.keys(n.metaTags).length>0||v.length>0||g.length>0?(g.length>0&&d7(C,g),du(C,"Open Graph",n.openGraph,H.info),du(C,"Twitter Cards",n.twitter,H.cyan),v.length>0&&u7(C,v),du(C,"JSON-LD",n.jsonLd,o),du(C,"Meta Tags",n.metaTags,H.textMuted)):C.appendChild(gA("No structured data found on this page")),m.appendChild(C),c.appendChild(m),A.overlayElement=c,document.body.appendChild(c),Mn(m)}function Hp(A,n,o,l){let c=document.createElement("div");Object.assign(c.style,{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",paddingBottom:"6px",borderBottom:`1px solid ${ee(o,19)}`});let m=document.createElement("h3");Object.assign(m.style,{color:o,fontSize:"0.8125rem",fontWeight:"600",margin:"0"}),m.textContent=n,c.appendChild(m);let g=document.createElement("span");Object.assign(g.style,{color:ee(o,80),fontSize:"0.5625rem",backgroundColor:ee(o,9),padding:"1px 6px",borderRadius:"8px",letterSpacing:"0.03em"}),g.textContent=String(l),c.appendChild(g),A.appendChild(c)}function du(A,n,o,l){let c=Array.isArray(o)?o.length:Object.keys(o).length;if(c===0)return;let m=document.createElement("div");m.style.marginBottom="20px",Hp(m,n,l,c),Array.isArray(o)?a7(m,o,l):i7(m,o),A.appendChild(m)}function a7(A,n,o){n.forEach((l,c)=>{let m=document.createElement("div");m.style.marginBottom="10px";let g=l,v=typeof g?.["@type"]=="string"?g["@type"]:null,B=document.createElement("div");Object.assign(B.style,{display:"flex",alignItems:"center",gap:"6px",marginBottom:"4px"});let C=document.createElement("span");if(Object.assign(C.style,{color:H.textSecondary,fontSize:"0.6875rem"}),C.textContent=`Schema ${c+1}`,B.appendChild(C),v){let D=document.createElement("span");Object.assign(D.style,{color:ee(o,80),fontSize:"0.5625rem",backgroundColor:ee(o,8),border:`1px solid ${ee(o,15)}`,padding:"0 5px",borderRadius:"3px"}),D.textContent=v,B.appendChild(D)}m.appendChild(B);let E=document.createElement("pre");Object.assign(E.style,{backgroundColor:"rgba(0, 0, 0, 0.25)",borderRadius:"4px",borderLeft:`2px solid ${ee(o,31)}`,padding:"10px 10px 10px 12px",fontSize:"0.625rem",margin:"0",whiteSpace:"pre-wrap",wordBreak:"break-word"}),o7(E,JSON.stringify(l,null,2)),m.appendChild(E),A.appendChild(m)})}function o7(A,n){let o={key:H.primary,string:H.warning,number:H.purple,boolean:H.info,nullVal:H.error,punct:H.textMuted},l=/("(?:\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*")(\s*:)?|(\btrue\b|\bfalse\b)|(\bnull\b)|(-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)|([{}[\],])|(\s+)/g;for(let c of n.matchAll(l)){let[,m,g,v,B,C,E,D]=c;if(D)A.appendChild(document.createTextNode(D));else if(m!==void 0){let T=document.createElement("span");if(T.style.color=g?o.key:o.string,T.textContent=m,A.appendChild(T),g){let k=document.createElement("span");k.style.color=o.punct,k.textContent=":",A.appendChild(k)}}else if(v){let T=document.createElement("span");T.style.color=o.boolean,T.textContent=v,A.appendChild(T)}else if(B){let T=document.createElement("span");T.style.color=o.nullVal,T.textContent=B,A.appendChild(T)}else if(C){let T=document.createElement("span");T.style.color=o.number,T.textContent=C,A.appendChild(T)}else if(E){let T=document.createElement("span");T.style.color=o.punct,T.textContent=E,A.appendChild(T)}}}function i7(A,n){Object.entries(n).forEach(([l,c],m)=>{let g=_p(l),v=document.createElement("div");Object.assign(v.style,{display:"flex",padding:g?"6px 8px":"3px 8px",alignItems:"flex-start",borderRadius:"3px",backgroundColor:m%2===0?"rgba(255, 255, 255, 0.02)":"transparent"});let B=document.createElement("span");if(Object.assign(B.style,{color:H.textSecondary,fontSize:"0.6875rem",width:"120px",minWidth:"120px",maxWidth:"120px",flexShrink:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingTop:g?"2px":"0"}),B.textContent=l,l.length>18&&(B.title=l),v.appendChild(B),g&&c){let C=document.createElement("div");Object.assign(C.style,{flex:"1",minWidth:"0"});let E=document.createElement("div");Object.assign(E.style,{display:"inline-block",padding:"4px",backgroundColor:"rgba(0, 0, 0, 0.2)",border:"1px solid rgba(255, 255, 255, 0.06)",borderRadius:"4px",marginBottom:"4px",minHeight:"60px",minWidth:"80px"});let D=document.createElement("img");Object.assign(D.style,{width:"200px",height:"120px",objectFit:"contain",borderRadius:"2px",display:"block"}),D.src=c,D.alt=l,D.onerror=()=>{E.style.display="none"},D.onload=()=>{D.naturalWidth&&(T.textContent=`${D.naturalWidth}\xD7${D.naturalHeight}`)},E.appendChild(D),C.appendChild(E);let T=document.createElement("div");Object.assign(T.style,{color:H.textMuted,fontSize:"0.5625rem",minHeight:"0.75rem",letterSpacing:"0.02em"}),C.appendChild(T);let k=document.createElement("div");Object.assign(k.style,{color:H.textMuted,fontSize:"0.5625rem",wordBreak:"break-all",opacity:"0.7"}),k.textContent=c,C.appendChild(k),v.appendChild(C)}else{let C=document.createElement("span");Object.assign(C.style,{color:H.text,fontSize:"0.6875rem",flex:"1",wordBreak:"break-word",whiteSpace:"pre-wrap",opacity:"0.85"}),C.textContent=String(c),v.appendChild(C)}A.appendChild(v)})}function s7(A,n){let o=parseInt(n||"",10);return A.includes("apple")?{text:"Apple home screen",color:H.info}:n==="any"||A.includes("svg")?{text:"Scalable (any)",color:H.cyan}:o>=192?{text:"Android / PWA",color:H.primary}:o>=48?{text:"Taskbar / shortcut",color:H.purple}:o>0?{text:"Browser tab",color:H.textSecondary}:{text:"General",color:H.textMuted}}function l7(A,n){let o=s7(A.label,A.size),l=document.createElement("div");Object.assign(l.style,{display:"flex",alignItems:"center",padding:"6px 8px",gap:"10px",borderRadius:"3px",backgroundColor:n%2===0?"rgba(255, 255, 255, 0.02)":"transparent"});let c=document.createElement("div");Object.assign(c.style,{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.25)",border:"1px solid rgba(255, 255, 255, 0.06)",borderRadius:"4px",flexShrink:"0"});let m=document.createElement("img");Object.assign(m.style,{width:"22px",height:"22px",objectFit:"contain"}),m.src=A.url,m.alt=A.label,m.onerror=()=>{c.style.opacity="0.3"},c.appendChild(m),l.appendChild(c);let g=document.createElement("div");Object.assign(g.style,{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",gap:"2px"});let v=document.createElement("div");Object.assign(v.style,{display:"flex",alignItems:"center",gap:"6px"});let B=document.createElement("span");Object.assign(B.style,{color:H.text,fontSize:"0.6875rem",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),B.textContent=A.label,A.label.length>24&&(B.title=A.label),v.appendChild(B);let C=document.createElement("span");Object.assign(C.style,{color:o.color,fontSize:"0.5rem",backgroundColor:ee(o.color,7),padding:"1px 6px",borderRadius:"6px",letterSpacing:"0.03em",whiteSpace:"nowrap",flexShrink:"0"}),C.textContent=o.text,v.appendChild(C),g.appendChild(v);let E=document.createElement("div");if(Object.assign(E.style,{display:"flex",alignItems:"center",gap:"6px",fontSize:"0.5625rem",color:H.textMuted}),A.size){let V=document.createElement("span");V.textContent=A.size,V.style.opacity="0.8",E.appendChild(V)}let D=document.createElement("span");D.style.letterSpacing="0.02em",E.appendChild(D),m.onload=()=>{if(m.naturalWidth){let V=`${m.naturalWidth}\xD7${m.naturalHeight}`;A.size?D.textContent=`\u2192 ${V}`:D.textContent=V}};let T=document.createElement("span");T.textContent="\xB7",T.style.opacity="0.4",E.appendChild(T);let k=document.createElement("span");return Object.assign(k.style,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",opacity:"0.6"}),k.textContent=A.url,k.title=A.url,E.appendChild(k),g.appendChild(E),l.appendChild(g),l}function u7(A,n){let o=H.purple,l=document.createElement("div");l.style.marginBottom="20px",Hp(l,"Favicons",o,n.length),n.forEach((c,m)=>{l.appendChild(l7(c,m))}),A.appendChild(l)}function Uy(A,n){let o=document.createElement("span");return Object.assign(o.style,{color:n,fontSize:"0.5625rem",backgroundColor:ee(n,8),padding:"2px 8px",borderRadius:"8px",letterSpacing:"0.03em"}),o.textContent=A,o}function c7(A,n){let o=document.createElement("div");return Object.assign(o.style,{display:"flex",alignItems:"center",padding:"4px 8px",gap:"8px",borderRadius:"3px",backgroundColor:A%2===0?"rgba(255, 255, 255, 0.02)":"transparent",...n?{borderLeft:`2px solid ${ee(n,25)}`}:{}}),o}function Lp(A,n){let o=document.createElement("span");return Object.assign(o.style,n),o.textContent=A,o}function d7(A,n){let o=document.createElement("div");o.style.marginBottom="20px";let l=n.filter(v=>v.severity==="error").length,c=n.length-l,g=l>0?H.error:H.warning;if(Hp(o,"Missing Tags",g,n.length),l>0||c>0){let v=document.createElement("div");Object.assign(v.style,{display:"flex",gap:"8px",marginBottom:"8px"}),l>0&&v.appendChild(Uy(`${l} error${l>1?"s":""}`,H.error)),c>0&&v.appendChild(Uy(`${c} warning${c>1?"s":""}`,H.warning)),o.appendChild(v)}n.forEach((v,B)=>{let C=v.severity==="error",E=C?H.error:H.warning,D=c7(B,E),T=Lp(C?"\u2718":"\u26A0",{fontSize:"0.625rem",flexShrink:"0",width:"14px",textAlign:"center",color:E});D.appendChild(T),D.appendChild(Lp(v.tag,{color:H.text,fontSize:"0.6875rem",width:"120px",minWidth:"120px",flexShrink:"0",fontWeight:"500"})),D.appendChild(Lp(v.hint,{color:H.textMuted,fontSize:"0.6875rem",flex:"1",opacity:"0.85"})),o.appendChild(D)}),A.appendChild(o)}function Oy(A){let n=Pe.a11y,o=()=>{A.showA11yModal=!1,A.render()},l=Ln(o),c=Hn(n,"Accessibility Audit");f7(c,n,o,A),l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),Mn(c),Ws().then(m=>{if(!A.showA11yModal)return;let g=qs(m);hf(c);let v=m.violations.length,B=v===0?"Accessibility Audit \u2014 No Issues":`Accessibility Audit \u2014 ${v} Violation${v===1?"":"s"}`,C=rn({color:n,title:B,onClose:o,onCopyMd:async()=>{await navigator.clipboard.writeText(g)},onSave:()=>hy(A,m),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingA11yAudit,savedPath:A.lastA11yAudit,evidenceContext:ba(A,B,{artifactPath:A.lastA11yAudit,observation:v===0?`${m.passes.length} axe rule${m.passes.length===1?"":"s"} passed.`:`${v} accessibility violation${v===1?"":"s"} found.`})});c.appendChild(C);let E=nn();p7(E,m,n),c.appendChild(E)}).catch(m=>{if(!A.showA11yModal)return;hf(c);let g=rn({color:H.error,title:"Accessibility Audit \u2014 Error",onClose:o,onCopyMd:async()=>{},sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation});c.appendChild(g);let v=nn();v.appendChild(ra(H.error,"Audit Failed",`${m instanceof Error?m.message:"Unknown error"}`)),c.appendChild(v)})}function f7(A,n,o,l){let c=nn(),m=document.createElement("div");Object.assign(m.style,{textAlign:"center",padding:"40px",color:H.textSecondary,fontSize:"0.875rem"}),m.textContent="Running accessibility audit...",m.style.animation="pulse 1.5s ease-in-out infinite",c.appendChild(m);let g=rn({color:n,title:"Accessibility Audit",onClose:o,onCopyMd:async()=>{},sweetlinkConnected:l.sweetlinkConnected,saveLocation:l.options.saveLocation});A.appendChild(g),A.appendChild(c)}function p7(A,n,o){if(h7(A,n,o),n.violations.length===0){let l=document.createElement("div");if(Object.assign(l.style,{textAlign:"center",padding:"40px",color:H.primary,fontSize:"0.875rem"}),l.textContent="No accessibility violations found!",A.appendChild(l),n.passes.length>0){let c=document.createElement("div");Object.assign(c.style,{textAlign:"center",color:H.textMuted,fontSize:"0.75rem",marginTop:"8px"}),c.textContent=`${n.passes.length} rules passed`,A.appendChild(c)}}else{let l=of(n.violations),c=document.createElement("div");Object.assign(c.style,{display:"flex",gap:"12px",marginBottom:"16px",padding:"10px 12px",backgroundColor:ee(o,6),border:`1px solid ${ee(o,19)}`,borderRadius:"6px",flexWrap:"wrap"});for(let g of["critical","serious","moderate","minor"]){if(l[g]===0)continue;let v=document.createElement("span"),B=lf(g);Object.assign(v.style,{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"0.6875rem",fontWeight:"600",color:B});let C=document.createElement("span");Object.assign(C.style,{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:B}),v.appendChild(C),v.appendChild(document.createTextNode(`${l[g]} ${g}`)),c.appendChild(v)}A.appendChild(c);let m=sf(n.violations);for(let[g,v]of m)v.length!==0&&g7(A,g,v)}}function h7(A,n,o){let l=[`${n.passes.length} axe rule${n.passes.length===1?"":"s"} passed`,`${n.violations.length} violation${n.violations.length===1?"":"s"} found`,"current DOM, focus semantics, names, landmarks, forms, and color contrast where browser APIs expose enough paint data"];A.appendChild(ra(o,"What was checked",l.join(" \xB7 ")))}function Ty(A){let n=document.createElement("div");return Object.assign(n.style,{padding:"3px 6px",marginBottom:"2px",backgroundColor:"rgba(0,0,0,0.2)",borderRadius:"3px",fontSize:"0.625rem",color:H.textSecondary,fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),n.textContent=A.html.length>100?`${A.html.slice(0,100)}...`:A.html,n.title=A.html,n}function m7(A,n){let o=document.createElement("div");Object.assign(o.style,{marginBottom:"12px",padding:"10px 12px",backgroundColor:ee(n,3),border:`1px solid ${ee(n,13)}`,borderRadius:"6px"});let l=document.createElement("div");Object.assign(l.style,{color:n,fontSize:"0.6875rem",fontWeight:"600",marginBottom:"4px"}),l.textContent=A.id,o.appendChild(l);let c=document.createElement("div");Object.assign(c.style,{color:H.text,fontSize:"0.75rem",marginBottom:"4px"}),c.textContent=A.help,o.appendChild(c);let m=document.createElement("div");Object.assign(m.style,{color:H.textSecondary,fontSize:"0.6875rem",marginBottom:"6px"}),m.textContent=A.description,o.appendChild(m);let g=document.createElement("div");Object.assign(g.style,{color:H.textMuted,fontSize:"0.625rem",marginBottom:"4px"}),g.textContent=`${A.nodes.length} element${A.nodes.length===1?"":"s"} affected`,o.appendChild(g);let v=document.createElement("div");Object.assign(v.style,{marginTop:"6px"});let B=A.nodes.slice(0,3);for(let C of B)v.appendChild(Ty(C));if(A.nodes.length>3){let C=document.createElement("button");Object.assign(C.style,{background:"none",border:"none",color:n,fontSize:"0.625rem",cursor:"pointer",padding:"2px 0",fontFamily:Bt}),C.textContent=`+ ${A.nodes.length-3} more`,C.onclick=()=>{C.remove();for(let E of A.nodes.slice(3))v.appendChild(Ty(E))},v.appendChild(C)}return o.appendChild(v),o}function g7(A,n,o){let l=lf(n),c=document.createElement("div");c.style.marginBottom="20px";let m=document.createElement("h3");Object.assign(m.style,{color:l,fontSize:"0.8125rem",fontWeight:"600",marginBottom:"10px",borderBottom:`1px solid ${ee(l,25)}`,paddingBottom:"6px",textTransform:"capitalize"}),m.textContent=`${n} (${o.length})`,c.appendChild(m);for(let g of o)c.appendChild(m7(g,l));A.appendChild(c)}function ky(A){let n=Pe.review,o=()=>uy(A),l=Ln(o),c=Hn(n,"AI Design Review");c.style.maxWidth="450px",c.appendChild(rn({color:n,title:"AI Design Review",onClose:o}));let m=nn();if(Object.assign(m.style,{color:H.text,fontSize:"0.8125rem",lineHeight:"1.6"}),A.apiKeyStatus===null?m.appendChild(gA("Checking API key configuration...")):A.apiKeyStatus.configured?m.appendChild(w7(A)):m.appendChild(v7()),c.appendChild(m),A.apiKeyStatus?.configured){let g=document.createElement("div");Object.assign(g.style,{display:"flex",justifyContent:"flex-end",gap:"10px",padding:"14px 18px",borderTop:`1px solid ${H.border}`});let v=tn({color:n,text:"Run Review",padding:"8px 16px"});v.style.backgroundColor=ee(n,13),v.onclick=()=>cy(A),g.appendChild(v),c.appendChild(g)}l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),Mn(c)}function v7(){let A=document.createElement("div");A.appendChild(ra(H.error,"API Key Not Configured","The ANTHROPIC_API_KEY environment variable is not set."));let n=document.createElement("div");Object.assign(n.style,{marginBottom:"12px"});let o=document.createElement("div");return Object.assign(o.style,{color:H.textSecondary,fontWeight:"600",marginBottom:"8px"}),o.textContent="To configure:",n.appendChild(o),[{text:"1. Get an API key from console.anthropic.com",highlight:!1},{text:"2. Add to your .env file:",highlight:!1},{text:" ANTHROPIC_API_KEY=sk-ant-...",highlight:!0},{text:"3. Restart your dev server",highlight:!1}].forEach(({text:c,highlight:m})=>{let g=document.createElement("div");Object.assign(g.style,{color:m?H.primary:H.textMuted,fontSize:"0.75rem",marginBottom:"4px",fontFamily:Bt}),g.textContent=c,n.appendChild(g)}),A.appendChild(n),A}function w7(A){let n=document.createElement("div");Object.assign(n.style,{marginBottom:"16px"});let o=document.createElement("p");Object.assign(o.style,{color:H.textSecondary,marginBottom:"12px"}),o.textContent="This will capture a screenshot and send it to Claude for design analysis.",n.appendChild(o);let l=ly(A);if(l){let c=ra(H.primary,"Estimated Cost",[]);c.style.marginBottom="0",c.style.padding="12px";let m=document.createElement("div");Object.assign(m.style,{display:"flex",justifyContent:"space-between",color:H.textSecondary,fontSize:"0.75rem"});let g=document.createElement("span");g.textContent=`~${l.tokens.toLocaleString()} tokens`,m.appendChild(g);let v=document.createElement("span");Object.assign(v.style,{color:H.warning,fontWeight:"600"}),v.textContent=l.cost,m.appendChild(v),c.appendChild(m),n.appendChild(c)}if(A.apiKeyStatus?.model){let c=document.createElement("div");Object.assign(c.style,{color:H.textMuted,fontSize:"0.6875rem",marginTop:"12px"}),c.textContent=`Model: ${A.apiKeyStatus.model}`,n.appendChild(c)}return n}function Ly(A){let n=A.settingsManager.getSettings();A.themeMode=A.forcedThemeMode??n.themeMode,A.forcedThemeMode&&n.themeMode!==A.forcedThemeMode&&A.settingsManager.saveSettingsNow({themeMode:A.forcedThemeMode}),js(Gs(A.themeMode)),A.debug.state("Theme loaded",{mode:A.themeMode}),typeof window<"u"&&window.matchMedia&&(A.themeMediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),A.themeMediaHandler=()=>{A.themeMode==="system"&&(js(Gs(A.themeMode)),A.debug.state("System theme changed",{effectiveTheme:go(A.themeMode)}),window.dispatchEvent(new CustomEvent("devbar-theme-change",{detail:{mode:A.themeMode}})),A.render())},A.themeMediaQuery.addEventListener("change",A.themeMediaHandler))}function Hy(A){let n=A.settingsManager.getSettings();A.compactMode=n.compactMode,A.debug.state("Compact mode loaded",{compactMode:A.compactMode})}function fu(A,n){let o=A.forcedThemeMode??n;A.themeMode=o,A.settingsManager.saveSettings({themeMode:o}),Cw(o),js(Gs(o)),A.debug.state("Theme mode changed",{mode:o,effectiveTheme:go(o)}),typeof window<"u"&&window.dispatchEvent(new CustomEvent("devbar-theme-change",{detail:{mode:o}})),A.render()}function My(A){let{position:n,accentColor:o}=A.options,l=document.createElement("div");l.setAttribute("data-devbar","true"),l.setAttribute("data-devbar-overlay","true"),Object.assign(l.style,{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",zIndex:"10003"}),l.onclick=k=>{k.target===l&&(A.showSettingsPopover=!1,A.render())};let c=document.createElement("div");c.setAttribute("data-devbar","true"),c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true"),c.setAttribute("aria-label","Settings"),c.tabIndex=-1;let m=n.startsWith("top"),g=480,v=16,B;if(A.container&&window.innerWidth>640){let k=A.container.getBoundingClientRect(),V=k.left+k.width/2;B=Math.max(v,Math.min(V-g/2,window.innerWidth-g-v))}else B=Math.max(v,(window.innerWidth-g)/2);Object.assign(c.style,{position:"fixed",[m?"top":"bottom"]:"70px",left:`${B}px`,zIndex:"10003",backgroundColor:"var(--devbar-color-bg-elevated)",border:`1px solid ${o}`,borderRadius:"8px",boxShadow:`${bt.shadows.dropLg}, 0 0 0 1px ${ee(o,20)}`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",width:`${g}px`,maxWidth:"calc(100vw - 32px)",maxHeight:"calc(100vh - 100px)",overflowY:"auto",fontFamily:Bt}),c.appendChild(b7(A));let C=document.createElement("div");C.className="devbar-settings-grid",Object.assign(C.style,{display:"grid",gridTemplateColumns:"1fr 1fr"});let E=H.textSecondary,D=document.createElement("div");Object.assign(D.style,{borderRight:`1px solid ${ee(E,13)}`}),D.appendChild(B7(A)),D.appendChild(y7(A)),C.appendChild(D);let T=document.createElement("div");T.appendChild(S7(A)),T.appendChild(T7(A)),C.appendChild(T),c.appendChild(C),c.appendChild(I7(A)),l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),c.focus()}function b7(A){let{accentColor:n}=A.options,o=document.createElement("div");Object.assign(o.style,{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",borderBottom:`1px solid ${ee(n,19)}`,position:"sticky",top:"0",backgroundColor:"var(--devbar-color-bg-elevated)",zIndex:"1"});let l=document.createElement("span");return Object.assign(l.style,{color:n,fontSize:"0.75rem",fontWeight:"600"}),l.textContent="Settings",o.appendChild(l),o.appendChild(Eo(()=>{A.showSettingsPopover=!1,A.render()})),o}function B7(A){let{accentColor:n}=A.options,o=!!A.forcedThemeMode,l=pu("Theme");hu(l,o?`Theme is controlled by the host app: ${A.forcedThemeMode}.`:"Follow OS/browser preference, force dark, or force light while reviewing.");let c=document.createElement("div");return Object.assign(c.style,{display:"flex",gap:"6px"}),["system","dark","light"].forEach(g=>{let v=Ny({label:g,isActive:A.themeMode===g,accentColor:n,disabled:o&&g!==A.forcedThemeMode,disabledTitle:"Theme controlled by host app",onClick:()=>fu(A,g)});v.style.textTransform="capitalize",c.appendChild(v)}),l.appendChild(c),l}function y7(A){let n=pu("Display & appearance");return hu(n,"Change where DevBar lives and how evidence captures are rendered."),n.appendChild(C7(A)),n.appendChild(E7(A)),n.appendChild(x7(A)),n.appendChild(Q7(A)),n}function C7(A){let{accentColor:n}=A.options,o=H.textSecondary,l=document.createElement("div");Object.assign(l.style,{marginBottom:"10px"});let c=document.createElement("div");Object.assign(c.style,{color:H.text,fontSize:"0.6875rem",marginBottom:"6px"}),c.textContent="Position",l.appendChild(c);let m=document.createElement("div");return Object.assign(m.style,{position:"relative",width:"100%",height:"70px",backgroundColor:"var(--devbar-color-bg-input)",border:`1px solid ${ee(o,19)}`,borderRadius:"4px"}),[{value:"top-left",style:{top:"6px",left:"6px"},title:"Top Left"},{value:"top-right",style:{top:"6px",right:"6px"},title:"Top Right"},{value:"bottom-left",style:{bottom:"6px",left:"6px"},title:"Bottom Left"},{value:"bottom-right",style:{bottom:"6px",right:"6px"},title:"Bottom Right"},{value:"bottom-center",style:{bottom:"6px",left:"50%",transform:"translateX(-50%)"},title:"Bottom Center"}].forEach(({value:v,style:B,title:C})=>{let E=document.createElement("button");E.setAttribute("data-position",v);let D=A.options.position===v;Object.assign(E.style,{position:"absolute",width:"24px",height:"6px",backgroundColor:D?n:H.textMuted,border:`1px solid ${D?n:H.textMuted}`,borderRadius:"2px",cursor:"pointer",padding:"0",transition:"all 150ms",boxShadow:D?`0 0 8px ${ee(n,38)}`:"none",opacity:D?"1":"0.5",...B}),E.title=C,E.onclick=()=>{A.options.position=v,A.settingsManager.saveSettings({position:v}),A.render()},E.onmouseenter=()=>{D||(E.style.backgroundColor=n,E.style.borderColor=n,E.style.boxShadow=`0 0 6px ${ee(n,25)}`,E.style.opacity="1")},E.onmouseleave=()=>{D||(E.style.backgroundColor=H.textMuted,E.style.borderColor=H.textMuted,E.style.boxShadow="none",E.style.opacity="0.5")},m.appendChild(E)}),l.appendChild(m),l}function E7(A){let{accentColor:n}=A.options,o=document.createDocumentFragment();o.appendChild(Ai("Compact Mode",A.compactMode,n,()=>{A.toggleCompactMode()}));let l=document.createElement("div");return Object.assign(l.style,{color:H.textMuted,fontSize:"0.5625rem",marginTop:"2px",marginBottom:"8px"}),l.textContent="Keyboard: Cmd or Ctrl+Shift+M",o.appendChild(l),o}function x7(A){let n=document.createElement("div");Object.assign(n.style,{marginBottom:"6px"});let o=document.createElement("div");Object.assign(o.style,{color:H.text,fontSize:"0.6875rem",marginBottom:"6px"}),o.textContent="Accent Color",n.appendChild(o);let l=document.createElement("div");Object.assign(l.style,{display:"flex",gap:"6px",flexWrap:"wrap",alignItems:"center"});let c=A.options.accentColor,m=c===H.primary,v=!vf.some(B=>B.value===c)&&!m;if(vf.forEach(({name:B,value:C})=>{let E=document.createElement("button"),D=c===C||m&&B==="Emerald";Object.assign(E.style,{width:"24px",height:"24px",borderRadius:"50%",backgroundColor:C,border:D?"2px solid #fff":"2px solid transparent",cursor:"pointer",transition:"all 150ms",boxShadow:D?`0 0 8px ${C}`:"none"}),E.title=B,E.onclick=()=>{A.options.accentColor=C,A.settingsManager.saveSettings({accentColor:C}),A.render()},l.appendChild(E)}),v){let B=document.createElement("button");B.type="button",B.setAttribute("data-accent-reset","true"),B.title=`Custom color (${c}). Click to reset to theme default.`,Object.assign(B.style,{marginLeft:"4px",padding:"2px 8px",borderRadius:"10px",border:`1px dashed ${c}`,backgroundColor:"transparent",color:c,fontSize:"0.625rem",fontFamily:Bt,cursor:"pointer",lineHeight:"1.4"}),B.textContent="custom \xB7 reset",B.onclick=()=>{let C=Co.accentColor;A.options.accentColor=C,A.settingsManager.saveSettings({accentColor:C}),A.render()},l.appendChild(B)}return n.appendChild(l),n}function F7(A,n){return[`#${A}::-webkit-slider-thumb {`," -webkit-appearance: none;"," width: 12px; height: 12px;"," border-radius: 50%;",` background: ${n};`,` border: 2px solid ${H.bg};`,` box-shadow: 0 0 4px ${ee(n,50)};`," cursor: grab;","}",`#${A}::-webkit-slider-thumb:active { cursor: grabbing; }`,`#${A}::-moz-range-thumb {`," width: 12px; height: 12px;"," border-radius: 50%;",` background: ${n};`,` border: 2px solid ${H.bg};`,` box-shadow: 0 0 4px ${ee(n,50)};`," cursor: grab;","}",`#${A}::-webkit-slider-runnable-track { background: transparent; }`,`#${A}::-moz-range-track { background: transparent; }`].join(`
|
|
443
443
|
`)}function D7(A,n,o,l){A.oninput=()=>{let c=parseFloat(A.value);n.textContent=c.toFixed(2),o.style.width=`${c*100}%`,l.options.screenshotQuality=c},A.onchange=()=>{l.settingsManager.saveSettings({screenshotQuality:l.options.screenshotQuality})}}function Q7(A){let{accentColor:n}=A.options,o=H.textSecondary,l=document.createElement("div");Object.assign(l.style,{marginTop:"8px"});let c=document.createElement("div");Object.assign(c.style,{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"});let m=document.createElement("span");Object.assign(m.style,{color:H.text,fontSize:"0.6875rem"}),m.textContent="Screenshot Quality",c.appendChild(m);let g=document.createElement("span");Object.assign(g.style,{color:n,fontSize:"0.6875rem",fontFamily:"monospace",minWidth:"28px",textAlign:"right"});let v=A.options.screenshotQuality;g.textContent=v.toFixed(2),c.appendChild(g),l.appendChild(c);let B=document.createElement("div");Object.assign(B.style,{position:"relative",height:"20px"});let C=document.createElement("div");Object.assign(C.style,{position:"absolute",top:"50%",left:"0",right:"0",height:"2px",transform:"translateY(-50%)",borderRadius:"1px",background:ee(o,25),pointerEvents:"none"});let E=document.createElement("div");Object.assign(E.style,{height:"100%",width:`${v*100}%`,borderRadius:"1px",background:n}),C.appendChild(E),B.appendChild(C);let D=document.createElement("input");D.type="range",D.min="0",D.max="1",D.step="0.01",D.value=String(v),Object.assign(D.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",appearance:"none",WebkitAppearance:"none",background:"transparent",outline:"none",cursor:"pointer",margin:"0"});let T=`devbar-quality-${Date.now()}`;D.id=T;let k=document.createElement("style");return k.textContent=F7(T,n),B.appendChild(k),D7(D,g,E,A),B.appendChild(D),l.appendChild(B),l}function S7(A){let{accentColor:n}=A.options,o=pu("Evidence workflow");return hu(o,"Choose the controls and save behavior an agent sees during inspect, verify, and handoff."),o.appendChild(U7(A)),o.appendChild(Ai("Screenshot Button",A.options.showScreenshot,n,()=>{A.options.showScreenshot=!A.options.showScreenshot,A.settingsManager.saveSettings({showScreenshot:A.options.showScreenshot}),A.render()})),o.appendChild(Ai("Console Badges",A.options.showConsoleBadges,n,()=>{A.options.showConsoleBadges=!A.options.showConsoleBadges,A.settingsManager.saveSettings({showConsoleBadges:A.options.showConsoleBadges}),A.render()})),o.appendChild(Ai("Tooltips",A.options.showTooltips,n,()=>{A.options.showTooltips=!A.options.showTooltips,A.settingsManager.saveSettings({showTooltips:A.options.showTooltips}),A.render()})),o}function U7(A){let{accentColor:n}=A.options,o=document.createElement("div");Object.assign(o.style,{marginBottom:"10px"});let l=document.createElement("div");Object.assign(l.style,{color:H.text,fontSize:"0.6875rem",marginBottom:"6px"}),l.textContent="Save Method",o.appendChild(l);let c=document.createElement("div");Object.assign(c.style,{color:H.textMuted,fontSize:"0.5625rem",lineHeight:"1.4",marginBottom:"8px"}),c.textContent="Auto saves artifacts through Sweetlink when connected, otherwise downloads in-browser.",o.appendChild(c);let m=document.createElement("div");return Object.assign(m.style,{display:"flex",gap:"6px",flexWrap:"wrap"}),[{value:"auto",label:"Auto"},{value:"download",label:"Download"},{value:"local",label:"Local"}].forEach(({value:v,label:B})=>{let C=v==="local"&&!A.sweetlinkConnected,E=Ny({label:B,isActive:A.options.saveLocation===v,accentColor:n,disabled:C,disabledTitle:"Sweetlink not connected",onClick:()=>{A.options.saveLocation=v,A.settingsManager.saveSettings({saveLocation:v}),A.render()}});m.appendChild(E)}),o.appendChild(m),o}function T7(A){let{accentColor:n}=A.options,o=pu("Metrics");return hu(o,"Keep the toolbar focused by hiding metrics that are not useful now."),[{key:"breakpoint",label:"Breakpoint"},{key:"fcp",label:"FCP"},{key:"lcp",label:"LCP"},{key:"cls",label:"CLS"},{key:"inp",label:"INP"},{key:"pageSize",label:"Page Size"}].forEach(({key:c,label:m})=>{let g=A.options.showMetrics[c]??!0;o.appendChild(Ai(m,g,n,()=>{A.options.showMetrics[c]=!A.options.showMetrics[c],A.settingsManager.saveSettings({showMetrics:{breakpoint:A.options.showMetrics.breakpoint??!0,fcp:A.options.showMetrics.fcp??!0,lcp:A.options.showMetrics.lcp??!0,cls:A.options.showMetrics.cls??!0,inp:A.options.showMetrics.inp??!0,pageSize:A.options.showMetrics.pageSize??!0}}),A.render()}))}),o}function I7(A){let n=H.textSecondary,o=document.createElement("div");Object.assign(o.style,{padding:"10px 14px",borderTop:`1px solid ${ee(n,13)}`});let l=tn({color:H.textMuted,text:"Reset to Defaults",padding:"6px 12px",fontSize:"0.625rem"});Object.assign(l.style,{width:"100%",justifyContent:"center",border:"1px solid transparent"});let c=H.textMuted;return l.onmouseenter=()=>{l.style.border=`1px solid ${c}`,l.style.backgroundColor=ee(c,6)},l.onmouseleave=()=>{l.style.border="1px solid transparent",l.style.backgroundColor="transparent"},l.onclick=()=>{A.settingsManager.resetToDefaults();let m=Co;A.applySettings(m)},o.appendChild(l),o}function pu(A,n=!0){let o=H.textSecondary,l=document.createElement("div");Object.assign(l.style,{padding:"10px 14px",borderBottom:n?`1px solid ${ee(o,13)}`:"none"});let c=document.createElement("div");return Object.assign(c.style,{color:o,fontSize:"0.625rem",textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:"8px"}),c.textContent=A,l.appendChild(c),l}function hu(A,n){let o=document.createElement("div");Object.assign(o.style,{color:H.textMuted,fontSize:"0.5625rem",lineHeight:"1.4",margin:"-2px 0 10px"}),o.textContent=n,A.appendChild(o)}function Ny(A){let{label:n,isActive:o,accentColor:l,disabled:c,disabledTitle:m,onClick:g}=A,v=H.textSecondary,B=document.createElement("button");return Object.assign(B.style,{padding:"6px 10px",minHeight:"28px",backgroundColor:o?ee(l,13):"transparent",border:`1px solid ${o?l:"transparent"}`,borderRadius:"4px",color:o?l:v,fontFamily:Bt,fontSize:"0.625rem",cursor:c?"not-allowed":"pointer",transition:"all 150ms",opacity:c?"0.5":"1"}),B.textContent=n,c?m&&(B.title=m):o||(B.onmouseenter=()=>{B.style.borderColor=`${v}`,B.style.backgroundColor=ee(v,6)},B.onmouseleave=()=>{B.style.borderColor="transparent",B.style.backgroundColor="transparent"}),B.onclick=()=>{c||g()},B}function Ai(A,n,o,l){let c=document.createElement("div");Object.assign(c.style,{display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"28px",marginBottom:"6px",gap:"12px"});let m=document.createElement("span");Object.assign(m.style,{color:H.text,fontSize:"0.6875rem"}),m.textContent=A,c.appendChild(m);let g=document.createElement("button");Object.assign(g.style,{width:"32px",height:"18px",borderRadius:"9px",border:`1px solid ${n?o:H.border}`,backgroundColor:n?o:H.bgInput,position:"relative",cursor:"pointer",transition:"all 150ms",flexShrink:"0",boxSizing:"border-box"});let v=document.createElement("span");return Object.assign(v.style,{position:"absolute",top:"2px",left:n?"14px":"2px",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:n?"#fff":H.textMuted,boxShadow:"0 1px 2px rgba(0,0,0,0.2)",transition:"left 150ms, background-color 150ms"}),g.appendChild(v),g.onclick=l,c.appendChild(g),c}function _7(A,n){if(A.consoleFilter){let o=A.consoleFilter;qt(A),A.consoleFilter=o,Qy(A,n)}else A.showOutlineModal?(qt(A),A.showOutlineModal=!0,Iy(A)):A.showSchemaModal?(qt(A),A.showSchemaModal=!0,Ry(A)):A.showA11yModal?(qt(A),A.showA11yModal=!0,Oy(A)):A.showDesignReviewConfirm?(qt(A),A.showDesignReviewConfirm=!0,ky(A)):A.showSettingsPopover&&(qt(A),A.showSettingsPopover=!0,My(A))}function Py(A,n,o){if(!A.destroyed&&!(typeof document>"u")&&!ff){pf(!0),Nw(A),A.overlayElement&&(A.overlayElement.remove(),A.overlayElement=null,document.body.style.overflow=""),A.container&&A.container.remove(),A.container=document.createElement("div"),A.container.setAttribute("data-devbar","true"),A.container.setAttribute("role","toolbar"),A.container.setAttribute("aria-label","DevBar"),document.body.appendChild(A.container);try{A.collapsed?Xw(A):A.compactMode?Dy(A,o):Sy(A,o)}catch(l){console.error("[GlobalDevBar] Render failed:",l)}try{_7(A,n)}catch(l){console.error("[GlobalDevBar] Overlay render failed:",l)}A.overlayElement&&(document.body.style.overflow="hidden"),pf(!1)}}function Ky(A){if(A.pendingViewerWindow){try{A.pendingViewerWindow.close()}catch{}A.pendingViewerWindow=null}}function Gy(A){return`ws://localhost:${A.baseWsPort}`}function Mp(A){return A.wsUrlCandidates?.length?A.wsUrlCandidates:[Gy(A)]}function k7(A,n){return typeof n=="string"?n:typeof n=="number"?`ws://localhost:${n}`:Mp(A)[0]??Gy(A)}function jy(A){try{let n=new URL(A);if(n.protocol!=="ws:"&&n.protocol!=="wss:")return null;let o=Number(n.port);return Number.isInteger(o)&&o>0?o:null}catch{return null}}function Vy(A,n,o=100){let l=Mp(A),c=l.indexOf(n);if(c>=0&&c+1<l.length){setTimeout(()=>Ba(A,l[c+1]),o);return}let m=jy(n);if(m!==null){let g=m+1;if(g<A.baseWsPort+10){setTimeout(()=>Ba(A,g),o);return}}setTimeout(()=>Ba(A),Bw)}function Ba(A,n){if(A.destroyed)return;let o=k7(A,n),l=jy(o);A.debug.ws("Connecting to WebSocket",{url:o,port:l??"same-origin",appPort:A.currentAppPort});let c=new WebSocket(o),m=!1;A.ws=c,A.wsVerified=!1,c.onopen=()=>{A.debug.ws("WebSocket socket opened, awaiting server-info"),c.send(JSON.stringify({type:"browser-client-ready"}))},c.onmessage=async g=>{try{let v=JSON.parse(g.data);if(v.type==="server-info"){let C=v.appPort;if(!(C===null||C===A.currentAppPort)){A.debug.ws("Server mismatch",{serverAppPort:C,currentAppPort:A.currentAppPort,targetUrl:o}),m=!0,c.close(),Vy(A,o);return}A.wsVerified=!0,A.sweetlinkConnected=!0,A.reconnectAttempts=0,A.serverProjectDir=v.projectDir??null,A.serverGitBranch=v.gitBranch??null,A.serverAppName=v.appName??null,A.debug.ws("Server verified",{appPort:C??"any",projectDir:A.serverProjectDir,gitBranch:A.serverGitBranch}),A.settingsManager.setWebSocket(c),A.settingsManager.setConnected(!0),c.send(JSON.stringify({type:"load-settings"})),A.render();return}if(!A.wsVerified){A.debug.ws("Ignoring command before verification",{type:v.type});return}if(v.type==="hifi-screenshot"){A.capturing=!1,A.render();return}if(v.type==="record-start-response"&&v.success){A.recordingActive=!0,A.recordingSessionId=v.sessionId??null,A.recordingStartedAt=Date.now(),A.recordingTimer=setInterval(()=>A.render(),1e3),A.render();return}if(v.type==="record-stop-response"||v.type==="record-stop"){if(A.recordingActive=!1,A.recordingTimer&&clearInterval(A.recordingTimer),A.recordingTimer=null,A.recordingStartedAt=null,v.success){let E=v.viewerUrl;E&&A.pendingViewerWindow?(A.pendingViewerWindow.location.href=E,A.pendingViewerWindow=null):Ky(A),E&&(A.lastViewerPath=E)}else Ky(A);A.render();return}let B=v;A.debug.ws("Received command",{type:B.type}),await iK(A,B)}catch(v){console.error("[GlobalDevBar] Error handling command:",v)}},c.onclose=()=>{if(A.wsVerified){if(A.sweetlinkConnected=!1,A.wsVerified=!1,A.serverProjectDir=null,A.settingsManager.setConnected(!1),A.debug.ws("WebSocket disconnected"),A.render(),!A.destroyed&&A.reconnectAttempts<Ks){let g=ww*2**A.reconnectAttempts;A.reconnectAttempts++,A.debug.ws("Scheduling reconnect",{attempt:A.reconnectAttempts,delayMs:g}),A.reconnectTimeout=setTimeout(()=>Ba(A,A.baseWsPort),Math.min(g,bw))}}else if(!A.destroyed&&!m){let g=Mp(A),v=g.indexOf(o);v>=0&&v+1<g.length&&(A.debug.ws("WebSocket closed before verification, trying next candidate"),Vy(A,o))}},c.onerror=()=>{A.debug.ws("WebSocket error")}}function mu(A,n,o=ZA){return(l,c)=>{ai(l,A,c[n],o)}}function gu(A,n){return(o,l)=>{n&&(o[n]=!1),console.error(`[GlobalDevBar] ${A} failed:`,l.error),n&&o.render()}}var L7=mu("outline","outlinePath"),H7=mu("schema","schemaPath"),M7=mu("consoleLogs","consoleLogsPath"),N7=mu("a11y","a11yPath"),P7=(A,n)=>{A.capturing=!1,ai(A,"screenshot",n.path,ZA)},K7=gu("Outline save"),V7=gu("Schema save"),G7=gu("Console logs save","savingConsoleLogs"),j7=gu("A11y save","savingA11yAudit");async function W7(A,n){let o=n.selector&&document.querySelector(n.selector)||document.body,c=await(await ei())(o,{logging:!1,useCORS:!0,allowTaint:!0});A.send(JSON.stringify({success:!0,data:{screenshot:c.toDataURL("image/png"),width:c.width,height:c.height,selector:n.selector||"body"},timestamp:Date.now()}))}function q7(A,n,o){let l=A.consoleLogs;if(o.filter){let c=o.filter.toLowerCase();l=l.filter(m=>m.level.includes(c)||m.message.toLowerCase().includes(c))}n.send(JSON.stringify({success:!0,data:l,timestamp:Date.now()}))}function z7(A,n){if(n.selector){let l=Array.from(document.querySelectorAll(n.selector)).map(c=>n.property?c[n.property]??null:{tagName:c.tagName,className:c.className,id:c.id,textContent:c.textContent?.trim().slice(0,100)});A.send(JSON.stringify({success:!0,data:{count:l.length,results:l},timestamp:Date.now()}))}}function X7(A,n){if(n.code&&typeof n.code=="string"&&n.code.length<=1e4)try{let l=(0,eval)(n.code);A.send(JSON.stringify({success:!0,data:l,timestamp:Date.now()}))}catch(o){A.send(JSON.stringify({success:!1,error:o instanceof Error?o.message:"Execution failed",timestamp:Date.now()}))}}async function Y7(A,n){try{let o=await Ws(n.forceRefresh),l={critical:0,serious:0,moderate:0,minor:0};for(let c of o.violations)l[c.impact]=(l[c.impact]||0)+1;A.send(JSON.stringify({success:!0,data:{result:o,summary:{totalViolations:o.violations.length,totalPasses:o.passes.length,totalIncomplete:o.incomplete.length,byImpact:l},url:window.location.href,title:document.title,timestamp:Date.now()},timestamp:Date.now()}))}catch(o){A.send(JSON.stringify({success:!1,error:o instanceof Error?o.message:"Accessibility audit failed",timestamp:Date.now()}))}}function J7(A){try{let n=DA(),o=Yn(n);A.send(JSON.stringify({success:!0,data:{outline:n,markdown:o,url:window.location.href,title:document.title,timestamp:Date.now()},timestamp:Date.now()}))}catch(n){A.send(JSON.stringify({success:!1,error:n instanceof Error?n.message:"Outline extraction failed",timestamp:Date.now()}))}}function $7(A){try{let n=QA(),o=SA(n);A.send(JSON.stringify({success:!0,data:{schema:n,markdown:o,url:window.location.href,title:document.title,timestamp:Date.now()},timestamp:Date.now()}))}catch(n){A.send(JSON.stringify({success:!1,error:n instanceof Error?n.message:"Schema extraction failed",timestamp:Date.now()}))}}async function Z7(A){try{let o=performance.getEntriesByType("paint").find(q=>q.name==="first-contentful-paint"),l=o?Math.round(o.startTime):null,c=q=>new Promise(se=>{try{let $=[],pe=new PerformanceObserver(Se=>{$.push(...Se.getEntries())});pe.observe({type:q,buffered:!0}),setTimeout(()=>{pe.disconnect(),se($)},0)}catch{se([])}}),[m,g,v]=await Promise.all([c("largest-contentful-paint"),c("layout-shift"),c("event")]),B=m.length>0?Math.round(m[m.length-1].startTime):null,C=null;if(g.length>0){let q=0;for(let se of g){let $=se;$.hadRecentInput||(q+=$.value)}C=Math.round(q*1e3)/1e3}let E=null;if(v.length>0){let q=0;for(let se of v){let $=se;$.duration>q&&(q=$.duration)}E=Math.round(q)}let D=null,T=performance.getEntriesByType("resource"),k=0;for(let q of T)k+=q.transferSize||0;k>0&&(D=k);let V={fcp:l,lcp:B,cls:C,inp:E,pageSize:D,url:window.location.href,title:document.title,timestamp:Date.now()},W=[];l!==null&&W.push(`FCP: ${l}ms`),B!==null&&W.push(`LCP: ${B}ms`),C!==null&&W.push(`CLS: ${C}`),E!==null&&W.push(`INP: ${E}ms`),D!==null&&W.push(`Page size: ${Math.round(D/1024)}KB`),A.send(JSON.stringify({success:!0,data:{vitals:V,summary:W.join(", ")||"No metrics available yet"},timestamp:Date.now()}))}catch(n){A.send(JSON.stringify({success:!1,error:n instanceof Error?n.message:"Vitals collection failed",timestamp:Date.now()}))}}function eK(A){try{window.location.reload(),A.send(JSON.stringify({success:!0,timestamp:Date.now()}))}catch(n){A.send(JSON.stringify({success:!1,error:n instanceof Error?n.message:"Refresh failed",timestamp:Date.now()}))}}function tK(A,n){A.designReviewInProgress=!1,ai(A,"designReview",n.reviewPath,Zd)}function rK(A,n){A.designReviewInProgress=!1,A.designReviewError=n.error||"Unknown error",console.error("[GlobalDevBar] Design review failed:",n.error),A.designReviewErrorTimeout&&clearTimeout(A.designReviewErrorTimeout),A.designReviewErrorTimeout=setTimeout(()=>{A.designReviewError=null,A.render()},Zd),A.render()}function nK(A,n){let o=n;A.apiKeyStatus={configured:o.configured??!1,model:o.model,pricing:o.pricing},A.render()}function AK(A,n){sK(A,n.settings)}function aK(A,n){A.debug.state("Settings saved to server",{path:n.settingsPath})}function oK(A){console.error("[GlobalDevBar] Settings operation failed:",A.error)}async function iK(A,n){let o=A.ws;if(!(!o||o.readyState!==WebSocket.OPEN))switch(n.type){case"screenshot":await W7(o,n);break;case"get-logs":q7(A,o,n);break;case"query-dom":z7(o,n);break;case"exec-js":X7(o,n);break;case"get-a11y":await Y7(o,n);break;case"get-outline":J7(o);break;case"get-schema":$7(o);break;case"get-vitals":await Z7(o);break;case"refresh":eK(o);break;case"screenshot-saved":P7(A,n);break;case"design-review-saved":tK(A,n);break;case"design-review-error":rK(A,n);break;case"api-key-status":nK(A,n);break;case"outline-saved":L7(A,n);break;case"outline-error":K7(A,n);break;case"schema-saved":H7(A,n);break;case"schema-error":V7(A,n);break;case"console-logs-saved":M7(A,n);break;case"console-logs-error":G7(A,n);break;case"a11y-saved":N7(A,n);break;case"a11y-error":j7(A,n);break;case"settings-loaded":AK(A,n);break;case"settings-saved":aK(A,n);break;case"settings-error":oK(n);break;default:break}}function ai(A,n,o,l){if(o){switch(n){case"screenshot":A.lastScreenshot=o,A.screenshotTimeout&&clearTimeout(A.screenshotTimeout),A.screenshotTimeout=setTimeout(()=>{A.lastScreenshot=null,A.render()},l);break;case"designReview":A.lastDesignReview=o,A.designReviewTimeout&&clearTimeout(A.designReviewTimeout),A.designReviewTimeout=setTimeout(()=>{A.lastDesignReview=null,A.render()},l);break;case"outline":A.savingOutline=!1,A.lastOutline=o,A.outlineTimeout&&clearTimeout(A.outlineTimeout),A.outlineTimeout=setTimeout(()=>{A.lastOutline=null,A.render()},l);break;case"schema":A.savingSchema=!1,A.lastSchema=o,A.schemaTimeout&&clearTimeout(A.schemaTimeout),A.schemaTimeout=setTimeout(()=>{A.lastSchema=null,A.render()},l);break;case"consoleLogs":A.savingConsoleLogs=!1,A.lastConsoleLogs=o,A.consoleLogsTimeout&&clearTimeout(A.consoleLogsTimeout),A.consoleLogsTimeout=setTimeout(()=>{A.lastConsoleLogs=null,A.render()},l);break;case"a11y":A.savingA11yAudit=!1,A.lastA11yAudit=o,A.a11yTimeout&&clearTimeout(A.a11yTimeout),A.a11yTimeout=setTimeout(()=>{A.lastA11yAudit=null,A.render()},l);break}A.render()}}function sK(A,n){if(!n){A.debug.state("No server settings found, using local");return}A.debug.state("Settings loaded from server",n),A.settingsManager.handleSettingsLoaded(n),A.applySettings(n)}function lK(A,n){let o=[],l=m=>{m&&!o.includes(m)&&o.push(m)};l(n.wsUrl),n.wsPath&&l(vw(A,n.wsPath));let c=$A(n.wsPort)??n.fallbackPort;return l(`ws://localhost:${c}`),o}var Ar=new Ps({trackCounts:!0});Ar.importEarlyLogs();Ar.start();Ar.startErrorHandlers();var wu=class A{static CONTROLS_KEY="__YTSPAR_DEVBAR_CONTROLS__";static get customControls(){return typeof window>"u"?[]:window[A.CONTROLS_KEY]??[]}static set customControls(n){typeof window<"u"&&(window[A.CONTROLS_KEY]=n)}options;forcedThemeMode;debugConfig;debug;container=null;ws=null;consoleLogs=[];sweetlinkConnected=!1;collapsed=!1;capturing=!1;copiedToClipboard=!1;copiedPath=!1;lastScreenshot=null;designReviewInProgress=!1;lastDesignReview=null;designReviewError=null;showDesignReviewConfirm=!1;apiKeyStatus=null;lastOutline=null;lastSchema=null;savingOutline=!1;savingSchema=!1;consoleFilter=null;savingConsoleLogs=!1;lastConsoleLogs=null;consoleLogsTimeout;showOutlineModal=!1;showSchemaModal=!1;showA11yModal=!1;a11yLoading=!1;lastA11yAudit=null;savingA11yAudit=!1;a11yTimeout=null;recordingActive=!1;recordingSessionId=null;recordingStartedAt=null;recordingTimer=null;lastViewerPath=null;pendingViewerWindow=null;demoActive=!1;demoTitle=null;demoSectionCount=0;rulerMode=!1;rulerOverlay=null;rulerPinnedElements=[];rulerCleanup=null;activeTooltips=new Set;breakpointInfo=null;perfStats=null;lcpValue=null;clsValue=0;inpValue=0;reconnectAttempts=0;currentAppPort;baseWsPort;wsUrlCandidates;wsVerified=!1;serverProjectDir=null;serverGitBranch=null;serverAppName=null;lastDotPosition=null;reconnectTimeout=null;screenshotTimeout=null;copiedPathTimeout=null;designReviewTimeout=null;designReviewErrorTimeout=null;outlineTimeout=null;schemaTimeout=null;resizeHandler=null;keydownHandler=null;fcpObserver=null;lcpObserver=null;clsObserver=null;inpObserver=null;destroyed=!1;themeMode="system";themeMediaQuery=null;themeMediaHandler=null;compactMode=!1;showSettingsPopover=!1;overlayElement=null;settingsManager;logChangeListener=null;constructor(n={}){if(this.debugConfig=_w(n.debug),this.debug=new zs(this.debugConfig),this.forcedThemeMode=n.themeMode,this.settingsManager=Jw(n.defaultThemeMode?{themeMode:n.defaultThemeMode}:{}),this.forcedThemeMode&&this.settingsManager.saveSettingsNow({themeMode:this.forcedThemeMode}),typeof window<"u"){let o=mw(window),l=n.sweetlink,c=l?.appPort??gw(window.location,o);this.currentAppPort=c,this.baseWsPort=l?.wsPort??$A(o.wsPort)??hw(c),this.wsUrlCandidates=lK(window.location,{wsUrl:l?.wsUrl??o.wsUrl,wsPort:l?.wsPort??o.wsPort,wsPath:l?.wsPath??o.wsPath,fallbackPort:this.baseWsPort})}else this.currentAppPort=0,this.baseWsPort=9223,this.wsUrlCandidates=[`ws://localhost:${9223}`];this.options={position:n.position??"bottom-left",accentColor:n.accentColor??H.primary,showMetrics:{breakpoint:n.showMetrics?.breakpoint??!0,fcp:n.showMetrics?.fcp??!0,lcp:n.showMetrics?.lcp??!0,cls:n.showMetrics?.cls??!0,inp:n.showMetrics?.inp??!0,pageSize:n.showMetrics?.pageSize??!0},showScreenshot:n.showScreenshot??!0,showConsoleBadges:n.showConsoleBadges??!0,showTooltips:n.showTooltips??!0,saveLocation:n.saveLocation??"auto",screenshotQuality:n.screenshotQuality??.65,sizeOverrides:n.sizeOverrides},this.debug.lifecycle("GlobalDevBar constructed",{options:this.options})}getLogCounts(){return{errorCount:Ar.getErrorCount(),warningCount:Ar.getWarningCount(),infoCount:Ar.getInfoCount()}}resetPositionStyles(n){Object.assign(n.style,{top:"",bottom:"",left:"",right:"",transform:""})}createCollapsedBadge(n,o,l){let c=document.createElement("span");return Object.assign(c.style,{position:"absolute",top:"-6px",right:l,minWidth:"16px",height:"16px",padding:"0 4px",borderRadius:"9999px",backgroundColor:o,color:we.white,fontSize:"0.5625rem",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center"}),c.textContent=n>99?"!":String(n),c}static registerControl(n){A.customControls=A.customControls.filter(l=>l.id!==n.id),A.customControls.push(n);let o=vu();o&&o.render()}static unregisterControl(n){A.customControls=A.customControls.filter(l=>l.id!==n);let o=vu();o&&o.render()}static getControls(){return[...A.customControls]}static clearControls(){A.customControls=[];let n=vu();n&&n.render()}init(){typeof window>"u"||this.destroyed||(this.debug.lifecycle("Initializing DevBar"),this.injectStyles(),this.consoleLogs=Ar.getLogs(),this.debug.lifecycle("Copied console logs",{count:this.consoleLogs.length}),this.logChangeListener=()=>{this.consoleLogs=Ar.getLogs(),this.overlayElement||this.render()},Ar.addListener(this.logChangeListener),Ly(this),Hy(this),this.connectWebSocket(),Ow(this),Lw(this),Rw(this),this.render(),this.debug.lifecycle("DevBar initialized successfully"))}getPosition(){return this.options.position}destroy(){this.debug.lifecycle("Destroying DevBar"),this.destroyed=!0,this.reconnectAttempts=Ks,this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.ws&&this.ws.close(),this.screenshotTimeout&&clearTimeout(this.screenshotTimeout),this.copiedPathTimeout&&clearTimeout(this.copiedPathTimeout),this.designReviewTimeout&&clearTimeout(this.designReviewTimeout),this.outlineTimeout&&clearTimeout(this.outlineTimeout),this.schemaTimeout&&clearTimeout(this.schemaTimeout),this.consoleLogsTimeout&&clearTimeout(this.consoleLogsTimeout),this.a11yTimeout&&clearTimeout(this.a11yTimeout),this.resizeHandler&&window.removeEventListener("resize",this.resizeHandler),this.keydownHandler&&window.removeEventListener("keydown",this.keydownHandler),this.fcpObserver&&this.fcpObserver.disconnect(),this.lcpObserver&&this.lcpObserver.disconnect(),this.clsObserver&&this.clsObserver.disconnect(),this.inpObserver&&this.inpObserver.disconnect(),this.themeMediaQuery&&this.themeMediaHandler&&this.themeMediaQuery.removeEventListener("change",this.themeMediaHandler),this.logChangeListener&&(Ar.removeListener(this.logChangeListener),this.logChangeListener=null),Ar.stop(),this.container&&(this.container.remove(),this.container=null),this.overlayElement&&(this.overlayElement.remove(),this.overlayElement=null,document.body.style.overflow=""),this.debug.lifecycle("DevBar destroyed")}injectStyles(){let n="devbar-styles";if(!document.getElementById(n)){let o=document.createElement("style");o.id=n,o.textContent=Qw,document.head.appendChild(o)}}connectWebSocket(n){Ba(this,n)}handleNotification(n,o,l){ai(this,n,o,l)}applySettings(n){let o=this.forcedThemeMode?{...n,themeMode:this.forcedThemeMode}:n;this.forcedThemeMode&&this.settingsManager.get("themeMode")!==this.forcedThemeMode&&this.settingsManager.saveSettingsNow({themeMode:this.forcedThemeMode}),this.themeMode=o.themeMode,this.compactMode=o.compactMode,this.options.position=o.position,this.options.accentColor=o.accentColor,this.options.showScreenshot=o.showScreenshot,this.options.showConsoleBadges=o.showConsoleBadges,this.options.showTooltips=o.showTooltips,this.options.saveLocation=o.saveLocation,this.options.screenshotQuality=o.screenshotQuality??.65,this.options.showMetrics={...o.showMetrics},this.render()}clearConsoleLogs(){Ar.clear(),this.consoleLogs=[],this.consoleFilter=null,this.render()}handleScreenshot(n){return iy(this,n)}getThemeMode(){return this.themeMode}setThemeMode(n){fu(this,n)}getColors(){return Ew(this.themeMode)}toggleCompactMode(){this.compactMode=!this.compactMode,this.settingsManager.saveSettings({compactMode:this.compactMode}),this.debug.state("Compact mode toggled",{compactMode:this.compactMode}),this.render()}isCompactMode(){return this.compactMode}render(){Py(this,Ar,A.customControls)}},zy="__YTSPAR_DEVBAR_INSTANCE__";function vu(){return typeof window>"u"?null:window[zy]??null}function qy(A){typeof window>"u"||(window[zy]=A)}function bu(A){let n=vu();if(n){let l=n.getPosition(),c=A?.position??"bottom-left";if(l===c)return n;n.destroy(),qy(null)}let o=new wu(A);return o.init(),qy(o),o}typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>bu()):bu());export{bu as initGlobalDevBar};
|
package/dist/browser/devbar.js
CHANGED
|
@@ -515,5 +515,5 @@ ${JSON.stringify(l,null,2)}
|
|
|
515
515
|
`;function fi(A,n={}){let{format:o="jpeg",quality:l=.7}=n;return o==="png"?A.toDataURL("image/png"):A.toDataURL("image/jpeg",l)}function d7(){if(document.getElementById(hy))return()=>{};let n=document.createElement("style");return n.id=hy,n.textContent=c7,document.head.appendChild(n),()=>{n.remove()}}function pi(A={}){document.body.classList.add("devbar-capturing"),document.activeElement instanceof HTMLElement&&document.activeElement.blur();let n=A.hideDevbar?d7():null;return()=>{n?.(),document.body.classList.remove("devbar-capturing")}}function hi(A){return new Promise(n=>setTimeout(n,A))}async function bu(A){return new Promise((n,o)=>{A.toBlob(async l=>{if(!l){o(new Error("Failed to create blob from canvas"));return}try{await navigator.clipboard.write([new ClipboardItem({"image/png":l})]),n()}catch(c){o(c)}},"image/png")})}function my(A,n,o){let l=new Blob([n],{type:o}),c=URL.createObjectURL(l),h=document.createElement("a");h.href=c,h.download=A,h.click(),URL.revokeObjectURL(c)}function gy(A,n){let o=document.createElement("a");o.href=n,o.download=A,o.click()}function Bu(A,n){if(Nn(A.options.saveLocation,A.sweetlinkConnected)==="local"&&A.ws?.readyState===WebSocket.OPEN)A[n.savingFlag]=!0,A.render(),A.ws.send(JSON.stringify({type:n.type,data:n.data}));else{let l=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);my(`${n.downloadFilename}-${l}.md`,n.downloadContent,n.downloadMimeType),A.handleNotification(n.notificationKey,n.notificationMessage,Aa)}}function vy(A,n){return{logging:!1,useCORS:!0,allowTaint:!0,scale:A,windowWidth:window.innerWidth,windowHeight:window.innerHeight,scrollX:n?-window.scrollX:0,scrollY:n?-window.scrollY:0,ignoreElements:o=>o.hasAttribute("data-devbar"),onclone:(o,l)=>{let c=document.createElement("style");c.textContent=["*, *::before, *::after {"," animation: none !important;"," mix-blend-mode: normal !important;","}"].join(`
|
|
516
516
|
`),l.ownerDocument.head.appendChild(c)}}}function f7(A,n){let o=window.innerWidth*n,l=window.innerHeight*n,c=window.scrollX*n,h=window.scrollY*n;if(A.width<=o&&A.height<=l)return A;let g=document.createElement("canvas");g.width=o,g.height=l;let v=g.getContext("2d");return v?(v.drawImage(A,c,h,o,l,0,0,o,l),g):A}async function wy(A,n){try{await navigator.clipboard.writeText(n),A.copiedPath=!0,A.copiedPathTimeout&&clearTimeout(A.copiedPathTimeout),A.copiedPathTimeout=setTimeout(()=>{A.copiedPath=!1,A.render()},uf),A.render()}catch(o){console.error("[GlobalDevBar] Failed to copy path:",o)}}async function by(A,n=!1){if(A.capturing)return;let o=Nn(A.options.saveLocation,A.sweetlinkConnected);if(!n&&o==="local"&&!A.sweetlinkConnected)return;let l=null;try{A.capturing=!0,A.render(),l=pi(),await hi(df);let h=await(await _A())(document.body,vy(ff,n));l(),l=null;let g=n?f7(h,ff):h;if(n)try{await bu(g),A.copiedToClipboard=!0,A.render(),A.screenshotTimeout&&clearTimeout(A.screenshotTimeout),A.screenshotTimeout=setTimeout(()=>{A.copiedToClipboard=!1,A.render()},uf)}catch(v){console.error("[GlobalDevBar] Failed to copy to clipboard:",v)}else{let v=fi(g,{format:"jpeg",quality:A.options.screenshotQuality});if(o==="local"&&A.ws?.readyState===WebSocket.OPEN){let B={};A.lcpValue!==null&&(B.lcp=Math.round(A.lcpValue)),A.clsValue>0&&(B.cls=A.clsValue),A.inpValue>0&&(B.inp=Math.round(A.inpValue));let C=performance.getEntriesByType("paint").find(T=>T.name==="first-contentful-paint");C&&(B.fcp=Math.round(C.startTime));let E=0,D=performance.getEntriesByType("navigation")[0];D&&(E+=D.transferSize||0),performance.getEntriesByType("resource").forEach(T=>{E+=T.transferSize||0}),A.ws.send(JSON.stringify({type:"save-screenshot",data:{screenshot:v,width:g.width,height:g.height,logs:A.consoleLogs,url:window.location.href,timestamp:Date.now(),webVitals:Object.keys(B).length>0?B:void 0,pageSize:E>0?E:void 0}}))}else{let B=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);gy(`devbar-screenshot-${B}.jpg`,v),A.handleNotification("screenshot","screenshot downloaded",Aa)}}}catch(c){console.error("[GlobalDevBar] Screenshot failed:",c),l&&l()}finally{A.capturing=!1,A.render()}}async function p7(A){if(A.designReviewInProgress||!A.sweetlinkConnected)return;let n=null;try{A.designReviewInProgress=!0,A.designReviewError=null,A.designReviewErrorTimeout&&(clearTimeout(A.designReviewErrorTimeout),A.designReviewErrorTimeout=null),A.render(),n=pi(),await hi(df);let l=await(await _A())(document.body,vy(1,!1));n(),n=null;let c=fi(l,{format:"png"});A.ws?.readyState===WebSocket.OPEN&&A.ws.send(JSON.stringify({type:"design-review-screenshot",data:{screenshot:c,width:l.width,height:l.height,logs:A.consoleLogs,url:window.location.href,timestamp:Date.now()}}))}catch(o){console.error("[GlobalDevBar] Design review failed:",o),n&&n(),A.designReviewInProgress=!1,A.render()}}function By(A){A.sweetlinkConnected&&(A.ws?.readyState===WebSocket.OPEN&&A.ws.send(JSON.stringify({type:"check-api-key"})),qt(A),A.showDesignReviewConfirm=!0,A.render())}function yy(A){if(!A.apiKeyStatus?.pricing)return null;let n=window.innerWidth,o=window.innerHeight,l=Math.ceil(n*o/750),c=500,h=1500,g=l+c,{input:v,output:B}=A.apiKeyStatus.pricing,C=g/1e6*v,E=h/1e6*B,D=C+E;return{tokens:g+h,cost:D<.01?"<$0.01":`~$${D.toFixed(2)}`}}function Cy(A){A.showDesignReviewConfirm=!1,A.apiKeyStatus=null,A.render()}function Ey(A){A.showDesignReviewConfirm=!1,p7(A)}function zp(A,n){let o=A[n];qt(A),A[n]=!o,A.render()}function xy(A){zp(A,"showOutlineModal")}function Fy(A){zp(A,"showSchemaModal")}function Dy(A){zp(A,"showA11yModal")}function Qy(A,n){if(A.savingA11yAudit)return;let o=il(n);Bu(A,{type:"save-a11y",data:{markdown:o,url:window.location.href,title:document.title,timestamp:Date.now()},savingFlag:"savingA11yAudit",downloadFilename:"a11y-audit",downloadContent:o,downloadMimeType:"text/markdown",notificationKey:"a11y",notificationMessage:"a11y report downloaded"})}function Sy(A){if(A.savingOutline)return;let n=eA(),o=En(n);Bu(A,{type:"save-outline",data:{outline:n,markdown:o,url:window.location.href,title:document.title,timestamp:Date.now()},savingFlag:"savingOutline",downloadFilename:"outline",downloadContent:o,downloadMimeType:"text/markdown",notificationKey:"outline",notificationMessage:"outline downloaded"})}function Xp(A){return A.length===0?"_No logs_":A.map(n=>`- **[${new Date(n.timestamp).toLocaleTimeString()}]** \`${n.level}\` ${n.message}`).join(`
|
|
517
517
|
`)}function Uy(A,n){if(A.savingConsoleLogs)return;let o=Xp(n);Bu(A,{type:"save-console-logs",data:{logs:n,markdown:o,url:window.location.href,title:document.title,timestamp:Date.now()},savingFlag:"savingConsoleLogs",downloadFilename:"console-logs",downloadContent:o,downloadMimeType:"text/markdown",notificationKey:"consoleLogs",notificationMessage:"console logs downloaded"})}function Ty(A){if(A.savingSchema)return;let n=tA(),o=di(n),l=ci(),c=rA(n,{missingTags:o,favicons:l});Bu(A,{type:"save-schema",data:{schema:n,markdown:c,url:window.location.href,title:document.title,timestamp:Date.now()},savingFlag:"savingSchema",downloadFilename:"schema",downloadContent:c,downloadMimeType:"text/markdown",notificationKey:"schema",notificationMessage:"schema downloaded"})}function mi(A,n,o){if(Ef(o)){A.addSuccess(`${n} simulated`,o),A.addWarning(sb());return}let l=o.endsWith("downloaded");A.addSuccess(l?`${n} downloaded!`:`${n} saved!`,l?void 0:o)}function nA(A,n,o,l){let h={error:"error",warn:"warning",info:"info"}[n],g=A.consoleFilter===n,v=document.createElement("span");return v.className="devbar-badge",Object.assign(v.style,{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"18px",height:"18px",padding:"0 5px",borderRadius:"9999px",backgroundColor:l,color:"#fff",fontSize:"0.625rem",fontWeight:"600",cursor:"pointer",boxShadow:g?`0 0 8px ${ee(l,80)}`:"none"}),v.textContent=o>99?"99+":String(o),Zr(A,v,()=>`${o} console ${h}${o===1?"":"s"} (click to view)`),v.onclick=()=>{let B=A.consoleFilter===n?null:n;qt(A),A.consoleFilter=B,A.render()},v}function yu(A,n){let o=document.createElement("button");o.type="button",o.setAttribute("aria-label","Screenshot");let l=A.copiedToClipboard||A.copiedPath||A.lastScreenshot,c=A.capturing,h=Nn(A.options.saveLocation,A.sweetlinkConnected),g=h==="local"&&!A.sweetlinkConnected&&!l;return en(A,o,n,(v,B)=>{if(A.copiedToClipboard){B.addSuccess("Copied to clipboard!");return}if(A.copiedPath){B.addSuccess("Path copied to clipboard!");return}if(A.lastScreenshot){let C=A.lastScreenshot;if(Ef(C)){mi(B,"Screenshot",C);return}if(C.endsWith("downloaded"))B.addSuccess("Screenshot downloaded!");else{B.addSuccess("Screenshot saved!",C);let D=document.createElement("div");Object.assign(D.style,{color:n,cursor:"pointer",fontSize:"0.625rem",marginTop:"6px",opacity:"0.8",transition:"opacity 150ms"}),D.textContent="copy path",D.onmouseenter=()=>{D.style.opacity="1"},D.onmouseleave=()=>{D.style.opacity="0.8"},D.onclick=async T=>{T.stopPropagation();try{await navigator.clipboard.writeText(C),D.textContent="\u2713 copied!",D.style.cursor="default",D.onclick=null}catch{D.textContent="\xD7 failed to copy",D.style.color=H.error}},v.appendChild(D)}return}if(B.addTitle("Screenshot"),B.addSectionHeader("Actions"),h==="local"&&!A.sweetlinkConnected)B.addShortcut("Shift+Click","Copy to clipboard"),B.addWarning("Sweetlink not connected. Switch save method to Auto or Download.");else{let C=h==="local"?"Save to file":"Download";B.addShortcut("Click",C),B.addShortcut("Shift+Click","Copy to clipboard"),B.addShortcut("Alt+Click","HiFi screenshot (pixel-perfect via daemon)"),B.addSectionHeader("Keyboard"),B.addShortcut("Cmd or Ctrl+Shift+S",C),B.addShortcut("Cmd or Ctrl+Shift+C","Copy")}}),Object.assign(o.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",minWidth:"24px",minHeight:"24px",flexShrink:"0",borderRadius:"50%",border:"1px solid",borderColor:l?n:ee(n,50),backgroundColor:l?ee(n,20):"transparent",color:l?n:ee(n,60),cursor:c?"not-allowed":"pointer",opacity:g?"0.4":"1",transition:"all 150ms"}),o.disabled=c,o.onclick=v=>{if(v.altKey){if(!A.ws||!A.sweetlinkConnected)return;A.ws.send(JSON.stringify({type:"hifi-screenshot"})),A.capturing=!0,A.render();return}A.lastScreenshot&&!v.shiftKey?wy(A,A.lastScreenshot):A.handleScreenshot(v.shiftKey)},A.copiedToClipboard||A.copiedPath||A.lastScreenshot?(o.textContent="\u2713",o.style.fontSize="0.6rem"):A.capturing?(o.textContent="...",o.style.fontSize="0.5rem"):o.appendChild(Mr("M19.844 7.938H7.938v11.905m0 11.113v11.906h11.905m23.019-11.906v11.906H30.956m11.906-23.018V7.938H30.956",{viewBox:"0 0 50.8 50.8",stroke:!0,strokeWidth:"4",children:[{type:"circle",cx:"25.4",cy:"25.4",r:"8.731"}]})),o}function Iy(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label","AI Design Review");let o=!!A.designReviewError,l=A.designReviewInProgress||!!A.lastDesignReview||o,c=A.designReviewInProgress||!A.sweetlinkConnected,h=o?H.error:Me.review;return en(A,n,h,(g,v)=>{if(A.designReviewInProgress){v.addProgress("AI Design Review in progress...");return}if(A.designReviewError){v.addError("Design review failed",A.designReviewError);return}if(A.lastDesignReview){mi(v,"Design review",A.lastDesignReview);return}v.addTitle("AI Design Review"),v.addDescription("Captures screenshot and sends to Claude for design analysis."),v.addSectionHeader("Requirements"),v.addShortcut("API Key","ANTHROPIC_API_KEY"),tn()&&v.addWarning("Demo mode: no Claude request will be sent."),A.sweetlinkConnected||v.addWarning("Sweetlink not connected")}),Object.assign(n.style,Hr(h,l,c)),A.sweetlinkConnected||(n.style.opacity="0.5"),n.disabled=c,n.onclick=()=>By(A),A.designReviewInProgress?(n.textContent="~",n.style.fontSize="0.5rem",n.style.animation="pulse 1s infinite"):A.designReviewError?(n.textContent="\xD7",n.style.fontSize="0.875rem",n.style.fontWeight="bold"):A.lastDesignReview?(n.textContent="v",n.style.fontSize="0.5rem"):n.appendChild(Mr("M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z",{fill:!0})),n}function _y(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label","Document Outline");let o=A.showOutlineModal||!!A.lastOutline;return en(A,n,Me.outline,(l,c)=>{if(A.lastOutline){mi(c,"Outline",A.lastOutline);return}c.addTitle("Document Outline"),c.addDescription("View page heading structure and save as markdown."),tn()&&c.addWarning("Demo mode: save actions return example paths only."),A.options.saveLocation==="local"&&!A.sweetlinkConnected&&c.addWarning("Sweetlink not connected. Switch save method to Auto or Download.")}),Object.assign(n.style,Hr(Me.outline,o,!1)),n.onclick=()=>xy(A),A.lastOutline?(n.textContent="v",n.style.fontSize="0.5rem"):n.appendChild(Mr("M3 4h18v2H3V4zm0 7h12v2H3v-2zm0 7h18v2H3v-2z",{fill:!0})),n}function Ry(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label","Page Schema");let o=A.showSchemaModal||!!A.lastSchema;return en(A,n,Me.schema,(l,c)=>{if(A.lastSchema){mi(c,"Schema",A.lastSchema);return}c.addTitle("Page Schema"),c.addDescription("View JSON-LD, Open Graph, and other structured data."),tn()&&c.addWarning("Demo mode: save actions return example paths only."),A.options.saveLocation==="local"&&!A.sweetlinkConnected&&c.addWarning("Sweetlink not connected. Switch save method to Auto or Download.")}),Object.assign(n.style,Hr(Me.schema,o,!1)),n.onclick=()=>Fy(A),A.lastSchema?(n.textContent="v",n.style.fontSize="0.5rem"):n.appendChild(Mr("M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z",{fill:!0})),n}function Oy(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label","Accessibility Audit");let o=A.showA11yModal||!!A.lastA11yAudit;return en(A,n,Me.a11y,(l,c)=>{if(A.lastA11yAudit){mi(c,"A11y report",A.lastA11yAudit);return}c.addTitle("Accessibility Audit"),c.addDescription("Run axe-core audit to check WCAG compliance."),tn()&&c.addWarning("Demo mode: save actions return example paths only."),A.options.saveLocation==="local"&&!A.sweetlinkConnected&&c.addWarning("Sweetlink not connected. Switch save method to Auto or Download.")}),n.addEventListener("mouseenter",()=>bf(),{once:!0}),Object.assign(n.style,Hr(Me.a11y,o,!1)),n.onclick=()=>Dy(A),A.lastA11yAudit?(n.textContent="v",n.style.fontSize="0.5rem"):n.appendChild(Mr("M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z",{fill:!0})),n}function ky(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label","Ruler");let o=A.rulerMode;return en(A,n,Me.ruler,(l,c)=>{o?(c.addTitle("Ruler Mode Active"),c.addDescription("Click elements to pin measurements. Press Esc or click here to exit.")):(c.addTitle("Ruler"),c.addDescription("Measure element dimensions and positions on page."))}),Object.assign(n.style,Hr(Me.ruler,o,!1)),n.onclick=()=>{A.rulerMode?(A.rulerMode=!1,A.rulerCleanup&&(A.rulerCleanup(),A.rulerCleanup=null)):(qt(A),A.rulerMode=!0,A.rulerCleanup=pb(A)),A.render()},o?(n.textContent="\u2716",n.style.fontSize="0.5rem"):n.appendChild(Mr("M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0zM14.5 12.5l2-2M11.5 9.5l2-2M8.5 6.5l2-2M17.5 15.5l2-2",{stroke:!0,strokeWidth:"2"})),n}function Ly(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label",A.recordingActive?"Stop Recording":"Start Recording");let o=A.recordingActive;if(en(A,n,Me.error,(l,c)=>{if(o){let h=A.recordingStartedAt?((Date.now()-A.recordingStartedAt)/1e3).toFixed(0):"0";c.addTitle(`Recording: ${h}s`),c.addShortcut("Click","Stop recording & open viewer")}else A.lastViewerPath?(tn()?(c.addSuccess("Demo recording simulated",A.lastViewerPath),c.addWarning("Demo only: no recording file was written.")):c.addSuccess("Last session recorded"),c.addShortcut("Click","Start new recording"),c.addShortcut("Shift+Click","Open last viewer")):(c.addTitle("Session Recording"),c.addShortcut("Click","Start recording (video + actions)"),tn()&&c.addWarning("Demo mode: no video or action manifest will be recorded."))}),Object.assign(n.style,{...Hr("#ef4444",o,!1),borderColor:o?"#ef4444":ee("#ef4444",50),backgroundColor:o?ee("#ef4444",20):"transparent",color:o?"#ef4444":ee("#ef4444",60),...o&&{animation:"devbar-pulse 1.5s ease-in-out infinite"}}),n.onclick=l=>{if(l.shiftKey&&A.lastViewerPath&&!o){window.open(A.lastViewerPath,"_blank");return}if(!(!A.ws||!A.sweetlinkConnected))if(o){let c=window.open("about:blank","_blank");A.pendingViewerWindow=c,A.ws.send(JSON.stringify({type:"record-stop"})),A.recordingTimer&&clearInterval(A.recordingTimer),A.recordingActive=!1,A.recordingTimer=null,A.recordingStartedAt=null,A.render()}else A.ws.send(JSON.stringify({type:"record-start"})),A.recordingActive=!0,A.recordingStartedAt=Date.now(),A.recordingSessionId=null,A.recordingTimer=setInterval(()=>A.render(),1e3),A.render()},o){let l=document.createElement("span");Object.assign(l.style,{display:"block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#ef4444"}),n.appendChild(l)}else{let l=document.createElement("span");Object.assign(l.style,{display:"block",width:"8px",height:"8px",borderRadius:"50%",border:"2px solid currentColor"}),n.appendChild(l)}return n}function Hy(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label",A.demoActive?"Demo in progress":"Start Demo");let o=A.demoActive;return en(A,n,Me.info,(l,c)=>{o?(c.addTitle(`Demo: "${A.demoTitle??"Untitled"}"`),c.addShortcut(`${A.demoSectionCount} sections`,""),c.addShortcut("Click","Add screenshot to demo")):(c.addTitle("Demo Document"),c.addShortcut("Click","Start demo (prompts for title)"),tn()&&c.addWarning("Demo mode: no markdown document will be written."))}),Object.assign(n.style,{...Hr(Me.info,o,!1)}),n.onclick=()=>{if(!(!A.ws||!A.sweetlinkConnected))if(o)A.ws.send(JSON.stringify({type:"demo-screenshot"})),A.demoSectionCount++,A.render();else{let l=prompt("Demo title:");if(!l)return;A.ws.send(JSON.stringify({type:"demo-init",data:{title:l}})),A.demoActive=!0,A.demoTitle=l,A.demoSectionCount=0,A.render()}},o?(n.textContent=String(A.demoSectionCount),n.style.fontSize="0.6rem"):n.appendChild(Mr("M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",{stroke:!0,strokeWidth:"2"})),n}function Cu(A){let n=document.createElement("button");n.type="button",n.setAttribute("data-testid","devbar-settings-button"),n.setAttribute("aria-label","Settings"),en(A,n,H.textSecondary,(c,h)=>{h.addTitle("Settings"),h.addSectionHeader("Keyboard"),h.addShortcut("Cmd or Ctrl+Shift+M","Toggle compact mode")});let o=A.showSettingsPopover,l=H.textSecondary;return Object.assign(n.style,Hr(l,o,!1)),n.onclick=()=>{let c=A.showSettingsPopover;qt(A),A.showSettingsPopover=!c,A.render()},n.appendChild(Mr("M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",{stroke:!0,children:[{type:"circle",cx:"12",cy:"12",r:"3"}]})),n}function My(A){let n=document.createElement("button");n.type="button",n.setAttribute("aria-label",A.compactMode?"Switch to expanded mode":"Switch to compact mode");let o=A.compactMode,{accentColor:l}=A.options,c=H.textSecondary;Object.assign(n.style,Hr(c,!1,!1)),n.style.borderColor=ee(l,38),Zr(A,n,()=>o?"Expand (Cmd or Ctrl+Shift+M)":"Compact (Cmd or Ctrl+Shift+M)",{onEnter:()=>{n.style.borderColor=l,n.style.backgroundColor=ee(l,13),n.style.color=c},onLeave:()=>{n.style.borderColor=ee(l,38),n.style.backgroundColor="transparent",n.style.color=ee(c,60)}}),n.onclick=()=>{A.toggleCompactMode()};let h=o?"9 18 15 12 9 6":"15 18 9 12 15 6";return n.appendChild(Mr("",{stroke:!0,children:[{type:"polyline",points:h}]})),n}function Ny(A,n=[]){if(!A.container)return;let{position:o,accentColor:l}=A.options,{errorCount:c,warningCount:h,infoCount:g}=A.getLogCounts(),v={"bottom-left":{bottom:"20px",left:"80px"},"bottom-right":{bottom:"20px",right:"16px"},"top-left":{top:"20px",left:"80px"},"top-right":{top:"20px",right:"16px"},"bottom-center":{bottom:"12px",left:"50%",transform:"translateX(-50%)"}},B=v[o]??v["bottom-left"],C=A.container;n.length>0?C.dataset.devbarCustomControls="true":delete C.dataset.devbarCustomControls,A.resetPositionStyles(C),Object.assign(C.style,{position:"fixed",...B,zIndex:"9999",backgroundColor:"var(--devbar-color-bg-card)",border:`1px solid ${l}`,borderRadius:"20px",color:l,boxShadow:`${ht.shadows.dropToolbar}, 0 0 0 1px ${ee(l,10)}`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",padding:"6px 10px",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px",boxSizing:"border-box",maxWidth:o==="bottom-center"?"calc(100vw - 32px)":"calc(100vw - 96px)",minWidth:"0",fontFamily:mt,fontSize:"0.6875rem"});let E=ll(A),D=E.querySelector(".devbar-conn-dot");if(Zr(A,E,()=>ia(A.sweetlinkConnected)),E.onclick=k=>{k.stopPropagation(),_o(A,D),A.collapsed=!0,A.debug.state("Collapsed DevBar from compact mode"),A.render()},C.appendChild(E),c>0&&C.appendChild(nA(A,"error",c,Me.error)),h>0&&C.appendChild(nA(A,"warn",h,Me.warning)),g>0&&C.appendChild(nA(A,"info",g,Me.info)),A.options.showScreenshot&&C.appendChild(yu(A,l)),C.appendChild(Cu(A)),n.length>0){let k=A.options.accentColor;for(let V of n)C.appendChild(Ro(V,k))}let T=document.createElement("button");T.type="button",Object.assign(T.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",borderRadius:"50%",border:`1px solid ${ee(l,38)}`,backgroundColor:"transparent",color:ee(l,60),cursor:"pointer",fontSize:"0.5rem",transition:"all 150ms"}),T.textContent="\u27EB",Zr(A,T,()=>"Expand DevBar",{onEnter:()=>{T.style.backgroundColor=ee(l,13),T.style.borderColor=l,T.style.color=l},onLeave:()=>{T.style.backgroundColor="transparent",T.style.borderColor=ee(l,38),T.style.color=ee(l,60)}}),T.onclick=()=>{A.toggleCompactMode()},C.appendChild(T)}function Da(A,n,o={}){let l=typeof window<"u"?window.location.href:"unknown",c=typeof window<"u"?`${window.innerWidth}x${window.innerHeight} @${window.devicePixelRatio||1}x`:"unknown",h=A.lastScreenshot??"not captured yet",g=o.artifactPath??"not saved yet",v=`Run pnpm sweetlink inspect --url ${l} before acting to refresh @e refs.`,B=[`# ${n}`,`- URL: ${l}`,`- Viewport: ${c}`,`- Screenshot: ${h}`,`- Artifact: ${g}`,`- Refs: ${v}`];return o.observation&&B.push(`- Observation: ${o.observation}`),{title:"Agent Context",items:[{label:"URL",value:l},{label:"Viewport",value:c},{label:"Screenshot",value:h},{label:"Artifact",value:g},{label:"Refs",value:v}],copyText:B.join(`
|
|
518
|
-
`)}}function Py(A,n){let o=A.consoleFilter;if(!o)return;let l=n.getLogs().filter(k=>k.level===o),h={error:Me.error,warn:Me.warning,info:Me.info}[o],v={error:"Errors",warn:"Warnings",info:"Info"}[o],B=()=>{A.consoleFilter=null,A.render()},C=Pn(B),E=Kn(h,`Console ${v}`),D=An({color:h,title:`Console ${v} (${l.length})`,onClose:B,onCopyMd:async()=>{await navigator.clipboard.writeText(Xp(l))},onSave:()=>Uy(A,l),onClear:()=>A.clearConsoleLogs(),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingConsoleLogs,savedPath:A.lastConsoleLogs,evidenceContext:Da(A,`Console ${v}`,{artifactPath:A.lastConsoleLogs,observation:`${l.length} ${o} log${l.length===1?"":"s"} in the current filter.`})});E.appendChild(D);let T=an();l.length===0?T.appendChild(CA(`No ${o}s recorded`)):h7(T,l,h),E.appendChild(T),C.appendChild(E),A.overlayElement=C,document.body.appendChild(C),Vn(E)}function h7(A,n,o){n.forEach((l,c)=>{let h=document.createElement("div");Object.assign(h.style,{padding:"8px 14px",borderBottom:c<n.length-1?`1px solid ${H.borderSubtle}`:"none"});let g=document.createElement("span");Object.assign(g.style,{color:H.textMuted,fontSize:"0.625rem",marginRight:"8px"}),g.textContent=new Date(l.timestamp).toLocaleTimeString(),h.appendChild(g);let v=document.createElement("span");Object.assign(v.style,{color:o,fontSize:"0.6875rem",wordBreak:"break-word",whiteSpace:"pre-wrap"}),v.textContent=l.message,h.appendChild(v),A.appendChild(h)})}function m7(A,n,o){if(A.lastDotPosition&&!o){let g=n.endsWith("right"),v;return g?v=n.startsWith("top")?{top:"20px",right:"16px"}:{bottom:"20px",right:"16px"}:v={top:`${A.lastDotPosition.top-15}px`,left:`${A.lastDotPosition.left-19}px`},A.lastDotPosition=null,v}let h={"bottom-left":{bottom:"20px",left:"80px"},"bottom-right":{bottom:"20px",right:"16px"},"top-left":{top:"20px",left:"80px"},"top-right":{top:"20px",right:"16px"},"bottom-center":{bottom:"12px",left:"50%",transform:"translateX(-50%)"}};return h[n]??h["bottom-left"]}function g7(A,n,o,l,c){A.resetPositionStyles(n);let h=A.options.sizeOverrides,g="fit-content",v="auto",B=c?"calc(100vw - 32px)":"calc(100vw - 96px)";Object.assign(n.style,{position:"fixed",...o,zIndex:"9999",backgroundColor:"var(--devbar-color-bg-card)",border:`1px solid ${l}`,borderRadius:"12px",color:H.primary,boxShadow:`${ht.shadows.dropToolbar}, 0 0 0 1px ${ee(l,10)}`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxSizing:"border-box",width:h?.width??g,maxWidth:h?.maxWidth??B,minWidth:h?.minWidth??v,cursor:"default"}),n.ondblclick=C=>{if(C.target?.closest("button, input, select, a"))return;let D=n.querySelector(".devbar-status span span");D&&_o(A,D),A.collapsed=!0,A.debug.state("Collapsed DevBar (double-click)"),A.render()}}function v7(){let A=document.createElement("div");return A.className="devbar-main",Object.assign(A.style,{display:"flex",alignItems:"center",alignContent:"flex-start",justifyContent:"flex-start",gap:"0.5rem",padding:"0.5rem 0.75rem",minWidth:"0",boxSizing:"border-box",fontFamily:mt,fontSize:"0.6875rem",lineHeight:"1rem"}),A}function w7(A){let n=ll(A);return Zr(A,n,()=>ia(A.sweetlinkConnected,"click to minimize")),n.onclick=o=>{o.stopPropagation(),_o(A,n),A.collapsed=!0,A.debug.state("Collapsed DevBar (connection dot click)"),A.render()},n}function b7(A,n){let o=document.createElement("div");return o.className="devbar-info",Object.assign(o.style,{display:"flex",alignItems:"center",gap:"0.5rem",textTransform:"uppercase",letterSpacing:"0.05em",flexShrink:"1",minWidth:"0",overflow:"visible"}),n.breakpoint&&A.breakpointInfo&&B7(A,o),A.perfStats&&C7(A,o,n),o}function B7(A,n){if(!A.breakpointInfo)return;let o=A.breakpointInfo.tailwindBreakpoint,l=xo[o],c=document.createElement("span");c.className="devbar-item",Object.assign(c.style,{opacity:"0.9",cursor:"default"}),ob(A,c,o,A.breakpointInfo.dimensions,l?.label||"");let h=o;o!=="base"&&(h=o==="sm"?`${o} - ${A.breakpointInfo.dimensions.split("x")[0]}`:`${o} - ${A.breakpointInfo.dimensions}`),c.textContent=h,n.appendChild(c)}function y7(A){return{fcp:{label:"FCP",value:A.fcp,title:"First Contentful Paint (FCP)",description:"Time until the first text or image renders on screen.",thresholds:{good:"<1.8s",needsWork:"1.8-3s",poor:">3s"}},lcp:{label:"LCP",value:A.lcp,title:"Largest Contentful Paint (LCP)",description:"Time until the largest visible element renders on screen.",thresholds:{good:"<2.5s",needsWork:"2.5-4s",poor:">4s"}},cls:{label:"CLS",value:A.cls,title:"Cumulative Layout Shift (CLS)",description:"Visual stability score. Higher values mean more unexpected layout shifts.",thresholds:{good:"<0.1",needsWork:"0.1-0.25",poor:">0.25"}},inp:{label:"INP",value:A.inp,title:"Interaction to Next Paint (INP)",description:"Responsiveness to user input. Measures the longest interaction delay.",thresholds:{good:"<200ms",needsWork:"200-500ms",poor:">500ms"}},pageSize:{label:"",value:A.totalSize,title:"Total Page Size",description:"Compressed/transferred size including HTML, CSS, JS, images, and other resources."}}}function C7(A,n,o){if(!A.perfStats)return;let{visible:l,hidden:c}=Yw(A),h=y7(A.perfStats),g=()=>{let B=document.createElement("span");B.style.opacity="0.4",B.textContent="|",n.appendChild(B)};for(let B of l){if(!o[B])continue;let C=h[B];g();let E=document.createElement("span");E.className="devbar-item",Object.assign(E.style,{opacity:B==="pageSize"?"0.7":"0.85",cursor:"default"}),E.textContent=C.label?`${C.label} ${C.value}`:C.value,C.thresholds?ab(A,E,C.title,C.description,C.thresholds):ib(A,E,C.title,C.description),n.appendChild(E)}let v=c.filter(B=>o[B]);v.length>0&&(g(),E7(A,n,v,h))}function E7(A,n,o,l){let c=document.createElement("span");c.className="devbar-item devbar-clickable",Object.assign(c.style,{opacity:"0.7",cursor:"pointer",padding:"0 2px"}),c.textContent="\xB7\xB7\xB7",nb(A,c,h=>{oa(A,h,"More Metrics");let g=document.createElement("div");Object.assign(g.style,{display:"flex",flexDirection:"column",gap:"6px",marginTop:"8px"});for(let v of o){let B=l[v],C=document.createElement("div");Object.assign(C.style,{display:"flex",justifyContent:"space-between",gap:"12px"});let E=document.createElement("span");Object.assign(E.style,{color:H.textMuted}),E.textContent=B.title.split("(")[0].trim();let D=document.createElement("span");Object.assign(D.style,{color:H.text,fontWeight:"500"}),D.textContent=B.value,C.appendChild(E),C.appendChild(D),g.appendChild(C)}h.appendChild(g)}),n.appendChild(c)}function x7(A,n,o,l,c,h){let g=w7(A),v=document.createElement("div");v.className="devbar-status",Object.assign(v.style,{display:"flex",alignItems:"center",gap:"0.5rem",flexWrap:"nowrap",flexShrink:"1",minWidth:"0"}),v.appendChild(g);let B=b7(A,n);return v.appendChild(B),o&&(l>0&&v.appendChild(nA(A,"error",l,Me.error)),c>0&&v.appendChild(nA(A,"warn",c,Me.warning)),h>0&&v.appendChild(nA(A,"info",h,Me.info))),v}function F7(A,n,o){let l=document.createElement("div");return l.className="devbar-actions",n&&l.appendChild(yu(A,o)),l.appendChild(Iy(A)),l.appendChild(_y(A)),l.appendChild(Ry(A)),l.appendChild(Oy(A)),l.appendChild(ky(A)),l.appendChild(Ly(A)),l.appendChild(Hy(A)),l.appendChild(Cu(A)),l.appendChild(My(A)),l}function D7(A,n){if(A.length===0)return null;let o=document.createElement("div");o.className="devbar-custom-controls",Object.assign(o.style,{display:"flex",flexWrap:"wrap",alignItems:"center",alignContent:"flex-start",justifyContent:"flex-start",gap:"0.5rem",padding:"0 0.75rem 0.5rem 0.75rem",borderTop:`1px solid ${ee(n,19)}`,marginTop:"0",paddingTop:"0.5rem",width:"100%",maxWidth:"100%",minWidth:"0",overflow:"visible",boxSizing:"border-box",fontFamily:mt,fontSize:"0.6875rem"});let l=A.filter(h=>!h.group),c=new Map;for(let h of A){if(!h.group)continue;let g=c.get(h.group)??[];g.push(h),c.set(h.group,g)}for(let h of l)o.appendChild(Ro(h,n));for(let[h,g]of c){let v=document.createElement("span");v.className="devbar-custom-group-label",Object.assign(v.style,{color:ee(n,50),fontSize:"0.5625rem",textTransform:"uppercase",letterSpacing:"0.05em",flex:"0 1 auto",minWidth:"0",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginLeft:l.length>0||[...c.keys()].indexOf(h)>0?"0.25rem":"0"}),v.textContent=h,o.appendChild(v);for(let B of g)o.appendChild(Ro(B,n))}return o}function Ky(A,n){if(!A.container)return;let{position:o,accentColor:l,showMetrics:c,showScreenshot:h,showConsoleBadges:g}=A.options,{errorCount:v,warningCount:B,infoCount:C}=A.getLogCounts(),E=o==="bottom-center",D=A.container;n.length>0?D.dataset.devbarCustomControls="true":delete D.dataset.devbarCustomControls;let T=m7(A,o,E);g7(A,D,T,l,E);let k=v7(),V=x7(A,c,g,v,B,C);k.appendChild(V);let W=F7(A,h,l);k.appendChild(W),D.appendChild(k);let q=D7(n,l);q&&D.appendChild(q)}function jy(A){let n=eA(),o=Me.outline,l=()=>{A.showOutlineModal=!1,A.render()},c=Pn(l),h=Kn(o,"Document Outline"),g=An({color:o,title:"Document Outline",onClose:l,onCopyMd:async()=>{let B=En(n);await navigator.clipboard.writeText(B)},onSave:()=>Sy(A),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingOutline,savedPath:A.lastOutline,evidenceContext:Da(A,"Document Outline",{artifactPath:A.lastOutline,observation:`${n.length} top-level semantic node${n.length===1?"":"s"} found.`})});h.appendChild(g);let v=an();n.length===0?v.appendChild(CA("No semantic elements found in this document")):Wy(n,v,0,{lastHeadingLevel:0}),h.appendChild(v),c.appendChild(h),A.overlayElement=c,document.body.appendChild(c),Vn(h)}function Wy(A,n,o,l){for(let c of A){let h=c.category==="heading"&&c.level>0,g=h&&c.level>l.lastHeadingLevel+1;h&&(l.lastHeadingLevel=c.level);let v=document.createElement("div");if(Object.assign(v.style,{padding:`4px 0 4px ${o*16}px`}),g){let T=document.createElement("span");Object.assign(T.style,{color:H.error,fontSize:"0.625rem",marginRight:"4px"}),T.textContent="\u26A0",T.title=`Heading level skipped (expected h${c.level-1} or higher before h${c.level})`,v.appendChild(T)}let B=document.createElement("span"),C=rl[c.category||"other"]||rl.other;if(Object.assign(B.style,{color:g?H.error:C,fontSize:"0.6875rem",fontWeight:"500"}),B.textContent=`<${c.tagName}>`,v.appendChild(B),c.category){let T=document.createElement("span");Object.assign(T.style,{color:H.textMuted,fontSize:"0.625rem",marginLeft:"6px"}),T.textContent=`[${c.category}]`,v.appendChild(T)}let E=document.createElement("span");Object.assign(E.style,{color:H.textSecondary,fontSize:"0.6875rem",marginLeft:"8px"});let D=c.text.length>60?`${c.text.slice(0,60)}...`:c.text;if(E.textContent=D,v.appendChild(E),c.id){let T=document.createElement("span");Object.assign(T.style,{color:H.textSecondary,fontSize:"0.625rem",marginLeft:"6px"}),T.textContent=`#${c.id}`,v.appendChild(T)}n.appendChild(v),c.children.length>0&&Wy(c.children,n,o+1,l)}}function qy(A){let n=tA(),o=Me.schema,l=()=>{A.showSchemaModal=!1,A.render()},c=Pn(l),h=Kn(o,"Page Schema"),g=di(n),v=ci(),B=An({color:o,title:"Page Schema",onClose:l,onCopyMd:async()=>{let D=rA(n,{missingTags:g,favicons:v});await navigator.clipboard.writeText(D)},onSave:()=>Ty(A),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingSchema,savedPath:A.lastSchema,evidenceContext:Da(A,"Page Schema",{artifactPath:A.lastSchema,observation:g.length?`${g.length} recommended metadata item${g.length===1?"":"s"} missing.`:"Schema evidence captured for this page."})});h.appendChild(B);let C=an();n.jsonLd.length>0||Object.keys(n.openGraph).length>0||Object.keys(n.twitter).length>0||Object.keys(n.metaTags).length>0||v.length>0||g.length>0?(g.length>0&&O7(C,g),Eu(C,"Open Graph",n.openGraph,H.info),Eu(C,"Twitter Cards",n.twitter,H.cyan),v.length>0&&_7(C,v),Eu(C,"JSON-LD",n.jsonLd,o),Eu(C,"Meta Tags",n.metaTags,H.textMuted)):C.appendChild(CA("No structured data found on this page")),h.appendChild(C),c.appendChild(h),A.overlayElement=c,document.body.appendChild(c),Vn(h)}function Jp(A,n,o,l){let c=document.createElement("div");Object.assign(c.style,{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",paddingBottom:"6px",borderBottom:`1px solid ${ee(o,19)}`});let h=document.createElement("h3");Object.assign(h.style,{color:o,fontSize:"0.8125rem",fontWeight:"600",margin:"0"}),h.textContent=n,c.appendChild(h);let g=document.createElement("span");Object.assign(g.style,{color:ee(o,80),fontSize:"0.5625rem",backgroundColor:ee(o,9),padding:"1px 6px",borderRadius:"8px",letterSpacing:"0.03em"}),g.textContent=String(l),c.appendChild(g),A.appendChild(c)}function Eu(A,n,o,l){let c=Array.isArray(o)?o.length:Object.keys(o).length;if(c===0)return;let h=document.createElement("div");h.style.marginBottom="20px",Jp(h,n,l,c),Array.isArray(o)?Q7(h,o,l):U7(h,o),A.appendChild(h)}function Q7(A,n,o){n.forEach((l,c)=>{let h=document.createElement("div");h.style.marginBottom="10px";let g=l,v=typeof g?.["@type"]=="string"?g["@type"]:null,B=document.createElement("div");Object.assign(B.style,{display:"flex",alignItems:"center",gap:"6px",marginBottom:"4px"});let C=document.createElement("span");if(Object.assign(C.style,{color:H.textSecondary,fontSize:"0.6875rem"}),C.textContent=`Schema ${c+1}`,B.appendChild(C),v){let D=document.createElement("span");Object.assign(D.style,{color:ee(o,80),fontSize:"0.5625rem",backgroundColor:ee(o,8),border:`1px solid ${ee(o,15)}`,padding:"0 5px",borderRadius:"3px"}),D.textContent=v,B.appendChild(D)}h.appendChild(B);let E=document.createElement("pre");Object.assign(E.style,{backgroundColor:"rgba(0, 0, 0, 0.25)",borderRadius:"4px",borderLeft:`2px solid ${ee(o,31)}`,padding:"10px 10px 10px 12px",fontSize:"0.625rem",margin:"0",whiteSpace:"pre-wrap",wordBreak:"break-word"}),S7(E,JSON.stringify(l,null,2)),h.appendChild(E),A.appendChild(h)})}function S7(A,n){let o={key:H.primary,string:H.warning,number:H.purple,boolean:H.info,nullVal:H.error,punct:H.textMuted},l=/("(?:\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*")(\s*:)?|(\btrue\b|\bfalse\b)|(\bnull\b)|(-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)|([{}[\],])|(\s+)/g;for(let c of n.matchAll(l)){let[,h,g,v,B,C,E,D]=c;if(D)A.appendChild(document.createTextNode(D));else if(h!==void 0){let T=document.createElement("span");if(T.style.color=g?o.key:o.string,T.textContent=h,A.appendChild(T),g){let k=document.createElement("span");k.style.color=o.punct,k.textContent=":",A.appendChild(k)}}else if(v){let T=document.createElement("span");T.style.color=o.boolean,T.textContent=v,A.appendChild(T)}else if(B){let T=document.createElement("span");T.style.color=o.nullVal,T.textContent=B,A.appendChild(T)}else if(C){let T=document.createElement("span");T.style.color=o.number,T.textContent=C,A.appendChild(T)}else if(E){let T=document.createElement("span");T.style.color=o.punct,T.textContent=E,A.appendChild(T)}}}function U7(A,n){Object.entries(n).forEach(([l,c],h)=>{let g=qp(l),v=document.createElement("div");Object.assign(v.style,{display:"flex",padding:g?"6px 8px":"3px 8px",alignItems:"flex-start",borderRadius:"3px",backgroundColor:h%2===0?"rgba(255, 255, 255, 0.02)":"transparent"});let B=document.createElement("span");if(Object.assign(B.style,{color:H.textSecondary,fontSize:"0.6875rem",width:"120px",minWidth:"120px",maxWidth:"120px",flexShrink:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingTop:g?"2px":"0"}),B.textContent=l,l.length>18&&(B.title=l),v.appendChild(B),g&&c){let C=document.createElement("div");Object.assign(C.style,{flex:"1",minWidth:"0"});let E=document.createElement("div");Object.assign(E.style,{display:"inline-block",padding:"4px",backgroundColor:"rgba(0, 0, 0, 0.2)",border:"1px solid rgba(255, 255, 255, 0.06)",borderRadius:"4px",marginBottom:"4px",minHeight:"60px",minWidth:"80px"});let D=document.createElement("img");Object.assign(D.style,{width:"200px",height:"120px",objectFit:"contain",borderRadius:"2px",display:"block"}),D.src=c,D.alt=l,D.onerror=()=>{E.style.display="none"},D.onload=()=>{D.naturalWidth&&(T.textContent=`${D.naturalWidth}\xD7${D.naturalHeight}`)},E.appendChild(D),C.appendChild(E);let T=document.createElement("div");Object.assign(T.style,{color:H.textMuted,fontSize:"0.5625rem",minHeight:"0.75rem",letterSpacing:"0.02em"}),C.appendChild(T);let k=document.createElement("div");Object.assign(k.style,{color:H.textMuted,fontSize:"0.5625rem",wordBreak:"break-all",opacity:"0.7"}),k.textContent=c,C.appendChild(k),v.appendChild(C)}else{let C=document.createElement("span");Object.assign(C.style,{color:H.text,fontSize:"0.6875rem",flex:"1",wordBreak:"break-word",whiteSpace:"pre-wrap",opacity:"0.85"}),C.textContent=String(c),v.appendChild(C)}A.appendChild(v)})}function T7(A,n){let o=parseInt(n||"",10);return A.includes("apple")?{text:"Apple home screen",color:H.info}:n==="any"||A.includes("svg")?{text:"Scalable (any)",color:H.cyan}:o>=192?{text:"Android / PWA",color:H.primary}:o>=48?{text:"Taskbar / shortcut",color:H.purple}:o>0?{text:"Browser tab",color:H.textSecondary}:{text:"General",color:H.textMuted}}function I7(A,n){let o=T7(A.label,A.size),l=document.createElement("div");Object.assign(l.style,{display:"flex",alignItems:"center",padding:"6px 8px",gap:"10px",borderRadius:"3px",backgroundColor:n%2===0?"rgba(255, 255, 255, 0.02)":"transparent"});let c=document.createElement("div");Object.assign(c.style,{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.25)",border:"1px solid rgba(255, 255, 255, 0.06)",borderRadius:"4px",flexShrink:"0"});let h=document.createElement("img");Object.assign(h.style,{width:"22px",height:"22px",objectFit:"contain"}),h.src=A.url,h.alt=A.label,h.onerror=()=>{c.style.opacity="0.3"},c.appendChild(h),l.appendChild(c);let g=document.createElement("div");Object.assign(g.style,{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",gap:"2px"});let v=document.createElement("div");Object.assign(v.style,{display:"flex",alignItems:"center",gap:"6px"});let B=document.createElement("span");Object.assign(B.style,{color:H.text,fontSize:"0.6875rem",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),B.textContent=A.label,A.label.length>24&&(B.title=A.label),v.appendChild(B);let C=document.createElement("span");Object.assign(C.style,{color:o.color,fontSize:"0.5rem",backgroundColor:ee(o.color,7),padding:"1px 6px",borderRadius:"6px",letterSpacing:"0.03em",whiteSpace:"nowrap",flexShrink:"0"}),C.textContent=o.text,v.appendChild(C),g.appendChild(v);let E=document.createElement("div");if(Object.assign(E.style,{display:"flex",alignItems:"center",gap:"6px",fontSize:"0.5625rem",color:H.textMuted}),A.size){let V=document.createElement("span");V.textContent=A.size,V.style.opacity="0.8",E.appendChild(V)}let D=document.createElement("span");D.style.letterSpacing="0.02em",E.appendChild(D),h.onload=()=>{if(h.naturalWidth){let V=`${h.naturalWidth}\xD7${h.naturalHeight}`;A.size?D.textContent=`\u2192 ${V}`:D.textContent=V}};let T=document.createElement("span");T.textContent="\xB7",T.style.opacity="0.4",E.appendChild(T);let k=document.createElement("span");return Object.assign(k.style,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",opacity:"0.6"}),k.textContent=A.url,k.title=A.url,E.appendChild(k),g.appendChild(E),l.appendChild(g),l}function _7(A,n){let o=H.purple,l=document.createElement("div");l.style.marginBottom="20px",Jp(l,"Favicons",o,n.length),n.forEach((c,h)=>{l.appendChild(I7(c,h))}),A.appendChild(l)}function Vy(A,n){let o=document.createElement("span");return Object.assign(o.style,{color:n,fontSize:"0.5625rem",backgroundColor:ee(n,8),padding:"2px 8px",borderRadius:"8px",letterSpacing:"0.03em"}),o.textContent=A,o}function R7(A,n){let o=document.createElement("div");return Object.assign(o.style,{display:"flex",alignItems:"center",padding:"4px 8px",gap:"8px",borderRadius:"3px",backgroundColor:A%2===0?"rgba(255, 255, 255, 0.02)":"transparent",...n?{borderLeft:`2px solid ${ee(n,25)}`}:{}}),o}function Yp(A,n){let o=document.createElement("span");return Object.assign(o.style,n),o.textContent=A,o}function O7(A,n){let o=document.createElement("div");o.style.marginBottom="20px";let l=n.filter(v=>v.severity==="error").length,c=n.length-l,g=l>0?H.error:H.warning;if(Jp(o,"Missing Tags",g,n.length),l>0||c>0){let v=document.createElement("div");Object.assign(v.style,{display:"flex",gap:"8px",marginBottom:"8px"}),l>0&&v.appendChild(Vy(`${l} error${l>1?"s":""}`,H.error)),c>0&&v.appendChild(Vy(`${c} warning${c>1?"s":""}`,H.warning)),o.appendChild(v)}n.forEach((v,B)=>{let C=v.severity==="error",E=C?H.error:H.warning,D=R7(B,E),T=Yp(C?"\u2718":"\u26A0",{fontSize:"0.625rem",flexShrink:"0",width:"14px",textAlign:"center",color:E});D.appendChild(T),D.appendChild(Yp(v.tag,{color:H.text,fontSize:"0.6875rem",width:"120px",minWidth:"120px",flexShrink:"0",fontWeight:"500"})),D.appendChild(Yp(v.hint,{color:H.textMuted,fontSize:"0.6875rem",flex:"1",opacity:"0.85"})),o.appendChild(D)}),A.appendChild(o)}function zy(A){let n=Me.a11y,o=()=>{A.showA11yModal=!1,A.render()},l=Pn(o),c=Kn(n,"Accessibility Audit");k7(c,n,o,A),l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),Vn(c),So().then(h=>{if(!A.showA11yModal)return;let g=il(h);Df(c);let v=h.violations.length,B=v===0?"Accessibility Audit \u2014 No Issues":`Accessibility Audit \u2014 ${v} Violation${v===1?"":"s"}`,C=An({color:n,title:B,onClose:o,onCopyMd:async()=>{await navigator.clipboard.writeText(g)},onSave:()=>Qy(A,h),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingA11yAudit,savedPath:A.lastA11yAudit,evidenceContext:Da(A,B,{artifactPath:A.lastA11yAudit,observation:v===0?`${h.passes.length} axe rule${h.passes.length===1?"":"s"} passed.`:`${v} accessibility violation${v===1?"":"s"} found.`})});c.appendChild(C);let E=an();L7(E,h,n),c.appendChild(E)}).catch(h=>{if(!A.showA11yModal)return;Df(c);let g=An({color:H.error,title:"Accessibility Audit \u2014 Error",onClose:o,onCopyMd:async()=>{},sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation});c.appendChild(g);let v=an();v.appendChild(la(H.error,"Audit Failed",`${h instanceof Error?h.message:"Unknown error"}`)),c.appendChild(v)})}function k7(A,n,o,l){let c=an(),h=document.createElement("div");Object.assign(h.style,{textAlign:"center",padding:"40px",color:H.textSecondary,fontSize:"0.875rem"}),h.textContent="Running accessibility audit...",h.style.animation="pulse 1.5s ease-in-out infinite",c.appendChild(h);let g=An({color:n,title:"Accessibility Audit",onClose:o,onCopyMd:async()=>{},sweetlinkConnected:l.sweetlinkConnected,saveLocation:l.options.saveLocation});A.appendChild(g),A.appendChild(c)}function L7(A,n,o){if(H7(A,n,o),n.violations.length===0){let l=document.createElement("div");if(Object.assign(l.style,{textAlign:"center",padding:"40px",color:H.primary,fontSize:"0.875rem"}),l.textContent="No accessibility violations found!",A.appendChild(l),n.passes.length>0){let c=document.createElement("div");Object.assign(c.style,{textAlign:"center",color:H.textMuted,fontSize:"0.75rem",marginTop:"8px"}),c.textContent=`${n.passes.length} rules passed`,A.appendChild(c)}}else{let l=Al(n.violations),c=document.createElement("div");Object.assign(c.style,{display:"flex",gap:"12px",marginBottom:"16px",padding:"10px 12px",backgroundColor:ee(o,6),border:`1px solid ${ee(o,19)}`,borderRadius:"6px",flexWrap:"wrap"});for(let g of["critical","serious","moderate","minor"]){if(l[g]===0)continue;let v=document.createElement("span"),B=ol(g);Object.assign(v.style,{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"0.6875rem",fontWeight:"600",color:B});let C=document.createElement("span");Object.assign(C.style,{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:B}),v.appendChild(C),v.appendChild(document.createTextNode(`${l[g]} ${g}`)),c.appendChild(v)}A.appendChild(c);let h=al(n.violations);for(let[g,v]of h)v.length!==0&&N7(A,g,v)}}function H7(A,n,o){let l=[`${n.passes.length} axe rule${n.passes.length===1?"":"s"} passed`,`${n.violations.length} violation${n.violations.length===1?"":"s"} found`,"current DOM, focus semantics, names, landmarks, forms, and color contrast where browser APIs expose enough paint data"];A.appendChild(la(o,"What was checked",l.join(" \xB7 ")))}function Gy(A){let n=document.createElement("div");return Object.assign(n.style,{padding:"3px 6px",marginBottom:"2px",backgroundColor:"rgba(0,0,0,0.2)",borderRadius:"3px",fontSize:"0.625rem",color:H.textSecondary,fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),n.textContent=A.html.length>100?`${A.html.slice(0,100)}...`:A.html,n.title=A.html,n}function M7(A,n){let o=document.createElement("div");Object.assign(o.style,{marginBottom:"12px",padding:"10px 12px",backgroundColor:ee(n,3),border:`1px solid ${ee(n,13)}`,borderRadius:"6px"});let l=document.createElement("div");Object.assign(l.style,{color:n,fontSize:"0.6875rem",fontWeight:"600",marginBottom:"4px"}),l.textContent=A.id,o.appendChild(l);let c=document.createElement("div");Object.assign(c.style,{color:H.text,fontSize:"0.75rem",marginBottom:"4px"}),c.textContent=A.help,o.appendChild(c);let h=document.createElement("div");Object.assign(h.style,{color:H.textSecondary,fontSize:"0.6875rem",marginBottom:"6px"}),h.textContent=A.description,o.appendChild(h);let g=document.createElement("div");Object.assign(g.style,{color:H.textMuted,fontSize:"0.625rem",marginBottom:"4px"}),g.textContent=`${A.nodes.length} element${A.nodes.length===1?"":"s"} affected`,o.appendChild(g);let v=document.createElement("div");Object.assign(v.style,{marginTop:"6px"});let B=A.nodes.slice(0,3);for(let C of B)v.appendChild(Gy(C));if(A.nodes.length>3){let C=document.createElement("button");Object.assign(C.style,{background:"none",border:"none",color:n,fontSize:"0.625rem",cursor:"pointer",padding:"2px 0",fontFamily:mt}),C.textContent=`+ ${A.nodes.length-3} more`,C.onclick=()=>{C.remove();for(let E of A.nodes.slice(3))v.appendChild(Gy(E))},v.appendChild(C)}return o.appendChild(v),o}function N7(A,n,o){let l=ol(n),c=document.createElement("div");c.style.marginBottom="20px";let h=document.createElement("h3");Object.assign(h.style,{color:l,fontSize:"0.8125rem",fontWeight:"600",marginBottom:"10px",borderBottom:`1px solid ${ee(l,25)}`,paddingBottom:"6px",textTransform:"capitalize"}),h.textContent=`${n} (${o.length})`,c.appendChild(h);for(let g of o)c.appendChild(M7(g,l));A.appendChild(c)}function Xy(A){let n=Me.review,o=()=>Cy(A),l=Pn(o),c=Kn(n,"AI Design Review");c.style.maxWidth="450px",c.appendChild(An({color:n,title:"AI Design Review",onClose:o}));let h=an();if(Object.assign(h.style,{color:H.text,fontSize:"0.8125rem",lineHeight:"1.6"}),A.apiKeyStatus===null?h.appendChild(CA("Checking API key configuration...")):A.apiKeyStatus.configured?h.appendChild(K7(A)):h.appendChild(P7()),c.appendChild(h),A.apiKeyStatus?.configured){let g=document.createElement("div");Object.assign(g.style,{display:"flex",justifyContent:"flex-end",gap:"10px",padding:"14px 18px",borderTop:`1px solid ${H.border}`});let v=rn({color:n,text:"Run Review",padding:"8px 16px"});v.style.backgroundColor=ee(n,13),v.onclick=()=>Ey(A),g.appendChild(v),c.appendChild(g)}l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),Vn(c)}function P7(){let A=document.createElement("div");A.appendChild(la(H.error,"API Key Not Configured","The ANTHROPIC_API_KEY environment variable is not set."));let n=document.createElement("div");Object.assign(n.style,{marginBottom:"12px"});let o=document.createElement("div");return Object.assign(o.style,{color:H.textSecondary,fontWeight:"600",marginBottom:"8px"}),o.textContent="To configure:",n.appendChild(o),[{text:"1. Get an API key from console.anthropic.com",highlight:!1},{text:"2. Add to your .env file:",highlight:!1},{text:" ANTHROPIC_API_KEY=sk-ant-...",highlight:!0},{text:"3. Restart your dev server",highlight:!1}].forEach(({text:c,highlight:h})=>{let g=document.createElement("div");Object.assign(g.style,{color:h?H.primary:H.textMuted,fontSize:"0.75rem",marginBottom:"4px",fontFamily:mt}),g.textContent=c,n.appendChild(g)}),A.appendChild(n),A}function K7(A){let n=document.createElement("div");Object.assign(n.style,{marginBottom:"16px"});let o=document.createElement("p");Object.assign(o.style,{color:H.textSecondary,marginBottom:"12px"}),o.textContent="This will capture a screenshot and send it to Claude for design analysis.",n.appendChild(o);let l=yy(A);if(l){let c=la(H.primary,"Estimated Cost",[]);c.style.marginBottom="0",c.style.padding="12px";let h=document.createElement("div");Object.assign(h.style,{display:"flex",justifyContent:"space-between",color:H.textSecondary,fontSize:"0.75rem"});let g=document.createElement("span");g.textContent=`~${l.tokens.toLocaleString()} tokens`,h.appendChild(g);let v=document.createElement("span");Object.assign(v.style,{color:H.warning,fontWeight:"600"}),v.textContent=l.cost,h.appendChild(v),c.appendChild(h),n.appendChild(c)}if(A.apiKeyStatus?.model){let c=document.createElement("div");Object.assign(c.style,{color:H.textMuted,fontSize:"0.6875rem",marginTop:"12px"}),c.textContent=`Model: ${A.apiKeyStatus.model}`,n.appendChild(c)}return n}function Yy(A){let n=A.settingsManager.getSettings();A.themeMode=A.forcedThemeMode??n.themeMode,A.forcedThemeMode&&n.themeMode!==A.forcedThemeMode&&A.settingsManager.saveSettingsNow({themeMode:A.forcedThemeMode}),Do(Fo(A.themeMode)),A.debug.state("Theme loaded",{mode:A.themeMode}),typeof window<"u"&&window.matchMedia&&(A.themeMediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),A.themeMediaHandler=()=>{A.themeMode==="system"&&(Do(Fo(A.themeMode)),A.debug.state("System theme changed",{effectiveTheme:aa(A.themeMode)}),window.dispatchEvent(new CustomEvent("devbar-theme-change",{detail:{mode:A.themeMode}})),A.render())},A.themeMediaQuery.addEventListener("change",A.themeMediaHandler))}function Jy(A){let n=A.settingsManager.getSettings();A.compactMode=n.compactMode,A.debug.state("Compact mode loaded",{compactMode:A.compactMode})}function xu(A,n){let o=A.forcedThemeMode??n;A.themeMode=o,A.settingsManager.saveSettings({themeMode:o}),mf(o),Do(Fo(o)),A.debug.state("Theme mode changed",{mode:o,effectiveTheme:aa(o)}),typeof window<"u"&&window.dispatchEvent(new CustomEvent("devbar-theme-change",{detail:{mode:o}})),A.render()}function $y(A){let{position:n,accentColor:o}=A.options,l=document.createElement("div");l.setAttribute("data-devbar","true"),l.setAttribute("data-devbar-overlay","true"),Object.assign(l.style,{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",zIndex:"10003"}),l.onclick=k=>{k.target===l&&(A.showSettingsPopover=!1,A.render())};let c=document.createElement("div");c.setAttribute("data-devbar","true"),c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true"),c.setAttribute("aria-label","Settings"),c.tabIndex=-1;let h=n.startsWith("top"),g=480,v=16,B;if(A.container&&window.innerWidth>640){let k=A.container.getBoundingClientRect(),V=k.left+k.width/2;B=Math.max(v,Math.min(V-g/2,window.innerWidth-g-v))}else B=Math.max(v,(window.innerWidth-g)/2);Object.assign(c.style,{position:"fixed",[h?"top":"bottom"]:"70px",left:`${B}px`,zIndex:"10003",backgroundColor:"var(--devbar-color-bg-elevated)",border:`1px solid ${o}`,borderRadius:"8px",boxShadow:`${ht.shadows.dropLg}, 0 0 0 1px ${ee(o,20)}`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",width:`${g}px`,maxWidth:"calc(100vw - 32px)",maxHeight:"calc(100vh - 100px)",overflowY:"auto",fontFamily:mt}),c.appendChild(V7(A));let C=document.createElement("div");C.className="devbar-settings-grid",Object.assign(C.style,{display:"grid",gridTemplateColumns:"1fr 1fr"});let E=H.textSecondary,D=document.createElement("div");Object.assign(D.style,{borderRight:`1px solid ${ee(E,13)}`}),D.appendChild(G7(A)),D.appendChild(j7(A)),C.appendChild(D);let T=document.createElement("div");T.appendChild($7(A)),T.appendChild(eK(A)),C.appendChild(T),c.appendChild(C),c.appendChild(tK(A)),l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),c.focus()}function V7(A){let{accentColor:n}=A.options,o=document.createElement("div");Object.assign(o.style,{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",borderBottom:`1px solid ${ee(n,19)}`,position:"sticky",top:"0",backgroundColor:"var(--devbar-color-bg-elevated)",zIndex:"1"});let l=document.createElement("span");return Object.assign(l.style,{color:n,fontSize:"0.75rem",fontWeight:"600"}),l.textContent="Settings",o.appendChild(l),o.appendChild(Oo(()=>{A.showSettingsPopover=!1,A.render()})),o}function G7(A){let{accentColor:n}=A.options,o=!!A.forcedThemeMode,l=Fu("Theme");Du(l,o?`Theme is controlled by the host app: ${A.forcedThemeMode}.`:"Follow OS/browser preference, force dark, or force light while reviewing.");let c=document.createElement("div");return Object.assign(c.style,{display:"flex",gap:"6px"}),["system","dark","light"].forEach(g=>{let v=Zy({label:g,isActive:A.themeMode===g,accentColor:n,disabled:o&&g!==A.forcedThemeMode,disabledTitle:"Theme controlled by host app",onClick:()=>xu(A,g)});v.style.textTransform="capitalize",c.appendChild(v)}),l.appendChild(c),l}function j7(A){let n=Fu("Display & appearance");return Du(n,"Change where DevBar lives and how evidence captures are rendered."),n.appendChild(W7(A)),n.appendChild(q7(A)),n.appendChild(z7(A)),n.appendChild(J7(A)),n}function W7(A){let{accentColor:n}=A.options,o=H.textSecondary,l=document.createElement("div");Object.assign(l.style,{marginBottom:"10px"});let c=document.createElement("div");Object.assign(c.style,{color:H.text,fontSize:"0.6875rem",marginBottom:"6px"}),c.textContent="Position",l.appendChild(c);let h=document.createElement("div");return Object.assign(h.style,{position:"relative",width:"100%",height:"70px",backgroundColor:"var(--devbar-color-bg-input)",border:`1px solid ${ee(o,19)}`,borderRadius:"4px"}),[{value:"top-left",style:{top:"6px",left:"6px"},title:"Top Left"},{value:"top-right",style:{top:"6px",right:"6px"},title:"Top Right"},{value:"bottom-left",style:{bottom:"6px",left:"6px"},title:"Bottom Left"},{value:"bottom-right",style:{bottom:"6px",right:"6px"},title:"Bottom Right"},{value:"bottom-center",style:{bottom:"6px",left:"50%",transform:"translateX(-50%)"},title:"Bottom Center"}].forEach(({value:v,style:B,title:C})=>{let E=document.createElement("button");E.setAttribute("data-position",v);let D=A.options.position===v;Object.assign(E.style,{position:"absolute",width:"24px",height:"6px",backgroundColor:D?n:H.textMuted,border:`1px solid ${D?n:H.textMuted}`,borderRadius:"2px",cursor:"pointer",padding:"0",transition:"all 150ms",boxShadow:D?`0 0 8px ${ee(n,38)}`:"none",opacity:D?"1":"0.5",...B}),E.title=C,E.onclick=()=>{A.options.position=v,A.settingsManager.saveSettings({position:v}),A.render()},E.onmouseenter=()=>{D||(E.style.backgroundColor=n,E.style.borderColor=n,E.style.boxShadow=`0 0 6px ${ee(n,25)}`,E.style.opacity="1")},E.onmouseleave=()=>{D||(E.style.backgroundColor=H.textMuted,E.style.borderColor=H.textMuted,E.style.boxShadow="none",E.style.opacity="0.5")},h.appendChild(E)}),l.appendChild(h),l}function q7(A){let{accentColor:n}=A.options,o=document.createDocumentFragment();o.appendChild(gi("Compact Mode",A.compactMode,n,()=>{A.toggleCompactMode()}));let l=document.createElement("div");return Object.assign(l.style,{color:H.textMuted,fontSize:"0.5625rem",marginTop:"2px",marginBottom:"8px"}),l.textContent="Keyboard: Cmd or Ctrl+Shift+M",o.appendChild(l),o}function z7(A){let n=document.createElement("div");Object.assign(n.style,{marginBottom:"6px"});let o=document.createElement("div");Object.assign(o.style,{color:H.text,fontSize:"0.6875rem",marginBottom:"6px"}),o.textContent="Accent Color",n.appendChild(o);let l=document.createElement("div");Object.assign(l.style,{display:"flex",gap:"6px",flexWrap:"wrap",alignItems:"center"});let c=A.options.accentColor,h=c===H.primary,v=!cl.some(B=>B.value===c)&&!h;if(cl.forEach(({name:B,value:C})=>{let E=document.createElement("button"),D=c===C||h&&B==="Emerald";Object.assign(E.style,{width:"24px",height:"24px",borderRadius:"50%",backgroundColor:C,border:D?"2px solid #fff":"2px solid transparent",cursor:"pointer",transition:"all 150ms",boxShadow:D?`0 0 8px ${C}`:"none"}),E.title=B,E.onclick=()=>{A.options.accentColor=C,A.settingsManager.saveSettings({accentColor:C}),A.render()},l.appendChild(E)}),v){let B=document.createElement("button");B.type="button",B.setAttribute("data-accent-reset","true"),B.title=`Custom color (${c}). Click to reset to theme default.`,Object.assign(B.style,{marginLeft:"4px",padding:"2px 8px",borderRadius:"10px",border:`1px dashed ${c}`,backgroundColor:"transparent",color:c,fontSize:"0.625rem",fontFamily:mt,cursor:"pointer",lineHeight:"1.4"}),B.textContent="custom \xB7 reset",B.onclick=()=>{let C=sa.accentColor;A.options.accentColor=C,A.settingsManager.saveSettings({accentColor:C}),A.render()},l.appendChild(B)}return n.appendChild(l),n}function X7(A,n){return[`#${A}::-webkit-slider-thumb {`," -webkit-appearance: none;"," width: 12px; height: 12px;"," border-radius: 50%;",` background: ${n};`,` border: 2px solid ${H.bg};`,` box-shadow: 0 0 4px ${ee(n,50)};`," cursor: grab;","}",`#${A}::-webkit-slider-thumb:active { cursor: grabbing; }`,`#${A}::-moz-range-thumb {`," width: 12px; height: 12px;"," border-radius: 50%;",` background: ${n};`,` border: 2px solid ${H.bg};`,` box-shadow: 0 0 4px ${ee(n,50)};`," cursor: grab;","}",`#${A}::-webkit-slider-runnable-track { background: transparent; }`,`#${A}::-moz-range-track { background: transparent; }`].join(`
|
|
518
|
+
`)}}function Py(A,n){let o=A.consoleFilter;if(!o)return;let l=n.getLogs().filter(k=>k.level===o),h={error:Me.error,warn:Me.warning,info:Me.info}[o],v={error:"Errors",warn:"Warnings",info:"Info"}[o],B=()=>{A.consoleFilter=null,A.render()},C=Pn(B),E=Kn(h,`Console ${v}`),D=An({color:h,title:`Console ${v} (${l.length})`,onClose:B,onCopyMd:async()=>{await navigator.clipboard.writeText(Xp(l))},onSave:()=>Uy(A,l),onClear:()=>A.clearConsoleLogs(),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingConsoleLogs,savedPath:A.lastConsoleLogs,evidenceContext:Da(A,`Console ${v}`,{artifactPath:A.lastConsoleLogs,observation:`${l.length} ${o} log${l.length===1?"":"s"} in the current filter.`})});E.appendChild(D);let T=an();l.length===0?T.appendChild(CA(`No ${o}s recorded`)):h7(T,l,h),E.appendChild(T),C.appendChild(E),A.overlayElement=C,document.body.appendChild(C),Vn(E)}function h7(A,n,o){n.forEach((l,c)=>{let h=document.createElement("div");Object.assign(h.style,{padding:"8px 14px",borderBottom:c<n.length-1?`1px solid ${H.borderSubtle}`:"none"});let g=document.createElement("span");Object.assign(g.style,{color:H.textMuted,fontSize:"0.625rem",marginRight:"8px"}),g.textContent=new Date(l.timestamp).toLocaleTimeString(),h.appendChild(g);let v=document.createElement("span");Object.assign(v.style,{color:o,fontSize:"0.6875rem",wordBreak:"break-word",whiteSpace:"pre-wrap"}),v.textContent=l.message,h.appendChild(v),A.appendChild(h)})}function m7(A,n,o){if(A.lastDotPosition&&!o){let g=n.endsWith("right"),v;return g?v=n.startsWith("top")?{top:"20px",right:"16px"}:{bottom:"20px",right:"16px"}:v={top:`${A.lastDotPosition.top-15}px`,left:`${A.lastDotPosition.left-19}px`},A.lastDotPosition=null,v}let h={"bottom-left":{bottom:"20px",left:"80px"},"bottom-right":{bottom:"20px",right:"16px"},"top-left":{top:"20px",left:"80px"},"top-right":{top:"20px",right:"16px"},"bottom-center":{bottom:"12px",left:"50%",transform:"translateX(-50%)"}};return h[n]??h["bottom-left"]}function g7(A,n,o,l,c){A.resetPositionStyles(n);let h=A.options.sizeOverrides,g="fit-content",v="auto",B=c?"calc(100vw - 32px)":"calc(100vw - 96px)";Object.assign(n.style,{position:"fixed",...o,zIndex:"9999",backgroundColor:"var(--devbar-color-bg-card)",border:`1px solid ${l}`,borderRadius:"12px",color:l,boxShadow:`${ht.shadows.dropToolbar}, 0 0 0 1px ${ee(l,10)}`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxSizing:"border-box",width:h?.width??g,maxWidth:h?.maxWidth??B,minWidth:h?.minWidth??v,cursor:"default"}),n.ondblclick=C=>{if(C.target?.closest("button, input, select, a"))return;let D=n.querySelector(".devbar-status span span");D&&_o(A,D),A.collapsed=!0,A.debug.state("Collapsed DevBar (double-click)"),A.render()}}function v7(){let A=document.createElement("div");return A.className="devbar-main",Object.assign(A.style,{display:"flex",alignItems:"center",alignContent:"flex-start",justifyContent:"flex-start",gap:"0.5rem",padding:"0.5rem 0.75rem",minWidth:"0",boxSizing:"border-box",fontFamily:mt,fontSize:"0.6875rem",lineHeight:"1rem"}),A}function w7(A){let n=ll(A);return Zr(A,n,()=>ia(A.sweetlinkConnected,"click to minimize")),n.onclick=o=>{o.stopPropagation(),_o(A,n),A.collapsed=!0,A.debug.state("Collapsed DevBar (connection dot click)"),A.render()},n}function b7(A,n){let o=document.createElement("div");return o.className="devbar-info",Object.assign(o.style,{display:"flex",alignItems:"center",gap:"0.5rem",textTransform:"uppercase",letterSpacing:"0.05em",flexShrink:"1",minWidth:"0",overflow:"visible"}),n.breakpoint&&A.breakpointInfo&&B7(A,o),A.perfStats&&C7(A,o,n),o}function B7(A,n){if(!A.breakpointInfo)return;let o=A.breakpointInfo.tailwindBreakpoint,l=xo[o],c=document.createElement("span");c.className="devbar-item",Object.assign(c.style,{opacity:"0.9",cursor:"default"}),ob(A,c,o,A.breakpointInfo.dimensions,l?.label||"");let h=o;o!=="base"&&(h=o==="sm"?`${o} - ${A.breakpointInfo.dimensions.split("x")[0]}`:`${o} - ${A.breakpointInfo.dimensions}`),c.textContent=h,n.appendChild(c)}function y7(A){return{fcp:{label:"FCP",value:A.fcp,title:"First Contentful Paint (FCP)",description:"Time until the first text or image renders on screen.",thresholds:{good:"<1.8s",needsWork:"1.8-3s",poor:">3s"}},lcp:{label:"LCP",value:A.lcp,title:"Largest Contentful Paint (LCP)",description:"Time until the largest visible element renders on screen.",thresholds:{good:"<2.5s",needsWork:"2.5-4s",poor:">4s"}},cls:{label:"CLS",value:A.cls,title:"Cumulative Layout Shift (CLS)",description:"Visual stability score. Higher values mean more unexpected layout shifts.",thresholds:{good:"<0.1",needsWork:"0.1-0.25",poor:">0.25"}},inp:{label:"INP",value:A.inp,title:"Interaction to Next Paint (INP)",description:"Responsiveness to user input. Measures the longest interaction delay.",thresholds:{good:"<200ms",needsWork:"200-500ms",poor:">500ms"}},pageSize:{label:"",value:A.totalSize,title:"Total Page Size",description:"Compressed/transferred size including HTML, CSS, JS, images, and other resources."}}}function C7(A,n,o){if(!A.perfStats)return;let{visible:l,hidden:c}=Yw(A),h=y7(A.perfStats),g=()=>{let B=document.createElement("span");B.style.opacity="0.4",B.textContent="|",n.appendChild(B)};for(let B of l){if(!o[B])continue;let C=h[B];g();let E=document.createElement("span");E.className="devbar-item",Object.assign(E.style,{opacity:B==="pageSize"?"0.7":"0.85",cursor:"default"}),E.textContent=C.label?`${C.label} ${C.value}`:C.value,C.thresholds?ab(A,E,C.title,C.description,C.thresholds):ib(A,E,C.title,C.description),n.appendChild(E)}let v=c.filter(B=>o[B]);v.length>0&&(g(),E7(A,n,v,h))}function E7(A,n,o,l){let c=document.createElement("span");c.className="devbar-item devbar-clickable",Object.assign(c.style,{opacity:"0.7",cursor:"pointer",padding:"0 2px"}),c.textContent="\xB7\xB7\xB7",nb(A,c,h=>{oa(A,h,"More Metrics");let g=document.createElement("div");Object.assign(g.style,{display:"flex",flexDirection:"column",gap:"6px",marginTop:"8px"});for(let v of o){let B=l[v],C=document.createElement("div");Object.assign(C.style,{display:"flex",justifyContent:"space-between",gap:"12px"});let E=document.createElement("span");Object.assign(E.style,{color:H.textMuted}),E.textContent=B.title.split("(")[0].trim();let D=document.createElement("span");Object.assign(D.style,{color:H.text,fontWeight:"500"}),D.textContent=B.value,C.appendChild(E),C.appendChild(D),g.appendChild(C)}h.appendChild(g)}),n.appendChild(c)}function x7(A,n,o,l,c,h){let g=w7(A),v=document.createElement("div");v.className="devbar-status",Object.assign(v.style,{display:"flex",alignItems:"center",gap:"0.5rem",flexWrap:"nowrap",flexShrink:"1",minWidth:"0"}),v.appendChild(g);let B=b7(A,n);return v.appendChild(B),o&&(l>0&&v.appendChild(nA(A,"error",l,Me.error)),c>0&&v.appendChild(nA(A,"warn",c,Me.warning)),h>0&&v.appendChild(nA(A,"info",h,Me.info))),v}function F7(A,n,o){let l=document.createElement("div");return l.className="devbar-actions",n&&l.appendChild(yu(A,o)),l.appendChild(Iy(A)),l.appendChild(_y(A)),l.appendChild(Ry(A)),l.appendChild(Oy(A)),l.appendChild(ky(A)),l.appendChild(Ly(A)),l.appendChild(Hy(A)),l.appendChild(Cu(A)),l.appendChild(My(A)),l}function D7(A,n){if(A.length===0)return null;let o=document.createElement("div");o.className="devbar-custom-controls",Object.assign(o.style,{display:"flex",flexWrap:"wrap",alignItems:"center",alignContent:"flex-start",justifyContent:"flex-start",gap:"0.5rem",padding:"0 0.75rem 0.5rem 0.75rem",borderTop:`1px solid ${ee(n,19)}`,marginTop:"0",paddingTop:"0.5rem",width:"100%",maxWidth:"100%",minWidth:"0",overflow:"visible",boxSizing:"border-box",fontFamily:mt,fontSize:"0.6875rem"});let l=A.filter(h=>!h.group),c=new Map;for(let h of A){if(!h.group)continue;let g=c.get(h.group)??[];g.push(h),c.set(h.group,g)}for(let h of l)o.appendChild(Ro(h,n));for(let[h,g]of c){let v=document.createElement("span");v.className="devbar-custom-group-label",Object.assign(v.style,{color:ee(n,50),fontSize:"0.5625rem",textTransform:"uppercase",letterSpacing:"0.05em",flex:"0 1 auto",minWidth:"0",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginLeft:l.length>0||[...c.keys()].indexOf(h)>0?"0.25rem":"0"}),v.textContent=h,o.appendChild(v);for(let B of g)o.appendChild(Ro(B,n))}return o}function Ky(A,n){if(!A.container)return;let{position:o,accentColor:l,showMetrics:c,showScreenshot:h,showConsoleBadges:g}=A.options,{errorCount:v,warningCount:B,infoCount:C}=A.getLogCounts(),E=o==="bottom-center",D=A.container;n.length>0?D.dataset.devbarCustomControls="true":delete D.dataset.devbarCustomControls;let T=m7(A,o,E);g7(A,D,T,l,E);let k=v7(),V=x7(A,c,g,v,B,C);k.appendChild(V);let W=F7(A,h,l);k.appendChild(W),D.appendChild(k);let q=D7(n,l);q&&D.appendChild(q)}function jy(A){let n=eA(),o=Me.outline,l=()=>{A.showOutlineModal=!1,A.render()},c=Pn(l),h=Kn(o,"Document Outline"),g=An({color:o,title:"Document Outline",onClose:l,onCopyMd:async()=>{let B=En(n);await navigator.clipboard.writeText(B)},onSave:()=>Sy(A),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingOutline,savedPath:A.lastOutline,evidenceContext:Da(A,"Document Outline",{artifactPath:A.lastOutline,observation:`${n.length} top-level semantic node${n.length===1?"":"s"} found.`})});h.appendChild(g);let v=an();n.length===0?v.appendChild(CA("No semantic elements found in this document")):Wy(n,v,0,{lastHeadingLevel:0}),h.appendChild(v),c.appendChild(h),A.overlayElement=c,document.body.appendChild(c),Vn(h)}function Wy(A,n,o,l){for(let c of A){let h=c.category==="heading"&&c.level>0,g=h&&c.level>l.lastHeadingLevel+1;h&&(l.lastHeadingLevel=c.level);let v=document.createElement("div");if(Object.assign(v.style,{padding:`4px 0 4px ${o*16}px`}),g){let T=document.createElement("span");Object.assign(T.style,{color:H.error,fontSize:"0.625rem",marginRight:"4px"}),T.textContent="\u26A0",T.title=`Heading level skipped (expected h${c.level-1} or higher before h${c.level})`,v.appendChild(T)}let B=document.createElement("span"),C=rl[c.category||"other"]||rl.other;if(Object.assign(B.style,{color:g?H.error:C,fontSize:"0.6875rem",fontWeight:"500"}),B.textContent=`<${c.tagName}>`,v.appendChild(B),c.category){let T=document.createElement("span");Object.assign(T.style,{color:H.textMuted,fontSize:"0.625rem",marginLeft:"6px"}),T.textContent=`[${c.category}]`,v.appendChild(T)}let E=document.createElement("span");Object.assign(E.style,{color:H.textSecondary,fontSize:"0.6875rem",marginLeft:"8px"});let D=c.text.length>60?`${c.text.slice(0,60)}...`:c.text;if(E.textContent=D,v.appendChild(E),c.id){let T=document.createElement("span");Object.assign(T.style,{color:H.textSecondary,fontSize:"0.625rem",marginLeft:"6px"}),T.textContent=`#${c.id}`,v.appendChild(T)}n.appendChild(v),c.children.length>0&&Wy(c.children,n,o+1,l)}}function qy(A){let n=tA(),o=Me.schema,l=()=>{A.showSchemaModal=!1,A.render()},c=Pn(l),h=Kn(o,"Page Schema"),g=di(n),v=ci(),B=An({color:o,title:"Page Schema",onClose:l,onCopyMd:async()=>{let D=rA(n,{missingTags:g,favicons:v});await navigator.clipboard.writeText(D)},onSave:()=>Ty(A),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingSchema,savedPath:A.lastSchema,evidenceContext:Da(A,"Page Schema",{artifactPath:A.lastSchema,observation:g.length?`${g.length} recommended metadata item${g.length===1?"":"s"} missing.`:"Schema evidence captured for this page."})});h.appendChild(B);let C=an();n.jsonLd.length>0||Object.keys(n.openGraph).length>0||Object.keys(n.twitter).length>0||Object.keys(n.metaTags).length>0||v.length>0||g.length>0?(g.length>0&&O7(C,g),Eu(C,"Open Graph",n.openGraph,H.info),Eu(C,"Twitter Cards",n.twitter,H.cyan),v.length>0&&_7(C,v),Eu(C,"JSON-LD",n.jsonLd,o),Eu(C,"Meta Tags",n.metaTags,H.textMuted)):C.appendChild(CA("No structured data found on this page")),h.appendChild(C),c.appendChild(h),A.overlayElement=c,document.body.appendChild(c),Vn(h)}function Jp(A,n,o,l){let c=document.createElement("div");Object.assign(c.style,{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",paddingBottom:"6px",borderBottom:`1px solid ${ee(o,19)}`});let h=document.createElement("h3");Object.assign(h.style,{color:o,fontSize:"0.8125rem",fontWeight:"600",margin:"0"}),h.textContent=n,c.appendChild(h);let g=document.createElement("span");Object.assign(g.style,{color:ee(o,80),fontSize:"0.5625rem",backgroundColor:ee(o,9),padding:"1px 6px",borderRadius:"8px",letterSpacing:"0.03em"}),g.textContent=String(l),c.appendChild(g),A.appendChild(c)}function Eu(A,n,o,l){let c=Array.isArray(o)?o.length:Object.keys(o).length;if(c===0)return;let h=document.createElement("div");h.style.marginBottom="20px",Jp(h,n,l,c),Array.isArray(o)?Q7(h,o,l):U7(h,o),A.appendChild(h)}function Q7(A,n,o){n.forEach((l,c)=>{let h=document.createElement("div");h.style.marginBottom="10px";let g=l,v=typeof g?.["@type"]=="string"?g["@type"]:null,B=document.createElement("div");Object.assign(B.style,{display:"flex",alignItems:"center",gap:"6px",marginBottom:"4px"});let C=document.createElement("span");if(Object.assign(C.style,{color:H.textSecondary,fontSize:"0.6875rem"}),C.textContent=`Schema ${c+1}`,B.appendChild(C),v){let D=document.createElement("span");Object.assign(D.style,{color:ee(o,80),fontSize:"0.5625rem",backgroundColor:ee(o,8),border:`1px solid ${ee(o,15)}`,padding:"0 5px",borderRadius:"3px"}),D.textContent=v,B.appendChild(D)}h.appendChild(B);let E=document.createElement("pre");Object.assign(E.style,{backgroundColor:"rgba(0, 0, 0, 0.25)",borderRadius:"4px",borderLeft:`2px solid ${ee(o,31)}`,padding:"10px 10px 10px 12px",fontSize:"0.625rem",margin:"0",whiteSpace:"pre-wrap",wordBreak:"break-word"}),S7(E,JSON.stringify(l,null,2)),h.appendChild(E),A.appendChild(h)})}function S7(A,n){let o={key:H.primary,string:H.warning,number:H.purple,boolean:H.info,nullVal:H.error,punct:H.textMuted},l=/("(?:\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*")(\s*:)?|(\btrue\b|\bfalse\b)|(\bnull\b)|(-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)|([{}[\],])|(\s+)/g;for(let c of n.matchAll(l)){let[,h,g,v,B,C,E,D]=c;if(D)A.appendChild(document.createTextNode(D));else if(h!==void 0){let T=document.createElement("span");if(T.style.color=g?o.key:o.string,T.textContent=h,A.appendChild(T),g){let k=document.createElement("span");k.style.color=o.punct,k.textContent=":",A.appendChild(k)}}else if(v){let T=document.createElement("span");T.style.color=o.boolean,T.textContent=v,A.appendChild(T)}else if(B){let T=document.createElement("span");T.style.color=o.nullVal,T.textContent=B,A.appendChild(T)}else if(C){let T=document.createElement("span");T.style.color=o.number,T.textContent=C,A.appendChild(T)}else if(E){let T=document.createElement("span");T.style.color=o.punct,T.textContent=E,A.appendChild(T)}}}function U7(A,n){Object.entries(n).forEach(([l,c],h)=>{let g=qp(l),v=document.createElement("div");Object.assign(v.style,{display:"flex",padding:g?"6px 8px":"3px 8px",alignItems:"flex-start",borderRadius:"3px",backgroundColor:h%2===0?"rgba(255, 255, 255, 0.02)":"transparent"});let B=document.createElement("span");if(Object.assign(B.style,{color:H.textSecondary,fontSize:"0.6875rem",width:"120px",minWidth:"120px",maxWidth:"120px",flexShrink:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingTop:g?"2px":"0"}),B.textContent=l,l.length>18&&(B.title=l),v.appendChild(B),g&&c){let C=document.createElement("div");Object.assign(C.style,{flex:"1",minWidth:"0"});let E=document.createElement("div");Object.assign(E.style,{display:"inline-block",padding:"4px",backgroundColor:"rgba(0, 0, 0, 0.2)",border:"1px solid rgba(255, 255, 255, 0.06)",borderRadius:"4px",marginBottom:"4px",minHeight:"60px",minWidth:"80px"});let D=document.createElement("img");Object.assign(D.style,{width:"200px",height:"120px",objectFit:"contain",borderRadius:"2px",display:"block"}),D.src=c,D.alt=l,D.onerror=()=>{E.style.display="none"},D.onload=()=>{D.naturalWidth&&(T.textContent=`${D.naturalWidth}\xD7${D.naturalHeight}`)},E.appendChild(D),C.appendChild(E);let T=document.createElement("div");Object.assign(T.style,{color:H.textMuted,fontSize:"0.5625rem",minHeight:"0.75rem",letterSpacing:"0.02em"}),C.appendChild(T);let k=document.createElement("div");Object.assign(k.style,{color:H.textMuted,fontSize:"0.5625rem",wordBreak:"break-all",opacity:"0.7"}),k.textContent=c,C.appendChild(k),v.appendChild(C)}else{let C=document.createElement("span");Object.assign(C.style,{color:H.text,fontSize:"0.6875rem",flex:"1",wordBreak:"break-word",whiteSpace:"pre-wrap",opacity:"0.85"}),C.textContent=String(c),v.appendChild(C)}A.appendChild(v)})}function T7(A,n){let o=parseInt(n||"",10);return A.includes("apple")?{text:"Apple home screen",color:H.info}:n==="any"||A.includes("svg")?{text:"Scalable (any)",color:H.cyan}:o>=192?{text:"Android / PWA",color:H.primary}:o>=48?{text:"Taskbar / shortcut",color:H.purple}:o>0?{text:"Browser tab",color:H.textSecondary}:{text:"General",color:H.textMuted}}function I7(A,n){let o=T7(A.label,A.size),l=document.createElement("div");Object.assign(l.style,{display:"flex",alignItems:"center",padding:"6px 8px",gap:"10px",borderRadius:"3px",backgroundColor:n%2===0?"rgba(255, 255, 255, 0.02)":"transparent"});let c=document.createElement("div");Object.assign(c.style,{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.25)",border:"1px solid rgba(255, 255, 255, 0.06)",borderRadius:"4px",flexShrink:"0"});let h=document.createElement("img");Object.assign(h.style,{width:"22px",height:"22px",objectFit:"contain"}),h.src=A.url,h.alt=A.label,h.onerror=()=>{c.style.opacity="0.3"},c.appendChild(h),l.appendChild(c);let g=document.createElement("div");Object.assign(g.style,{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",gap:"2px"});let v=document.createElement("div");Object.assign(v.style,{display:"flex",alignItems:"center",gap:"6px"});let B=document.createElement("span");Object.assign(B.style,{color:H.text,fontSize:"0.6875rem",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),B.textContent=A.label,A.label.length>24&&(B.title=A.label),v.appendChild(B);let C=document.createElement("span");Object.assign(C.style,{color:o.color,fontSize:"0.5rem",backgroundColor:ee(o.color,7),padding:"1px 6px",borderRadius:"6px",letterSpacing:"0.03em",whiteSpace:"nowrap",flexShrink:"0"}),C.textContent=o.text,v.appendChild(C),g.appendChild(v);let E=document.createElement("div");if(Object.assign(E.style,{display:"flex",alignItems:"center",gap:"6px",fontSize:"0.5625rem",color:H.textMuted}),A.size){let V=document.createElement("span");V.textContent=A.size,V.style.opacity="0.8",E.appendChild(V)}let D=document.createElement("span");D.style.letterSpacing="0.02em",E.appendChild(D),h.onload=()=>{if(h.naturalWidth){let V=`${h.naturalWidth}\xD7${h.naturalHeight}`;A.size?D.textContent=`\u2192 ${V}`:D.textContent=V}};let T=document.createElement("span");T.textContent="\xB7",T.style.opacity="0.4",E.appendChild(T);let k=document.createElement("span");return Object.assign(k.style,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",opacity:"0.6"}),k.textContent=A.url,k.title=A.url,E.appendChild(k),g.appendChild(E),l.appendChild(g),l}function _7(A,n){let o=H.purple,l=document.createElement("div");l.style.marginBottom="20px",Jp(l,"Favicons",o,n.length),n.forEach((c,h)=>{l.appendChild(I7(c,h))}),A.appendChild(l)}function Vy(A,n){let o=document.createElement("span");return Object.assign(o.style,{color:n,fontSize:"0.5625rem",backgroundColor:ee(n,8),padding:"2px 8px",borderRadius:"8px",letterSpacing:"0.03em"}),o.textContent=A,o}function R7(A,n){let o=document.createElement("div");return Object.assign(o.style,{display:"flex",alignItems:"center",padding:"4px 8px",gap:"8px",borderRadius:"3px",backgroundColor:A%2===0?"rgba(255, 255, 255, 0.02)":"transparent",...n?{borderLeft:`2px solid ${ee(n,25)}`}:{}}),o}function Yp(A,n){let o=document.createElement("span");return Object.assign(o.style,n),o.textContent=A,o}function O7(A,n){let o=document.createElement("div");o.style.marginBottom="20px";let l=n.filter(v=>v.severity==="error").length,c=n.length-l,g=l>0?H.error:H.warning;if(Jp(o,"Missing Tags",g,n.length),l>0||c>0){let v=document.createElement("div");Object.assign(v.style,{display:"flex",gap:"8px",marginBottom:"8px"}),l>0&&v.appendChild(Vy(`${l} error${l>1?"s":""}`,H.error)),c>0&&v.appendChild(Vy(`${c} warning${c>1?"s":""}`,H.warning)),o.appendChild(v)}n.forEach((v,B)=>{let C=v.severity==="error",E=C?H.error:H.warning,D=R7(B,E),T=Yp(C?"\u2718":"\u26A0",{fontSize:"0.625rem",flexShrink:"0",width:"14px",textAlign:"center",color:E});D.appendChild(T),D.appendChild(Yp(v.tag,{color:H.text,fontSize:"0.6875rem",width:"120px",minWidth:"120px",flexShrink:"0",fontWeight:"500"})),D.appendChild(Yp(v.hint,{color:H.textMuted,fontSize:"0.6875rem",flex:"1",opacity:"0.85"})),o.appendChild(D)}),A.appendChild(o)}function zy(A){let n=Me.a11y,o=()=>{A.showA11yModal=!1,A.render()},l=Pn(o),c=Kn(n,"Accessibility Audit");k7(c,n,o,A),l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),Vn(c),So().then(h=>{if(!A.showA11yModal)return;let g=il(h);Df(c);let v=h.violations.length,B=v===0?"Accessibility Audit \u2014 No Issues":`Accessibility Audit \u2014 ${v} Violation${v===1?"":"s"}`,C=An({color:n,title:B,onClose:o,onCopyMd:async()=>{await navigator.clipboard.writeText(g)},onSave:()=>Qy(A,h),sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation,isSaving:A.savingA11yAudit,savedPath:A.lastA11yAudit,evidenceContext:Da(A,B,{artifactPath:A.lastA11yAudit,observation:v===0?`${h.passes.length} axe rule${h.passes.length===1?"":"s"} passed.`:`${v} accessibility violation${v===1?"":"s"} found.`})});c.appendChild(C);let E=an();L7(E,h,n),c.appendChild(E)}).catch(h=>{if(!A.showA11yModal)return;Df(c);let g=An({color:H.error,title:"Accessibility Audit \u2014 Error",onClose:o,onCopyMd:async()=>{},sweetlinkConnected:A.sweetlinkConnected,saveLocation:A.options.saveLocation});c.appendChild(g);let v=an();v.appendChild(la(H.error,"Audit Failed",`${h instanceof Error?h.message:"Unknown error"}`)),c.appendChild(v)})}function k7(A,n,o,l){let c=an(),h=document.createElement("div");Object.assign(h.style,{textAlign:"center",padding:"40px",color:H.textSecondary,fontSize:"0.875rem"}),h.textContent="Running accessibility audit...",h.style.animation="pulse 1.5s ease-in-out infinite",c.appendChild(h);let g=An({color:n,title:"Accessibility Audit",onClose:o,onCopyMd:async()=>{},sweetlinkConnected:l.sweetlinkConnected,saveLocation:l.options.saveLocation});A.appendChild(g),A.appendChild(c)}function L7(A,n,o){if(H7(A,n,o),n.violations.length===0){let l=document.createElement("div");if(Object.assign(l.style,{textAlign:"center",padding:"40px",color:H.primary,fontSize:"0.875rem"}),l.textContent="No accessibility violations found!",A.appendChild(l),n.passes.length>0){let c=document.createElement("div");Object.assign(c.style,{textAlign:"center",color:H.textMuted,fontSize:"0.75rem",marginTop:"8px"}),c.textContent=`${n.passes.length} rules passed`,A.appendChild(c)}}else{let l=Al(n.violations),c=document.createElement("div");Object.assign(c.style,{display:"flex",gap:"12px",marginBottom:"16px",padding:"10px 12px",backgroundColor:ee(o,6),border:`1px solid ${ee(o,19)}`,borderRadius:"6px",flexWrap:"wrap"});for(let g of["critical","serious","moderate","minor"]){if(l[g]===0)continue;let v=document.createElement("span"),B=ol(g);Object.assign(v.style,{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"0.6875rem",fontWeight:"600",color:B});let C=document.createElement("span");Object.assign(C.style,{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:B}),v.appendChild(C),v.appendChild(document.createTextNode(`${l[g]} ${g}`)),c.appendChild(v)}A.appendChild(c);let h=al(n.violations);for(let[g,v]of h)v.length!==0&&N7(A,g,v)}}function H7(A,n,o){let l=[`${n.passes.length} axe rule${n.passes.length===1?"":"s"} passed`,`${n.violations.length} violation${n.violations.length===1?"":"s"} found`,"current DOM, focus semantics, names, landmarks, forms, and color contrast where browser APIs expose enough paint data"];A.appendChild(la(o,"What was checked",l.join(" \xB7 ")))}function Gy(A){let n=document.createElement("div");return Object.assign(n.style,{padding:"3px 6px",marginBottom:"2px",backgroundColor:"rgba(0,0,0,0.2)",borderRadius:"3px",fontSize:"0.625rem",color:H.textSecondary,fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),n.textContent=A.html.length>100?`${A.html.slice(0,100)}...`:A.html,n.title=A.html,n}function M7(A,n){let o=document.createElement("div");Object.assign(o.style,{marginBottom:"12px",padding:"10px 12px",backgroundColor:ee(n,3),border:`1px solid ${ee(n,13)}`,borderRadius:"6px"});let l=document.createElement("div");Object.assign(l.style,{color:n,fontSize:"0.6875rem",fontWeight:"600",marginBottom:"4px"}),l.textContent=A.id,o.appendChild(l);let c=document.createElement("div");Object.assign(c.style,{color:H.text,fontSize:"0.75rem",marginBottom:"4px"}),c.textContent=A.help,o.appendChild(c);let h=document.createElement("div");Object.assign(h.style,{color:H.textSecondary,fontSize:"0.6875rem",marginBottom:"6px"}),h.textContent=A.description,o.appendChild(h);let g=document.createElement("div");Object.assign(g.style,{color:H.textMuted,fontSize:"0.625rem",marginBottom:"4px"}),g.textContent=`${A.nodes.length} element${A.nodes.length===1?"":"s"} affected`,o.appendChild(g);let v=document.createElement("div");Object.assign(v.style,{marginTop:"6px"});let B=A.nodes.slice(0,3);for(let C of B)v.appendChild(Gy(C));if(A.nodes.length>3){let C=document.createElement("button");Object.assign(C.style,{background:"none",border:"none",color:n,fontSize:"0.625rem",cursor:"pointer",padding:"2px 0",fontFamily:mt}),C.textContent=`+ ${A.nodes.length-3} more`,C.onclick=()=>{C.remove();for(let E of A.nodes.slice(3))v.appendChild(Gy(E))},v.appendChild(C)}return o.appendChild(v),o}function N7(A,n,o){let l=ol(n),c=document.createElement("div");c.style.marginBottom="20px";let h=document.createElement("h3");Object.assign(h.style,{color:l,fontSize:"0.8125rem",fontWeight:"600",marginBottom:"10px",borderBottom:`1px solid ${ee(l,25)}`,paddingBottom:"6px",textTransform:"capitalize"}),h.textContent=`${n} (${o.length})`,c.appendChild(h);for(let g of o)c.appendChild(M7(g,l));A.appendChild(c)}function Xy(A){let n=Me.review,o=()=>Cy(A),l=Pn(o),c=Kn(n,"AI Design Review");c.style.maxWidth="450px",c.appendChild(An({color:n,title:"AI Design Review",onClose:o}));let h=an();if(Object.assign(h.style,{color:H.text,fontSize:"0.8125rem",lineHeight:"1.6"}),A.apiKeyStatus===null?h.appendChild(CA("Checking API key configuration...")):A.apiKeyStatus.configured?h.appendChild(K7(A)):h.appendChild(P7()),c.appendChild(h),A.apiKeyStatus?.configured){let g=document.createElement("div");Object.assign(g.style,{display:"flex",justifyContent:"flex-end",gap:"10px",padding:"14px 18px",borderTop:`1px solid ${H.border}`});let v=rn({color:n,text:"Run Review",padding:"8px 16px"});v.style.backgroundColor=ee(n,13),v.onclick=()=>Ey(A),g.appendChild(v),c.appendChild(g)}l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),Vn(c)}function P7(){let A=document.createElement("div");A.appendChild(la(H.error,"API Key Not Configured","The ANTHROPIC_API_KEY environment variable is not set."));let n=document.createElement("div");Object.assign(n.style,{marginBottom:"12px"});let o=document.createElement("div");return Object.assign(o.style,{color:H.textSecondary,fontWeight:"600",marginBottom:"8px"}),o.textContent="To configure:",n.appendChild(o),[{text:"1. Get an API key from console.anthropic.com",highlight:!1},{text:"2. Add to your .env file:",highlight:!1},{text:" ANTHROPIC_API_KEY=sk-ant-...",highlight:!0},{text:"3. Restart your dev server",highlight:!1}].forEach(({text:c,highlight:h})=>{let g=document.createElement("div");Object.assign(g.style,{color:h?H.primary:H.textMuted,fontSize:"0.75rem",marginBottom:"4px",fontFamily:mt}),g.textContent=c,n.appendChild(g)}),A.appendChild(n),A}function K7(A){let n=document.createElement("div");Object.assign(n.style,{marginBottom:"16px"});let o=document.createElement("p");Object.assign(o.style,{color:H.textSecondary,marginBottom:"12px"}),o.textContent="This will capture a screenshot and send it to Claude for design analysis.",n.appendChild(o);let l=yy(A);if(l){let c=la(H.primary,"Estimated Cost",[]);c.style.marginBottom="0",c.style.padding="12px";let h=document.createElement("div");Object.assign(h.style,{display:"flex",justifyContent:"space-between",color:H.textSecondary,fontSize:"0.75rem"});let g=document.createElement("span");g.textContent=`~${l.tokens.toLocaleString()} tokens`,h.appendChild(g);let v=document.createElement("span");Object.assign(v.style,{color:H.warning,fontWeight:"600"}),v.textContent=l.cost,h.appendChild(v),c.appendChild(h),n.appendChild(c)}if(A.apiKeyStatus?.model){let c=document.createElement("div");Object.assign(c.style,{color:H.textMuted,fontSize:"0.6875rem",marginTop:"12px"}),c.textContent=`Model: ${A.apiKeyStatus.model}`,n.appendChild(c)}return n}function Yy(A){let n=A.settingsManager.getSettings();A.themeMode=A.forcedThemeMode??n.themeMode,A.forcedThemeMode&&n.themeMode!==A.forcedThemeMode&&A.settingsManager.saveSettingsNow({themeMode:A.forcedThemeMode}),Do(Fo(A.themeMode)),A.debug.state("Theme loaded",{mode:A.themeMode}),typeof window<"u"&&window.matchMedia&&(A.themeMediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),A.themeMediaHandler=()=>{A.themeMode==="system"&&(Do(Fo(A.themeMode)),A.debug.state("System theme changed",{effectiveTheme:aa(A.themeMode)}),window.dispatchEvent(new CustomEvent("devbar-theme-change",{detail:{mode:A.themeMode}})),A.render())},A.themeMediaQuery.addEventListener("change",A.themeMediaHandler))}function Jy(A){let n=A.settingsManager.getSettings();A.compactMode=n.compactMode,A.debug.state("Compact mode loaded",{compactMode:A.compactMode})}function xu(A,n){let o=A.forcedThemeMode??n;A.themeMode=o,A.settingsManager.saveSettings({themeMode:o}),mf(o),Do(Fo(o)),A.debug.state("Theme mode changed",{mode:o,effectiveTheme:aa(o)}),typeof window<"u"&&window.dispatchEvent(new CustomEvent("devbar-theme-change",{detail:{mode:o}})),A.render()}function $y(A){let{position:n,accentColor:o}=A.options,l=document.createElement("div");l.setAttribute("data-devbar","true"),l.setAttribute("data-devbar-overlay","true"),Object.assign(l.style,{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",zIndex:"10003"}),l.onclick=k=>{k.target===l&&(A.showSettingsPopover=!1,A.render())};let c=document.createElement("div");c.setAttribute("data-devbar","true"),c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true"),c.setAttribute("aria-label","Settings"),c.tabIndex=-1;let h=n.startsWith("top"),g=480,v=16,B;if(A.container&&window.innerWidth>640){let k=A.container.getBoundingClientRect(),V=k.left+k.width/2;B=Math.max(v,Math.min(V-g/2,window.innerWidth-g-v))}else B=Math.max(v,(window.innerWidth-g)/2);Object.assign(c.style,{position:"fixed",[h?"top":"bottom"]:"70px",left:`${B}px`,zIndex:"10003",backgroundColor:"var(--devbar-color-bg-elevated)",border:`1px solid ${o}`,borderRadius:"8px",boxShadow:`${ht.shadows.dropLg}, 0 0 0 1px ${ee(o,20)}`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",width:`${g}px`,maxWidth:"calc(100vw - 32px)",maxHeight:"calc(100vh - 100px)",overflowY:"auto",fontFamily:mt}),c.appendChild(V7(A));let C=document.createElement("div");C.className="devbar-settings-grid",Object.assign(C.style,{display:"grid",gridTemplateColumns:"1fr 1fr"});let E=H.textSecondary,D=document.createElement("div");Object.assign(D.style,{borderRight:`1px solid ${ee(E,13)}`}),D.appendChild(G7(A)),D.appendChild(j7(A)),C.appendChild(D);let T=document.createElement("div");T.appendChild($7(A)),T.appendChild(eK(A)),C.appendChild(T),c.appendChild(C),c.appendChild(tK(A)),l.appendChild(c),A.overlayElement=l,document.body.appendChild(l),c.focus()}function V7(A){let{accentColor:n}=A.options,o=document.createElement("div");Object.assign(o.style,{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",borderBottom:`1px solid ${ee(n,19)}`,position:"sticky",top:"0",backgroundColor:"var(--devbar-color-bg-elevated)",zIndex:"1"});let l=document.createElement("span");return Object.assign(l.style,{color:n,fontSize:"0.75rem",fontWeight:"600"}),l.textContent="Settings",o.appendChild(l),o.appendChild(Oo(()=>{A.showSettingsPopover=!1,A.render()})),o}function G7(A){let{accentColor:n}=A.options,o=!!A.forcedThemeMode,l=Fu("Theme");Du(l,o?`Theme is controlled by the host app: ${A.forcedThemeMode}.`:"Follow OS/browser preference, force dark, or force light while reviewing.");let c=document.createElement("div");return Object.assign(c.style,{display:"flex",gap:"6px"}),["system","dark","light"].forEach(g=>{let v=Zy({label:g,isActive:A.themeMode===g,accentColor:n,disabled:o&&g!==A.forcedThemeMode,disabledTitle:"Theme controlled by host app",onClick:()=>xu(A,g)});v.style.textTransform="capitalize",c.appendChild(v)}),l.appendChild(c),l}function j7(A){let n=Fu("Display & appearance");return Du(n,"Change where DevBar lives and how evidence captures are rendered."),n.appendChild(W7(A)),n.appendChild(q7(A)),n.appendChild(z7(A)),n.appendChild(J7(A)),n}function W7(A){let{accentColor:n}=A.options,o=H.textSecondary,l=document.createElement("div");Object.assign(l.style,{marginBottom:"10px"});let c=document.createElement("div");Object.assign(c.style,{color:H.text,fontSize:"0.6875rem",marginBottom:"6px"}),c.textContent="Position",l.appendChild(c);let h=document.createElement("div");return Object.assign(h.style,{position:"relative",width:"100%",height:"70px",backgroundColor:"var(--devbar-color-bg-input)",border:`1px solid ${ee(o,19)}`,borderRadius:"4px"}),[{value:"top-left",style:{top:"6px",left:"6px"},title:"Top Left"},{value:"top-right",style:{top:"6px",right:"6px"},title:"Top Right"},{value:"bottom-left",style:{bottom:"6px",left:"6px"},title:"Bottom Left"},{value:"bottom-right",style:{bottom:"6px",right:"6px"},title:"Bottom Right"},{value:"bottom-center",style:{bottom:"6px",left:"50%",transform:"translateX(-50%)"},title:"Bottom Center"}].forEach(({value:v,style:B,title:C})=>{let E=document.createElement("button");E.setAttribute("data-position",v);let D=A.options.position===v;Object.assign(E.style,{position:"absolute",width:"24px",height:"6px",backgroundColor:D?n:H.textMuted,border:`1px solid ${D?n:H.textMuted}`,borderRadius:"2px",cursor:"pointer",padding:"0",transition:"all 150ms",boxShadow:D?`0 0 8px ${ee(n,38)}`:"none",opacity:D?"1":"0.5",...B}),E.title=C,E.onclick=()=>{A.options.position=v,A.settingsManager.saveSettings({position:v}),A.render()},E.onmouseenter=()=>{D||(E.style.backgroundColor=n,E.style.borderColor=n,E.style.boxShadow=`0 0 6px ${ee(n,25)}`,E.style.opacity="1")},E.onmouseleave=()=>{D||(E.style.backgroundColor=H.textMuted,E.style.borderColor=H.textMuted,E.style.boxShadow="none",E.style.opacity="0.5")},h.appendChild(E)}),l.appendChild(h),l}function q7(A){let{accentColor:n}=A.options,o=document.createDocumentFragment();o.appendChild(gi("Compact Mode",A.compactMode,n,()=>{A.toggleCompactMode()}));let l=document.createElement("div");return Object.assign(l.style,{color:H.textMuted,fontSize:"0.5625rem",marginTop:"2px",marginBottom:"8px"}),l.textContent="Keyboard: Cmd or Ctrl+Shift+M",o.appendChild(l),o}function z7(A){let n=document.createElement("div");Object.assign(n.style,{marginBottom:"6px"});let o=document.createElement("div");Object.assign(o.style,{color:H.text,fontSize:"0.6875rem",marginBottom:"6px"}),o.textContent="Accent Color",n.appendChild(o);let l=document.createElement("div");Object.assign(l.style,{display:"flex",gap:"6px",flexWrap:"wrap",alignItems:"center"});let c=A.options.accentColor,h=c===H.primary,v=!cl.some(B=>B.value===c)&&!h;if(cl.forEach(({name:B,value:C})=>{let E=document.createElement("button"),D=c===C||h&&B==="Emerald";Object.assign(E.style,{width:"24px",height:"24px",borderRadius:"50%",backgroundColor:C,border:D?"2px solid #fff":"2px solid transparent",cursor:"pointer",transition:"all 150ms",boxShadow:D?`0 0 8px ${C}`:"none"}),E.title=B,E.onclick=()=>{A.options.accentColor=C,A.settingsManager.saveSettings({accentColor:C}),A.render()},l.appendChild(E)}),v){let B=document.createElement("button");B.type="button",B.setAttribute("data-accent-reset","true"),B.title=`Custom color (${c}). Click to reset to theme default.`,Object.assign(B.style,{marginLeft:"4px",padding:"2px 8px",borderRadius:"10px",border:`1px dashed ${c}`,backgroundColor:"transparent",color:c,fontSize:"0.625rem",fontFamily:mt,cursor:"pointer",lineHeight:"1.4"}),B.textContent="custom \xB7 reset",B.onclick=()=>{let C=sa.accentColor;A.options.accentColor=C,A.settingsManager.saveSettings({accentColor:C}),A.render()},l.appendChild(B)}return n.appendChild(l),n}function X7(A,n){return[`#${A}::-webkit-slider-thumb {`," -webkit-appearance: none;"," width: 12px; height: 12px;"," border-radius: 50%;",` background: ${n};`,` border: 2px solid ${H.bg};`,` box-shadow: 0 0 4px ${ee(n,50)};`," cursor: grab;","}",`#${A}::-webkit-slider-thumb:active { cursor: grabbing; }`,`#${A}::-moz-range-thumb {`," width: 12px; height: 12px;"," border-radius: 50%;",` background: ${n};`,` border: 2px solid ${H.bg};`,` box-shadow: 0 0 4px ${ee(n,50)};`," cursor: grab;","}",`#${A}::-webkit-slider-runnable-track { background: transparent; }`,`#${A}::-moz-range-track { background: transparent; }`].join(`
|
|
519
519
|
`)}function Y7(A,n,o,l){A.oninput=()=>{let c=parseFloat(A.value);n.textContent=c.toFixed(2),o.style.width=`${c*100}%`,l.options.screenshotQuality=c},A.onchange=()=>{l.settingsManager.saveSettings({screenshotQuality:l.options.screenshotQuality})}}function J7(A){let{accentColor:n}=A.options,o=H.textSecondary,l=document.createElement("div");Object.assign(l.style,{marginTop:"8px"});let c=document.createElement("div");Object.assign(c.style,{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"});let h=document.createElement("span");Object.assign(h.style,{color:H.text,fontSize:"0.6875rem"}),h.textContent="Screenshot Quality",c.appendChild(h);let g=document.createElement("span");Object.assign(g.style,{color:n,fontSize:"0.6875rem",fontFamily:"monospace",minWidth:"28px",textAlign:"right"});let v=A.options.screenshotQuality;g.textContent=v.toFixed(2),c.appendChild(g),l.appendChild(c);let B=document.createElement("div");Object.assign(B.style,{position:"relative",height:"20px"});let C=document.createElement("div");Object.assign(C.style,{position:"absolute",top:"50%",left:"0",right:"0",height:"2px",transform:"translateY(-50%)",borderRadius:"1px",background:ee(o,25),pointerEvents:"none"});let E=document.createElement("div");Object.assign(E.style,{height:"100%",width:`${v*100}%`,borderRadius:"1px",background:n}),C.appendChild(E),B.appendChild(C);let D=document.createElement("input");D.type="range",D.min="0",D.max="1",D.step="0.01",D.value=String(v),Object.assign(D.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",appearance:"none",WebkitAppearance:"none",background:"transparent",outline:"none",cursor:"pointer",margin:"0"});let T=`devbar-quality-${Date.now()}`;D.id=T;let k=document.createElement("style");return k.textContent=X7(T,n),B.appendChild(k),Y7(D,g,E,A),B.appendChild(D),l.appendChild(B),l}function $7(A){let{accentColor:n}=A.options,o=Fu("Evidence workflow");return Du(o,"Choose the controls and save behavior an agent sees during inspect, verify, and handoff."),o.appendChild(Z7(A)),o.appendChild(gi("Screenshot Button",A.options.showScreenshot,n,()=>{A.options.showScreenshot=!A.options.showScreenshot,A.settingsManager.saveSettings({showScreenshot:A.options.showScreenshot}),A.render()})),o.appendChild(gi("Console Badges",A.options.showConsoleBadges,n,()=>{A.options.showConsoleBadges=!A.options.showConsoleBadges,A.settingsManager.saveSettings({showConsoleBadges:A.options.showConsoleBadges}),A.render()})),o.appendChild(gi("Tooltips",A.options.showTooltips,n,()=>{A.options.showTooltips=!A.options.showTooltips,A.settingsManager.saveSettings({showTooltips:A.options.showTooltips}),A.render()})),o}function Z7(A){let{accentColor:n}=A.options,o=document.createElement("div");Object.assign(o.style,{marginBottom:"10px"});let l=document.createElement("div");Object.assign(l.style,{color:H.text,fontSize:"0.6875rem",marginBottom:"6px"}),l.textContent="Save Method",o.appendChild(l);let c=document.createElement("div");Object.assign(c.style,{color:H.textMuted,fontSize:"0.5625rem",lineHeight:"1.4",marginBottom:"8px"}),c.textContent="Auto saves artifacts through Sweetlink when connected, otherwise downloads in-browser.",o.appendChild(c);let h=document.createElement("div");return Object.assign(h.style,{display:"flex",gap:"6px",flexWrap:"wrap"}),[{value:"auto",label:"Auto"},{value:"download",label:"Download"},{value:"local",label:"Local"}].forEach(({value:v,label:B})=>{let C=v==="local"&&!A.sweetlinkConnected,E=Zy({label:B,isActive:A.options.saveLocation===v,accentColor:n,disabled:C,disabledTitle:"Sweetlink not connected",onClick:()=>{A.options.saveLocation=v,A.settingsManager.saveSettings({saveLocation:v}),A.render()}});h.appendChild(E)}),o.appendChild(h),o}function eK(A){let{accentColor:n}=A.options,o=Fu("Metrics");return Du(o,"Keep the toolbar focused by hiding metrics that are not useful now."),[{key:"breakpoint",label:"Breakpoint"},{key:"fcp",label:"FCP"},{key:"lcp",label:"LCP"},{key:"cls",label:"CLS"},{key:"inp",label:"INP"},{key:"pageSize",label:"Page Size"}].forEach(({key:c,label:h})=>{let g=A.options.showMetrics[c]??!0;o.appendChild(gi(h,g,n,()=>{A.options.showMetrics[c]=!A.options.showMetrics[c],A.settingsManager.saveSettings({showMetrics:{breakpoint:A.options.showMetrics.breakpoint??!0,fcp:A.options.showMetrics.fcp??!0,lcp:A.options.showMetrics.lcp??!0,cls:A.options.showMetrics.cls??!0,inp:A.options.showMetrics.inp??!0,pageSize:A.options.showMetrics.pageSize??!0}}),A.render()}))}),o}function tK(A){let n=H.textSecondary,o=document.createElement("div");Object.assign(o.style,{padding:"10px 14px",borderTop:`1px solid ${ee(n,13)}`});let l=rn({color:H.textMuted,text:"Reset to Defaults",padding:"6px 12px",fontSize:"0.625rem"});Object.assign(l.style,{width:"100%",justifyContent:"center",border:"1px solid transparent"});let c=H.textMuted;return l.onmouseenter=()=>{l.style.border=`1px solid ${c}`,l.style.backgroundColor=ee(c,6)},l.onmouseleave=()=>{l.style.border="1px solid transparent",l.style.backgroundColor="transparent"},l.onclick=()=>{A.settingsManager.resetToDefaults();let h=sa;A.applySettings(h)},o.appendChild(l),o}function Fu(A,n=!0){let o=H.textSecondary,l=document.createElement("div");Object.assign(l.style,{padding:"10px 14px",borderBottom:n?`1px solid ${ee(o,13)}`:"none"});let c=document.createElement("div");return Object.assign(c.style,{color:o,fontSize:"0.625rem",textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:"8px"}),c.textContent=A,l.appendChild(c),l}function Du(A,n){let o=document.createElement("div");Object.assign(o.style,{color:H.textMuted,fontSize:"0.5625rem",lineHeight:"1.4",margin:"-2px 0 10px"}),o.textContent=n,A.appendChild(o)}function Zy(A){let{label:n,isActive:o,accentColor:l,disabled:c,disabledTitle:h,onClick:g}=A,v=H.textSecondary,B=document.createElement("button");return Object.assign(B.style,{padding:"6px 10px",minHeight:"28px",backgroundColor:o?ee(l,13):"transparent",border:`1px solid ${o?l:"transparent"}`,borderRadius:"4px",color:o?l:v,fontFamily:mt,fontSize:"0.625rem",cursor:c?"not-allowed":"pointer",transition:"all 150ms",opacity:c?"0.5":"1"}),B.textContent=n,c?h&&(B.title=h):o||(B.onmouseenter=()=>{B.style.borderColor=`${v}`,B.style.backgroundColor=ee(v,6)},B.onmouseleave=()=>{B.style.borderColor="transparent",B.style.backgroundColor="transparent"}),B.onclick=()=>{c||g()},B}function gi(A,n,o,l){let c=document.createElement("div");Object.assign(c.style,{display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"28px",marginBottom:"6px",gap:"12px"});let h=document.createElement("span");Object.assign(h.style,{color:H.text,fontSize:"0.6875rem"}),h.textContent=A,c.appendChild(h);let g=document.createElement("button");Object.assign(g.style,{width:"32px",height:"18px",borderRadius:"9px",border:`1px solid ${n?o:H.border}`,backgroundColor:n?o:H.bgInput,position:"relative",cursor:"pointer",transition:"all 150ms",flexShrink:"0",boxSizing:"border-box"});let v=document.createElement("span");return Object.assign(v.style,{position:"absolute",top:"2px",left:n?"14px":"2px",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:n?"#fff":H.textMuted,boxShadow:"0 1px 2px rgba(0,0,0,0.2)",transition:"left 150ms, background-color 150ms"}),g.appendChild(v),g.onclick=l,c.appendChild(g),c}function rK(A,n){if(A.consoleFilter){let o=A.consoleFilter;qt(A),A.consoleFilter=o,Py(A,n)}else A.showOutlineModal?(qt(A),A.showOutlineModal=!0,jy(A)):A.showSchemaModal?(qt(A),A.showSchemaModal=!0,qy(A)):A.showA11yModal?(qt(A),A.showA11yModal=!0,zy(A)):A.showDesignReviewConfirm?(qt(A),A.showDesignReviewConfirm=!0,Xy(A)):A.showSettingsPopover&&(qt(A),A.showSettingsPopover=!0,$y(A))}function eC(A,n,o){if(!A.destroyed&&!(typeof document>"u")&&!xf){Ff(!0),eb(A),A.overlayElement&&(A.overlayElement.remove(),A.overlayElement=null,document.body.style.overflow=""),A.container&&A.container.remove(),A.container=document.createElement("div"),A.container.setAttribute("data-devbar","true"),A.container.setAttribute("role","toolbar"),A.container.setAttribute("aria-label","DevBar"),document.body.appendChild(A.container);try{A.collapsed?lb(A):A.compactMode?Ny(A,o):Ky(A,o)}catch(l){console.error("[GlobalDevBar] Render failed:",l)}try{rK(A,n)}catch(l){console.error("[GlobalDevBar] Overlay render failed:",l)}A.overlayElement&&(document.body.style.overflow="hidden"),Ff(!1)}}function tC(A){if(A.pendingViewerWindow){try{A.pendingViewerWindow.close()}catch{}A.pendingViewerWindow=null}}function nC(A){return`ws://localhost:${A.baseWsPort}`}function $p(A){return A.wsUrlCandidates?.length?A.wsUrlCandidates:[nC(A)]}function aK(A,n){return typeof n=="string"?n:typeof n=="number"?`ws://localhost:${n}`:$p(A)[0]??nC(A)}function AC(A){try{let n=new URL(A);if(n.protocol!=="ws:"&&n.protocol!=="wss:")return null;let o=Number(n.port);return Number.isInteger(o)&&o>0?o:null}catch{return null}}function rC(A,n,o=100){let l=$p(A),c=l.indexOf(n);if(c>=0&&c+1<l.length){setTimeout(()=>Qa(A,l[c+1]),o);return}let h=AC(n);if(h!==null){let g=h+1;if(g<A.baseWsPort+10){setTimeout(()=>Qa(A,g),o);return}}setTimeout(()=>Qa(A),Hw)}function Qa(A,n){if(A.destroyed)return;let o=aK(A,n),l=AC(o);A.debug.ws("Connecting to WebSocket",{url:o,port:l??"same-origin",appPort:A.currentAppPort});let c=new WebSocket(o),h=!1;A.ws=c,A.wsVerified=!1,c.onopen=()=>{A.debug.ws("WebSocket socket opened, awaiting server-info"),c.send(JSON.stringify({type:"browser-client-ready"}))},c.onmessage=async g=>{try{let v=JSON.parse(g.data);if(v.type==="server-info"){let C=v.appPort;if(!(C===null||C===A.currentAppPort)){A.debug.ws("Server mismatch",{serverAppPort:C,currentAppPort:A.currentAppPort,targetUrl:o}),h=!0,c.close(),rC(A,o);return}A.wsVerified=!0,A.sweetlinkConnected=!0,A.reconnectAttempts=0,A.serverProjectDir=v.projectDir??null,A.serverGitBranch=v.gitBranch??null,A.serverAppName=v.appName??null,A.debug.ws("Server verified",{appPort:C??"any",projectDir:A.serverProjectDir,gitBranch:A.serverGitBranch}),A.settingsManager.setWebSocket(c),A.settingsManager.setConnected(!0),c.send(JSON.stringify({type:"load-settings"})),A.render();return}if(!A.wsVerified){A.debug.ws("Ignoring command before verification",{type:v.type});return}if(v.type==="hifi-screenshot"){A.capturing=!1,A.render();return}if(v.type==="record-start-response"&&v.success){A.recordingActive=!0,A.recordingSessionId=v.sessionId??null,A.recordingStartedAt=Date.now(),A.recordingTimer=setInterval(()=>A.render(),1e3),A.render();return}if(v.type==="record-stop-response"||v.type==="record-stop"){if(A.recordingActive=!1,A.recordingTimer&&clearInterval(A.recordingTimer),A.recordingTimer=null,A.recordingStartedAt=null,v.success){let E=v.viewerUrl;E&&A.pendingViewerWindow?(A.pendingViewerWindow.location.href=E,A.pendingViewerWindow=null):tC(A),E&&(A.lastViewerPath=E)}else tC(A);A.render();return}let B=v;A.debug.ws("Received command",{type:B.type}),await UK(A,B)}catch(v){console.error("[GlobalDevBar] Error handling command:",v)}},c.onclose=()=>{if(A.wsVerified){if(A.sweetlinkConnected=!1,A.wsVerified=!1,A.serverProjectDir=null,A.settingsManager.setConnected(!1),A.debug.ws("WebSocket disconnected"),A.render(),!A.destroyed&&A.reconnectAttempts<tl){let g=kw*2**A.reconnectAttempts;A.reconnectAttempts++,A.debug.ws("Scheduling reconnect",{attempt:A.reconnectAttempts,delayMs:g}),A.reconnectTimeout=setTimeout(()=>Qa(A,A.baseWsPort),Math.min(g,Lw))}}else if(!A.destroyed&&!h){let g=$p(A),v=g.indexOf(o);v>=0&&v+1<g.length&&(A.debug.ws("WebSocket closed before verification, trying next candidate"),rC(A,o))}},c.onerror=()=>{A.debug.ws("WebSocket error")}}function Qu(A,n,o=Aa){return(l,c)=>{vi(l,A,c[n],o)}}function Su(A,n){return(o,l)=>{n&&(o[n]=!1),console.error(`[GlobalDevBar] ${A} failed:`,l.error),n&&o.render()}}var oK=Qu("outline","outlinePath"),iK=Qu("schema","schemaPath"),sK=Qu("consoleLogs","consoleLogsPath"),lK=Qu("a11y","a11yPath"),uK=(A,n)=>{A.capturing=!1,vi(A,"screenshot",n.path,Aa)},cK=Su("Outline save"),dK=Su("Schema save"),fK=Su("Console logs save","savingConsoleLogs"),pK=Su("A11y save","savingA11yAudit");async function hK(A,n){let o=n.selector&&document.querySelector(n.selector)||document.body,c=await(await _A())(o,{logging:!1,useCORS:!0,allowTaint:!0});A.send(JSON.stringify({success:!0,data:{screenshot:c.toDataURL("image/png"),width:c.width,height:c.height,selector:n.selector||"body"},timestamp:Date.now()}))}function mK(A,n,o){let l=A.consoleLogs;if(o.filter){let c=o.filter.toLowerCase();l=l.filter(h=>h.level.includes(c)||h.message.toLowerCase().includes(c))}n.send(JSON.stringify({success:!0,data:l,timestamp:Date.now()}))}function gK(A,n){if(n.selector){let l=Array.from(document.querySelectorAll(n.selector)).map(c=>n.property?c[n.property]??null:{tagName:c.tagName,className:c.className,id:c.id,textContent:c.textContent?.trim().slice(0,100)});A.send(JSON.stringify({success:!0,data:{count:l.length,results:l},timestamp:Date.now()}))}}function vK(A,n){if(n.code&&typeof n.code=="string"&&n.code.length<=1e4)try{let l=(0,eval)(n.code);A.send(JSON.stringify({success:!0,data:l,timestamp:Date.now()}))}catch(o){A.send(JSON.stringify({success:!1,error:o instanceof Error?o.message:"Execution failed",timestamp:Date.now()}))}}async function wK(A,n){try{let o=await So(n.forceRefresh),l={critical:0,serious:0,moderate:0,minor:0};for(let c of o.violations)l[c.impact]=(l[c.impact]||0)+1;A.send(JSON.stringify({success:!0,data:{result:o,summary:{totalViolations:o.violations.length,totalPasses:o.passes.length,totalIncomplete:o.incomplete.length,byImpact:l},url:window.location.href,title:document.title,timestamp:Date.now()},timestamp:Date.now()}))}catch(o){A.send(JSON.stringify({success:!1,error:o instanceof Error?o.message:"Accessibility audit failed",timestamp:Date.now()}))}}function bK(A){try{let n=eA(),o=En(n);A.send(JSON.stringify({success:!0,data:{outline:n,markdown:o,url:window.location.href,title:document.title,timestamp:Date.now()},timestamp:Date.now()}))}catch(n){A.send(JSON.stringify({success:!1,error:n instanceof Error?n.message:"Outline extraction failed",timestamp:Date.now()}))}}function BK(A){try{let n=tA(),o=rA(n);A.send(JSON.stringify({success:!0,data:{schema:n,markdown:o,url:window.location.href,title:document.title,timestamp:Date.now()},timestamp:Date.now()}))}catch(n){A.send(JSON.stringify({success:!1,error:n instanceof Error?n.message:"Schema extraction failed",timestamp:Date.now()}))}}async function yK(A){try{let o=performance.getEntriesByType("paint").find(q=>q.name==="first-contentful-paint"),l=o?Math.round(o.startTime):null,c=q=>new Promise(se=>{try{let $=[],pe=new PerformanceObserver(Se=>{$.push(...Se.getEntries())});pe.observe({type:q,buffered:!0}),setTimeout(()=>{pe.disconnect(),se($)},0)}catch{se([])}}),[h,g,v]=await Promise.all([c("largest-contentful-paint"),c("layout-shift"),c("event")]),B=h.length>0?Math.round(h[h.length-1].startTime):null,C=null;if(g.length>0){let q=0;for(let se of g){let $=se;$.hadRecentInput||(q+=$.value)}C=Math.round(q*1e3)/1e3}let E=null;if(v.length>0){let q=0;for(let se of v){let $=se;$.duration>q&&(q=$.duration)}E=Math.round(q)}let D=null,T=performance.getEntriesByType("resource"),k=0;for(let q of T)k+=q.transferSize||0;k>0&&(D=k);let V={fcp:l,lcp:B,cls:C,inp:E,pageSize:D,url:window.location.href,title:document.title,timestamp:Date.now()},W=[];l!==null&&W.push(`FCP: ${l}ms`),B!==null&&W.push(`LCP: ${B}ms`),C!==null&&W.push(`CLS: ${C}`),E!==null&&W.push(`INP: ${E}ms`),D!==null&&W.push(`Page size: ${Math.round(D/1024)}KB`),A.send(JSON.stringify({success:!0,data:{vitals:V,summary:W.join(", ")||"No metrics available yet"},timestamp:Date.now()}))}catch(n){A.send(JSON.stringify({success:!1,error:n instanceof Error?n.message:"Vitals collection failed",timestamp:Date.now()}))}}function CK(A){try{window.location.reload(),A.send(JSON.stringify({success:!0,timestamp:Date.now()}))}catch(n){A.send(JSON.stringify({success:!1,error:n instanceof Error?n.message:"Refresh failed",timestamp:Date.now()}))}}function EK(A,n){A.designReviewInProgress=!1,vi(A,"designReview",n.reviewPath,cf)}function xK(A,n){A.designReviewInProgress=!1,A.designReviewError=n.error||"Unknown error",console.error("[GlobalDevBar] Design review failed:",n.error),A.designReviewErrorTimeout&&clearTimeout(A.designReviewErrorTimeout),A.designReviewErrorTimeout=setTimeout(()=>{A.designReviewError=null,A.render()},cf),A.render()}function FK(A,n){let o=n;A.apiKeyStatus={configured:o.configured??!1,model:o.model,pricing:o.pricing},A.render()}function DK(A,n){TK(A,n.settings)}function QK(A,n){A.debug.state("Settings saved to server",{path:n.settingsPath})}function SK(A){console.error("[GlobalDevBar] Settings operation failed:",A.error)}async function UK(A,n){let o=A.ws;if(!(!o||o.readyState!==WebSocket.OPEN))switch(n.type){case"screenshot":await hK(o,n);break;case"get-logs":mK(A,o,n);break;case"query-dom":gK(o,n);break;case"exec-js":vK(o,n);break;case"get-a11y":await wK(o,n);break;case"get-outline":bK(o);break;case"get-schema":BK(o);break;case"get-vitals":await yK(o);break;case"refresh":CK(o);break;case"screenshot-saved":uK(A,n);break;case"design-review-saved":EK(A,n);break;case"design-review-error":xK(A,n);break;case"api-key-status":FK(A,n);break;case"outline-saved":oK(A,n);break;case"outline-error":cK(A,n);break;case"schema-saved":iK(A,n);break;case"schema-error":dK(A,n);break;case"console-logs-saved":sK(A,n);break;case"console-logs-error":fK(A,n);break;case"a11y-saved":lK(A,n);break;case"a11y-error":pK(A,n);break;case"settings-loaded":DK(A,n);break;case"settings-saved":QK(A,n);break;case"settings-error":SK(n);break;default:break}}function vi(A,n,o,l){if(o){switch(n){case"screenshot":A.lastScreenshot=o,A.screenshotTimeout&&clearTimeout(A.screenshotTimeout),A.screenshotTimeout=setTimeout(()=>{A.lastScreenshot=null,A.render()},l);break;case"designReview":A.lastDesignReview=o,A.designReviewTimeout&&clearTimeout(A.designReviewTimeout),A.designReviewTimeout=setTimeout(()=>{A.lastDesignReview=null,A.render()},l);break;case"outline":A.savingOutline=!1,A.lastOutline=o,A.outlineTimeout&&clearTimeout(A.outlineTimeout),A.outlineTimeout=setTimeout(()=>{A.lastOutline=null,A.render()},l);break;case"schema":A.savingSchema=!1,A.lastSchema=o,A.schemaTimeout&&clearTimeout(A.schemaTimeout),A.schemaTimeout=setTimeout(()=>{A.lastSchema=null,A.render()},l);break;case"consoleLogs":A.savingConsoleLogs=!1,A.lastConsoleLogs=o,A.consoleLogsTimeout&&clearTimeout(A.consoleLogsTimeout),A.consoleLogsTimeout=setTimeout(()=>{A.lastConsoleLogs=null,A.render()},l);break;case"a11y":A.savingA11yAudit=!1,A.lastA11yAudit=o,A.a11yTimeout&&clearTimeout(A.a11yTimeout),A.a11yTimeout=setTimeout(()=>{A.lastA11yAudit=null,A.render()},l);break}A.render()}}function TK(A,n){if(!n){A.debug.state("No server settings found, using local");return}A.debug.state("Settings loaded from server",n),A.settingsManager.handleSettingsLoaded(n),A.applySettings(n)}function IK(A,n){let o=[],l=h=>{h&&!o.includes(h)&&o.push(h)};l(n.wsUrl),n.wsPath&&l(Ow(A,n.wsPath));let c=na(n.wsPort)??n.fallbackPort;return l(`ws://localhost:${c}`),o}var Ar=new el({trackCounts:!0});Ar.importEarlyLogs();Ar.start();Ar.startErrorHandlers();var Kr=class A{static CONTROLS_KEY="__YTSPAR_DEVBAR_CONTROLS__";static get customControls(){return typeof window>"u"?[]:window[A.CONTROLS_KEY]??[]}static set customControls(n){typeof window<"u"&&(window[A.CONTROLS_KEY]=n)}options;forcedThemeMode;debugConfig;debug;container=null;ws=null;consoleLogs=[];sweetlinkConnected=!1;collapsed=!1;capturing=!1;copiedToClipboard=!1;copiedPath=!1;lastScreenshot=null;designReviewInProgress=!1;lastDesignReview=null;designReviewError=null;showDesignReviewConfirm=!1;apiKeyStatus=null;lastOutline=null;lastSchema=null;savingOutline=!1;savingSchema=!1;consoleFilter=null;savingConsoleLogs=!1;lastConsoleLogs=null;consoleLogsTimeout;showOutlineModal=!1;showSchemaModal=!1;showA11yModal=!1;a11yLoading=!1;lastA11yAudit=null;savingA11yAudit=!1;a11yTimeout=null;recordingActive=!1;recordingSessionId=null;recordingStartedAt=null;recordingTimer=null;lastViewerPath=null;pendingViewerWindow=null;demoActive=!1;demoTitle=null;demoSectionCount=0;rulerMode=!1;rulerOverlay=null;rulerPinnedElements=[];rulerCleanup=null;activeTooltips=new Set;breakpointInfo=null;perfStats=null;lcpValue=null;clsValue=0;inpValue=0;reconnectAttempts=0;currentAppPort;baseWsPort;wsUrlCandidates;wsVerified=!1;serverProjectDir=null;serverGitBranch=null;serverAppName=null;lastDotPosition=null;reconnectTimeout=null;screenshotTimeout=null;copiedPathTimeout=null;designReviewTimeout=null;designReviewErrorTimeout=null;outlineTimeout=null;schemaTimeout=null;resizeHandler=null;keydownHandler=null;fcpObserver=null;lcpObserver=null;clsObserver=null;inpObserver=null;destroyed=!1;themeMode="system";themeMediaQuery=null;themeMediaHandler=null;compactMode=!1;showSettingsPopover=!1;overlayElement=null;settingsManager;logChangeListener=null;constructor(n={}){if(this.debugConfig=Bf(n.debug),this.debug=new Uo(this.debugConfig),this.forcedThemeMode=n.themeMode,this.settingsManager=Uf(n.defaultThemeMode?{themeMode:n.defaultThemeMode}:{}),this.forcedThemeMode&&this.settingsManager.saveSettingsNow({themeMode:this.forcedThemeMode}),typeof window<"u"){let o=_w(window),l=n.sweetlink,c=l?.appPort??Rw(window.location,o);this.currentAppPort=c,this.baseWsPort=l?.wsPort??na(o.wsPort)??Iw(c),this.wsUrlCandidates=IK(window.location,{wsUrl:l?.wsUrl??o.wsUrl,wsPort:l?.wsPort??o.wsPort,wsPath:l?.wsPath??o.wsPath,fallbackPort:this.baseWsPort})}else this.currentAppPort=0,this.baseWsPort=9223,this.wsUrlCandidates=[`ws://localhost:${9223}`];this.options={position:n.position??"bottom-left",accentColor:n.accentColor??H.primary,showMetrics:{breakpoint:n.showMetrics?.breakpoint??!0,fcp:n.showMetrics?.fcp??!0,lcp:n.showMetrics?.lcp??!0,cls:n.showMetrics?.cls??!0,inp:n.showMetrics?.inp??!0,pageSize:n.showMetrics?.pageSize??!0},showScreenshot:n.showScreenshot??!0,showConsoleBadges:n.showConsoleBadges??!0,showTooltips:n.showTooltips??!0,saveLocation:n.saveLocation??"auto",screenshotQuality:n.screenshotQuality??.65,sizeOverrides:n.sizeOverrides},this.debug.lifecycle("GlobalDevBar constructed",{options:this.options})}getLogCounts(){return{errorCount:Ar.getErrorCount(),warningCount:Ar.getWarningCount(),infoCount:Ar.getInfoCount()}}resetPositionStyles(n){Object.assign(n.style,{top:"",bottom:"",left:"",right:"",transform:""})}createCollapsedBadge(n,o,l){let c=document.createElement("span");return Object.assign(c.style,{position:"absolute",top:"-6px",right:l,minWidth:"16px",height:"16px",padding:"0 4px",borderRadius:"9999px",backgroundColor:o,color:we.white,fontSize:"0.5625rem",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center"}),c.textContent=n>99?"!":String(n),c}static registerControl(n){A.customControls=A.customControls.filter(l=>l.id!==n.id),A.customControls.push(n);let o=Sa();o&&o.render()}static unregisterControl(n){A.customControls=A.customControls.filter(l=>l.id!==n);let o=Sa();o&&o.render()}static getControls(){return[...A.customControls]}static clearControls(){A.customControls=[];let n=Sa();n&&n.render()}init(){typeof window>"u"||this.destroyed||(this.debug.lifecycle("Initializing DevBar"),this.injectStyles(),this.consoleLogs=Ar.getLogs(),this.debug.lifecycle("Copied console logs",{count:this.consoleLogs.length}),this.logChangeListener=()=>{this.consoleLogs=Ar.getLogs(),this.overlayElement||this.render()},Ar.addListener(this.logChangeListener),Yy(this),Jy(this),this.connectWebSocket(),Xw(this),Jw(this),zw(this),this.render(),this.debug.lifecycle("DevBar initialized successfully"))}getPosition(){return this.options.position}destroy(){this.debug.lifecycle("Destroying DevBar"),this.destroyed=!0,this.reconnectAttempts=tl,this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.ws&&this.ws.close(),this.screenshotTimeout&&clearTimeout(this.screenshotTimeout),this.copiedPathTimeout&&clearTimeout(this.copiedPathTimeout),this.designReviewTimeout&&clearTimeout(this.designReviewTimeout),this.outlineTimeout&&clearTimeout(this.outlineTimeout),this.schemaTimeout&&clearTimeout(this.schemaTimeout),this.consoleLogsTimeout&&clearTimeout(this.consoleLogsTimeout),this.a11yTimeout&&clearTimeout(this.a11yTimeout),this.resizeHandler&&window.removeEventListener("resize",this.resizeHandler),this.keydownHandler&&window.removeEventListener("keydown",this.keydownHandler),this.fcpObserver&&this.fcpObserver.disconnect(),this.lcpObserver&&this.lcpObserver.disconnect(),this.clsObserver&&this.clsObserver.disconnect(),this.inpObserver&&this.inpObserver.disconnect(),this.themeMediaQuery&&this.themeMediaHandler&&this.themeMediaQuery.removeEventListener("change",this.themeMediaHandler),this.logChangeListener&&(Ar.removeListener(this.logChangeListener),this.logChangeListener=null),Ar.stop(),this.container&&(this.container.remove(),this.container=null),this.overlayElement&&(this.overlayElement.remove(),this.overlayElement=null,document.body.style.overflow=""),this.debug.lifecycle("DevBar destroyed")}injectStyles(){let n="devbar-styles";if(!document.getElementById(n)){let o=document.createElement("style");o.id=n,o.textContent=Vw,document.head.appendChild(o)}}connectWebSocket(n){Qa(this,n)}handleNotification(n,o,l){vi(this,n,o,l)}applySettings(n){let o=this.forcedThemeMode?{...n,themeMode:this.forcedThemeMode}:n;this.forcedThemeMode&&this.settingsManager.get("themeMode")!==this.forcedThemeMode&&this.settingsManager.saveSettingsNow({themeMode:this.forcedThemeMode}),this.themeMode=o.themeMode,this.compactMode=o.compactMode,this.options.position=o.position,this.options.accentColor=o.accentColor,this.options.showScreenshot=o.showScreenshot,this.options.showConsoleBadges=o.showConsoleBadges,this.options.showTooltips=o.showTooltips,this.options.saveLocation=o.saveLocation,this.options.screenshotQuality=o.screenshotQuality??.65,this.options.showMetrics={...o.showMetrics},this.render()}clearConsoleLogs(){Ar.clear(),this.consoleLogs=[],this.consoleFilter=null,this.render()}handleScreenshot(n){return by(this,n)}getThemeMode(){return this.themeMode}setThemeMode(n){xu(this,n)}getColors(){return gf(this.themeMode)}toggleCompactMode(){this.compactMode=!this.compactMode,this.settingsManager.saveSettings({compactMode:this.compactMode}),this.debug.state("Compact mode toggled",{compactMode:this.compactMode}),this.render()}isCompactMode(){return this.compactMode}render(){eC(this,Ar,A.customControls)}},oC="__YTSPAR_DEVBAR_INSTANCE__";function Sa(){return typeof window>"u"?null:window[oC]??null}function Zp(A){typeof window>"u"||(window[oC]=A)}function RA(A){let n=Sa();if(n){let l=n.getPosition(),c=A?.position??"bottom-left";if(l===c)return n;n.destroy(),Zp(null)}let o=new Kr(A);return o.init(),Zp(o),o}function e1(){return Sa()}function _K(){let A=Sa();A&&(A.destroy(),Zp(null))}var t1=class{entries=[];observer=null;listeners=new Set;maxEntries=200;start(){if(typeof PerformanceObserver>"u"){console.warn("[NetworkMonitor] PerformanceObserver not supported");return}let n=performance.getEntriesByType("resource");for(let o of n)this.addEntry(o);try{this.observer=new PerformanceObserver(o=>{for(let l of o.getEntries())this.addEntry(l);this.notifyListeners()}),this.observer.observe({type:"resource",buffered:!0})}catch(o){console.warn("[NetworkMonitor] Failed to start observer",o)}}stop(){this.observer&&(this.observer.disconnect(),this.observer=null)}addEntry(n){let o={url:n.name,name:this.getResourceName(n.name),initiatorType:n.initiatorType,duration:Math.round(n.duration),transferSize:n.transferSize,encodedBodySize:n.encodedBodySize,decodedBodySize:n.decodedBodySize,startTime:Math.round(n.startTime),responseEnd:Math.round(n.responseEnd)};this.entries.push(o),this.entries.length>this.maxEntries&&(this.entries=this.entries.slice(-this.maxEntries))}getResourceName(n){try{let o=new URL(n),c=o.pathname.split("/").filter(Boolean);return c.length>0?c[c.length-1]:o.hostname}catch{return n.slice(0,50)}}getState(){let n=0;for(let o of this.entries)n+=o.transferSize||0;return{entries:[...this.entries],totalRequests:this.entries.length,totalSize:n,pendingCount:0}}getEntriesByType(n){return this.entries.filter(o=>o.initiatorType===n)}search(n){let o=n.toLowerCase();return this.entries.filter(l=>l.url.toLowerCase().includes(o)||l.name.toLowerCase().includes(o)||l.initiatorType.toLowerCase().includes(o))}clear(){this.entries=[],this.notifyListeners()}subscribe(n){return this.listeners.add(n),()=>this.listeners.delete(n)}notifyListeners(){let n=this.getState();for(let o of this.listeners)o(n)}};var iC="devbar-plugin-app-version";function RK(A,n={}){let{prefix:o="v",variant:l="default",onClick:c}=n;return Kr.registerControl({id:iC,label:`${o}${A}`,variant:l,onClick:c?()=>c(A):void 0}),()=>{Kr.unregisterControl(iC)}}var r1="devbar-plugin-git-branch",OK=2e3;function kK(A={}){let{prefix:n="\uE0A0",variant:o="info",onClick:l}=A,c=null,h=!1;function g(){if(h)return;let C=e1()?.serverGitBranch??null;C!==c&&(c=C,C?Kr.registerControl({id:r1,label:`${n} ${C}`,variant:o,onClick:l?()=>l(C):void 0}):Kr.unregisterControl(r1))}g();let v=setInterval(g,OK);return()=>{h=!0,clearInterval(v),Kr.unregisterControl(r1)}}var sC={showMetrics:{breakpoint:!1,fcp:!1,lcp:!1,cls:!1,inp:!1,pageSize:!1},showScreenshot:!1,showConsoleBadges:!0,showTooltips:!1},lC={showMetrics:{breakpoint:!0,fcp:!0,lcp:!0,cls:!0,inp:!0,pageSize:!0},showScreenshot:!0,showConsoleBadges:!0,showTooltips:!0},uC={showMetrics:{breakpoint:!1,fcp:!0,lcp:!0,cls:!0,inp:!0,pageSize:!0},showScreenshot:!1,showConsoleBadges:!1,showTooltips:!0},cC={showMetrics:{breakpoint:!0,fcp:!1,lcp:!1,cls:!1,inp:!1,pageSize:!1},showScreenshot:!0,showConsoleBadges:!1,showTooltips:!0},dC={showMetrics:{breakpoint:!0,fcp:!0,lcp:!0,cls:!0,inp:!0,pageSize:!0},showScreenshot:!0,showConsoleBadges:!0,showTooltips:!0,debug:!0};function LK(A){return RA({...sC,...A})}function HK(A){return RA({...lC,...A})}function MK(A){return RA({...uC,...A})}function NK(A){return RA({...cC,...A})}function PK(A){return RA({...dC,...A})}function KK(A){try{return{parsed:JSON.parse(A),success:!0}}catch{return{parsed:void 0,success:!1}}}function fC(A){let n=[];for(let o=0;o<A.length;o++){let l=A.key(o);if(l===null)continue;let c=A.getItem(l)??"",{parsed:h,success:g}=KK(c);n.push({key:l,value:c,parsedValue:g?h:void 0,isParseable:g,size:new Blob([c]).size})}return n.sort((o,l)=>o.key.localeCompare(l.key))}function pC(){return typeof localStorage>"u"?[]:fC(localStorage)}function hC(){return typeof sessionStorage>"u"?[]:fC(sessionStorage)}function mC(){return typeof document>"u"||!document.cookie?[]:document.cookie.split(";").map(A=>{let[n,...o]=A.trim().split("="),l=o.join("=");return{name:n.trim(),value:decodeURIComponent(l||""),size:new Blob([l||""]).size}}).filter(A=>A.name).sort((A,n)=>A.name.localeCompare(n.name))}function VK(){return{localStorage:pC(),sessionStorage:hC(),cookies:mC()}}function GK(A,n){typeof localStorage>"u"||localStorage.setItem(A,n)}function jK(A){typeof localStorage>"u"||localStorage.removeItem(A)}function WK(A,n){typeof sessionStorage>"u"||sessionStorage.setItem(A,n)}function qK(A){typeof sessionStorage>"u"||sessionStorage.removeItem(A)}function zK(A){typeof document>"u"||(document.cookie=`${A}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`)}export{cl as ACCENT_COLOR_PRESETS,Me as BUTTON_COLORS,rl as CATEGORY_COLORS,sa as DEFAULT_SETTINGS,yA as DEVBAR_LOGO_COLORS,If as DEVBAR_LOGO_PATHS,nn as DEVBAR_LOGO_SHAPES,Tf as DEVBAR_LOGO_VIEWBOX,ht as DEVBAR_THEME,hf as DEVBAR_THEME_LIGHT,Uo as DebugLogger,qw as EARLY_CONSOLE_CAPTURE_SCRIPT,mt as FONT_MONO,Kr as GlobalDevBar,t1 as NetworkMonitor,we as PALETTE,dC as PRESET_DEBUG,lC as PRESET_FULL,sC as PRESET_MINIMAL,uC as PRESET_PERFORMANCE,cC as PRESET_RESPONSIVE,pf as STORAGE_KEYS,xo as TAILWIND_BREAKPOINTS,RK as appVersionPlugin,fi as canvasToDataUrl,bu as copyCanvasToClipboard,kH as createDevBarLogo,hi as delay,zK as deleteCookie,jK as deleteLocalStorageItem,qK as deleteSessionStorageItem,_K as destroyGlobalDevBar,Ar as earlyConsoleCapture,eA as extractDocumentOutline,tA as extractPageSchema,of as formatArg,sf as formatArgs,Mw as generateThemeCSSVars,mC as getCookies,LH as getDevBarLogoSvg,aa as getEffectiveTheme,e1 as getGlobalDevBar,_A as getHtml2Canvas,ol as getImpactColor,pC as getLocalStorage,hC as getSessionStorage,Uf as getSettingsManager,VK as getStorageData,wH as getStoredThemeMode,Fo as getTheme,gf as getThemeColors,Al as getViolationCounts,kK as gitBranchPlugin,al as groupViolationsByImpact,PK as initDebug,HK as initFull,RA as initGlobalDevBar,LK as initMinimal,MK as initPerformance,NK as initResponsive,Do as injectThemeCSS,BH as isAxeLoaded,Bf as normalizeDebugConfig,En as outlineToMarkdown,bf as preloadAxe,pi as prepareForCapture,Nn as resolveSaveLocation,So as runA11yAudit,rA as schemaToMarkdown,GK as setLocalStorageItem,WK as setSessionStorageItem,mf as setStoredThemeMode};
|
|
@@ -66,7 +66,7 @@ function styleExpandedWrapper(state, wrapper, posStyle, accentColor, isCentered)
|
|
|
66
66
|
backgroundColor: 'var(--devbar-color-bg-card)',
|
|
67
67
|
border: `1px solid ${accentColor}`,
|
|
68
68
|
borderRadius: '12px',
|
|
69
|
-
color:
|
|
69
|
+
color: accentColor,
|
|
70
70
|
boxShadow: `${DEVBAR_THEME.shadows.dropToolbar}, 0 0 0 1px ${withAlpha(accentColor, 10)}`,
|
|
71
71
|
backdropFilter: 'blur(8px)',
|
|
72
72
|
WebkitBackdropFilter: 'blur(8px)',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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AAiB,EACjB,UAAU,EACV,YAAY,EACZ,SAAS,CACV,CAAC;IACF,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAE/B,oBAAoB;IACpB,MAAM,gBAAgB,GAAG,4BAA4B,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;IAC1F,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEtC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAE7B,kCAAkC;IAClC,MAAM,SAAS,GAAG,uBAAuB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IACvE,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"expanded.js","sourceRoot":"","sources":["../../../src/modules/rendering/expanded.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,aAAa,EACb,UAAU,EACV,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAElG;;;GAGG;AACH,SAAS,uBAAuB,CAC9B,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MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,OAAO,CAAC,oBAAoB,GAAG,MAAM,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,OAAO,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC9C,CAAC;IAED,oCAAoC;IACpC,MAAM,QAAQ,GAAG,uBAAuB,CAAC,KAAK,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IACtE,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IAExE,wBAAwB;IACxB,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IAExC,iEAAiE;IACjE,MAAM,SAAS,GAAG,eAAe,CAC/B,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,SAAS,CACV,CAAC;IACF,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAE/B,oBAAoB;IACpB,MAAM,gBAAgB,GAAG,4BAA4B,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;IAC1F,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEtC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAE7B,kCAAkC;IAClC,MAAM,SAAS,GAAG,uBAAuB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IACvE,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ytspar/devbar",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.1-canary.5f2060e",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Development toolbar and utilities with Sweetlink integration - pure vanilla JS, no framework dependencies",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"axe-core": "^4.10.2",
|
|
80
80
|
"html2canvas-pro": "^2.0.0",
|
|
81
|
-
"@ytspar/sweetlink": "^1.23.0"
|
|
81
|
+
"@ytspar/sweetlink": "^1.23.0-canary.5f2060e"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@types/node": "^25.2.3",
|