-`;function w(e){let t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}function a(e,t={}){let o=new CustomEvent(e,t);document.dispatchEvent(o)}function C(){let e=w(_),t=!1,o=()=>{t?i():a("lvdbg:debug-button-click",{detail:{buttonRect:e.getBoundingClientRect()}})},n=()=>{t=!0,e.style.cursor="grabbing",document.addEventListener("mousemove",r)},i=()=>{t=!1,e.style.cursor="pointer",document.removeEventListener("mousemove",r)},r=s=>{let g=e.offsetWidth,m=e.offsetHeight,d=window.innerWidth-g,h=window.innerHeight-m,v=Math.max(0,Math.min(s.clientX-g/2,d)),f=Math.max(0,Math.min(s.clientY-m/2,h));e.style.left=`${v}px`,e.style.top=`${f}px`,e.style.right="auto",e.style.bottom="auto"},l=()=>{let s=e.getBoundingClientRect();s.top>=0&&s.left>=0&&s.bottom<=window.innerHeight&&s.right<=window.innerWidth||(e.style.left="auto",e.style.top="auto",e.style.right="20px",e.style.bottom="20px")};return e.addEventListener("click",o),document.addEventListener("lvdbg:move-button-click",n),window.addEventListener("resize",()=>l()),e}var A=`
+`;function w(e){let t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}function a(e,t={}){let o=new CustomEvent(e,t);document.dispatchEvent(o)}function E(){let e=w(U),t=!1,o=()=>{t?i():a("lvdbg:debug-button-click",{detail:{buttonRect:e.getBoundingClientRect()}})},n=()=>{t=!0,e.style.cursor="grabbing",document.addEventListener("mousemove",r)},i=()=>{t=!1,e.style.cursor="pointer",document.removeEventListener("mousemove",r)},r=s=>{let g=e.offsetWidth,m=e.offsetHeight,d=window.innerWidth-g,h=window.innerHeight-m,v=Math.max(0,Math.min(s.clientX-g/2,d)),f=Math.max(0,Math.min(s.clientY-m/2,h));e.style.left=`${v}px`,e.style.top=`${f}px`,e.style.right="auto",e.style.bottom="auto"},l=()=>{let s=e.getBoundingClientRect();s.top>=0&&s.left>=0&&s.bottom<=window.innerHeight&&s.right<=window.innerWidth||(e.style.left="auto",e.style.top="auto",e.style.right="20px",e.style.bottom="20px")};return e.addEventListener("click",o),document.addEventListener("lvdbg:move-button-click",n),window.addEventListener("resize",()=>l()),e}var R=`
-`;function E({liveDebuggerURL:e,debugChannel:t}){let o=w(A),n=!1,i=d=>{o.style.display="block";let h=o.getBoundingClientRect(),v=h.width,f=h.height;d.right+v>window.innerWidth?o.style.left=`${d.left-v}px`:o.style.left=`${d.right}px`,d.top+f>window.innerHeight?o.style.top=`${d.bottom-f}px`:o.style.top=`${d.top}px`,n=!0},r=()=>{o.style.display="none",n=!1},l=d=>{let h=d.detail.buttonRect;n?r():i(h)},s=()=>{window.open(e,"_blank"),r()},g=()=>{a("lvdbg:inspect-button-click"),r()},m=()=>{a("lvdbg:move-button-click"),r()};return o.querySelector("#live-debugger-debug-tooltip-open-in-new-tab").addEventListener("click",s),o.querySelector("#live-debugger-debug-tooltip-inspect-elements").addEventListener("click",g),o.querySelector("#live-debugger-debug-tooltip-move-button").addEventListener("click",m),document.addEventListener("lvdbg:debug-button-click",l),document.addEventListener("lvdbg:click-outside-debug-menu",r),t.on("inspect-mode-changed",r),window.addEventListener("resize",()=>{n&&r()}),o}function U(){return new Promise(e=>{let t=document.querySelectorAll("[data-phx-session]"),o={},n=document.querySelector("[data-phx-main]")?.id,i=l=>{se(l)&&(de(o,l.target),ce(o,t)&&(r.disconnect(),e({mainSocketID:n,rootSocketIDs:ue(o,n)})))},r=new MutationObserver(l=>{l.forEach(i)});t.forEach(l=>{r.observe(l,{attributes:!0})})})}function se(e){return e.type==="attributes"&&e.attributeName==="data-phx-root-id"}function de(e,t){e[t.id]=t.getAttribute("data-phx-root-id")}function ce(e,t){return Object.keys(e).length>=t.length}function ue(e,t){let o=new Set(Object.values(e));return o.delete(t),[...o]}function R(){let e=document.querySelector('meta[name="live-debugger-config"]');if(e)return e;{let t=`
+`;function L({liveDebuggerURL:e,debugChannel:t}){let o=w(R),n=!1,i=d=>{o.style.display="block";let h=o.getBoundingClientRect(),v=h.width,f=h.height;d.right+v>window.innerWidth?o.style.left=`${d.left-v}px`:o.style.left=`${d.right}px`,d.top+f>window.innerHeight?o.style.top=`${d.bottom-f}px`:o.style.top=`${d.top}px`,n=!0},r=()=>{o.style.display="none",n=!1},l=d=>{let h=d.detail.buttonRect;n?r():i(h)},s=()=>{window.open(e,"_blank"),r()},g=()=>{a("lvdbg:inspect-button-click"),r()},m=()=>{a("lvdbg:move-button-click"),r()};return o.querySelector("#live-debugger-debug-tooltip-open-in-new-tab").addEventListener("click",s),o.querySelector("#live-debugger-debug-tooltip-inspect-elements").addEventListener("click",g),o.querySelector("#live-debugger-debug-tooltip-move-button").addEventListener("click",m),document.addEventListener("lvdbg:debug-button-click",l),document.addEventListener("lvdbg:click-outside-debug-menu",r),t.on("inspect-mode-changed",r),window.addEventListener("resize",()=>{n&&r()}),o}function O(){return new Promise(e=>{let t=document.querySelectorAll("[data-phx-session]"),o={},n=document.querySelector("[data-phx-main]")?.id,i=l=>{de(l)&&(ce(o,l.target),ue(o,t)&&(r.disconnect(),e({mainSocketID:n,rootSocketIDs:ae(o,n)})))},r=new MutationObserver(l=>{l.forEach(i)});t.forEach(l=>{r.observe(l,{attributes:!0})})})}function de(e){return e.type==="attributes"&&e.attributeName==="data-phx-root-id"}function ce(e,t){e[t.id]=t.getAttribute("data-phx-root-id")}function ue(e,t){return Object.keys(e).length>=t.length}function ae(e,t){let o=new Set(Object.values(e));return o.delete(t),[...o]}function P(){let e=document.querySelector('meta[name="live-debugger-config"]');if(e)return e;{let t=`
LiveDebugger meta tag not found!
If you have recently bumped LiveDebugger version, please update your layout according to the instructions in the GitHub README.
You can find it here: https://github.com/software-mansion/live-debugger#installation
- `;throw new Error(t)}}function O(e){return e.getAttribute("url")}function P(e){return e.hasAttribute("debug-button")}function L(e,t,o,n){let i=C(),r=E({liveDebuggerURL:t,debugChannel:o}),l=!1,s=()=>{l=!0,setTimeout(()=>{l=!1},0)};i.addEventListener("click",s,!0),r.addEventListener("click",s,!0);let g=()=>{n.appendChild(i),n.appendChild(r)},m=()=>{i.remove(),r.remove()};return P(e)&&g(),o.on("toggle-debug-button",({enabled:d})=>{d?g():m()}),document.addEventListener("click",d=>{let h=d.composedPath?.()??[d.target],v=h.includes(i)||h.includes(r)||h.some(f=>f?.getRootNode?.()===n);l||v||a("lvdbg:click-outside-debug-menu")}),{debugButton:i,debugMenu:r}}var x="live-debugger-highlight-element",ae="live-debugger-highlight-pulse-element",z=["#ffe78080","#ffe78060","#ffe78030","#ffe78000"],pe=["#87CCE880","#87CCE860","#87CCE830","#87CCE800"],ge=["#8bca8480"],Z=e=>{if(!e)return!1;if(e.checkVisibility)return e.checkVisibility();let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0"};function N(e){switch(e){case"LiveComponent":return pe;case"LiveView":return z;case"StreamItem":return ge;default:return z}}function X(e,t,o){let n=e.getBoundingClientRect(),i=document.createElement("div");return i.id=o,i.dataset.attr=t.attr,i.dataset.val=t.val,i.style.position="absolute",i.style.top=`${n.top+window.scrollY}px`,i.style.left=`${n.left+window.scrollX}px`,i.style.width=`${e.offsetWidth}px`,i.style.height=`${e.offsetHeight}px`,i.style.backgroundColor=N(t.type)[0],i.style.zIndex="10000",i.style.pointerEvents="none",i}function he(e){let t=e.querySelector(`#${x}`);t&&t.remove(),a("lvdbg:remove-tooltip")}function j({detail:e},t){let o=t.querySelector(`#${x}`);if(o){o.remove(),a("lvdbg:remove-tooltip");let i=e.attr===void 0||e.val===void 0,r=o.dataset.val===e.val;if(i||r)return}let n=document.querySelector(`[${e.attr}="${e.val}"]`);Z(n)&&(o=X(n,e,x),t.appendChild(o),ve(e))}function me(e){let t=e.querySelector(`#${x}`);if(t){let o=document.querySelector(`[${t.dataset.attr}="${t.dataset.val}"]`),n=o.getBoundingClientRect();t.style.top=`${n.top+window.scrollY}px`,t.style.left=`${n.left+window.scrollX}px`,t.style.width=`${o.offsetWidth}px`,t.style.height=`${o.offsetHeight}px`}}function W({detail:e},t){let o=document.querySelector(`[${e.attr}="${e.val}"]`);if(Z(o)){let n=X(o,e,ae);t.appendChild(n);let i=n.offsetWidth,r=n.offsetHeight,l=N(e.type);n.animate([{width:`${i}px`,height:`${r}px`,transform:"translate(0, 0)",backgroundColor:l[1]},{width:`${i+20}px`,height:`${r+20}px`,transform:"translate(-10px, -10px)",backgroundColor:l[2]},{width:`${i+40}px`,height:`${r+40}px`,transform:"translate(-20px, -20px)",backgroundColor:l[3]}],{duration:500,iterations:1,delay:200}).onfinish=()=>{n.remove()}}}function ve(e){if(!["module","type","id_key","id_value"].every(i=>e.hasOwnProperty(i)))return;let n={detail:{module:e.module,type:e.type,id_key:e.id_key,id_value:e.id_value}};a("lvdbg:show-tooltip",n)}function k(e,t){document.addEventListener("lvdbg:inspect-highlight",o=>j(o,t)),document.addEventListener("lvdbg:inspect-pulse",o=>W(o,t)),document.addEventListener("lvdbg:inspect-clear",()=>he(t)),e.on("highlight",o=>j({detail:o},t)),e.on("pulse",o=>W({detail:o},t)),window.addEventListener("resize",()=>me(t))}var p=[];for(let e=0;e<256;++e)p.push((e+256).toString(16).slice(1));function Y(e,t=0){return(p[e[t+0]]+p[e[t+1]]+p[e[t+2]]+p[e[t+3]]+"-"+p[e[t+4]]+p[e[t+5]]+"-"+p[e[t+6]]+p[e[t+7]]+"-"+p[e[t+8]]+p[e[t+9]]+"-"+p[e[t+10]]+p[e[t+11]]+p[e[t+12]]+p[e[t+13]]+p[e[t+14]]+p[e[t+15]]).toLowerCase()}var M,fe=new Uint8Array(16);function I(){if(!M){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");M=crypto.getRandomValues.bind(crypto)}return M(fe)}var be=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),D={randomUUID:be};function we(e,t,o){if(D.randomUUID&&!t&&!e)return D.randomUUID();e=e||{};let n=e.random??e.rng?.()??I();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(o=o||0,o<0||o+16>t.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[o+i]=n[i];return t}return Y(n)}var S=we;function $(e,t){let o=ye();e.push("window-initialized",{window_id:o,socket_id:t})}function ye(){let e=window.name;if(e)return e;let t=S();return window.name=t,t}function q(e,t,o){let n=e.replace(/^http/,"ws")+"/client",i=new window.Phoenix.Socket(n,{params:{socketID:t,rootSocketIDs:o}});i.connect();let r=i.channel(`client:${t}`);return r.join().receive("ok",()=>{$(r,t),console.log("LiveDebugger debug connection established!")}).receive("error",l=>{console.error(`LiveDebugger was unable to establish websocket debug connection! Browser features will not work:
-`,l)}),{debugSocket:i,debugChannel:r}}function T({baseURL:e,debugChannel:t,socketID:o,debugButton:n}){let i=!1,r=null,l=[];t.on("found-node-element",c=>{Ee({module:c.module,type:c.type,id_key:c.id_key,id_value:c.id_value})}),t.on("inspect-mode-changed",c=>{c.inspect_mode?(f(),l.push(c.pid)):(l=l.filter(u=>u!==c.pid),l.length===0&&v())});let s=c=>{let u=G(c.target);if(!u)return;let b=F(u);if(b.val===r)return;let y=u.type=="LiveComponent"?u.element.dataset.phxComponent:u.element.id;t.push("request-node-element",{root_socket_id:o,socket_id:u.phxId,type:u.type,id:y}),r=b.val,xe({attr:b.attr,val:b.val,type:u.type})},g=c=>{c.preventDefault(),c.stopPropagation();let u=G(c.target);if(!u)return;let b=F(u);Ce({attr:b.attr,val:b.val,type:u.type});let y=ke(e,u);l.length===0?window.open(y,"_blank"):l.forEach(ie=>{t.push("element-inspected",{pid:ie,url:y})}),l=[],v()},m=c=>{c.preventDefault(),l.forEach(u=>{t.push("inspect-mode-changed",{inspect_mode:!1,pid:u})}),l=[],v()},d=c=>{c.key==="Escape"&&(l.forEach(u=>{t.push("inspect-mode-changed",{inspect_mode:!1,pid:u})}),l=[],v())},h=()=>{K(),r=null},v=()=>{i&&(i=!1,r=null,n&&n.classList.remove("live-debugger-inspect-mode"),K(),Le(),document.body.classList.remove("live-debugger-inspect-mode"),document.body.removeEventListener("click",g),document.body.removeEventListener("mouseover",s),document.removeEventListener("mouseleave",h),document.removeEventListener("contextmenu",m),document.removeEventListener("keydown",d))},f=()=>{i||(i=!0,n&&n.classList.add("live-debugger-inspect-mode"),document.body.classList.add("live-debugger-inspect-mode"),document.body.addEventListener("click",g),document.body.addEventListener("mouseover",s),document.body.addEventListener("mouseleave",h),document.addEventListener("contextmenu",m),document.addEventListener("keydown",d))};document.addEventListener("lvdbg:inspect-button-click",c=>{setTimeout(f)})}function xe(e){a("lvdbg:inspect-highlight",{detail:e})}function Ce(e){a("lvdbg:inspect-pulse",{detail:e})}function K(){a("lvdbg:inspect-clear")}function Ee(e){a("lvdbg:show-tooltip",{detail:e})}function Le(){a("lvdbg:remove-tooltip")}function G(e){let t=e.closest("[data-phx-session]"),o=e.closest("[data-phx-component]");if(!t)return null;let n=t.getAttribute("data-phx-root-id");return o&&t.contains(o)?{element:o,type:"LiveComponent",phxRootId:n,phxId:t.id}:{element:t,type:"LiveView",phxRootId:n,phxId:t.id}}function ke(e,{element:t,type:o,phxRootId:n,phxId:i}){let r=new URL(`${e}/redirect/${i}`);return n!==i&&r.searchParams.set("root_id",n),o==="LiveComponent"&&r.searchParams.set("node_id",t.dataset.phxComponent),r.searchParams.set("from","inspect_button"),r}function F({type:e,element:t,phxId:o}){return e==="LiveComponent"?{attr:"data-phx-id",val:`c${t.dataset.phxComponent}-${o}`}:{attr:"id",val:t.id}}var J=`
+ `;throw new Error(t)}}function z(e){return e.getAttribute("url")}function j(e){return e.hasAttribute("debug-button")}function k(e,t,o,n){let i=E(),r=L({liveDebuggerURL:t,debugChannel:o}),l=!1,s=()=>{l=!0,setTimeout(()=>{l=!1},0)};i.addEventListener("click",s,!0),r.addEventListener("click",s,!0);let g=()=>{n.appendChild(i),n.appendChild(r)},m=()=>{i.remove(),r.remove()};return j(e)&&g(),o.on("toggle-debug-button",({enabled:d})=>{d?g():m()}),document.addEventListener("click",d=>{let h=d.composedPath?.()??[d.target],v=h.includes(i)||h.includes(r)||h.some(f=>f?.getRootNode?.()===n);l||v||a("lvdbg:click-outside-debug-menu")}),{debugButton:i,debugMenu:r}}var x="live-debugger-highlight-element",pe="live-debugger-highlight-pulse-element",Z=["#ffe78080","#ffe78060","#ffe78030","#ffe78000"],ge=["#87CCE880","#87CCE860","#87CCE830","#87CCE800"],he=["#8bca8480"];function C(e){if(!e)return null;let t=e.getBoundingClientRect();if(t.width!==0||t.height!==0)return t;let o=[...e.children].map(s=>C(s)).filter(Boolean);if(o.length===0)return null;let n=Math.min(...o.map(s=>s.top)),i=Math.min(...o.map(s=>s.left)),r=Math.max(...o.map(s=>s.right)),l=Math.max(...o.map(s=>s.bottom));return{top:n,left:i,right:r,bottom:l,width:r-i,height:l-n}}function X(e){switch(e){case"LiveComponent":return ge;case"LiveView":return Z;case"StreamItem":return he;default:return Z}}function Y(e,t,o){let n=document.createElement("div");return n.id=o,n.dataset.attr=t.attr,n.dataset.val=t.val,n.style.position="absolute",n.style.top=`${e.top+window.scrollY}px`,n.style.left=`${e.left+window.scrollX}px`,n.style.width=`${e.width}px`,n.style.height=`${e.height}px`,n.style.backgroundColor=X(t.type)[0],n.style.zIndex="10000",n.style.pointerEvents="none",n}function M(e){e.querySelector(`#${x}`)?.remove(),a("lvdbg:remove-tooltip")}function W({detail:e},t){let o=t.querySelector(`#${x}`);if(o){o.remove(),a("lvdbg:remove-tooltip");let r=e.attr===void 0||e.val===void 0,l=o.dataset.val===e.val;if(r||l)return}let n=document.querySelector(`[${e.attr}="${e.val}"]`);if(!n)return;let i=C(n);i&&(o=Y(i,e,x),t.appendChild(o),ve(e))}function me(e){let t=e.querySelector(`#${x}`);if(!t)return;let o=document.querySelector(`[${t.dataset.attr}="${t.dataset.val}"]`);if(!o){M(e);return}let n=C(o);if(!n){M(e);return}t.style.top=`${n.top+window.scrollY}px`,t.style.left=`${n.left+window.scrollX}px`,t.style.width=`${n.width}px`,t.style.height=`${n.height}px`}function N({detail:e},t){let o=document.querySelector(`[${e.attr}="${e.val}"]`);if(!o)return;let n=C(o);if(!n)return;let i=Y(n,e,pe);t.appendChild(i);let r=i.offsetWidth,l=i.offsetHeight,s=X(e.type);i.animate([{width:`${r}px`,height:`${l}px`,transform:"translate(0, 0)",backgroundColor:s[1]},{width:`${r+20}px`,height:`${l+20}px`,transform:"translate(-10px, -10px)",backgroundColor:s[2]},{width:`${r+40}px`,height:`${l+40}px`,transform:"translate(-20px, -20px)",backgroundColor:s[3]}],{duration:500,iterations:1,delay:200}).onfinish=()=>i.remove()}function ve(e){if(!["module","type","id_key","id_value"].every(i=>e.hasOwnProperty(i)))return;let n={detail:{module:e.module,type:e.type,id_key:e.id_key,id_value:e.id_value}};a("lvdbg:show-tooltip",n)}function I(e,t){document.addEventListener("lvdbg:inspect-highlight",o=>W(o,t)),document.addEventListener("lvdbg:inspect-pulse",o=>N(o,t)),document.addEventListener("lvdbg:inspect-clear",()=>M(t)),e.on("highlight",o=>W({detail:o},t)),e.on("pulse",o=>N({detail:o},t)),window.addEventListener("resize",()=>me(t))}var p=[];for(let e=0;e<256;++e)p.push((e+256).toString(16).slice(1));function K(e,t=0){return(p[e[t+0]]+p[e[t+1]]+p[e[t+2]]+p[e[t+3]]+"-"+p[e[t+4]]+p[e[t+5]]+"-"+p[e[t+6]]+p[e[t+7]]+"-"+p[e[t+8]]+p[e[t+9]]+"-"+p[e[t+10]]+p[e[t+11]]+p[e[t+12]]+p[e[t+13]]+p[e[t+14]]+p[e[t+15]]).toLowerCase()}var D,fe=new Uint8Array(16);function S(){if(!D){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");D=crypto.getRandomValues.bind(crypto)}return D(fe)}var be=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$={randomUUID:be};function we(e,t,o){if($.randomUUID&&!t&&!e)return $.randomUUID();e=e||{};let n=e.random??e.rng?.()??S();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(o=o||0,o<0||o+16>t.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[o+i]=n[i];return t}return K(n)}var q=we;function T(e,t){let o=ye();e.push("window-initialized",{window_id:o,socket_id:t})}function ye(){let e=window.name;if(e)return e;let t=q();return window.name=t,t}function H(e,t,o){let n=e.replace(/^http/,"ws")+"/client",i=new window.Phoenix.Socket(n,{params:{socketID:t,rootSocketIDs:o}});i.connect();let r=i.channel(`client:${t}`);return r.join().receive("ok",()=>{T(r,t),console.log("LiveDebugger debug connection established!")}).receive("error",l=>{console.error(`LiveDebugger was unable to establish websocket debug connection! Browser features will not work:
+`,l)}),{debugSocket:i,debugChannel:r}}function B({baseURL:e,debugChannel:t,socketID:o,debugButton:n}){let i=!1,r=null,l=[];t.on("found-node-element",c=>{Ee({module:c.module,type:c.type,id_key:c.id_key,id_value:c.id_value})}),t.on("inspect-mode-changed",c=>{c.inspect_mode?(f(),l.push(c.pid)):(l=l.filter(u=>u!==c.pid),l.length===0&&v())});let s=c=>{let u=F(c.target);if(!u)return;let b=J(u);if(b.val===r)return;let y=u.type=="LiveComponent"?u.element.dataset.phxComponent:u.element.id;t.push("request-node-element",{root_socket_id:o,socket_id:u.phxId,type:u.type,id:y}),r=b.val,xe({attr:b.attr,val:b.val,type:u.type})},g=c=>{c.preventDefault(),c.stopPropagation();let u=F(c.target);if(!u)return;let b=J(u);Ce({attr:b.attr,val:b.val,type:u.type});let y=ke(e,u);l.length===0?window.open(y,"_blank"):l.forEach(re=>{t.push("element-inspected",{pid:re,url:y})}),l=[],v()},m=c=>{c.preventDefault(),l.forEach(u=>{t.push("inspect-mode-changed",{inspect_mode:!1,pid:u})}),l=[],v()},d=c=>{c.key==="Escape"&&(l.forEach(u=>{t.push("inspect-mode-changed",{inspect_mode:!1,pid:u})}),l=[],v())},h=()=>{G(),r=null},v=()=>{i&&(i=!1,r=null,n&&n.classList.remove("live-debugger-inspect-mode"),G(),Le(),document.body.classList.remove("live-debugger-inspect-mode"),document.body.removeEventListener("click",g),document.body.removeEventListener("mouseover",s),document.removeEventListener("mouseleave",h),document.removeEventListener("contextmenu",m),document.removeEventListener("keydown",d))},f=()=>{i||(i=!0,n&&n.classList.add("live-debugger-inspect-mode"),document.body.classList.add("live-debugger-inspect-mode"),document.body.addEventListener("click",g),document.body.addEventListener("mouseover",s),document.body.addEventListener("mouseleave",h),document.addEventListener("contextmenu",m),document.addEventListener("keydown",d))};document.addEventListener("lvdbg:inspect-button-click",c=>{setTimeout(f)})}function xe(e){a("lvdbg:inspect-highlight",{detail:e})}function Ce(e){a("lvdbg:inspect-pulse",{detail:e})}function G(){a("lvdbg:inspect-clear")}function Ee(e){a("lvdbg:show-tooltip",{detail:e})}function Le(){a("lvdbg:remove-tooltip")}function F(e){let t=e.closest("[data-phx-session]"),o=e.closest("[data-phx-component]");if(!t)return null;let n=t.getAttribute("data-phx-root-id");return o&&t.contains(o)?{element:o,type:"LiveComponent",phxRootId:n,phxId:t.id}:{element:t,type:"LiveView",phxRootId:n,phxId:t.id}}function ke(e,{element:t,type:o,phxRootId:n,phxId:i}){let r=new URL(`${e}/redirect/${i}`);return n!==i&&r.searchParams.set("root_id",n),o==="LiveComponent"&&r.searchParams.set("node_id",t.dataset.phxComponent),r.searchParams.set("from","inspect_button"),r}function J({type:e,element:t,phxId:o}){return e==="LiveComponent"?{attr:"data-phx-id",val:`c${t.dataset.phxComponent}-${o}`}:{attr:"id",val:t.id}}var Q=`