@code-inspector/core 2.0.0-beta.4 → 2.0.0-beta.5
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/client.iife.js +1 -1
- package/dist/client.umd.js +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +16754 -16766
- package/package.json +1 -1
- package/types/client/ai-persist.d.ts +1 -0
- package/types/client/index.d.ts +1 -0
package/dist/client.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(z,M){typeof exports=="object"&&typeof module!="undefined"?M(exports):typeof define=="function"&&define.amd?define(["exports"],M):M((z=typeof globalThis!="undefined"?globalThis:z||self).vueInspectorClient={})})(this,function(z){var Re;"use strict";var hi=Object.freeze,di=Object.defineProperty,Os=Object.defineProperties;var js=Object.getOwnPropertyDescriptors;var Ie=Object.getOwnPropertySymbols;var pi=Object.prototype.hasOwnProperty,ui=Object.prototype.propertyIsEnumerable;var W=Math.pow,zn=(z,M,L)=>M in z?di(z,M,{enumerable:!0,configurable:!0,writable:!0,value:L}):z[M]=L,C=(z,M)=>{for(var L in M||(M={}))pi.call(M,L)&&zn(z,L,M[L]);if(Ie)for(var L of Ie(M))ui.call(M,L)&&zn(z,L,M[L]);return z},V=(z,M)=>Os(z,js(M));var In=(z,M)=>{var L={};for(var q in z)pi.call(z,q)&&M.indexOf(q)<0&&(L[q]=z[q]);if(z!=null&&Ie)for(var q of Ie(z))M.indexOf(q)<0&&ui.call(z,q)&&(L[q]=z[q]);return L};var N=(z,M,L)=>(zn(z,typeof M!="symbol"?M+"":M,L),L);var $=(z,M)=>hi(di(z,"raw",{value:hi(M||z.slice())})),B=(z,M,L)=>new Promise((q,Bt)=>{var re=st=>{try{Ut(L.next(st))}catch(St){Bt(St)}},se=st=>{try{Ut(L.throw(st))}catch(St){Bt(St)}},Ut=st=>st.done?q(st.value):Promise.resolve(st.value).then(re,se);Ut((L=L.apply(z,M)).next())});var gi,fi,mi,bi,yi,vi,xi,wi,ki,$i,_i,Si,Ci,Ti,Mi,Pi,Ei,Ri,Ai,zi,Ii,Ni,Li,Di,Oi,ji,Vi,Bi,Ui,Wi,qi,Fi,Hi,Yi,Ki,Xi,Zi,Gi;const M=window,L=M.ShadowRoot&&(M.ShadyCSS===void 0||M.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,q=Symbol(),Bt=new WeakMap;class re{constructor(t,e,i){if(this._$cssResult$=!0,i!==q)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this._strings=e}get styleSheet(){let t=this._styleSheet;const e=this._strings;if(L&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Bt.get(e)),t===void 0&&((this._styleSheet=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Bt.set(e,t))}return t}toString(){return this.cssText}}const se=(o,...t)=>{const e=o.length===1?o[0]:t.reduce((i,n,r)=>i+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw new Error("Value passed to 'css' function must be a 'css' function result: ".concat(s,". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."))})(n)+o[r+1],o[0]);return new re(e,o,q)},Ut=o=>{let t="";for(const i of o.cssRules)t+=i.cssText;return new re(typeof(e=t)=="string"?e:String(e),void 0,q);var e},st=L?o=>o:o=>o instanceof CSSStyleSheet?Ut(o):o;var St,Ne,Le;const at=window;let Dn,vt;const On=at.trustedTypes,Qi=On?On.emptyScript:"",De=at.reactiveElementPolyfillSupportDevMode;{const o=(St=at.litIssuedWarnings)!==null&&St!==void 0?St:at.litIssuedWarnings=new Set;vt=(t,e)=>{e+=" See https://lit.dev/msg/".concat(t," for more information."),o.has(e)||(console.warn(e),o.add(e))},vt("dev-mode","Lit is in dev mode. Not recommended for production!"),!((Ne=at.ShadyDOM)===null||Ne===void 0)&&Ne.inUse&&De===void 0&&vt("polyfill-support-missing","Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded."),Dn=t=>({then:(e,i)=>{vt("request-update-promise","The `requestUpdate` method should no longer return a Promise but does so on `".concat(t,"`. Use `updateComplete` instead.")),e!==void 0&&e(!1)}})}const jn=o=>{at.emitLitDebugLogEvents&&at.dispatchEvent(new CustomEvent("lit-debug",{detail:o}))},Vn=(o,t)=>o,Oe={toAttribute(o,t){switch(t){case Boolean:o=o?Qi:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch(i){e=null}}return e}},Bn=(o,t)=>t!==o&&(t==t||o==o),je={attribute:!0,type:String,converter:Oe,reflect:!1,hasChanged:Bn},Ve="finalized";class lt extends HTMLElement{constructor(){super(),this.__instanceProperties=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this._initialize()}static addInitializer(t){var e;this.finalize(),((e=this._initializers)!==null&&e!==void 0?e:this._initializers=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,i)=>{const n=this.__attributeNameForProperty(i,e);n!==void 0&&(this.__attributeToPropertyMap.set(n,i),t.push(n))}),t}static createProperty(t,e=je){var i;if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n=typeof t=="symbol"?Symbol():"__".concat(t),r=this.getPropertyDescriptor(t,n,e);r!==void 0&&(Object.defineProperty(this.prototype,t,r),this.hasOwnProperty("__reactivePropertyKeys")||(this.__reactivePropertyKeys=new Set((i=this.__reactivePropertyKeys)!==null&&i!==void 0?i:[])),this.__reactivePropertyKeys.add(t))}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const r=this[t];this[e]=n,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||je}static finalize(){if(this.hasOwnProperty(Ve))return!1;this[Ve]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),t._initializers!==void 0&&(this._initializers=[...t._initializers]),this.elementProperties=new Map(t.elementProperties),this.__attributeToPropertyMap=new Map,this.hasOwnProperty(Vn("properties"))){const e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const n of i)this.createProperty(n,e[n])}this.elementStyles=this.finalizeStyles(this.styles);{const e=(i,n=!1)=>{this.prototype.hasOwnProperty(i)&&vt(n?"renamed-api":"removed-api","`".concat(i,"` is implemented on class ").concat(this.name,". It has been ").concat(n?"renamed":"removed"," in this version of LitElement."))};e("initialize"),e("requestUpdateInternal"),e("_getUpdateComplete",!0)}return!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const n of i)e.unshift(st(n))}else t!==void 0&&e.push(st(t));return e}static __attributeNameForProperty(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}_initialize(){var t;this.__updatePromise=new Promise(e=>this.enableUpdating=e),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),(t=this.constructor._initializers)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((e=this.__controllers)!==null&&e!==void 0?e:this.__controllers=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var e;(e=this.__controllers)===null||e===void 0||e.splice(this.__controllers.indexOf(t)>>>0,1)}__saveInstanceProperties(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this.__instanceProperties.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return((i,n)=>{L?i.adoptedStyleSheets=n.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):n.forEach(r=>{const s=document.createElement("style"),a=M.litNonce;a!==void 0&&s.setAttribute("nonce",a),s.textContent=r.cssText,i.appendChild(s)})})(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this.__controllers)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this.__controllers)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$attributeToProperty(t,i)}__propertyToAttribute(t,e,i=je){var n;const r=this.constructor.__attributeNameForProperty(t,i);if(r!==void 0&&i.reflect===!0){const s=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:Oe).toAttribute(e,i.type);this.constructor.enabledWarnings.indexOf("migration")>=0&&s===void 0&&vt("undefined-attribute-value","The attribute value for the ".concat(t," property is undefined on element ").concat(this.localName,". The attribute will be removed, but in the previous version of `ReactiveElement`, the attribute would not have changed.")),this.__reflectingProperty=t,s==null?this.removeAttribute(r):this.setAttribute(r,s),this.__reflectingProperty=null}}_$attributeToProperty(t,e){var i;const n=this.constructor,r=n.__attributeToPropertyMap.get(t);if(r!==void 0&&this.__reflectingProperty!==r){const s=n.getPropertyOptions(r),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((i=s.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?s.converter:Oe;this.__reflectingProperty=r,this[r]=a.fromAttribute(e,s.type),this.__reflectingProperty=null}}requestUpdate(t,e,i){let n=!0;return t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||Bn)(this[t],e)?(this._$changedProperties.has(t)||this._$changedProperties.set(t,e),i.reflect===!0&&this.__reflectingProperty!==t&&(this.__reflectingProperties===void 0&&(this.__reflectingProperties=new Map),this.__reflectingProperties.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this.__updatePromise=this.__enqueueUpdate()),Dn(this.localName)}__enqueueUpdate(){return B(this,null,function*(){this.isUpdatePending=!0;try{yield this.__updatePromise}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&(yield t),!this.isUpdatePending})}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t,e;if(!this.isUpdatePending)return;if(jn==null||jn({kind:"update"}),!this.hasUpdated){const r=[];if((t=this.constructor.__reactivePropertyKeys)===null||t===void 0||t.forEach(s=>{var a;this.hasOwnProperty(s)&&!(!((a=this.__instanceProperties)===null||a===void 0)&&a.has(s))&&r.push(s)}),r.length)throw new Error("The following properties on element ".concat(this.localName," will not trigger updates as expected because they are set using class fields: ").concat(r.join(", "),". Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information."))}this.__instanceProperties&&(this.__instanceProperties.forEach((r,s)=>this[s]=r),this.__instanceProperties=void 0);let i=!1;const n=this._$changedProperties;try{i=this.shouldUpdate(n),i?(this.willUpdate(n),(e=this.__controllers)===null||e===void 0||e.forEach(r=>{var s;return(s=r.hostUpdate)===null||s===void 0?void 0:s.call(r)}),this.update(n)):this.__markUpdated()}catch(r){throw i=!1,this.__markUpdated(),r}i&&this._$didUpdate(n)}willUpdate(t){}_$didUpdate(t){var e;(e=this.__controllers)===null||e===void 0||e.forEach(i=>{var n;return(n=i.hostUpdated)===null||n===void 0?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t),this.isUpdatePending&&this.constructor.enabledWarnings.indexOf("change-in-update")>=0&&vt("change-in-update","Element ".concat(this.localName," scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update."))}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(t){return!0}update(t){this.__reflectingProperties!==void 0&&(this.__reflectingProperties.forEach((e,i)=>this.__propertyToAttribute(i,this[i],e)),this.__reflectingProperties=void 0),this.__markUpdated()}updated(t){}firstUpdated(t){}}lt[Ve]=!0,lt.elementProperties=new Map,lt.elementStyles=[],lt.shadowRootOptions={mode:"open"},De==null||De({ReactiveElement:lt});{lt.enabledWarnings=["change-in-update"];const o=function(t){t.hasOwnProperty(Vn("enabledWarnings"))||(t.enabledWarnings=t.enabledWarnings.slice())};lt.enableWarning=function(t){o(this),this.enabledWarnings.indexOf(t)<0&&this.enabledWarnings.push(t)},lt.disableWarning=function(t){o(this);const e=this.enabledWarnings.indexOf(t);e>=0&&this.enabledWarnings.splice(e,1)}}var Un,Be,Ue,We;((Le=at.reactiveElementVersions)!==null&&Le!==void 0?Le:at.reactiveElementVersions=[]).push("1.6.1"),at.reactiveElementVersions.length>1&&vt("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.");const H=window,P=o=>{H.emitLitDebugLogEvents&&H.dispatchEvent(new CustomEvent("lit-debug",{detail:o}))};let ae,Ji=0;(Un=H.litIssuedWarnings)!==null&&Un!==void 0||(H.litIssuedWarnings=new Set),ae=(o,t)=>{t+=o?" See https://lit.dev/msg/".concat(o," for more information."):"",H.litIssuedWarnings.has(t)||(console.warn(t),H.litIssuedWarnings.add(t))},ae("dev-mode","Lit is in dev mode. Not recommended for production!");const Q=!((Be=H.ShadyDOM)===null||Be===void 0)&&Be.inUse&&((Ue=H.ShadyDOM)===null||Ue===void 0?void 0:Ue.noPatch)===!0?H.ShadyDOM.wrap:o=>o,Rt=H.trustedTypes,Wn=Rt?Rt.createPolicy("lit-html",{createHTML:o=>o}):void 0,tr=o=>o,le=(o,t,e)=>tr,er=o=>{if(Tt!==le)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");Tt=o},nr=()=>{Tt=le},qe=(o,t,e)=>Tt(o,t,e),Fe="$lit$",ut="lit$".concat(String(Math.random()).slice(9),"$"),qn="?"+ut,or="<".concat(qn,">"),Wt=document,qt=(o="")=>Wt.createComment(o),Ft=o=>o===null||typeof o!="object"&&typeof o!="function",Fn=Array.isArray,He="[ \n\f\r]",Ht=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Hn=/-->/g,Yn=/>/g,Ct=new RegExp(">|".concat(He,"(?:([^\\s\"'>=/]+)(").concat(He,"*=").concat(He,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),Ye=/'/g,Ke=/"/g,Kn=/^(?:script|style|textarea|title)$/i,S=(Xn=1,(o,...t)=>(o.some(e=>e===void 0)&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),{_$litType$:Xn,strings:o,values:t}));var Xn;const xt=Symbol.for("lit-noChange"),O=Symbol.for("lit-nothing"),Zn=new WeakMap,At=Wt.createTreeWalker(Wt,129,null,!1);let Tt=le;class Yt{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,s=0;const a=t.length-1,l=this.parts,[c,h]=((d,p)=>{const g=d.length-1,u=[];let m,f=p===2?"<svg>":"",b=Ht;for(let v=0;v<g;v++){const _=d[v];let T,x,A=-1,j=0;for(;j<_.length&&(b.lastIndex=j,x=b.exec(_),x!==null);)if(j=b.lastIndex,b===Ht){if(x[1]==="!--")b=Hn;else if(x[1]!==void 0)b=Yn;else if(x[2]!==void 0)Kn.test(x[2])&&(m=new RegExp("</".concat(x[2]),"g")),b=Ct;else if(x[3]!==void 0)throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else b===Ct?x[0]===">"?(b=m!=null?m:Ht,A=-1):x[1]===void 0?A=-2:(A=b.lastIndex-x[2].length,T=x[1],b=x[3]===void 0?Ct:x[3]==='"'?Ke:Ye):b===Ke||b===Ye?b=Ct:b===Hn||b===Yn?b=Ht:(b=Ct,m=void 0);console.assert(A===-1||b===Ct||b===Ye||b===Ke,"unexpected parse state B");const K=b===Ct&&d[v+1].startsWith("/>")?" ":"";f+=b===Ht?_+or:A>=0?(u.push(T),_.slice(0,A)+Fe+_.slice(A)+ut+K):_+ut+(A===-2?(u.push(void 0),v):K)}const y=f+(d[g]||"<?>")+(p===2?"</svg>":"");if(!Array.isArray(d)||!d.hasOwnProperty("raw")){let v="invalid template strings array";throw v="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n\n If you're using the html or svg tagged template functions normally\n and and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(v)}return[Wn!==void 0?Wn.createHTML(y):y,u]})(t,e);if(this.el=Yt.createElement(c,i),At.currentNode=this.el.content,e===2){const d=this.el.content,p=d.firstChild;p.remove(),d.append(...p.childNodes)}for(;(n=At.nextNode())!==null&&l.length<a;){if(n.nodeType===1){{const d=n.localName;if(/^(?:textarea|template)$/i.test(d)&&n.innerHTML.includes(ut)){const p="Expressions are not supported inside `".concat(d,"` elements. See https://lit.dev/msg/expression-in-").concat(d," for more information.");if(d==="template")throw new Error(p);ae("",p)}}if(n.hasAttributes()){const d=[];for(const p of n.getAttributeNames())if(p.endsWith(Fe)||p.startsWith(ut)){const g=h[s++];if(d.push(p),g!==void 0){const u=n.getAttribute(g.toLowerCase()+Fe).split(ut),m=/([.?@])?(.*)/.exec(g);l.push({type:1,index:r,name:m[2],strings:u,ctor:m[1]==="."?rr:m[1]==="?"?ar:m[1]==="@"?lr:ce})}else l.push({type:6,index:r})}for(const p of d)n.removeAttribute(p)}if(Kn.test(n.tagName)){const d=n.textContent.split(ut),p=d.length-1;if(p>0){n.textContent=Rt?Rt.emptyScript:"";for(let g=0;g<p;g++)n.append(d[g],qt()),At.nextNode(),l.push({type:2,index:++r});n.append(d[p],qt())}}}else if(n.nodeType===8)if(n.data===qn)l.push({type:2,index:r});else{let d=-1;for(;(d=n.data.indexOf(ut,d+1))!==-1;)l.push({type:7,index:r}),d+=ut.length-1}r++}P==null||P({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:t})}static createElement(t,e){const i=Wt.createElement("template");return i.innerHTML=t,i}}function zt(o,t,e=o,i){var n,r,s,a;if(t===xt)return t;let l=i!==void 0?(n=e.__directives)===null||n===void 0?void 0:n[i]:e.__directive;const c=Ft(t)?void 0:t._$litDirective$;return(l==null?void 0:l.constructor)!==c&&((r=l==null?void 0:l._$notifyDirectiveConnectionChanged)===null||r===void 0||r.call(l,!1),c===void 0?l=void 0:(l=new c(o),l._$initialize(o,e,i)),i!==void 0?((s=(a=e).__directives)!==null&&s!==void 0?s:a.__directives=[])[i]=l:e.__directive=l),l!==void 0&&(t=zt(o,l._$resolve(o,t.values),l,i)),t}class ir{constructor(t,e){this._parts=[],this._$disconnectableChildren=void 0,this._$template=t,this._$parent=e}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(t){var e;const{el:{content:i},parts:n}=this._$template,r=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:Wt).importNode(i,!0);At.currentNode=r;let s=At.nextNode(),a=0,l=0,c=n[0];for(;c!==void 0;){if(a===c.index){let h;c.type===2?h=new Kt(s,s.nextSibling,this,t):c.type===1?h=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(h=new cr(s,this,t)),this._parts.push(h),c=n[++l]}a!==(c==null?void 0:c.index)&&(s=At.nextNode(),a++)}return r}_update(t){let e=0;for(const i of this._parts)i!==void 0&&(P==null||P({kind:"set part",part:i,value:t[e],valueIndex:e,values:t,templateInstance:this}),i.strings!==void 0?(i._$setValue(t,i,e),e+=i.strings.length-2):i._$setValue(t[e])),e++}}class Kt{constructor(t,e,i,n){var r;this.type=2,this._$committedValue=O,this._$disconnectableChildren=void 0,this._$startNode=t,this._$endNode=e,this._$parent=i,this.options=n,this.__isConnected=(r=n==null?void 0:n.isConnected)===null||r===void 0||r,this._textSanitizer=void 0}get _$isConnected(){var t,e;return(e=(t=this._$parent)===null||t===void 0?void 0:t._$isConnected)!==null&&e!==void 0?e:this.__isConnected}get parentNode(){let t=Q(this._$startNode).parentNode;const e=this._$parent;return e!==void 0&&t.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(t,e=this){var i;if(this.parentNode===null)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(t=zt(this,t,e),Ft(t))t===O||t==null||t===""?(this._$committedValue!==O&&(P==null||P({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=O):t!==this._$committedValue&&t!==xt&&this._commitText(t);else if(t._$litType$!==void 0)this._commitTemplateResult(t);else if(t.nodeType!==void 0){if(((i=this.options)===null||i===void 0?void 0:i.host)===t)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",t,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(t)}else(n=>Fn(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function")(t)?this._commitIterable(t):this._commitText(t)}_insert(t,e=this._$endNode){return Q(Q(this._$startNode).parentNode).insertBefore(t,e)}_commitNode(t){var e;if(this._$committedValue!==t){if(this._$clear(),Tt!==le){const i=(e=this._$startNode.parentNode)===null||e===void 0?void 0:e.nodeName;if(i==="STYLE"||i==="SCRIPT"){let n="Forbidden";throw n=i==="STYLE"?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and make do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(n)}}P==null||P({kind:"commit node",start:this._$startNode,parent:this._$parent,value:t,options:this.options}),this._$committedValue=this._insert(t)}}_commitText(t){if(this._$committedValue!==O&&Ft(this._$committedValue)){const e=Q(this._$startNode).nextSibling;this._textSanitizer===void 0&&(this._textSanitizer=qe(e,"data","property")),t=this._textSanitizer(t),P==null||P({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}else{const e=document.createTextNode("");this._commitNode(e),this._textSanitizer===void 0&&(this._textSanitizer=qe(e,"data","property")),t=this._textSanitizer(t),P==null||P({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}this._$committedValue=t}_commitTemplateResult(t){var e;const{values:i,_$litType$:n}=t,r=typeof n=="number"?this._$getTemplate(t):(n.el===void 0&&(n.el=Yt.createElement(n.h,this.options)),n);if(((e=this._$committedValue)===null||e===void 0?void 0:e._$template)===r)P==null||P({kind:"template updating",template:r,instance:this._$committedValue,parts:this._$committedValue._parts,options:this.options,values:i}),this._$committedValue._update(i);else{const s=new ir(r,this),a=s._clone(this.options);P==null||P({kind:"template instantiated",template:r,instance:s,parts:s._parts,options:this.options,fragment:a,values:i}),s._update(i),P==null||P({kind:"template instantiated and updated",template:r,instance:s,parts:s._parts,options:this.options,fragment:a,values:i}),this._commitNode(a),this._$committedValue=s}}_$getTemplate(t){let e=Zn.get(t.strings);return e===void 0&&Zn.set(t.strings,e=new Yt(t)),e}_commitIterable(t){Fn(this._$committedValue)||(this._$committedValue=[],this._$clear());const e=this._$committedValue;let i,n=0;for(const r of t)n===e.length?e.push(i=new Kt(this._insert(qt()),this._insert(qt()),this,this.options)):i=e[n],i._$setValue(r),n++;n<e.length&&(this._$clear(i&&Q(i._$endNode).nextSibling,n),e.length=n)}_$clear(t=Q(this._$startNode).nextSibling,e){var i;for((i=this._$notifyConnectionChanged)===null||i===void 0||i.call(this,!1,!0,e);t&&t!==this._$endNode;){const n=Q(t).nextSibling;Q(t).remove(),t=n}}setConnected(t){var e;if(this._$parent!==void 0)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=t,(e=this._$notifyConnectionChanged)===null||e===void 0||e.call(this,t)}}class ce{constructor(t,e,i,n,r){this.type=1,this._$committedValue=O,this._$disconnectableChildren=void 0,this.element=t,this.name=e,this._$parent=n,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=O,this._sanitizer=void 0}get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t,e=this,i,n){const r=this.strings;let s=!1;if(r===void 0)t=zt(this,t,e,0),s=!Ft(t)||t!==this._$committedValue&&t!==xt,s&&(this._$committedValue=t);else{const a=t;let l,c;for(t=r[0],l=0;l<r.length-1;l++)c=zt(this,a[i+l],e,l),c===xt&&(c=this._$committedValue[l]),s||(s=!Ft(c)||c!==this._$committedValue[l]),c===O?t=O:t!==O&&(t+=(c!=null?c:"")+r[l+1]),this._$committedValue[l]=c}s&&!n&&this._commitValue(t)}_commitValue(t){t===O?Q(this.element).removeAttribute(this.name):(this._sanitizer===void 0&&(this._sanitizer=Tt(this.element,this.name,"attribute")),t=this._sanitizer(t!=null?t:""),P==null||P({kind:"commit attribute",element:this.element,name:this.name,value:t,options:this.options}),Q(this.element).setAttribute(this.name,t!=null?t:""))}}class rr extends ce{constructor(){super(...arguments),this.type=3}_commitValue(t){this._sanitizer===void 0&&(this._sanitizer=Tt(this.element,this.name,"property")),t=this._sanitizer(t),P==null||P({kind:"commit property",element:this.element,name:this.name,value:t,options:this.options}),this.element[this.name]=t===O?void 0:t}}const sr=Rt?Rt.emptyScript:"";class ar extends ce{constructor(){super(...arguments),this.type=4}_commitValue(t){P==null||P({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!t||t===O),options:this.options}),t&&t!==O?Q(this.element).setAttribute(this.name,sr):Q(this.element).removeAttribute(this.name)}}class lr extends ce{constructor(t,e,i,n,r){if(super(t,e,i,n,r),this.type=5,this.strings!==void 0)throw new Error("A `<".concat(t.localName,">` has a `@").concat(e,"=...` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text."))}_$setValue(t,e=this){var i;if((t=(i=zt(this,t,e,0))!==null&&i!==void 0?i:O)===xt)return;const n=this._$committedValue,r=t===O&&n!==O||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==O&&(n===O||r);P==null||P({kind:"commit event listener",element:this.element,name:this.name,value:t,options:this.options,removeListener:r,addListener:s,oldListener:n}),r&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$committedValue=t}handleEvent(t){var e,i;typeof this._$committedValue=="function"?this._$committedValue.call((i=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&i!==void 0?i:this.element,t):this._$committedValue.handleEvent(t)}}class cr{constructor(t,e,i){this.element=t,this.type=6,this._$disconnectableChildren=void 0,this._$parent=e,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){P==null||P({kind:"commit to element binding",element:this.element,value:t,options:this.options}),zt(this,t)}}const Gn=H.litHtmlPolyfillSupportDevMode;Gn==null||Gn(Yt,Kt),((We=H.litHtmlVersions)!==null&&We!==void 0?We:H.litHtmlVersions=[]).push("2.6.1"),H.litHtmlVersions.length>1&&ae("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.");const he=(o,t,e)=>{var i,n;if(t==null)throw new TypeError("The container to render into may not be ".concat(t));const r=Ji++,s=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:t;let a=s._$litPart$;if(P==null||P({kind:"begin render",id:r,value:o,container:t,options:e,part:a}),a===void 0){const l=(n=e==null?void 0:e.renderBefore)!==null&&n!==void 0?n:null;s._$litPart$=a=new Kt(t.insertBefore(qt(),l),l,void 0,e!=null?e:{})}return a._$setValue(o),P==null||P({kind:"end render",id:r,value:o,container:t,options:e,part:a}),a};var Xe,Ze,Ge;let Qe;he.setSanitizer=er,he.createSanitizer=qe,he._testOnlyClearSanitizerFactoryDoNotCallOrElse=nr;{const o=(Xe=globalThis.litIssuedWarnings)!==null&&Xe!==void 0?Xe:globalThis.litIssuedWarnings=new Set;Qe=(t,e)=>{e+=" See https://lit.dev/msg/".concat(t," for more information."),o.has(e)||(console.warn(e),o.add(e))}}class It extends lt{constructor(){super(...arguments),this.renderOptions={host:this},this.__childPart=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.__childPart=he(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.__childPart)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.__childPart)===null||t===void 0||t.setConnected(!1)}render(){return xt}}It.finalized=!0,It._$litElement$=!0,(Ze=globalThis.litElementHydrateSupport)===null||Ze===void 0||Ze.call(globalThis,{LitElement:It});const Qn=globalThis.litElementPolyfillSupportDevMode;Qn==null||Qn({LitElement:It}),It.finalize=function(){if(!lt.finalize.call(this))return!1;const o=(t,e,i=!1)=>{if(t.hasOwnProperty(e)){const n=(typeof t=="function"?t:t.constructor).name;Qe(i?"renamed-api":"removed-api","`".concat(e,"` is implemented on class ").concat(n,". It has been ").concat(i?"renamed":"removed"," in this version of LitElement."))}};return o(this,"render"),o(this,"getStyles",!0),o(this.prototype,"adoptStyles"),!0},((Ge=globalThis.litElementVersions)!==null&&Ge!==void 0?Ge:globalThis.litElementVersions=[]).push("3.2.2"),globalThis.litElementVersions.length>1&&Qe("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.");const hr=(o,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?V(C({},t),{finisher(e){e.createProperty(t.key,o)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,o)}},dr=(o,t,e)=>{t.constructor.createProperty(e,o)};function Y(o){return(t,e)=>e!==void 0?dr(o,t,e):hr(o,t)}function E(o){return Y(V(C({},o),{state:!0}))}function Nt(o,t){return(({finisher:e,descriptor:i})=>(n,r)=>{var s;if(r===void 0){const a=(s=n.originalKey)!==null&&s!==void 0?s:n.key,l=i!=null?{kind:"method",placement:"prototype",key:a,descriptor:i(n.key)}:V(C({},n),{key:a});return e!=null&&(l.finisher=function(c){e(c,a)}),l}{const a=n.constructor;i!==void 0&&Object.defineProperty(n,r,i(r)),e==null||e(a,r)}})({descriptor:e=>{const i={get(){var n,r;return(r=(n=this.renderRoot)===null||n===void 0?void 0:n.querySelector(o))!==null&&r!==void 0?r:null},enumerable:!0,configurable:!0};if(t){const n=typeof e=="symbol"?Symbol():"__".concat(e);i.get=function(){var r,s;return this[n]===void 0&&(this[n]=(s=(r=this.renderRoot)===null||r===void 0?void 0:r.querySelector(o))!==null&&s!==void 0?s:null),this[n]}}return i}})}var Je;(Je=window.HTMLSlotElement)===null||Je===void 0||Je.prototype.assignedElements;const pr=1,ur=2,Jn=o=>(...t)=>({_$litDirective$:o,values:t});class to{constructor(t){}get _$isConnected(){return this._$parent._$isConnected}_$initialize(t,e,i){this.__part=t,this._$parent=e,this.__attributeIndex=i}_$resolve(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const gt=Jn(class extends to{constructor(o){var t;if(super(o),o.type!==pr||o.name!=="style"||((t=o.strings)===null||t===void 0?void 0:t.length)>2)throw new Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((t,e)=>{const i=o[e];return i==null?t:t+"".concat(e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(i,";")},"")}update(o,[t]){const{style:e}=o.element;if(this._previousStyleProperties===void 0){this._previousStyleProperties=new Set;for(const i in t)this._previousStyleProperties.add(i);return this.render(t)}this._previousStyleProperties.forEach(i=>{t[i]==null&&(this._previousStyleProperties.delete(i),i.includes("-")?e.removeProperty(i):e[i]="")});for(const i in t){const n=t[i];n!=null&&(this._previousStyleProperties.add(i),i.includes("-")?e.setProperty(i,n):e[i]=n)}return xt}}),de="data-insp-path",gr=new Proxy({},{get(o,t){throw new Error('Module "path" has been externalized for browser compatibility. Cannot access "path.'.concat(t,'" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.'))}}),fr=Object.freeze(Object.defineProperty({__proto__:null,default:gr},Symbol.toStringTag,{value:"Module"})),mr=new Proxy({},{get(o,t){throw new Error('Module "os" has been externalized for browser compatibility. Cannot access "os.'.concat(t,'" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.'))}}),br=Object.freeze(Object.defineProperty({__proto__:null,default:mr},Symbol.toStringTag,{value:"Module"}));function pe(o){if(o.__esModule)return o;var t=o.default;if(typeof t=="function"){var e=function i(){if(this instanceof i){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(t,n))}return t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(o).forEach(function(i){var n=Object.getOwnPropertyDescriptor(o,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return o[i]}})}),e}new Proxy({},{get(o,t){throw new Error('Module "fs" has been externalized for browser compatibility. Cannot access "fs.'.concat(t,'" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.'))}}),new Proxy({},{get(o,t){throw new Error('Module "child_process" has been externalized for browser compatibility. Cannot access "child_process.'.concat(t,'" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.'))}});var eo,no,tn,oo,io,ro,so,ao,lo={exports:{}};function co(){if(oo)return tn;oo=1;const o=no?eo:(no=1,eo={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),t={};for(const n of Object.keys(o))t[o[n]]=n;const e={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};tn=e;for(const n of Object.keys(e)){if(!("channels"in e[n]))throw new Error("missing channels property: "+n);if(!("labels"in e[n]))throw new Error("missing channel labels property: "+n);if(e[n].labels.length!==e[n].channels)throw new Error("channel and label counts mismatch: "+n);const{channels:r,labels:s}=e[n];delete e[n].channels,delete e[n].labels,Object.defineProperty(e[n],"channels",{value:r}),Object.defineProperty(e[n],"labels",{value:s})}function i(n,r){return W(n[0]-r[0],2)+W(n[1]-r[1],2)+W(n[2]-r[2],2)}return e.rgb.hsl=function(n){const r=n[0]/255,s=n[1]/255,a=n[2]/255,l=Math.min(r,s,a),c=Math.max(r,s,a),h=c-l;let d,p;c===l?d=0:r===c?d=(s-a)/h:s===c?d=2+(a-r)/h:a===c&&(d=4+(r-s)/h),d=Math.min(60*d,360),d<0&&(d+=360);const g=(l+c)/2;return p=c===l?0:g<=.5?h/(c+l):h/(2-c-l),[d,100*p,100*g]},e.rgb.hsv=function(n){let r,s,a,l,c;const h=n[0]/255,d=n[1]/255,p=n[2]/255,g=Math.max(h,d,p),u=g-Math.min(h,d,p),m=function(f){return(g-f)/6/u+.5};return u===0?(l=0,c=0):(c=u/g,r=m(h),s=m(d),a=m(p),h===g?l=a-s:d===g?l=1/3+r-a:p===g&&(l=2/3+s-r),l<0?l+=1:l>1&&(l-=1)),[360*l,100*c,100*g]},e.rgb.hwb=function(n){const r=n[0],s=n[1];let a=n[2];const l=e.rgb.hsl(n)[0],c=1/255*Math.min(r,Math.min(s,a));return a=1-1/255*Math.max(r,Math.max(s,a)),[l,100*c,100*a]},e.rgb.cmyk=function(n){const r=n[0]/255,s=n[1]/255,a=n[2]/255,l=Math.min(1-r,1-s,1-a);return[100*((1-r-l)/(1-l)||0),100*((1-s-l)/(1-l)||0),100*((1-a-l)/(1-l)||0),100*l]},e.rgb.keyword=function(n){const r=t[n];if(r)return r;let s,a=1/0;for(const l of Object.keys(o)){const c=i(n,o[l]);c<a&&(a=c,s=l)}return s},e.keyword.rgb=function(n){return o[n]},e.rgb.xyz=function(n){let r=n[0]/255,s=n[1]/255,a=n[2]/255;return r=r>.04045?W((r+.055)/1.055,2.4):r/12.92,s=s>.04045?W((s+.055)/1.055,2.4):s/12.92,a=a>.04045?W((a+.055)/1.055,2.4):a/12.92,[100*(.4124*r+.3576*s+.1805*a),100*(.2126*r+.7152*s+.0722*a),100*(.0193*r+.1192*s+.9505*a)]},e.rgb.lab=function(n){const r=e.rgb.xyz(n);let s=r[0],a=r[1],l=r[2];return s/=95.047,a/=100,l/=108.883,s=s>.008856?W(s,1/3):7.787*s+16/116,a=a>.008856?W(a,1/3):7.787*a+16/116,l=l>.008856?W(l,1/3):7.787*l+16/116,[116*a-16,500*(s-a),200*(a-l)]},e.hsl.rgb=function(n){const r=n[0]/360,s=n[1]/100,a=n[2]/100;let l,c,h;if(s===0)return h=255*a,[h,h,h];l=a<.5?a*(1+s):a+s-a*s;const d=2*a-l,p=[0,0,0];for(let g=0;g<3;g++)c=r+1/3*-(g-1),c<0&&c++,c>1&&c--,h=6*c<1?d+6*(l-d)*c:2*c<1?l:3*c<2?d+(l-d)*(2/3-c)*6:d,p[g]=255*h;return p},e.hsl.hsv=function(n){const r=n[0];let s=n[1]/100,a=n[2]/100,l=s;const c=Math.max(a,.01);return a*=2,s*=a<=1?a:2-a,l*=c<=1?c:2-c,[r,100*(a===0?2*l/(c+l):2*s/(a+s)),100*((a+s)/2)]},e.hsv.rgb=function(n){const r=n[0]/60,s=n[1]/100;let a=n[2]/100;const l=Math.floor(r)%6,c=r-Math.floor(r),h=255*a*(1-s),d=255*a*(1-s*c),p=255*a*(1-s*(1-c));switch(a*=255,l){case 0:return[a,p,h];case 1:return[d,a,h];case 2:return[h,a,p];case 3:return[h,d,a];case 4:return[p,h,a];case 5:return[a,h,d]}},e.hsv.hsl=function(n){const r=n[0],s=n[1]/100,a=n[2]/100,l=Math.max(a,.01);let c,h;h=(2-s)*a;const d=(2-s)*l;return c=s*l,c/=d<=1?d:2-d,c=c||0,h/=2,[r,100*c,100*h]},e.hwb.rgb=function(n){const r=n[0]/360;let s=n[1]/100,a=n[2]/100;const l=s+a;let c;l>1&&(s/=l,a/=l);const h=Math.floor(6*r),d=1-a;c=6*r-h,1&h&&(c=1-c);const p=s+c*(d-s);let g,u,m;switch(h){default:case 6:case 0:g=d,u=p,m=s;break;case 1:g=p,u=d,m=s;break;case 2:g=s,u=d,m=p;break;case 3:g=s,u=p,m=d;break;case 4:g=p,u=s,m=d;break;case 5:g=d,u=s,m=p}return[255*g,255*u,255*m]},e.cmyk.rgb=function(n){const r=n[0]/100,s=n[1]/100,a=n[2]/100,l=n[3]/100;return[255*(1-Math.min(1,r*(1-l)+l)),255*(1-Math.min(1,s*(1-l)+l)),255*(1-Math.min(1,a*(1-l)+l))]},e.xyz.rgb=function(n){const r=n[0]/100,s=n[1]/100,a=n[2]/100;let l,c,h;return l=3.2406*r+-1.5372*s+-.4986*a,c=-.9689*r+1.8758*s+.0415*a,h=.0557*r+-.204*s+1.057*a,l=l>.0031308?1.055*W(l,1/2.4)-.055:12.92*l,c=c>.0031308?1.055*W(c,1/2.4)-.055:12.92*c,h=h>.0031308?1.055*W(h,1/2.4)-.055:12.92*h,l=Math.min(Math.max(0,l),1),c=Math.min(Math.max(0,c),1),h=Math.min(Math.max(0,h),1),[255*l,255*c,255*h]},e.xyz.lab=function(n){let r=n[0],s=n[1],a=n[2];return r/=95.047,s/=100,a/=108.883,r=r>.008856?W(r,1/3):7.787*r+16/116,s=s>.008856?W(s,1/3):7.787*s+16/116,a=a>.008856?W(a,1/3):7.787*a+16/116,[116*s-16,500*(r-s),200*(s-a)]},e.lab.xyz=function(n){let r,s,a;s=(n[0]+16)/116,r=n[1]/500+s,a=s-n[2]/200;const l=W(s,3),c=W(r,3),h=W(a,3);return s=l>.008856?l:(s-16/116)/7.787,r=c>.008856?c:(r-16/116)/7.787,a=h>.008856?h:(a-16/116)/7.787,r*=95.047,s*=100,a*=108.883,[r,s,a]},e.lab.lch=function(n){const r=n[0],s=n[1],a=n[2];let l;return l=360*Math.atan2(a,s)/2/Math.PI,l<0&&(l+=360),[r,Math.sqrt(s*s+a*a),l]},e.lch.lab=function(n){const r=n[0],s=n[1],a=n[2]/360*2*Math.PI;return[r,s*Math.cos(a),s*Math.sin(a)]},e.rgb.ansi16=function(n,r=null){const[s,a,l]=n;let c=r===null?e.rgb.hsv(n)[2]:r;if(c=Math.round(c/50),c===0)return 30;let h=30+(Math.round(l/255)<<2|Math.round(a/255)<<1|Math.round(s/255));return c===2&&(h+=60),h},e.hsv.ansi16=function(n){return e.rgb.ansi16(e.hsv.rgb(n),n[2])},e.rgb.ansi256=function(n){const r=n[0],s=n[1],a=n[2];return r===s&&s===a?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(s/255*5)+Math.round(a/255*5)},e.ansi16.rgb=function(n){let r=n%10;if(r===0||r===7)return n>50&&(r+=3.5),r=r/10.5*255,[r,r,r];const s=.5*(1+~~(n>50));return[(1&r)*s*255,(r>>1&1)*s*255,(r>>2&1)*s*255]},e.ansi256.rgb=function(n){if(n>=232){const s=10*(n-232)+8;return[s,s,s]}let r;return n-=16,[Math.floor(n/36)/5*255,Math.floor((r=n%36)/6)/5*255,r%6/5*255]},e.rgb.hex=function(n){const r=(((255&Math.round(n[0]))<<16)+((255&Math.round(n[1]))<<8)+(255&Math.round(n[2]))).toString(16).toUpperCase();return"000000".substring(r.length)+r},e.hex.rgb=function(n){const r=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!r)return[0,0,0];let s=r[0];r[0].length===3&&(s=s.split("").map(l=>l+l).join(""));const a=parseInt(s,16);return[a>>16&255,a>>8&255,255&a]},e.rgb.hcg=function(n){const r=n[0]/255,s=n[1]/255,a=n[2]/255,l=Math.max(Math.max(r,s),a),c=Math.min(Math.min(r,s),a),h=l-c;let d,p;return d=h<1?c/(1-h):0,p=h<=0?0:l===r?(s-a)/h%6:l===s?2+(a-r)/h:4+(r-s)/h,p/=6,p%=1,[360*p,100*h,100*d]},e.hsl.hcg=function(n){const r=n[1]/100,s=n[2]/100,a=s<.5?2*r*s:2*r*(1-s);let l=0;return a<1&&(l=(s-.5*a)/(1-a)),[n[0],100*a,100*l]},e.hsv.hcg=function(n){const r=n[1]/100,s=n[2]/100,a=r*s;let l=0;return a<1&&(l=(s-a)/(1-a)),[n[0],100*a,100*l]},e.hcg.rgb=function(n){const r=n[0]/360,s=n[1]/100,a=n[2]/100;if(s===0)return[255*a,255*a,255*a];const l=[0,0,0],c=r%1*6,h=c%1,d=1-h;let p=0;switch(Math.floor(c)){case 0:l[0]=1,l[1]=h,l[2]=0;break;case 1:l[0]=d,l[1]=1,l[2]=0;break;case 2:l[0]=0,l[1]=1,l[2]=h;break;case 3:l[0]=0,l[1]=d,l[2]=1;break;case 4:l[0]=h,l[1]=0,l[2]=1;break;default:l[0]=1,l[1]=0,l[2]=d}return p=(1-s)*a,[255*(s*l[0]+p),255*(s*l[1]+p),255*(s*l[2]+p)]},e.hcg.hsv=function(n){const r=n[1]/100,s=r+n[2]/100*(1-r);let a=0;return s>0&&(a=r/s),[n[0],100*a,100*s]},e.hcg.hsl=function(n){const r=n[1]/100,s=n[2]/100*(1-r)+.5*r;let a=0;return s>0&&s<.5?a=r/(2*s):s>=.5&&s<1&&(a=r/(2*(1-s))),[n[0],100*a,100*s]},e.hcg.hwb=function(n){const r=n[1]/100,s=r+n[2]/100*(1-r);return[n[0],100*(s-r),100*(1-s)]},e.hwb.hcg=function(n){const r=n[1]/100,s=1-n[2]/100,a=s-r;let l=0;return a<1&&(l=(s-a)/(1-a)),[n[0],100*a,100*l]},e.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]},e.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]},e.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]},e.gray.hsl=function(n){return[0,0,n[0]]},e.gray.hsv=e.gray.hsl,e.gray.hwb=function(n){return[0,100,n[0]]},e.gray.cmyk=function(n){return[0,0,0,n[0]]},e.gray.lab=function(n){return[n[0],0,0]},e.gray.hex=function(n){const r=255&Math.round(n[0]/100*255),s=((r<<16)+(r<<8)+r).toString(16).toUpperCase();return"000000".substring(s.length)+s},e.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]},tn}function yr(){if(ro)return io;ro=1;const o=co();function t(n){const r=function(){const a={},l=Object.keys(o);for(let c=l.length,h=0;h<c;h++)a[l[h]]={distance:-1,parent:null};return a}(),s=[n];for(r[n].distance=0;s.length;){const a=s.pop(),l=Object.keys(o[a]);for(let c=l.length,h=0;h<c;h++){const d=l[h],p=r[d];p.distance===-1&&(p.distance=r[a].distance+1,p.parent=a,s.unshift(d))}}return r}function e(n,r){return function(s){return r(n(s))}}function i(n,r){const s=[r[n].parent,n];let a=o[r[n].parent][n],l=r[n].parent;for(;r[l].parent;)s.unshift(r[l].parent),a=e(o[r[l].parent][l],a),l=r[l].parent;return a.conversion=s,a}return io=function(n){const r=t(n),s={},a=Object.keys(r);for(let l=a.length,c=0;c<l;c++){const h=a[c];r[h].parent!==null&&(s[h]=i(h,r))}return s}}function vr(){if(ao)return so;ao=1;const o=co(),t=yr(),e={};return Object.keys(o).forEach(i=>{e[i]={},Object.defineProperty(e[i],"channels",{value:o[i].channels}),Object.defineProperty(e[i],"labels",{value:o[i].labels});const n=t(i);Object.keys(n).forEach(r=>{const s=n[r];e[i][r]=function(a){const l=function(...c){const h=c[0];if(h==null)return h;h.length>1&&(c=h);const d=a(c);if(typeof d=="object")for(let p=d.length,g=0;g<p;g++)d[g]=Math.round(d[g]);return d};return"conversion"in a&&(l.conversion=a.conversion),l}(s),e[i][r].raw=function(a){const l=function(...c){const h=c[0];return h==null?h:(h.length>1&&(c=h),a(c))};return"conversion"in a&&(l.conversion=a.conversion),l}(s)})}),so=e}(function(o){const t=(c,h)=>(...d)=>"\x1B[".concat(c(...d)+h,"m"),e=(c,h)=>(...d)=>{const p=c(...d);return"\x1B[".concat(38+h,";5;").concat(p,"m")},i=(c,h)=>(...d)=>{const p=c(...d);return"\x1B[".concat(38+h,";2;").concat(p[0],";").concat(p[1],";").concat(p[2],"m")},n=c=>c,r=(c,h,d)=>[c,h,d],s=(c,h,d)=>{Object.defineProperty(c,h,{get:()=>{const p=d();return Object.defineProperty(c,h,{value:p,enumerable:!0,configurable:!0}),p},enumerable:!0,configurable:!0})};let a;const l=(c,h,d,p)=>{a===void 0&&(a=vr());const g=p?10:0,u={};for(const[m,f]of Object.entries(a)){const b=m==="ansi16"?"ansi":m;m===h?u[b]=c(d,g):typeof f=="object"&&(u[b]=c(f[h],g))}return u};Object.defineProperty(o,"exports",{enumerable:!0,get:function(){const c=new Map,h={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};h.color.gray=h.color.blackBright,h.bgColor.bgGray=h.bgColor.bgBlackBright,h.color.grey=h.color.blackBright,h.bgColor.bgGrey=h.bgColor.bgBlackBright;for(const[d,p]of Object.entries(h)){for(const[g,u]of Object.entries(p))h[g]={open:"\x1B[".concat(u[0],"m"),close:"\x1B[".concat(u[1],"m")},p[g]=h[g],c.set(u[0],u[1]);Object.defineProperty(h,d,{value:p,enumerable:!1})}return Object.defineProperty(h,"codes",{value:c,enumerable:!1}),h.color.close="\x1B[39m",h.bgColor.close="\x1B[49m",s(h.color,"ansi",()=>l(t,"ansi16",n,!1)),s(h.color,"ansi256",()=>l(e,"ansi256",n,!1)),s(h.color,"ansi16m",()=>l(i,"rgb",r,!1)),s(h.bgColor,"ansi",()=>l(t,"ansi16",n,!0)),s(h.bgColor,"ansi256",()=>l(e,"ansi256",n,!0)),s(h.bgColor,"ansi16m",()=>l(i,"rgb",r,!0)),h}})})(lo);var en,ho,xr={stringReplaceAll:(o,t,e)=>{let i=o.indexOf(t);if(i===-1)return o;const n=t.length;let r=0,s="";do s+=o.substr(r,i-r)+t+e,r=i+n,i=o.indexOf(t,r);while(i!==-1);return s+=o.substr(r),s},stringEncaseCRLFWithFirstIndex:(o,t,e,i)=>{let n=0,r="";do{const s=o[i-1]==="\r";r+=o.substr(n,(s?i-1:i)-n)+t+(s?"\r\n":"\n")+e,n=i+1,i=o.indexOf("\n",n)}while(i!==-1);return r+=o.substr(n),r}};const Xt=lo.exports,{stdout:nn,stderr:on}={stdout:!1,stderr:!1},{stringReplaceAll:wr,stringEncaseCRLFWithFirstIndex:kr}=xr,{isArray:ue}=Array,po=["ansi","ansi","ansi256","ansi16m"],Lt=Object.create(null);class $r{constructor(t){return uo(t)}}const uo=o=>{const t={};return((e,i={})=>{if(i.level&&!(Number.isInteger(i.level)&&i.level>=0&&i.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=nn?nn.level:0;e.level=i.level===void 0?n:i.level})(t,o),t.template=(...e)=>mo(t.template,...e),Object.setPrototypeOf(t,ge.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=$r,t.template};function ge(o){return uo(o)}for(const[o,t]of Object.entries(Xt))Lt[o]={get(){const e=fe(this,rn(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,o,{value:e}),e}};Lt.visible={get(){const o=fe(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:o}),o}};const go=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const o of go)Lt[o]={get(){const{level:t}=this;return function(...e){const i=rn(Xt.color[po[t]][o](...e),Xt.color.close,this._styler);return fe(this,i,this._isEmpty)}}};for(const o of go)Lt["bg"+o[0].toUpperCase()+o.slice(1)]={get(){const{level:t}=this;return function(...e){const i=rn(Xt.bgColor[po[t]][o](...e),Xt.bgColor.close,this._styler);return fe(this,i,this._isEmpty)}}};const _r=Object.defineProperties(()=>{},V(C({},Lt),{level:{enumerable:!0,get(){return this._generator.level},set(o){this._generator.level=o}}})),rn=(o,t,e)=>{let i,n;return e===void 0?(i=o,n=t):(i=e.openAll+o,n=t+e.closeAll),{open:o,close:t,openAll:i,closeAll:n,parent:e}},fe=(o,t,e)=>{const i=(...n)=>ue(n[0])&&ue(n[0].raw)?fo(i,mo(i,...n)):fo(i,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(i,_r),i._generator=o,i._styler=t,i._isEmpty=e,i},fo=(o,t)=>{if(o.level<=0||!t)return o._isEmpty?"":t;let e=o._styler;if(e===void 0)return t;const{openAll:i,closeAll:n}=e;if(t.indexOf("\x1B")!==-1)for(;e!==void 0;)t=wr(t,e.close,e.open),e=e.parent;const r=t.indexOf("\n");return r!==-1&&(t=kr(t,n,i,r)),i+t+n};let sn;const mo=(o,...t)=>{const[e]=t;if(!ue(e)||!ue(e.raw))return t.join(" ");const i=t.slice(1),n=[e.raw[0]];for(let r=1;r<e.length;r++)n.push(String(i[r-1]).replace(/[{}\\]/g,"\\$&"),String(e.raw[r]));return sn===void 0&&(sn=function(){if(ho)return en;ho=1;const r=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,s=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,a=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,l=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,c=new Map([["n","\n"],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function h(u){const m=u[0]==="u",f=u[1]==="{";return m&&!f&&u.length===5||u[0]==="x"&&u.length===3?String.fromCharCode(parseInt(u.slice(1),16)):m&&f?String.fromCodePoint(parseInt(u.slice(2,-1),16)):c.get(u)||u}function d(u,m){const f=[],b=m.trim().split(/\s*,\s*/g);let y;for(const v of b){const _=Number(v);if(Number.isNaN(_)){if(!(y=v.match(a)))throw new Error("Invalid Chalk template style argument: ".concat(v," (in style '").concat(u,"')"));f.push(y[2].replace(l,(T,x,A)=>x?h(x):A))}else f.push(_)}return f}function p(u){s.lastIndex=0;const m=[];let f;for(;(f=s.exec(u))!==null;){const b=f[1];if(f[2]){const y=d(b,f[2]);m.push([b].concat(y))}else m.push([b])}return m}function g(u,m){const f={};for(const y of m)for(const v of y.styles)f[v[0]]=y.inverse?null:v.slice(1);let b=u;for(const[y,v]of Object.entries(f))if(Array.isArray(v)){if(!(y in b))throw new Error("Unknown Chalk style: ".concat(y));b=v.length>0?b[y](...v):b[y]}return b}return en=(u,m)=>{const f=[],b=[];let y=[];if(m.replace(r,(v,_,T,x,A,j)=>{if(_)y.push(h(_));else if(x){const K=y.join("");y=[],b.push(f.length===0?K:g(u,f)(K)),f.push({inverse:T,styles:p(x)})}else if(A){if(f.length===0)throw new Error("Found extraneous } in Chalk template literal");b.push(g(u,f)(y.join(""))),y=[],f.pop()}else y.push(j)}),b.push(y.join("")),f.length>0){const v="Chalk template literal is missing ".concat(f.length," closing bracket").concat(f.length===1?"":"s"," (`}`)");throw new Error(v)}return b.join("")},en}()),sn(o,n.join(""))};Object.defineProperties(ge.prototype,Lt);const an=ge();an.supportsColor=nn,an.stderr=ge({level:on?on.level:0}),an.stderr.supportsColor=on;var wt={exports:{}};const Sr=new Proxy({},{get(o,t){throw new Error('Module "" has been externalized for browser compatibility. Cannot access ".'.concat(t,'" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.'))}}),Cr=pe(Object.freeze(Object.defineProperty({__proto__:null,default:Sr},Symbol.toStringTag,{value:"Module"}))),Tr=pe(fr),Mr=pe(br),Pr=new Proxy({},{get(o,t){throw new Error('Module "crypto" has been externalized for browser compatibility. Cannot access "crypto.'.concat(t,'" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.'))}}),Er=Object.freeze(Object.defineProperty({__proto__:null,default:Pr},Symbol.toStringTag,{value:"Module"})),ln=Cr,cn=Tr,Rr=Mr,Ar=pe(Er),hn="16.4.5",zr=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function dn(o){console.log("[dotenv@".concat(hn,"][DEBUG] ").concat(o))}function bo(o){return o&&o.DOTENV_KEY&&o.DOTENV_KEY.length>0?o.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Ir(o,t){let e;try{e=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){const l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}const i=e.password;if(!i){const a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}const n=e.searchParams.get("environment");if(!n){const a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}const r="DOTENV_VAULT_".concat(n.toUpperCase()),s=o.parsed[r];if(!s){const a=new Error("NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ".concat(r," in your .env.vault file."));throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:i}}function yo(o){let t=null;if(o&&o.path&&o.path.length>0)if(Array.isArray(o.path))for(const e of o.path)ln.existsSync(e)&&(t=e.endsWith(".vault")?e:"".concat(e,".vault"));else t=o.path.endsWith(".vault")?o.path:"".concat(o.path,".vault");else t=cn.resolve(process.cwd(),".env.vault");return ln.existsSync(t)?t:null}function vo(o){return o[0]==="~"?cn.join(Rr.homedir(),o.slice(1)):o}const U={configDotenv:function(o){const t=cn.resolve(process.cwd(),".env");let e="utf8";const i=!!(o&&o.debug);o&&o.encoding?e=o.encoding:i&&dn("No encoding is specified. UTF-8 is used by default");let n,r=[t];if(o&&o.path)if(Array.isArray(o.path)){r=[];for(const l of o.path)r.push(vo(l))}else r=[vo(o.path)];const s={};for(const l of r)try{const c=U.parse(ln.readFileSync(l,{encoding:e}));U.populate(s,c,o)}catch(c){i&&dn("Failed to load ".concat(l," ").concat(c.message)),n=c}let a=process.env;return o&&o.processEnv!=null&&(a=o.processEnv),U.populate(a,s,o),n?{parsed:s,error:n}:{parsed:s}},_configVault:function(o){var t;t="Loading env from encrypted .env.vault",console.log("[dotenv@".concat(hn,"][INFO] ").concat(t));const e=U._parseVault(o);let i=process.env;return o&&o.processEnv!=null&&(i=o.processEnv),U.populate(i,e,o),{parsed:e}},_parseVault:function(o){const t=yo(o),e=U.configDotenv({path:t});if(!e.parsed){const s=new Error("MISSING_DATA: Cannot parse ".concat(t," for an unknown reason"));throw s.code="MISSING_DATA",s}const i=bo(o).split(","),n=i.length;let r;for(let s=0;s<n;s++)try{const a=Ir(e,i[s].trim());r=U.decrypt(a.ciphertext,a.key);break}catch(a){if(s+1>=n)throw a}return U.parse(r)},config:function(o){if(bo(o).length===0)return U.configDotenv(o);const t=yo(o);return t?U._configVault(o):(e="You set DOTENV_KEY but you are missing a .env.vault file at ".concat(t,". Did you forget to build it?"),console.log("[dotenv@".concat(hn,"][WARN] ").concat(e)),U.configDotenv(o));var e},decrypt:function(o,t){const e=Buffer.from(t.slice(-64),"hex");let i=Buffer.from(o,"base64");const n=i.subarray(0,12),r=i.subarray(-16);i=i.subarray(12,-16);try{const s=Ar.createDecipheriv("aes-256-gcm",e,n);return s.setAuthTag(r),"".concat(s.update(i)).concat(s.final())}catch(s){const a=s instanceof RangeError,l=s.message==="Invalid key length",c=s.message==="Unsupported state or unable to authenticate data";if(a||l){const h=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw h.code="INVALID_DOTENV_KEY",h}if(c){const h=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw h.code="DECRYPTION_FAILED",h}throw s}},parse:function(o){const t={};let e,i=o.toString();for(i=i.replace(/\r\n?/gm,"\n");(e=zr.exec(i))!=null;){const n=e[1];let r=e[2]||"";r=r.trim();const s=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),s==='"'&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[n]=r}return t},populate:function(o,t,e={}){const i=!!(e&&e.debug),n=!!(e&&e.override);if(typeof t!="object"){const r=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw r.code="OBJECT_REQUIRED",r}for(const r of Object.keys(t))Object.prototype.hasOwnProperty.call(o,r)?(n===!0&&(o[r]=t[r]),i&&dn(n===!0?'"'.concat(r,'" is already defined and WAS overwritten'):'"'.concat(r,'" is already defined and was NOT overwritten'))):o[r]=t[r]}};wt.exports.configDotenv=U.configDotenv,wt.exports._configVault=U._configVault,wt.exports._parseVault=U._parseVault,wt.exports.config=U.config,wt.exports.decrypt=U.decrypt,wt.exports.parse=U.parse,wt.exports.populate=U.populate,wt.exports=U;const xo="{file}",wo="{line}",ko="{column}";class Nr{constructor(){this.parts=[]}push(t,e){return this.parts.push({text:t,style:e}),this}line(){return this.parts.push({text:"\n",style:""}),this}merge(t){return this.parts.push(...t.parts),this}build(){const t=[],e=[];for(const i of this.parts)i.text==="\n"?t.push("\n"):(t.push("%c".concat(i.text)),e.push(i.style));return{text:t.join(""),styles:e}}log(){const{text:t,styles:e}=this.build();console.log(t,...e)}warn(){const{text:t,styles:e}=this.build();console.warn(t,...e)}error(){const{text:t,styles:e}=this.build();console.error(t,...e)}groupCollapsed(t){const{text:e,styles:i}=this.build();console.groupCollapsed(e,...i),t(),console.groupEnd()}group(t){const{text:e,styles:i}=this.build();console.group(e,...i),t(),console.groupEnd()}blue(t){return this.push(t,"color: #006aff; word-break: break-word;")}green(t){return this.push(t,"color: #00B42A; word-break: break-word;")}yellow(t){return this.push(t,"color: #FF7D00; word-break: break-word;")}red(t){return this.push(t,"color: #F53F3F; word-break: break-word;")}gray(t){return this.push(t,"color: #86909C; word-break: break-word;")}text(t){return this.push(t,"")}styled(t,e){return this.push(t,e)}bold(t){return t!==void 0?this.push(t,"font-weight: bold;"):(this.parts.length>0&&(this.parts[this.parts.length-1].style+=" font-weight: bold;"),this)}style(t){return this.parts.length>0&&(this.parts[this.parts.length-1].style+=t),this}}const Lr=Object.fromEntries(["blue","green","yellow","red","gray","bold","text","styled"].map(o=>[o,(...t)=>{const e=new Nr;return e[o].apply(e,t)}]));class pn extends to{constructor(t){if(super(t),this._value=O,t.type!==ur)throw new Error("".concat(this.constructor.directiveName,"() can only be used in child bindings"))}render(t){if(t===O||t==null)return this._templateResult=void 0,this._value=t;if(t===xt)return t;if(typeof t!="string")throw new Error("".concat(this.constructor.directiveName,"() called with a non-string value"));if(t===this._value)return this._templateResult;this._value=t;const e=[t];return e.raw=e,this._templateResult={_$litType$:this.constructor.resultType,strings:e,values:[]}}}pn.directiveName="unsafeHTML",pn.resultType=1;const $o=Jn(pn),un=Math.min,Dt=Math.max,me=Math.round,ct=o=>({x:o,y:o}),Dr={left:"right",right:"left",bottom:"top",top:"bottom"},Or={start:"end",end:"start"};function _o(o,t,e){return Dt(o,un(t,e))}function be(o,t){return typeof o=="function"?o(t):o}function Mt(o){return o.split("-")[0]}function ye(o){return o.split("-")[1]}function So(o){return o==="x"?"y":"x"}function Co(o){return o==="y"?"height":"width"}const jr=new Set(["top","bottom"]);function kt(o){return jr.has(Mt(o))?"y":"x"}function To(o){return So(kt(o))}function gn(o){return o.replace(/start|end/g,t=>Or[t])}const Mo=["left","right"],Po=["right","left"],Vr=["top","bottom"],Br=["bottom","top"];function Ur(o,t,e,i){const n=ye(o);let r=function(s,a,l){switch(s){case"top":case"bottom":return l?a?Po:Mo:a?Mo:Po;case"left":case"right":return a?Vr:Br;default:return[]}}(Mt(o),e==="start",i);return n&&(r=r.map(s=>s+"-"+n),t&&(r=r.concat(r.map(gn)))),r}function ve(o){return o.replace(/left|right|bottom|top/g,t=>Dr[t])}function xe(o){const{x:t,y:e,width:i,height:n}=o;return{width:i,height:n,top:e,left:t,right:t+i,bottom:e+n,x:t,y:e}}function Eo(o,t,e){let{reference:i,floating:n}=o;const r=kt(t),s=To(t),a=Co(s),l=Mt(t),c=r==="y",h=i.x+i.width/2-n.width/2,d=i.y+i.height/2-n.height/2,p=i[a]/2-n[a]/2;let g;switch(l){case"top":g={x:h,y:i.y-n.height};break;case"bottom":g={x:h,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:d};break;case"left":g={x:i.x-n.width,y:d};break;default:g={x:i.x,y:i.y}}switch(ye(t)){case"start":g[s]-=p*(e&&c?-1:1);break;case"end":g[s]+=p*(e&&c?-1:1)}return g}function Wr(o,t){return B(this,null,function*(){var e;t===void 0&&(t={});const{x:i,y:n,platform:r,rects:s,elements:a,strategy:l}=o,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:p=!1,padding:g=0}=be(t,o),u=function(T){return typeof T!="number"?function(x){return C({top:0,right:0,bottom:0,left:0},x)}(T):{top:T,right:T,bottom:T,left:T}}(g),m=a[p?d==="floating"?"reference":"floating":d],f=xe(yield r.getClippingRect({element:(e=yield r.isElement==null?void 0:r.isElement(m))==null||e?m:m.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),b=d==="floating"?{x:i,y:n,width:s.floating.width,height:s.floating.height}:s.reference,y=yield r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating),v=(yield r.isElement==null?void 0:r.isElement(y))&&(yield r.getScale==null?void 0:r.getScale(y))||{x:1,y:1},_=xe(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:y,strategy:l}):b);return{top:(f.top-_.top+u.top)/v.y,bottom:(_.bottom-f.bottom+u.bottom)/v.y,left:(f.left-_.left+u.left)/v.x,right:(_.right-f.right+u.right)/v.x}})}const qr=new Set(["left","top"]);function we(){return typeof window!="undefined"}function Ot(o){return Ro(o)?(o.nodeName||"").toLowerCase():"#document"}function X(o){var t;return(o==null||(t=o.ownerDocument)==null?void 0:t.defaultView)||window}function ft(o){var t;return(t=(Ro(o)?o.ownerDocument:o.document)||window.document)==null?void 0:t.documentElement}function Ro(o){return!!we()&&(o instanceof Node||o instanceof X(o).Node)}function J(o){return!!we()&&(o instanceof Element||o instanceof X(o).Element)}function ht(o){return!!we()&&(o instanceof HTMLElement||o instanceof X(o).HTMLElement)}function Ao(o){return!(!we()||typeof ShadowRoot=="undefined")&&(o instanceof ShadowRoot||o instanceof X(o).ShadowRoot)}const Fr=new Set(["inline","contents"]);function Zt(o){const{overflow:t,overflowX:e,overflowY:i,display:n}=tt(o);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&!Fr.has(n)}const Hr=new Set(["table","td","th"]);function Yr(o){return Hr.has(Ot(o))}const Kr=[":popover-open",":modal"];function ke(o){return Kr.some(t=>{try{return o.matches(t)}catch(e){return!1}})}const Xr=["transform","translate","scale","rotate","perspective"],Zr=["transform","translate","scale","rotate","perspective","filter"],Gr=["paint","layout","strict","content"];function fn(o){const t=mn(),e=J(o)?tt(o):o;return Xr.some(i=>!!e[i]&&e[i]!=="none")||!!e.containerType&&e.containerType!=="normal"||!t&&!!e.backdropFilter&&e.backdropFilter!=="none"||!t&&!!e.filter&&e.filter!=="none"||Zr.some(i=>(e.willChange||"").includes(i))||Gr.some(i=>(e.contain||"").includes(i))}function mn(){return!(typeof CSS=="undefined"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Qr=new Set(["html","body","#document"]);function jt(o){return Qr.has(Ot(o))}function tt(o){return X(o).getComputedStyle(o)}function $e(o){return J(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:{scrollLeft:o.scrollX,scrollTop:o.scrollY}}function $t(o){if(Ot(o)==="html")return o;const t=o.assignedSlot||o.parentNode||Ao(o)&&o.host||ft(o);return Ao(t)?t.host:t}function zo(o){const t=$t(o);return jt(t)?o.ownerDocument?o.ownerDocument.body:o.body:ht(t)&&Zt(t)?t:zo(t)}function bn(o,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);const n=zo(o),r=n===((i=o.ownerDocument)==null?void 0:i.body),s=X(n);if(r){const a=yn(s);return t.concat(s,s.visualViewport||[],Zt(n)?n:[],a&&e?bn(a):[])}return t.concat(n,bn(n,[],e))}function yn(o){return o.parent&&Object.getPrototypeOf(o.parent)?o.frameElement:null}function Io(o){const t=tt(o);let e=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const n=ht(o),r=n?o.offsetWidth:e,s=n?o.offsetHeight:i,a=me(e)!==r||me(i)!==s;return a&&(e=r,i=s),{width:e,height:i,$:a}}function No(o){return J(o)?o:o.contextElement}function Vt(o){const t=No(o);if(!ht(t))return ct(1);const e=t.getBoundingClientRect(),{width:i,height:n,$:r}=Io(t);let s=(r?me(e.width):e.width)/i,a=(r?me(e.height):e.height)/n;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Jr=ct(0);function Lo(o){const t=X(o);return mn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Jr}function Gt(o,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);const n=o.getBoundingClientRect(),r=No(o);let s=ct(1);t&&(i?J(i)&&(s=Vt(i)):s=Vt(o));const a=function(p,g,u){return g===void 0&&(g=!1),!(!u||g&&u!==X(p))&&g}(r,e,i)?Lo(r):ct(0);let l=(n.left+a.x)/s.x,c=(n.top+a.y)/s.y,h=n.width/s.x,d=n.height/s.y;if(r){const p=X(r),g=i&&J(i)?X(i):i;let u=p,m=yn(u);for(;m&&i&&g!==u;){const f=Vt(m),b=m.getBoundingClientRect(),y=tt(m),v=b.left+(m.clientLeft+parseFloat(y.paddingLeft))*f.x,_=b.top+(m.clientTop+parseFloat(y.paddingTop))*f.y;l*=f.x,c*=f.y,h*=f.x,d*=f.y,l+=v,c+=_,u=X(m),m=yn(u)}}return xe({width:h,height:d,x:l,y:c})}function _e(o,t){const e=$e(o).scrollLeft;return t?t.left+e:Gt(ft(o)).left+e}function Do(o,t){const e=o.getBoundingClientRect();return{x:e.left+t.scrollLeft-_e(o,e),y:e.top+t.scrollTop}}const Oo=25,ts=new Set(["absolute","fixed"]);function jo(o,t,e){let i;if(t==="viewport")i=function(n,r){const s=X(n),a=ft(n),l=s.visualViewport;let c=a.clientWidth,h=a.clientHeight,d=0,p=0;if(l){c=l.width,h=l.height;const u=mn();(!u||u&&r==="fixed")&&(d=l.offsetLeft,p=l.offsetTop)}const g=_e(a);if(g<=0){const u=a.ownerDocument,m=u.body,f=getComputedStyle(m),b=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,y=Math.abs(a.clientWidth-m.clientWidth-b);y<=Oo&&(c-=y)}else g<=Oo&&(c+=g);return{width:c,height:h,x:d,y:p}}(o,e);else if(t==="document")i=function(n){const r=ft(n),s=$e(n),a=n.ownerDocument.body,l=Dt(r.scrollWidth,r.clientWidth,a.scrollWidth,a.clientWidth),c=Dt(r.scrollHeight,r.clientHeight,a.scrollHeight,a.clientHeight);let h=-s.scrollLeft+_e(n);const d=-s.scrollTop;return tt(a).direction==="rtl"&&(h+=Dt(r.clientWidth,a.clientWidth)-l),{width:l,height:c,x:h,y:d}}(ft(o));else if(J(t))i=function(n,r){const s=Gt(n,!0,r==="fixed"),a=s.top+n.clientTop,l=s.left+n.clientLeft,c=ht(n)?Vt(n):ct(1);return{width:n.clientWidth*c.x,height:n.clientHeight*c.y,x:l*c.x,y:a*c.y}}(t,e);else{const n=Lo(o);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return xe(i)}function Vo(o,t){const e=$t(o);return!(e===t||!J(e)||jt(e))&&(tt(e).position==="fixed"||Vo(e,t))}function es(o,t,e){const i=ht(t),n=ft(t),r=e==="fixed",s=Gt(o,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=ct(0);function c(){l.x=_e(n)}if(i||!i&&!r)if((Ot(t)!=="body"||Zt(n))&&(a=$e(t)),i){const d=Gt(t,!0,r,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else n&&c();r&&!i&&n&&c();const h=!n||i||r?ct(0):Do(n,a);return{x:s.left+a.scrollLeft-l.x-h.x,y:s.top+a.scrollTop-l.y-h.y,width:s.width,height:s.height}}function vn(o){return tt(o).position==="static"}function Bo(o,t){if(!ht(o)||tt(o).position==="fixed")return null;if(t)return t(o);let e=o.offsetParent;return ft(o)===e&&(e=e.ownerDocument.body),e}function Uo(o,t){const e=X(o);if(ke(o))return e;if(!ht(o)){let n=$t(o);for(;n&&!jt(n);){if(J(n)&&!vn(n))return n;n=$t(n)}return e}let i=Bo(o,t);for(;i&&Yr(i)&&vn(i);)i=Bo(i,t);return i&&jt(i)&&vn(i)&&!fn(i)?e:i||function(n){let r=$t(n);for(;ht(r)&&!jt(r);){if(fn(r))return r;if(ke(r))return null;r=$t(r)}return null}(o)||e}const ns={convertOffsetParentRelativeRectToViewportRelativeRect:function(o){let{elements:t,rect:e,offsetParent:i,strategy:n}=o;const r=n==="fixed",s=ft(i),a=!!t&&ke(t.floating);if(i===s||a&&r)return e;let l={scrollLeft:0,scrollTop:0},c=ct(1);const h=ct(0),d=ht(i);if((d||!d&&!r)&&((Ot(i)!=="body"||Zt(s))&&(l=$e(i)),ht(i))){const g=Gt(i);c=Vt(i),h.x=g.x+i.clientLeft,h.y=g.y+i.clientTop}const p=!s||d||r?ct(0):Do(s,l);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+h.x+p.x,y:e.y*c.y-l.scrollTop*c.y+h.y+p.y}},getDocumentElement:ft,getClippingRect:function(o){let{element:t,boundary:e,rootBoundary:i,strategy:n}=o;const r=[...e==="clippingAncestors"?ke(t)?[]:function(l,c){const h=c.get(l);if(h)return h;let d=bn(l,[],!1).filter(m=>J(m)&&Ot(m)!=="body"),p=null;const g=tt(l).position==="fixed";let u=g?$t(l):l;for(;J(u)&&!jt(u);){const m=tt(u),f=fn(u);f||m.position!=="fixed"||(p=null),(g?!f&&!p:!f&&m.position==="static"&&p&&ts.has(p.position)||Zt(u)&&!f&&Vo(l,u))?d=d.filter(b=>b!==u):p=m,u=$t(u)}return c.set(l,d),d}(t,this._c):[].concat(e),i],s=r[0],a=r.reduce((l,c)=>{const h=jo(t,c,n);return l.top=Dt(h.top,l.top),l.right=un(h.right,l.right),l.bottom=un(h.bottom,l.bottom),l.left=Dt(h.left,l.left),l},jo(t,s,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Uo,getElementRects:function(o){return B(this,null,function*(){const t=this.getOffsetParent||Uo,e=this.getDimensions,i=yield e(o.floating);return{reference:es(o.reference,yield t(o.floating),o.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})},getClientRects:function(o){return Array.from(o.getClientRects())},getDimensions:function(o){const{width:t,height:e}=Io(o);return{width:t,height:e}},getScale:Vt,isElement:J,isRTL:function(o){return tt(o).direction==="rtl"}},os=function(o){return o===void 0&&(o=0),{name:"offset",options:o,fn(e){return B(this,null,function*(){var i,n;const{x:r,y:s,placement:a,middlewareData:l}=e,c=yield function(h,d){return B(this,null,function*(){const{placement:p,platform:g,elements:u}=h,m=yield g.isRTL==null?void 0:g.isRTL(u.floating),f=Mt(p),b=ye(p),y=kt(p)==="y",v=qr.has(f)?-1:1,_=m&&y?-1:1,T=be(d,h);let{mainAxis:x,crossAxis:A,alignmentAxis:j}=typeof T=="number"?{mainAxis:T,crossAxis:0,alignmentAxis:null}:{mainAxis:T.mainAxis||0,crossAxis:T.crossAxis||0,alignmentAxis:T.alignmentAxis};return b&&typeof j=="number"&&(A=b==="end"?-1*j:j),y?{x:A*_,y:x*v}:{x:x*v,y:A*_}})}(e,o);return a===((i=l.offset)==null?void 0:i.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:V(C({},c),{placement:a})}})}}},is=function(o){return o===void 0&&(o={}),{name:"shift",options:o,fn(e){return B(this,null,function*(){const{x:i,y:n,placement:r,platform:s}=e,y=be(o,e),{mainAxis:a=!0,crossAxis:l=!1,limiter:c={fn:v=>{let{x:_,y:T}=v;return{x:_,y:T}}}}=y,h=In(y,["mainAxis","crossAxis","limiter"]),d={x:i,y:n},p=yield s.detectOverflow(e,h),g=kt(Mt(r)),u=So(g);let m=d[u],f=d[g];if(a){const v=u==="y"?"bottom":"right";m=_o(m+p[u==="y"?"top":"left"],m,m-p[v])}if(l){const v=g==="y"?"bottom":"right";f=_o(f+p[g==="y"?"top":"left"],f,f-p[v])}const b=c.fn(V(C({},e),{[u]:m,[g]:f}));return V(C({},b),{data:{x:b.x-i,y:b.y-n,enabled:{[u]:a,[g]:l}}})})}}},rs=function(o){return o===void 0&&(o={}),{name:"flip",options:o,fn(e){return B(this,null,function*(){var i,n;const{placement:r,middlewareData:s,rects:a,initialPlacement:l,platform:c,elements:h}=e,ci=be(o,e),{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:f=!0}=ci,b=In(ci,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((i=s.arrow)!=null&&i.alignmentOffset)return{};const y=Mt(r),v=kt(l),_=Mt(l)===l,T=yield c.isRTL==null?void 0:c.isRTL(h.floating),x=g||(_||!f?[ve(l)]:function(pt){const yt=ve(pt);return[gn(pt),yt,gn(yt)]}(l)),A=m!=="none";!g&&A&&x.push(...Ur(l,f,m,T));const j=[l,...x],K=yield c.detectOverflow(e,b),dt=[];let ot=((n=s.flip)==null?void 0:n.overflows)||[];if(d&&dt.push(K[y]),p){const pt=function(yt,_t,G){G===void 0&&(G=!1);const it=ye(yt),rt=To(yt),Ae=Co(rt);let ze=rt==="x"?it===(G?"end":"start")?"right":"left":it==="start"?"bottom":"top";return _t.reference[Ae]>_t.floating[Ae]&&(ze=ve(ze)),[ze,ve(ze)]}(r,a,T);dt.push(K[pt[0]],K[pt[1]])}if(ot=[...ot,{placement:r,overflows:dt}],!dt.every(pt=>pt<=0)){var Z,D;const pt=(((Z=s.flip)==null?void 0:Z.index)||0)+1,yt=j[pt];if(yt&&(!(p==="alignment"&&v!==kt(yt))||ot.every(G=>kt(G.placement)!==v||G.overflows[0]>0)))return{data:{index:pt,overflows:ot},reset:{placement:yt}};let _t=(D=ot.filter(G=>G.overflows[0]<=0).sort((G,it)=>G.overflows[1]-it.overflows[1])[0])==null?void 0:D.placement;if(!_t)switch(u){case"bestFit":{var li;const G=(li=ot.filter(it=>{if(A){const rt=kt(it.placement);return rt===v||rt==="y"}return!0}).map(it=>[it.placement,it.overflows.filter(rt=>rt>0).reduce((rt,Ae)=>rt+Ae,0)]).sort((it,rt)=>it[1]-rt[1])[0])==null?void 0:li[0];G&&(_t=G);break}case"initialPlacement":_t=l}if(r!==_t)return{reset:{placement:_t}}}return{}})}}},ss=(o,t,e)=>{const i=new Map,n=C({platform:ns},e),r=V(C({},n.platform),{_c:i});return((s,a,l)=>B(this,null,function*(){const{placement:c="bottom",strategy:h="absolute",middleware:d=[],platform:p}=l,g=d.filter(Boolean),u=yield p.isRTL==null?void 0:p.isRTL(a);let m=yield p.getElementRects({reference:s,floating:a,strategy:h}),{x:f,y:b}=Eo(m,c,u),y=c,v={},_=0;for(let x=0;x<g.length;x++){var T;const{name:A,fn:j}=g[x],{x:K,y:dt,data:ot,reset:Z}=yield j({x:f,y:b,initialPlacement:c,placement:y,strategy:h,middlewareData:v,rects:m,platform:V(C({},p),{detectOverflow:(T=p.detectOverflow)!=null?T:Wr}),elements:{reference:s,floating:a}});f=K!=null?K:f,b=dt!=null?dt:b,v=V(C({},v),{[A]:C(C({},v[A]),ot)}),Z&&_<=50&&(_++,typeof Z=="object"&&(Z.placement&&(y=Z.placement),Z.rects&&(m=Z.rects===!0?yield p.getElementRects({reference:s,floating:a,strategy:h}):Z.rects),{x:f,y:b}=Eo(m,y,u)),x=-1)}return{x:f,y:b,placement:y,strategy:h,middlewareData:v}}))(o,t,V(C({},n),{platform:r}))};function as(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Pt={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Wo(o){Pt=o}var Qt={exec:()=>null};function R(o,t=""){let e=typeof o=="string"?o:o.source,i={replace:(n,r)=>{let s=typeof r=="string"?r:r.source;return s=s.replace(F.caret,"$1"),e=e.replace(n,s),i},getRegex:()=>new RegExp(e,t)};return i}var ls=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch(o){return!1}})(),F={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp("^( {0,3}".concat(o,")((?:[ ][^\\n]*)?(?:\\n|$))")),nextBulletRegex:o=>new RegExp("^ {0,".concat(Math.min(3,o-1),"}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))")),hrRegex:o=>new RegExp("^ {0,".concat(Math.min(3,o-1),"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)")),fencesBeginRegex:o=>new RegExp("^ {0,".concat(Math.min(3,o-1),"}(?:```|~~~)")),headingBeginRegex:o=>new RegExp("^ {0,".concat(Math.min(3,o-1),"}#")),htmlBeginRegex:o=>new RegExp("^ {0,".concat(Math.min(3,o-1),"}<(?:[a-z].*>|!--)"),"i")},Jt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xn=/(?:[*+-]|\d{1,9}[.)])/,qo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Fo=R(qo).replace(/bull/g,xn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),cs=R(qo).replace(/bull/g,xn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),wn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,kn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hs=R(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ds=R(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,xn).getRegex(),Se="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",$n=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ps=R("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",$n).replace("tag",Se).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ho=R(wn).replace("hr",Jt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Se).getRegex(),_n={blockquote:R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ho).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:hs,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Jt,html:ps,lheading:Fo,list:ds,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Ho,table:Qt,text:/^[^\n]+/},Yo=R("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Jt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Se).getRegex(),us=V(C({},_n),{lheading:cs,table:Yo,paragraph:R(wn).replace("hr",Jt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yo).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Se).getRegex()}),gs=V(C({},_n),{html:R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",$n).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Qt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:R(wn).replace("hr",Jt).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Fo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),Ko=/^( {2,}|\\)\n(?!\s*$)/,Ce=/[\p{P}\p{S}]/u,Sn=/[\s\p{P}\p{S}]/u,Xo=/[^\s\p{P}\p{S}]/u,fs=R(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Sn).getRegex(),Zo=/(?!~)[\p{P}\p{S}]/u,ms=R(/link|precode-code|html/,"g").replace("link",new RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)")).replace("precode-",ls?"(?<!`)()":"(^^|[^`])").replace("code",new RegExp("(?<b>`+)[^`]+\\k<b>(?!`)")).replace("html",/<(?! )[^<>]*?>/).getRegex(),Go=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,bs=R(Go,"u").replace(/punct/g,Ce).getRegex(),ys=R(Go,"u").replace(/punct/g,Zo).getRegex(),Qo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vs=R(Qo,"gu").replace(/notPunctSpace/g,Xo).replace(/punctSpace/g,Sn).replace(/punct/g,Ce).getRegex(),xs=R(Qo,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,Zo).getRegex(),ws=R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Xo).replace(/punctSpace/g,Sn).replace(/punct/g,Ce).getRegex(),ks=R(/\\(punct)/,"gu").replace(/punct/g,Ce).getRegex(),$s=R(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_s=R($n).replace("(?:-->|$)","-->").getRegex(),Ss=R("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_s).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Te=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Cs=R(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Jo=R(/^!?\[(label)\]\[(ref)\]/).replace("label",Te).replace("ref",kn).getRegex(),ti=R(/^!?\[(ref)\](?:\[\])?/).replace("ref",kn).getRegex(),ei=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Cn={_backpedal:Qt,anyPunctuation:ks,autolink:$s,blockSkip:ms,br:Ko,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Qt,emStrongLDelim:bs,emStrongRDelimAst:vs,emStrongRDelimUnd:ws,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Cs,nolink:ti,punctuation:fs,reflink:Jo,reflinkSearch:R("reflink|nolink(?!\\()","g").replace("reflink",Jo).replace("nolink",ti).getRegex(),tag:Ss,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Qt},Ts=V(C({},Cn),{link:R(/^!?\[(label)\]\((.*?)\)/).replace("label",Te).getRegex(),reflink:R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Te).getRegex()}),Tn=V(C({},Cn),{emStrongRDelimAst:xs,emStrongLDelim:ys,url:R(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ei).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:R(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ei).getRegex()}),Ms=V(C({},Tn),{br:R(Ko).replace("{2,}","*").getRegex(),text:R(Tn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Me={normal:_n,gfm:us,pedantic:gs},te={normal:Cn,gfm:Tn,breaks:Ms,pedantic:Ts},Ps={"&":"&","<":"<",">":">",'"':""","'":"'"},ni=o=>Ps[o];function mt(o,t){if(t){if(F.escapeTest.test(o))return o.replace(F.escapeReplace,ni)}else if(F.escapeTestNoEncode.test(o))return o.replace(F.escapeReplaceNoEncode,ni);return o}function oi(o){try{o=encodeURI(o).replace(F.percentDecode,"%")}catch(t){return null}return o}function ii(o,t){var n;let e=o.replace(F.findPipe,(r,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}).split(F.splitPipe),i=0;if(e[0].trim()||e.shift(),e.length>0&&!((n=e.at(-1))!=null&&n.trim())&&e.pop(),t)if(e.length>t)e.splice(t);else for(;e.length<t;)e.push("");for(;i<e.length;i++)e[i]=e[i].trim().replace(F.slashPipe,"|");return e}function ee(o,t,e){let i=o.length;if(i===0)return"";let n=0;for(;n<i;){let r=o.charAt(i-n-1);if(r!==t||e){if(r===t||!e)break;n++}else n++}return o.slice(0,i-n)}function ri(o,t,e,i,n){let r=t.href,s=t.title||null,a=o[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:o[0].charAt(0)==="!"?"image":"link",raw:e,href:r,title:s,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}var Pe=class{constructor(o){N(this,"options");N(this,"rules");N(this,"lexer");this.options=o||Pt}space(o){let t=this.rules.block.newline.exec(o);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(o){let t=this.rules.block.code.exec(o);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ee(e,"\n")}}}fences(o){let t=this.rules.block.fences.exec(o);if(t){let e=t[0],i=function(n,r,s){let a=n.match(s.other.indentCodeCompensation);if(a===null)return r;let l=a[1];return r.split("\n").map(c=>{let h=c.match(s.other.beginningSpace);if(h===null)return c;let[d]=h;return d.length>=l.length?c.slice(l.length):c}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(o){let t=this.rules.block.heading.exec(o);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let i=ee(e,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(e=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(o){let t=this.rules.block.hr.exec(o);if(t)return{type:"hr",raw:ee(t[0],"\n")}}blockquote(o){let t=this.rules.block.blockquote.exec(o);if(t){let e=ee(t[0],"\n").split("\n"),i="",n="",r=[];for(;e.length>0;){let s,a=!1,l=[];for(s=0;s<e.length;s++)if(this.rules.other.blockquoteStart.test(e[s]))l.push(e[s]),a=!0;else{if(a)break;l.push(e[s])}e=e.slice(s);let c=l.join("\n"),h=c.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");i=i?"".concat(i,"\n").concat(c):c,n=n?"".concat(n,"\n").concat(h):h;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,r,!0),this.lexer.state.top=d,e.length===0)break;let p=r.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){let g=p,u=g.raw+"\n"+e.join("\n"),m=this.blockquote(u);r[r.length-1]=m,i=i.substring(0,i.length-g.raw.length)+m.raw,n=n.substring(0,n.length-g.text.length)+m.text;break}if((p==null?void 0:p.type)==="list"){let g=p,u=g.raw+"\n"+e.join("\n"),m=this.list(u);r[r.length-1]=m,i=i.substring(0,i.length-p.raw.length)+m.raw,n=n.substring(0,n.length-g.raw.length)+m.raw,e=u.substring(r.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:i,tokens:r,text:n}}}list(o){var e,i;let t=this.rules.block.list.exec(o);if(t){let n=t[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?"\\d{1,9}\\".concat(n.slice(-1)):"\\".concat(n),this.options.pedantic&&(n=r?n:"[*+-]");let a=this.rules.other.listItemRegex(n),l=!1;for(;o;){let h=!1,d="",p="";if(!(t=a.exec(o))||this.rules.block.hr.test(o))break;d=t[0],o=o.substring(d.length);let g=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),u=o.split("\n",1)[0],m=!g.trim(),f=0;if(this.options.pedantic?(f=2,p=g.trimStart()):m?f=t[1].length+1:(f=t[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,p=g.slice(f),f+=t[1].length),m&&this.rules.other.blankLine.test(u)&&(d+=u+"\n",o=o.substring(u.length+1),h=!0),!h){let b=this.rules.other.nextBulletRegex(f),y=this.rules.other.hrRegex(f),v=this.rules.other.fencesBeginRegex(f),_=this.rules.other.headingBeginRegex(f),T=this.rules.other.htmlBeginRegex(f);for(;o;){let x,A=o.split("\n",1)[0];if(u=A,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),x=u):x=u.replace(this.rules.other.tabCharGlobal," "),v.test(u)||_.test(u)||T.test(u)||b.test(u)||y.test(u))break;if(x.search(this.rules.other.nonSpaceChar)>=f||!u.trim())p+="\n"+x.slice(f);else{if(m||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(g)||_.test(g)||y.test(g))break;p+="\n"+u}!m&&!u.trim()&&(m=!0),d+=A+"\n",o=o.substring(A.length+1),g=x.slice(f)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(l=!0)),s.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),s.raw+=d}let c=s.items.at(-1);if(!c)return;c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd(),s.raw=s.raw.trimEnd();for(let h of s.items){if(this.lexer.state.top=!1,h.tokens=this.lexer.blockTokens(h.text,[]),h.task){if(h.text=h.text.replace(this.rules.other.listReplaceTask,""),((e=h.tokens[0])==null?void 0:e.type)==="text"||((i=h.tokens[0])==null?void 0:i.type)==="paragraph"){h.tokens[0].raw=h.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),h.tokens[0].text=h.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(h.raw);if(d){let p={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};h.checked=p.checked,s.loose?h.tokens[0]&&["paragraph","text"].includes(h.tokens[0].type)&&"tokens"in h.tokens[0]&&h.tokens[0].tokens?(h.tokens[0].raw=p.raw+h.tokens[0].raw,h.tokens[0].text=p.raw+h.tokens[0].text,h.tokens[0].tokens.unshift(p)):h.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):h.tokens.unshift(p)}}if(!s.loose){let d=h.tokens.filter(g=>g.type==="space"),p=d.length>0&&d.some(g=>this.rules.other.anyLine.test(g.raw));s.loose=p}}if(s.loose)for(let h of s.items){h.loose=!0;for(let d of h.tokens)d.type==="text"&&(d.type="paragraph")}return s}}html(o){let t=this.rules.block.html.exec(o);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(o){let t=this.rules.block.def.exec(o);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:n}}}table(o){var s;let t=this.rules.block.table.exec(o);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=ii(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=(s=t[3])!=null&&s.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===i.length){for(let a of i)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<e.length;a++)r.header.push({text:e[a],tokens:this.lexer.inline(e[a]),header:!0,align:r.align[a]});for(let a of n)r.rows.push(ii(a,r.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[c]})));return r}}lheading(o){let t=this.rules.block.lheading.exec(o);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(o){let t=this.rules.block.paragraph.exec(o);if(t){let e=t[1].charAt(t[1].length-1)==="\n"?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(o){let t=this.rules.block.text.exec(o);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(o){let t=this.rules.inline.escape.exec(o);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(o){let t=this.rules.inline.tag.exec(o);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(o){let t=this.rules.inline.link.exec(o);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let r=ee(e.slice(0,-1),"\\");if((e.length-r.length)%2==0)return}else{let r=function(s,a){if(s.indexOf(a[1])===-1)return-1;let l=0;for(let c=0;c<s.length;c++)if(s[c]==="\\")c++;else if(s[c]===a[0])l++;else if(s[c]===a[1]&&(l--,l<0))return c;return l>0?-2:-1}(t[2],"()");if(r===-2)return;if(r>-1){let s=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,s).trim(),t[3]=""}}let i=t[2],n="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(i);r&&(i=r[1],n=r[3])}else n=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?i.slice(1):i.slice(1,-1)),ri(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(o,t){let e;if((e=this.rules.inline.reflink.exec(o))||(e=this.rules.inline.nolink.exec(o))){let i=t[(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!i){let n=e[0].charAt(0);return{type:"text",raw:n,text:n}}return ri(e,i,e[0],this.lexer,this.rules)}}emStrong(o,t,e=""){let i=this.rules.inline.emStrongLDelim.exec(o);if(!(!i||i[3]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!i[1]&&!i[2]||!e||this.rules.inline.punctuation.exec(e))){let n,r,s=[...i[0]].length-1,a=s,l=0,c=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*o.length+s);(i=c.exec(t))!=null;){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n)continue;if(r=[...n].length,i[3]||i[4]){a+=r;continue}if((i[5]||i[6])&&s%3&&!((s+r)%3)){l+=r;continue}if(a-=r,a>0)continue;r=Math.min(r,r+a+l);let h=[...i[0]][0].length,d=o.slice(0,s+i.index+h+r);if(Math.min(s,r)%2){let g=d.slice(1,-1);return{type:"em",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(o){let t=this.rules.inline.code.exec(o);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return i&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(o){let t=this.rules.inline.br.exec(o);if(t)return{type:"br",raw:t[0]}}del(o){let t=this.rules.inline.del.exec(o);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(o){let t=this.rules.inline.autolink.exec(o);if(t){let e,i;return t[2]==="@"?(e=t[1],i="mailto:"+e):(e=t[1],i=e),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(o){var e,i;let t;if(t=this.rules.inline.url.exec(o)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let s;do s=t[0],t[0]=(i=(e=this.rules.inline._backpedal.exec(t[0]))==null?void 0:e[0])!=null?i:"";while(s!==t[0]);n=t[0],r=t[1]==="www."?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(o){let t=this.rules.inline.text.exec(o);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},et=class Nn{constructor(t){N(this,"tokens");N(this,"options");N(this,"state");N(this,"inlineQueue");N(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Pt,this.options.tokenizer=this.options.tokenizer||new Pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:F,block:Me.normal,inline:te.normal};this.options.pedantic?(e.block=Me.pedantic,e.inline=te.pedantic):this.options.gfm&&(e.block=Me.gfm,this.options.breaks?e.inline=te.breaks:e.inline=te.gfm),this.tokenizer.rules=e}static get rules(){return{block:Me,inline:te}}static lex(t,e){return new Nn(e).lex(t)}static lexInline(t,e){return new Nn(e).inlineTokens(t)}lex(t){t=t.replace(F.carriageReturn,"\n"),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let i=this.inlineQueue[e];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],i=!1){var n,r,s;for(this.options.pedantic&&(t=t.replace(F.tabCharGlobal," ").replace(F.spaceLine,""));t;){let a;if((r=(n=this.options.extensions)==null?void 0:n.block)!=null&&r.some(c=>!!(a=c.call({lexer:this},t,e))&&(t=t.substring(a.raw.length),e.push(a),!0)))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let c=e.at(-1);a.raw.length===1&&c!==void 0?c.raw+="\n":e.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);let c=e.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith("\n")?"":"\n")+a.raw,c.text+="\n"+a.text,this.inlineQueue.at(-1).src=c.text):e.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);let c=e.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith("\n")?"":"\n")+a.raw,c.text+="\n"+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},e.push(a));continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),e.push(a);continue}let l=t;if((s=this.options.extensions)!=null&&s.startBlock){let c,h=1/0,d=t.slice(1);this.options.extensions.startBlock.forEach(p=>{c=p.call({lexer:this},d),typeof c=="number"&&c>=0&&(h=Math.min(h,c))}),h<1/0&&h>=0&&(l=t.substring(0,h+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){let c=e.at(-1);i&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith("\n")?"":"\n")+a.raw,c.text+="\n"+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):e.push(a),i=l.length!==t.length,t=t.substring(a.raw.length)}else if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);let c=e.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith("\n")?"":"\n")+a.raw,c.text+="\n"+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):e.push(a)}else if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){var l,c,h,d,p,g;let i,n=t,r=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)u.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=(h=(c=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:c.call({lexer:this},n))!=null?h:n;let s=!1,a="";for(;t;){let u;if(s||(a=""),s=!1,(p=(d=this.options.extensions)==null?void 0:d.inline)==null?void 0:p.some(f=>!!(u=f.call({lexer:this},t,e))&&(t=t.substring(u.raw.length),e.push(u),!0)))continue;if(u=this.tokenizer.escape(t)){t=t.substring(u.raw.length),e.push(u);continue}if(u=this.tokenizer.tag(t)){t=t.substring(u.raw.length),e.push(u);continue}if(u=this.tokenizer.link(t)){t=t.substring(u.raw.length),e.push(u);continue}if(u=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(u.raw.length);let f=e.at(-1);u.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=u.raw,f.text+=u.text):e.push(u);continue}if(u=this.tokenizer.emStrong(t,n,a)){t=t.substring(u.raw.length),e.push(u);continue}if(u=this.tokenizer.codespan(t)){t=t.substring(u.raw.length),e.push(u);continue}if(u=this.tokenizer.br(t)){t=t.substring(u.raw.length),e.push(u);continue}if(u=this.tokenizer.del(t)){t=t.substring(u.raw.length),e.push(u);continue}if(u=this.tokenizer.autolink(t)){t=t.substring(u.raw.length),e.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(t))){t=t.substring(u.raw.length),e.push(u);continue}let m=t;if((g=this.options.extensions)!=null&&g.startInline){let f,b=1/0,y=t.slice(1);this.options.extensions.startInline.forEach(v=>{f=v.call({lexer:this},y),typeof f=="number"&&f>=0&&(b=Math.min(b,f))}),b<1/0&&b>=0&&(m=t.substring(0,b+1))}if(u=this.tokenizer.inlineText(m)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(a=u.raw.slice(-1)),s=!0;let f=e.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=u.raw,f.text+=u.text):e.push(u)}else if(t){let f="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(f);break}throw new Error(f)}}return e}},Ee=class{constructor(o){N(this,"options");N(this,"parser");this.options=o||Pt}space(o){return""}code({text:o,lang:t,escaped:e}){var r;let i=(r=(t||"").match(F.notSpaceStart))==null?void 0:r[0],n=o.replace(F.endingNewline,"")+"\n";return i?'<pre><code class="language-'+mt(i)+'">'+(e?n:mt(n,!0))+"</code></pre>\n":"<pre><code>"+(e?n:mt(n,!0))+"</code></pre>\n"}blockquote({tokens:o}){return"<blockquote>\n".concat(this.parser.parse(o),"</blockquote>\n")}html({text:o}){return o}def(o){return""}heading({tokens:o,depth:t}){return"<h".concat(t,">").concat(this.parser.parseInline(o),"</h").concat(t,">\n")}hr(o){return"<hr>\n"}list(o){let t=o.ordered,e=o.start,i="";for(let r=0;r<o.items.length;r++){let s=o.items[r];i+=this.listitem(s)}let n=t?"ol":"ul";return"<"+n+(t&&e!==1?' start="'+e+'"':"")+">\n"+i+"</"+n+">\n"}listitem(o){return"<li>".concat(this.parser.parse(o.tokens),"</li>\n")}checkbox({checked:o}){return"<input "+(o?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:o}){return"<p>".concat(this.parser.parseInline(o),"</p>\n")}table(o){let t="",e="";for(let n=0;n<o.header.length;n++)e+=this.tablecell(o.header[n]);t+=this.tablerow({text:e});let i="";for(let n=0;n<o.rows.length;n++){let r=o.rows[n];e="";for(let s=0;s<r.length;s++)e+=this.tablecell(r[s]);i+=this.tablerow({text:e})}return i&&(i="<tbody>".concat(i,"</tbody>")),"<table>\n<thead>\n"+t+"</thead>\n"+i+"</table>\n"}tablerow({text:o}){return"<tr>\n".concat(o,"</tr>\n")}tablecell(o){let t=this.parser.parseInline(o.tokens),e=o.header?"th":"td";return(o.align?"<".concat(e,' align="').concat(o.align,'">'):"<".concat(e,">"))+t+"</".concat(e,">\n")}strong({tokens:o}){return"<strong>".concat(this.parser.parseInline(o),"</strong>")}em({tokens:o}){return"<em>".concat(this.parser.parseInline(o),"</em>")}codespan({text:o}){return"<code>".concat(mt(o,!0),"</code>")}br(o){return"<br>"}del({tokens:o}){return"<del>".concat(this.parser.parseInline(o),"</del>")}link({href:o,title:t,tokens:e}){let i=this.parser.parseInline(e),n=oi(o);if(n===null)return i;let r='<a href="'+(o=n)+'"';return t&&(r+=' title="'+mt(t)+'"'),r+=">"+i+"</a>",r}image({href:o,title:t,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let n=oi(o);if(n===null)return mt(e);let r='<img src="'.concat(o=n,'" alt="').concat(e,'"');return t&&(r+=' title="'.concat(mt(t),'"')),r+=">",r}text(o){return"tokens"in o&&o.tokens?this.parser.parseInline(o.tokens):"escaped"in o&&o.escaped?o.text:mt(o.text)}},Mn=class{strong({text:o}){return o}em({text:o}){return o}codespan({text:o}){return o}del({text:o}){return o}html({text:o}){return o}text({text:o}){return o}link({text:o}){return""+o}image({text:o}){return""+o}br(){return""}checkbox({raw:o}){return o}},nt=class Ln{constructor(t){N(this,"options");N(this,"renderer");N(this,"textRenderer");this.options=t||Pt,this.options.renderer=this.options.renderer||new Ee,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Mn}static parse(t,e){return new Ln(e).parse(t)}static parseInline(t,e){return new Ln(e).parseInline(t)}parse(t){var i,n;let e="";for(let r=0;r<t.length;r++){let s=t[r];if((n=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&n[s.type]){let l=s,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){e+=c||"";continue}}let a=s;switch(a.type){case"space":e+=this.renderer.space(a);break;case"hr":e+=this.renderer.hr(a);break;case"heading":e+=this.renderer.heading(a);break;case"code":e+=this.renderer.code(a);break;case"table":e+=this.renderer.table(a);break;case"blockquote":e+=this.renderer.blockquote(a);break;case"list":e+=this.renderer.list(a);break;case"checkbox":e+=this.renderer.checkbox(a);break;case"html":e+=this.renderer.html(a);break;case"def":e+=this.renderer.def(a);break;case"paragraph":e+=this.renderer.paragraph(a);break;case"text":e+=this.renderer.text(a);break;default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return e}parseInline(t,e=this.renderer){var n,r;let i="";for(let s=0;s<t.length;s++){let a=t[s];if((r=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&r[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){i+=c||"";continue}}let l=a;switch(l.type){case"escape":case"text":i+=e.text(l);break;case"html":i+=e.html(l);break;case"link":i+=e.link(l);break;case"image":i+=e.image(l);break;case"checkbox":i+=e.checkbox(l);break;case"strong":i+=e.strong(l);break;case"em":i+=e.em(l);break;case"codespan":i+=e.codespan(l);break;case"br":i+=e.br(l);break;case"del":i+=e.del(l);break;default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return i}},ne=(Re=class{constructor(o){N(this,"options");N(this,"block");this.options=o||Pt}preprocess(o){return o}postprocess(o){return o}processAllTokens(o){return o}emStrongMask(o){return o}provideLexer(){return this.block?et.lex:et.lexInline}provideParser(){return this.block?nt.parse:nt.parseInline}},N(Re,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),N(Re,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Re),Et=new class{constructor(...o){N(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null});N(this,"options",this.setOptions);N(this,"parse",this.parseMarkdown(!0));N(this,"parseInline",this.parseMarkdown(!1));N(this,"Parser",nt);N(this,"Renderer",Ee);N(this,"TextRenderer",Mn);N(this,"Lexer",et);N(this,"Tokenizer",Pe);N(this,"Hooks",ne);this.use(...o)}walkTokens(o,t){var i,n;let e=[];for(let r of o)switch(e=e.concat(t.call(this,r)),r.type){case"table":{let s=r;for(let a of s.header)e=e.concat(this.walkTokens(a.tokens,t));for(let a of s.rows)for(let l of a)e=e.concat(this.walkTokens(l.tokens,t));break}case"list":{let s=r;e=e.concat(this.walkTokens(s.items,t));break}default:{let s=r;(n=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&n[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let l=s[a].flat(1/0);e=e.concat(this.walkTokens(l,t))}):s.tokens&&(e=e.concat(this.walkTokens(s.tokens,t)))}}return e}use(...o){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return o.forEach(e=>{let i=C({},e);if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let r=t.renderers[n.name];t.renderers[n.name]=r?function(...s){let a=n.renderer.apply(this,s);return a===!1&&(a=r.apply(this,s)),a}:n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=t[n.level];r?r.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),i.extensions=t),e.renderer){let n=this.defaults.renderer||new Ee(this.defaults);for(let r in e.renderer){if(!(r in n))throw new Error("renderer '".concat(r,"' does not exist"));if(["options","parser"].includes(r))continue;let s=r,a=e.renderer[s],l=n[s];n[s]=(...c)=>{let h=a.apply(n,c);return h===!1&&(h=l.apply(n,c)),h||""}}i.renderer=n}if(e.tokenizer){let n=this.defaults.tokenizer||new Pe(this.defaults);for(let r in e.tokenizer){if(!(r in n))throw new Error("tokenizer '".concat(r,"' does not exist"));if(["options","rules","lexer"].includes(r))continue;let s=r,a=e.tokenizer[s],l=n[s];n[s]=(...c)=>{let h=a.apply(n,c);return h===!1&&(h=l.apply(n,c)),h}}i.tokenizer=n}if(e.hooks){let n=this.defaults.hooks||new ne;for(let r in e.hooks){if(!(r in n))throw new Error("hook '".concat(r,"' does not exist"));if(["options","block"].includes(r))continue;let s=r,a=e.hooks[s],l=n[s];ne.passThroughHooks.has(r)?n[s]=c=>{if(this.defaults.async&&ne.passThroughHooksRespectAsync.has(r))return(()=>B(this,null,function*(){let d=yield a.call(n,c);return l.call(n,d)}))();let h=a.call(n,c);return l.call(n,h)}:n[s]=(...c)=>{if(this.defaults.async)return(()=>B(this,null,function*(){let d=yield a.apply(n,c);return d===!1&&(d=yield l.apply(n,c)),d}))();let h=a.apply(n,c);return h===!1&&(h=l.apply(n,c)),h}}i.hooks=n}if(e.walkTokens){let n=this.defaults.walkTokens,r=e.walkTokens;i.walkTokens=function(s){let a=[];return a.push(r.call(this,s)),n&&(a=a.concat(n.call(this,s))),a}}this.defaults=C(C({},this.defaults),i)}),this}setOptions(o){return this.defaults=C(C({},this.defaults),o),this}lexer(o,t){return et.lex(o,t!=null?t:this.defaults)}parser(o,t){return nt.parse(o,t!=null?t:this.defaults)}parseMarkdown(o){return(t,e)=>{let i=C({},e),n=C(C({},this.defaults),i),r=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&i.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=o),n.async)return(()=>B(this,null,function*(){let s=n.hooks?yield n.hooks.preprocess(t):t,a=yield(n.hooks?yield n.hooks.provideLexer():o?et.lex:et.lexInline)(s,n),l=n.hooks?yield n.hooks.processAllTokens(a):a;n.walkTokens&&(yield Promise.all(this.walkTokens(l,n.walkTokens)));let c=yield(n.hooks?yield n.hooks.provideParser():o?nt.parse:nt.parseInline)(l,n);return n.hooks?yield n.hooks.postprocess(c):c}))().catch(r);try{n.hooks&&(t=n.hooks.preprocess(t));let s=(n.hooks?n.hooks.provideLexer():o?et.lex:et.lexInline)(t,n);n.hooks&&(s=n.hooks.processAllTokens(s)),n.walkTokens&&this.walkTokens(s,n.walkTokens);let a=(n.hooks?n.hooks.provideParser():o?nt.parse:nt.parseInline)(s,n);return n.hooks&&(a=n.hooks.postprocess(a)),a}catch(s){return r(s)}}}onError(o,t){return e=>{if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",o){let i="<p>An error occurred:</p><pre>"+mt(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}};function I(o,t){return Et.parse(o,t)}I.options=I.setOptions=function(o){return Et.setOptions(o),I.defaults=Et.defaults,Wo(I.defaults),I},I.getDefaults=as,I.defaults=Pt,I.use=function(...o){return Et.use(...o),I.defaults=Et.defaults,Wo(I.defaults),I},I.walkTokens=function(o,t){return Et.walkTokens(o,t)},I.parseInline=Et.parseInline,I.Parser=nt,I.parser=nt.parse,I.Renderer=Ee,I.TextRenderer=Mn,I.Lexer=et,I.lexer=et.lex,I.Tokenizer=Pe,I.Hooks=ne,I.parse=I,I.options,I.setOptions,I.use,I.walkTokens,I.parseInline,nt.parse,et.lex;let oe="";function Pn(o){if(!oe||!o)return o;const t=oe.endsWith("/")?oe:oe+"/";return o.startsWith(t)?o.slice(t.length):o}const Es=["right-start","left-start","right-end","left-end","bottom-end","top-end","bottom-start","top-start","right","left","bottom","top"],bt=16;function si(o){try{return I.parse(o,{async:!1})}catch(t){return o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br>")}}function Rs(o){const{name:t,summary:e}=function(s){const a=s.name,l=s.input||{};switch(a){case"Read":return{name:"Read",summary:Pn(l.file_path||"")};case"Write":return{name:"Write",summary:Pn(l.file_path||"")};case"Edit":return{name:"Update",summary:Pn(l.file_path||"")};case"Glob":return{name:"List",summary:l.pattern||""};case"Grep":return{name:"Search",summary:l.pattern||""};case"Bash":return{name:"Bash",summary:l.command||""};case"WebFetch":return{name:"Fetch",summary:l.url||""};case"WebSearch":return{name:"Search",summary:l.query||""};default:return{name:a,summary:""}}}(o),i=o.isComplete,n=o.result!==void 0,r=o.name==="Edit"&&o.input&&(o.input.old_string||o.input.new_string);return S(wi||(wi=$(['\n <div class="tool-call-inline">\n <div class="tool-header-inline">\n <span class="tool-bullet ','">●</span>\n <span class="tool-name-inline">',"</span>\n ","\n </div>\n ","\n </div>\n "])),i?"tool-bullet-complete":"tool-bullet-running",t,e?S(gi||(gi=$(['<span class="tool-summary-inline">',"</span>"])),e):"",r?S(vi||(vi=$(['<div class="tool-diff-wrapper">\n <span class="tool-result-bracket">⎿</span>\n ',"\n </div>"])),function(s){const a=s.input||{},l=a.old_string||"",c=a.new_string||"";if(!l&&!c)return S(fi||(fi=$([""])));const h=l.split("\n"),d=c.split("\n");return S(yi||(yi=$(['\n <div class="diff-view">\n ',"\n ","\n </div>\n "])),h.map(p=>S(mi||(mi=$(['<div class="diff-line diff-del">- ',"</div>"])),p)),d.map(p=>S(bi||(bi=$(['<div class="diff-line diff-add">+ ',"</div>"])),p)))}(o)):n?S(xi||(xi=$(['<div class="tool-result-inline">\n <span class="tool-result-bracket">⎿</span>\n <span class="tool-result-text ','"\n >',"</span\n >\n </div>"])),o.isError?"tool-error-text":"",function(s,a){if(!s)return"";let l=s.trim();if(a==="Write")return"Wrote ".concat(l.split("\n").length," lines");if(a==="Read"){const c=l.split("\n").length;if(c>5)return"".concat(c," lines")}return l.length>300&&(l=l.slice(0,300)+"..."),l}(o.result,o.name)):"")}function As(o,t){var e;return o.showChatModal?S(Bi||(Bi=$(['\n <div\n class="chat-modal-overlay"\n @click="','"\n @mousemove="','"\n @mouseup="','"\n >\n <div\n class="chat-modal chat-modal-floating ','"\n id="chat-modal-floating"\n @click="','"\n >\n <div class="chat-modal-header" @mousedown="','">\n <div class="chat-modal-title-wrapper">\n <div class="chat-modal-title-row">\n <h3 class="chat-modal-title">AI Assistant</h3>\n ',"\n </div>\n ",'\n </div>\n <div class="chat-modal-actions">\n <button\n class="chat-modal-theme"\n @click="','"\n title="','"\n >\n ','\n </button>\n <button\n class="chat-modal-clear"\n @click="','"\n title="Clear"\n >\n <svg\n width="14"\n height="14"\n viewBox="0 0 24 24"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n >\n <path d="M3 6h18" />\n <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" />\n <path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />\n </svg>\n </button>\n <button\n class="chat-modal-close"\n @click="','"\n title="Close"\n >\n <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </button>\n </div>\n </div>\n <div class="chat-modal-content">\n ',"\n ","\n </div>\n ",'\n <div class="chat-modal-footer">\n <span class="chat-input-prompt">❯</span>\n <textarea\n class="chat-input"\n placeholder="Enter your message..."\n .value="','"\n @input="','"\n @keydown="','"\n ?disabled="','"\n rows="2"\n ></textarea>\n <button\n class="chat-send-btn"\n @click="','"\n ?disabled="','"\n title="Send (Enter)"\n >\n ',"\n </button>\n </div>\n </div>\n </div>\n "])),t.handleOverlayClick,t.handleDragMove,t.handleDragEnd,o.isDragging?"dragging":"",i=>i.stopPropagation(),t.handleDragStart,o.chatModel?S(ki||(ki=$(['<span class="chat-model-badge">',"</span>"])),o.chatModel):"",o.chatContext?S($i||($i=$(['<span class="chat-context-info"\n ><',"> ","#","</span\n >"])),o.chatContext.name,o.chatContext.file,o.chatContext.line):"",t.toggleTheme,o.chatTheme==="dark"?"Switch to light theme":"Switch to dark theme",o.chatTheme==="dark"?S(_i||(_i=$(['<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <circle cx="12" cy="12" r="5" />\n <path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42" />\n </svg>']))):S(Si||(Si=$(['<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />\n </svg>']))),t.clearChatMessages,t.closeChatModal,o.chatMessages.length===0?S(Ci||(Ci=$(['<div class="chat-empty">\n <span class="chat-empty-prompt">❯</span>\n <span class="chat-empty-text">Ask me anything about this code...</span>\n </div>']))):o.chatMessages.map(i=>S(Ni||(Ni=$(['\n <div class="chat-line chat-line-','">\n ','\n <div class="chat-message-content">\n ',"\n </div>\n </div>\n "])),i.role,i.role==="user"?S(Ti||(Ti=$(['<span class="chat-prompt">❯</span>']))):S(Mi||(Mi=$(['<span class="chat-indent"></span>']))),function(n){const r=n.role==="assistant";return n.blocks&&n.blocks.length>0?S(Ai||(Ai=$(["\n ","\n "])),n.blocks.map(s=>s.type==="text"&&s.content?r?S(Pi||(Pi=$(['<div class="chat-text-inline chat-markdown">',"</div>"])),$o(si(s.content))):S(Ei||(Ei=$(['<div class="chat-text-inline">',"</div>"])),s.content):s.type==="tool"&&s.tool?Rs(s.tool):S(Ri||(Ri=$([""]))))):r&&n.content?S(zi||(zi=$(['<div class="chat-text-inline chat-markdown">',"</div>"])),$o(si(n.content))):S(Ii||(Ii=$(['<div class="chat-text-inline">',"</div>"])),n.content)}(i))),!o.chatLoading||o.chatMessages.length&&((e=o.chatMessages[o.chatMessages.length-1])==null?void 0:e.role)!=="user"?"":S(Li||(Li=$(['<div class="chat-loading">\n <span class="chat-indent"></span>\n <span class="chat-cursor"></span>\n </div>']))),o.turnStatus!=="idle"?S(Oi||(Oi=$(['<div class="chat-status-bar">\n <div class="chat-status-info">\n <span class="chat-status-icon ','">\n ','\n </span>\n <span class="chat-status-text">\n ','\n </span>\n <span class="chat-status-duration">· ',"</span>\n </div>\n ","\n </div>"])),o.turnStatus,o.turnStatus==="running"?"●":o.turnStatus==="done"?"✓":"■",o.turnStatus==="running"?"Running":o.turnStatus==="done"?"Done":"Interrupt",function(i){const n=Math.floor(i/60),r=Math.floor(i%60);return n>0?"".concat(n,"m ").concat(r.toString().padStart(2,"0"),"s"):"".concat(r,"s")}(o.turnDuration),o.turnStatus==="running"?S(Di||(Di=$(['<button\n class="chat-interrupt-btn"\n @click="','"\n title="Interrupt"\n >\n <svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor">\n <rect x="6" y="6" width="12" height="12" rx="1" />\n </svg>\n </button>'])),t.interruptChat):""):"",o.chatInput,t.handleChatInput,t.handleChatKeyDown,o.chatLoading,t.sendChatMessage,o.chatLoading||!o.chatInput.trim(),o.chatLoading?S(ji||(ji=$(['<svg\n class="chat-send-loading"\n width="16"\n height="16"\n viewBox="0 0 24 24"\n >\n <circle\n cx="12"\n cy="12"\n r="10"\n stroke="currentColor"\n stroke-width="3"\n fill="none"\n stroke-dasharray="31.4"\n stroke-linecap="round"\n />\n </svg>']))):S(Vi||(Vi=$(['<svg\n width="16"\n height="16"\n viewBox="0 0 24 24"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n >\n <path d="M5 12h14" />\n <path d="M12 5l7 7-7 7" />\n </svg>'])))):S(Ui||(Ui=$([""])))}I.setOptions({breaks:!0,gfm:!0});const zs=se(Wi||(Wi=$(["\n /* 暗色主题变量(默认) */\n :host {\n --chat-bg: #1e1e1e;\n --chat-header-bg: #252526;\n --chat-border: #333;\n --chat-text: #d4d4d4;\n --chat-text-secondary: #ccc;\n --chat-text-muted: #aaa;\n --chat-text-placeholder: #888;\n --chat-accent: #569cd6;\n --chat-accent-hover: #6cb6ff;\n --chat-overlay: rgba(0, 0, 0, 0.3);\n --chat-shadow: rgba(0, 0, 0, 0.4);\n --chat-code-bg: #2d2d2d;\n --chat-code-text: #ce9178;\n --chat-pre-bg: #1a1a1a;\n --chat-pre-text: #d4d4d4;\n --chat-prompt-ai: #c586c0;\n --chat-tool-bg: #252526;\n --chat-tool-border: #555;\n --chat-tool-complete: #4ec9b0;\n --chat-tool-name: #dcdcaa;\n --chat-tool-result: #9cdcfe;\n --chat-tool-error: #f48771;\n --chat-tool-prefix: #555;\n --chat-scrollbar-track: #1e1e1e;\n --chat-scrollbar-thumb: #424242;\n --chat-scrollbar-hover: #555;\n --chat-heading: #e0e0e0;\n --chat-strong: #e0e0e0;\n --chat-em: #b5b5b5;\n --chat-del: #888;\n --chat-blockquote-bg: #252526;\n --chat-blockquote-text: #aaa;\n --chat-table-header-bg: #252526;\n --chat-table-alt-bg: #1a1a1a;\n --chat-input-bg: #1e1e1e;\n --chat-btn-text: #1e1e1e;\n --chat-ai-text: #9cdcfe;\n --chat-user-text: #d4d4d4;\n --chat-hover-bg: #333;\n --chat-diff-add-bg: rgba(35, 134, 54, 0.15);\n --chat-diff-add-text: #4ec9b0;\n --chat-diff-del-bg: rgba(218, 54, 51, 0.15);\n --chat-diff-del-text: #f48771;\n }\n\n /* 亮色主题变量 */\n :host(.chat-theme-light) {\n --chat-bg: #ffffff;\n --chat-header-bg: #f5f5f5;\n --chat-border: #e0e0e0;\n --chat-text: #333333;\n --chat-text-secondary: #555555;\n --chat-text-muted: #666;\n --chat-text-placeholder: #aaaaaa;\n --chat-accent: #0969da;\n --chat-accent-hover: #0550ae;\n --chat-overlay: rgba(0, 0, 0, 0.15);\n --chat-shadow: rgba(0, 0, 0, 0.12);\n --chat-code-bg: #eff1f3;\n --chat-code-text: #d73e1d;\n --chat-pre-bg: #f6f8fa;\n --chat-pre-text: #333333;\n --chat-prompt-ai: #8250df;\n --chat-tool-bg: #f5f5f5;\n --chat-tool-border: #d0d0d0;\n --chat-tool-complete: #1a7f37;\n --chat-tool-name: #953800;\n --chat-tool-result: #0550ae;\n --chat-tool-error: #cf222e;\n --chat-tool-prefix: #bbb;\n --chat-scrollbar-track: #ffffff;\n --chat-scrollbar-thumb: #c8c8c8;\n --chat-scrollbar-hover: #a0a0a0;\n --chat-heading: #1f2328;\n --chat-strong: #1f2328;\n --chat-em: #555555;\n --chat-del: #aaaaaa;\n --chat-blockquote-bg: #f5f5f5;\n --chat-blockquote-text: #666666;\n --chat-table-header-bg: #f5f5f5;\n --chat-table-alt-bg: #f6f8fa;\n --chat-input-bg: #ffffff;\n --chat-btn-text: #ffffff;\n --chat-ai-text: #0550ae;\n --chat-user-text: #333333;\n --chat-hover-bg: #e8e8e8;\n --chat-diff-add-bg: rgba(35, 134, 54, 0.1);\n --chat-diff-add-text: #1a7f37;\n --chat-diff-del-bg: rgba(218, 54, 51, 0.1);\n --chat-diff-del-text: #cf222e;\n }\n\n /* 聊天框样式 */\n .chat-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--chat-overlay);\n z-index: 99999999999999999;\n animation: fadeIn 0.2s ease-out;\n }\n\n .chat-modal {\n background: var(--chat-bg);\n border-radius: 8px;\n box-shadow: 0 8px 32px var(--chat-shadow);\n width: 90%;\n max-width: 600px;\n height: 70vh;\n max-height: 700px;\n display: flex;\n flex-direction: column;\n animation: slideUp 0.3s ease-out;\n overflow: hidden;\n border: 1px solid var(--chat-border);\n }\n\n .chat-modal-floating {\n position: fixed;\n top: 0;\n left: 0;\n width: 480px;\n min-width: 360px;\n height: min(520px, calc(100vh - 32px));\n animation: slideIn 0.3s ease-out;\n }\n\n .chat-modal-centered {\n animation: fadeInScale 0.3s ease-out;\n }\n\n @keyframes fadeInScale {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes slideUp {\n from { transform: translateY(20px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n }\n\n @keyframes slideIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n\n .chat-modal-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n background: var(--chat-header-bg);\n border-bottom: 1px solid var(--chat-border);\n cursor: move;\n user-select: none;\n }\n\n .chat-modal.dragging {\n transition: none;\n user-select: none;\n }\n\n .chat-modal.dragging .chat-modal-content,\n .chat-modal.dragging .chat-modal-footer {\n pointer-events: none;\n }\n\n .chat-modal-title-wrapper {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n flex: 1;\n }\n\n .chat-modal-title {\n margin: 0;\n font-size: 13px;\n font-weight: 500;\n color: var(--chat-text-secondary);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n }\n\n .chat-modal-title-row {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .chat-model-badge {\n font-size: 10px;\n color: var(--chat-text-muted);\n background: var(--chat-border);\n padding: 1px 6px;\n border-radius: 3px;\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n white-space: nowrap;\n max-width: 160px;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .chat-context-info {\n font-size: 11px;\n color: var(--chat-text-muted);\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .chat-modal-actions {\n display: flex;\n align-items: center;\n gap: 4px;\n flex-shrink: 0;\n }\n\n .chat-modal-theme,\n .chat-modal-clear {\n background: transparent;\n border: none;\n color: var(--chat-text-muted);\n cursor: pointer;\n padding: 4px;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.15s;\n }\n\n .chat-modal-theme:hover,\n .chat-modal-clear:hover {\n background: var(--chat-hover-bg);\n color: var(--chat-text-secondary);\n }\n\n .chat-modal-close {\n background: transparent;\n border: none;\n color: var(--chat-text-muted);\n cursor: pointer;\n padding: 0;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: all 0.15s;\n }\n\n .chat-modal-close:hover {\n background: var(--chat-hover-bg);\n color: var(--chat-text-secondary);\n }\n\n .chat-modal-content {\n flex: 1;\n overflow-y: auto;\n padding: 12px 14px;\n display: flex;\n flex-direction: column;\n gap: 0;\n min-height: 0;\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 13px;\n line-height: 1.5;\n background: var(--chat-bg);\n }\n\n .chat-empty {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n color: var(--chat-text-placeholder);\n }\n\n .chat-empty-prompt {\n color: var(--chat-accent);\n font-weight: 600;\n }\n\n .chat-empty-text {\n color: var(--chat-text-placeholder);\n font-style: italic;\n }\n\n /* 终端风格连续消息流 */\n .chat-line {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n word-break: break-word;\n }\n\n .chat-line-user {\n color: var(--chat-user-text);\n margin-top: 12px;\n }\n\n .chat-line-user:first-child {\n margin-top: 0;\n }\n\n .chat-line-assistant {\n color: var(--chat-ai-text);\n margin-top: 2px;\n }\n\n .chat-prompt {\n color: var(--chat-accent);\n font-weight: 600;\n flex-shrink: 0;\n user-select: none;\n }\n\n .chat-indent {\n display: inline-block;\n width: 10px;\n flex-shrink: 0;\n }\n\n .chat-message-content {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n .chat-text-inline {\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n /* Markdown 渲染样式 */\n .chat-markdown {\n white-space: normal;\n }\n\n .chat-markdown p {\n margin: 0 0 8px 0;\n }\n\n .chat-markdown p:last-child {\n margin-bottom: 0;\n }\n\n .chat-markdown h1,\n .chat-markdown h2,\n .chat-markdown h3,\n .chat-markdown h4,\n .chat-markdown h5,\n .chat-markdown h6 {\n margin: 12px 0 8px 0;\n font-weight: 600;\n line-height: 1.3;\n color: var(--chat-heading);\n }\n\n .chat-markdown h1 { font-size: 1.4em; }\n .chat-markdown h2 { font-size: 1.25em; }\n .chat-markdown h3 { font-size: 1.1em; }\n .chat-markdown h4,\n .chat-markdown h5,\n .chat-markdown h6 { font-size: 1em; }\n\n .chat-markdown code {\n background: var(--chat-code-bg);\n padding: 2px 6px;\n border-radius: 4px;\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 0.9em;\n color: var(--chat-code-text);\n }\n\n .chat-markdown pre {\n background: var(--chat-pre-bg);\n border: 1px solid var(--chat-border);\n border-radius: 6px;\n padding: 12px;\n margin: 8px 0;\n overflow-x: auto;\n }\n\n .chat-markdown pre code {\n background: transparent;\n padding: 0;\n color: var(--chat-pre-text);\n font-size: 12px;\n line-height: 1.5;\n }\n\n .chat-markdown ul,\n .chat-markdown ol {\n margin: 8px 0;\n padding-left: 20px;\n }\n\n .chat-markdown li {\n margin: 4px 0;\n }\n\n .chat-markdown li > ul,\n .chat-markdown li > ol {\n margin: 4px 0;\n }\n\n .chat-markdown blockquote {\n margin: 8px 0;\n padding: 8px 12px;\n border-left: 3px solid var(--chat-accent);\n background: var(--chat-blockquote-bg);\n color: var(--chat-blockquote-text);\n }\n\n .chat-markdown blockquote p {\n margin: 0;\n }\n\n .chat-markdown a {\n color: var(--chat-accent);\n text-decoration: none;\n }\n\n .chat-markdown a:hover {\n text-decoration: underline;\n }\n\n .chat-markdown hr {\n border: none;\n border-top: 1px solid var(--chat-border);\n margin: 12px 0;\n }\n\n .chat-markdown table {\n border-collapse: collapse;\n margin: 8px 0;\n width: 100%;\n font-size: 12px;\n }\n\n .chat-markdown th,\n .chat-markdown td {\n border: 1px solid var(--chat-border);\n padding: 6px 10px;\n text-align: left;\n }\n\n .chat-markdown th {\n background: var(--chat-table-header-bg);\n font-weight: 600;\n }\n\n .chat-markdown tr:nth-child(even) {\n background: var(--chat-table-alt-bg);\n }\n\n .chat-markdown strong {\n font-weight: 600;\n color: var(--chat-strong);\n }\n\n .chat-markdown em {\n font-style: italic;\n color: var(--chat-em);\n }\n\n .chat-markdown del {\n text-decoration: line-through;\n color: var(--chat-del);\n }\n\n .chat-line-user {\n color: var(--chat-user-text);\n }\n\n .chat-line-assistant {\n color: var(--chat-ai-text);\n }\n\n /* 加载状态 - 光标闪烁 */\n .chat-loading {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .chat-cursor {\n width: 8px;\n height: 16px;\n background: var(--chat-accent);\n animation: cursorBlink 1s step-end infinite;\n }\n\n @keyframes cursorBlink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0; }\n }\n\n /* 状态栏 */\n .chat-status-bar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 4px 14px;\n background: var(--chat-header-bg);\n border-top: 1px solid var(--chat-border);\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 11px;\n }\n\n .chat-status-info {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--chat-text-muted);\n }\n\n .chat-status-icon {\n font-size: 10px;\n }\n\n .chat-status-icon.running {\n color: var(--chat-accent);\n animation: statusPulse 1.5s ease-in-out infinite;\n }\n\n .chat-status-icon.done {\n color: var(--chat-tool-complete);\n }\n\n .chat-status-icon.interrupt {\n color: var(--chat-tool-error);\n }\n\n @keyframes statusPulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.4; }\n }\n\n .chat-status-text {\n color: var(--chat-text-muted);\n }\n\n .chat-status-duration {\n color: var(--chat-text-placeholder);\n }\n\n .chat-interrupt-btn {\n background: transparent;\n border: 1px solid var(--chat-border);\n color: var(--chat-text-muted);\n cursor: pointer;\n padding: 0;\n width: 24px;\n height: 24px;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.15s;\n }\n\n .chat-interrupt-btn:hover {\n background: var(--chat-hover-bg);\n color: var(--chat-tool-error);\n border-color: var(--chat-tool-error);\n }\n\n /* 底部输入区域 */\n .chat-modal-footer {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 14px;\n border-top: 1px solid var(--chat-border);\n background: var(--chat-header-bg);\n }\n\n .chat-input-prompt {\n color: var(--chat-accent);\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 13px;\n font-weight: 600;\n flex-shrink: 0;\n user-select: none;\n }\n\n .chat-input {\n flex: 1;\n background: var(--chat-input-bg);\n border: 1px solid var(--chat-border);\n border-radius: 4px;\n padding: 6px 10px;\n font-size: 13px;\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n color: var(--chat-text);\n resize: none;\n line-height: 1.4;\n outline: none;\n transition: border-color 0.15s;\n }\n\n .chat-input::placeholder {\n color: var(--chat-text-placeholder);\n }\n\n .chat-input:focus {\n border-color: var(--chat-accent);\n }\n\n .chat-input:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n .chat-send-btn {\n background: var(--chat-accent);\n border: none;\n border-radius: 4px;\n padding: 6px 10px;\n cursor: pointer;\n color: var(--chat-btn-text);\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.15s;\n flex-shrink: 0;\n }\n\n .chat-send-btn:hover:not(:disabled) {\n background: var(--chat-accent-hover);\n }\n\n .chat-send-btn:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n .chat-send-loading {\n animation: chatSendSpin 1s linear infinite;\n }\n\n @keyframes chatSendSpin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n /* CLI 扁平内联工具调用 */\n .tool-call-inline {\n margin: 4px 0;\n font-size: 13px;\n line-height: 1.5;\n }\n\n .tool-header-inline {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--chat-text-secondary);\n }\n\n .tool-bullet {\n font-size: 10px;\n flex-shrink: 0;\n }\n\n .tool-bullet-running {\n color: var(--chat-accent);\n animation: toolPulse 1.5s ease-in-out infinite;\n }\n\n .tool-bullet-complete {\n color: var(--chat-tool-complete);\n }\n\n @keyframes toolPulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.3; }\n }\n\n .tool-name-inline {\n color: var(--chat-tool-name);\n font-weight: 600;\n }\n\n .tool-summary-inline {\n color: var(--chat-text-muted);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1;\n direction: rtl;\n text-align: left;\n }\n\n .tool-result-inline {\n display: flex;\n align-items: flex-start;\n gap: 6px;\n padding-left: 16px;\n margin-top: 2px;\n }\n\n .tool-result-bracket {\n color: var(--chat-tool-prefix);\n flex-shrink: 0;\n line-height: 1.4;\n }\n\n .tool-result-text {\n color: var(--chat-tool-result);\n white-space: pre-wrap;\n word-break: break-word;\n line-height: 1.4;\n font-size: 12px;\n }\n\n .tool-error-text {\n color: var(--chat-tool-error);\n }\n\n /* Diff 视图(Edit 工具红绿对比) */\n .tool-diff-wrapper {\n display: flex;\n align-items: flex-start;\n gap: 6px;\n padding-left: 16px;\n margin-top: 2px;\n }\n\n .tool-diff-wrapper > .tool-result-bracket {\n margin-top: 2px;\n }\n\n .diff-view {\n flex: 1;\n min-width: 0;\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 4px;\n overflow: hidden;\n }\n\n .diff-line {\n padding: 1px 8px;\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n .diff-del {\n background: var(--chat-diff-del-bg);\n color: var(--chat-diff-del-text);\n }\n\n .diff-add {\n background: var(--chat-diff-add-bg);\n color: var(--chat-diff-add-text);\n }\n\n /* 滚动条样式 */\n .chat-modal-content::-webkit-scrollbar {\n width: 8px;\n }\n\n .chat-modal-content::-webkit-scrollbar-track {\n background: var(--chat-scrollbar-track);\n }\n\n .chat-modal-content::-webkit-scrollbar-thumb {\n background: var(--chat-scrollbar-thumb);\n border-radius: 4px;\n }\n\n .chat-modal-content::-webkit-scrollbar-thumb:hover {\n background: var(--chat-scrollbar-hover);\n }\n"]))),En="__code_inspector_ai_state__";var Is=Object.defineProperty,Ns=Object.getOwnPropertyDescriptor,k=(o,t,e,i)=>{for(var n,r=i>1?void 0:i?Ns(t,e):t,s=o.length-1;s>=0;s--)(n=o[s])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&Is(t,e,r),r};const Rn="__code-inspector-unique-id",An="data-astro-source-file",Ls={ctrlKey:"^control",altKey:"⌥option",metaKey:"⌘command",shiftKey:"shift"},Ds={ctrlKey:"Ctrl",altKey:"Alt",metaKey:"⊞Windows",shiftKey:"Shift"},ie=300;function ai(){return new Promise(o=>{requestAnimationFrame(o)})}class w extends It{constructor(){super(...arguments),this.hotKeys="shiftKey,altKey",this.port=5678,this.showSwitch=!1,this.autoToggle=!1,this.hideConsole=!1,this.locate=!0,this.copy=void 0,this.target="",this.targetNode=null,this.ip="localhost",this.ai=!1,this.wheelThrottling=!1,this.modeKey="z",this.defaultAction="",this.position={top:0,right:0,bottom:0,left:0,padding:{top:0,right:0,bottom:0,left:0},border:{top:0,right:0,bottom:0,left:0},margin:{top:0,right:0,bottom:0,left:0}},this.element={name:"",line:0,column:0,path:""},this.elementTipStyle={vertical:"",horizon:"",visibility:""},this.show=!1,this.showNodeTree=!1,this.nodeTreePosition={},this.nodeTree=null,this.dragging=!1,this.mousePosition={baseX:0,baseY:0,moveX:0,moveY:0},this.draggingTarget="switch",this.open=!1,this.moved=!1,this.hoverSwitch=!1,this.preUserSelect="",this.sendType="xhr",this.activeNode={},this.showSettingsModal=!1,this.internalLocate=!1,this.internalCopy=!1,this.internalTarget=!1,this.internalAI=!1,this.showChatModal=!1,this.chatMessages=[],this.chatInput="",this.chatLoading=!1,this.chatContext=null,this.currentTools=new Map,this.chatSessionId=null,this.chatTheme="dark",this.turnStatus="idle",this.turnDuration=0,this.chatModel="",this.chatAbortController=null,this.turnTimerInterval=null,this.turnStartTime=0,this.isDragging=!1,this.dragStartX=0,this.dragStartY=0,this.modalStartX=0,this.modalStartY=0,this.wasDragging=!1,this.chatPositionCleanup=null,this.features=[{label:"Locate Code",description:"Open the editor and locate code",checked:()=>!!this.internalLocate,onChange:()=>this.toggleLocate(),action:"locate",fn:()=>this.locateCode(),key:1,available:()=>!!this.locate},{label:"Copy Path",description:"Copy the code path to clipboard",checked:()=>!!this.internalCopy,onChange:()=>this.toggleCopy(),action:"copy",fn:()=>this.copyCode(),key:2,available:()=>this.copy!==!1},{label:"Open Target",description:"Open the target url",checked:()=>!!this.internalTarget,onChange:()=>this.toggleTarget(),action:"target",fn:()=>this.targetCode(),key:3,available:()=>!!this.target},{label:"AI Assistant",description:"Use AI for coding",checked:()=>!!this.internalAI,onChange:()=>this.toggleAICode(),action:"ai",fn:()=>this.openChatModal(),key:4,available:()=>!!this.ai}],this.eventListeners=[],this.isTracking=t=>this.hotKeys&&this.hotKeys.split(",").every(e=>t[e.trim()]),this.getDomPropertyValue=(t,e)=>{const i=window.getComputedStyle(t);return Number(i.getPropertyValue(e).replace("px",""))},this.calculateElementInfoPosition=t=>B(this,null,function*(){var _,T;const{top:e,right:i,bottom:n,left:r}=t.getBoundingClientRect(),s=document.documentElement.clientHeight,a=document.documentElement.clientWidth,l=this.getDomPropertyValue(t,"margin-top"),c=this.getDomPropertyValue(t,"margin-right"),h=this.getDomPropertyValue(t,"margin-bottom"),d=this.getDomPropertyValue(t,"margin-left");yield ai();const{width:p,height:g}=this.elementInfoRef.getBoundingClientRect(),u=e-l,m=i+c,f=n+h,b=r-d,y=[{vertical:"element-info-bottom",horizon:"element-info-right",top:f,left:b,isExternal:!0},{vertical:"element-info-bottom",horizon:"element-info-left",top:f,left:m-p,isExternal:!0},{vertical:"element-info-top",horizon:"element-info-right",top:u-g,left:b,isExternal:!0},{vertical:"element-info-top",horizon:"element-info-left",top:u-g,left:m-p,isExternal:!0},{vertical:"element-info-bottom-inner",horizon:"element-info-right",top:f-g,left:b,isExternal:!1},{vertical:"element-info-bottom-inner",horizon:"element-info-left",top:f-g,left:m-p,isExternal:!1},{vertical:"element-info-top-inner",horizon:"element-info-right",top:u,left:b,isExternal:!1},{vertical:"element-info-top-inner",horizon:"element-info-left",top:u,left:m-p,isExternal:!1},{vertical:"element-info-top-inner",horizon:"element-info-left",top:Math.max(0,u),left:m-p,isExternal:!1,additionStyle:{transform:"translateY(".concat(Math.max(0,-u),"px)")}},{vertical:"element-info-top-inner",horizon:"element-info-right",top:Math.max(0,u),left:m-p,isExternal:!1,additionStyle:{transform:"translateY(".concat(Math.max(0,-u),"px)")}}],v=x=>x.left<0||x.left+p>a||x.top<0||x.top+g>s;for(const x of y){const A=document.documentElement.clientWidth;if(x.horizon.endsWith("left")){const j=b+p-A;j>0&&(x.additionStyle={transform:"translateX(-".concat(j,"px) ").concat(((_=x.additionStyle)==null?void 0:_.transform)||"")})}else{const j=p-m;j>0&&(x.additionStyle={transform:"translateX(".concat(j,"px) ").concat(((T=x.additionStyle)==null?void 0:T.transform)||"")})}if(!v(x))return x}return y[0]}),this.renderCover=t=>B(this,null,function*(){if(t===this.targetNode)return;this.targetNode=t;const{top:e,right:i,bottom:n,left:r}=t.getBoundingClientRect();if(this.position={top:e,right:i,bottom:n,left:r,border:{top:this.getDomPropertyValue(t,"border-top-width"),right:this.getDomPropertyValue(t,"border-right-width"),bottom:this.getDomPropertyValue(t,"border-bottom-width"),left:this.getDomPropertyValue(t,"border-left-width")},padding:{top:this.getDomPropertyValue(t,"padding-top"),right:this.getDomPropertyValue(t,"padding-right"),bottom:this.getDomPropertyValue(t,"padding-bottom"),left:this.getDomPropertyValue(t,"padding-left")},margin:{top:this.getDomPropertyValue(t,"margin-top"),right:this.getDomPropertyValue(t,"margin-right"),bottom:this.getDomPropertyValue(t,"margin-bottom"),left:this.getDomPropertyValue(t,"margin-left")}},this.elementTipStyle={vertical:"",horizon:"",visibility:"hidden"},this.addGlobalCursorStyle(),this.preUserSelect||(this.preUserSelect=getComputedStyle(document.body).userSelect),document.body.style.userSelect="none",this.element=this.getSourceInfo(t),this.show=!0,!this.showNodeTree){const{vertical:s,horizon:a,additionStyle:l}=yield this.calculateElementInfoPosition(t);this.elementTipStyle={vertical:s,horizon:a,visibility:"visible",additionStyle:l}}}),this.getAstroFilePath=t=>{var e;return(e=t.getAttribute)!=null&&e.call(t,An)?"".concat(t.getAttribute(An),":").concat(t.getAttribute("data-astro-source-loc"),":").concat(t.tagName.toLowerCase()):""},this.getSourceInfo=t=>{var a;let e=((a=t.getAttribute)==null?void 0:a.call(t,de))||t[de]||this.getAstroFilePath(t);if(!e)return null;const i=e.split(":"),n=i[i.length-1],r=Number(i[i.length-2]),s=Number(i[i.length-3]);return{name:n,path:i.slice(0,i.length-3).join(":"),line:s,column:r}},this.removeCover=t=>{t!==!0&&this.nodeTree||(this.targetNode=null,this.show=!1,this.removeGlobalCursorStyle(),document.body.style.userSelect=this.preUserSelect,this.preUserSelect="")},this.renderLayerPanel=(t,{x:e,y:i})=>{const n=document.documentElement.clientWidth,r=document.documentElement.clientHeight,s=n-e,a=r-i;let l={};s<e?(l.right=s+"px",e<ie&&(l.transform="translateX(".concat(ie-e,"px)"))):(l.left=e+"px",s<ie&&(l.transform="translateX(-".concat(ie-s,"px)"))),a<i?(l.bottom=a+"px",l.maxHeight=i-10+"px"):(l.top=i+"px",l.maxHeight=r-i-10+"px"),this.nodeTreePosition=l,this.nodeTree=t,this.showNodeTree=!0},this.removeLayerPanel=()=>{this.showNodeTree=!1,this.nodeTree=null,this.activeNode={}},this.addGlobalCursorStyle=()=>{if(!document.getElementById(Rn)){const t=document.createElement("style");t.setAttribute("id",Rn),t.innerText="body * {\n cursor: pointer !important;\n }",document.body.appendChild(t)}},this.removeGlobalCursorStyle=()=>{const t=document.getElementById(Rn);t&&t.remove()},this.sendXHR=()=>{const t=encodeURIComponent(this.element.path),e="http://".concat(this.ip,":").concat(this.port,"/?file=").concat(t,"&line=").concat(this.element.line,"&column=").concat(this.element.column),i=new XMLHttpRequest;i.open("GET",e,!0),i.send(),i.addEventListener("error",()=>{this.sendType="img",this.sendImg()})},this.sendImg=()=>{const t=encodeURIComponent(this.element.path),e="http://".concat(this.ip,":").concat(this.port,"/?file=").concat(t,"&line=").concat(this.element.line,"&column=").concat(this.element.column);document.createElement("img").src=e},this.buildTargetUrl=()=>{let t=this.target;const{path:e,line:i,column:n}=this.element,r={"{file}":e,"{line}":i,"{column}":n};for(let s in r)t=t.replace(new RegExp(s,"g"),String(r[s]));return t},this.locateCode=()=>{this.sendType==="xhr"?this.sendXHR():this.sendImg()},this.copyCode=()=>{const t=function(e,i,n,r){let s="".concat(e,":").concat(i,":").concat(n);if(typeof r=="string")s=r.replace(xo,e).replace(wo,i.toString()).replace(ko,n.toString());else if(r instanceof Array)return r.map(a=>a.replace(xo,e).replace(wo,i.toString()).replace(ko,n.toString()));return[s]}(this.element.path,String(this.element.line),String(this.element.column),this.copy||!1);this.copyToClipboard(t[0])},this.targetCode=()=>{window.open(this.buildTargetUrl(),"_blank")},this.dispatchCustomEvent=t=>{window.dispatchEvent(new CustomEvent("code-inspector:trackCode",{detail:{action:t,element:this.element}}))},this.trackCode=()=>{this.features.forEach(t=>{t.checked()&&(t.fn(),this.dispatchCustomEvent(t.action))})},this.handleModeShortcut=t=>{var n,r;if(!this.isTracking(t))return;if(((n=t.code)==null?void 0:n.toLowerCase())==="key".concat(this.modeKey)||((r=t.key)==null?void 0:r.toLowerCase())===this.modeKey)return this.toggleSettingsModal(),t.preventDefault(),void t.stopPropagation();const e=t.code.toLowerCase(),i=t.keyCode;this.features.forEach(s=>{const a="digit"+s.key,l="numpad"+s.key,c=48+s.key;if((e===a||e===l||i===c)&&s.available()&&(s.action==="ai"||this.targetNode&&this.element.path))return s.fn(),t.preventDefault(),t.stopPropagation(),void this.dispatchCustomEvent(s.action)})},this.handleDrag=t=>{if(t.composedPath().includes(this)?this.hoverSwitch=!0:this.hoverSwitch=!1,this.dragging){this.moved=!0;const e=this.draggingTarget==="switch"?this.inspectorSwitchRef:this.nodeTreeRef;return e.style.left=this.mousePosition.baseX+(this.getMousePosition(t).x-this.mousePosition.moveX)+"px",e.style.top=this.mousePosition.baseY+(this.getMousePosition(t).y-this.mousePosition.moveY)+"px",void(this.draggingTarget&&(this.nodeTreePosition.left=e.style.left,this.nodeTreePosition.top=e.style.top))}},this.getValidNodeList=t=>{const e=[];for(const i of t)i.hasAttribute&&i.hasAttribute(An)?e.push({node:i,isAstro:!0}):(i.hasAttribute&&i.hasAttribute(de)||i[de])&&e.push({node:i,isAstro:!1});return e},this.isSamePositionNode=(t,e)=>{const i=t.getBoundingClientRect(),n=e.getBoundingClientRect();return i.top===n.top&&i.left===n.left&&i.right===n.right&&i.bottom===n.bottom},this.handleMouseMove=t=>B(this,null,function*(){if((this.isTracking(t)&&!this.dragging||this.open)&&!this.hoverSwitch){document.hasFocus()||window.focus();const e=t.composedPath(),i=this.getValidNodeList(e);let n;for(const{node:r,isAstro:s}of i){if(s){n=r;break}n?this.isSamePositionNode(n,r)&&(n=r):n=r}n?this.renderCover(n):this.removeCover()}else this.removeCover()}),this.handleWheel=t=>{if(!this.targetNode||(t.stopPropagation(),t.preventDefault(),this.wheelThrottling))return;this.wheelThrottling=!0;const e=t.composedPath(),i=this.getValidNodeList(e);let n=i.findIndex(({node:s})=>s===this.targetNode);if(n===-1)return void(this.wheelThrottling=!1);const r=t.deltaX||t.deltaY;r>0?n--:r<0&&n++,n>=0&&n<i.length&&this.renderCover(i[n].node),setTimeout(()=>{this.wheelThrottling=!1},200)},this.handleMouseClick=t=>{(this.isTracking(t)||this.open)&&this.show&&(t.stopPropagation(),t.preventDefault(),this.trackCode(),this.removeCover(),this.autoToggle&&(this.open=!1)),t.composedPath().includes(this.nodeTreeRef)||this.removeLayerPanel()},this.handleContextMenu=t=>{if((this.isTracking(t)&&!this.dragging||this.open)&&!this.hoverSwitch){t.preventDefault();const e=t.composedPath(),i=this.generateNodeTree(e);this.renderLayerPanel(i,{x:t.clientX,y:t.clientY})}},this.generateNodeTree=t=>{let e,i=1,n=null;for(const r of t.reverse()){const s=this.getSourceInfo(r);if(!s)continue;const a=V(C({},s),{children:[],depth:i++,element:r});n?n.children.push(a):e=a,n=a}return e},this.handlePointerDown=t=>{let e=!1,i=t.target;for(;i;){if(i.disabled){e=!0;break}i=i.parentElement}e&&(this.isTracking(t)||this.open)&&this.show&&(t.stopPropagation(),t.preventDefault(),this.trackCode(),this.removeCover(),this.autoToggle&&(this.open=!1))},this.handleKeyUp=t=>{this.isTracking(t)||this.open||this.removeCover()},this.printTip=()=>{const t=navigator.userAgent.toLowerCase(),e=["windows","win32","wow32","win64","wow64"].some(a=>t.toUpperCase().match(a.toUpperCase()))?Ds:Ls,i=this.hotKeys.split(",").map(a=>e[a.trim()]),n=[...i,this.modeKey.toUpperCase()],r=Lr,s=a=>{const l=r.yellow(a[0]).bold();for(let c=1;c<a.length;c++)l.green(" + ").yellow(a[c]).bold();return l};r.blue("[code-inspector-plugin] click to expand the guide").groupCollapsed(()=>{s(i.concat("left click")).green(" to use active feature").log(),s(i.concat("right click")).green(" to open node tree").log(),s(i.concat("mouse wheel")).green(" to select parent node or child node").log(),s(n).green(" to change active feature").log(),this.features.forEach(a=>{s(i.concat(a.key.toString())).green(" to use ").yellow(a.label).bold().log()})})},this.getMousePosition=t=>{var e,i;return{x:t instanceof MouseEvent?t.pageX:(e=t.touches[0])==null?void 0:e.pageX,y:t instanceof MouseEvent?t.pageY:(i=t.touches[0])==null?void 0:i.pageY}},this.recordMousePosition=(t,e)=>{const i=e==="switch"?this.inspectorSwitchRef:this.nodeTreeRef;this.mousePosition={baseX:i.offsetLeft,baseY:i.offsetTop,moveX:this.getMousePosition(t).x,moveY:this.getMousePosition(t).y},this.dragging=!0,this.draggingTarget=e,t.preventDefault()},this.handleMouseUp=t=>{this.hoverSwitch=!1,this.dragging&&(this.dragging=!1,t instanceof TouchEvent&&this.draggingTarget==="switch"&&this.switch(t))},this.switch=t=>{this.moved||(this.open=!this.open,t.preventDefault(),t.stopPropagation()),this.moved=!1},this.handleClickTreeNode=t=>{this.element=t,this.trackCode(),this.removeLayerPanel()},this.handleMouseEnterNode=(t,e)=>B(this,null,function*(){const{x:i,y:n,width:r,height:s}=t.target.getBoundingClientRect();this.activeNode={width:r-16+"px",left:i+8+"px",visibility:"hidden",top:n-4+"px",bottom:"",content:"".concat(e.path,":").concat(e.line,":").concat(e.column),class:"tooltip-top"},this.renderCover(e.element),yield ai();const{y:a}=this.nodeTreeTooltipRef.getBoundingClientRect();a<0&&(this.activeNode=V(C({},this.activeNode),{bottom:"",top:"".concat(n+s+4,"px"),class:"tooltip-bottom"})),this.activeNode=V(C({},this.activeNode),{visibility:"visible"})}),this.handleMouseLeaveNode=()=>{this.activeNode=V(C({},this.activeNode),{visibility:"hidden"}),this.removeCover(!0)},this.toggleSettingsModal=()=>{this.showSettingsModal=!this.showSettingsModal},this.closeSettingsModal=()=>{this.showSettingsModal=!1},this.clearAllActions=()=>{this.internalLocate=!1,this.internalCopy=!1,this.internalTarget=!1,this.internalAI=!1},this.toggleLocate=()=>{const t=!this.internalLocate;this.clearAllActions(),this.internalLocate=t},this.toggleCopy=()=>{const t=!this.internalCopy;this.clearAllActions(),this.internalCopy=t},this.toggleTarget=()=>{const t=!this.internalTarget;this.clearAllActions(),this.internalTarget=t},this.toggleAICode=()=>{const t=!this.internalAI;this.clearAllActions(),this.internalAI=t},this.persistAIState=()=>{var e;let t=null;if(this.showChatModal){const i=(e=this.shadowRoot)==null?void 0:e.querySelector("#chat-modal-floating");i&&(t={left:i.style.left,top:i.style.top})}(function(i){try{sessionStorage.setItem(En,JSON.stringify(i))}catch(n){}})({showChatModal:this.showChatModal,chatMessages:this.chatMessages,chatContext:this.chatContext,chatSessionId:this.chatSessionId,chatTheme:this.chatTheme,chatModel:this.chatModel,modalPosition:t})},this.openChatModal=()=>{this.element.path?this.chatContext={file:this.element.path,line:this.element.line,column:this.element.column,name:this.element.name}:this.chatContext=null;const t=this.targetNode;this.showChatModal=!0,this.chatModel||function(e,i){return B(this,null,function*(){try{const n=yield fetch("http://".concat(e,":").concat(i,"/ai/model"));return n.ok&&(yield n.json()).model||""}catch(n){return""}})}(this.ip,this.port).then(e=>{e&&this.isConnected&&(this.chatModel=e)}),document.body.style.overflow="hidden",this.updateComplete.then(()=>{requestAnimationFrame(()=>{var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("#chat-modal-floating");if(e)if(t)this.chatPositionCleanup=(n=e,(i=t)&&n&&B(this,null,function*(){const s=yield ss(i,n,{strategy:"fixed",placement:"right-start",middleware:[os(bt),rs({fallbackPlacements:Es.slice(1),padding:bt}),is({padding:bt})]}),{x:a,y:l}=s,c=document.documentElement.clientWidth,h=document.documentElement.clientHeight,d=n.getBoundingClientRect(),p=d.width,g=d.height,u=i.getBoundingClientRect(),m=a<bt||l<bt||a+p>c-bt||l+g>h-bt,f=a<u.right&&a+p>u.left&&l<u.bottom&&l+g>u.top;if(m||f){const b=(c-p)/2,y=(h-g)/2;Object.assign(n.style,{left:"".concat(Math.max(bt,b),"px"),top:"".concat(Math.max(bt,y),"px")}),n.classList.add("chat-modal-centered")}else Object.assign(n.style,{left:"".concat(a,"px"),top:"".concat(l,"px")}),n.classList.remove("chat-modal-centered")}),null);else{const s=document.documentElement.clientWidth,a=document.documentElement.clientHeight,l=e.getBoundingClientRect(),c=(s-l.width)/2,h=(a-l.height)/2;e.style.left="".concat(Math.max(16,c),"px"),e.style.top="".concat(Math.max(16,h),"px"),e.classList.add("chat-modal-centered")}var i,n;requestAnimationFrame(()=>this.persistAIState())})})},this.closeChatModal=()=>{this.chatPositionCleanup&&(this.chatPositionCleanup(),this.chatPositionCleanup=null),this.showChatModal=!1,document.body.style.overflow="",function(){try{sessionStorage.removeItem(En)}catch(t){}}()},this.clearChatMessages=()=>{this.chatMessages=[],this.chatSessionId=null,this.turnStatus="idle",this.turnDuration=0,this.persistAIState()},this.toggleTheme=()=>{this.chatTheme=this.chatTheme==="dark"?"light":"dark",this.chatTheme==="light"?this.classList.add("chat-theme-light"):this.classList.remove("chat-theme-light"),this.persistAIState()},this.handleChatInput=t=>{this.chatInput=t.target.value},this.handleChatKeyDown=t=>{t.key!=="Enter"||t.shiftKey||(t.preventDefault(),this.sendChatMessage())},this.scrollPending=!1,this.scrollChatToBottom=()=>{this.scrollPending||(this.scrollPending=!0,requestAnimationFrame(()=>{var e;const t=(e=this.shadowRoot)==null?void 0:e.querySelector(".chat-modal-content");t&&(t.scrollTop=t.scrollHeight),this.scrollPending=!1}))},this.startTurnTimer=()=>{this.turnStartTime=Date.now(),this.turnDuration=0,this.turnStatus="running",this.turnTimerInterval=setInterval(()=>{this.turnDuration=Math.floor((Date.now()-this.turnStartTime)/1e3)},1e3)},this.stopTurnTimer=t=>{this.turnTimerInterval&&(clearInterval(this.turnTimerInterval),this.turnTimerInterval=null),this.turnDuration=Math.floor((Date.now()-this.turnStartTime)/1e3),this.turnStatus=t},this.interruptChat=()=>{this.chatAbortController&&(this.chatAbortController.abort(),this.chatAbortController=null),this.stopTurnTimer("interrupt"),this.chatLoading=!1},this.handleChatDragStart=t=>{var i;if(t.button!==0)return;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("#chat-modal-floating");e&&(this.chatPositionCleanup&&(this.chatPositionCleanup(),this.chatPositionCleanup=null),this.isDragging=!0,this.wasDragging=!0,this.dragStartX=t.clientX,this.dragStartY=t.clientY,this.modalStartX=e.offsetLeft,this.modalStartY=e.offsetTop,t.preventDefault())},this.handleChatDragMove=t=>{var p;if(!this.isDragging)return;const e=(p=this.shadowRoot)==null?void 0:p.querySelector("#chat-modal-floating");if(!e)return;const i=t.clientX-this.dragStartX,n=t.clientY-this.dragStartY,r=this.modalStartX+i,s=this.modalStartY+n,a=document.documentElement.clientWidth,l=document.documentElement.clientHeight,c=e.getBoundingClientRect(),h=Math.max(0,Math.min(r,a-c.width)),d=Math.max(0,Math.min(s,l-c.height));e.style.left="".concat(h,"px"),e.style.top="".concat(d,"px")},this.handleChatDragEnd=()=>{this.isDragging=!1,setTimeout(()=>{this.wasDragging=!1},100),this.persistAIState()},this.handleOverlayClick=()=>{this.wasDragging||this.closeChatModal()},this.sendChatMessage=()=>B(this,null,function*(){if(!this.chatInput.trim()||this.chatLoading)return;const t=this.chatInput.trim();this.chatInput="",this.chatMessages=[...this.chatMessages,{role:"user",content:t}],this.chatLoading=!0,this.scrollChatToBottom(),this.startTurnTimer(),this.chatAbortController=new AbortController,this.chatMessages=[...this.chatMessages,{role:"assistant",content:"",blocks:[]}];let e="";const i=[],n=new Map,r=()=>{this.chatMessages=[...this.chatMessages.slice(0,-1),{role:"assistant",content:e,blocks:[...i]}],this.scrollChatToBottom()};let s=null;const a=()=>{s&&(clearTimeout(s),s=null),r(),this.persistAIState()};try{yield function(l,c,h,d,p,g,u,m){return B(this,null,function*(){var v,_,T,x;const f=yield fetch("http://".concat(l,":").concat(c,"/ai"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C({message:h,context:d,history:p},m&&{sessionId:m})),signal:u});if(!f.ok)throw new Error("Chat request failed");const b=(v=f.body)==null?void 0:v.getReader(),y=new TextDecoder;if(b){let A="";for(;;){const{done:j,value:K}=yield b.read();if(j)break;A+=y.decode(K,{stream:!0});const dt=A.split("\n");A=dt.pop()||"";for(const ot of dt)if(ot.startsWith("data: ")){const Z=ot.slice(6);if(Z==="[DONE]")continue;try{const D=JSON.parse(Z);switch(D.type){case"text":default:D.content&&g.onText(D.content);break;case"tool_start":g.onToolStart(D.toolId,D.toolName,D.index);break;case"tool_input":g.onToolInput(D.index,D.input);break;case"tool_result":g.onToolResult(D.toolUseId,D.content,D.isError);break;case"session":D.sessionId&&((_=g.onSessionId)==null||_.call(g,D.sessionId));break;case"info":D.cwd&&((T=g.onProjectRoot)==null||T.call(g,D.cwd)),D.model&&((x=g.onModel)==null||x.call(g,D.model))}D.error&&g.onError(new Error(D.error))}catch(D){}}}}})}(this.ip,this.port,t,this.chatContext,this.chatMessages.slice(0,-1),{onText:l=>{e+=l;const c=i[i.length-1];c&&c.type==="text"?c.content=(c.content||"")+l:i.push({type:"text",content:l}),s||(s=setTimeout(()=>{s=null,r()},50))},onToolStart:(l,c,h)=>{const d={id:l,name:c,isComplete:!1},p=i.length;i.push({type:"tool",tool:d}),n.set(l,p),a()},onToolInput:(l,c)=>{for(let h=i.length-1;h>=0;h--)if(i[h].type==="tool"&&i[h].tool&&!i[h].tool.isComplete){i[h].tool.input=c,a();break}},onToolResult:(l,c,h)=>{var p;const d=n.get(l);d!==void 0&&((p=i[d])!=null&&p.tool)&&(i[d].tool.result=c,i[d].tool.isError=h,i[d].tool.isComplete=!0,a())},onError:l=>{console.error("Chat error:",l)},onSessionId:l=>{this.chatSessionId=l,this.persistAIState()},onProjectRoot:l=>{oe=l},onModel:l=>{this.chatModel=l}},this.chatAbortController.signal,this.chatSessionId),a(),this.stopTurnTimer("done")}catch(l){l instanceof Error&&l.name==="AbortError"||(this.chatMessages=this.chatMessages.slice(0,-1),this.showNotification("Failed to send message","error"),this.stopTurnTimer("interrupt"))}finally{this.chatLoading=!1,this.chatAbortController=null}}),this.renderNodeTree=t=>S(qi||(qi=$(['\n <div\n class="inspector-layer"\n style="padding-left: ','px;"\n @mouseenter="','"\n @mouseleave="','"\n @click="','"\n >\n <',">\n </div>\n ","\n "])),8*t.depth,e=>B(this,null,function*(){return yield this.handleMouseEnterNode(e,t)}),this.handleMouseLeaveNode,()=>this.handleClickTreeNode(t),t.name,t.children.map(e=>this.renderNodeTree(e)))}showNotification(t,e="success"){const i=document.createElement("div");i.className="code-inspector-notification code-inspector-notification-".concat(e),i.textContent=t,document.body.appendChild(i),requestAnimationFrame(()=>{i.classList.add("code-inspector-notification-show")}),setTimeout(()=>{i.classList.remove("code-inspector-notification-show"),setTimeout(()=>{document.body.removeChild(i)},300)},2e3)}copyToClipboard(t){var e;try{typeof((e=navigator==null?void 0:navigator.clipboard)==null?void 0:e.writeText)=="function"?navigator.clipboard.writeText(t).then(()=>{this.showNotification("✓ Copied to clipboard")}).catch(()=>{this.fallbackCopy(t)}):this.fallbackCopy(t)}catch(i){this.fallbackCopy(t)}}fallbackCopy(t){try{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();const i=document.execCommand("copy");document.body.removeChild(e),i?this.showNotification("✓ Copied to clipboard"):this.showNotification("✗ Copy failed","error")}catch(e){this.showNotification("✗ Copy failed","error")}}attachEventListeners(){this.eventListeners.forEach(({event:t,handler:e,options:i})=>{window.addEventListener(t,e,i)})}detachEventListeners(){this.eventListeners.forEach(({event:t,handler:e,options:i})=>{window.removeEventListener(t,e,i)})}firstUpdated(){var i,n,r;let t=!1;if(this.defaultAction)switch(this.defaultAction){case"ai":this.ai&&(this.internalAI=!0,t=!0);break;case"target":this.target&&(this.internalTarget=!0,t=!0);break;case"copy":this.copy&&(this.internalCopy=!0,t=!0);break;case"locate":this.locate&&(this.internalLocate=!0,t=!0)}t||(this.locate?this.internalLocate=!0:this.copy?this.internalCopy=!0:this.target?this.internalTarget=!0:this.ai&&(this.internalAI=!0));const e=function(){try{const s=sessionStorage.getItem(En);return s?JSON.parse(s):null}catch(s){return null}}();if(e!=null&&e.showChatModal)this.chatMessages=e.chatMessages,this.chatContext=e.chatContext,this.chatSessionId=e.chatSessionId,this.chatTheme=e.chatTheme,this.chatModel=e.chatModel,this.showChatModal=!0,this.chatTheme==="light"&&this.classList.add("chat-theme-light"),document.body.style.overflow="hidden",this.updateComplete.then(()=>{requestAnimationFrame(()=>{var a;const s=(a=this.shadowRoot)==null?void 0:a.querySelector("#chat-modal-floating");s&&e.modalPosition&&(s.style.left=e.modalPosition.left,s.style.top=e.modalPosition.top)})});else{const s=(r=(n=(i=window.matchMedia)==null?void 0:i.call(window,"(prefers-color-scheme: dark)"))==null?void 0:n.matches)!=null?r:!1;this.chatTheme=s?"dark":"light",this.chatTheme==="light"&&this.classList.add("chat-theme-light")}this.eventListeners=[{event:"mousemove",handler:this.handleMouseMove,options:!0},{event:"touchmove",handler:this.handleMouseMove,options:!0},{event:"mousemove",handler:this.handleDrag,options:!0},{event:"touchmove",handler:this.handleDrag,options:!0},{event:"click",handler:this.handleMouseClick,options:!0},{event:"pointerdown",handler:this.handlePointerDown,options:!0},{event:"keyup",handler:this.handleKeyUp,options:!0},{event:"keydown",handler:this.handleModeShortcut,options:!0},{event:"mouseleave",handler:this.removeCover,options:!0},{event:"mouseup",handler:this.handleMouseUp,options:!0},{event:"touchend",handler:this.handleMouseUp,options:!0},{event:"contextmenu",handler:this.handleContextMenu,options:!0},{event:"wheel",handler:this.handleWheel,options:{passive:!1}}],this.hideConsole||this.printTip(),this.attachEventListeners()}disconnectedCallback(){this.detachEventListeners()}render(){const t={display:this.show?"block":"none",top:this.position.top-this.position.margin.top+"px",left:this.position.left-this.position.margin.left+"px",height:"".concat(this.position.bottom-this.position.top+this.position.margin.bottom+this.position.margin.top,"px"),width:"".concat(this.position.right-this.position.left+this.position.margin.right+this.position.margin.left,"px")},e={borderTopWidth:"".concat(this.position.margin.top,"px"),borderRightWidth:"".concat(this.position.margin.right,"px"),borderBottomWidth:"".concat(this.position.margin.bottom,"px"),borderLeftWidth:"".concat(this.position.margin.left,"px")},i={borderTopWidth:"".concat(this.position.border.top,"px"),borderRightWidth:"".concat(this.position.border.right,"px"),borderBottomWidth:"".concat(this.position.border.bottom,"px"),borderLeftWidth:"".concat(this.position.border.left,"px")},n={borderTopWidth:"".concat(this.position.padding.top,"px"),borderRightWidth:"".concat(this.position.padding.right,"px"),borderBottomWidth:"".concat(this.position.padding.bottom,"px"),borderLeftWidth:"".concat(this.position.padding.left,"px")},r=C({display:this.showNodeTree?"flex":"none"},this.nodeTreePosition),s={visibility:this.activeNode.visibility,maxWidth:this.activeNode.width,top:this.activeNode.top,left:this.activeNode.left,bottom:this.activeNode.bottom,display:this.showNodeTree?"":"none"};return S(Zi||(Zi=$(['\n <div\n class="code-inspector-container"\n id="code-inspector-container"\n style=','\n >\n <div class="margin-overlay" style=','>\n <div class="border-overlay" style=','>\n <div class="padding-overlay" style=','>\n <div class="content-overlay"></div>\n </div>\n </div>\n </div>\n <div\n id="element-info"\n class="element-info '," "," ",'"\n style=','\n >\n <div class="element-info-content">\n <div class="name-line">\n <div class="element-name">\n <span class="element-title"><','></span>\n </div>\n </div>\n <div class="path-line">\n ',":",":",'\n </div>\n </div>\n </div>\n </div>\n <div\n id="inspector-switch"\n class="inspector-switch '," ",'"\n style=','\n @mousedown="','"\n @touchstart="','"\n @click="','"\n >\n ','\n </div>\n <div\n id="inspector-node-tree"\n class="element-info-content"\n style=','\n >\n <div\n class="inspector-layer-title"\n @mousedown="','"\n @touchstart="','"\n >\n <div>🔍️ Click node to locate</div>\n ','\n </div>\n\n <div\n class="node-tree-list"\n style="','"\n >\n ','\n <div style="height: 8px"></div>\n </div>\n </div>\n\n <!-- 设置弹窗 -->\n ',"\n\n <!-- 聊天框 -->\n ",'\n\n <div\n id="node-tree-tooltip"\n class="','"\n style=',"\n >\n ","\n </div>\n "])),gt(t),gt(e),gt(i),gt(n),this.elementTipStyle.vertical,this.elementTipStyle.horizon,this.elementTipStyle.visibility,gt(C({width:ie+"px",maxWidth:"100vw"},this.elementTipStyle.additionStyle)),this.element.name,this.element.path,this.element.line,this.element.column,this.open?"active-inspector-switch":"",this.moved?"move-inspector-switch":"",gt({display:this.showSwitch?"flex":"none"}),a=>this.recordMousePosition(a,"switch"),a=>this.recordMousePosition(a,"switch"),this.switch,this.open?S(Fi||(Fi=$(['\n <svg\n t="1677801709811"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="1110"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n width="1em"\n height="1em"\n >\n <path\n d="M546.56 704H128c-19.2 0-32-12.8-32-32V256h704v194.56c10.928 1.552 21.648 3.76 32 6.832V128c0-35.2-28.8-64-64-64H128C92.8 64 64 92.8 64 128v544c0 35.2 28.8 64 64 64h425.392a221.936 221.936 0 0 1-6.848-32zM96 128c0-19.2 12.8-32 32-32h640c19.2 0 32 12.8 32 32v96H96V128z"\n fill="#34495E"\n p-id="1111"\n ></path>\n <path\n d="M416 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="#00B42A"\n p-id="1112"\n ></path>\n <path\n d="M288 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="#F7BA1E"\n p-id="1113"\n ></path>\n <path\n d="M160 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="#F53F3F"\n p-id="1114"\n ></path>\n <path\n d="M382.848 658.928l99.376-370.88 30.912 8.272-99.36 370.88zM318.368 319.2L160 477.6l158.4 158.4 22.64-22.624-135.792-135.776 135.776-135.776zM768 480c-13.088 0-25.888 1.344-38.24 3.84l6.24-6.24-158.4-158.4-22.64 22.624 135.792 135.776-135.776 135.776 22.656 22.624 2.208-2.224a190.768 190.768 0 0 0 30.928 148.08l-116.672 116.656c-10.24 10.24-10.24 26.896 0 37.136l27.76 27.76c5.12 5.12 11.84 7.68 18.56 7.68s13.456-2.56 18.56-7.68l120.992-120.96A190.56 190.56 0 0 0 768 864c105.872 0 192-86.128 192-192s-86.128-192-192-192z m-159.12 193.136c0-88.224 71.776-160 160-160 10.656 0 21.04 1.152 31.12 3.152V672c0 19.2-12.8 32-32 32h-156a160.144 160.144 0 0 1-3.12-30.864z m-68.464 263.584l-19.632-19.632 110.336-110.336c6.464 6.656 13.392 12.848 20.752 18.528l-111.456 111.44z m228.464-103.584c-65.92 0-122.576-40.096-147.056-97.136H768c35.2 0 64-28.8 64-64v-145.776c56.896 24.544 96.88 81.12 96.88 146.912 0 88.224-71.776 160-160 160z"\n fill="#006AFF"\n p-id="1115"\n ></path>\n <path\n d="M864.576 672c0 52.928-43.072 96-96 96v32a128 128 0 0 0 128-128h-32z"\n fill="#34495E"\n p-id="1116"\n ></path>\n </svg>\n ']))):S(Hi||(Hi=$(['<svg\n t="1677801709811"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="1110"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n width="1em"\n height="1em"\n >\n <path\n d="M546.56 704H128c-19.2 0-32-12.8-32-32V256h704v194.56c10.928 1.552 21.648 3.76 32 6.832V128c0-35.2-28.8-64-64-64H128C92.8 64 64 92.8 64 128v544c0 35.2 28.8 64 64 64h425.392a221.936 221.936 0 0 1-6.848-32zM96 128c0-19.2 12.8-32 32-32h640c19.2 0 32 12.8 32 32v96H96V128z"\n fill="currentColor"\n p-id="1111"\n ></path>\n <path\n d="M416 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="currentColor"\n p-id="1112"\n ></path>\n <path\n d="M288 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="currentColor"\n p-id="1113"\n ></path>\n <path\n d="M160 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="currentColor"\n p-id="1114"\n ></path>\n <path\n d="M382.848 658.928l99.376-370.88 30.912 8.272-99.36 370.88zM318.368 319.2L160 477.6l158.4 158.4 22.64-22.624-135.792-135.776 135.776-135.776zM768 480c-13.088 0-25.888 1.344-38.24 3.84l6.24-6.24-158.4-158.4-22.64 22.624 135.792 135.776-135.776 135.776 22.656 22.624 2.208-2.224a190.768 190.768 0 0 0 30.928 148.08l-116.672 116.656c-10.24 10.24-10.24 26.896 0 37.136l27.76 27.76c5.12 5.12 11.84 7.68 18.56 7.68s13.456-2.56 18.56-7.68l120.992-120.96A190.56 190.56 0 0 0 768 864c105.872 0 192-86.128 192-192s-86.128-192-192-192z m-159.12 193.136c0-88.224 71.776-160 160-160 10.656 0 21.04 1.152 31.12 3.152V672c0 19.2-12.8 32-32 32h-156a160.144 160.144 0 0 1-3.12-30.864z m-68.464 263.584l-19.632-19.632 110.336-110.336c6.464 6.656 13.392 12.848 20.752 18.528l-111.456 111.44z m228.464-103.584c-65.92 0-122.576-40.096-147.056-97.136H768c35.2 0 64-28.8 64-64v-145.776c56.896 24.544 96.88 81.12 96.88 146.912 0 88.224-71.776 160-160 160z"\n fill="currentColor"\n p-id="1115"\n ></path>\n <path\n d="M864.576 672c0 52.928-43.072 96-96 96v32a128 128 0 0 0 128-128h-32z"\n fill="currentColor"\n p-id="1116"\n ></path>\n </svg>']))),gt(r),a=>this.recordMousePosition(a,"nodeTree"),a=>this.recordMousePosition(a,"nodeTree"),S(Yi||(Yi=$(['<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16"\n height="16"\n viewBox="0 0 24 24"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n class="close-icon"\n @click="','"\n >\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>'])),this.removeLayerPanel),gt({pointerEvents:this.dragging?"none":""}),this.nodeTree?this.renderNodeTree(this.nodeTree):"",this.showSettingsModal?S(Xi||(Xi=$(['\n <div\n class="settings-modal-overlay"\n @click="','"\n >\n <div\n class="settings-modal"\n @click="','"\n >\n <div class="settings-modal-header">\n <h3 class="settings-modal-title">Mode Settings</h3>\n <button\n class="settings-modal-close"\n @click="','"\n >\n ×\n </button>\n </div>\n <div class="settings-modal-content">\n ',"\n </div>\n </div>\n </div>\n "])),this.closeSettingsModal,a=>a.stopPropagation(),this.closeSettingsModal,this.features.map(a=>S(Ki||(Ki=$(['\n <div class="settings-item">\n <label class="settings-label">\n <span class="settings-label-text"\n >','</span\n >\n <span class="settings-label-desc"\n >','</span\n >\n </label>\n <label class="settings-switch">\n <input\n type="checkbox"\n .checked="','"\n @change="','"\n />\n <span class="settings-slider"></span>\n </label>\n </div>\n '])),a.label,a.description,a.checked(),a.onChange))):"",As({showChatModal:this.showChatModal,chatMessages:this.chatMessages,chatInput:this.chatInput,chatLoading:this.chatLoading,chatContext:this.chatContext,currentTools:this.currentTools,chatTheme:this.chatTheme,turnStatus:this.turnStatus,turnDuration:this.turnDuration,isDragging:this.isDragging,chatModel:this.chatModel},{closeChatModal:this.closeChatModal,clearChatMessages:this.clearChatMessages,handleChatInput:this.handleChatInput,handleChatKeyDown:this.handleChatKeyDown,sendChatMessage:this.sendChatMessage,toggleTheme:this.toggleTheme,interruptChat:this.interruptChat,handleDragStart:this.handleChatDragStart,handleDragMove:this.handleChatDragMove,handleDragEnd:this.handleChatDragEnd,handleOverlayClick:this.handleOverlayClick}),this.activeNode.class,gt(s),this.activeNode.content)}}if(w.styles=[se(Gi||(Gi=$(["\n .code-inspector-container {\n position: fixed;\n pointer-events: none;\n z-index: 9999999999999;\n font-family: 'PingFang SC';\n .margin-overlay {\n position: absolute;\n inset: 0;\n border-style: solid;\n border-color: rgba(255, 155, 0, 0.3);\n .border-overlay {\n position: absolute;\n inset: 0;\n border-style: solid;\n border-color: rgba(255, 200, 50, 0.3);\n .padding-overlay {\n position: absolute;\n inset: 0;\n border-style: solid;\n border-color: rgba(77, 200, 0, 0.3);\n .content-overlay {\n position: absolute;\n inset: 0;\n background: rgba(120, 170, 210, 0.7);\n }\n }\n }\n }\n }\n .element-info {\n position: absolute;\n }\n .element-info.hidden {\n visibility: hidden;\n }\n .element-info-content {\n max-width: 100%;\n font-size: 12px;\n color: #000;\n background-color: #fff;\n word-break: break-all;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);\n box-sizing: border-box;\n padding: 4px 8px;\n border-radius: 4px;\n }\n .element-info-top {\n top: -4px;\n transform: translateY(-100%);\n }\n .element-info-bottom {\n top: calc(100% + 4px);\n }\n .element-info-top-inner {\n top: 4px;\n }\n .element-info-bottom-inner {\n bottom: 4px;\n }\n .element-info-left {\n left: 0;\n display: flex;\n justify-content: flex-start;\n }\n .element-info-right {\n right: 0;\n display: flex;\n justify-content: flex-end;\n }\n .element-name .element-title {\n color: coral;\n font-weight: bold;\n }\n .path-line {\n color: #333;\n line-height: 12px;\n margin-top: 4px;\n }\n .inspector-switch {\n position: fixed;\n z-index: 9999999999999;\n top: 50%;\n right: 24px;\n font-size: 22px;\n transform: translateY(-100%);\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: rgba(255, 255, 255, 0.8);\n color: #555;\n height: 32px;\n width: 32px;\n border-radius: 50%;\n box-shadow: 0px 1px 2px -2px rgba(0, 0, 0, 0.2),\n 0px 3px 6px 0px rgba(0, 0, 0, 0.16),\n 0px 5px 12px 4px rgba(0, 0, 0, 0.12);\n cursor: pointer;\n }\n .active-inspector-switch {\n color: #006aff;\n }\n .move-inspector-switch {\n cursor: move;\n }\n #inspector-node-tree {\n position: fixed;\n user-select: none;\n z-index: 9999999999999999;\n min-width: 300px;\n max-width: min(max(30vw, 300px), 400px);\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,\n 'Liberation Mono', 'Courier New', monospace;\n display: flex;\n flex-direction: column;\n padding: 0;\n\n .inspector-layer-title {\n border-bottom: 1px solid #eee;\n padding: 8px 8px 4px;\n margin-bottom: 8px;\n flex-shrink: 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: move;\n user-select: none;\n &:hover {\n background: rgba(0, 106, 255, 0.1);\n }\n }\n\n .node-tree-list {\n flex: 1;\n overflow-y: auto;\n min-height: 0;\n }\n\n .inspector-layer {\n cursor: pointer;\n position: relative;\n padding-right: 8px;\n &:hover {\n background: #fdf4bf;\n }\n }\n\n .path-line {\n font-size: 9px;\n color: #777;\n margin-top: 1px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n }\n }\n\n #node-tree-tooltip {\n position: fixed;\n box-sizing: border-box;\n z-index: 999999999999999999;\n background: rgba(0, 0, 0, 0.6);\n color: white;\n padding: 2px 6px;\n border-radius: 4px;\n font-size: 12px;\n white-space: wrap;\n pointer-events: none;\n word-break: break-all;\n }\n .tooltip-top {\n transform: translateY(-100%);\n }\n .close-icon {\n cursor: pointer;\n }\n\n /* 设置弹窗样式 */\n .settings-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 99999999999999999;\n animation: fadeIn 0.2s ease-out;\n }\n\n .settings-modal {\n background: #fff;\n border-radius: 12px;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n width: 90%;\n max-width: 480px;\n max-height: 90vh;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n animation: slideUp 0.3s ease-out;\n }\n\n .settings-modal-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px;\n border-bottom: 1px solid #eee;\n }\n\n .settings-modal-title {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: #333;\n }\n\n .settings-modal-close {\n background: none;\n border: none;\n font-size: 28px;\n color: #999;\n cursor: pointer;\n padding: 0;\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: all 0.2s;\n }\n\n .settings-modal-close:hover {\n background: #f5f5f5;\n color: #333;\n }\n\n .settings-modal-content {\n padding: 16px 24px;\n overflow-y: auto;\n flex: 1;\n }\n\n .settings-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 0;\n border-bottom: 1px solid #f5f5f5;\n }\n\n .settings-item:last-child {\n border-bottom: none;\n }\n\n .settings-label {\n display: flex;\n flex-direction: column;\n flex: 1;\n margin-right: 16px;\n cursor: pointer;\n }\n\n .settings-label-text {\n font-size: 15px;\n font-weight: 500;\n color: #333;\n margin-bottom: 4px;\n }\n\n .settings-label-desc {\n font-size: 13px;\n color: #999;\n }\n\n .settings-switch {\n position: relative;\n display: inline-block;\n width: 44px;\n height: 24px;\n flex-shrink: 0;\n }\n\n .settings-switch input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n .settings-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #ccc;\n transition: 0.3s;\n border-radius: 24px;\n }\n\n .settings-slider:before {\n position: absolute;\n content: '';\n height: 18px;\n width: 18px;\n left: 3px;\n bottom: 3px;\n background-color: white;\n transition: 0.3s;\n border-radius: 50%;\n }\n\n .settings-switch input:checked + .settings-slider {\n background-color: #006aff;\n }\n\n .settings-switch input:checked + .settings-slider:before {\n transform: translateX(20px);\n }\n\n .settings-switch input:focus + .settings-slider {\n box-shadow: 0 0 1px #006aff;\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes slideUp {\n from {\n transform: translateY(20px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n }\n "]))),zs],k([Y()],w.prototype,"hotKeys",2),k([Y()],w.prototype,"port",2),k([Y()],w.prototype,"showSwitch",2),k([Y()],w.prototype,"autoToggle",2),k([Y()],w.prototype,"hideConsole",2),k([Y()],w.prototype,"locate",2),k([Y()],w.prototype,"copy",2),k([Y()],w.prototype,"target",2),k([Y()],w.prototype,"targetNode",2),k([Y()],w.prototype,"ip",2),k([Y()],w.prototype,"ai",2),k([Y()],w.prototype,"modeKey",2),k([Y()],w.prototype,"defaultAction",2),k([E()],w.prototype,"position",2),k([E()],w.prototype,"element",2),k([E()],w.prototype,"elementTipStyle",2),k([E()],w.prototype,"show",2),k([E()],w.prototype,"showNodeTree",2),k([E()],w.prototype,"nodeTreePosition",2),k([E()],w.prototype,"nodeTree",2),k([E()],w.prototype,"dragging",2),k([E()],w.prototype,"mousePosition",2),k([E()],w.prototype,"draggingTarget",2),k([E()],w.prototype,"open",2),k([E()],w.prototype,"moved",2),k([E()],w.prototype,"hoverSwitch",2),k([E()],w.prototype,"preUserSelect",2),k([E()],w.prototype,"sendType",2),k([E()],w.prototype,"activeNode",2),k([E()],w.prototype,"showSettingsModal",2),k([E()],w.prototype,"internalLocate",2),k([E()],w.prototype,"internalCopy",2),k([E()],w.prototype,"internalTarget",2),k([E()],w.prototype,"internalAI",2),k([E()],w.prototype,"showChatModal",2),k([E()],w.prototype,"chatMessages",2),k([E()],w.prototype,"chatInput",2),k([E()],w.prototype,"chatLoading",2),k([E()],w.prototype,"chatContext",2),k([E()],w.prototype,"currentTools",2),k([E()],w.prototype,"chatTheme",2),k([E()],w.prototype,"turnStatus",2),k([E()],w.prototype,"turnDuration",2),k([E()],w.prototype,"chatModel",2),k([E()],w.prototype,"isDragging",2),k([Nt("#inspector-switch")],w.prototype,"inspectorSwitchRef",2),k([Nt("#code-inspector-container")],w.prototype,"codeInspectorContainerRef",2),k([Nt("#element-info")],w.prototype,"elementInfoRef",2),k([Nt("#inspector-node-tree")],w.prototype,"nodeTreeRef",2),k([Nt(".inspector-layer-title")],w.prototype,"nodeTreeTitleRef",2),k([Nt("#node-tree-tooltip")],w.prototype,"nodeTreeTooltipRef",2),!document.getElementById("code-inspector-notification-styles")){const o=document.createElement("style");o.id="code-inspector-notification-styles",o.textContent="\n .code-inspector-notification {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 99999999999999999;\n padding: 12px 16px;\n border-radius: 8px;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-weight: 500;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n opacity: 0;\n transform: translateY(-10px);\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n pointer-events: none;\n }\n .code-inspector-notification-success {\n background: hsl(143, 85%, 96%);\n color: hsl(140, 100%, 27%);\n border: 1px solid hsl(145, 92%, 91%);\n }\n .code-inspector-notification-error {\n background: hsl(0, 93%, 94%);\n color: hsl(0, 84%, 40%);\n border: 1px solid hsl(0, 93%, 94%);\n }\n .code-inspector-notification-show {\n opacity: 1;\n transform: translateY(0);\n }\n ",document.head.appendChild(o)}customElements.get("code-inspector-component")||customElements.define("code-inspector-component",w),z.CodeInspectorComponent=w,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(R,A){typeof exports=="object"&&typeof module!="undefined"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):A((R=typeof globalThis!="undefined"?globalThis:R||self).vueInspectorClient={})})(this,function(R){var vt;"use strict";var Ho=Object.freeze,qo=Object.defineProperty,as=Object.defineProperties;var ls=Object.getOwnPropertyDescriptors;var $t=Object.getOwnPropertySymbols;var Fo=Object.prototype.hasOwnProperty,Wo=Object.prototype.propertyIsEnumerable;var j=Math.pow,dn=(R,A,z)=>A in R?qo(R,A,{enumerable:!0,configurable:!0,writable:!0,value:z}):R[A]=z,T=(R,A)=>{for(var z in A||(A={}))Fo.call(A,z)&&dn(R,z,A[z]);if($t)for(var z of $t(A))Wo.call(A,z)&&dn(R,z,A[z]);return R},L=(R,A)=>as(R,ls(A));var un=(R,A)=>{var z={};for(var U in R)Fo.call(R,U)&&A.indexOf(U)<0&&(z[U]=R[U]);if(R!=null&&$t)for(var U of $t(R))A.indexOf(U)<0&&Wo.call(R,U)&&(z[U]=R[U]);return z};var I=(R,A,z)=>(dn(R,typeof A!="symbol"?A+"":A,z),z);var $=(R,A)=>Ho(qo(R,"raw",{value:Ho(A||R.slice())})),D=(R,A,z)=>new Promise((U,De)=>{var Ze=Y=>{try{$e(z.next(Y))}catch(he){De(he)}},Ge=Y=>{try{$e(z.throw(Y))}catch(he){De(he)}},$e=Y=>Y.done?U(Y.value):Promise.resolve(Y.value).then(Ze,Ge);$e((z=z.apply(R,A)).next())});var Yo,Ko,Xo,Zo,Go,Qo,Jo,ei,ti,ni,oi,ii,ri,si,ai,li,ci,hi,pi,di,ui,gi,fi,mi,bi,yi,xi,vi,wi,ki,$i,Si,Ci,Ti,Ai,Mi,_i,Ei;const A=window,z=A.ShadowRoot&&(A.ShadyCSS===void 0||A.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,U=Symbol(),De=new WeakMap;let Ze=class{constructor(n,e,t){if(this._$cssResult$=!0,t!==U)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=e}get styleSheet(){let n=this.o;const e=this.t;if(z&&n===void 0){const t=e!==void 0&&e.length===1;t&&(n=De.get(e)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),t&&De.set(e,n))}return n}toString(){return this.cssText}};const Ge=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((i,o,r)=>i+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+n[r+1],n[0]);return new Ze(t,n,U)},$e=z?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(i=>new Ze(typeof i=="string"?i:i+"",void 0,U))(t)})(n):n;var Y;const he=window,mn=he.trustedTypes,Ii=mn?mn.emptyScript:"",bn=he.reactiveElementPolyfillSupport,St={toAttribute(n,e){switch(e){case Boolean:n=n?Ii:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch(i){t=null}}return t}},yn=(n,e)=>e!==n&&(e==e||n==n),Ct={attribute:!0,type:String,converter:St,reflect:!1,hasChanged:yn};let Se=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(n){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(n)}static get observedAttributes(){this.finalize();const n=[];return this.elementProperties.forEach((e,t)=>{const i=this._$Ep(t,e);i!==void 0&&(this._$Ev.set(i,t),n.push(i))}),n}static createProperty(n,e=Ct){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(n,e),!e.noAccessor&&!this.prototype.hasOwnProperty(n)){const t=typeof n=="symbol"?Symbol():"__"+n,i=this.getPropertyDescriptor(n,t,e);i!==void 0&&Object.defineProperty(this.prototype,n,i)}}static getPropertyDescriptor(n,e,t){return{get(){return this[e]},set(i){const o=this[n];this[e]=i,this.requestUpdate(n,o,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)||Ct}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const n=Object.getPrototypeOf(this);if(n.finalize(),n.h!==void 0&&(this.h=[...n.h]),this.elementProperties=new Map(n.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(n){const e=[];if(Array.isArray(n)){const t=new Set(n.flat(1/0).reverse());for(const i of t)e.unshift($e(i))}else n!==void 0&&e.push($e(n));return e}static _$Ep(n,e){const t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof n=="string"?n.toLowerCase():void 0}u(){var n;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(n=this.constructor.h)===null||n===void 0||n.forEach(e=>e(this))}addController(n){var e,t;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(n),this.renderRoot!==void 0&&this.isConnected&&((t=n.hostConnected)===null||t===void 0||t.call(n))}removeController(n){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(n)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((n,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var n;const e=(n=this.shadowRoot)!==null&&n!==void 0?n:this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{z?t.adoptedStyleSheets=i.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet):i.forEach(o=>{const r=document.createElement("style"),s=A.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=o.cssText,t.appendChild(r)})})(e,this.constructor.elementStyles),e}connectedCallback(){var n;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(n=this._$ES)===null||n===void 0||n.forEach(e=>{var t;return(t=e.hostConnected)===null||t===void 0?void 0:t.call(e)})}enableUpdating(n){}disconnectedCallback(){var n;(n=this._$ES)===null||n===void 0||n.forEach(e=>{var t;return(t=e.hostDisconnected)===null||t===void 0?void 0:t.call(e)})}attributeChangedCallback(n,e,t){this._$AK(n,t)}_$EO(n,e,t=Ct){var i;const o=this.constructor._$Ep(n,t);if(o!==void 0&&t.reflect===!0){const r=(((i=t.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?t.converter:St).toAttribute(e,t.type);this._$El=n,r==null?this.removeAttribute(o):this.setAttribute(o,r),this._$El=null}}_$AK(n,e){var t;const i=this.constructor,o=i._$Ev.get(n);if(o!==void 0&&this._$El!==o){const r=i.getPropertyOptions(o),s=typeof r.converter=="function"?{fromAttribute:r.converter}:((t=r.converter)===null||t===void 0?void 0:t.fromAttribute)!==void 0?r.converter:St;this._$El=o,this[o]=s.fromAttribute(e,r.type),this._$El=null}}requestUpdate(n,e,t){let i=!0;n!==void 0&&(((t=t||this.constructor.getPropertyOptions(n)).hasChanged||yn)(this[n],e)?(this._$AL.has(n)||this._$AL.set(n,e),t.reflect===!0&&this._$El!==n&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(n,t))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}_$Ej(){return D(this,null,function*(){this.isUpdatePending=!0;try{yield this._$E_}catch(e){Promise.reject(e)}const n=this.scheduleUpdate();return n!=null&&(yield n),!this.isUpdatePending})}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(n=this._$ES)===null||n===void 0||n.forEach(i=>{var o;return(o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(t)):this._$Ek()}catch(i){throw e=!1,this._$Ek(),i}e&&this._$AE(t)}willUpdate(n){}_$AE(n){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var i;return(i=t.hostUpdated)===null||i===void 0?void 0:i.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(n){return!0}update(n){this._$EC!==void 0&&(this._$EC.forEach((e,t)=>this._$EO(t,this[t],e)),this._$EC=void 0),this._$Ek()}updated(n){}firstUpdated(n){}};var Tt;Se.finalized=!0,Se.elementProperties=new Map,Se.elementStyles=[],Se.shadowRootOptions={mode:"open"},bn==null||bn({ReactiveElement:Se}),((Y=he.reactiveElementVersions)!==null&&Y!==void 0?Y:he.reactiveElementVersions=[]).push("1.6.1");const Qe=window,Ce=Qe.trustedTypes,xn=Ce?Ce.createPolicy("lit-html",{createHTML:n=>n}):void 0,pe="lit$".concat((Math.random()+"").slice(9),"$"),vn="?"+pe,zi="<".concat(vn,">"),Te=document,Le=(n="")=>Te.createComment(n),Ne=n=>n===null||typeof n!="object"&&typeof n!="function",wn=Array.isArray,Oe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,kn=/-->/g,$n=/>/g,ye=RegExp(">|[ \n\f\r](?:([^\\s\"'>=/]+)([ \n\f\r]*=[ \n\f\r]*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)","g"),Sn=/'/g,Cn=/"/g,Tn=/^(?:script|style|textarea|title)$/i,C=(n=>(e,...t)=>({_$litType$:n,strings:e,values:t}))(1),de=Symbol.for("lit-noChange"),N=Symbol.for("lit-nothing"),An=new WeakMap,Ae=Te.createTreeWalker(Te,129,null,!1),Di=(n,e)=>{const t=n.length-1,i=[];let o,r=e===2?"<svg>":"",s=Oe;for(let l=0;l<t;l++){const c=n[l];let h,p,d=-1,g=0;for(;g<c.length&&(s.lastIndex=g,p=s.exec(c),p!==null);)g=s.lastIndex,s===Oe?p[1]==="!--"?s=kn:p[1]!==void 0?s=$n:p[2]!==void 0?(Tn.test(p[2])&&(o=RegExp("</"+p[2],"g")),s=ye):p[3]!==void 0&&(s=ye):s===ye?p[0]===">"?(s=o!=null?o:Oe,d=-1):p[1]===void 0?d=-2:(d=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?ye:p[3]==='"'?Cn:Sn):s===Cn||s===Sn?s=ye:s===kn||s===$n?s=Oe:(s=ye,o=void 0);const u=s===ye&&n[l+1].startsWith("/>")?" ":"";r+=s===Oe?c+zi:d>=0?(i.push(h),c.slice(0,d)+"$lit$"+c.slice(d)+pe+u):c+pe+(d===-2?(i.push(void 0),l):u)}const a=r+(n[t]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return[xn!==void 0?xn.createHTML(a):a,i]};let At=class Ri{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let r=0,s=0;const a=e.length-1,l=this.parts,[c,h]=Di(e,t);if(this.el=Ri.createElement(c,i),Ae.currentNode=this.el.content,t===2){const p=this.el.content,d=p.firstChild;d.remove(),p.append(...d.childNodes)}for(;(o=Ae.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes()){const p=[];for(const d of o.getAttributeNames())if(d.endsWith("$lit$")||d.startsWith(pe)){const g=h[s++];if(p.push(d),g!==void 0){const u=o.getAttribute(g.toLowerCase()+"$lit$").split(pe),m=/([.?@])?(.*)/.exec(g);l.push({type:1,index:r,name:m[2],strings:u,ctor:m[1]==="."?Ni:m[1]==="?"?Bi:m[1]==="@"?ji:Je})}else l.push({type:6,index:r})}for(const d of p)o.removeAttribute(d)}if(Tn.test(o.tagName)){const p=o.textContent.split(pe),d=p.length-1;if(d>0){o.textContent=Ce?Ce.emptyScript:"";for(let g=0;g<d;g++)o.append(p[g],Le()),Ae.nextNode(),l.push({type:2,index:++r});o.append(p[d],Le())}}}else if(o.nodeType===8)if(o.data===vn)l.push({type:2,index:r});else{let p=-1;for(;(p=o.data.indexOf(pe,p+1))!==-1;)l.push({type:7,index:r}),p+=pe.length-1}r++}}static createElement(e,t){const i=Te.createElement("template");return i.innerHTML=e,i}};function Me(n,e,t=n,i){var o,r,s,a;if(e===de)return e;let l=i!==void 0?(o=t._$Co)===null||o===void 0?void 0:o[i]:t._$Cl;const c=Ne(e)?void 0:e._$litDirective$;return(l==null?void 0:l.constructor)!==c&&((r=l==null?void 0:l._$AO)===null||r===void 0||r.call(l,!1),c===void 0?l=void 0:(l=new c(n),l._$AT(n,t,i)),i!==void 0?((s=(a=t)._$Co)!==null&&s!==void 0?s:a._$Co=[])[i]=l:t._$Cl=l),l!==void 0&&(e=Me(n,l._$AS(n,e.values),l,i)),e}class Li{constructor(e,t){this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(e){var t;const{el:{content:i},parts:o}=this._$AD,r=((t=e==null?void 0:e.creationScope)!==null&&t!==void 0?t:Te).importNode(i,!0);Ae.currentNode=r;let s=Ae.nextNode(),a=0,l=0,c=o[0];for(;c!==void 0;){if(a===c.index){let h;c.type===2?h=new Mt(s,s.nextSibling,this,e):c.type===1?h=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(h=new Ui(s,this,e)),this.u.push(h),c=o[++l]}a!==(c==null?void 0:c.index)&&(s=Ae.nextNode(),a++)}return r}p(e){let t=0;for(const i of this.u)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}let Mt=class Pi{constructor(e,t,i,o){var r;this.type=2,this._$AH=N,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=o,this._$Cm=(r=o==null?void 0:o.isConnected)===null||r===void 0||r}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cm}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Me(this,e,t),Ne(e)?e===N||e==null||e===""?(this._$AH!==N&&this._$AR(),this._$AH=N):e!==this._$AH&&e!==de&&this.g(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):(i=>wn(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function")(e)?this.k(e):this.g(e)}O(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==N&&Ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(Te.createTextNode(e)),this._$AH=e}$(e){var t;const{values:i,_$litType$:o}=e,r=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=At.createElement(o.h,this.options)),o);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===r)this._$AH.p(i);else{const s=new Li(r,this),a=s.v(this.options);s.p(i),this.T(a),this._$AH=s}}_$AC(e){let t=An.get(e.strings);return t===void 0&&An.set(e.strings,t=new At(e)),t}k(e){wn(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,o=0;for(const r of e)o===t.length?t.push(i=new Pi(this.O(Le()),this.O(Le()),this,this.options)):i=t[o],i._$AI(r),o++;o<t.length&&(this._$AR(i&&i._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,t);e&&e!==this._$AB;){const o=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cm=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},Je=class{constructor(n,e,t,i,o){this.type=1,this._$AH=N,this._$AN=void 0,this.element=n,this.name=e,this._$AM=i,this.options=o,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=N}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(n,e=this,t,i){const o=this.strings;let r=!1;if(o===void 0)n=Me(this,n,e,0),r=!Ne(n)||n!==this._$AH&&n!==de,r&&(this._$AH=n);else{const s=n;let a,l;for(n=o[0],a=0;a<o.length-1;a++)l=Me(this,s[t+a],e,a),l===de&&(l=this._$AH[a]),r||(r=!Ne(l)||l!==this._$AH[a]),l===N?n=N:n!==N&&(n+=(l!=null?l:"")+o[a+1]),this._$AH[a]=l}r&&!i&&this.j(n)}j(n){n===N?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n!=null?n:"")}},Ni=class extends Je{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===N?void 0:n}};const Oi=Ce?Ce.emptyScript:"";let Bi=class extends Je{constructor(){super(...arguments),this.type=4}j(n){n&&n!==N?this.element.setAttribute(this.name,Oi):this.element.removeAttribute(this.name)}};class ji extends Je{constructor(e,t,i,o,r){super(e,t,i,o,r),this.type=5}_$AI(e,t=this){var i;if((e=(i=Me(this,e,t,0))!==null&&i!==void 0?i:N)===de)return;const o=this._$AH,r=e===N&&o!==N||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,s=e!==N&&(o===N||r);r&&this.element.removeEventListener(this.name,this,o),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,i;typeof this._$AH=="function"?this._$AH.call((i=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}}let Ui=class{constructor(n,e,t){this.element=n,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(n){Me(this,n)}};const Mn=Qe.litHtmlPolyfillSupport;Mn==null||Mn(At,Mt),((Tt=Qe.litHtmlVersions)!==null&&Tt!==void 0?Tt:Qe.litHtmlVersions=[]).push("2.6.1");var _t,Et;class Be extends Se{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((i,o,r)=>{var s,a;const l=(s=r==null?void 0:r.renderBefore)!==null&&s!==void 0?s:o;let c=l._$litPart$;if(c===void 0){const h=(a=r==null?void 0:r.renderBefore)!==null&&a!==void 0?a:null;l._$litPart$=c=new Mt(o.insertBefore(Le(),h),h,void 0,r!=null?r:{})}return c._$AI(i),c})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return de}}Be.finalized=!0,Be._$litElement$=!0,(_t=globalThis.litElementHydrateSupport)===null||_t===void 0||_t.call(globalThis,{LitElement:Be});const _n=globalThis.litElementPolyfillSupport;_n==null||_n({LitElement:Be}),((Et=globalThis.litElementVersions)!==null&&Et!==void 0?Et:globalThis.litElementVersions=[]).push("3.2.2");const Vi=(n,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?L(T({},e),{finisher(t){t.createProperty(e.key,n)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,n)}};function q(n){return(e,t)=>t!==void 0?((i,o,r)=>{o.constructor.createProperty(r,i)})(n,e,t):Vi(n,e)}function M(n){return q(L(T({},n),{state:!0}))}function _e(n,e){return(({finisher:t,descriptor:i})=>(o,r)=>{var s;if(r===void 0){const a=(s=o.originalKey)!==null&&s!==void 0?s:o.key,l=i!=null?{kind:"method",placement:"prototype",key:a,descriptor:i(o.key)}:L(T({},o),{key:a});return t!=null&&(l.finisher=function(c){t(c,a)}),l}{const a=o.constructor;i!==void 0&&Object.defineProperty(o,r,i(r)),t==null||t(a,r)}})({descriptor:t=>{const i={get(){var o,r;return(r=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(n))!==null&&r!==void 0?r:null},enumerable:!0,configurable:!0};if(e){const o=typeof t=="symbol"?Symbol():"__"+t;i.get=function(){var r,s;return this[o]===void 0&&(this[o]=(s=(r=this.renderRoot)===null||r===void 0?void 0:r.querySelector(n))!==null&&s!==void 0?s:null),this[o]}}return i}})}var Rt;(Rt=window.HTMLSlotElement)===null||Rt===void 0||Rt.prototype.assignedElements;const Hi=1,qi=2,En=n=>(...e)=>({_$litDirective$:n,values:e});let Rn=class{constructor(n){}get _$AU(){return this._$AM._$AU}_$AT(n,e,t){this._$Ct=n,this._$AM=e,this._$Ci=t}_$AS(n,e){return this.update(n,e)}update(n,e){return this.render(...e)}};const ie=En(class extends Rn{constructor(n){var e;if(super(n),n.type!==Hi||n.name!=="style"||((e=n.strings)===null||e===void 0?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const i=n[t];return i==null?e:e+"".concat(t=t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(i,";")},"")}update(n,[e]){const{style:t}=n.element;if(this.vt===void 0){this.vt=new Set;for(const i in e)this.vt.add(i);return this.render(e)}this.vt.forEach(i=>{e[i]==null&&(this.vt.delete(i),i.includes("-")?t.removeProperty(i):t[i]="")});for(const i in e){const o=e[i];o!=null&&(this.vt.add(i),i.includes("-")?t.setProperty(i,o):t[i]=o)}return de}}),et="data-insp-path",Fi=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}));function Wi(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){if(this instanceof i){var o=[null];return o.push.apply(o,arguments),new(Function.bind.apply(e,o))}return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var o=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return n[i]}})}),t}var Pn,In,Pt,zn,It,Dn,Ln,Nn,On={exports:{}};function Bn(){if(zn)return Pt;zn=1;const n=In?Pn:(In=1,Pn={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),e={};for(const o of Object.keys(n))e[n[o]]=o;const t={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Pt=t;for(const o of Object.keys(t)){if(!("channels"in t[o]))throw new Error("missing channels property: "+o);if(!("labels"in t[o]))throw new Error("missing channel labels property: "+o);if(t[o].labels.length!==t[o].channels)throw new Error("channel and label counts mismatch: "+o);const{channels:r,labels:s}=t[o];delete t[o].channels,delete t[o].labels,Object.defineProperty(t[o],"channels",{value:r}),Object.defineProperty(t[o],"labels",{value:s})}function i(o,r){return j(o[0]-r[0],2)+j(o[1]-r[1],2)+j(o[2]-r[2],2)}return t.rgb.hsl=function(o){const r=o[0]/255,s=o[1]/255,a=o[2]/255,l=Math.min(r,s,a),c=Math.max(r,s,a),h=c-l;let p,d;c===l?p=0:r===c?p=(s-a)/h:s===c?p=2+(a-r)/h:a===c&&(p=4+(r-s)/h),p=Math.min(60*p,360),p<0&&(p+=360);const g=(l+c)/2;return d=c===l?0:g<=.5?h/(c+l):h/(2-c-l),[p,100*d,100*g]},t.rgb.hsv=function(o){let r,s,a,l,c;const h=o[0]/255,p=o[1]/255,d=o[2]/255,g=Math.max(h,p,d),u=g-Math.min(h,p,d),m=function(f){return(g-f)/6/u+.5};return u===0?(l=0,c=0):(c=u/g,r=m(h),s=m(p),a=m(d),h===g?l=a-s:p===g?l=1/3+r-a:d===g&&(l=2/3+s-r),l<0?l+=1:l>1&&(l-=1)),[360*l,100*c,100*g]},t.rgb.hwb=function(o){const r=o[0],s=o[1];let a=o[2];const l=t.rgb.hsl(o)[0],c=1/255*Math.min(r,Math.min(s,a));return a=1-1/255*Math.max(r,Math.max(s,a)),[l,100*c,100*a]},t.rgb.cmyk=function(o){const r=o[0]/255,s=o[1]/255,a=o[2]/255,l=Math.min(1-r,1-s,1-a);return[100*((1-r-l)/(1-l)||0),100*((1-s-l)/(1-l)||0),100*((1-a-l)/(1-l)||0),100*l]},t.rgb.keyword=function(o){const r=e[o];if(r)return r;let s,a=1/0;for(const l of Object.keys(n)){const c=i(o,n[l]);c<a&&(a=c,s=l)}return s},t.keyword.rgb=function(o){return n[o]},t.rgb.xyz=function(o){let r=o[0]/255,s=o[1]/255,a=o[2]/255;return r=r>.04045?j((r+.055)/1.055,2.4):r/12.92,s=s>.04045?j((s+.055)/1.055,2.4):s/12.92,a=a>.04045?j((a+.055)/1.055,2.4):a/12.92,[100*(.4124*r+.3576*s+.1805*a),100*(.2126*r+.7152*s+.0722*a),100*(.0193*r+.1192*s+.9505*a)]},t.rgb.lab=function(o){const r=t.rgb.xyz(o);let s=r[0],a=r[1],l=r[2];return s/=95.047,a/=100,l/=108.883,s=s>.008856?j(s,1/3):7.787*s+16/116,a=a>.008856?j(a,1/3):7.787*a+16/116,l=l>.008856?j(l,1/3):7.787*l+16/116,[116*a-16,500*(s-a),200*(a-l)]},t.hsl.rgb=function(o){const r=o[0]/360,s=o[1]/100,a=o[2]/100;let l,c,h;if(s===0)return h=255*a,[h,h,h];l=a<.5?a*(1+s):a+s-a*s;const p=2*a-l,d=[0,0,0];for(let g=0;g<3;g++)c=r+1/3*-(g-1),c<0&&c++,c>1&&c--,h=6*c<1?p+6*(l-p)*c:2*c<1?l:3*c<2?p+(l-p)*(2/3-c)*6:p,d[g]=255*h;return d},t.hsl.hsv=function(o){const r=o[0];let s=o[1]/100,a=o[2]/100,l=s;const c=Math.max(a,.01);return a*=2,s*=a<=1?a:2-a,l*=c<=1?c:2-c,[r,100*(a===0?2*l/(c+l):2*s/(a+s)),100*((a+s)/2)]},t.hsv.rgb=function(o){const r=o[0]/60,s=o[1]/100;let a=o[2]/100;const l=Math.floor(r)%6,c=r-Math.floor(r),h=255*a*(1-s),p=255*a*(1-s*c),d=255*a*(1-s*(1-c));switch(a*=255,l){case 0:return[a,d,h];case 1:return[p,a,h];case 2:return[h,a,d];case 3:return[h,p,a];case 4:return[d,h,a];case 5:return[a,h,p]}},t.hsv.hsl=function(o){const r=o[0],s=o[1]/100,a=o[2]/100,l=Math.max(a,.01);let c,h;h=(2-s)*a;const p=(2-s)*l;return c=s*l,c/=p<=1?p:2-p,c=c||0,h/=2,[r,100*c,100*h]},t.hwb.rgb=function(o){const r=o[0]/360;let s=o[1]/100,a=o[2]/100;const l=s+a;let c;l>1&&(s/=l,a/=l);const h=Math.floor(6*r),p=1-a;c=6*r-h,1&h&&(c=1-c);const d=s+c*(p-s);let g,u,m;switch(h){default:case 6:case 0:g=p,u=d,m=s;break;case 1:g=d,u=p,m=s;break;case 2:g=s,u=p,m=d;break;case 3:g=s,u=d,m=p;break;case 4:g=d,u=s,m=p;break;case 5:g=p,u=s,m=d}return[255*g,255*u,255*m]},t.cmyk.rgb=function(o){const r=o[0]/100,s=o[1]/100,a=o[2]/100,l=o[3]/100;return[255*(1-Math.min(1,r*(1-l)+l)),255*(1-Math.min(1,s*(1-l)+l)),255*(1-Math.min(1,a*(1-l)+l))]},t.xyz.rgb=function(o){const r=o[0]/100,s=o[1]/100,a=o[2]/100;let l,c,h;return l=3.2406*r+-1.5372*s+-.4986*a,c=-.9689*r+1.8758*s+.0415*a,h=.0557*r+-.204*s+1.057*a,l=l>.0031308?1.055*j(l,1/2.4)-.055:12.92*l,c=c>.0031308?1.055*j(c,1/2.4)-.055:12.92*c,h=h>.0031308?1.055*j(h,1/2.4)-.055:12.92*h,l=Math.min(Math.max(0,l),1),c=Math.min(Math.max(0,c),1),h=Math.min(Math.max(0,h),1),[255*l,255*c,255*h]},t.xyz.lab=function(o){let r=o[0],s=o[1],a=o[2];return r/=95.047,s/=100,a/=108.883,r=r>.008856?j(r,1/3):7.787*r+16/116,s=s>.008856?j(s,1/3):7.787*s+16/116,a=a>.008856?j(a,1/3):7.787*a+16/116,[116*s-16,500*(r-s),200*(s-a)]},t.lab.xyz=function(o){let r,s,a;s=(o[0]+16)/116,r=o[1]/500+s,a=s-o[2]/200;const l=j(s,3),c=j(r,3),h=j(a,3);return s=l>.008856?l:(s-16/116)/7.787,r=c>.008856?c:(r-16/116)/7.787,a=h>.008856?h:(a-16/116)/7.787,r*=95.047,s*=100,a*=108.883,[r,s,a]},t.lab.lch=function(o){const r=o[0],s=o[1],a=o[2];let l;return l=360*Math.atan2(a,s)/2/Math.PI,l<0&&(l+=360),[r,Math.sqrt(s*s+a*a),l]},t.lch.lab=function(o){const r=o[0],s=o[1],a=o[2]/360*2*Math.PI;return[r,s*Math.cos(a),s*Math.sin(a)]},t.rgb.ansi16=function(o,r=null){const[s,a,l]=o;let c=r===null?t.rgb.hsv(o)[2]:r;if(c=Math.round(c/50),c===0)return 30;let h=30+(Math.round(l/255)<<2|Math.round(a/255)<<1|Math.round(s/255));return c===2&&(h+=60),h},t.hsv.ansi16=function(o){return t.rgb.ansi16(t.hsv.rgb(o),o[2])},t.rgb.ansi256=function(o){const r=o[0],s=o[1],a=o[2];return r===s&&s===a?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(s/255*5)+Math.round(a/255*5)},t.ansi16.rgb=function(o){let r=o%10;if(r===0||r===7)return o>50&&(r+=3.5),r=r/10.5*255,[r,r,r];const s=.5*(1+~~(o>50));return[(1&r)*s*255,(r>>1&1)*s*255,(r>>2&1)*s*255]},t.ansi256.rgb=function(o){if(o>=232){const s=10*(o-232)+8;return[s,s,s]}let r;return o-=16,[Math.floor(o/36)/5*255,Math.floor((r=o%36)/6)/5*255,r%6/5*255]},t.rgb.hex=function(o){const r=(((255&Math.round(o[0]))<<16)+((255&Math.round(o[1]))<<8)+(255&Math.round(o[2]))).toString(16).toUpperCase();return"000000".substring(r.length)+r},t.hex.rgb=function(o){const r=o.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!r)return[0,0,0];let s=r[0];r[0].length===3&&(s=s.split("").map(l=>l+l).join(""));const a=parseInt(s,16);return[a>>16&255,a>>8&255,255&a]},t.rgb.hcg=function(o){const r=o[0]/255,s=o[1]/255,a=o[2]/255,l=Math.max(Math.max(r,s),a),c=Math.min(Math.min(r,s),a),h=l-c;let p,d;return p=h<1?c/(1-h):0,d=h<=0?0:l===r?(s-a)/h%6:l===s?2+(a-r)/h:4+(r-s)/h,d/=6,d%=1,[360*d,100*h,100*p]},t.hsl.hcg=function(o){const r=o[1]/100,s=o[2]/100,a=s<.5?2*r*s:2*r*(1-s);let l=0;return a<1&&(l=(s-.5*a)/(1-a)),[o[0],100*a,100*l]},t.hsv.hcg=function(o){const r=o[1]/100,s=o[2]/100,a=r*s;let l=0;return a<1&&(l=(s-a)/(1-a)),[o[0],100*a,100*l]},t.hcg.rgb=function(o){const r=o[0]/360,s=o[1]/100,a=o[2]/100;if(s===0)return[255*a,255*a,255*a];const l=[0,0,0],c=r%1*6,h=c%1,p=1-h;let d=0;switch(Math.floor(c)){case 0:l[0]=1,l[1]=h,l[2]=0;break;case 1:l[0]=p,l[1]=1,l[2]=0;break;case 2:l[0]=0,l[1]=1,l[2]=h;break;case 3:l[0]=0,l[1]=p,l[2]=1;break;case 4:l[0]=h,l[1]=0,l[2]=1;break;default:l[0]=1,l[1]=0,l[2]=p}return d=(1-s)*a,[255*(s*l[0]+d),255*(s*l[1]+d),255*(s*l[2]+d)]},t.hcg.hsv=function(o){const r=o[1]/100,s=r+o[2]/100*(1-r);let a=0;return s>0&&(a=r/s),[o[0],100*a,100*s]},t.hcg.hsl=function(o){const r=o[1]/100,s=o[2]/100*(1-r)+.5*r;let a=0;return s>0&&s<.5?a=r/(2*s):s>=.5&&s<1&&(a=r/(2*(1-s))),[o[0],100*a,100*s]},t.hcg.hwb=function(o){const r=o[1]/100,s=r+o[2]/100*(1-r);return[o[0],100*(s-r),100*(1-s)]},t.hwb.hcg=function(o){const r=o[1]/100,s=1-o[2]/100,a=s-r;let l=0;return a<1&&(l=(s-a)/(1-a)),[o[0],100*a,100*l]},t.apple.rgb=function(o){return[o[0]/65535*255,o[1]/65535*255,o[2]/65535*255]},t.rgb.apple=function(o){return[o[0]/255*65535,o[1]/255*65535,o[2]/255*65535]},t.gray.rgb=function(o){return[o[0]/100*255,o[0]/100*255,o[0]/100*255]},t.gray.hsl=function(o){return[0,0,o[0]]},t.gray.hsv=t.gray.hsl,t.gray.hwb=function(o){return[0,100,o[0]]},t.gray.cmyk=function(o){return[0,0,0,o[0]]},t.gray.lab=function(o){return[o[0],0,0]},t.gray.hex=function(o){const r=255&Math.round(o[0]/100*255),s=((r<<16)+(r<<8)+r).toString(16).toUpperCase();return"000000".substring(s.length)+s},t.rgb.gray=function(o){return[(o[0]+o[1]+o[2])/3/255*100]},Pt}function Yi(){if(Dn)return It;Dn=1;const n=Bn();function e(o){const r=function(){const a={},l=Object.keys(n);for(let c=l.length,h=0;h<c;h++)a[l[h]]={distance:-1,parent:null};return a}(),s=[o];for(r[o].distance=0;s.length;){const a=s.pop(),l=Object.keys(n[a]);for(let c=l.length,h=0;h<c;h++){const p=l[h],d=r[p];d.distance===-1&&(d.distance=r[a].distance+1,d.parent=a,s.unshift(p))}}return r}function t(o,r){return function(s){return r(o(s))}}function i(o,r){const s=[r[o].parent,o];let a=n[r[o].parent][o],l=r[o].parent;for(;r[l].parent;)s.unshift(r[l].parent),a=t(n[r[l].parent][l],a),l=r[l].parent;return a.conversion=s,a}return It=function(o){const r=e(o),s={},a=Object.keys(r);for(let l=a.length,c=0;c<l;c++){const h=a[c];r[h].parent!==null&&(s[h]=i(h,r))}return s},It}function Ki(){if(Nn)return Ln;Nn=1;const n=Bn(),e=Yi(),t={};return Object.keys(n).forEach(i=>{t[i]={},Object.defineProperty(t[i],"channels",{value:n[i].channels}),Object.defineProperty(t[i],"labels",{value:n[i].labels});const o=e(i);Object.keys(o).forEach(r=>{const s=o[r];t[i][r]=function(a){const l=function(...c){const h=c[0];if(h==null)return h;h.length>1&&(c=h);const p=a(c);if(typeof p=="object")for(let d=p.length,g=0;g<d;g++)p[g]=Math.round(p[g]);return p};return"conversion"in a&&(l.conversion=a.conversion),l}(s),t[i][r].raw=function(a){const l=function(...c){const h=c[0];return h==null?h:(h.length>1&&(c=h),a(c))};return"conversion"in a&&(l.conversion=a.conversion),l}(s)})}),Ln=t}(function(n){const e=(c,h)=>(...p)=>"\x1B[".concat(c(...p)+h,"m"),t=(c,h)=>(...p)=>{const d=c(...p);return"\x1B[".concat(38+h,";5;").concat(d,"m")},i=(c,h)=>(...p)=>{const d=c(...p);return"\x1B[".concat(38+h,";2;").concat(d[0],";").concat(d[1],";").concat(d[2],"m")},o=c=>c,r=(c,h,p)=>[c,h,p],s=(c,h,p)=>{Object.defineProperty(c,h,{get:()=>{const d=p();return Object.defineProperty(c,h,{value:d,enumerable:!0,configurable:!0}),d},enumerable:!0,configurable:!0})};let a;const l=(c,h,p,d)=>{a===void 0&&(a=Ki());const g=d?10:0,u={};for(const[m,f]of Object.entries(a)){const b=m==="ansi16"?"ansi":m;m===h?u[b]=c(p,g):typeof f=="object"&&(u[b]=c(f[h],g))}return u};Object.defineProperty(n,"exports",{enumerable:!0,get:function(){const c=new Map,h={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};h.color.gray=h.color.blackBright,h.bgColor.bgGray=h.bgColor.bgBlackBright,h.color.grey=h.color.blackBright,h.bgColor.bgGrey=h.bgColor.bgBlackBright;for(const[p,d]of Object.entries(h)){for(const[g,u]of Object.entries(d))h[g]={open:"\x1B[".concat(u[0],"m"),close:"\x1B[".concat(u[1],"m")},d[g]=h[g],c.set(u[0],u[1]);Object.defineProperty(h,p,{value:d,enumerable:!1})}return Object.defineProperty(h,"codes",{value:c,enumerable:!1}),h.color.close="\x1B[39m",h.bgColor.close="\x1B[49m",s(h.color,"ansi",()=>l(e,"ansi16",o,!1)),s(h.color,"ansi256",()=>l(t,"ansi256",o,!1)),s(h.color,"ansi16m",()=>l(i,"rgb",r,!1)),s(h.bgColor,"ansi",()=>l(e,"ansi16",o,!0)),s(h.bgColor,"ansi256",()=>l(t,"ansi256",o,!0)),s(h.bgColor,"ansi16m",()=>l(i,"rgb",r,!0)),h}})})(On);var zt,jn,Xi={stringReplaceAll:(n,e,t)=>{let i=n.indexOf(e);if(i===-1)return n;const o=e.length;let r=0,s="";do s+=n.substr(r,i-r)+e+t,r=i+o,i=n.indexOf(e,r);while(i!==-1);return s+=n.substr(r),s},stringEncaseCRLFWithFirstIndex:(n,e,t,i)=>{let o=0,r="";do{const s=n[i-1]==="\r";r+=n.substr(o,(s?i-1:i)-o)+e+(s?"\r\n":"\n")+t,o=i+1,i=n.indexOf("\n",o)}while(i!==-1);return r+=n.substr(o),r}};const je=On.exports,{stdout:Dt,stderr:Lt}={stdout:!1,stderr:!1},{stringReplaceAll:Zi,stringEncaseCRLFWithFirstIndex:Gi}=Xi,{isArray:tt}=Array,Un=["ansi","ansi","ansi256","ansi16m"],Ee=Object.create(null);class Qi{constructor(e){return Vn(e)}}const Vn=n=>{const e={};return((t,i={})=>{if(i.level&&!(Number.isInteger(i.level)&&i.level>=0&&i.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const o=Dt?Dt.level:0;t.level=i.level===void 0?o:i.level})(e,n),e.template=(...t)=>Fn(e.template,...t),Object.setPrototypeOf(e,nt.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=Qi,e.template};function nt(n){return Vn(n)}for(const[n,e]of Object.entries(je))Ee[n]={get(){const t=ot(this,Nt(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,n,{value:t}),t}};Ee.visible={get(){const n=ot(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:n}),n}};const Hn=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const n of Hn)Ee[n]={get(){const{level:e}=this;return function(...t){const i=Nt(je.color[Un[e]][n](...t),je.color.close,this._styler);return ot(this,i,this._isEmpty)}}};for(const n of Hn)Ee["bg"+n[0].toUpperCase()+n.slice(1)]={get(){const{level:e}=this;return function(...t){const i=Nt(je.bgColor[Un[e]][n](...t),je.bgColor.close,this._styler);return ot(this,i,this._isEmpty)}}};const Ji=Object.defineProperties(()=>{},L(T({},Ee),{level:{enumerable:!0,get(){return this._generator.level},set(n){this._generator.level=n}}})),Nt=(n,e,t)=>{let i,o;return t===void 0?(i=n,o=e):(i=t.openAll+n,o=e+t.closeAll),{open:n,close:e,openAll:i,closeAll:o,parent:t}},ot=(n,e,t)=>{const i=(...o)=>tt(o[0])&&tt(o[0].raw)?qn(i,Fn(i,...o)):qn(i,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(i,Ji),i._generator=n,i._styler=e,i._isEmpty=t,i},qn=(n,e)=>{if(n.level<=0||!e)return n._isEmpty?"":e;let t=n._styler;if(t===void 0)return e;const{openAll:i,closeAll:o}=t;if(e.indexOf("\x1B")!==-1)for(;t!==void 0;)e=Zi(e,t.close,t.open),t=t.parent;const r=e.indexOf("\n");return r!==-1&&(e=Gi(e,o,i,r)),i+e+o};let Ot;const Fn=(n,...e)=>{const[t]=e;if(!tt(t)||!tt(t.raw))return e.join(" ");const i=e.slice(1),o=[t.raw[0]];for(let r=1;r<t.length;r++)o.push(String(i[r-1]).replace(/[{}\\]/g,"\\$&"),String(t.raw[r]));return Ot===void 0&&(Ot=function(){if(jn)return zt;jn=1;const r=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,s=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,a=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,l=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,c=new Map([["n","\n"],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function h(u){const m=u[0]==="u",f=u[1]==="{";return m&&!f&&u.length===5||u[0]==="x"&&u.length===3?String.fromCharCode(parseInt(u.slice(1),16)):m&&f?String.fromCodePoint(parseInt(u.slice(2,-1),16)):c.get(u)||u}function p(u,m){const f=[],b=m.trim().split(/\s*,\s*/g);let y;for(const w of b){const E=Number(w);if(Number.isNaN(E)){if(!(y=w.match(a)))throw new Error("Invalid Chalk template style argument: ".concat(w," (in style '").concat(u,"')"));f.push(y[2].replace(l,(k,S,B)=>S?h(S):B))}else f.push(E)}return f}function d(u){s.lastIndex=0;const m=[];let f;for(;(f=s.exec(u))!==null;){const b=f[1];if(f[2]){const y=p(b,f[2]);m.push([b].concat(y))}else m.push([b])}return m}function g(u,m){const f={};for(const y of m)for(const w of y.styles)f[w[0]]=y.inverse?null:w.slice(1);let b=u;for(const[y,w]of Object.entries(f))if(Array.isArray(w)){if(!(y in b))throw new Error("Unknown Chalk style: ".concat(y));b=w.length>0?b[y](...w):b[y]}return b}return zt=(u,m)=>{const f=[],b=[];let y=[];if(m.replace(r,(w,E,k,S,B,H)=>{if(E)y.push(h(E));else if(S){const le=y.join("");y=[],b.push(f.length===0?le:g(u,f)(le)),f.push({inverse:k,styles:d(S)})}else if(B){if(f.length===0)throw new Error("Found extraneous } in Chalk template literal");b.push(g(u,f)(y.join(""))),y=[],f.pop()}else y.push(H)}),b.push(y.join("")),f.length>0){const w="Chalk template literal is missing ".concat(f.length," closing bracket").concat(f.length===1?"":"s"," (`}`)");throw new Error(w)}return b.join("")},zt}()),Ot(n,o.join(""))};Object.defineProperties(nt.prototype,Ee);const Bt=nt();Bt.supportsColor=Dt,Bt.stderr=nt({level:Lt?Lt.level:0}),Bt.stderr.supportsColor=Lt;var ue={exports:{}};const it=Wi(Fi),jt=it,Ut=it,er=it,tr=it,Vt="16.4.5",nr=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function Ht(n){console.log("[dotenv@".concat(Vt,"][DEBUG] ").concat(n))}function Wn(n){return n&&n.DOTENV_KEY&&n.DOTENV_KEY.length>0?n.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function or(n,e){let t;try{t=new URL(e)}catch(a){if(a.code==="ERR_INVALID_URL"){const l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}const i=t.password;if(!i){const a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}const o=t.searchParams.get("environment");if(!o){const a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}const r="DOTENV_VAULT_".concat(o.toUpperCase()),s=n.parsed[r];if(!s){const a=new Error("NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ".concat(r," in your .env.vault file."));throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:i}}function Yn(n){let e=null;if(n&&n.path&&n.path.length>0)if(Array.isArray(n.path))for(const t of n.path)jt.existsSync(t)&&(e=t.endsWith(".vault")?t:"".concat(t,".vault"));else e=n.path.endsWith(".vault")?n.path:"".concat(n.path,".vault");else e=Ut.resolve(process.cwd(),".env.vault");return jt.existsSync(e)?e:null}function Kn(n){return n[0]==="~"?Ut.join(er.homedir(),n.slice(1)):n}const O={configDotenv:function(n){const e=Ut.resolve(process.cwd(),".env");let t="utf8";const i=!!(n&&n.debug);n&&n.encoding?t=n.encoding:i&&Ht("No encoding is specified. UTF-8 is used by default");let o,r=[e];if(n&&n.path)if(Array.isArray(n.path)){r=[];for(const l of n.path)r.push(Kn(l))}else r=[Kn(n.path)];const s={};for(const l of r)try{const c=O.parse(jt.readFileSync(l,{encoding:t}));O.populate(s,c,n)}catch(c){i&&Ht("Failed to load ".concat(l," ").concat(c.message)),o=c}let a=process.env;return n&&n.processEnv!=null&&(a=n.processEnv),O.populate(a,s,n),o?{parsed:s,error:o}:{parsed:s}},_configVault:function(n){var e;e="Loading env from encrypted .env.vault",console.log("[dotenv@".concat(Vt,"][INFO] ").concat(e));const t=O._parseVault(n);let i=process.env;return n&&n.processEnv!=null&&(i=n.processEnv),O.populate(i,t,n),{parsed:t}},_parseVault:function(n){const e=Yn(n),t=O.configDotenv({path:e});if(!t.parsed){const s=new Error("MISSING_DATA: Cannot parse ".concat(e," for an unknown reason"));throw s.code="MISSING_DATA",s}const i=Wn(n).split(","),o=i.length;let r;for(let s=0;s<o;s++)try{const a=or(t,i[s].trim());r=O.decrypt(a.ciphertext,a.key);break}catch(a){if(s+1>=o)throw a}return O.parse(r)},config:function(n){if(Wn(n).length===0)return O.configDotenv(n);const e=Yn(n);return e?O._configVault(n):(t="You set DOTENV_KEY but you are missing a .env.vault file at ".concat(e,". Did you forget to build it?"),console.log("[dotenv@".concat(Vt,"][WARN] ").concat(t)),O.configDotenv(n));var t},decrypt:function(n,e){const t=Buffer.from(e.slice(-64),"hex");let i=Buffer.from(n,"base64");const o=i.subarray(0,12),r=i.subarray(-16);i=i.subarray(12,-16);try{const s=tr.createDecipheriv("aes-256-gcm",t,o);return s.setAuthTag(r),"".concat(s.update(i)).concat(s.final())}catch(s){const a=s instanceof RangeError,l=s.message==="Invalid key length",c=s.message==="Unsupported state or unable to authenticate data";if(a||l){const h=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw h.code="INVALID_DOTENV_KEY",h}if(c){const h=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw h.code="DECRYPTION_FAILED",h}throw s}},parse:function(n){const e={};let t,i=n.toString();for(i=i.replace(/\r\n?/gm,"\n");(t=nr.exec(i))!=null;){const o=t[1];let r=t[2]||"";r=r.trim();const s=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),s==='"'&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),e[o]=r}return e},populate:function(n,e,t={}){const i=!!(t&&t.debug),o=!!(t&&t.override);if(typeof e!="object"){const r=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw r.code="OBJECT_REQUIRED",r}for(const r of Object.keys(e))Object.prototype.hasOwnProperty.call(n,r)?(o===!0&&(n[r]=e[r]),i&&Ht(o===!0?'"'.concat(r,'" is already defined and WAS overwritten'):'"'.concat(r,'" is already defined and was NOT overwritten'))):n[r]=e[r]}};ue.exports.configDotenv=O.configDotenv,ue.exports._configVault=O._configVault,ue.exports._parseVault=O._parseVault,ue.exports.config=O.config,ue.exports.decrypt=O.decrypt,ue.exports.parse=O.parse,ue.exports.populate=O.populate,ue.exports=O;const Xn="{file}",Zn="{line}",Gn="{column}";class ir{constructor(){this.parts=[]}push(e,t){return this.parts.push({text:e,style:t}),this}line(){return this.parts.push({text:"\n",style:""}),this}merge(e){return this.parts.push(...e.parts),this}build(){const e=[],t=[];for(const i of this.parts)i.text==="\n"?e.push("\n"):(e.push("%c".concat(i.text)),t.push(i.style));return{text:e.join(""),styles:t}}log(){const{text:e,styles:t}=this.build();console.log(e,...t)}warn(){const{text:e,styles:t}=this.build();console.warn(e,...t)}error(){const{text:e,styles:t}=this.build();console.error(e,...t)}groupCollapsed(e){const{text:t,styles:i}=this.build();console.groupCollapsed(t,...i),e(),console.groupEnd()}group(e){const{text:t,styles:i}=this.build();console.group(t,...i),e(),console.groupEnd()}blue(e){return this.push(e,"color: #006aff; word-break: break-word;")}green(e){return this.push(e,"color: #00B42A; word-break: break-word;")}yellow(e){return this.push(e,"color: #FF7D00; word-break: break-word;")}red(e){return this.push(e,"color: #F53F3F; word-break: break-word;")}gray(e){return this.push(e,"color: #86909C; word-break: break-word;")}text(e){return this.push(e,"")}styled(e,t){return this.push(e,t)}bold(e){return e!==void 0?this.push(e,"font-weight: bold;"):(this.parts.length>0&&(this.parts[this.parts.length-1].style+=" font-weight: bold;"),this)}style(e){return this.parts.length>0&&(this.parts[this.parts.length-1].style+=e),this}}const rr=Object.fromEntries(["blue","green","yellow","red","gray","bold","text","styled"].map(n=>[n,(...e)=>{const t=new ir;return t[n].apply(t,e)}]));class qt extends Rn{constructor(e){if(super(e),this.it=N,e.type!==qi)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===N||e==null)return this._t=void 0,this.it=e;if(e===de)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}qt.directiveName="unsafeHTML",qt.resultType=1;const Qn=En(qt),Ft=Math.min,Re=Math.max,rt=Math.round,ee=n=>({x:n,y:n}),sr={left:"right",right:"left",bottom:"top",top:"bottom"},ar={start:"end",end:"start"};function Jn(n,e,t){return Re(n,Ft(e,t))}function st(n,e){return typeof n=="function"?n(e):n}function xe(n){return n.split("-")[0]}function at(n){return n.split("-")[1]}function eo(n){return n==="x"?"y":"x"}function to(n){return n==="y"?"height":"width"}const lr=new Set(["top","bottom"]);function ge(n){return lr.has(xe(n))?"y":"x"}function no(n){return eo(ge(n))}function Wt(n){return n.replace(/start|end/g,e=>ar[e])}const oo=["left","right"],io=["right","left"],cr=["top","bottom"],hr=["bottom","top"];function pr(n,e,t,i){const o=at(n);let r=function(s,a,l){switch(s){case"top":case"bottom":return l?a?io:oo:a?oo:io;case"left":case"right":return a?cr:hr;default:return[]}}(xe(n),t==="start",i);return o&&(r=r.map(s=>s+"-"+o),e&&(r=r.concat(r.map(Wt)))),r}function lt(n){return n.replace(/left|right|bottom|top/g,e=>sr[e])}function ct(n){const{x:e,y:t,width:i,height:o}=n;return{width:i,height:o,top:t,left:e,right:e+i,bottom:t+o,x:e,y:t}}function ro(n,e,t){let{reference:i,floating:o}=n;const r=ge(e),s=no(e),a=to(s),l=xe(e),c=r==="y",h=i.x+i.width/2-o.width/2,p=i.y+i.height/2-o.height/2,d=i[a]/2-o[a]/2;let g;switch(l){case"top":g={x:h,y:i.y-o.height};break;case"bottom":g={x:h,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:p};break;case"left":g={x:i.x-o.width,y:p};break;default:g={x:i.x,y:i.y}}switch(at(e)){case"start":g[s]-=d*(t&&c?-1:1);break;case"end":g[s]+=d*(t&&c?-1:1)}return g}function dr(n,e){return D(this,null,function*(){var t;e===void 0&&(e={});const{x:i,y:o,platform:r,rects:s,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:d=!1,padding:g=0}=st(e,n),u=function(k){return typeof k!="number"?function(S){return T({top:0,right:0,bottom:0,left:0},S)}(k):{top:k,right:k,bottom:k,left:k}}(g),m=a[d?p==="floating"?"reference":"floating":p],f=ct(yield r.getClippingRect({element:(t=yield r.isElement==null?void 0:r.isElement(m))==null||t?m:m.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),b=p==="floating"?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=yield r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating),w=(yield r.isElement==null?void 0:r.isElement(y))&&(yield r.getScale==null?void 0:r.getScale(y))||{x:1,y:1},E=ct(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:y,strategy:l}):b);return{top:(f.top-E.top+u.top)/w.y,bottom:(E.bottom-f.bottom+u.bottom)/w.y,left:(f.left-E.left+u.left)/w.x,right:(E.right-f.right+u.right)/w.x}})}const ur=new Set(["left","top"]);function ht(){return typeof window!="undefined"}function Pe(n){return so(n)?(n.nodeName||"").toLowerCase():"#document"}function F(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function re(n){var e;return(e=(so(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function so(n){return!!ht()&&(n instanceof Node||n instanceof F(n).Node)}function K(n){return!!ht()&&(n instanceof Element||n instanceof F(n).Element)}function te(n){return!!ht()&&(n instanceof HTMLElement||n instanceof F(n).HTMLElement)}function ao(n){return!(!ht()||typeof ShadowRoot=="undefined")&&(n instanceof ShadowRoot||n instanceof F(n).ShadowRoot)}const gr=new Set(["inline","contents"]);function Ue(n){const{overflow:e,overflowX:t,overflowY:i,display:o}=X(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!gr.has(o)}const fr=new Set(["table","td","th"]);function mr(n){return fr.has(Pe(n))}const br=[":popover-open",":modal"];function pt(n){return br.some(e=>{try{return n.matches(e)}catch(t){return!1}})}const yr=["transform","translate","scale","rotate","perspective"],xr=["transform","translate","scale","rotate","perspective","filter"],vr=["paint","layout","strict","content"];function Yt(n){const e=Kt(),t=K(n)?X(n):n;return yr.some(i=>!!t[i]&&t[i]!=="none")||!!t.containerType&&t.containerType!=="normal"||!e&&!!t.backdropFilter&&t.backdropFilter!=="none"||!e&&!!t.filter&&t.filter!=="none"||xr.some(i=>(t.willChange||"").includes(i))||vr.some(i=>(t.contain||"").includes(i))}function Kt(){return!(typeof CSS=="undefined"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const wr=new Set(["html","body","#document"]);function Ie(n){return wr.has(Pe(n))}function X(n){return F(n).getComputedStyle(n)}function dt(n){return K(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function fe(n){if(Pe(n)==="html")return n;const e=n.assignedSlot||n.parentNode||ao(n)&&n.host||re(n);return ao(e)?e.host:e}function lo(n){const e=fe(n);return Ie(e)?n.ownerDocument?n.ownerDocument.body:n.body:te(e)&&Ue(e)?e:lo(e)}function Xt(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const o=lo(n),r=o===((i=n.ownerDocument)==null?void 0:i.body),s=F(o);if(r){const a=Zt(s);return e.concat(s,s.visualViewport||[],Ue(o)?o:[],a&&t?Xt(a):[])}return e.concat(o,Xt(o,[],t))}function Zt(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function co(n){const e=X(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=te(n),r=o?n.offsetWidth:t,s=o?n.offsetHeight:i,a=rt(t)!==r||rt(i)!==s;return a&&(t=r,i=s),{width:t,height:i,$:a}}function ho(n){return K(n)?n:n.contextElement}function ze(n){const e=ho(n);if(!te(e))return ee(1);const t=e.getBoundingClientRect(),{width:i,height:o,$:r}=co(e);let s=(r?rt(t.width):t.width)/i,a=(r?rt(t.height):t.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const kr=ee(0);function po(n){const e=F(n);return Kt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:kr}function Ve(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const o=n.getBoundingClientRect(),r=ho(n);let s=ee(1);e&&(i?K(i)&&(s=ze(i)):s=ze(n));const a=function(d,g,u){return g===void 0&&(g=!1),!(!u||g&&u!==F(d))&&g}(r,t,i)?po(r):ee(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,h=o.width/s.x,p=o.height/s.y;if(r){const d=F(r),g=i&&K(i)?F(i):i;let u=d,m=Zt(u);for(;m&&i&&g!==u;){const f=ze(m),b=m.getBoundingClientRect(),y=X(m),w=b.left+(m.clientLeft+parseFloat(y.paddingLeft))*f.x,E=b.top+(m.clientTop+parseFloat(y.paddingTop))*f.y;l*=f.x,c*=f.y,h*=f.x,p*=f.y,l+=w,c+=E,u=F(m),m=Zt(u)}}return ct({width:h,height:p,x:l,y:c})}function ut(n,e){const t=dt(n).scrollLeft;return e?e.left+t:Ve(re(n)).left+t}function uo(n,e){const t=n.getBoundingClientRect();return{x:t.left+e.scrollLeft-ut(n,t),y:t.top+e.scrollTop}}const go=25,$r=new Set(["absolute","fixed"]);function fo(n,e,t){let i;if(e==="viewport")i=function(o,r){const s=F(o),a=re(o),l=s.visualViewport;let c=a.clientWidth,h=a.clientHeight,p=0,d=0;if(l){c=l.width,h=l.height;const u=Kt();(!u||u&&r==="fixed")&&(p=l.offsetLeft,d=l.offsetTop)}const g=ut(a);if(g<=0){const u=a.ownerDocument,m=u.body,f=getComputedStyle(m),b=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,y=Math.abs(a.clientWidth-m.clientWidth-b);y<=go&&(c-=y)}else g<=go&&(c+=g);return{width:c,height:h,x:p,y:d}}(n,t);else if(e==="document")i=function(o){const r=re(o),s=dt(o),a=o.ownerDocument.body,l=Re(r.scrollWidth,r.clientWidth,a.scrollWidth,a.clientWidth),c=Re(r.scrollHeight,r.clientHeight,a.scrollHeight,a.clientHeight);let h=-s.scrollLeft+ut(o);const p=-s.scrollTop;return X(a).direction==="rtl"&&(h+=Re(r.clientWidth,a.clientWidth)-l),{width:l,height:c,x:h,y:p}}(re(n));else if(K(e))i=function(o,r){const s=Ve(o,!0,r==="fixed"),a=s.top+o.clientTop,l=s.left+o.clientLeft,c=te(o)?ze(o):ee(1);return{width:o.clientWidth*c.x,height:o.clientHeight*c.y,x:l*c.x,y:a*c.y}}(e,t);else{const o=po(n);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return ct(i)}function mo(n,e){const t=fe(n);return!(t===e||!K(t)||Ie(t))&&(X(t).position==="fixed"||mo(t,e))}function Sr(n,e,t){const i=te(e),o=re(e),r=t==="fixed",s=Ve(n,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=ee(0);function c(){l.x=ut(o)}if(i||!i&&!r)if((Pe(e)!=="body"||Ue(o))&&(a=dt(e)),i){const p=Ve(e,!0,r,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else o&&c();r&&!i&&o&&c();const h=!o||i||r?ee(0):uo(o,a);return{x:s.left+a.scrollLeft-l.x-h.x,y:s.top+a.scrollTop-l.y-h.y,width:s.width,height:s.height}}function Gt(n){return X(n).position==="static"}function bo(n,e){if(!te(n)||X(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return re(n)===t&&(t=t.ownerDocument.body),t}function yo(n,e){const t=F(n);if(pt(n))return t;if(!te(n)){let o=fe(n);for(;o&&!Ie(o);){if(K(o)&&!Gt(o))return o;o=fe(o)}return t}let i=bo(n,e);for(;i&&mr(i)&&Gt(i);)i=bo(i,e);return i&&Ie(i)&&Gt(i)&&!Yt(i)?t:i||function(o){let r=fe(o);for(;te(r)&&!Ie(r);){if(Yt(r))return r;if(pt(r))return null;r=fe(r)}return null}(n)||t}const Cr={convertOffsetParentRelativeRectToViewportRelativeRect:function(n){let{elements:e,rect:t,offsetParent:i,strategy:o}=n;const r=o==="fixed",s=re(i),a=!!e&&pt(e.floating);if(i===s||a&&r)return t;let l={scrollLeft:0,scrollTop:0},c=ee(1);const h=ee(0),p=te(i);if((p||!p&&!r)&&((Pe(i)!=="body"||Ue(s))&&(l=dt(i)),te(i))){const g=Ve(i);c=ze(i),h.x=g.x+i.clientLeft,h.y=g.y+i.clientTop}const d=!s||p||r?ee(0):uo(s,l);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+h.x+d.x,y:t.y*c.y-l.scrollTop*c.y+h.y+d.y}},getDocumentElement:re,getClippingRect:function(n){let{element:e,boundary:t,rootBoundary:i,strategy:o}=n;const r=[...t==="clippingAncestors"?pt(e)?[]:function(l,c){const h=c.get(l);if(h)return h;let p=Xt(l,[],!1).filter(m=>K(m)&&Pe(m)!=="body"),d=null;const g=X(l).position==="fixed";let u=g?fe(l):l;for(;K(u)&&!Ie(u);){const m=X(u),f=Yt(u);f||m.position!=="fixed"||(d=null),(g?!f&&!d:!f&&m.position==="static"&&d&&$r.has(d.position)||Ue(u)&&!f&&mo(l,u))?p=p.filter(b=>b!==u):d=m,u=fe(u)}return c.set(l,p),p}(e,this._c):[].concat(t),i],s=r[0],a=r.reduce((l,c)=>{const h=fo(e,c,o);return l.top=Re(h.top,l.top),l.right=Ft(h.right,l.right),l.bottom=Ft(h.bottom,l.bottom),l.left=Re(h.left,l.left),l},fo(e,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:yo,getElementRects:function(n){return D(this,null,function*(){const e=this.getOffsetParent||yo,t=this.getDimensions,i=yield t(n.floating);return{reference:Sr(n.reference,yield e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})},getClientRects:function(n){return Array.from(n.getClientRects())},getDimensions:function(n){const{width:e,height:t}=co(n);return{width:e,height:t}},getScale:ze,isElement:K,isRTL:function(n){return X(n).direction==="rtl"}},Tr=function(n){return n===void 0&&(n=0),{name:"offset",options:n,fn(t){return D(this,null,function*(){var i,o;const{x:r,y:s,placement:a,middlewareData:l}=t,c=yield function(h,p){return D(this,null,function*(){const{placement:d,platform:g,elements:u}=h,m=yield g.isRTL==null?void 0:g.isRTL(u.floating),f=xe(d),b=at(d),y=ge(d)==="y",w=ur.has(f)?-1:1,E=m&&y?-1:1,k=st(p,h);let{mainAxis:S,crossAxis:B,alignmentAxis:H}=typeof k=="number"?{mainAxis:k,crossAxis:0,alignmentAxis:null}:{mainAxis:k.mainAxis||0,crossAxis:k.crossAxis||0,alignmentAxis:k.alignmentAxis};return b&&typeof H=="number"&&(B=b==="end"?-1*H:H),y?{x:B*E,y:S*w}:{x:S*w,y:B*E}})}(t,n);return a===((i=l.offset)==null?void 0:i.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:L(T({},c),{placement:a})}})}}},Ar=function(n){return n===void 0&&(n={}),{name:"shift",options:n,fn(t){return D(this,null,function*(){const{x:i,y:o,placement:r,platform:s}=t,y=st(n,t),{mainAxis:a=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x:E,y:k}=w;return{x:E,y:k}}}}=y,h=un(y,["mainAxis","crossAxis","limiter"]),p={x:i,y:o},d=yield s.detectOverflow(t,h),g=ge(xe(r)),u=eo(g);let m=p[u],f=p[g];if(a){const w=u==="y"?"bottom":"right";m=Jn(m+d[u==="y"?"top":"left"],m,m-d[w])}if(l){const w=g==="y"?"bottom":"right";f=Jn(f+d[g==="y"?"top":"left"],f,f-d[w])}const b=c.fn(L(T({},t),{[u]:m,[g]:f}));return L(T({},b),{data:{x:b.x-i,y:b.y-o,enabled:{[u]:a,[g]:l}}})})}}},Mr=function(n){return n===void 0&&(n={}),{name:"flip",options:n,fn(t){return D(this,null,function*(){var i,o;const{placement:r,middlewareData:s,rects:a,initialPlacement:l,platform:c,elements:h}=t,Vo=st(n,t),{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:f=!0}=Vo,b=un(Vo,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((i=s.arrow)!=null&&i.alignmentOffset)return{};const y=xe(r),w=ge(l),E=xe(l)===l,k=yield c.isRTL==null?void 0:c.isRTL(h.floating),S=g||(E||!f?[lt(l)]:function(oe){const ce=lt(oe);return[Wt(oe),ce,Wt(ce)]}(l)),B=m!=="none";!g&&B&&S.push(...pr(l,f,m,k));const H=[l,...S],le=yield c.detectOverflow(t,b),ke=[];let me=((o=s.flip)==null?void 0:o.overflows)||[];if(p&&ke.push(le[y]),d){const oe=function(ce,be,W){W===void 0&&(W=!1);const Q=at(ce),J=no(ce),wt=to(J);let kt=J==="x"?Q===(W?"end":"start")?"right":"left":Q==="start"?"bottom":"top";return be.reference[wt]>be.floating[wt]&&(kt=lt(kt)),[kt,lt(kt)]}(r,a,k);ke.push(le[oe[0]],le[oe[1]])}if(me=[...me,{placement:r,overflows:ke}],!ke.every(oe=>oe<=0)){var ne,jo;const oe=(((ne=s.flip)==null?void 0:ne.index)||0)+1,ce=H[oe];if(ce&&(!(d==="alignment"&&w!==ge(ce))||me.every(W=>ge(W.placement)!==w||W.overflows[0]>0)))return{data:{index:oe,overflows:me},reset:{placement:ce}};let be=(jo=me.filter(W=>W.overflows[0]<=0).sort((W,Q)=>W.overflows[1]-Q.overflows[1])[0])==null?void 0:jo.placement;if(!be)switch(u){case"bestFit":{var Uo;const W=(Uo=me.filter(Q=>{if(B){const J=ge(Q.placement);return J===w||J==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(J=>J>0).reduce((J,wt)=>J+wt,0)]).sort((Q,J)=>Q[1]-J[1])[0])==null?void 0:Uo[0];W&&(be=W);break}case"initialPlacement":be=l}if(r!==be)return{reset:{placement:be}}}return{}})}}},_r=(n,e,t)=>{const i=new Map,o=T({platform:Cr},t),r=L(T({},o.platform),{_c:i});return((s,a,l)=>D(this,null,function*(){const{placement:c="bottom",strategy:h="absolute",middleware:p=[],platform:d}=l,g=p.filter(Boolean),u=yield d.isRTL==null?void 0:d.isRTL(a);let m=yield d.getElementRects({reference:s,floating:a,strategy:h}),{x:f,y:b}=ro(m,c,u),y=c,w={},E=0;for(let S=0;S<g.length;S++){var k;const{name:B,fn:H}=g[S],{x:le,y:ke,data:me,reset:ne}=yield H({x:f,y:b,initialPlacement:c,placement:y,strategy:h,middlewareData:w,rects:m,platform:L(T({},d),{detectOverflow:(k=d.detectOverflow)!=null?k:dr}),elements:{reference:s,floating:a}});f=le!=null?le:f,b=ke!=null?ke:b,w=L(T({},w),{[B]:T(T({},w[B]),me)}),ne&&E<=50&&(E++,typeof ne=="object"&&(ne.placement&&(y=ne.placement),ne.rects&&(m=ne.rects===!0?yield d.getElementRects({reference:s,floating:a,strategy:h}):ne.rects),{x:f,y:b}=ro(m,y,u)),S=-1)}return{x:f,y:b,placement:y,strategy:h,middlewareData:w}}))(n,e,L(T({},o),{platform:r}))};function Er(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ve={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function xo(n){ve=n}var He={exec:()=>null};function _(n,e=""){let t=typeof n=="string"?n:n.source,i={replace:(o,r)=>{let s=typeof r=="string"?r:r.source;return s=s.replace(V.caret,"$1"),t=t.replace(o,s),i},getRegex:()=>new RegExp(t,e)};return i}var Rr=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch(n){return!1}})(),V={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp("^( {0,3}".concat(n,")((?:[ ][^\\n]*)?(?:\\n|$))")),nextBulletRegex:n=>new RegExp("^ {0,".concat(Math.min(3,n-1),"}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))")),hrRegex:n=>new RegExp("^ {0,".concat(Math.min(3,n-1),"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)")),fencesBeginRegex:n=>new RegExp("^ {0,".concat(Math.min(3,n-1),"}(?:```|~~~)")),headingBeginRegex:n=>new RegExp("^ {0,".concat(Math.min(3,n-1),"}#")),htmlBeginRegex:n=>new RegExp("^ {0,".concat(Math.min(3,n-1),"}<(?:[a-z].*>|!--)"),"i")},qe=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qt=/(?:[*+-]|\d{1,9}[.)])/,vo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,wo=_(vo).replace(/bull/g,Qt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Pr=_(vo).replace(/bull/g,Qt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Jt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,en=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ir=_(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",en).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),zr=_(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Qt).getRegex(),gt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",tn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Dr=_("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",tn).replace("tag",gt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ko=_(Jt).replace("hr",qe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gt).getRegex(),nn={blockquote:_(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ko).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Ir,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:qe,html:Dr,lheading:wo,list:zr,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:ko,table:He,text:/^[^\n]+/},$o=_("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gt).getRegex(),Lr=L(T({},nn),{lheading:Pr,table:$o,paragraph:_(Jt).replace("hr",qe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",$o).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gt).getRegex()}),Nr=L(T({},nn),{html:_("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",tn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:He,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_(Jt).replace("hr",qe).replace("heading"," *#{1,6} *[^\n]").replace("lheading",wo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),So=/^( {2,}|\\)\n(?!\s*$)/,ft=/[\p{P}\p{S}]/u,on=/[\s\p{P}\p{S}]/u,Co=/[^\s\p{P}\p{S}]/u,Or=_(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,on).getRegex(),To=/(?!~)[\p{P}\p{S}]/u,Br=_(/link|precode-code|html/,"g").replace("link",new RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)")).replace("precode-",Rr?"(?<!`)()":"(^^|[^`])").replace("code",new RegExp("(?<b>`+)[^`]+\\k<b>(?!`)")).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ao=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,jr=_(Ao,"u").replace(/punct/g,ft).getRegex(),Ur=_(Ao,"u").replace(/punct/g,To).getRegex(),Mo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Vr=_(Mo,"gu").replace(/notPunctSpace/g,Co).replace(/punctSpace/g,on).replace(/punct/g,ft).getRegex(),Hr=_(Mo,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,To).getRegex(),qr=_("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Co).replace(/punctSpace/g,on).replace(/punct/g,ft).getRegex(),Fr=_(/\\(punct)/,"gu").replace(/punct/g,ft).getRegex(),Wr=_(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Yr=_(tn).replace("(?:-->|$)","-->").getRegex(),Kr=_("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Yr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),mt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Xr=_(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",mt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_o=_(/^!?\[(label)\]\[(ref)\]/).replace("label",mt).replace("ref",en).getRegex(),Eo=_(/^!?\[(ref)\](?:\[\])?/).replace("ref",en).getRegex(),Ro=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,rn={_backpedal:He,anyPunctuation:Fr,autolink:Wr,blockSkip:Br,br:So,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:He,emStrongLDelim:jr,emStrongRDelimAst:Vr,emStrongRDelimUnd:qr,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Xr,nolink:Eo,punctuation:Or,reflink:_o,reflinkSearch:_("reflink|nolink(?!\\()","g").replace("reflink",_o).replace("nolink",Eo).getRegex(),tag:Kr,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:He},Zr=L(T({},rn),{link:_(/^!?\[(label)\]\((.*?)\)/).replace("label",mt).getRegex(),reflink:_(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",mt).getRegex()}),sn=L(T({},rn),{emStrongRDelimAst:Hr,emStrongLDelim:Ur,url:_(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ro).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:_(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ro).getRegex()}),Gr=L(T({},sn),{br:_(So).replace("{2,}","*").getRegex(),text:_(sn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),bt={normal:nn,gfm:Lr,pedantic:Nr},Fe={normal:rn,gfm:sn,breaks:Gr,pedantic:Zr},Qr={"&":"&","<":"<",">":">",'"':""","'":"'"},Po=n=>Qr[n];function se(n,e){if(e){if(V.escapeTest.test(n))return n.replace(V.escapeReplace,Po)}else if(V.escapeTestNoEncode.test(n))return n.replace(V.escapeReplaceNoEncode,Po);return n}function Io(n){try{n=encodeURI(n).replace(V.percentDecode,"%")}catch(e){return null}return n}function zo(n,e){var r;let t=n.replace(V.findPipe,(s,a,l)=>{let c=!1,h=a;for(;--h>=0&&l[h]==="\\";)c=!c;return c?"|":" |"}),i=t.split(V.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!((r=i.at(-1))!=null&&r.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(V.slashPipe,"|");return i}function We(n,e,t){let i=n.length;if(i===0)return"";let o=0;for(;o<i;){let r=n.charAt(i-o-1);if(r!==e||t){if(r===e||!t)break;o++}else o++}return n.slice(0,i-o)}function Do(n,e,t,i,o){let r=e.href,s=e.title||null,a=n[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:s,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}var yt=class{constructor(n){I(this,"options");I(this,"rules");I(this,"lexer");this.options=n||ve}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:We(t,"\n")}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],i=function(o,r,s){let a=o.match(s.other.indentCodeCompensation);if(a===null)return r;let l=a[1];return r.split("\n").map(c=>{let h=c.match(s.other.beginningSpace);if(h===null)return c;let[p]=h;return p.length>=l.length?c.slice(l.length):c}).join("\n")}(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let i=We(t,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(t=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:We(e[0],"\n")}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=We(e[0],"\n").split("\n"),i="",o="",r=[];for(;t.length>0;){let s,a=!1,l=[];for(s=0;s<t.length;s++)if(this.rules.other.blockquoteStart.test(t[s]))l.push(t[s]),a=!0;else{if(a)break;l.push(t[s])}t=t.slice(s);let c=l.join("\n"),h=c.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");i=i?"".concat(i,"\n").concat(c):c,o=o?"".concat(o,"\n").concat(h):h;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,r,!0),this.lexer.state.top=p,t.length===0)break;let d=r.at(-1);if((d==null?void 0:d.type)==="code")break;if((d==null?void 0:d.type)==="blockquote"){let g=d,u=g.raw+"\n"+t.join("\n"),m=this.blockquote(u);r[r.length-1]=m,i=i.substring(0,i.length-g.raw.length)+m.raw,o=o.substring(0,o.length-g.text.length)+m.text;break}if((d==null?void 0:d.type)==="list"){let g=d,u=g.raw+"\n"+t.join("\n"),m=this.list(u);r[r.length-1]=m,i=i.substring(0,i.length-d.raw.length)+m.raw,o=o.substring(0,o.length-g.raw.length)+m.raw,t=u.substring(r.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:i,tokens:r,text:o}}}list(n){var t,i;let e=this.rules.block.list.exec(n);if(e){let o=e[1].trim(),r=o.length>1,s={type:"list",raw:"",ordered:r,start:r?+o.slice(0,-1):"",loose:!1,items:[]};o=r?"\\d{1,9}\\".concat(o.slice(-1)):"\\".concat(o),this.options.pedantic&&(o=r?o:"[*+-]");let a=this.rules.other.listItemRegex(o),l=!1;for(;n;){let h=!1,p="",d="";if(!(e=a.exec(n))||this.rules.block.hr.test(n))break;p=e[0],n=n.substring(p.length);let g=e[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),u=n.split("\n",1)[0],m=!g.trim(),f=0;if(this.options.pedantic?(f=2,d=g.trimStart()):m?f=e[1].length+1:(f=e[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,d=g.slice(f),f+=e[1].length),m&&this.rules.other.blankLine.test(u)&&(p+=u+"\n",n=n.substring(u.length+1),h=!0),!h){let b=this.rules.other.nextBulletRegex(f),y=this.rules.other.hrRegex(f),w=this.rules.other.fencesBeginRegex(f),E=this.rules.other.headingBeginRegex(f),k=this.rules.other.htmlBeginRegex(f);for(;n;){let S,B=n.split("\n",1)[0];if(u=B,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),S=u):S=u.replace(this.rules.other.tabCharGlobal," "),w.test(u)||E.test(u)||k.test(u)||b.test(u)||y.test(u))break;if(S.search(this.rules.other.nonSpaceChar)>=f||!u.trim())d+="\n"+S.slice(f);else{if(m||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(g)||E.test(g)||y.test(g))break;d+="\n"+u}!m&&!u.trim()&&(m=!0),p+=B+"\n",n=n.substring(B.length+1),g=S.slice(f)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(l=!0)),s.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),s.raw+=p}let c=s.items.at(-1);if(!c)return;c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd(),s.raw=s.raw.trimEnd();for(let h of s.items){if(this.lexer.state.top=!1,h.tokens=this.lexer.blockTokens(h.text,[]),h.task){if(h.text=h.text.replace(this.rules.other.listReplaceTask,""),((t=h.tokens[0])==null?void 0:t.type)==="text"||((i=h.tokens[0])==null?void 0:i.type)==="paragraph"){h.tokens[0].raw=h.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),h.tokens[0].text=h.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(h.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};h.checked=d.checked,s.loose?h.tokens[0]&&["paragraph","text"].includes(h.tokens[0].type)&&"tokens"in h.tokens[0]&&h.tokens[0].tokens?(h.tokens[0].raw=d.raw+h.tokens[0].raw,h.tokens[0].text=d.raw+h.tokens[0].text,h.tokens[0].tokens.unshift(d)):h.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):h.tokens.unshift(d)}}if(!s.loose){let p=h.tokens.filter(g=>g.type==="space"),d=p.length>0&&p.some(g=>this.rules.other.anyLine.test(g.raw));s.loose=d}}if(s.loose)for(let h of s.items){h.loose=!0;for(let p of h.tokens)p.type==="text"&&(p.type="paragraph")}return s}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:i,title:o}}}table(n){var s;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=zo(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(s=e[3])!=null&&s.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],r={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===i.length){for(let a of i)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<t.length;a++)r.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:r.align[a]});for(let a of o)r.rows.push(zo(a,r.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[c]})));return r}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)==="\n"?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let r=We(t.slice(0,-1),"\\");if((t.length-r.length)%2==0)return}else{let r=function(s,a){if(s.indexOf(a[1])===-1)return-1;let l=0;for(let c=0;c<s.length;c++)if(s[c]==="\\")c++;else if(s[c]===a[0])l++;else if(s[c]===a[1]&&(l--,l<0))return c;return l>0?-2:-1}(e[2],"()");if(r===-2)return;if(r>-1){let s=(e[0].indexOf("!")===0?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,s).trim(),e[3]=""}}let i=e[2],o="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(i);r&&(i=r[1],o=r[3])}else o=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?i.slice(1):i.slice(1,-1)),Do(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let i=e[(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!i){let o=t[0].charAt(0);return{type:"text",raw:o,text:o}}return Do(t,i,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let i=this.rules.inline.emStrongLDelim.exec(n);if(!(!i||i[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!i[1]&&!i[2]||!t||this.rules.inline.punctuation.exec(t))){let o,r,s=[...i[0]].length-1,a=s,l=0,c=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*n.length+s);(i=c.exec(e))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(r=[...o].length,i[3]||i[4]){a+=r;continue}if((i[5]||i[6])&&s%3&&!((s+r)%3)){l+=r;continue}if(a-=r,a>0)continue;r=Math.min(r,r+a+l);let h=[...i[0]][0].length,p=n.slice(0,s+i.index+h+r);if(Math.min(s,r)%2){let g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}let d=p.slice(2,-2);return{type:"strong",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(t),o=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return i&&o&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,i;return e[2]==="@"?(t=e[1],i="mailto:"+t):(t=e[1],i=t),{type:"link",raw:e[0],text:t,href:i,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t,i;let e;if(e=this.rules.inline.url.exec(n)){let o,r;if(e[2]==="@")o=e[0],r="mailto:"+o;else{let s;do s=e[0],e[0]=(i=(t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])!=null?i:"";while(s!==e[0]);o=e[0],r=e[1]==="www."?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:o,href:r,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},Z=class gn{constructor(e){I(this,"tokens");I(this,"options");I(this,"state");I(this,"inlineQueue");I(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ve,this.options.tokenizer=this.options.tokenizer||new yt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:V,block:bt.normal,inline:Fe.normal};this.options.pedantic?(t.block=bt.pedantic,t.inline=Fe.pedantic):this.options.gfm&&(t.block=bt.gfm,this.options.breaks?t.inline=Fe.breaks:t.inline=Fe.gfm),this.tokenizer.rules=t}static get rules(){return{block:bt,inline:Fe}}static lex(e,t){return new gn(t).lex(e)}static lexInline(e,t){return new gn(t).inlineTokens(e)}lex(e){e=e.replace(V.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let i=this.inlineQueue[t];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],i=!1){var o,r,s;for(this.options.pedantic&&(e=e.replace(V.tabCharGlobal," ").replace(V.spaceLine,""));e;){let a;if((r=(o=this.options.extensions)==null?void 0:o.block)!=null&&r.some(c=>!!(a=c.call({lexer:this},e,t))&&(e=e.substring(a.raw.length),t.push(a),!0)))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let c=t.at(-1);a.raw.length===1&&c!==void 0?c.raw+="\n":t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let c=t.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith("\n")?"":"\n")+a.raw,c.text+="\n"+a.text,this.inlineQueue.at(-1).src=c.text):t.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let c=t.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith("\n")?"":"\n")+a.raw,c.text+="\n"+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},t.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if((s=this.options.extensions)!=null&&s.startBlock){let c,h=1/0,p=e.slice(1);this.options.extensions.startBlock.forEach(d=>{c=d.call({lexer:this},p),typeof c=="number"&&c>=0&&(h=Math.min(h,c))}),h<1/0&&h>=0&&(l=e.substring(0,h+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){let c=t.at(-1);i&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith("\n")?"":"\n")+a.raw,c.text+="\n"+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(a),i=l.length!==e.length,e=e.substring(a.raw.length)}else if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let c=t.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith("\n")?"":"\n")+a.raw,c.text+="\n"+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(a)}else if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var l,c,h,p,d,g;let i,o=e,r=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)u.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,r.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)i=r[2]?r[2].length:0,o=o.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);o=(h=(c=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:c.call({lexer:this},o))!=null?h:o;let s=!1,a="";for(;e;){let u;if(s||(a=""),s=!1,(d=(p=this.options.extensions)==null?void 0:p.inline)==null?void 0:d.some(f=>!!(u=f.call({lexer:this},e,t))&&(e=e.substring(u.raw.length),t.push(u),!0)))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(u.raw.length);let f=t.at(-1);u.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=u.raw,f.text+=u.text):t.push(u);continue}if(u=this.tokenizer.emStrong(e,o,a)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.del(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),t.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),t.push(u);continue}let m=e;if((g=this.options.extensions)!=null&&g.startInline){let f,b=1/0,y=e.slice(1);this.options.extensions.startInline.forEach(w=>{f=w.call({lexer:this},y),typeof f=="number"&&f>=0&&(b=Math.min(b,f))}),b<1/0&&b>=0&&(m=e.substring(0,b+1))}if(u=this.tokenizer.inlineText(m)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(a=u.raw.slice(-1)),s=!0;let f=t.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=u.raw,f.text+=u.text):t.push(u)}else if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}throw new Error(f)}}return t}},xt=class{constructor(n){I(this,"options");I(this,"parser");this.options=n||ve}space(n){return""}code({text:n,lang:e,escaped:t}){var r;let i=(r=(e||"").match(V.notSpaceStart))==null?void 0:r[0],o=n.replace(V.endingNewline,"")+"\n";return i?'<pre><code class="language-'+se(i)+'">'+(t?o:se(o,!0))+"</code></pre>\n":"<pre><code>"+(t?o:se(o,!0))+"</code></pre>\n"}blockquote({tokens:n}){return"<blockquote>\n".concat(this.parser.parse(n),"</blockquote>\n")}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return"<h".concat(e,">").concat(this.parser.parseInline(n),"</h").concat(e,">\n")}hr(n){return"<hr>\n"}list(n){let e=n.ordered,t=n.start,i="";for(let r=0;r<n.items.length;r++){let s=n.items[r];i+=this.listitem(s)}let o=e?"ol":"ul";return"<"+o+(e&&t!==1?' start="'+t+'"':"")+">\n"+i+"</"+o+">\n"}listitem(n){return"<li>".concat(this.parser.parse(n.tokens),"</li>\n")}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return"<p>".concat(this.parser.parseInline(n),"</p>\n")}table(n){let e="",t="";for(let o=0;o<n.header.length;o++)t+=this.tablecell(n.header[o]);e+=this.tablerow({text:t});let i="";for(let o=0;o<n.rows.length;o++){let r=n.rows[o];t="";for(let s=0;s<r.length;s++)t+=this.tablecell(r[s]);i+=this.tablerow({text:t})}return i&&(i="<tbody>".concat(i,"</tbody>")),"<table>\n<thead>\n"+e+"</thead>\n"+i+"</table>\n"}tablerow({text:n}){return"<tr>\n".concat(n,"</tr>\n")}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?"<".concat(t,' align="').concat(n.align,'">'):"<".concat(t,">"))+e+"</".concat(t,">\n")}strong({tokens:n}){return"<strong>".concat(this.parser.parseInline(n),"</strong>")}em({tokens:n}){return"<em>".concat(this.parser.parseInline(n),"</em>")}codespan({text:n}){return"<code>".concat(se(n,!0),"</code>")}br(n){return"<br>"}del({tokens:n}){return"<del>".concat(this.parser.parseInline(n),"</del>")}link({href:n,title:e,tokens:t}){let i=this.parser.parseInline(t),o=Io(n);if(o===null)return i;let r='<a href="'+(n=o)+'"';return e&&(r+=' title="'+se(e)+'"'),r+=">"+i+"</a>",r}image({href:n,title:e,text:t,tokens:i}){i&&(t=this.parser.parseInline(i,this.parser.textRenderer));let o=Io(n);if(o===null)return se(t);let r='<img src="'.concat(n=o,'" alt="').concat(t,'"');return e&&(r+=' title="'.concat(se(e),'"')),r+=">",r}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:se(n.text)}},an=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},G=class fn{constructor(e){I(this,"options");I(this,"renderer");I(this,"textRenderer");this.options=e||ve,this.options.renderer=this.options.renderer||new xt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new an}static parse(e,t){return new fn(t).parse(e)}static parseInline(e,t){return new fn(t).parseInline(e)}parse(e){var i,o;let t="";for(let r=0;r<e.length;r++){let s=e[r];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[s.type]){let l=s,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){t+=c||"";continue}}let a=s;switch(a.type){case"space":t+=this.renderer.space(a);break;case"hr":t+=this.renderer.hr(a);break;case"heading":t+=this.renderer.heading(a);break;case"code":t+=this.renderer.code(a);break;case"table":t+=this.renderer.table(a);break;case"blockquote":t+=this.renderer.blockquote(a);break;case"list":t+=this.renderer.list(a);break;case"checkbox":t+=this.renderer.checkbox(a);break;case"html":t+=this.renderer.html(a);break;case"def":t+=this.renderer.def(a);break;case"paragraph":t+=this.renderer.paragraph(a);break;case"text":t+=this.renderer.text(a);break;default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return t}parseInline(e,t=this.renderer){var o,r;let i="";for(let s=0;s<e.length;s++){let a=e[s];if((r=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&r[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){i+=c||"";continue}}let l=a;switch(l.type){case"escape":case"text":i+=t.text(l);break;case"html":i+=t.html(l);break;case"link":i+=t.link(l);break;case"image":i+=t.image(l);break;case"checkbox":i+=t.checkbox(l);break;case"strong":i+=t.strong(l);break;case"em":i+=t.em(l);break;case"codespan":i+=t.codespan(l);break;case"br":i+=t.br(l);break;case"del":i+=t.del(l);break;default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return i}},Ye=(vt=class{constructor(n){I(this,"options");I(this,"block");this.options=n||ve}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Z.lex:Z.lexInline}provideParser(){return this.block?G.parse:G.parseInline}},I(vt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),I(vt,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),vt),we=new class{constructor(...n){I(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null});I(this,"options",this.setOptions);I(this,"parse",this.parseMarkdown(!0));I(this,"parseInline",this.parseMarkdown(!1));I(this,"Parser",G);I(this,"Renderer",xt);I(this,"TextRenderer",an);I(this,"Lexer",Z);I(this,"Tokenizer",yt);I(this,"Hooks",Ye);this.use(...n)}walkTokens(n,e){var i,o;let t=[];for(let r of n)switch(t=t.concat(e.call(this,r)),r.type){case"table":{let s=r;for(let a of s.header)t=t.concat(this.walkTokens(a.tokens,e));for(let a of s.rows)for(let l of a)t=t.concat(this.walkTokens(l.tokens,e));break}case"list":{let s=r;t=t.concat(this.walkTokens(s.items,e));break}default:{let s=r;(o=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&o[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let l=s[a].flat(1/0);t=t.concat(this.walkTokens(l,e))}):s.tokens&&(t=t.concat(this.walkTokens(s.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let i=T({},t);if(i.async=this.defaults.async||i.async||!1,t.extensions&&(t.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let r=e.renderers[o.name];e.renderers[o.name]=r?function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=r.apply(this,s)),a}:o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[o.level];r?r.unshift(o.tokenizer):e[o.level]=[o.tokenizer],o.start&&(o.level==="block"?e.startBlock?e.startBlock.push(o.start):e.startBlock=[o.start]:o.level==="inline"&&(e.startInline?e.startInline.push(o.start):e.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(e.childTokens[o.name]=o.childTokens)}),i.extensions=e),t.renderer){let o=this.defaults.renderer||new xt(this.defaults);for(let r in t.renderer){if(!(r in o))throw new Error("renderer '".concat(r,"' does not exist"));if(["options","parser"].includes(r))continue;let s=r,a=t.renderer[s],l=o[s];o[s]=(...c)=>{let h=a.apply(o,c);return h===!1&&(h=l.apply(o,c)),h||""}}i.renderer=o}if(t.tokenizer){let o=this.defaults.tokenizer||new yt(this.defaults);for(let r in t.tokenizer){if(!(r in o))throw new Error("tokenizer '".concat(r,"' does not exist"));if(["options","rules","lexer"].includes(r))continue;let s=r,a=t.tokenizer[s],l=o[s];o[s]=(...c)=>{let h=a.apply(o,c);return h===!1&&(h=l.apply(o,c)),h}}i.tokenizer=o}if(t.hooks){let o=this.defaults.hooks||new Ye;for(let r in t.hooks){if(!(r in o))throw new Error("hook '".concat(r,"' does not exist"));if(["options","block"].includes(r))continue;let s=r,a=t.hooks[s],l=o[s];Ye.passThroughHooks.has(r)?o[s]=c=>{if(this.defaults.async&&Ye.passThroughHooksRespectAsync.has(r))return(()=>D(this,null,function*(){let p=yield a.call(o,c);return l.call(o,p)}))();let h=a.call(o,c);return l.call(o,h)}:o[s]=(...c)=>{if(this.defaults.async)return(()=>D(this,null,function*(){let p=yield a.apply(o,c);return p===!1&&(p=yield l.apply(o,c)),p}))();let h=a.apply(o,c);return h===!1&&(h=l.apply(o,c)),h}}i.hooks=o}if(t.walkTokens){let o=this.defaults.walkTokens,r=t.walkTokens;i.walkTokens=function(s){let a=[];return a.push(r.call(this,s)),o&&(a=a.concat(o.call(this,s))),a}}this.defaults=T(T({},this.defaults),i)}),this}setOptions(n){return this.defaults=T(T({},this.defaults),n),this}lexer(n,e){return Z.lex(n,e!=null?e:this.defaults)}parser(n,e){return G.parse(n,e!=null?e:this.defaults)}parseMarkdown(n){return(e,t)=>{let i=T({},t),o=T(T({},this.defaults),i),r=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=n),o.async)return(()=>D(this,null,function*(){let s=o.hooks?yield o.hooks.preprocess(e):e,a=yield(o.hooks?yield o.hooks.provideLexer():n?Z.lex:Z.lexInline)(s,o),l=o.hooks?yield o.hooks.processAllTokens(a):a;o.walkTokens&&(yield Promise.all(this.walkTokens(l,o.walkTokens)));let c=yield(o.hooks?yield o.hooks.provideParser():n?G.parse:G.parseInline)(l,o);return o.hooks?yield o.hooks.postprocess(c):c}))().catch(r);try{o.hooks&&(e=o.hooks.preprocess(e));let s=(o.hooks?o.hooks.provideLexer():n?Z.lex:Z.lexInline)(e,o);o.hooks&&(s=o.hooks.processAllTokens(s)),o.walkTokens&&this.walkTokens(s,o.walkTokens);let a=(o.hooks?o.hooks.provideParser():n?G.parse:G.parseInline)(s,o);return o.hooks&&(a=o.hooks.postprocess(a)),a}catch(s){return r(s)}}}onError(n,e){return t=>{if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",n){let i="<p>An error occurred:</p><pre>"+se(t.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(t);throw t}}};function P(n,e){return we.parse(n,e)}P.options=P.setOptions=function(n){return we.setOptions(n),P.defaults=we.defaults,xo(P.defaults),P},P.getDefaults=Er,P.defaults=ve,P.use=function(...n){return we.use(...n),P.defaults=we.defaults,xo(P.defaults),P},P.walkTokens=function(n,e){return we.walkTokens(n,e)},P.parseInline=we.parseInline,P.Parser=G,P.parser=G.parse,P.Renderer=xt,P.TextRenderer=an,P.Lexer=Z,P.lexer=Z.lex,P.Tokenizer=yt,P.Hooks=Ye,P.parse=P,P.options,P.setOptions,P.use,P.walkTokens,P.parseInline,G.parse,Z.lex;let Ke="";function Lo(n){Ke=n}function ln(n){if(!Ke||!n)return n;const e=Ke.endsWith("/")?Ke:Ke+"/";return n.startsWith(e)?n.slice(e.length):n}const Jr=["right-start","left-start","right-end","left-end","bottom-end","top-end","bottom-start","top-start","right","left","bottom","top"],ae=16;function No(n){try{return P.parse(n,{async:!1})}catch(e){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br>")}}function es(n){const{name:e,summary:t}=function(s){const a=s.name,l=s.input||{};switch(a){case"Read":return{name:"Read",summary:ln(l.file_path||"")};case"Write":return{name:"Write",summary:ln(l.file_path||"")};case"Edit":return{name:"Update",summary:ln(l.file_path||"")};case"Glob":return{name:"List",summary:l.pattern||""};case"Grep":return{name:"Search",summary:l.pattern||""};case"Bash":return{name:"Bash",summary:l.command||""};case"WebFetch":return{name:"Fetch",summary:l.url||""};case"WebSearch":return{name:"Search",summary:l.query||""};default:return{name:a,summary:""}}}(n),i=n.isComplete,o=n.result!==void 0,r=n.name==="Edit"&&n.input&&(n.input.old_string||n.input.new_string);return C(ei||(ei=$(['\n <div class="tool-call-inline">\n <div class="tool-header-inline">\n <span class="tool-bullet ','">●</span>\n <span class="tool-name-inline">',"</span>\n ","\n </div>\n ","\n </div>\n "])),i?"tool-bullet-complete":"tool-bullet-running",e,t?C(Yo||(Yo=$(['<span class="tool-summary-inline">',"</span>"])),t):"",r?C(Qo||(Qo=$(['<div class="tool-diff-wrapper">\n <span class="tool-result-bracket">⎿</span>\n ',"\n </div>"])),function(s){const a=s.input||{},l=a.old_string||"",c=a.new_string||"";if(!l&&!c)return C(Ko||(Ko=$([""])));const h=l.split("\n"),p=c.split("\n");return C(Go||(Go=$(['\n <div class="diff-view">\n ',"\n ","\n </div>\n "])),h.map(d=>C(Xo||(Xo=$(['<div class="diff-line diff-del">- ',"</div>"])),d)),p.map(d=>C(Zo||(Zo=$(['<div class="diff-line diff-add">+ ',"</div>"])),d)))}(n)):o?C(Jo||(Jo=$(['<div class="tool-result-inline">\n <span class="tool-result-bracket">⎿</span>\n <span class="tool-result-text ','"\n >',"</span\n >\n </div>"])),n.isError?"tool-error-text":"",function(s,a){if(!s)return"";let l=s.trim();if(a==="Write")return"Wrote ".concat(l.split("\n").length," lines");if(a==="Read"){const c=l.split("\n").length;if(c>5)return"".concat(c," lines")}return l.length>300&&(l=l.slice(0,300)+"..."),l}(n.result,n.name)):"")}function ts(n,e){var t;return n.showChatModal?C(vi||(vi=$(['\n <div\n class="chat-modal-overlay"\n @click="','"\n @mousemove="','"\n @mouseup="','"\n >\n <div\n class="chat-modal chat-modal-floating ','"\n id="chat-modal-floating"\n @click="','"\n >\n <div class="chat-modal-header" @mousedown="','">\n <div class="chat-modal-title-wrapper">\n <div class="chat-modal-title-row">\n <h3 class="chat-modal-title">AI Assistant</h3>\n ',"\n </div>\n ",'\n </div>\n <div class="chat-modal-actions">\n <button\n class="chat-modal-theme"\n @click="','"\n title="','"\n >\n ','\n </button>\n <button\n class="chat-modal-clear"\n @click="','"\n title="Clear"\n >\n <svg\n width="14"\n height="14"\n viewBox="0 0 24 24"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n >\n <path d="M3 6h18" />\n <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" />\n <path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />\n </svg>\n </button>\n <button\n class="chat-modal-close"\n @click="','"\n title="Close"\n >\n <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </button>\n </div>\n </div>\n <div class="chat-modal-content">\n ',"\n ","\n </div>\n ",'\n <div class="chat-modal-footer">\n <span class="chat-input-prompt">❯</span>\n <textarea\n class="chat-input"\n placeholder="Enter your message..."\n .value="','"\n @input="','"\n @keydown="','"\n ?disabled="','"\n rows="2"\n ></textarea>\n <button\n class="chat-send-btn"\n @click="','"\n ?disabled="','"\n title="Send (Enter)"\n >\n ',"\n </button>\n </div>\n </div>\n </div>\n "])),e.handleOverlayClick,e.handleDragMove,e.handleDragEnd,n.isDragging?"dragging":"",i=>i.stopPropagation(),e.handleDragStart,n.chatModel?C(ti||(ti=$(['<span class="chat-model-badge">',"</span>"])),n.chatModel):"",n.chatContext?C(ni||(ni=$(['<span class="chat-context-info"\n ><',"> ","#","</span\n >"])),n.chatContext.name,n.chatContext.file,n.chatContext.line):"",e.toggleTheme,n.chatTheme==="dark"?"Switch to light theme":"Switch to dark theme",n.chatTheme==="dark"?C(oi||(oi=$(['<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <circle cx="12" cy="12" r="5" />\n <path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42" />\n </svg>']))):C(ii||(ii=$(['<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />\n </svg>']))),e.clearChatMessages,e.closeChatModal,n.chatMessages.length===0?C(ri||(ri=$(['<div class="chat-empty">\n <span class="chat-empty-prompt">❯</span>\n <span class="chat-empty-text">Ask me anything about this code...</span>\n </div>']))):n.chatMessages.map(i=>C(gi||(gi=$(['\n <div class="chat-line chat-line-','">\n ','\n <div class="chat-message-content">\n ',"\n </div>\n </div>\n "])),i.role,i.role==="user"?C(si||(si=$(['<span class="chat-prompt">❯</span>']))):C(ai||(ai=$(['<span class="chat-indent"></span>']))),function(o){const r=o.role==="assistant";return o.blocks&&o.blocks.length>0?C(pi||(pi=$(["\n ","\n "])),o.blocks.map(s=>s.type==="text"&&s.content?r?C(li||(li=$(['<div class="chat-text-inline chat-markdown">',"</div>"])),Qn(No(s.content))):C(ci||(ci=$(['<div class="chat-text-inline">',"</div>"])),s.content):s.type==="tool"&&s.tool?es(s.tool):C(hi||(hi=$([""]))))):r&&o.content?C(di||(di=$(['<div class="chat-text-inline chat-markdown">',"</div>"])),Qn(No(o.content))):C(ui||(ui=$(['<div class="chat-text-inline">',"</div>"])),o.content)}(i))),!n.chatLoading||n.chatMessages.length&&((t=n.chatMessages[n.chatMessages.length-1])==null?void 0:t.role)!=="user"?"":C(fi||(fi=$(['<div class="chat-loading">\n <span class="chat-indent"></span>\n <span class="chat-cursor"></span>\n </div>']))),n.turnStatus!=="idle"?C(bi||(bi=$(['<div class="chat-status-bar">\n <div class="chat-status-info">\n <span class="chat-status-icon ','">\n ','\n </span>\n <span class="chat-status-text">\n ','\n </span>\n <span class="chat-status-duration">· ',"</span>\n </div>\n ","\n </div>"])),n.turnStatus,n.turnStatus==="running"?"●":n.turnStatus==="done"?"✓":"■",n.turnStatus==="running"?"Running":n.turnStatus==="done"?"Done":"Interrupt",function(i){const o=Math.floor(i/60),r=Math.floor(i%60);return o>0?"".concat(o,"m ").concat(r.toString().padStart(2,"0"),"s"):"".concat(r,"s")}(n.turnDuration),n.turnStatus==="running"?C(mi||(mi=$(['<button\n class="chat-interrupt-btn"\n @click="','"\n title="Interrupt"\n >\n <svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor">\n <rect x="6" y="6" width="12" height="12" rx="1" />\n </svg>\n </button>'])),e.interruptChat):""):"",n.chatInput,e.handleChatInput,e.handleChatKeyDown,n.chatLoading,e.sendChatMessage,n.chatLoading||!n.chatInput.trim(),n.chatLoading?C(yi||(yi=$(['<svg\n class="chat-send-loading"\n width="16"\n height="16"\n viewBox="0 0 24 24"\n >\n <circle\n cx="12"\n cy="12"\n r="10"\n stroke="currentColor"\n stroke-width="3"\n fill="none"\n stroke-dasharray="31.4"\n stroke-linecap="round"\n />\n </svg>']))):C(xi||(xi=$(['<svg\n width="16"\n height="16"\n viewBox="0 0 24 24"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n >\n <path d="M5 12h14" />\n <path d="M12 5l7 7-7 7" />\n </svg>'])))):C(wi||(wi=$([""])))}P.setOptions({breaks:!0,gfm:!0});const ns=Ge(ki||(ki=$(["\n /* 暗色主题变量(默认) */\n :host {\n --chat-bg: #1e1e1e;\n --chat-header-bg: #252526;\n --chat-border: #333;\n --chat-text: #d4d4d4;\n --chat-text-secondary: #ccc;\n --chat-text-muted: #aaa;\n --chat-text-placeholder: #888;\n --chat-accent: #569cd6;\n --chat-accent-hover: #6cb6ff;\n --chat-overlay: rgba(0, 0, 0, 0.3);\n --chat-shadow: rgba(0, 0, 0, 0.4);\n --chat-code-bg: #2d2d2d;\n --chat-code-text: #ce9178;\n --chat-pre-bg: #1a1a1a;\n --chat-pre-text: #d4d4d4;\n --chat-prompt-ai: #c586c0;\n --chat-tool-bg: #252526;\n --chat-tool-border: #555;\n --chat-tool-complete: #4ec9b0;\n --chat-tool-name: #dcdcaa;\n --chat-tool-result: #9cdcfe;\n --chat-tool-error: #f48771;\n --chat-tool-prefix: #555;\n --chat-scrollbar-track: #1e1e1e;\n --chat-scrollbar-thumb: #424242;\n --chat-scrollbar-hover: #555;\n --chat-heading: #e0e0e0;\n --chat-strong: #e0e0e0;\n --chat-em: #b5b5b5;\n --chat-del: #888;\n --chat-blockquote-bg: #252526;\n --chat-blockquote-text: #aaa;\n --chat-table-header-bg: #252526;\n --chat-table-alt-bg: #1a1a1a;\n --chat-input-bg: #1e1e1e;\n --chat-btn-text: #1e1e1e;\n --chat-ai-text: #9cdcfe;\n --chat-user-text: #d4d4d4;\n --chat-hover-bg: #333;\n --chat-diff-add-bg: rgba(35, 134, 54, 0.15);\n --chat-diff-add-text: #4ec9b0;\n --chat-diff-del-bg: rgba(218, 54, 51, 0.15);\n --chat-diff-del-text: #f48771;\n }\n\n /* 亮色主题变量 */\n :host(.chat-theme-light) {\n --chat-bg: #ffffff;\n --chat-header-bg: #f5f5f5;\n --chat-border: #e0e0e0;\n --chat-text: #333333;\n --chat-text-secondary: #555555;\n --chat-text-muted: #666;\n --chat-text-placeholder: #aaaaaa;\n --chat-accent: #0969da;\n --chat-accent-hover: #0550ae;\n --chat-overlay: rgba(0, 0, 0, 0.15);\n --chat-shadow: rgba(0, 0, 0, 0.12);\n --chat-code-bg: #eff1f3;\n --chat-code-text: #d73e1d;\n --chat-pre-bg: #f6f8fa;\n --chat-pre-text: #333333;\n --chat-prompt-ai: #8250df;\n --chat-tool-bg: #f5f5f5;\n --chat-tool-border: #d0d0d0;\n --chat-tool-complete: #1a7f37;\n --chat-tool-name: #953800;\n --chat-tool-result: #0550ae;\n --chat-tool-error: #cf222e;\n --chat-tool-prefix: #bbb;\n --chat-scrollbar-track: #ffffff;\n --chat-scrollbar-thumb: #c8c8c8;\n --chat-scrollbar-hover: #a0a0a0;\n --chat-heading: #1f2328;\n --chat-strong: #1f2328;\n --chat-em: #555555;\n --chat-del: #aaaaaa;\n --chat-blockquote-bg: #f5f5f5;\n --chat-blockquote-text: #666666;\n --chat-table-header-bg: #f5f5f5;\n --chat-table-alt-bg: #f6f8fa;\n --chat-input-bg: #ffffff;\n --chat-btn-text: #ffffff;\n --chat-ai-text: #0550ae;\n --chat-user-text: #333333;\n --chat-hover-bg: #e8e8e8;\n --chat-diff-add-bg: rgba(35, 134, 54, 0.1);\n --chat-diff-add-text: #1a7f37;\n --chat-diff-del-bg: rgba(218, 54, 51, 0.1);\n --chat-diff-del-text: #cf222e;\n }\n\n /* 聊天框样式 */\n .chat-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--chat-overlay);\n z-index: 99999999999999999;\n animation: fadeIn 0.2s ease-out;\n }\n\n .chat-modal {\n background: var(--chat-bg);\n border-radius: 8px;\n box-shadow: 0 8px 32px var(--chat-shadow);\n width: 90%;\n max-width: 600px;\n height: 70vh;\n max-height: 700px;\n display: flex;\n flex-direction: column;\n animation: slideUp 0.3s ease-out;\n overflow: hidden;\n border: 1px solid var(--chat-border);\n }\n\n .chat-modal-floating {\n position: fixed;\n top: 0;\n left: 0;\n width: 480px;\n min-width: 360px;\n height: min(520px, calc(100vh - 32px));\n animation: slideIn 0.3s ease-out;\n }\n\n .chat-modal-centered {\n animation: fadeInScale 0.3s ease-out;\n }\n\n @keyframes fadeInScale {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes slideUp {\n from { transform: translateY(20px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n }\n\n @keyframes slideIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n\n .chat-modal-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n background: var(--chat-header-bg);\n border-bottom: 1px solid var(--chat-border);\n cursor: move;\n user-select: none;\n }\n\n .chat-modal.dragging {\n transition: none;\n user-select: none;\n }\n\n .chat-modal.dragging .chat-modal-content,\n .chat-modal.dragging .chat-modal-footer {\n pointer-events: none;\n }\n\n .chat-modal-title-wrapper {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n flex: 1;\n }\n\n .chat-modal-title {\n margin: 0;\n font-size: 13px;\n font-weight: 500;\n color: var(--chat-text-secondary);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n }\n\n .chat-modal-title-row {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .chat-model-badge {\n font-size: 10px;\n color: var(--chat-text-muted);\n background: var(--chat-border);\n padding: 1px 6px;\n border-radius: 3px;\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n white-space: nowrap;\n max-width: 160px;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .chat-context-info {\n font-size: 11px;\n color: var(--chat-text-muted);\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .chat-modal-actions {\n display: flex;\n align-items: center;\n gap: 4px;\n flex-shrink: 0;\n }\n\n .chat-modal-theme,\n .chat-modal-clear {\n background: transparent;\n border: none;\n color: var(--chat-text-muted);\n cursor: pointer;\n padding: 4px;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.15s;\n }\n\n .chat-modal-theme:hover,\n .chat-modal-clear:hover {\n background: var(--chat-hover-bg);\n color: var(--chat-text-secondary);\n }\n\n .chat-modal-close {\n background: transparent;\n border: none;\n color: var(--chat-text-muted);\n cursor: pointer;\n padding: 0;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: all 0.15s;\n }\n\n .chat-modal-close:hover {\n background: var(--chat-hover-bg);\n color: var(--chat-text-secondary);\n }\n\n .chat-modal-content {\n flex: 1;\n overflow-y: auto;\n padding: 12px 14px;\n display: flex;\n flex-direction: column;\n gap: 0;\n min-height: 0;\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 13px;\n line-height: 1.5;\n background: var(--chat-bg);\n }\n\n .chat-empty {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n color: var(--chat-text-placeholder);\n }\n\n .chat-empty-prompt {\n color: var(--chat-accent);\n font-weight: 600;\n }\n\n .chat-empty-text {\n color: var(--chat-text-placeholder);\n font-style: italic;\n }\n\n /* 终端风格连续消息流 */\n .chat-line {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n word-break: break-word;\n }\n\n .chat-line-user {\n color: var(--chat-user-text);\n margin-top: 12px;\n }\n\n .chat-line-user:first-child {\n margin-top: 0;\n }\n\n .chat-line-assistant {\n color: var(--chat-ai-text);\n margin-top: 2px;\n }\n\n .chat-prompt {\n color: var(--chat-accent);\n font-weight: 600;\n flex-shrink: 0;\n user-select: none;\n }\n\n .chat-indent {\n display: inline-block;\n width: 10px;\n flex-shrink: 0;\n }\n\n .chat-message-content {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n .chat-text-inline {\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n /* Markdown 渲染样式 */\n .chat-markdown {\n white-space: normal;\n }\n\n .chat-markdown p {\n margin: 0 0 8px 0;\n }\n\n .chat-markdown p:last-child {\n margin-bottom: 0;\n }\n\n .chat-markdown h1,\n .chat-markdown h2,\n .chat-markdown h3,\n .chat-markdown h4,\n .chat-markdown h5,\n .chat-markdown h6 {\n margin: 12px 0 8px 0;\n font-weight: 600;\n line-height: 1.3;\n color: var(--chat-heading);\n }\n\n .chat-markdown h1 { font-size: 1.4em; }\n .chat-markdown h2 { font-size: 1.25em; }\n .chat-markdown h3 { font-size: 1.1em; }\n .chat-markdown h4,\n .chat-markdown h5,\n .chat-markdown h6 { font-size: 1em; }\n\n .chat-markdown code {\n background: var(--chat-code-bg);\n padding: 2px 6px;\n border-radius: 4px;\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 0.9em;\n color: var(--chat-code-text);\n }\n\n .chat-markdown pre {\n background: var(--chat-pre-bg);\n border: 1px solid var(--chat-border);\n border-radius: 6px;\n padding: 12px;\n margin: 8px 0;\n overflow-x: auto;\n }\n\n .chat-markdown pre code {\n background: transparent;\n padding: 0;\n color: var(--chat-pre-text);\n font-size: 12px;\n line-height: 1.5;\n }\n\n .chat-markdown ul,\n .chat-markdown ol {\n margin: 8px 0;\n padding-left: 20px;\n }\n\n .chat-markdown li {\n margin: 4px 0;\n }\n\n .chat-markdown li > ul,\n .chat-markdown li > ol {\n margin: 4px 0;\n }\n\n .chat-markdown blockquote {\n margin: 8px 0;\n padding: 8px 12px;\n border-left: 3px solid var(--chat-accent);\n background: var(--chat-blockquote-bg);\n color: var(--chat-blockquote-text);\n }\n\n .chat-markdown blockquote p {\n margin: 0;\n }\n\n .chat-markdown a {\n color: var(--chat-accent);\n text-decoration: none;\n }\n\n .chat-markdown a:hover {\n text-decoration: underline;\n }\n\n .chat-markdown hr {\n border: none;\n border-top: 1px solid var(--chat-border);\n margin: 12px 0;\n }\n\n .chat-markdown table {\n border-collapse: collapse;\n margin: 8px 0;\n width: 100%;\n font-size: 12px;\n }\n\n .chat-markdown th,\n .chat-markdown td {\n border: 1px solid var(--chat-border);\n padding: 6px 10px;\n text-align: left;\n }\n\n .chat-markdown th {\n background: var(--chat-table-header-bg);\n font-weight: 600;\n }\n\n .chat-markdown tr:nth-child(even) {\n background: var(--chat-table-alt-bg);\n }\n\n .chat-markdown strong {\n font-weight: 600;\n color: var(--chat-strong);\n }\n\n .chat-markdown em {\n font-style: italic;\n color: var(--chat-em);\n }\n\n .chat-markdown del {\n text-decoration: line-through;\n color: var(--chat-del);\n }\n\n .chat-line-user {\n color: var(--chat-user-text);\n }\n\n .chat-line-assistant {\n color: var(--chat-ai-text);\n }\n\n /* 加载状态 - 光标闪烁 */\n .chat-loading {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .chat-cursor {\n width: 8px;\n height: 16px;\n background: var(--chat-accent);\n animation: cursorBlink 1s step-end infinite;\n }\n\n @keyframes cursorBlink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0; }\n }\n\n /* 状态栏 */\n .chat-status-bar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 4px 14px;\n background: var(--chat-header-bg);\n border-top: 1px solid var(--chat-border);\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 11px;\n }\n\n .chat-status-info {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--chat-text-muted);\n }\n\n .chat-status-icon {\n font-size: 10px;\n }\n\n .chat-status-icon.running {\n color: var(--chat-accent);\n animation: statusPulse 1.5s ease-in-out infinite;\n }\n\n .chat-status-icon.done {\n color: var(--chat-tool-complete);\n }\n\n .chat-status-icon.interrupt {\n color: var(--chat-tool-error);\n }\n\n @keyframes statusPulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.4; }\n }\n\n .chat-status-text {\n color: var(--chat-text-muted);\n }\n\n .chat-status-duration {\n color: var(--chat-text-placeholder);\n }\n\n .chat-interrupt-btn {\n background: transparent;\n border: 1px solid var(--chat-border);\n color: var(--chat-text-muted);\n cursor: pointer;\n padding: 0;\n width: 24px;\n height: 24px;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.15s;\n }\n\n .chat-interrupt-btn:hover {\n background: var(--chat-hover-bg);\n color: var(--chat-tool-error);\n border-color: var(--chat-tool-error);\n }\n\n /* 底部输入区域 */\n .chat-modal-footer {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 14px;\n border-top: 1px solid var(--chat-border);\n background: var(--chat-header-bg);\n }\n\n .chat-input-prompt {\n color: var(--chat-accent);\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 13px;\n font-weight: 600;\n flex-shrink: 0;\n user-select: none;\n }\n\n .chat-input {\n flex: 1;\n background: var(--chat-input-bg);\n border: 1px solid var(--chat-border);\n border-radius: 4px;\n padding: 6px 10px;\n font-size: 13px;\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n color: var(--chat-text);\n resize: none;\n line-height: 1.4;\n outline: none;\n transition: border-color 0.15s;\n }\n\n .chat-input::placeholder {\n color: var(--chat-text-placeholder);\n }\n\n .chat-input:focus {\n border-color: var(--chat-accent);\n }\n\n .chat-input:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n .chat-send-btn {\n background: var(--chat-accent);\n border: none;\n border-radius: 4px;\n padding: 6px 10px;\n cursor: pointer;\n color: var(--chat-btn-text);\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.15s;\n flex-shrink: 0;\n }\n\n .chat-send-btn:hover:not(:disabled) {\n background: var(--chat-accent-hover);\n }\n\n .chat-send-btn:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n .chat-send-loading {\n animation: chatSendSpin 1s linear infinite;\n }\n\n @keyframes chatSendSpin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n /* CLI 扁平内联工具调用 */\n .tool-call-inline {\n margin: 4px 0;\n font-size: 13px;\n line-height: 1.5;\n }\n\n .tool-header-inline {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--chat-text-secondary);\n }\n\n .tool-bullet {\n font-size: 10px;\n flex-shrink: 0;\n }\n\n .tool-bullet-running {\n color: var(--chat-accent);\n animation: toolPulse 1.5s ease-in-out infinite;\n }\n\n .tool-bullet-complete {\n color: var(--chat-tool-complete);\n }\n\n @keyframes toolPulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.3; }\n }\n\n .tool-name-inline {\n color: var(--chat-tool-name);\n font-weight: 600;\n }\n\n .tool-summary-inline {\n color: var(--chat-text-muted);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1;\n direction: rtl;\n text-align: left;\n }\n\n .tool-result-inline {\n display: flex;\n align-items: flex-start;\n gap: 6px;\n padding-left: 16px;\n margin-top: 2px;\n }\n\n .tool-result-bracket {\n color: var(--chat-tool-prefix);\n flex-shrink: 0;\n line-height: 1.4;\n }\n\n .tool-result-text {\n color: var(--chat-tool-result);\n white-space: pre-wrap;\n word-break: break-word;\n line-height: 1.4;\n font-size: 12px;\n }\n\n .tool-error-text {\n color: var(--chat-tool-error);\n }\n\n /* Diff 视图(Edit 工具红绿对比) */\n .tool-diff-wrapper {\n display: flex;\n align-items: flex-start;\n gap: 6px;\n padding-left: 16px;\n margin-top: 2px;\n }\n\n .tool-diff-wrapper > .tool-result-bracket {\n margin-top: 2px;\n }\n\n .diff-view {\n flex: 1;\n min-width: 0;\n font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 4px;\n overflow: hidden;\n }\n\n .diff-line {\n padding: 1px 8px;\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n .diff-del {\n background: var(--chat-diff-del-bg);\n color: var(--chat-diff-del-text);\n }\n\n .diff-add {\n background: var(--chat-diff-add-bg);\n color: var(--chat-diff-add-text);\n }\n\n /* 滚动条样式 */\n .chat-modal-content::-webkit-scrollbar {\n width: 8px;\n }\n\n .chat-modal-content::-webkit-scrollbar-track {\n background: var(--chat-scrollbar-track);\n }\n\n .chat-modal-content::-webkit-scrollbar-thumb {\n background: var(--chat-scrollbar-thumb);\n border-radius: 4px;\n }\n\n .chat-modal-content::-webkit-scrollbar-thumb:hover {\n background: var(--chat-scrollbar-hover);\n }\n"])));function Oo(n,e,t,i,o,r,s,a){return D(this,null,function*(){var p,d,g,u;const l=yield fetch("http://".concat(n,":").concat(e,"/ai"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T({message:t,context:i,history:o},a&&{sessionId:a})),signal:s});if(!l.ok)throw new Error("Chat request failed");const c=(p=l.body)==null?void 0:p.getReader(),h=new TextDecoder;if(c){let m="";for(;;){const{done:f,value:b}=yield c.read();if(f)break;m+=h.decode(b,{stream:!0});const y=m.split("\n");m=y.pop()||"";for(const w of y)if(w.startsWith("data: ")){const E=w.slice(6);if(E==="[DONE]")continue;try{const k=JSON.parse(E);switch(k.type){case"text":default:k.content&&r.onText(k.content);break;case"tool_start":r.onToolStart(k.toolId,k.toolName,k.index);break;case"tool_input":r.onToolInput(k.index,k.input);break;case"tool_result":r.onToolResult(k.toolUseId,k.content,k.isError);break;case"session":k.sessionId&&((d=r.onSessionId)==null||d.call(r,k.sessionId));break;case"info":k.cwd&&((g=r.onProjectRoot)==null||g.call(r,k.cwd)),k.model&&((u=r.onModel)==null||u.call(r,k.model))}k.error&&r.onError(new Error(k.error))}catch(k){}}}}})}const cn="__code_inspector_ai_state__";var os=Object.defineProperty,is=Object.getOwnPropertyDescriptor,v=(n,e,t,i)=>{for(var o,r=i>1?void 0:i?is(e,t):e,s=n.length-1;s>=0;s--)(o=n[s])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&os(e,t,r),r};const hn="__code-inspector-unique-id",pn="data-astro-source-file",rs={ctrlKey:"^control",altKey:"⌥option",metaKey:"⌘command",shiftKey:"shift"},ss={ctrlKey:"Ctrl",altKey:"Alt",metaKey:"⊞Windows",shiftKey:"Shift"},Xe=300;function Bo(){return new Promise(n=>{requestAnimationFrame(n)})}class x extends Be{constructor(){super(...arguments),this.hotKeys="shiftKey,altKey",this.port=5678,this.showSwitch=!1,this.autoToggle=!1,this.hideConsole=!1,this.locate=!0,this.copy=void 0,this.target="",this.targetNode=null,this.ip="localhost",this.ai=!1,this.wheelThrottling=!1,this.modeKey="z",this.defaultAction="",this.position={top:0,right:0,bottom:0,left:0,padding:{top:0,right:0,bottom:0,left:0},border:{top:0,right:0,bottom:0,left:0},margin:{top:0,right:0,bottom:0,left:0}},this.element={name:"",line:0,column:0,path:""},this.elementTipStyle={vertical:"",horizon:"",visibility:""},this.show=!1,this.showNodeTree=!1,this.nodeTreePosition={},this.nodeTree=null,this.dragging=!1,this.mousePosition={baseX:0,baseY:0,moveX:0,moveY:0},this.draggingTarget="switch",this.open=!1,this.moved=!1,this.hoverSwitch=!1,this.preUserSelect="",this.sendType="xhr",this.activeNode={},this.showSettingsModal=!1,this.internalLocate=!1,this.internalCopy=!1,this.internalTarget=!1,this.internalAI=!1,this.showChatModal=!1,this.chatMessages=[],this.chatInput="",this.chatLoading=!1,this.chatContext=null,this.currentTools=new Map,this.chatSessionId=null,this.chatTheme="dark",this.turnStatus="idle",this.turnDuration=0,this.chatModel="",this.chatAbortController=null,this.turnTimerInterval=null,this.turnStartTime=0,this.isDragging=!1,this.dragStartX=0,this.dragStartY=0,this.modalStartX=0,this.modalStartY=0,this.wasDragging=!1,this.chatPositionCleanup=null,this.features=[{label:"Locate Code",description:"Open the editor and locate code",checked:()=>!!this.internalLocate,onChange:()=>this.toggleLocate(),action:"locate",fn:()=>this.locateCode(),key:1,available:()=>!!this.locate},{label:"Copy Path",description:"Copy the code path to clipboard",checked:()=>!!this.internalCopy,onChange:()=>this.toggleCopy(),action:"copy",fn:()=>this.copyCode(),key:2,available:()=>this.copy!==!1},{label:"Open Target",description:"Open the target url",checked:()=>!!this.internalTarget,onChange:()=>this.toggleTarget(),action:"target",fn:()=>this.targetCode(),key:3,available:()=>!!this.target},{label:"AI Assistant",description:"Use AI for coding",checked:()=>!!this.internalAI,onChange:()=>this.toggleAICode(),action:"ai",fn:()=>this.openChatModal(),key:4,available:()=>!!this.ai}],this.eventListeners=[],this.isTracking=e=>this.hotKeys&&this.hotKeys.split(",").every(t=>e[t.trim()]),this.getDomPropertyValue=(e,t)=>{const i=window.getComputedStyle(e);return Number(i.getPropertyValue(t).replace("px",""))},this.calculateElementInfoPosition=e=>D(this,null,function*(){var E,k;const{top:t,right:i,bottom:o,left:r}=e.getBoundingClientRect(),s=document.documentElement.clientHeight,a=document.documentElement.clientWidth,l=this.getDomPropertyValue(e,"margin-top"),c=this.getDomPropertyValue(e,"margin-right"),h=this.getDomPropertyValue(e,"margin-bottom"),p=this.getDomPropertyValue(e,"margin-left");yield Bo();const{width:d,height:g}=this.elementInfoRef.getBoundingClientRect(),u=t-l,m=i+c,f=o+h,b=r-p,y=[{vertical:"element-info-bottom",horizon:"element-info-right",top:f,left:b,isExternal:!0},{vertical:"element-info-bottom",horizon:"element-info-left",top:f,left:m-d,isExternal:!0},{vertical:"element-info-top",horizon:"element-info-right",top:u-g,left:b,isExternal:!0},{vertical:"element-info-top",horizon:"element-info-left",top:u-g,left:m-d,isExternal:!0},{vertical:"element-info-bottom-inner",horizon:"element-info-right",top:f-g,left:b,isExternal:!1},{vertical:"element-info-bottom-inner",horizon:"element-info-left",top:f-g,left:m-d,isExternal:!1},{vertical:"element-info-top-inner",horizon:"element-info-right",top:u,left:b,isExternal:!1},{vertical:"element-info-top-inner",horizon:"element-info-left",top:u,left:m-d,isExternal:!1},{vertical:"element-info-top-inner",horizon:"element-info-left",top:Math.max(0,u),left:m-d,isExternal:!1,additionStyle:{transform:"translateY(".concat(Math.max(0,-u),"px)")}},{vertical:"element-info-top-inner",horizon:"element-info-right",top:Math.max(0,u),left:m-d,isExternal:!1,additionStyle:{transform:"translateY(".concat(Math.max(0,-u),"px)")}}],w=S=>S.left<0||S.left+d>a||S.top<0||S.top+g>s;for(const S of y){const B=document.documentElement.clientWidth;if(S.horizon.endsWith("left")){const H=b+d-B;H>0&&(S.additionStyle={transform:"translateX(-".concat(H,"px) ").concat(((E=S.additionStyle)==null?void 0:E.transform)||"")})}else{const H=d-m;H>0&&(S.additionStyle={transform:"translateX(".concat(H,"px) ").concat(((k=S.additionStyle)==null?void 0:k.transform)||"")})}if(!w(S))return S}return y[0]}),this.renderCover=e=>D(this,null,function*(){if(e===this.targetNode)return;this.targetNode=e;const{top:t,right:i,bottom:o,left:r}=e.getBoundingClientRect();if(this.position={top:t,right:i,bottom:o,left:r,border:{top:this.getDomPropertyValue(e,"border-top-width"),right:this.getDomPropertyValue(e,"border-right-width"),bottom:this.getDomPropertyValue(e,"border-bottom-width"),left:this.getDomPropertyValue(e,"border-left-width")},padding:{top:this.getDomPropertyValue(e,"padding-top"),right:this.getDomPropertyValue(e,"padding-right"),bottom:this.getDomPropertyValue(e,"padding-bottom"),left:this.getDomPropertyValue(e,"padding-left")},margin:{top:this.getDomPropertyValue(e,"margin-top"),right:this.getDomPropertyValue(e,"margin-right"),bottom:this.getDomPropertyValue(e,"margin-bottom"),left:this.getDomPropertyValue(e,"margin-left")}},this.elementTipStyle={vertical:"",horizon:"",visibility:"hidden"},this.addGlobalCursorStyle(),this.preUserSelect||(this.preUserSelect=getComputedStyle(document.body).userSelect),document.body.style.userSelect="none",this.element=this.getSourceInfo(e),this.show=!0,!this.showNodeTree){const{vertical:s,horizon:a,additionStyle:l}=yield this.calculateElementInfoPosition(e);this.elementTipStyle={vertical:s,horizon:a,visibility:"visible",additionStyle:l}}}),this.getAstroFilePath=e=>{var t;return(t=e.getAttribute)!=null&&t.call(e,pn)?"".concat(e.getAttribute(pn),":").concat(e.getAttribute("data-astro-source-loc"),":").concat(e.tagName.toLowerCase()):""},this.getSourceInfo=e=>{var a;let t=((a=e.getAttribute)==null?void 0:a.call(e,et))||e[et]||this.getAstroFilePath(e);if(!t)return null;const i=t.split(":"),o=i[i.length-1],r=Number(i[i.length-2]),s=Number(i[i.length-3]);return{name:o,path:i.slice(0,i.length-3).join(":"),line:s,column:r}},this.removeCover=e=>{e!==!0&&this.nodeTree||(this.targetNode=null,this.show=!1,this.removeGlobalCursorStyle(),document.body.style.userSelect=this.preUserSelect,this.preUserSelect="")},this.renderLayerPanel=(e,{x:t,y:i})=>{const o=document.documentElement.clientWidth,r=document.documentElement.clientHeight,s=o-t,a=r-i;let l={};s<t?(l.right=s+"px",t<Xe&&(l.transform="translateX(".concat(Xe-t,"px)"))):(l.left=t+"px",s<Xe&&(l.transform="translateX(-".concat(Xe-s,"px)"))),a<i?(l.bottom=a+"px",l.maxHeight=i-10+"px"):(l.top=i+"px",l.maxHeight=r-i-10+"px"),this.nodeTreePosition=l,this.nodeTree=e,this.showNodeTree=!0},this.removeLayerPanel=()=>{this.showNodeTree=!1,this.nodeTree=null,this.activeNode={}},this.addGlobalCursorStyle=()=>{if(!document.getElementById(hn)){const e=document.createElement("style");e.setAttribute("id",hn),e.innerText="body * {\n cursor: pointer !important;\n }",document.body.appendChild(e)}},this.removeGlobalCursorStyle=()=>{const e=document.getElementById(hn);e&&e.remove()},this.sendXHR=()=>{const e=encodeURIComponent(this.element.path),t="http://".concat(this.ip,":").concat(this.port,"/?file=").concat(e,"&line=").concat(this.element.line,"&column=").concat(this.element.column),i=new XMLHttpRequest;i.open("GET",t,!0),i.send(),i.addEventListener("error",()=>{this.sendType="img",this.sendImg()})},this.sendImg=()=>{const e=encodeURIComponent(this.element.path),t="http://".concat(this.ip,":").concat(this.port,"/?file=").concat(e,"&line=").concat(this.element.line,"&column=").concat(this.element.column);document.createElement("img").src=t},this.buildTargetUrl=()=>{let e=this.target;const{path:t,line:i,column:o}=this.element,r={"{file}":t,"{line}":i,"{column}":o};for(let s in r)e=e.replace(new RegExp(s,"g"),String(r[s]));return e},this.locateCode=()=>{this.sendType==="xhr"?this.sendXHR():this.sendImg()},this.copyCode=()=>{const e=function(t,i,o,r){let s="".concat(t,":").concat(i,":").concat(o);if(typeof r=="string")s=r.replace(Xn,t).replace(Zn,i.toString()).replace(Gn,o.toString());else if(r instanceof Array)return r.map(a=>a.replace(Xn,t).replace(Zn,i.toString()).replace(Gn,o.toString()));return[s]}(this.element.path,String(this.element.line),String(this.element.column),this.copy||!1);this.copyToClipboard(e[0])},this.targetCode=()=>{window.open(this.buildTargetUrl(),"_blank")},this.dispatchCustomEvent=e=>{window.dispatchEvent(new CustomEvent("code-inspector:trackCode",{detail:{action:e,element:this.element}}))},this.trackCode=()=>{this.features.forEach(e=>{e.checked()&&(e.fn(),this.dispatchCustomEvent(e.action))})},this.handleModeShortcut=e=>{var o,r;if(!this.isTracking(e))return;if(((o=e.code)==null?void 0:o.toLowerCase())==="key".concat(this.modeKey)||((r=e.key)==null?void 0:r.toLowerCase())===this.modeKey)return this.toggleSettingsModal(),e.preventDefault(),void e.stopPropagation();const t=e.code.toLowerCase(),i=e.keyCode;this.features.forEach(s=>{const a="digit"+s.key,l="numpad"+s.key,c=48+s.key;if((t===a||t===l||i===c)&&s.available()&&(s.action==="ai"||this.targetNode&&this.element.path))return s.fn(),e.preventDefault(),e.stopPropagation(),void this.dispatchCustomEvent(s.action)})},this.handleDrag=e=>{if(e.composedPath().includes(this)?this.hoverSwitch=!0:this.hoverSwitch=!1,this.dragging){this.moved=!0;const t=this.draggingTarget==="switch"?this.inspectorSwitchRef:this.nodeTreeRef;return t.style.left=this.mousePosition.baseX+(this.getMousePosition(e).x-this.mousePosition.moveX)+"px",t.style.top=this.mousePosition.baseY+(this.getMousePosition(e).y-this.mousePosition.moveY)+"px",void(this.draggingTarget&&(this.nodeTreePosition.left=t.style.left,this.nodeTreePosition.top=t.style.top))}},this.getValidNodeList=e=>{const t=[];for(const i of e)i.hasAttribute&&i.hasAttribute(pn)?t.push({node:i,isAstro:!0}):(i.hasAttribute&&i.hasAttribute(et)||i[et])&&t.push({node:i,isAstro:!1});return t},this.isSamePositionNode=(e,t)=>{const i=e.getBoundingClientRect(),o=t.getBoundingClientRect();return i.top===o.top&&i.left===o.left&&i.right===o.right&&i.bottom===o.bottom},this.handleMouseMove=e=>D(this,null,function*(){if((this.isTracking(e)&&!this.dragging||this.open)&&!this.hoverSwitch){document.hasFocus()||window.focus();const t=e.composedPath(),i=this.getValidNodeList(t);let o;for(const{node:r,isAstro:s}of i){if(s){o=r;break}o?this.isSamePositionNode(o,r)&&(o=r):o=r}o?this.renderCover(o):this.removeCover()}else this.removeCover()}),this.handleWheel=e=>{if(!this.targetNode||(e.stopPropagation(),e.preventDefault(),this.wheelThrottling))return;this.wheelThrottling=!0;const t=e.composedPath(),i=this.getValidNodeList(t);let o=i.findIndex(({node:s})=>s===this.targetNode);if(o===-1)return void(this.wheelThrottling=!1);const r=e.deltaX||e.deltaY;r>0?o--:r<0&&o++,o>=0&&o<i.length&&this.renderCover(i[o].node),setTimeout(()=>{this.wheelThrottling=!1},200)},this.handleMouseClick=e=>{(this.isTracking(e)||this.open)&&this.show&&(e.stopPropagation(),e.preventDefault(),this.trackCode(),this.removeCover(),this.autoToggle&&(this.open=!1)),e.composedPath().includes(this.nodeTreeRef)||this.removeLayerPanel()},this.handleContextMenu=e=>{if((this.isTracking(e)&&!this.dragging||this.open)&&!this.hoverSwitch){e.preventDefault();const t=e.composedPath(),i=this.generateNodeTree(t);this.renderLayerPanel(i,{x:e.clientX,y:e.clientY})}},this.generateNodeTree=e=>{let t,i=1,o=null;for(const r of e.reverse()){const s=this.getSourceInfo(r);if(!s)continue;const a=L(T({},s),{children:[],depth:i++,element:r});o?o.children.push(a):t=a,o=a}return t},this.handlePointerDown=e=>{let t=!1,i=e.target;for(;i;){if(i.disabled){t=!0;break}i=i.parentElement}t&&(this.isTracking(e)||this.open)&&this.show&&(e.stopPropagation(),e.preventDefault(),this.trackCode(),this.removeCover(),this.autoToggle&&(this.open=!1))},this.handleKeyUp=e=>{this.isTracking(e)||this.open||this.removeCover()},this.printTip=()=>{const e=navigator.userAgent.toLowerCase(),t=["windows","win32","wow32","win64","wow64"].some(a=>e.toUpperCase().match(a.toUpperCase()))?ss:rs,i=this.hotKeys.split(",").map(a=>t[a.trim()]),o=[...i,this.modeKey.toUpperCase()],r=rr,s=a=>{const l=r.yellow(a[0]).bold();for(let c=1;c<a.length;c++)l.green(" + ").yellow(a[c]).bold();return l};r.blue("[code-inspector-plugin] click to expand the guide").groupCollapsed(()=>{s(i.concat("left click")).green(" to use active feature").log(),s(i.concat("right click")).green(" to open node tree").log(),s(i.concat("mouse wheel")).green(" to select parent node or child node").log(),s(o).green(" to change active feature").log(),this.features.forEach(a=>{s(i.concat(a.key.toString())).green(" to use ").yellow(a.label).bold().log()})})},this.getMousePosition=e=>{var t,i;return{x:e instanceof MouseEvent?e.pageX:(t=e.touches[0])==null?void 0:t.pageX,y:e instanceof MouseEvent?e.pageY:(i=e.touches[0])==null?void 0:i.pageY}},this.recordMousePosition=(e,t)=>{const i=t==="switch"?this.inspectorSwitchRef:this.nodeTreeRef;this.mousePosition={baseX:i.offsetLeft,baseY:i.offsetTop,moveX:this.getMousePosition(e).x,moveY:this.getMousePosition(e).y},this.dragging=!0,this.draggingTarget=t,e.preventDefault()},this.handleMouseUp=e=>{this.hoverSwitch=!1,this.dragging&&(this.dragging=!1,e instanceof TouchEvent&&this.draggingTarget==="switch"&&this.switch(e))},this.switch=e=>{this.moved||(this.open=!this.open,e.preventDefault(),e.stopPropagation()),this.moved=!1},this.handleClickTreeNode=e=>{this.element=e,this.trackCode(),this.removeLayerPanel()},this.handleMouseEnterNode=(e,t)=>D(this,null,function*(){const{x:i,y:o,width:r,height:s}=e.target.getBoundingClientRect();this.activeNode={width:r-16+"px",left:i+8+"px",visibility:"hidden",top:o-4+"px",bottom:"",content:"".concat(t.path,":").concat(t.line,":").concat(t.column),class:"tooltip-top"},this.renderCover(t.element),yield Bo();const{y:a}=this.nodeTreeTooltipRef.getBoundingClientRect();a<0&&(this.activeNode=L(T({},this.activeNode),{bottom:"",top:"".concat(o+s+4,"px"),class:"tooltip-bottom"})),this.activeNode=L(T({},this.activeNode),{visibility:"visible"})}),this.handleMouseLeaveNode=()=>{this.activeNode=L(T({},this.activeNode),{visibility:"hidden"}),this.removeCover(!0)},this.toggleSettingsModal=()=>{this.showSettingsModal=!this.showSettingsModal},this.closeSettingsModal=()=>{this.showSettingsModal=!1},this.clearAllActions=()=>{this.internalLocate=!1,this.internalCopy=!1,this.internalTarget=!1,this.internalAI=!1},this.toggleLocate=()=>{const e=!this.internalLocate;this.clearAllActions(),this.internalLocate=e},this.toggleCopy=()=>{const e=!this.internalCopy;this.clearAllActions(),this.internalCopy=e},this.toggleTarget=()=>{const e=!this.internalTarget;this.clearAllActions(),this.internalTarget=e},this.toggleAICode=()=>{const e=!this.internalAI;this.clearAllActions(),this.internalAI=e},this.persistAIState=()=>{var t;let e=null;if(this.showChatModal){const i=(t=this.shadowRoot)==null?void 0:t.querySelector("#chat-modal-floating");i&&(e={left:i.style.left,top:i.style.top})}(function(i){try{sessionStorage.setItem(cn,JSON.stringify(i))}catch(o){}})({showChatModal:this.showChatModal,chatMessages:this.chatMessages,chatContext:this.chatContext,chatSessionId:this.chatSessionId,chatTheme:this.chatTheme,chatModel:this.chatModel,modalPosition:e,turnStatus:this.turnStatus})},this.openChatModal=()=>{this.element.path?this.chatContext={file:this.element.path,line:this.element.line,column:this.element.column,name:this.element.name}:this.chatContext=null;const e=this.targetNode;this.showChatModal=!0,this.chatModel||function(t,i){return D(this,null,function*(){try{const o=yield fetch("http://".concat(t,":").concat(i,"/ai/model"));return o.ok&&(yield o.json()).model||""}catch(o){return""}})}(this.ip,this.port).then(t=>{t&&this.isConnected&&(this.chatModel=t)}),document.body.style.overflow="hidden",this.updateComplete.then(()=>{requestAnimationFrame(()=>{var r;const t=(r=this.shadowRoot)==null?void 0:r.querySelector("#chat-modal-floating");if(t)if(e)this.chatPositionCleanup=(o=t,(i=e)&&o&&D(this,null,function*(){const s=yield _r(i,o,{strategy:"fixed",placement:"right-start",middleware:[Tr(ae),Mr({fallbackPlacements:Jr.slice(1),padding:ae}),Ar({padding:ae})]}),{x:a,y:l}=s,c=document.documentElement.clientWidth,h=document.documentElement.clientHeight,p=o.getBoundingClientRect(),d=p.width,g=p.height,u=i.getBoundingClientRect(),m=a<ae||l<ae||a+d>c-ae||l+g>h-ae,f=a<u.right&&a+d>u.left&&l<u.bottom&&l+g>u.top;if(m||f){const b=(c-d)/2,y=(h-g)/2;Object.assign(o.style,{left:"".concat(Math.max(ae,b),"px"),top:"".concat(Math.max(ae,y),"px")}),o.classList.add("chat-modal-centered")}else Object.assign(o.style,{left:"".concat(a,"px"),top:"".concat(l,"px")}),o.classList.remove("chat-modal-centered")}),null);else{const s=document.documentElement.clientWidth,a=document.documentElement.clientHeight,l=t.getBoundingClientRect(),c=(s-l.width)/2,h=(a-l.height)/2;t.style.left="".concat(Math.max(16,c),"px"),t.style.top="".concat(Math.max(16,h),"px"),t.classList.add("chat-modal-centered")}var i,o;requestAnimationFrame(()=>this.persistAIState())})})},this.closeChatModal=()=>{this.chatPositionCleanup&&(this.chatPositionCleanup(),this.chatPositionCleanup=null),this.showChatModal=!1,document.body.style.overflow="",function(){try{sessionStorage.removeItem(cn)}catch(e){}}()},this.clearChatMessages=()=>{this.chatMessages=[],this.chatSessionId=null,this.turnStatus="idle",this.turnDuration=0,this.persistAIState()},this.toggleTheme=()=>{this.chatTheme=this.chatTheme==="dark"?"light":"dark",this.chatTheme==="light"?this.classList.add("chat-theme-light"):this.classList.remove("chat-theme-light"),this.persistAIState()},this.handleChatInput=e=>{this.chatInput=e.target.value},this.handleChatKeyDown=e=>{e.key!=="Enter"||e.shiftKey||(e.preventDefault(),this.sendChatMessage())},this.scrollPending=!1,this.scrollChatToBottom=()=>{this.scrollPending||(this.scrollPending=!0,requestAnimationFrame(()=>{var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector(".chat-modal-content");e&&(e.scrollTop=e.scrollHeight),this.scrollPending=!1}))},this.startTurnTimer=()=>{this.turnStartTime=Date.now(),this.turnDuration=0,this.turnStatus="running",this.turnTimerInterval=setInterval(()=>{this.turnDuration=Math.floor((Date.now()-this.turnStartTime)/1e3)},1e3)},this.stopTurnTimer=e=>{this.turnTimerInterval&&(clearInterval(this.turnTimerInterval),this.turnTimerInterval=null),this.turnDuration=Math.floor((Date.now()-this.turnStartTime)/1e3),this.turnStatus=e},this.interruptChat=()=>{this.chatAbortController&&(this.chatAbortController.abort(),this.chatAbortController=null),this.stopTurnTimer("interrupt"),this.chatLoading=!1},this.handleChatDragStart=e=>{var i;if(e.button!==0)return;const t=(i=this.shadowRoot)==null?void 0:i.querySelector("#chat-modal-floating");t&&(this.chatPositionCleanup&&(this.chatPositionCleanup(),this.chatPositionCleanup=null),this.isDragging=!0,this.wasDragging=!0,this.dragStartX=e.clientX,this.dragStartY=e.clientY,this.modalStartX=t.offsetLeft,this.modalStartY=t.offsetTop,e.preventDefault())},this.handleChatDragMove=e=>{var d;if(!this.isDragging)return;const t=(d=this.shadowRoot)==null?void 0:d.querySelector("#chat-modal-floating");if(!t)return;const i=e.clientX-this.dragStartX,o=e.clientY-this.dragStartY,r=this.modalStartX+i,s=this.modalStartY+o,a=document.documentElement.clientWidth,l=document.documentElement.clientHeight,c=t.getBoundingClientRect(),h=Math.max(0,Math.min(r,a-c.width)),p=Math.max(0,Math.min(s,l-c.height));t.style.left="".concat(h,"px"),t.style.top="".concat(p,"px")},this.handleChatDragEnd=()=>{this.isDragging=!1,setTimeout(()=>{this.wasDragging=!1},100),this.persistAIState()},this.handleOverlayClick=()=>{this.wasDragging||this.closeChatModal()},this.sendChatMessage=()=>D(this,null,function*(){if(!this.chatInput.trim()||this.chatLoading)return;const e=this.chatInput.trim();this.chatInput="",this.chatMessages=[...this.chatMessages,{role:"user",content:e}],this.chatLoading=!0,this.scrollChatToBottom(),this.startTurnTimer(),this.chatAbortController=new AbortController,this.chatMessages=[...this.chatMessages,{role:"assistant",content:"",blocks:[]}];let t="";const i=[],o=new Map,r=()=>{this.chatMessages=[...this.chatMessages.slice(0,-1),{role:"assistant",content:t,blocks:[...i]}],this.scrollChatToBottom()};let s=null;const a=()=>{s&&(clearTimeout(s),s=null),r(),this.persistAIState()};try{yield Oo(this.ip,this.port,e,this.chatContext,this.chatMessages.slice(0,-1),{onText:l=>{t+=l;const c=i[i.length-1];c&&c.type==="text"?c.content=(c.content||"")+l:i.push({type:"text",content:l}),s||(s=setTimeout(()=>{s=null,r()},50))},onToolStart:(l,c,h)=>{const p={id:l,name:c,isComplete:!1},d=i.length;i.push({type:"tool",tool:p}),o.set(l,d),a()},onToolInput:(l,c)=>{for(let h=i.length-1;h>=0;h--)if(i[h].type==="tool"&&i[h].tool&&!i[h].tool.isComplete){i[h].tool.input=c,a();break}},onToolResult:(l,c,h)=>{var d;const p=o.get(l);p!==void 0&&((d=i[p])!=null&&d.tool)&&(i[p].tool.result=c,i[p].tool.isError=h,i[p].tool.isComplete=!0,a())},onError:l=>{console.error("Chat error:",l)},onSessionId:l=>{this.chatSessionId=l,this.persistAIState()},onProjectRoot:l=>{Lo(l)},onModel:l=>{this.chatModel=l}},this.chatAbortController.signal,this.chatSessionId),a(),this.stopTurnTimer("done")}catch(l){l instanceof Error&&l.name==="AbortError"||(this.chatMessages=this.chatMessages.slice(0,-1),this.showNotification("Failed to send message","error"),this.stopTurnTimer("interrupt"))}finally{this.chatLoading=!1,this.chatAbortController=null}}),this.resumeAITask=()=>D(this,null,function*(){if(!this.chatSessionId||this.chatLoading)return;this.chatLoading=!0,this.startTurnTimer(),this.chatAbortController=new AbortController,this.chatMessages=[...this.chatMessages,{role:"assistant",content:"",blocks:[]}];let e="";const t=[],i=new Map,o=()=>{this.chatMessages=[...this.chatMessages.slice(0,-1),{role:"assistant",content:e,blocks:[...t]}],this.scrollChatToBottom()};let r=null;const s=()=>{r&&(clearTimeout(r),r=null),o(),this.persistAIState()};try{yield Oo(this.ip,this.port,"The previous task was interrupted by a page refresh. Please continue from where you left off.",this.chatContext,this.chatMessages.slice(0,-1),{onText:a=>{e+=a;const l=t[t.length-1];l&&l.type==="text"?l.content=(l.content||"")+a:t.push({type:"text",content:a}),r||(r=setTimeout(()=>{r=null,o()},50))},onToolStart:(a,l,c)=>{const h={id:a,name:l,isComplete:!1},p=t.length;t.push({type:"tool",tool:h}),i.set(a,p),s()},onToolInput:(a,l)=>{for(let c=t.length-1;c>=0;c--)if(t[c].type==="tool"&&t[c].tool&&!t[c].tool.isComplete){t[c].tool.input=l,s();break}},onToolResult:(a,l,c)=>{var p;const h=i.get(a);h!==void 0&&((p=t[h])!=null&&p.tool)&&(t[h].tool.result=l,t[h].tool.isError=c,t[h].tool.isComplete=!0,s())},onError:a=>{console.error("Resume error:",a)},onSessionId:a=>{this.chatSessionId=a,this.persistAIState()},onProjectRoot:a=>{Lo(a)},onModel:a=>{this.chatModel=a}},this.chatAbortController.signal,this.chatSessionId),s(),this.stopTurnTimer("done")}catch(a){a instanceof Error&&a.name==="AbortError"||(this.chatMessages=this.chatMessages.slice(0,-1),this.stopTurnTimer("interrupt"))}finally{this.chatLoading=!1,this.chatAbortController=null}}),this.renderNodeTree=e=>C($i||($i=$(['\n <div\n class="inspector-layer"\n style="padding-left: ','px;"\n @mouseenter="','"\n @mouseleave="','"\n @click="','"\n >\n <',">\n </div>\n ","\n "])),8*e.depth,t=>D(this,null,function*(){return yield this.handleMouseEnterNode(t,e)}),this.handleMouseLeaveNode,()=>this.handleClickTreeNode(e),e.name,e.children.map(t=>this.renderNodeTree(t)))}showNotification(e,t="success"){const i=document.createElement("div");i.className="code-inspector-notification code-inspector-notification-".concat(t),i.textContent=e,document.body.appendChild(i),requestAnimationFrame(()=>{i.classList.add("code-inspector-notification-show")}),setTimeout(()=>{i.classList.remove("code-inspector-notification-show"),setTimeout(()=>{document.body.removeChild(i)},300)},2e3)}copyToClipboard(e){var t;try{typeof((t=navigator==null?void 0:navigator.clipboard)==null?void 0:t.writeText)=="function"?navigator.clipboard.writeText(e).then(()=>{this.showNotification("✓ Copied to clipboard")}).catch(()=>{this.fallbackCopy(e)}):this.fallbackCopy(e)}catch(i){this.fallbackCopy(e)}}fallbackCopy(e){try{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();const i=document.execCommand("copy");document.body.removeChild(t),i?this.showNotification("✓ Copied to clipboard"):this.showNotification("✗ Copy failed","error")}catch(t){this.showNotification("✗ Copy failed","error")}}attachEventListeners(){this.eventListeners.forEach(({event:e,handler:t,options:i})=>{window.addEventListener(e,t,i)})}detachEventListeners(){this.eventListeners.forEach(({event:e,handler:t,options:i})=>{window.removeEventListener(e,t,i)})}firstUpdated(){var i,o,r;let e=!1;if(this.defaultAction)switch(this.defaultAction){case"ai":this.ai&&(this.internalAI=!0,e=!0);break;case"target":this.target&&(this.internalTarget=!0,e=!0);break;case"copy":this.copy&&(this.internalCopy=!0,e=!0);break;case"locate":this.locate&&(this.internalLocate=!0,e=!0)}e||(this.locate?this.internalLocate=!0:this.copy?this.internalCopy=!0:this.target?this.internalTarget=!0:this.ai&&(this.internalAI=!0));const t=function(){try{const s=sessionStorage.getItem(cn);return s?JSON.parse(s):null}catch(s){return null}}();if(t!=null&&t.showChatModal)this.chatMessages=t.chatMessages,this.chatContext=t.chatContext,this.chatSessionId=t.chatSessionId,this.chatTheme=t.chatTheme,this.chatModel=t.chatModel,this.showChatModal=!0,this.chatTheme==="light"&&this.classList.add("chat-theme-light"),document.body.style.overflow="hidden",this.updateComplete.then(()=>{requestAnimationFrame(()=>{var a;const s=(a=this.shadowRoot)==null?void 0:a.querySelector("#chat-modal-floating");s&&t.modalPosition&&(s.style.left=t.modalPosition.left,s.style.top=t.modalPosition.top),t.turnStatus==="running"&&t.chatSessionId&&this.resumeAITask()})});else{const s=(r=(o=(i=window.matchMedia)==null?void 0:i.call(window,"(prefers-color-scheme: dark)"))==null?void 0:o.matches)!=null?r:!1;this.chatTheme=s?"dark":"light",this.chatTheme==="light"&&this.classList.add("chat-theme-light")}this.eventListeners=[{event:"mousemove",handler:this.handleMouseMove,options:!0},{event:"touchmove",handler:this.handleMouseMove,options:!0},{event:"mousemove",handler:this.handleDrag,options:!0},{event:"touchmove",handler:this.handleDrag,options:!0},{event:"click",handler:this.handleMouseClick,options:!0},{event:"pointerdown",handler:this.handlePointerDown,options:!0},{event:"keyup",handler:this.handleKeyUp,options:!0},{event:"keydown",handler:this.handleModeShortcut,options:!0},{event:"mouseleave",handler:this.removeCover,options:!0},{event:"mouseup",handler:this.handleMouseUp,options:!0},{event:"touchend",handler:this.handleMouseUp,options:!0},{event:"contextmenu",handler:this.handleContextMenu,options:!0},{event:"wheel",handler:this.handleWheel,options:{passive:!1}}],this.hideConsole||this.printTip(),this.attachEventListeners()}disconnectedCallback(){this.detachEventListeners()}render(){const e={display:this.show?"block":"none",top:this.position.top-this.position.margin.top+"px",left:this.position.left-this.position.margin.left+"px",height:"".concat(this.position.bottom-this.position.top+this.position.margin.bottom+this.position.margin.top,"px"),width:"".concat(this.position.right-this.position.left+this.position.margin.right+this.position.margin.left,"px")},t={borderTopWidth:"".concat(this.position.margin.top,"px"),borderRightWidth:"".concat(this.position.margin.right,"px"),borderBottomWidth:"".concat(this.position.margin.bottom,"px"),borderLeftWidth:"".concat(this.position.margin.left,"px")},i={borderTopWidth:"".concat(this.position.border.top,"px"),borderRightWidth:"".concat(this.position.border.right,"px"),borderBottomWidth:"".concat(this.position.border.bottom,"px"),borderLeftWidth:"".concat(this.position.border.left,"px")},o={borderTopWidth:"".concat(this.position.padding.top,"px"),borderRightWidth:"".concat(this.position.padding.right,"px"),borderBottomWidth:"".concat(this.position.padding.bottom,"px"),borderLeftWidth:"".concat(this.position.padding.left,"px")},r=T({display:this.showNodeTree?"flex":"none"},this.nodeTreePosition),s={visibility:this.activeNode.visibility,maxWidth:this.activeNode.width,top:this.activeNode.top,left:this.activeNode.left,bottom:this.activeNode.bottom,display:this.showNodeTree?"":"none"};return C(_i||(_i=$(['\n <div\n class="code-inspector-container"\n id="code-inspector-container"\n style=','\n >\n <div class="margin-overlay" style=','>\n <div class="border-overlay" style=','>\n <div class="padding-overlay" style=','>\n <div class="content-overlay"></div>\n </div>\n </div>\n </div>\n <div\n id="element-info"\n class="element-info '," "," ",'"\n style=','\n >\n <div class="element-info-content">\n <div class="name-line">\n <div class="element-name">\n <span class="element-title"><','></span>\n </div>\n </div>\n <div class="path-line">\n ',":",":",'\n </div>\n </div>\n </div>\n </div>\n <div\n id="inspector-switch"\n class="inspector-switch '," ",'"\n style=','\n @mousedown="','"\n @touchstart="','"\n @click="','"\n >\n ','\n </div>\n <div\n id="inspector-node-tree"\n class="element-info-content"\n style=','\n >\n <div\n class="inspector-layer-title"\n @mousedown="','"\n @touchstart="','"\n >\n <div>🔍️ Click node to locate</div>\n ','\n </div>\n\n <div\n class="node-tree-list"\n style="','"\n >\n ','\n <div style="height: 8px"></div>\n </div>\n </div>\n\n <!-- 设置弹窗 -->\n ',"\n\n <!-- 聊天框 -->\n ",'\n\n <div\n id="node-tree-tooltip"\n class="','"\n style=',"\n >\n ","\n </div>\n "])),ie(e),ie(t),ie(i),ie(o),this.elementTipStyle.vertical,this.elementTipStyle.horizon,this.elementTipStyle.visibility,ie(T({width:Xe+"px",maxWidth:"100vw"},this.elementTipStyle.additionStyle)),this.element.name,this.element.path,this.element.line,this.element.column,this.open?"active-inspector-switch":"",this.moved?"move-inspector-switch":"",ie({display:this.showSwitch?"flex":"none"}),a=>this.recordMousePosition(a,"switch"),a=>this.recordMousePosition(a,"switch"),this.switch,this.open?C(Si||(Si=$(['\n <svg\n t="1677801709811"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="1110"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n width="1em"\n height="1em"\n >\n <path\n d="M546.56 704H128c-19.2 0-32-12.8-32-32V256h704v194.56c10.928 1.552 21.648 3.76 32 6.832V128c0-35.2-28.8-64-64-64H128C92.8 64 64 92.8 64 128v544c0 35.2 28.8 64 64 64h425.392a221.936 221.936 0 0 1-6.848-32zM96 128c0-19.2 12.8-32 32-32h640c19.2 0 32 12.8 32 32v96H96V128z"\n fill="#34495E"\n p-id="1111"\n ></path>\n <path\n d="M416 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="#00B42A"\n p-id="1112"\n ></path>\n <path\n d="M288 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="#F7BA1E"\n p-id="1113"\n ></path>\n <path\n d="M160 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="#F53F3F"\n p-id="1114"\n ></path>\n <path\n d="M382.848 658.928l99.376-370.88 30.912 8.272-99.36 370.88zM318.368 319.2L160 477.6l158.4 158.4 22.64-22.624-135.792-135.776 135.776-135.776zM768 480c-13.088 0-25.888 1.344-38.24 3.84l6.24-6.24-158.4-158.4-22.64 22.624 135.792 135.776-135.776 135.776 22.656 22.624 2.208-2.224a190.768 190.768 0 0 0 30.928 148.08l-116.672 116.656c-10.24 10.24-10.24 26.896 0 37.136l27.76 27.76c5.12 5.12 11.84 7.68 18.56 7.68s13.456-2.56 18.56-7.68l120.992-120.96A190.56 190.56 0 0 0 768 864c105.872 0 192-86.128 192-192s-86.128-192-192-192z m-159.12 193.136c0-88.224 71.776-160 160-160 10.656 0 21.04 1.152 31.12 3.152V672c0 19.2-12.8 32-32 32h-156a160.144 160.144 0 0 1-3.12-30.864z m-68.464 263.584l-19.632-19.632 110.336-110.336c6.464 6.656 13.392 12.848 20.752 18.528l-111.456 111.44z m228.464-103.584c-65.92 0-122.576-40.096-147.056-97.136H768c35.2 0 64-28.8 64-64v-145.776c56.896 24.544 96.88 81.12 96.88 146.912 0 88.224-71.776 160-160 160z"\n fill="#006AFF"\n p-id="1115"\n ></path>\n <path\n d="M864.576 672c0 52.928-43.072 96-96 96v32a128 128 0 0 0 128-128h-32z"\n fill="#34495E"\n p-id="1116"\n ></path>\n </svg>\n ']))):C(Ci||(Ci=$(['<svg\n t="1677801709811"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="1110"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n width="1em"\n height="1em"\n >\n <path\n d="M546.56 704H128c-19.2 0-32-12.8-32-32V256h704v194.56c10.928 1.552 21.648 3.76 32 6.832V128c0-35.2-28.8-64-64-64H128C92.8 64 64 92.8 64 128v544c0 35.2 28.8 64 64 64h425.392a221.936 221.936 0 0 1-6.848-32zM96 128c0-19.2 12.8-32 32-32h640c19.2 0 32 12.8 32 32v96H96V128z"\n fill="currentColor"\n p-id="1111"\n ></path>\n <path\n d="M416 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="currentColor"\n p-id="1112"\n ></path>\n <path\n d="M288 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="currentColor"\n p-id="1113"\n ></path>\n <path\n d="M160 160m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"\n fill="currentColor"\n p-id="1114"\n ></path>\n <path\n d="M382.848 658.928l99.376-370.88 30.912 8.272-99.36 370.88zM318.368 319.2L160 477.6l158.4 158.4 22.64-22.624-135.792-135.776 135.776-135.776zM768 480c-13.088 0-25.888 1.344-38.24 3.84l6.24-6.24-158.4-158.4-22.64 22.624 135.792 135.776-135.776 135.776 22.656 22.624 2.208-2.224a190.768 190.768 0 0 0 30.928 148.08l-116.672 116.656c-10.24 10.24-10.24 26.896 0 37.136l27.76 27.76c5.12 5.12 11.84 7.68 18.56 7.68s13.456-2.56 18.56-7.68l120.992-120.96A190.56 190.56 0 0 0 768 864c105.872 0 192-86.128 192-192s-86.128-192-192-192z m-159.12 193.136c0-88.224 71.776-160 160-160 10.656 0 21.04 1.152 31.12 3.152V672c0 19.2-12.8 32-32 32h-156a160.144 160.144 0 0 1-3.12-30.864z m-68.464 263.584l-19.632-19.632 110.336-110.336c6.464 6.656 13.392 12.848 20.752 18.528l-111.456 111.44z m228.464-103.584c-65.92 0-122.576-40.096-147.056-97.136H768c35.2 0 64-28.8 64-64v-145.776c56.896 24.544 96.88 81.12 96.88 146.912 0 88.224-71.776 160-160 160z"\n fill="currentColor"\n p-id="1115"\n ></path>\n <path\n d="M864.576 672c0 52.928-43.072 96-96 96v32a128 128 0 0 0 128-128h-32z"\n fill="currentColor"\n p-id="1116"\n ></path>\n </svg>']))),ie(r),a=>this.recordMousePosition(a,"nodeTree"),a=>this.recordMousePosition(a,"nodeTree"),C(Ti||(Ti=$(['<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16"\n height="16"\n viewBox="0 0 24 24"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n class="close-icon"\n @click="','"\n >\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>'])),this.removeLayerPanel),ie({pointerEvents:this.dragging?"none":""}),this.nodeTree?this.renderNodeTree(this.nodeTree):"",this.showSettingsModal?C(Mi||(Mi=$(['\n <div\n class="settings-modal-overlay"\n @click="','"\n >\n <div\n class="settings-modal"\n @click="','"\n >\n <div class="settings-modal-header">\n <h3 class="settings-modal-title">Mode Settings</h3>\n <button\n class="settings-modal-close"\n @click="','"\n >\n ×\n </button>\n </div>\n <div class="settings-modal-content">\n ',"\n </div>\n </div>\n </div>\n "])),this.closeSettingsModal,a=>a.stopPropagation(),this.closeSettingsModal,this.features.map(a=>C(Ai||(Ai=$(['\n <div class="settings-item">\n <label class="settings-label">\n <span class="settings-label-text"\n >','</span\n >\n <span class="settings-label-desc"\n >','</span\n >\n </label>\n <label class="settings-switch">\n <input\n type="checkbox"\n .checked="','"\n @change="','"\n />\n <span class="settings-slider"></span>\n </label>\n </div>\n '])),a.label,a.description,a.checked(),a.onChange))):"",ts({showChatModal:this.showChatModal,chatMessages:this.chatMessages,chatInput:this.chatInput,chatLoading:this.chatLoading,chatContext:this.chatContext,currentTools:this.currentTools,chatTheme:this.chatTheme,turnStatus:this.turnStatus,turnDuration:this.turnDuration,isDragging:this.isDragging,chatModel:this.chatModel},{closeChatModal:this.closeChatModal,clearChatMessages:this.clearChatMessages,handleChatInput:this.handleChatInput,handleChatKeyDown:this.handleChatKeyDown,sendChatMessage:this.sendChatMessage,toggleTheme:this.toggleTheme,interruptChat:this.interruptChat,handleDragStart:this.handleChatDragStart,handleDragMove:this.handleChatDragMove,handleDragEnd:this.handleChatDragEnd,handleOverlayClick:this.handleOverlayClick}),this.activeNode.class,ie(s),this.activeNode.content)}}if(x.styles=[Ge(Ei||(Ei=$(["\n .code-inspector-container {\n position: fixed;\n pointer-events: none;\n z-index: 9999999999999;\n font-family: 'PingFang SC';\n .margin-overlay {\n position: absolute;\n inset: 0;\n border-style: solid;\n border-color: rgba(255, 155, 0, 0.3);\n .border-overlay {\n position: absolute;\n inset: 0;\n border-style: solid;\n border-color: rgba(255, 200, 50, 0.3);\n .padding-overlay {\n position: absolute;\n inset: 0;\n border-style: solid;\n border-color: rgba(77, 200, 0, 0.3);\n .content-overlay {\n position: absolute;\n inset: 0;\n background: rgba(120, 170, 210, 0.7);\n }\n }\n }\n }\n }\n .element-info {\n position: absolute;\n }\n .element-info.hidden {\n visibility: hidden;\n }\n .element-info-content {\n max-width: 100%;\n font-size: 12px;\n color: #000;\n background-color: #fff;\n word-break: break-all;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);\n box-sizing: border-box;\n padding: 4px 8px;\n border-radius: 4px;\n }\n .element-info-top {\n top: -4px;\n transform: translateY(-100%);\n }\n .element-info-bottom {\n top: calc(100% + 4px);\n }\n .element-info-top-inner {\n top: 4px;\n }\n .element-info-bottom-inner {\n bottom: 4px;\n }\n .element-info-left {\n left: 0;\n display: flex;\n justify-content: flex-start;\n }\n .element-info-right {\n right: 0;\n display: flex;\n justify-content: flex-end;\n }\n .element-name .element-title {\n color: coral;\n font-weight: bold;\n }\n .path-line {\n color: #333;\n line-height: 12px;\n margin-top: 4px;\n }\n .inspector-switch {\n position: fixed;\n z-index: 9999999999999;\n top: 50%;\n right: 24px;\n font-size: 22px;\n transform: translateY(-100%);\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: rgba(255, 255, 255, 0.8);\n color: #555;\n height: 32px;\n width: 32px;\n border-radius: 50%;\n box-shadow: 0px 1px 2px -2px rgba(0, 0, 0, 0.2),\n 0px 3px 6px 0px rgba(0, 0, 0, 0.16),\n 0px 5px 12px 4px rgba(0, 0, 0, 0.12);\n cursor: pointer;\n }\n .active-inspector-switch {\n color: #006aff;\n }\n .move-inspector-switch {\n cursor: move;\n }\n #inspector-node-tree {\n position: fixed;\n user-select: none;\n z-index: 9999999999999999;\n min-width: 300px;\n max-width: min(max(30vw, 300px), 400px);\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,\n 'Liberation Mono', 'Courier New', monospace;\n display: flex;\n flex-direction: column;\n padding: 0;\n\n .inspector-layer-title {\n border-bottom: 1px solid #eee;\n padding: 8px 8px 4px;\n margin-bottom: 8px;\n flex-shrink: 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: move;\n user-select: none;\n &:hover {\n background: rgba(0, 106, 255, 0.1);\n }\n }\n\n .node-tree-list {\n flex: 1;\n overflow-y: auto;\n min-height: 0;\n }\n\n .inspector-layer {\n cursor: pointer;\n position: relative;\n padding-right: 8px;\n &:hover {\n background: #fdf4bf;\n }\n }\n\n .path-line {\n font-size: 9px;\n color: #777;\n margin-top: 1px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n }\n }\n\n #node-tree-tooltip {\n position: fixed;\n box-sizing: border-box;\n z-index: 999999999999999999;\n background: rgba(0, 0, 0, 0.6);\n color: white;\n padding: 2px 6px;\n border-radius: 4px;\n font-size: 12px;\n white-space: wrap;\n pointer-events: none;\n word-break: break-all;\n }\n .tooltip-top {\n transform: translateY(-100%);\n }\n .close-icon {\n cursor: pointer;\n }\n\n /* 设置弹窗样式 */\n .settings-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 99999999999999999;\n animation: fadeIn 0.2s ease-out;\n }\n\n .settings-modal {\n background: #fff;\n border-radius: 12px;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n width: 90%;\n max-width: 480px;\n max-height: 90vh;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n animation: slideUp 0.3s ease-out;\n }\n\n .settings-modal-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px;\n border-bottom: 1px solid #eee;\n }\n\n .settings-modal-title {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: #333;\n }\n\n .settings-modal-close {\n background: none;\n border: none;\n font-size: 28px;\n color: #999;\n cursor: pointer;\n padding: 0;\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: all 0.2s;\n }\n\n .settings-modal-close:hover {\n background: #f5f5f5;\n color: #333;\n }\n\n .settings-modal-content {\n padding: 16px 24px;\n overflow-y: auto;\n flex: 1;\n }\n\n .settings-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 0;\n border-bottom: 1px solid #f5f5f5;\n }\n\n .settings-item:last-child {\n border-bottom: none;\n }\n\n .settings-label {\n display: flex;\n flex-direction: column;\n flex: 1;\n margin-right: 16px;\n cursor: pointer;\n }\n\n .settings-label-text {\n font-size: 15px;\n font-weight: 500;\n color: #333;\n margin-bottom: 4px;\n }\n\n .settings-label-desc {\n font-size: 13px;\n color: #999;\n }\n\n .settings-switch {\n position: relative;\n display: inline-block;\n width: 44px;\n height: 24px;\n flex-shrink: 0;\n }\n\n .settings-switch input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n .settings-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #ccc;\n transition: 0.3s;\n border-radius: 24px;\n }\n\n .settings-slider:before {\n position: absolute;\n content: '';\n height: 18px;\n width: 18px;\n left: 3px;\n bottom: 3px;\n background-color: white;\n transition: 0.3s;\n border-radius: 50%;\n }\n\n .settings-switch input:checked + .settings-slider {\n background-color: #006aff;\n }\n\n .settings-switch input:checked + .settings-slider:before {\n transform: translateX(20px);\n }\n\n .settings-switch input:focus + .settings-slider {\n box-shadow: 0 0 1px #006aff;\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes slideUp {\n from {\n transform: translateY(20px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n }\n "]))),ns],v([q()],x.prototype,"hotKeys",2),v([q()],x.prototype,"port",2),v([q()],x.prototype,"showSwitch",2),v([q()],x.prototype,"autoToggle",2),v([q()],x.prototype,"hideConsole",2),v([q()],x.prototype,"locate",2),v([q()],x.prototype,"copy",2),v([q()],x.prototype,"target",2),v([q()],x.prototype,"targetNode",2),v([q()],x.prototype,"ip",2),v([q()],x.prototype,"ai",2),v([q()],x.prototype,"modeKey",2),v([q()],x.prototype,"defaultAction",2),v([M()],x.prototype,"position",2),v([M()],x.prototype,"element",2),v([M()],x.prototype,"elementTipStyle",2),v([M()],x.prototype,"show",2),v([M()],x.prototype,"showNodeTree",2),v([M()],x.prototype,"nodeTreePosition",2),v([M()],x.prototype,"nodeTree",2),v([M()],x.prototype,"dragging",2),v([M()],x.prototype,"mousePosition",2),v([M()],x.prototype,"draggingTarget",2),v([M()],x.prototype,"open",2),v([M()],x.prototype,"moved",2),v([M()],x.prototype,"hoverSwitch",2),v([M()],x.prototype,"preUserSelect",2),v([M()],x.prototype,"sendType",2),v([M()],x.prototype,"activeNode",2),v([M()],x.prototype,"showSettingsModal",2),v([M()],x.prototype,"internalLocate",2),v([M()],x.prototype,"internalCopy",2),v([M()],x.prototype,"internalTarget",2),v([M()],x.prototype,"internalAI",2),v([M()],x.prototype,"showChatModal",2),v([M()],x.prototype,"chatMessages",2),v([M()],x.prototype,"chatInput",2),v([M()],x.prototype,"chatLoading",2),v([M()],x.prototype,"chatContext",2),v([M()],x.prototype,"currentTools",2),v([M()],x.prototype,"chatTheme",2),v([M()],x.prototype,"turnStatus",2),v([M()],x.prototype,"turnDuration",2),v([M()],x.prototype,"chatModel",2),v([M()],x.prototype,"isDragging",2),v([_e("#inspector-switch")],x.prototype,"inspectorSwitchRef",2),v([_e("#code-inspector-container")],x.prototype,"codeInspectorContainerRef",2),v([_e("#element-info")],x.prototype,"elementInfoRef",2),v([_e("#inspector-node-tree")],x.prototype,"nodeTreeRef",2),v([_e(".inspector-layer-title")],x.prototype,"nodeTreeTitleRef",2),v([_e("#node-tree-tooltip")],x.prototype,"nodeTreeTooltipRef",2),!document.getElementById("code-inspector-notification-styles")){const n=document.createElement("style");n.id="code-inspector-notification-styles",n.textContent="\n .code-inspector-notification {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 99999999999999999;\n padding: 12px 16px;\n border-radius: 8px;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-weight: 500;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n opacity: 0;\n transform: translateY(-10px);\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n pointer-events: none;\n }\n .code-inspector-notification-success {\n background: hsl(143, 85%, 96%);\n color: hsl(140, 100%, 27%);\n border: 1px solid hsl(145, 92%, 91%);\n }\n .code-inspector-notification-error {\n background: hsl(0, 93%, 94%);\n color: hsl(0, 84%, 40%);\n border: 1px solid hsl(0, 93%, 94%);\n }\n .code-inspector-notification-show {\n opacity: 1;\n transform: translateY(0);\n }\n ",document.head.appendChild(n)}customElements.get("code-inspector-component")||customElements.define("code-inspector-component",x),R.CodeInspectorComponent=x,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|