@aevantec/litevue 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/litevue-devtools.iife.js +1 -1
- package/dist/litevue-devtools.mjs +1 -1
- package/dist/litevue-devtools.umd.js +1 -1
- package/dist/litevue-plugins.dev.iife.js +64 -41
- package/dist/litevue-plugins.dev.mjs +64 -40
- package/dist/litevue-plugins.iife.js +1 -1
- package/dist/litevue-plugins.mjs +1 -1
- package/dist/litevue-plugins.umd.js +1 -1
- package/dist/litevue.dev.iife.js +121 -39
- package/dist/litevue.dev.mjs +121 -38
- package/dist/litevue.iife.js +1 -1
- package/dist/litevue.mjs +1 -1
- package/dist/litevue.umd.js +1 -1
- package/dist/plugins/collapse.iife.js +1 -1
- package/dist/plugins/collapse.mjs +1 -1
- package/dist/plugins/collapse.umd.js +1 -1
- package/dist/plugins/focus.iife.js +1 -1
- package/dist/plugins/focus.mjs +1 -1
- package/dist/plugins/focus.umd.js +1 -1
- package/dist/plugins/intersect.iife.js +1 -1
- package/dist/plugins/intersect.umd.js +1 -1
- package/dist/plugins/mask.iife.js +1 -1
- package/dist/plugins/mask.mjs +1 -1
- package/dist/plugins/mask.umd.js +1 -1
- package/dist/plugins/media.dev.iife.js +3 -4
- package/dist/plugins/media.dev.mjs +3 -3
- package/dist/plugins/media.iife.js +1 -1
- package/dist/plugins/media.mjs +1 -1
- package/dist/plugins/media.umd.js +1 -1
- package/dist/plugins/morph.dev.iife.js +39 -19
- package/dist/plugins/morph.dev.mjs +39 -18
- package/dist/plugins/morph.iife.js +1 -1
- package/dist/plugins/morph.mjs +1 -1
- package/dist/plugins/morph.umd.js +1 -1
- package/dist/plugins/navigate.dev.iife.js +26 -19
- package/dist/plugins/navigate.dev.mjs +26 -18
- package/dist/plugins/navigate.iife.js +1 -1
- package/dist/plugins/navigate.mjs +1 -1
- package/dist/plugins/navigate.umd.js +1 -1
- package/dist/plugins/persist.dev.iife.js +2 -3
- package/dist/plugins/persist.dev.mjs +2 -2
- package/dist/plugins/persist.iife.js +1 -1
- package/dist/plugins/persist.mjs +1 -1
- package/dist/plugins/persist.umd.js +1 -1
- package/dist/plugins/popover.iife.js +1 -1
- package/dist/plugins/popover.mjs +1 -1
- package/dist/plugins/popover.umd.js +1 -1
- package/dist/plugins/resize.iife.js +1 -1
- package/dist/plugins/resize.umd.js +1 -1
- package/dist/plugins/transition.iife.js +1 -1
- package/dist/plugins/transition.mjs +1 -1
- package/dist/plugins/transition.umd.js +1 -1
- package/dist/types/app.d.mts +3 -1
- package/dist/types/app.d.ts +3 -1
- package/dist/types/context.d.mts +1 -1
- package/dist/types/context.d.ts +1 -1
- package/dist/types/devtools-panel/chrome.d.mts +6 -5
- package/dist/types/devtools-panel/chrome.d.ts +6 -5
- package/dist/types/devtools-panel/menu.d.mts +12 -0
- package/dist/types/devtools-panel/menu.d.ts +12 -0
- package/dist/types/devtools-panel/styles.d.mts +5 -2
- package/dist/types/devtools-panel/styles.d.ts +5 -2
- package/dist/types/devtools-panel/values.d.mts +11 -5
- package/dist/types/devtools-panel/values.d.ts +11 -5
- package/dist/types/directives/show.d.mts +1 -0
- package/dist/types/directives/show.d.ts +1 -0
- package/dist/types/errors.d.mts +1 -1
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/store.d.mts +5 -1
- package/dist/types/store.d.ts +5 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
var LiteVueDevtoolsPanel=function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n,t,o,r,i,l,a,d,s,p,c,h,g=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",u="litevue-devtools-theme",f="litevue-devtools-ui",v=()=>{try{return JSON.parse(localStorage.getItem(f)||"{}")}catch{return{}}},b=e=>{try{localStorage.setItem(f,JSON.stringify({...v(),...e}))}catch{}},m={dark:g('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:g('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:g('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},x={float:g('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},y={float:"bottom",bottom:"right",right:"float"},w={float:"floating",bottom:"docked to bottom",right:"docked to right"},k={dark:"light",light:"system",system:"dark"},C=(e,n,t)=>Math.min(Math.max(e,n),Math.max(n,t)),L=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},E=(e,n)=>{const t=new Set,o=(e,r,i)=>{if(null!=e){if("object"==typeof e){if(i>4||t.has(e))return;t.add(e);const l=!Array.isArray(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let a;try{a=e[t]}catch{continue}if("function"==typeof a)continue;const d=r?`${r}.${t}`:t;if(l&&t.toLowerCase().includes(n))return d;const s=o(a,d,i+1);if(s)return s}return}return String(e).toLowerCase().includes(n)?r:void 0}};return o(e,"",0)},S=e=>e instanceof Map||e instanceof Set,O=e=>{let n="";const t=e=>{if(S(e))n+=`${e.constructor.name}(${e.size})`;else if(!e||"object"!=typeof e||e.toJSON)n+=JSON.stringify(e)??String(e);else{const o=Array.isArray(e);n+=o?"[":"{";let r=0;for(const i of o?e.keys():Object.keys(e)){if(n.length>60)break;const l=e[i],a=void 0===l||"function"==typeof l;a&&!o||(r++&&(n+=","),o||(n+=JSON.stringify(i)+":"),a?n+="null":t(l))}n+=o?"]":"}"}};try{t(e)}catch{n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},$=(e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}},M=e=>[...e.directives.map(e=>"v-"+e),...e.magics].join(" "),_=null,j=null,z=!1,N="",I="Elements",H="float",P="",T="",A="",D="",V="",W="",J=()=>{},R=(()=>{try{const e=localStorage.getItem(u);if("light"===e||"system"===e)return e}catch{}return"dark"})(),X=matchMedia("(prefers-color-scheme: light)"),Y=()=>{const e="light"===R||"system"===R&&X.matches;t.host.classList.toggle("light",e),d.innerHTML=m[R],d.title="theme: "+R},B=new Set,F=new WeakSet,U=()=>{if("float"!==H)return;const e=parseInt(o.style.right)||0,n=parseInt(o.style.bottom)||0;A=o.style.right=C(e,0,window.innerWidth-o.offsetWidth)+"px",D=o.style.bottom=C(n,0,window.innerHeight-o.offsetHeight)+"px"},q=e=>{"float"===H?(P=o.style.width||P,T=o.style.height||T,A=o.style.right||A,D=o.style.bottom||D):"bottom"===H?V=o.style.height||V:W=o.style.width||W,H=e;const n="float"!==e;o.classList.toggle("dock-bottom","bottom"===e),o.classList.toggle("dock-right","right"===e),o.style.right=n?"":A,o.style.bottom=n?"":D,o.style.width="bottom"===e?"":"right"===e?W:P,o.style.height="right"===e?"":"bottom"===e?V:T,p.innerHTML=x[e],p.title="panel: "+w[e]},G=e=>{const n=L("span","label");return n.appendChild(L("span","punct","<")),n.appendChild(L("span","name",re(e))),n.appendChild(L("span","punct",">")),n},Z=e=>{let t=e.parentElement;for(;t;){if(n.scopes.has(t))return t;t=t.parentElement}return null},K=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},Q=()=>{s.style.display="none"},ee=e=>{e!==_&&B.clear(),j=null,_=e,I="Elements",window.$scope=e?n.scopes.get(e):void 0,ie(),le()},ne=e=>{e!==j&&B.clear(),_=null,j=e,I="Stores",window.$scope=n.stores.get(e),ie(),le()},te=e=>{I=e,ie()},oe=/^\s*([A-Za-z_$][\w$]*)\s*\(/,re=e=>n.names.get(e)||(e=>{const t=oe.exec(n.exps.get(e)||"")?.[1];return t&&n.components?.has(t)?t:void 0})(e)||e.getAttribute("id")||e.localName,ie=()=>{if((()=>{const e=n.stores?n.stores.size:0;c.textContent=`Elements (${n.scopes.size})`,c.className="Elements"===I?"tab active":"tab",h.textContent=`Stores (${e})`,h.className="Stores"===I?"tab active":"tab"})(),J(),i.textContent="","Elements"===I){const e=[...n.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=new Map;for(const i of e)if(!N||re(i).toLowerCase().includes(N))t.set(i,void 0);else{const e=E(n.scopes.get(i),N);e&&t.set(i,e)}if(!t.size)return void i.appendChild(L("div","empty",N?"no matching scopes":"no scopes mounted"));const o=new Set;for(const n of t.keys()){o.add(n);for(let e=Z(n);e;e=Z(e))o.add(e)}const r=new Map,l=new Map,a=new Map;for(const n of e){if(!o.has(n))continue;const e=Z(n);r.set(n,e),a.set(n,e?(a.get(e)??0)+1:0),e&&l.set(e,(l.get(e)||0)+1)}const d=e=>{for(let n=r.get(e);n;n=r.get(n)??null)if(F.has(n))return!0;return!1};for(const s of e){if(!o.has(s)||d(s))continue;const e=L("div",s===_?"row sel":"row");e.style.paddingLeft=8+12*(a.get(s)??0)+"px";const r=F.has(s);if(l.get(s)){const n=L("span",r?"arrow":"arrow open","\u25b6");n.onclick=e=>{e.stopPropagation(),r?F.delete(s):F.add(s),ie()},e.appendChild(n)}else e.appendChild(L("span","spacer"));e.appendChild(G(s));const p=n.exps.get(s);p&&e.appendChild(L("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(L("span","hit"," "+c)),e.onclick=()=>ee(s),e.onmouseenter=()=>K(s),e.onmouseleave=Q,i.appendChild(e)}return}const e=new Map;for(const o of n.stores?n.stores.keys():[])if(!N||o.toLowerCase().includes(N))e.set(o,void 0);else{const t=E(n.stores.get(o),N);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=L("div",n===j?"row sel":"row"),o=L("span","label");o.appendChild(L("span","punct","$store.")),o.appendChild(L("span","name",n)),t.appendChild(o);const r=e.get(n);r&&t.appendChild(L("span","hit"," "+r)),t.onclick=()=>ne(n),i.appendChild(t)}else i.appendChild(L("div","empty",N?"no matching stores":"no stores registered"))},le=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=j?n.stores.get(j):_?n.scopes.get(_):void 0;if(!e)return void l.appendChild(L("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof $(e,n)?.value,t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>de(n,e,n,0,"prop",[])),r.length&&(l.appendChild(L("div","divider","inherited")),r.forEach(n=>de(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(L("div","empty","empty scope")),l.appendChild(ae(e))},ae=e=>{const n=L("div","prop adder");n.appendChild(L("span","spacer"));const t=L("input","val key-in");t.placeholder="key";const o=L("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),ue(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},de=(e,n,t,o,r,i,a)=>{let d,s;try{d=n[e]}catch{s=1}const p=L("div",r);p.style.paddingLeft=8+14*o+"px";const c=$(n,e);if(a||=(e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(c),null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,c=!s&&B.has(t);if(p.appendChild(L("span",c?"arrow open":"arrow","\u25b6")),p.appendChild(L("span","key",e)),p.appendChild(L("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${O(e)}`:O(e))(d))),s||(p.classList.add("toggle"),p.onclick=()=>{c?B.delete(t):B.add(t),le()}),se(p,n,e,o,r),l.appendChild(p),c){const e=S(d),n=e?d instanceof Map?Object.fromEntries(d):[...d]:d,s=Object.keys(n);if(!s.length){const e=L("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const l of s)de(l,n,t+"."+l,o+1,r,i.concat([d]),a||e)}return}if(p.appendChild(L("span","spacer")),p.appendChild(L("span","key",e)),"function"==typeof d)p.appendChild(L("span","preview","\u0192"));else if(s||a)p.appendChild(L("span","preview",s?"(threw)":O(d)));else if("boolean"==typeof d){p.appendChild(L("span","bool",String(d)));const t=L("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),ue()},p.appendChild(t)}else{const t=L("input","val");t.value=O(d),t.onfocus=()=>{t.value=String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=String(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);t.value!==String(d)&&o!==d?(n[e]=o,ue()):t.value=O(d)},p.appendChild(t)}se(p,n,e,o,r),l.appendChild(p)},se=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const a=L("button","del","\u2715");a.title=`delete "${o}"`,a.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],ue()},e.appendChild(a)},pe=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),he();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&ee(r)},ce=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?K(o):Q()}},he=()=>{z=!1,a.classList.remove("active"),Q(),document.removeEventListener("click",pe,!0),document.removeEventListener("mousemove",ce,!0)},ge=!1,ue=()=>{ge||(ge=!0,setTimeout(()=>{ge=!1,"none"!==o.style.display&&(ie(),le())}))},fe=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const f=document.createElement("style");f.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(f),s=L("div","highlight"),t.appendChild(s),(r=L("div","pill","\u26a1 LiteVue")).onclick=()=>{r.style.display="none",o.style.display="flex",U(),b({open:!0}),ue()},t.appendChild(r),(o=L("div","panel")).style.display="none";const m=L("div","header");m.appendChild(L("span","title","\u26a1 LiteVue")),m.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;if("float"!==H)return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,a=e=>{o.style.right=C(t-(e.clientX-i),0,window.innerWidth-o.offsetWidth)+"px",o.style.bottom=C(r-(e.clientY-l),0,window.innerHeight-o.offsetHeight)+"px"},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),b({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const x=L("div","grip");x.addEventListener("mousedown",e=>{e.preventDefault(),x.classList.add("active");const n=o.getBoundingClientRect(),t=e.clientX,r=e.clientY,i=n.width,l=n.height,a=e=>{if("right"!==H){const n="bottom"===H?r-e.clientY:e.clientY-r;o.style.height=C(l+n,320,window.innerHeight-24)+"px"}if("bottom"!==H){const n="right"===H?t-e.clientX:e.clientX-t;o.style.width=C(i+n,320,window.innerWidth-24)+"px"}},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),x.classList.remove("active");const e=parseInt(o.style.width),n=parseInt(o.style.height);b("float"===H?{w:e,h:n}:"bottom"===H?{bh:n}:{rw:e})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const w=(e=>{let n=!1;const t=L("button","btn");t.innerHTML=g('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=L("div","plugins");o.hidden=!0;const r=()=>{const r=e.plugins||[];if(t.title=`plugins (${r.length})`,n)if(o.textContent="",r.length)for(const e of r){const n=L("div","plugin");n.appendChild(L("span","name",e.name)),n.appendChild(L("span","gave",M(e)||"nothing registered")),e.teardown||n.appendChild(L("span","flag","no teardown")),o.appendChild(n)}else o.appendChild(L("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{n=!n;for(const e of o.parentElement.children)e.hidden=e===o?!n:n;t.classList.toggle("active",n),r()},{btn:t,el:o,render:r}})(n);J=w.render,m.appendChild(w.btn),(p=L("button","btn")).onclick=()=>{q(y[H]),b({dock:H})},m.appendChild(p),(d=L("button","btn")).onclick=()=>{(e=>{try{localStorage.setItem(u,e)}catch{}})(R=k[R]),Y()},m.appendChild(d),X.addEventListener("change",()=>{"system"===R&&Y()}),Y(),(a=L("button","btn")).title="pick an element on the page",a.innerHTML=g('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),a.onclick=()=>z?he():(z=!0,a.classList.add("active"),document.addEventListener("click",pe,!0),void document.addEventListener("mousemove",ce,!0)),m.appendChild(a);const E=L("button","btn","\u2715");E.onclick=()=>{z&&he(),o.style.display="none",r.style.display="",b({open:!1})},m.appendChild(E),o.appendChild(m);const S=L("div","body"),O=L("div","side"),$=L("div","tabs");(c=L("div","tab active")).onclick=()=>te("Elements"),(h=L("div","tab")).onclick=()=>te("Stores"),$.appendChild(c),$.appendChild(h),O.appendChild($);const j=L("input","filter");j.placeholder="Filter by name or state",j.oninput=()=>{N=j.value.trim().toLowerCase(),ie()},j.onkeydown=e=>{"Escape"===e.key&&(j.value="",N="",ie())},O.appendChild(j),i=L("div","tree"),O.appendChild(i),l=L("div","state"),S.appendChild(O),S.appendChild(l),S.appendChild(w.el),o.appendChild(S),o.appendChild(x),t.appendChild(o);const I=v();I.w&&(P=o.style.width=I.w+"px"),I.h&&(T=o.style.height=I.h+"px"),null!=I.right&&(A=o.style.right=I.right+"px"),null!=I.bottom&&(D=o.style.bottom=I.bottom+"px"),I.bh&&(V=I.bh+"px"),I.rw&&(W=I.rw+"px"),q(I.dock||"float"),document.body.appendChild(e),I.open&&(r.style.display="none",o.style.display="flex",U(),ue()),n.on("scope:mount",ue),n.on("scope:unmount",e=>{e===_&&(_=window.$scope=null),ue()}),n.stores&&n.on("store:register",ue),n.plugins&&n.on("plugin:install",ue),n.on("flush",ue)},ve=!1,be=()=>{if(ve)return;const e=window.__LITE_VUE__;e?(ve=!0,n=e,document.body?fe():addEventListener("DOMContentLoaded",fe)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};return be(),e.init=be,e}({});
|
|
1
|
+
var LiteVueDevtoolsPanel=function(e){var n,t,o,r,i,l,a,d,s,p,c,h,u,g=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",f="litevue-devtools-theme",v="litevue-devtools-ui",b=()=>{try{return JSON.parse(localStorage.getItem(v)||"{}")}catch{return{}}},m=e=>{try{localStorage.setItem(v,JSON.stringify({...b(),...e}))}catch{}},x={dark:g('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:g('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:g('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},y={float:g('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),left:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="3" width="8" height="18" fill="currentColor"/>'),right:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},w=[{value:"float",label:"Floating",icon:y.float},{value:"left",label:"Dock to left",icon:y.left},{value:"bottom",label:"Dock to bottom",icon:y.bottom},{value:"right",label:"Dock to right",icon:y.right}],k=[{value:"dark",label:"Dark",icon:x.dark},{value:"light",label:"Light",icon:x.light},{value:"system",label:"System",icon:x.system}],C=(e,n,t)=>Math.min(Math.max(e,n),Math.max(n,t)),L=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},E=(e,n)=>{const t=new Set,o=(e,r,i)=>{if(null!=e){if("object"==typeof e){if(i>4||t.has(e)||ArrayBuffer.isView(e))return;t.add(e),O(e)&&(e=[...e]);const l=!Array.isArray(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let a;try{a=e[t]}catch{continue}if("function"==typeof a)continue;const d=r?`${r}.${t}`:t;if(l&&t.toLowerCase().includes(n))return d;const s=o(a,d,i+1);if(s)return s}return}return String(e).toLowerCase().includes(n)?r:void 0}};return o(e,"",0)},O=e=>e instanceof Map||e instanceof Set,S=e=>{let n="";const t=e=>{if(O(e))n+=`${e.constructor.name}(${e.size})`;else if(!e||"object"!=typeof e||e.toJSON)n+="object"==typeof e||"string"==typeof e?JSON.stringify(e):String(e);else{const o=Array.isArray(e)||ArrayBuffer.isView(e);n+=o?"[":"{";let r=0;for(const i of o?[].keys.call(e):Object.keys(e)){if(n.length>60)break;let l;try{l=e[i]}catch{}const a=void 0===l||"function"==typeof l;a&&!o||(r++&&(n+=","),o||(n+=JSON.stringify(i)+":"),a?n+="null":t(l))}n+=o?"]":"}"}};try{t(e)}catch{n+="\u2026"}return n.length>60?n.slice(0,60)+"\u2026":n},M=(e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}},$=e=>[...e.directives.map(e=>"v-"+e),...e.magics].join(" "),A=(e,t,o)=>{let r;const i=L("div","menu-wrap"),l=L("button","btn");l.setAttribute("aria-haspopup","menu"),l.setAttribute("aria-expanded","false");const a=L("div","menu");a.setAttribute("role","menu"),a.hidden=!0;const d=t.map(e=>{const n=L("button","item");return n.setAttribute("role","menuitemradio"),n.innerHTML=e.icon,n.appendChild(L("span","",e.label)),n.onclick=()=>{p(!0),e.value!==r&&(c(e.value),o(e.value))},a.appendChild(n),n}),s=e=>{e.composedPath().includes(i)||p()},p=e=>{a.hidden||(a.hidden=!0,l.setAttribute("aria-expanded","false"),document.removeEventListener("mousedown",s,!0),n=void 0,e&&l.focus())};l.onclick=()=>a.hidden?(n?.(),a.hidden=!1,l.setAttribute("aria-expanded","true"),document.addEventListener("mousedown",s,!0),n=p,void(d.find(e=>"true"===e.getAttribute("aria-checked"))||d[0]).focus()):p(),a.onkeydown=e=>{const n=d.indexOf(e.target),t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0;t?(e.preventDefault(),d[(n+t+d.length)%d.length].focus()):"Escape"===e.key?p(!0):"Tab"===e.key&&p()};const c=n=>{r=n;const o=t.findIndex(e=>e.value===n);l.innerHTML=t[o].icon+'<svg width="7" height="7" viewBox="0 0 10 10" fill="currentColor"><path d="M1 3h8L5 8z"/></svg>',l.title=`${e}: ${t[o].label.toLowerCase()}`,d.forEach((e,n)=>e.setAttribute("aria-checked",String(n===o)))};return i.appendChild(l),i.appendChild(a),{el:i,set:c}},_=null,z=null,I=!1,N="",j="Elements",D="float",H="",P="",T="",V="",W="",B="",J="",R=()=>{},X=(()=>{try{const e=localStorage.getItem(f);if("light"===e||"system"===e)return e}catch{}return"dark"})(),Y=matchMedia("(prefers-color-scheme: light)"),F=()=>{const e="light"===X||"system"===X&&Y.matches;o.host.classList.toggle("light",e),s.set(X)},U=new Set,q=new WeakSet,G=()=>{if("float"!==D)return;const e=parseInt(r.style.right)||0,n=parseInt(r.style.bottom)||0;T=r.style.right=C(e,0,window.innerWidth-r.offsetWidth)+"px",V=r.style.bottom=C(n,0,window.innerHeight-r.offsetHeight)+"px"},Z=e=>{"float"===D?(H=r.style.width||H,P=r.style.height||P,T=r.style.right||T,V=r.style.bottom||V):"bottom"===D?W=r.style.height||W:"left"===D?B=r.style.width||B:J=r.style.width||J,D=e;const n="float"!==e;for(const t of["left","bottom","right"])r.classList.toggle("dock-"+t,e===t);r.style.right=n?"":T,r.style.bottom=n?"":V,r.style.width="bottom"===e?"":"left"===e?B:"right"===e?J:H,r.style.height="bottom"===e?W:"float"===e?P:"",c.set(e)},K=e=>{const n=L("span","label");return n.appendChild(L("span","punct","<")),n.appendChild(L("span","name",de(e))),n.appendChild(L("span","punct",">")),n},Q=Object.getOwnPropertyDescriptor(Node.prototype,"parentElement").get,ee=e=>e.__marker?.parentElement||Q.call(e),ne=e=>{let n=ee(e);for(;n;){if(t.scopes.has(n))return n;n=ee(n)}return null},te=e=>{const n=e.getBoundingClientRect();p.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},oe=()=>{p.style.display="none"},re=e=>{e!==_&&U.clear(),z=null,_=e,j="Elements",window.$scope=e?t.scopes.get(e):void 0,se(),pe()},ie=e=>{e!==z&&U.clear(),_=null,z=e,j="Stores",window.$scope=t.stores.get(e),se(),pe()},le=e=>{j=e,se()},ae=/^\s*([A-Za-z_$][\w$]*)\s*\(/,de=e=>t.names.get(e)||(e=>{const n=ae.exec(t.exps.get(e)||"")?.[1];return n&&t.components?.has(n)?n:void 0})(e)||Element.prototype.getAttribute.call(e,"id")||(e instanceof HTMLFormElement?"form":e.localName),se=()=>{if((()=>{const e=t.stores?t.stores.size:0;h.textContent=`Elements (${t.scopes.size})`,h.className="Elements"===j?"tab active":"tab",u.textContent=`Stores (${e})`,u.className="Stores"===j?"tab active":"tab"})(),R(),l.textContent="","Elements"===j){const e=[...t.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),n=new Map;for(const l of e)if(!N||de(l).toLowerCase().includes(N))n.set(l,void 0);else{const e=E(t.scopes.get(l),N);e&&n.set(l,e)}if(!n.size)return void l.appendChild(L("div","empty",N?"no matching scopes":"no scopes mounted"));const o=new Set;for(const t of n.keys()){o.add(t);for(let e=ne(t);e;e=ne(e))o.add(e)}const r=new Map,i=new Map,a=new Map;for(const t of e){if(!o.has(t))continue;const e=ne(t);r.set(t,e),a.set(t,e?(a.get(e)??0)+1:0),e&&i.set(e,(i.get(e)||0)+1)}const d=e=>{for(let n=r.get(e);n;n=r.get(n)??null)if(q.has(n))return!0;return!1};for(const s of e){if(!o.has(s)||d(s))continue;const e=L("div",s===_?"row sel":"row");e.style.paddingLeft=8+12*(a.get(s)??0)+"px";const r=q.has(s);if(i.get(s)){const n=L("span",r?"arrow":"arrow open","\u25b6");n.onclick=e=>{e.stopPropagation(),r?q.delete(s):q.add(s),se()},e.appendChild(n)}else e.appendChild(L("span","spacer"));e.appendChild(K(s));const p=t.exps.get(s);p&&e.appendChild(L("span","exp"," "+p));const c=n.get(s);c&&e.appendChild(L("span","hit"," "+c)),e.onclick=()=>re(s),e.onmouseenter=()=>te(s),e.onmouseleave=oe,l.appendChild(e)}return}const e=new Map;for(const o of t.stores?t.stores.keys():[])if(!N||o.toLowerCase().includes(N))e.set(o,void 0);else{const n=E(t.stores.get(o),N);n&&e.set(o,n)}const n=[...e.keys()];if(n.length)for(const t of n){const n=L("div",t===z?"row sel":"row"),o=L("span","label");o.appendChild(L("span","punct","$store.")),o.appendChild(L("span","name",t)),n.appendChild(o);const r=e.get(t);r&&n.appendChild(L("span","hit"," "+r)),n.onclick=()=>ie(t),l.appendChild(n)}else l.appendChild(L("div","empty",N?"no matching stores":"no stores registered"))},pe=()=>{if(a.contains(o.activeElement))return;a.textContent="";const e=z?t.stores.get(z):_?t.scopes.get(_):void 0;if(!e)return void a.appendChild(L("div","empty","Select a scope"));const{own:n,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof M(e,n)?.value,t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);n.forEach(n=>he(n,e,n,0,"prop",[])),r.length&&(a.appendChild(L("div","divider","inherited")),r.forEach(n=>he(n,e,n,0,"prop inherited",[]))),n.length||r.length||a.appendChild(L("div","empty","empty scope")),a.appendChild(ce(e))},ce=e=>{const n=L("div","prop adder");n.appendChild(L("span","spacer"));const t=L("input","val key-in");t.placeholder="key";const o=L("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:r.trim()&&!isNaN(+r)&&(i=+r),e[n]=i,t.blur(),o.blur(),me(),setTimeout(()=>{const e=a.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},he=(e,n,t,o,r,i,l,d=e)=>{let s,p;try{s=n[e]}catch{p=1}const c=L("div",r);c.style.paddingLeft=8+14*o+"px";const h=M(n,e);if(l||=(e=>{if(!e)return!1;if(e.get&&!e.set||!1===e.writable)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(h),null!==s&&"object"==typeof s){const p=i.indexOf(s)>-1,h=!p&&U.has(t);if(c.appendChild(L("span",h?"arrow open":"arrow","\u25b6")),c.appendChild(L("span","key",d)),c.appendChild(L("span","preview",p?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${S(e)}`:S(e))(s))),p||(c.classList.add("toggle"),c.onclick=()=>{h?U.delete(t):U.add(t),pe()}),ue(c,n,e,o,r),a.appendChild(c),h){const e=O(s),n=e?[...s.values()]:s,d=s instanceof Map&&[...s.keys()].map(S),p=Object.keys(n);if(!p.length){const e=L("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",a.appendChild(e)}for(const a of p)he(a,n,t+"."+a,o+1,r,i.concat([s]),l||e,d?d[+a]:a)}return}if(c.appendChild(L("span","spacer")),c.appendChild(L("span","key",d)),"function"==typeof s)c.appendChild(L("span","preview","\u0192"));else if(p||l)c.appendChild(L("span","preview",p?"(threw)":S(s)));else if("boolean"==typeof s){c.appendChild(L("span","bool",String(s)));const t=L("input","check");t.type="checkbox",t.checked=s,t.onchange=()=>{n[e]=t.checked,t.blur(),me()},c.appendChild(t)}else{const t=L("input","val");t.value=S(s);let o="";t.onfocus=()=>{t.value=String(s),o=t.value},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=o,t.blur())},t.onblur=()=>{const r=((e,n)=>{if("bigint"==typeof n)try{return e.trim()?BigInt(e):n}catch{return n}if("number"==typeof n){const t=Number(e);return e.trim()&&!isNaN(t)?t:n}return e})(t.value,s);t.value!==o&&r!==s?(n[e]=r,me()):t.value=S(s)},c.appendChild(t)}ue(c,n,e,o,r),a.appendChild(c)},ue=(e,n,t,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,t);if(l&&l.get)return;const a=L("button","del","\u2715");a.title=`delete "${t}"`,a.onclick=e=>{e.stopPropagation();const r=o.activeElement;r&&r.blur&&r.blur(),delete n[t],me()},e.appendChild(a)},ge=e=>{const n=e.target;if(n===o.host)return;e.preventDefault(),e.stopPropagation(),ve();let r=n;for(;r&&!t.scopes.has(r);)r=ee(r);r&&re(r)},fe=e=>{let n=e.target;if(n!==o.host){for(;n&&!t.scopes.has(n);)n=ee(n);n?te(n):oe()}},ve=()=>{I=!1,d.classList.remove("active"),oe(),document.removeEventListener("click",ge,!0),document.removeEventListener("mousemove",fe,!0)},be=!1,me=()=>{be||(be=!0,setTimeout(()=>{if(be=!1,"none"!==r.style.display){if(r.matches(":active"))return me();se(),pe()}}))},xe=()=>{const e=document.createElement("div");o=e.attachShadow({mode:"open"});const n=document.createElement("style");n.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-left,\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-left {\n right: auto;\n left: 0;\n border-left: 0;\n border-right: 1px solid var(--border);\n}\n.panel.dock-left .header,\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-left .grip,\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-left .grip {\n left: auto;\n}\n.panel.dock-left .grip:hover,\n.panel.dock-left .grip.active,\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.btn svg + svg {\n margin-left: 4px;\n opacity: 0.7;\n}\n.menu-wrap {\n position: relative;\n}\n.menu {\n position: absolute;\n top: calc(100% + 4px);\n right: 0;\n z-index: 2;\n display: flex;\n flex-direction: column;\n min-width: 140px;\n padding: 3px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 4px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n cursor: default;\n}\n.item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: none;\n border: 0;\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n text-align: left;\n white-space: nowrap;\n cursor: pointer;\n}\n.item:hover,\n.item:focus-visible {\n background: var(--hover);\n outline: none;\n}\n.item[aria-checked='true'] {\n color: var(--accent);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",o.appendChild(n),p=L("div","highlight"),o.appendChild(p),(i=L("div","pill","\u26a1 LiteVue")).onclick=()=>{i.style.display="none",r.style.display="flex",G(),m({open:!0}),me()},o.appendChild(i),(r=L("div","panel")).style.display="none";const v=L("div","header");v.appendChild(L("span","title","\u26a1 LiteVue")),v.addEventListener("mousedown",e=>{if(e.target.closest(".btn, .menu"))return;if("float"!==D)return;e.preventDefault();const n=r.getBoundingClientRect(),t=window.innerWidth-n.right,o=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,a=e=>{r.style.right=C(t-(e.clientX-i),0,window.innerWidth-r.offsetWidth)+"px",r.style.bottom=C(o-(e.clientY-l),0,window.innerHeight-r.offsetHeight)+"px"},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),m({right:parseInt(r.style.right||"12"),bottom:parseInt(r.style.bottom||"12")})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const x=L("div","grip");x.addEventListener("mousedown",e=>{e.preventDefault(),x.classList.add("active");const n=r.getBoundingClientRect(),t=e.clientX,o=e.clientY,i=n.width,l=n.height,a=e=>{const a="bottom"===D?o-e.clientY:e.clientY-o,d="right"===D?t-e.clientX:e.clientX-t,s=C(l+a,320,window.innerHeight-24),p=C(i+d,320,window.innerWidth-24);"float"!==D&&"bottom"!==D||(r.style.height=s+"px"),"bottom"!==D&&(r.style.width=p+"px"),"float"===D&&(r.style.right=Math.max(0,innerWidth-n.left-p)+"px",r.style.bottom=Math.max(0,innerHeight-n.top-s)+"px")},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),x.classList.remove("active");const e=parseInt(r.style.width),n=parseInt(r.style.height);m("float"===D?{w:e,h:n,right:parseInt(r.style.right),bottom:parseInt(r.style.bottom)}:"bottom"===D?{bh:n}:"left"===D?{lw:e}:{rw:e})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const y=(e=>{let n=!1;const t=L("button","btn");t.innerHTML=g('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=L("div","plugins");o.hidden=!0;const r=()=>{const r=e.plugins||[];if(t.title=`plugins (${r.length})`,n)if(o.textContent="",r.length)for(const e of r){const n=L("div","plugin");n.appendChild(L("span","name",e.name)),n.appendChild(L("span","gave",$(e)||"nothing registered")),e.teardown||n.appendChild(L("span","flag","no teardown")),o.appendChild(n)}else o.appendChild(L("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{n=!n;for(const e of o.parentElement.children)e.hidden=e===o?!n:n;t.classList.toggle("active",n),r()},{btn:t,el:o,render:r}})(t);R=y.render,v.appendChild(y.btn),c=A("layout",w,e=>{Z(e),G(),m({dock:D})}),v.appendChild(c.el),s=A("theme",k,e=>{(e=>{try{localStorage.setItem(f,e)}catch{}})(X=e),F()}),v.appendChild(s.el),Y.addEventListener("change",()=>{"system"===X&&F()}),F(),(d=L("button","btn")).title="pick an element on the page",d.innerHTML=g('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>I?ve():(I=!0,d.classList.add("active"),document.addEventListener("click",ge,!0),void document.addEventListener("mousemove",fe,!0)),v.appendChild(d);const E=L("button","btn","\u2715");E.onclick=()=>{I&&ve(),r.style.display="none",i.style.display="",l.textContent=a.textContent="",m({open:!1})},v.appendChild(E),r.appendChild(v);const O=L("div","body"),S=L("div","side"),M=L("div","tabs");(h=L("div","tab active")).onclick=()=>le("Elements"),(u=L("div","tab")).onclick=()=>le("Stores"),M.appendChild(h),M.appendChild(u),S.appendChild(M);const z=L("input","filter");z.placeholder="Filter by name or state",z.oninput=()=>{N=z.value.trim().toLowerCase(),se()},z.onkeydown=e=>{"Escape"===e.key&&(z.value="",N="",se())},S.appendChild(z),l=L("div","tree"),S.appendChild(l),a=L("div","state"),O.appendChild(S),O.appendChild(a),O.appendChild(y.el),r.appendChild(O),r.appendChild(x),o.appendChild(r);const j=b();j.w&&(H=r.style.width=j.w+"px"),j.h&&(P=r.style.height=j.h+"px"),null!=j.right&&(T=r.style.right=j.right+"px"),null!=j.bottom&&(V=r.style.bottom=j.bottom+"px"),j.bh&&(W=j.bh+"px"),j.lw&&(B=j.lw+"px"),j.rw&&(J=j.rw+"px"),Z(w.some(e=>e.value===j.dock)?j.dock:"float"),document.body.appendChild(e),j.open&&(i.style.display="none",r.style.display="flex",G(),me()),t.on("scope:mount",me),t.on("scope:unmount",e=>{e===_&&(_=window.$scope=null),me()}),t.stores&&t.on("store:register",me),t.plugins&&t.on("plugin:install",me),t.on("flush",me)},ye=!1,we=()=>{if(ye)return;const e=window.__LITE_VUE__;e?(ye=!0,t=e,document.body?xe():addEventListener("DOMContentLoaded",xe)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};return we(),e.init=we,e}({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var n,e,t,o,r,i,l,a,d,s,p,c,h=n=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+n+"</svg>",g="litevue-devtools-theme",u="litevue-devtools-ui",f=()=>{try{return JSON.parse(localStorage.getItem(u)||"{}")}catch{return{}}},v=n=>{try{localStorage.setItem(u,JSON.stringify({...f(),...n}))}catch{}},x={dark:h('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:h('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:h('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},m={float:h('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:h('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:h('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},b={float:"bottom",bottom:"right",right:"float"},y={float:"floating",bottom:"docked to bottom",right:"docked to right"},w={dark:"light",light:"system",system:"dark"},k=(n,e,t)=>Math.min(Math.max(n,e),Math.max(e,t)),C=(n,e,t)=>{const o=document.createElement(n);return o.className=e,null!=t&&(o.textContent=t),o},L=(n,e)=>{const t=/* @__PURE__ */new Set,o=(n,r,i)=>{if(null!=n){if("object"==typeof n){if(i>4||t.has(n))return;t.add(n);const l=!Array.isArray(n);for(const t of Object.keys(n)){if("$"===t[0])continue;let a;try{a=n[t]}catch{continue}if("function"==typeof a)continue;const d=r?`${r}.${t}`:t;if(l&&t.toLowerCase().includes(e))return d;const s=o(a,d,i+1);if(s)return s}return}return String(n).toLowerCase().includes(e)?r:void 0}};return o(n,"",0)},E=n=>n instanceof Map||n instanceof Set,O=n=>{let e="";const t=n=>{if(E(n))e+=`${n.constructor.name}(${n.size})`;else if(!n||"object"!=typeof n||n.toJSON)e+=JSON.stringify(n)??String(n);else{const o=Array.isArray(n);e+=o?"[":"{";let r=0;for(const i of o?n.keys():Object.keys(n)){if(e.length>60)break;const l=n[i],a=void 0===l||"function"==typeof l;a&&!o||(r++&&(e+=","),o||(e+=JSON.stringify(i)+":"),a?e+="null":t(l))}e+=o?"]":"}"}};try{t(n)}catch{e=String(n)}return e.length>60?e.slice(0,60)+"\u2026":e},S=(n,e)=>{for(let t=n;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const n=Object.getOwnPropertyDescriptor(t,e);if(n)return n}},$=n=>[...n.directives.map(n=>"v-"+n),...n.magics].join(" "),M=null,_=null,j=!1,z="",N="Elements",I="float",H="",T="",P="",A="",D="",W="",V=()=>{},J=(()=>{try{const n=localStorage.getItem(g);if("light"===n||"system"===n)return n}catch{}return"dark"})(),R=matchMedia("(prefers-color-scheme: light)"),X=()=>{const n="light"===J||"system"===J&&R.matches;e.host.classList.toggle("light",n),a.innerHTML=x[J],a.title="theme: "+J},Y=/* @__PURE__ */new Set,B=/* @__PURE__ */new WeakSet,F=()=>{if("float"!==I)return;const n=parseInt(t.style.right)||0,e=parseInt(t.style.bottom)||0;P=t.style.right=k(n,0,window.innerWidth-t.offsetWidth)+"px",A=t.style.bottom=k(e,0,window.innerHeight-t.offsetHeight)+"px"},U=n=>{"float"===I?(H=t.style.width||H,T=t.style.height||T,P=t.style.right||P,A=t.style.bottom||A):"bottom"===I?D=t.style.height||D:W=t.style.width||W,I=n;const e="float"!==n;t.classList.toggle("dock-bottom","bottom"===n),t.classList.toggle("dock-right","right"===n),t.style.right=e?"":P,t.style.bottom=e?"":A,t.style.width="bottom"===n?"":"right"===n?W:H,t.style.height="right"===n?"":"bottom"===n?D:T,s.innerHTML=m[n],s.title="panel: "+y[n]},q=n=>{const e=C("span","label");return e.appendChild(C("span","punct","<")),e.appendChild(C("span","name",on(n))),e.appendChild(C("span","punct",">")),e},G=e=>{let t=e.parentElement;for(;t;){if(n.scopes.has(t))return t;t=t.parentElement}return null},Z=n=>{const e=n.getBoundingClientRect();d.style.cssText=`display:block;left:${e.left}px;top:${e.top}px;width:${e.width}px;height:${e.height}px`},K=()=>{d.style.display="none"},Q=e=>{e!==M&&Y.clear(),_=null,M=e,N="Elements",window.$scope=e?n.scopes.get(e):void 0,rn(),ln()},nn=e=>{e!==_&&Y.clear(),M=null,_=e,N="Stores",window.$scope=n.stores.get(e),rn(),ln()},en=n=>{N=n,rn()},tn=/^\s*([A-Za-z_$][\w$]*)\s*\(/,on=e=>n.names.get(e)||(e=>{const t=tn.exec(n.exps.get(e)||"")?.[1];return t&&n.components?.has(t)?t:void 0})(e)||e.getAttribute("id")||e.localName,rn=()=>{if((()=>{const e=n.stores?n.stores.size:0;p.textContent=`Elements (${n.scopes.size})`,p.className="Elements"===N?"tab active":"tab",c.textContent=`Stores (${e})`,c.className="Stores"===N?"tab active":"tab"})(),V(),r.textContent="","Elements"===N){const e=[...n.scopes.keys()].sort((n,e)=>n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=/* @__PURE__ */new Map;for(const r of e)if(!z||on(r).toLowerCase().includes(z))t.set(r,void 0);else{const e=L(n.scopes.get(r),z);e&&t.set(r,e)}if(!t.size)return void r.appendChild(C("div","empty",z?"no matching scopes":"no scopes mounted"));const o=/* @__PURE__ */new Set;for(const n of t.keys()){o.add(n);for(let e=G(n);e;e=G(e))o.add(e)}const i=/* @__PURE__ */new Map,l=/* @__PURE__ */new Map,a=/* @__PURE__ */new Map;for(const n of e){if(!o.has(n))continue;const e=G(n);i.set(n,e),a.set(n,e?(a.get(e)??0)+1:0),e&&l.set(e,(l.get(e)||0)+1)}const d=n=>{for(let e=i.get(n);e;e=i.get(e)??null)if(B.has(e))return!0;return!1};for(const s of e){if(!o.has(s)||d(s))continue;const e=C("div",s===M?"row sel":"row");e.style.paddingLeft=8+12*(a.get(s)??0)+"px";const i=B.has(s);if(l.get(s)){const n=C("span",i?"arrow":"arrow open","\u25b6");n.onclick=n=>{n.stopPropagation(),i?B.delete(s):B.add(s),rn()},e.appendChild(n)}else e.appendChild(C("span","spacer"));e.appendChild(q(s));const p=n.exps.get(s);p&&e.appendChild(C("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(C("span","hit"," "+c)),e.onclick=()=>Q(s),e.onmouseenter=()=>Z(s),e.onmouseleave=K,r.appendChild(e)}return}const e=/* @__PURE__ */new Map;for(const o of n.stores?n.stores.keys():[])if(!z||o.toLowerCase().includes(z))e.set(o,void 0);else{const t=L(n.stores.get(o),z);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=C("div",n===_?"row sel":"row"),o=C("span","label");o.appendChild(C("span","punct","$store.")),o.appendChild(C("span","name",n)),t.appendChild(o);const i=e.get(n);i&&t.appendChild(C("span","hit"," "+i)),t.onclick=()=>nn(n),r.appendChild(t)}else r.appendChild(C("div","empty",z?"no matching stores":"no stores registered"))},ln=()=>{if(i.contains(e.activeElement))return;i.textContent="";const t=_?n.stores.get(_):M?n.scopes.get(M):void 0;if(!t)return void i.appendChild(C("div","empty","Select a scope"));const{own:o,inherited:r}=(n=>{const e=(n,e)=>"$"!==e[0]&&"function"!=typeof S(n,e)?.value,t=Object.keys(n).filter(t=>e(n,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(n);for(;i&&i!==Object.prototype;){for(const n of Object.keys(i))!o.has(n)&&e(i,n)&&(o.add(n),r.push(n));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(t);o.forEach(n=>dn(n,t,n,0,"prop",[])),r.length&&(i.appendChild(C("div","divider","inherited")),r.forEach(n=>dn(n,t,n,0,"prop inherited",[]))),o.length||r.length||i.appendChild(C("div","empty","empty scope")),i.appendChild(an(t))},an=n=>{const e=C("div","prop adder");e.appendChild(C("span","spacer"));const t=C("input","val key-in");t.placeholder="key";const o=C("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=e=>{"Enter"===e.key&&(()=>{const e=t.value.trim();if(!e)return;const r=o.value;let l=r;"true"===r?l=!0:"false"===r?l=!1:""===r||isNaN(+r)||(l=+r),n[e]=l,t.blur(),o.blur(),un(),setTimeout(()=>{const n=i.querySelector(".adder .key-in");n&&n.focus()})})()},e.appendChild(t),e.appendChild(o),e},dn=(n,e,t,o,r,l,a)=>{let d,s;try{d=e[n]}catch{s=1}const p=C("div",r);p.style.paddingLeft=8+14*o+"px";const c=S(e,n);if(a||=(n=>{if(!n)return!1;if(n.get&&!n.set)return!0;const e=n.value;return!!e&&!0===e.__v_isRef&&!0===e.__v_isReadonly})(c),null!==d&&"object"==typeof d){const s=l.indexOf(d)>-1,c=!s&&Y.has(t);if(p.appendChild(C("span",c?"arrow open":"arrow","\u25b6")),p.appendChild(C("span","key",n)),p.appendChild(C("span","preview",s?"(circular)":(n=>Array.isArray(n)?`(${n.length}) ${O(n)}`:O(n))(d))),s||(p.classList.add("toggle"),p.onclick=()=>{c?Y.delete(t):Y.add(t),ln()}),sn(p,e,n,o,r),i.appendChild(p),c){const n=E(d),e=n?d instanceof Map?Object.fromEntries(d):[...d]:d,s=Object.keys(e);if(!s.length){const n=C("div","muted","(empty)");n.style.paddingLeft=22+14*(o+1)+"px",i.appendChild(n)}for(const i of s)dn(i,e,t+"."+i,o+1,r,l.concat([d]),a||n)}return}if(p.appendChild(C("span","spacer")),p.appendChild(C("span","key",n)),"function"==typeof d)p.appendChild(C("span","preview","\u0192"));else if(s||a)p.appendChild(C("span","preview",s?"(threw)":O(d)));else if("boolean"==typeof d){p.appendChild(C("span","bool",String(d)));const t=C("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{e[n]=t.checked,t.blur(),un()},p.appendChild(t)}else{const t=C("input","val");t.value=O(d),t.onfocus=()=>{t.value=String(d)},t.onkeydown=n=>{"Enter"===n.key&&t.blur(),"Escape"===n.key&&(t.value=String(d),t.blur())},t.onblur=()=>{const o=((n,e)=>{if("number"==typeof e){const e=parseFloat(n);return isNaN(e)?n:e}return n})(t.value,d);t.value!==String(d)&&o!==d?(e[n]=o,un()):t.value=O(d)},p.appendChild(t)}sn(p,e,n,o,r),i.appendChild(p)},sn=(n,t,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(t,o);if(l&&l.get)return;const a=C("button","del","\u2715");a.title=`delete "${o}"`,a.onclick=n=>{n.stopPropagation();const r=e.activeElement;r&&r.blur&&r.blur(),delete t[o],un()},n.appendChild(a)},pn=t=>{const o=t.target;if(o===e.host)return;t.preventDefault(),t.stopPropagation(),hn();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&Q(r)},cn=t=>{let o=t.target;if(o!==e.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?Z(o):K()}},hn=()=>{j=!1,l.classList.remove("active"),K(),document.removeEventListener("click",pn,!0),document.removeEventListener("mousemove",cn,!0)},gn=!1,un=()=>{gn||(gn=!0,setTimeout(()=>{gn=!1,"none"!==t.style.display&&(rn(),ln())}))},fn=()=>{const u=document.createElement("div");e=u.attachShadow({mode:"open"});const x=document.createElement("style");x.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",e.appendChild(x),d=C("div","highlight"),e.appendChild(d),(o=C("div","pill","\u26a1 LiteVue")).onclick=()=>{o.style.display="none",t.style.display="flex",F(),v({open:!0}),un()},e.appendChild(o),(t=C("div","panel")).style.display="none";const m=C("div","header");m.appendChild(C("span","title","\u26a1 LiteVue")),m.addEventListener("mousedown",n=>{if(n.target.closest(".btn"))return;if("float"!==I)return;n.preventDefault();const e=t.getBoundingClientRect(),o=window.innerWidth-e.right,r=window.innerHeight-e.bottom,i=n.clientX,l=n.clientY,a=n=>{t.style.right=k(o-(n.clientX-i),0,window.innerWidth-t.offsetWidth)+"px",t.style.bottom=k(r-(n.clientY-l),0,window.innerHeight-t.offsetHeight)+"px"},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),v({right:parseInt(t.style.right)||12,bottom:parseInt(t.style.bottom)||12})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const y=C("div","grip");y.addEventListener("mousedown",n=>{n.preventDefault(),y.classList.add("active");const e=t.getBoundingClientRect(),o=n.clientX,r=n.clientY,i=e.width,l=e.height,a=n=>{if("right"!==I){const e="bottom"===I?r-n.clientY:n.clientY-r;t.style.height=k(l+e,320,window.innerHeight-24)+"px"}if("bottom"!==I){const e="right"===I?o-n.clientX:n.clientX-o;t.style.width=k(i+e,320,window.innerWidth-24)+"px"}},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),y.classList.remove("active");const n=parseInt(t.style.width),e=parseInt(t.style.height);v("float"===I?{w:n,h:e}:"bottom"===I?{bh:e}:{rw:n})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const L=(n=>{let e=!1;const t=C("button","btn");t.innerHTML=h('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=C("div","plugins");o.hidden=!0;const r=()=>{const r=n.plugins||[];if(t.title=`plugins (${r.length})`,e)if(o.textContent="",r.length)for(const n of r){const e=C("div","plugin");e.appendChild(C("span","name",n.name)),e.appendChild(C("span","gave",$(n)||"nothing registered")),n.teardown||e.appendChild(C("span","flag","no teardown")),o.appendChild(e)}else o.appendChild(C("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{e=!e;for(const n of o.parentElement.children)n.hidden=n===o?!e:e;t.classList.toggle("active",e),r()},{btn:t,el:o,render:r}})(n);V=L.render,m.appendChild(L.btn),(s=C("button","btn")).onclick=()=>{U(b[I]),v({dock:I})},m.appendChild(s),(a=C("button","btn")).onclick=()=>{(n=>{try{localStorage.setItem(g,n)}catch{}})(J=w[J]),X()},m.appendChild(a),R.addEventListener("change",()=>{"system"===J&&X()}),X(),(l=C("button","btn")).title="pick an element on the page",l.innerHTML=h('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),l.onclick=()=>j?hn():(j=!0,l.classList.add("active"),document.addEventListener("click",pn,!0),void document.addEventListener("mousemove",cn,!0)),m.appendChild(l);const E=C("button","btn","\u2715");E.onclick=()=>{j&&hn(),t.style.display="none",o.style.display="",v({open:!1})},m.appendChild(E),t.appendChild(m);const O=C("div","body"),S=C("div","side"),_=C("div","tabs");(p=C("div","tab active")).onclick=()=>en("Elements"),(c=C("div","tab")).onclick=()=>en("Stores"),_.appendChild(p),_.appendChild(c),S.appendChild(_);const N=C("input","filter");N.placeholder="Filter by name or state",N.oninput=()=>{z=N.value.trim().toLowerCase(),rn()},N.onkeydown=n=>{"Escape"===n.key&&(N.value="",z="",rn())},S.appendChild(N),r=C("div","tree"),S.appendChild(r),i=C("div","state"),O.appendChild(S),O.appendChild(i),O.appendChild(L.el),t.appendChild(O),t.appendChild(y),e.appendChild(t);const Y=f();Y.w&&(H=t.style.width=Y.w+"px"),Y.h&&(T=t.style.height=Y.h+"px"),null!=Y.right&&(P=t.style.right=Y.right+"px"),null!=Y.bottom&&(A=t.style.bottom=Y.bottom+"px"),Y.bh&&(D=Y.bh+"px"),Y.rw&&(W=Y.rw+"px"),U(Y.dock||"float"),document.body.appendChild(u),Y.open&&(o.style.display="none",t.style.display="flex",F(),un()),n.on("scope:mount",un),n.on("scope:unmount",n=>{n===M&&(M=window.$scope=null),un()}),n.stores&&n.on("store:register",un),n.plugins&&n.on("plugin:install",un),n.on("flush",un)},vn=!1,xn=()=>{if(vn)return;const e=window.__LITE_VUE__;e?(vn=!0,n=e,document.body?fn():addEventListener("DOMContentLoaded",fn)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};xn();export{xn as init};
|
|
1
|
+
var e,n,t,o,r,i,l,a,d,s,p,c,h,u=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",g="litevue-devtools-theme",f="litevue-devtools-ui",v=()=>{try{return JSON.parse(localStorage.getItem(f)||"{}")}catch{return{}}},b=e=>{try{localStorage.setItem(f,JSON.stringify({...v(),...e}))}catch{}},m={dark:u('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:u('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:u('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},x={float:u('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:u('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),left:u('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="3" width="8" height="18" fill="currentColor"/>'),right:u('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},y=[{value:"float",label:"Floating",icon:x.float},{value:"left",label:"Dock to left",icon:x.left},{value:"bottom",label:"Dock to bottom",icon:x.bottom},{value:"right",label:"Dock to right",icon:x.right}],w=[{value:"dark",label:"Dark",icon:m.dark},{value:"light",label:"Light",icon:m.light},{value:"system",label:"System",icon:m.system}],k=(e,n,t)=>Math.min(Math.max(e,n),Math.max(n,t)),C=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},L=(e,n)=>{const t=/* @__PURE__ */new Set,o=(e,r,i)=>{if(null!=e){if("object"==typeof e){if(i>4||t.has(e)||ArrayBuffer.isView(e))return;t.add(e),E(e)&&(e=[...e]);const l=!Array.isArray(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let a;try{a=e[t]}catch{continue}if("function"==typeof a)continue;const d=r?`${r}.${t}`:t;if(l&&t.toLowerCase().includes(n))return d;const s=o(a,d,i+1);if(s)return s}return}return String(e).toLowerCase().includes(n)?r:void 0}};return o(e,"",0)},E=e=>e instanceof Map||e instanceof Set,O=e=>{let n="";const t=e=>{if(E(e))n+=`${e.constructor.name}(${e.size})`;else if(!e||"object"!=typeof e||e.toJSON)n+="object"==typeof e||"string"==typeof e?JSON.stringify(e):String(e);else{const o=Array.isArray(e)||ArrayBuffer.isView(e);n+=o?"[":"{";let r=0;for(const i of o?[].keys.call(e):Object.keys(e)){if(n.length>60)break;let l;try{l=e[i]}catch{}const a=void 0===l||"function"==typeof l;a&&!o||(r++&&(n+=","),o||(n+=JSON.stringify(i)+":"),a?n+="null":t(l))}n+=o?"]":"}"}};try{t(e)}catch{n+="\u2026"}return n.length>60?n.slice(0,60)+"\u2026":n},S=(e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}},M=e=>[...e.directives.map(e=>"v-"+e),...e.magics].join(" "),$=(n,t,o)=>{let r;const i=C("div","menu-wrap"),l=C("button","btn");l.setAttribute("aria-haspopup","menu"),l.setAttribute("aria-expanded","false");const a=C("div","menu");a.setAttribute("role","menu"),a.hidden=!0;const d=t.map(e=>{const n=C("button","item");return n.setAttribute("role","menuitemradio"),n.innerHTML=e.icon,n.appendChild(C("span","",e.label)),n.onclick=()=>{p(!0),e.value!==r&&(c(e.value),o(e.value))},a.appendChild(n),n}),s=e=>{e.composedPath().includes(i)||p()},p=n=>{a.hidden||(a.hidden=!0,l.setAttribute("aria-expanded","false"),document.removeEventListener("mousedown",s,!0),e=void 0,n&&l.focus())};l.onclick=()=>a.hidden?(e?.(),a.hidden=!1,l.setAttribute("aria-expanded","true"),document.addEventListener("mousedown",s,!0),e=p,void(d.find(e=>"true"===e.getAttribute("aria-checked"))||d[0]).focus()):p(),a.onkeydown=e=>{const n=d.indexOf(e.target),t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0;t?(e.preventDefault(),d[(n+t+d.length)%d.length].focus()):"Escape"===e.key?p(!0):"Tab"===e.key&&p()};const c=e=>{r=e;const o=t.findIndex(n=>n.value===e);l.innerHTML=t[o].icon+'<svg width="7" height="7" viewBox="0 0 10 10" fill="currentColor"><path d="M1 3h8L5 8z"/></svg>',l.title=`${n}: ${t[o].label.toLowerCase()}`,d.forEach((e,n)=>e.setAttribute("aria-checked",String(n===o)))};return i.appendChild(l),i.appendChild(a),{el:i,set:c}},A=null,_=null,z=!1,I="",N="Elements",j="float",D="",H="",T="",P="",V="",W="",B="",J=()=>{},R=(()=>{try{const e=localStorage.getItem(g);if("light"===e||"system"===e)return e}catch{}return"dark"})(),X=matchMedia("(prefers-color-scheme: light)"),Y=()=>{const e="light"===R||"system"===R&&X.matches;t.host.classList.toggle("light",e),d.set(R)},F=/* @__PURE__ */new Set,U=/* @__PURE__ */new WeakSet,q=()=>{if("float"!==j)return;const e=parseInt(o.style.right)||0,n=parseInt(o.style.bottom)||0;T=o.style.right=k(e,0,window.innerWidth-o.offsetWidth)+"px",P=o.style.bottom=k(n,0,window.innerHeight-o.offsetHeight)+"px"},G=e=>{"float"===j?(D=o.style.width||D,H=o.style.height||H,T=o.style.right||T,P=o.style.bottom||P):"bottom"===j?V=o.style.height||V:"left"===j?W=o.style.width||W:B=o.style.width||B,j=e;const n="float"!==e;for(const t of["left","bottom","right"])o.classList.toggle("dock-"+t,e===t);o.style.right=n?"":T,o.style.bottom=n?"":P,o.style.width="bottom"===e?"":"left"===e?W:"right"===e?B:D,o.style.height="bottom"===e?V:"float"===e?H:"",p.set(e)},Z=e=>{const n=C("span","label");return n.appendChild(C("span","punct","<")),n.appendChild(C("span","name",ae(e))),n.appendChild(C("span","punct",">")),n},K=Object.getOwnPropertyDescriptor(Node.prototype,"parentElement").get,Q=e=>e.__marker?.parentElement||K.call(e),ee=e=>{let t=Q(e);for(;t;){if(n.scopes.has(t))return t;t=Q(t)}return null},ne=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},te=()=>{s.style.display="none"},oe=e=>{e!==A&&F.clear(),_=null,A=e,N="Elements",window.$scope=e?n.scopes.get(e):void 0,de(),se()},re=e=>{e!==_&&F.clear(),A=null,_=e,N="Stores",window.$scope=n.stores.get(e),de(),se()},ie=e=>{N=e,de()},le=/^\s*([A-Za-z_$][\w$]*)\s*\(/,ae=e=>n.names.get(e)||(e=>{const t=le.exec(n.exps.get(e)||"")?.[1];return t&&n.components?.has(t)?t:void 0})(e)||Element.prototype.getAttribute.call(e,"id")||(e instanceof HTMLFormElement?"form":e.localName),de=()=>{if((()=>{const e=n.stores?n.stores.size:0;c.textContent=`Elements (${n.scopes.size})`,c.className="Elements"===N?"tab active":"tab",h.textContent=`Stores (${e})`,h.className="Stores"===N?"tab active":"tab"})(),J(),i.textContent="","Elements"===N){const e=[...n.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=/* @__PURE__ */new Map;for(const i of e)if(!I||ae(i).toLowerCase().includes(I))t.set(i,void 0);else{const e=L(n.scopes.get(i),I);e&&t.set(i,e)}if(!t.size)return void i.appendChild(C("div","empty",I?"no matching scopes":"no scopes mounted"));const o=/* @__PURE__ */new Set;for(const n of t.keys()){o.add(n);for(let e=ee(n);e;e=ee(e))o.add(e)}const r=/* @__PURE__ */new Map,l=/* @__PURE__ */new Map,a=/* @__PURE__ */new Map;for(const n of e){if(!o.has(n))continue;const e=ee(n);r.set(n,e),a.set(n,e?(a.get(e)??0)+1:0),e&&l.set(e,(l.get(e)||0)+1)}const d=e=>{for(let n=r.get(e);n;n=r.get(n)??null)if(U.has(n))return!0;return!1};for(const s of e){if(!o.has(s)||d(s))continue;const e=C("div",s===A?"row sel":"row");e.style.paddingLeft=8+12*(a.get(s)??0)+"px";const r=U.has(s);if(l.get(s)){const n=C("span",r?"arrow":"arrow open","\u25b6");n.onclick=e=>{e.stopPropagation(),r?U.delete(s):U.add(s),de()},e.appendChild(n)}else e.appendChild(C("span","spacer"));e.appendChild(Z(s));const p=n.exps.get(s);p&&e.appendChild(C("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(C("span","hit"," "+c)),e.onclick=()=>oe(s),e.onmouseenter=()=>ne(s),e.onmouseleave=te,i.appendChild(e)}return}const e=/* @__PURE__ */new Map;for(const o of n.stores?n.stores.keys():[])if(!I||o.toLowerCase().includes(I))e.set(o,void 0);else{const t=L(n.stores.get(o),I);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=C("div",n===_?"row sel":"row"),o=C("span","label");o.appendChild(C("span","punct","$store.")),o.appendChild(C("span","name",n)),t.appendChild(o);const r=e.get(n);r&&t.appendChild(C("span","hit"," "+r)),t.onclick=()=>re(n),i.appendChild(t)}else i.appendChild(C("div","empty",I?"no matching stores":"no stores registered"))},se=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=_?n.stores.get(_):A?n.scopes.get(A):void 0;if(!e)return void l.appendChild(C("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof S(e,n)?.value,t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>ce(n,e,n,0,"prop",[])),r.length&&(l.appendChild(C("div","divider","inherited")),r.forEach(n=>ce(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(C("div","empty","empty scope")),l.appendChild(pe(e))},pe=e=>{const n=C("div","prop adder");n.appendChild(C("span","spacer"));const t=C("input","val key-in");t.placeholder="key";const o=C("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:r.trim()&&!isNaN(+r)&&(i=+r),e[n]=i,t.blur(),o.blur(),be(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},ce=(e,n,t,o,r,i,a,d=e)=>{let s,p;try{s=n[e]}catch{p=1}const c=C("div",r);c.style.paddingLeft=8+14*o+"px";const h=S(n,e);if(a||=(e=>{if(!e)return!1;if(e.get&&!e.set||!1===e.writable)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(h),null!==s&&"object"==typeof s){const p=i.indexOf(s)>-1,h=!p&&F.has(t);if(c.appendChild(C("span",h?"arrow open":"arrow","\u25b6")),c.appendChild(C("span","key",d)),c.appendChild(C("span","preview",p?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${O(e)}`:O(e))(s))),p||(c.classList.add("toggle"),c.onclick=()=>{h?F.delete(t):F.add(t),se()}),he(c,n,e,o,r),l.appendChild(c),h){const e=E(s),n=e?[...s.values()]:s,d=s instanceof Map&&[...s.keys()].map(O),p=Object.keys(n);if(!p.length){const e=C("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const l of p)ce(l,n,t+"."+l,o+1,r,i.concat([s]),a||e,d?d[+l]:l)}return}if(c.appendChild(C("span","spacer")),c.appendChild(C("span","key",d)),"function"==typeof s)c.appendChild(C("span","preview","\u0192"));else if(p||a)c.appendChild(C("span","preview",p?"(threw)":O(s)));else if("boolean"==typeof s){c.appendChild(C("span","bool",String(s)));const t=C("input","check");t.type="checkbox",t.checked=s,t.onchange=()=>{n[e]=t.checked,t.blur(),be()},c.appendChild(t)}else{const t=C("input","val");t.value=O(s);let o="";t.onfocus=()=>{t.value=String(s),o=t.value},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=o,t.blur())},t.onblur=()=>{const r=((e,n)=>{if("bigint"==typeof n)try{return e.trim()?BigInt(e):n}catch{return n}if("number"==typeof n){const t=Number(e);return e.trim()&&!isNaN(t)?t:n}return e})(t.value,s);t.value!==o&&r!==s?(n[e]=r,be()):t.value=O(s)},c.appendChild(t)}he(c,n,e,o,r),l.appendChild(c)},he=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const a=C("button","del","\u2715");a.title=`delete "${o}"`,a.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],be()},e.appendChild(a)},ue=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),fe();let r=o;for(;r&&!n.scopes.has(r);)r=Q(r);r&&oe(r)},ge=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=Q(o);o?ne(o):te()}},fe=()=>{z=!1,a.classList.remove("active"),te(),document.removeEventListener("click",ue,!0),document.removeEventListener("mousemove",ge,!0)},ve=!1,be=()=>{ve||(ve=!0,setTimeout(()=>{if(ve=!1,"none"!==o.style.display){if(o.matches(":active"))return be();de(),se()}}))},me=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const f=document.createElement("style");f.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-left,\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-left {\n right: auto;\n left: 0;\n border-left: 0;\n border-right: 1px solid var(--border);\n}\n.panel.dock-left .header,\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-left .grip,\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-left .grip {\n left: auto;\n}\n.panel.dock-left .grip:hover,\n.panel.dock-left .grip.active,\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.btn svg + svg {\n margin-left: 4px;\n opacity: 0.7;\n}\n.menu-wrap {\n position: relative;\n}\n.menu {\n position: absolute;\n top: calc(100% + 4px);\n right: 0;\n z-index: 2;\n display: flex;\n flex-direction: column;\n min-width: 140px;\n padding: 3px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 4px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n cursor: default;\n}\n.item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: none;\n border: 0;\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n text-align: left;\n white-space: nowrap;\n cursor: pointer;\n}\n.item:hover,\n.item:focus-visible {\n background: var(--hover);\n outline: none;\n}\n.item[aria-checked='true'] {\n color: var(--accent);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(f),s=C("div","highlight"),t.appendChild(s),(r=C("div","pill","\u26a1 LiteVue")).onclick=()=>{r.style.display="none",o.style.display="flex",q(),b({open:!0}),be()},t.appendChild(r),(o=C("div","panel")).style.display="none";const m=C("div","header");m.appendChild(C("span","title","\u26a1 LiteVue")),m.addEventListener("mousedown",e=>{if(e.target.closest(".btn, .menu"))return;if("float"!==j)return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,a=e=>{o.style.right=k(t-(e.clientX-i),0,window.innerWidth-o.offsetWidth)+"px",o.style.bottom=k(r-(e.clientY-l),0,window.innerHeight-o.offsetHeight)+"px"},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),b({right:parseInt(o.style.right||"12"),bottom:parseInt(o.style.bottom||"12")})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const x=C("div","grip");x.addEventListener("mousedown",e=>{e.preventDefault(),x.classList.add("active");const n=o.getBoundingClientRect(),t=e.clientX,r=e.clientY,i=n.width,l=n.height,a=e=>{const a="bottom"===j?r-e.clientY:e.clientY-r,d="right"===j?t-e.clientX:e.clientX-t,s=k(l+a,320,window.innerHeight-24),p=k(i+d,320,window.innerWidth-24);"float"!==j&&"bottom"!==j||(o.style.height=s+"px"),"bottom"!==j&&(o.style.width=p+"px"),"float"===j&&(o.style.right=Math.max(0,innerWidth-n.left-p)+"px",o.style.bottom=Math.max(0,innerHeight-n.top-s)+"px")},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),x.classList.remove("active");const e=parseInt(o.style.width),n=parseInt(o.style.height);b("float"===j?{w:e,h:n,right:parseInt(o.style.right),bottom:parseInt(o.style.bottom)}:"bottom"===j?{bh:n}:"left"===j?{lw:e}:{rw:e})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const L=(e=>{let n=!1;const t=C("button","btn");t.innerHTML=u('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=C("div","plugins");o.hidden=!0;const r=()=>{const r=e.plugins||[];if(t.title=`plugins (${r.length})`,n)if(o.textContent="",r.length)for(const e of r){const n=C("div","plugin");n.appendChild(C("span","name",e.name)),n.appendChild(C("span","gave",M(e)||"nothing registered")),e.teardown||n.appendChild(C("span","flag","no teardown")),o.appendChild(n)}else o.appendChild(C("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{n=!n;for(const e of o.parentElement.children)e.hidden=e===o?!n:n;t.classList.toggle("active",n),r()},{btn:t,el:o,render:r}})(n);J=L.render,m.appendChild(L.btn),p=$("layout",y,e=>{G(e),q(),b({dock:j})}),m.appendChild(p.el),d=$("theme",w,e=>{(e=>{try{localStorage.setItem(g,e)}catch{}})(R=e),Y()}),m.appendChild(d.el),X.addEventListener("change",()=>{"system"===R&&Y()}),Y(),(a=C("button","btn")).title="pick an element on the page",a.innerHTML=u('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),a.onclick=()=>z?fe():(z=!0,a.classList.add("active"),document.addEventListener("click",ue,!0),void document.addEventListener("mousemove",ge,!0)),m.appendChild(a);const E=C("button","btn","\u2715");E.onclick=()=>{z&&fe(),o.style.display="none",r.style.display="",i.textContent=l.textContent="",b({open:!1})},m.appendChild(E),o.appendChild(m);const O=C("div","body"),S=C("div","side"),_=C("div","tabs");(c=C("div","tab active")).onclick=()=>ie("Elements"),(h=C("div","tab")).onclick=()=>ie("Stores"),_.appendChild(c),_.appendChild(h),S.appendChild(_);const N=C("input","filter");N.placeholder="Filter by name or state",N.oninput=()=>{I=N.value.trim().toLowerCase(),de()},N.onkeydown=e=>{"Escape"===e.key&&(N.value="",I="",de())},S.appendChild(N),i=C("div","tree"),S.appendChild(i),l=C("div","state"),O.appendChild(S),O.appendChild(l),O.appendChild(L.el),o.appendChild(O),o.appendChild(x),t.appendChild(o);const F=v();F.w&&(D=o.style.width=F.w+"px"),F.h&&(H=o.style.height=F.h+"px"),null!=F.right&&(T=o.style.right=F.right+"px"),null!=F.bottom&&(P=o.style.bottom=F.bottom+"px"),F.bh&&(V=F.bh+"px"),F.lw&&(W=F.lw+"px"),F.rw&&(B=F.rw+"px"),G(y.some(e=>e.value===F.dock)?F.dock:"float"),document.body.appendChild(e),F.open&&(r.style.display="none",o.style.display="flex",q(),be()),n.on("scope:mount",be),n.on("scope:unmount",e=>{e===A&&(A=window.$scope=null),be()}),n.stores&&n.on("store:register",be),n.plugins&&n.on("plugin:install",be),n.on("flush",be)},xe=!1,ye=()=>{if(xe)return;const e=window.__LITE_VUE__;e?(xe=!0,n=e,document.body?me():addEventListener("DOMContentLoaded",me)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};ye();export{ye as init};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVueDevtoolsPanel={})}(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n,t,o,r,i,l,a,d,s,p,c,h,u=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",g="litevue-devtools-theme",f="litevue-devtools-ui",v=()=>{try{return JSON.parse(localStorage.getItem(f)||"{}")}catch{return{}}},b=e=>{try{localStorage.setItem(f,JSON.stringify({...v(),...e}))}catch{}},m={dark:u('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:u('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:u('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},x={float:u('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:u('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:u('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},y={float:"bottom",bottom:"right",right:"float"},w={float:"floating",bottom:"docked to bottom",right:"docked to right"},k={dark:"light",light:"system",system:"dark"},C=(e,n,t)=>Math.min(Math.max(e,n),Math.max(n,t)),L=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},E=(e,n)=>{const t=new Set,o=(e,r,i)=>{if(null!=e){if("object"==typeof e){if(i>4||t.has(e))return;t.add(e);const l=!Array.isArray(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let a;try{a=e[t]}catch{continue}if("function"==typeof a)continue;const d=r?`${r}.${t}`:t;if(l&&t.toLowerCase().includes(n))return d;const s=o(a,d,i+1);if(s)return s}return}return String(e).toLowerCase().includes(n)?r:void 0}};return o(e,"",0)},S=e=>e instanceof Map||e instanceof Set,O=e=>{let n="";const t=e=>{if(S(e))n+=`${e.constructor.name}(${e.size})`;else if(!e||"object"!=typeof e||e.toJSON)n+=JSON.stringify(e)??String(e);else{const o=Array.isArray(e);n+=o?"[":"{";let r=0;for(const i of o?e.keys():Object.keys(e)){if(n.length>60)break;const l=e[i],a=void 0===l||"function"==typeof l;a&&!o||(r++&&(n+=","),o||(n+=JSON.stringify(i)+":"),a?n+="null":t(l))}n+=o?"]":"}"}};try{t(e)}catch{n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},$=(e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}},M=e=>[...e.directives.map(e=>"v-"+e),...e.magics].join(" "),j=null,_=null,z=!1,N="",I="Elements",T="float",H="",P="",A="",D="",V="",W="",J=()=>{},R=(()=>{try{const e=localStorage.getItem(g);if("light"===e||"system"===e)return e}catch{}return"dark"})(),X=matchMedia("(prefers-color-scheme: light)"),Y=()=>{const e="light"===R||"system"===R&&X.matches;t.host.classList.toggle("light",e),d.innerHTML=m[R],d.title="theme: "+R},B=new Set,F=new WeakSet,U=()=>{if("float"!==T)return;const e=parseInt(o.style.right)||0,n=parseInt(o.style.bottom)||0;A=o.style.right=C(e,0,window.innerWidth-o.offsetWidth)+"px",D=o.style.bottom=C(n,0,window.innerHeight-o.offsetHeight)+"px"},q=e=>{"float"===T?(H=o.style.width||H,P=o.style.height||P,A=o.style.right||A,D=o.style.bottom||D):"bottom"===T?V=o.style.height||V:W=o.style.width||W,T=e;const n="float"!==e;o.classList.toggle("dock-bottom","bottom"===e),o.classList.toggle("dock-right","right"===e),o.style.right=n?"":A,o.style.bottom=n?"":D,o.style.width="bottom"===e?"":"right"===e?W:H,o.style.height="right"===e?"":"bottom"===e?V:P,p.innerHTML=x[e],p.title="panel: "+w[e]},G=e=>{const n=L("span","label");return n.appendChild(L("span","punct","<")),n.appendChild(L("span","name",re(e))),n.appendChild(L("span","punct",">")),n},Z=e=>{let t=e.parentElement;for(;t;){if(n.scopes.has(t))return t;t=t.parentElement}return null},K=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},Q=()=>{s.style.display="none"},ee=e=>{e!==j&&B.clear(),_=null,j=e,I="Elements",window.$scope=e?n.scopes.get(e):void 0,ie(),le()},ne=e=>{e!==_&&B.clear(),j=null,_=e,I="Stores",window.$scope=n.stores.get(e),ie(),le()},te=e=>{I=e,ie()},oe=/^\s*([A-Za-z_$][\w$]*)\s*\(/,re=e=>n.names.get(e)||(e=>{const t=oe.exec(n.exps.get(e)||"")?.[1];return t&&n.components?.has(t)?t:void 0})(e)||e.getAttribute("id")||e.localName,ie=()=>{if((()=>{const e=n.stores?n.stores.size:0;c.textContent=`Elements (${n.scopes.size})`,c.className="Elements"===I?"tab active":"tab",h.textContent=`Stores (${e})`,h.className="Stores"===I?"tab active":"tab"})(),J(),i.textContent="","Elements"===I){const e=[...n.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=new Map;for(const i of e)if(!N||re(i).toLowerCase().includes(N))t.set(i,void 0);else{const e=E(n.scopes.get(i),N);e&&t.set(i,e)}if(!t.size)return void i.appendChild(L("div","empty",N?"no matching scopes":"no scopes mounted"));const o=new Set;for(const n of t.keys()){o.add(n);for(let e=Z(n);e;e=Z(e))o.add(e)}const r=new Map,l=new Map,a=new Map;for(const n of e){if(!o.has(n))continue;const e=Z(n);r.set(n,e),a.set(n,e?(a.get(e)??0)+1:0),e&&l.set(e,(l.get(e)||0)+1)}const d=e=>{for(let n=r.get(e);n;n=r.get(n)??null)if(F.has(n))return!0;return!1};for(const s of e){if(!o.has(s)||d(s))continue;const e=L("div",s===j?"row sel":"row");e.style.paddingLeft=8+12*(a.get(s)??0)+"px";const r=F.has(s);if(l.get(s)){const n=L("span",r?"arrow":"arrow open","\u25b6");n.onclick=e=>{e.stopPropagation(),r?F.delete(s):F.add(s),ie()},e.appendChild(n)}else e.appendChild(L("span","spacer"));e.appendChild(G(s));const p=n.exps.get(s);p&&e.appendChild(L("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(L("span","hit"," "+c)),e.onclick=()=>ee(s),e.onmouseenter=()=>K(s),e.onmouseleave=Q,i.appendChild(e)}return}const e=new Map;for(const o of n.stores?n.stores.keys():[])if(!N||o.toLowerCase().includes(N))e.set(o,void 0);else{const t=E(n.stores.get(o),N);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=L("div",n===_?"row sel":"row"),o=L("span","label");o.appendChild(L("span","punct","$store.")),o.appendChild(L("span","name",n)),t.appendChild(o);const r=e.get(n);r&&t.appendChild(L("span","hit"," "+r)),t.onclick=()=>ne(n),i.appendChild(t)}else i.appendChild(L("div","empty",N?"no matching stores":"no stores registered"))},le=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=_?n.stores.get(_):j?n.scopes.get(j):void 0;if(!e)return void l.appendChild(L("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof $(e,n)?.value,t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>de(n,e,n,0,"prop",[])),r.length&&(l.appendChild(L("div","divider","inherited")),r.forEach(n=>de(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(L("div","empty","empty scope")),l.appendChild(ae(e))},ae=e=>{const n=L("div","prop adder");n.appendChild(L("span","spacer"));const t=L("input","val key-in");t.placeholder="key";const o=L("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),ge(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},de=(e,n,t,o,r,i,a)=>{let d,s;try{d=n[e]}catch{s=1}const p=L("div",r);p.style.paddingLeft=8+14*o+"px";const c=$(n,e);if(a||=(e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(c),null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,c=!s&&B.has(t);if(p.appendChild(L("span",c?"arrow open":"arrow","\u25b6")),p.appendChild(L("span","key",e)),p.appendChild(L("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${O(e)}`:O(e))(d))),s||(p.classList.add("toggle"),p.onclick=()=>{c?B.delete(t):B.add(t),le()}),se(p,n,e,o,r),l.appendChild(p),c){const e=S(d),n=e?d instanceof Map?Object.fromEntries(d):[...d]:d,s=Object.keys(n);if(!s.length){const e=L("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const l of s)de(l,n,t+"."+l,o+1,r,i.concat([d]),a||e)}return}if(p.appendChild(L("span","spacer")),p.appendChild(L("span","key",e)),"function"==typeof d)p.appendChild(L("span","preview","\u0192"));else if(s||a)p.appendChild(L("span","preview",s?"(threw)":O(d)));else if("boolean"==typeof d){p.appendChild(L("span","bool",String(d)));const t=L("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),ge()},p.appendChild(t)}else{const t=L("input","val");t.value=O(d),t.onfocus=()=>{t.value=String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=String(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);t.value!==String(d)&&o!==d?(n[e]=o,ge()):t.value=O(d)},p.appendChild(t)}se(p,n,e,o,r),l.appendChild(p)},se=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const a=L("button","del","\u2715");a.title=`delete "${o}"`,a.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],ge()},e.appendChild(a)},pe=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),he();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&ee(r)},ce=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?K(o):Q()}},he=()=>{z=!1,a.classList.remove("active"),Q(),document.removeEventListener("click",pe,!0),document.removeEventListener("mousemove",ce,!0)},ue=!1,ge=()=>{ue||(ue=!0,setTimeout(()=>{ue=!1,"none"!==o.style.display&&(ie(),le())}))},fe=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const f=document.createElement("style");f.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(f),s=L("div","highlight"),t.appendChild(s),(r=L("div","pill","\u26a1 LiteVue")).onclick=()=>{r.style.display="none",o.style.display="flex",U(),b({open:!0}),ge()},t.appendChild(r),(o=L("div","panel")).style.display="none";const m=L("div","header");m.appendChild(L("span","title","\u26a1 LiteVue")),m.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;if("float"!==T)return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,a=e=>{o.style.right=C(t-(e.clientX-i),0,window.innerWidth-o.offsetWidth)+"px",o.style.bottom=C(r-(e.clientY-l),0,window.innerHeight-o.offsetHeight)+"px"},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),b({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const x=L("div","grip");x.addEventListener("mousedown",e=>{e.preventDefault(),x.classList.add("active");const n=o.getBoundingClientRect(),t=e.clientX,r=e.clientY,i=n.width,l=n.height,a=e=>{if("right"!==T){const n="bottom"===T?r-e.clientY:e.clientY-r;o.style.height=C(l+n,320,window.innerHeight-24)+"px"}if("bottom"!==T){const n="right"===T?t-e.clientX:e.clientX-t;o.style.width=C(i+n,320,window.innerWidth-24)+"px"}},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),x.classList.remove("active");const e=parseInt(o.style.width),n=parseInt(o.style.height);b("float"===T?{w:e,h:n}:"bottom"===T?{bh:n}:{rw:e})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const w=(e=>{let n=!1;const t=L("button","btn");t.innerHTML=u('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=L("div","plugins");o.hidden=!0;const r=()=>{const r=e.plugins||[];if(t.title=`plugins (${r.length})`,n)if(o.textContent="",r.length)for(const e of r){const n=L("div","plugin");n.appendChild(L("span","name",e.name)),n.appendChild(L("span","gave",M(e)||"nothing registered")),e.teardown||n.appendChild(L("span","flag","no teardown")),o.appendChild(n)}else o.appendChild(L("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{n=!n;for(const e of o.parentElement.children)e.hidden=e===o?!n:n;t.classList.toggle("active",n),r()},{btn:t,el:o,render:r}})(n);J=w.render,m.appendChild(w.btn),(p=L("button","btn")).onclick=()=>{q(y[T]),b({dock:T})},m.appendChild(p),(d=L("button","btn")).onclick=()=>{(e=>{try{localStorage.setItem(g,e)}catch{}})(R=k[R]),Y()},m.appendChild(d),X.addEventListener("change",()=>{"system"===R&&Y()}),Y(),(a=L("button","btn")).title="pick an element on the page",a.innerHTML=u('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),a.onclick=()=>z?he():(z=!0,a.classList.add("active"),document.addEventListener("click",pe,!0),void document.addEventListener("mousemove",ce,!0)),m.appendChild(a);const E=L("button","btn","\u2715");E.onclick=()=>{z&&he(),o.style.display="none",r.style.display="",b({open:!1})},m.appendChild(E),o.appendChild(m);const S=L("div","body"),O=L("div","side"),$=L("div","tabs");(c=L("div","tab active")).onclick=()=>te("Elements"),(h=L("div","tab")).onclick=()=>te("Stores"),$.appendChild(c),$.appendChild(h),O.appendChild($);const _=L("input","filter");_.placeholder="Filter by name or state",_.oninput=()=>{N=_.value.trim().toLowerCase(),ie()},_.onkeydown=e=>{"Escape"===e.key&&(_.value="",N="",ie())},O.appendChild(_),i=L("div","tree"),O.appendChild(i),l=L("div","state"),S.appendChild(O),S.appendChild(l),S.appendChild(w.el),o.appendChild(S),o.appendChild(x),t.appendChild(o);const I=v();I.w&&(H=o.style.width=I.w+"px"),I.h&&(P=o.style.height=I.h+"px"),null!=I.right&&(A=o.style.right=I.right+"px"),null!=I.bottom&&(D=o.style.bottom=I.bottom+"px"),I.bh&&(V=I.bh+"px"),I.rw&&(W=I.rw+"px"),q(I.dock||"float"),document.body.appendChild(e),I.open&&(r.style.display="none",o.style.display="flex",U(),ge()),n.on("scope:mount",ge),n.on("scope:unmount",e=>{e===j&&(j=window.$scope=null),ge()}),n.stores&&n.on("store:register",ge),n.plugins&&n.on("plugin:install",ge),n.on("flush",ge)},ve=!1,be=()=>{if(ve)return;const e=window.__LITE_VUE__;e?(ve=!0,n=e,document.body?fe():addEventListener("DOMContentLoaded",fe)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};be(),e.init=be});
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVueDevtoolsPanel={})}(this,function(e){var n,t,o,r,i,l,a,d,s,p,c,h,u,g=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",f="litevue-devtools-theme",v="litevue-devtools-ui",b=()=>{try{return JSON.parse(localStorage.getItem(v)||"{}")}catch{return{}}},m=e=>{try{localStorage.setItem(v,JSON.stringify({...b(),...e}))}catch{}},x={dark:g('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:g('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:g('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},y={float:g('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),left:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="3" width="8" height="18" fill="currentColor"/>'),right:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},w=[{value:"float",label:"Floating",icon:y.float},{value:"left",label:"Dock to left",icon:y.left},{value:"bottom",label:"Dock to bottom",icon:y.bottom},{value:"right",label:"Dock to right",icon:y.right}],k=[{value:"dark",label:"Dark",icon:x.dark},{value:"light",label:"Light",icon:x.light},{value:"system",label:"System",icon:x.system}],C=(e,n,t)=>Math.min(Math.max(e,n),Math.max(n,t)),L=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},E=(e,n)=>{const t=new Set,o=(e,r,i)=>{if(null!=e){if("object"==typeof e){if(i>4||t.has(e)||ArrayBuffer.isView(e))return;t.add(e),O(e)&&(e=[...e]);const l=!Array.isArray(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let a;try{a=e[t]}catch{continue}if("function"==typeof a)continue;const d=r?`${r}.${t}`:t;if(l&&t.toLowerCase().includes(n))return d;const s=o(a,d,i+1);if(s)return s}return}return String(e).toLowerCase().includes(n)?r:void 0}};return o(e,"",0)},O=e=>e instanceof Map||e instanceof Set,S=e=>{let n="";const t=e=>{if(O(e))n+=`${e.constructor.name}(${e.size})`;else if(!e||"object"!=typeof e||e.toJSON)n+="object"==typeof e||"string"==typeof e?JSON.stringify(e):String(e);else{const o=Array.isArray(e)||ArrayBuffer.isView(e);n+=o?"[":"{";let r=0;for(const i of o?[].keys.call(e):Object.keys(e)){if(n.length>60)break;let l;try{l=e[i]}catch{}const a=void 0===l||"function"==typeof l;a&&!o||(r++&&(n+=","),o||(n+=JSON.stringify(i)+":"),a?n+="null":t(l))}n+=o?"]":"}"}};try{t(e)}catch{n+="\u2026"}return n.length>60?n.slice(0,60)+"\u2026":n},M=(e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}},$=e=>[...e.directives.map(e=>"v-"+e),...e.magics].join(" "),A=(e,t,o)=>{let r;const i=L("div","menu-wrap"),l=L("button","btn");l.setAttribute("aria-haspopup","menu"),l.setAttribute("aria-expanded","false");const a=L("div","menu");a.setAttribute("role","menu"),a.hidden=!0;const d=t.map(e=>{const n=L("button","item");return n.setAttribute("role","menuitemradio"),n.innerHTML=e.icon,n.appendChild(L("span","",e.label)),n.onclick=()=>{p(!0),e.value!==r&&(c(e.value),o(e.value))},a.appendChild(n),n}),s=e=>{e.composedPath().includes(i)||p()},p=e=>{a.hidden||(a.hidden=!0,l.setAttribute("aria-expanded","false"),document.removeEventListener("mousedown",s,!0),n=void 0,e&&l.focus())};l.onclick=()=>a.hidden?(n?.(),a.hidden=!1,l.setAttribute("aria-expanded","true"),document.addEventListener("mousedown",s,!0),n=p,void(d.find(e=>"true"===e.getAttribute("aria-checked"))||d[0]).focus()):p(),a.onkeydown=e=>{const n=d.indexOf(e.target),t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0;t?(e.preventDefault(),d[(n+t+d.length)%d.length].focus()):"Escape"===e.key?p(!0):"Tab"===e.key&&p()};const c=n=>{r=n;const o=t.findIndex(e=>e.value===n);l.innerHTML=t[o].icon+'<svg width="7" height="7" viewBox="0 0 10 10" fill="currentColor"><path d="M1 3h8L5 8z"/></svg>',l.title=`${e}: ${t[o].label.toLowerCase()}`,d.forEach((e,n)=>e.setAttribute("aria-checked",String(n===o)))};return i.appendChild(l),i.appendChild(a),{el:i,set:c}},_=null,j=null,z=!1,I="",N="Elements",D="float",T="",H="",P="",V="",W="",B="",J="",R=()=>{},X=(()=>{try{const e=localStorage.getItem(f);if("light"===e||"system"===e)return e}catch{}return"dark"})(),Y=matchMedia("(prefers-color-scheme: light)"),F=()=>{const e="light"===X||"system"===X&&Y.matches;o.host.classList.toggle("light",e),s.set(X)},U=new Set,q=new WeakSet,G=()=>{if("float"!==D)return;const e=parseInt(r.style.right)||0,n=parseInt(r.style.bottom)||0;P=r.style.right=C(e,0,window.innerWidth-r.offsetWidth)+"px",V=r.style.bottom=C(n,0,window.innerHeight-r.offsetHeight)+"px"},Z=e=>{"float"===D?(T=r.style.width||T,H=r.style.height||H,P=r.style.right||P,V=r.style.bottom||V):"bottom"===D?W=r.style.height||W:"left"===D?B=r.style.width||B:J=r.style.width||J,D=e;const n="float"!==e;for(const t of["left","bottom","right"])r.classList.toggle("dock-"+t,e===t);r.style.right=n?"":P,r.style.bottom=n?"":V,r.style.width="bottom"===e?"":"left"===e?B:"right"===e?J:T,r.style.height="bottom"===e?W:"float"===e?H:"",c.set(e)},K=e=>{const n=L("span","label");return n.appendChild(L("span","punct","<")),n.appendChild(L("span","name",de(e))),n.appendChild(L("span","punct",">")),n},Q=Object.getOwnPropertyDescriptor(Node.prototype,"parentElement").get,ee=e=>e.__marker?.parentElement||Q.call(e),ne=e=>{let n=ee(e);for(;n;){if(t.scopes.has(n))return n;n=ee(n)}return null},te=e=>{const n=e.getBoundingClientRect();p.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},oe=()=>{p.style.display="none"},re=e=>{e!==_&&U.clear(),j=null,_=e,N="Elements",window.$scope=e?t.scopes.get(e):void 0,se(),pe()},ie=e=>{e!==j&&U.clear(),_=null,j=e,N="Stores",window.$scope=t.stores.get(e),se(),pe()},le=e=>{N=e,se()},ae=/^\s*([A-Za-z_$][\w$]*)\s*\(/,de=e=>t.names.get(e)||(e=>{const n=ae.exec(t.exps.get(e)||"")?.[1];return n&&t.components?.has(n)?n:void 0})(e)||Element.prototype.getAttribute.call(e,"id")||(e instanceof HTMLFormElement?"form":e.localName),se=()=>{if((()=>{const e=t.stores?t.stores.size:0;h.textContent=`Elements (${t.scopes.size})`,h.className="Elements"===N?"tab active":"tab",u.textContent=`Stores (${e})`,u.className="Stores"===N?"tab active":"tab"})(),R(),l.textContent="","Elements"===N){const e=[...t.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),n=new Map;for(const l of e)if(!I||de(l).toLowerCase().includes(I))n.set(l,void 0);else{const e=E(t.scopes.get(l),I);e&&n.set(l,e)}if(!n.size)return void l.appendChild(L("div","empty",I?"no matching scopes":"no scopes mounted"));const o=new Set;for(const t of n.keys()){o.add(t);for(let e=ne(t);e;e=ne(e))o.add(e)}const r=new Map,i=new Map,a=new Map;for(const t of e){if(!o.has(t))continue;const e=ne(t);r.set(t,e),a.set(t,e?(a.get(e)??0)+1:0),e&&i.set(e,(i.get(e)||0)+1)}const d=e=>{for(let n=r.get(e);n;n=r.get(n)??null)if(q.has(n))return!0;return!1};for(const s of e){if(!o.has(s)||d(s))continue;const e=L("div",s===_?"row sel":"row");e.style.paddingLeft=8+12*(a.get(s)??0)+"px";const r=q.has(s);if(i.get(s)){const n=L("span",r?"arrow":"arrow open","\u25b6");n.onclick=e=>{e.stopPropagation(),r?q.delete(s):q.add(s),se()},e.appendChild(n)}else e.appendChild(L("span","spacer"));e.appendChild(K(s));const p=t.exps.get(s);p&&e.appendChild(L("span","exp"," "+p));const c=n.get(s);c&&e.appendChild(L("span","hit"," "+c)),e.onclick=()=>re(s),e.onmouseenter=()=>te(s),e.onmouseleave=oe,l.appendChild(e)}return}const e=new Map;for(const o of t.stores?t.stores.keys():[])if(!I||o.toLowerCase().includes(I))e.set(o,void 0);else{const n=E(t.stores.get(o),I);n&&e.set(o,n)}const n=[...e.keys()];if(n.length)for(const t of n){const n=L("div",t===j?"row sel":"row"),o=L("span","label");o.appendChild(L("span","punct","$store.")),o.appendChild(L("span","name",t)),n.appendChild(o);const r=e.get(t);r&&n.appendChild(L("span","hit"," "+r)),n.onclick=()=>ie(t),l.appendChild(n)}else l.appendChild(L("div","empty",I?"no matching stores":"no stores registered"))},pe=()=>{if(a.contains(o.activeElement))return;a.textContent="";const e=j?t.stores.get(j):_?t.scopes.get(_):void 0;if(!e)return void a.appendChild(L("div","empty","Select a scope"));const{own:n,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof M(e,n)?.value,t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);n.forEach(n=>he(n,e,n,0,"prop",[])),r.length&&(a.appendChild(L("div","divider","inherited")),r.forEach(n=>he(n,e,n,0,"prop inherited",[]))),n.length||r.length||a.appendChild(L("div","empty","empty scope")),a.appendChild(ce(e))},ce=e=>{const n=L("div","prop adder");n.appendChild(L("span","spacer"));const t=L("input","val key-in");t.placeholder="key";const o=L("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:r.trim()&&!isNaN(+r)&&(i=+r),e[n]=i,t.blur(),o.blur(),me(),setTimeout(()=>{const e=a.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},he=(e,n,t,o,r,i,l,d=e)=>{let s,p;try{s=n[e]}catch{p=1}const c=L("div",r);c.style.paddingLeft=8+14*o+"px";const h=M(n,e);if(l||=(e=>{if(!e)return!1;if(e.get&&!e.set||!1===e.writable)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(h),null!==s&&"object"==typeof s){const p=i.indexOf(s)>-1,h=!p&&U.has(t);if(c.appendChild(L("span",h?"arrow open":"arrow","\u25b6")),c.appendChild(L("span","key",d)),c.appendChild(L("span","preview",p?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${S(e)}`:S(e))(s))),p||(c.classList.add("toggle"),c.onclick=()=>{h?U.delete(t):U.add(t),pe()}),ue(c,n,e,o,r),a.appendChild(c),h){const e=O(s),n=e?[...s.values()]:s,d=s instanceof Map&&[...s.keys()].map(S),p=Object.keys(n);if(!p.length){const e=L("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",a.appendChild(e)}for(const a of p)he(a,n,t+"."+a,o+1,r,i.concat([s]),l||e,d?d[+a]:a)}return}if(c.appendChild(L("span","spacer")),c.appendChild(L("span","key",d)),"function"==typeof s)c.appendChild(L("span","preview","\u0192"));else if(p||l)c.appendChild(L("span","preview",p?"(threw)":S(s)));else if("boolean"==typeof s){c.appendChild(L("span","bool",String(s)));const t=L("input","check");t.type="checkbox",t.checked=s,t.onchange=()=>{n[e]=t.checked,t.blur(),me()},c.appendChild(t)}else{const t=L("input","val");t.value=S(s);let o="";t.onfocus=()=>{t.value=String(s),o=t.value},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=o,t.blur())},t.onblur=()=>{const r=((e,n)=>{if("bigint"==typeof n)try{return e.trim()?BigInt(e):n}catch{return n}if("number"==typeof n){const t=Number(e);return e.trim()&&!isNaN(t)?t:n}return e})(t.value,s);t.value!==o&&r!==s?(n[e]=r,me()):t.value=S(s)},c.appendChild(t)}ue(c,n,e,o,r),a.appendChild(c)},ue=(e,n,t,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,t);if(l&&l.get)return;const a=L("button","del","\u2715");a.title=`delete "${t}"`,a.onclick=e=>{e.stopPropagation();const r=o.activeElement;r&&r.blur&&r.blur(),delete n[t],me()},e.appendChild(a)},ge=e=>{const n=e.target;if(n===o.host)return;e.preventDefault(),e.stopPropagation(),ve();let r=n;for(;r&&!t.scopes.has(r);)r=ee(r);r&&re(r)},fe=e=>{let n=e.target;if(n!==o.host){for(;n&&!t.scopes.has(n);)n=ee(n);n?te(n):oe()}},ve=()=>{z=!1,d.classList.remove("active"),oe(),document.removeEventListener("click",ge,!0),document.removeEventListener("mousemove",fe,!0)},be=!1,me=()=>{be||(be=!0,setTimeout(()=>{if(be=!1,"none"!==r.style.display){if(r.matches(":active"))return me();se(),pe()}}))},xe=()=>{const e=document.createElement("div");o=e.attachShadow({mode:"open"});const n=document.createElement("style");n.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-left,\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-left {\n right: auto;\n left: 0;\n border-left: 0;\n border-right: 1px solid var(--border);\n}\n.panel.dock-left .header,\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-left .grip,\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-left .grip {\n left: auto;\n}\n.panel.dock-left .grip:hover,\n.panel.dock-left .grip.active,\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.btn svg + svg {\n margin-left: 4px;\n opacity: 0.7;\n}\n.menu-wrap {\n position: relative;\n}\n.menu {\n position: absolute;\n top: calc(100% + 4px);\n right: 0;\n z-index: 2;\n display: flex;\n flex-direction: column;\n min-width: 140px;\n padding: 3px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 4px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n cursor: default;\n}\n.item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: none;\n border: 0;\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n text-align: left;\n white-space: nowrap;\n cursor: pointer;\n}\n.item:hover,\n.item:focus-visible {\n background: var(--hover);\n outline: none;\n}\n.item[aria-checked='true'] {\n color: var(--accent);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",o.appendChild(n),p=L("div","highlight"),o.appendChild(p),(i=L("div","pill","\u26a1 LiteVue")).onclick=()=>{i.style.display="none",r.style.display="flex",G(),m({open:!0}),me()},o.appendChild(i),(r=L("div","panel")).style.display="none";const v=L("div","header");v.appendChild(L("span","title","\u26a1 LiteVue")),v.addEventListener("mousedown",e=>{if(e.target.closest(".btn, .menu"))return;if("float"!==D)return;e.preventDefault();const n=r.getBoundingClientRect(),t=window.innerWidth-n.right,o=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,a=e=>{r.style.right=C(t-(e.clientX-i),0,window.innerWidth-r.offsetWidth)+"px",r.style.bottom=C(o-(e.clientY-l),0,window.innerHeight-r.offsetHeight)+"px"},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),m({right:parseInt(r.style.right||"12"),bottom:parseInt(r.style.bottom||"12")})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const x=L("div","grip");x.addEventListener("mousedown",e=>{e.preventDefault(),x.classList.add("active");const n=r.getBoundingClientRect(),t=e.clientX,o=e.clientY,i=n.width,l=n.height,a=e=>{const a="bottom"===D?o-e.clientY:e.clientY-o,d="right"===D?t-e.clientX:e.clientX-t,s=C(l+a,320,window.innerHeight-24),p=C(i+d,320,window.innerWidth-24);"float"!==D&&"bottom"!==D||(r.style.height=s+"px"),"bottom"!==D&&(r.style.width=p+"px"),"float"===D&&(r.style.right=Math.max(0,innerWidth-n.left-p)+"px",r.style.bottom=Math.max(0,innerHeight-n.top-s)+"px")},d=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",d),x.classList.remove("active");const e=parseInt(r.style.width),n=parseInt(r.style.height);m("float"===D?{w:e,h:n,right:parseInt(r.style.right),bottom:parseInt(r.style.bottom)}:"bottom"===D?{bh:n}:"left"===D?{lw:e}:{rw:e})};document.addEventListener("mousemove",a),document.addEventListener("mouseup",d)});const y=(e=>{let n=!1;const t=L("button","btn");t.innerHTML=g('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=L("div","plugins");o.hidden=!0;const r=()=>{const r=e.plugins||[];if(t.title=`plugins (${r.length})`,n)if(o.textContent="",r.length)for(const e of r){const n=L("div","plugin");n.appendChild(L("span","name",e.name)),n.appendChild(L("span","gave",$(e)||"nothing registered")),e.teardown||n.appendChild(L("span","flag","no teardown")),o.appendChild(n)}else o.appendChild(L("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{n=!n;for(const e of o.parentElement.children)e.hidden=e===o?!n:n;t.classList.toggle("active",n),r()},{btn:t,el:o,render:r}})(t);R=y.render,v.appendChild(y.btn),c=A("layout",w,e=>{Z(e),G(),m({dock:D})}),v.appendChild(c.el),s=A("theme",k,e=>{(e=>{try{localStorage.setItem(f,e)}catch{}})(X=e),F()}),v.appendChild(s.el),Y.addEventListener("change",()=>{"system"===X&&F()}),F(),(d=L("button","btn")).title="pick an element on the page",d.innerHTML=g('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>z?ve():(z=!0,d.classList.add("active"),document.addEventListener("click",ge,!0),void document.addEventListener("mousemove",fe,!0)),v.appendChild(d);const E=L("button","btn","\u2715");E.onclick=()=>{z&&ve(),r.style.display="none",i.style.display="",l.textContent=a.textContent="",m({open:!1})},v.appendChild(E),r.appendChild(v);const O=L("div","body"),S=L("div","side"),M=L("div","tabs");(h=L("div","tab active")).onclick=()=>le("Elements"),(u=L("div","tab")).onclick=()=>le("Stores"),M.appendChild(h),M.appendChild(u),S.appendChild(M);const j=L("input","filter");j.placeholder="Filter by name or state",j.oninput=()=>{I=j.value.trim().toLowerCase(),se()},j.onkeydown=e=>{"Escape"===e.key&&(j.value="",I="",se())},S.appendChild(j),l=L("div","tree"),S.appendChild(l),a=L("div","state"),O.appendChild(S),O.appendChild(a),O.appendChild(y.el),r.appendChild(O),r.appendChild(x),o.appendChild(r);const N=b();N.w&&(T=r.style.width=N.w+"px"),N.h&&(H=r.style.height=N.h+"px"),null!=N.right&&(P=r.style.right=N.right+"px"),null!=N.bottom&&(V=r.style.bottom=N.bottom+"px"),N.bh&&(W=N.bh+"px"),N.lw&&(B=N.lw+"px"),N.rw&&(J=N.rw+"px"),Z(w.some(e=>e.value===N.dock)?N.dock:"float"),document.body.appendChild(e),N.open&&(i.style.display="none",r.style.display="flex",G(),me()),t.on("scope:mount",me),t.on("scope:unmount",e=>{e===_&&(_=window.$scope=null),me()}),t.stores&&t.on("store:register",me),t.plugins&&t.on("plugin:install",me),t.on("flush",me)},ye=!1,we=()=>{if(ye)return;const e=window.__LITE_VUE__;e?(ye=!0,t=e,document.body?xe():addEventListener("DOMContentLoaded",xe)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};we(),e.init=we});
|