shopify-theme-devtools 2.0.0 → 2.1.0

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.
@@ -1,4 +1,4 @@
1
- var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,__publicField=(t,e,a)=>__defNormalProp(t,"symbol"!=typeof e?e+"":e,a);!function(){"use strict";var t;const e=globalThis,a=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new WeakMap;let o=class{constructor(t,e,a){if(this._$cssResult$=!0,a!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(a&&void 0===t){const a=void 0!==e&&1===e.length;a&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),a&&s.set(e,t))}return t}toString(){return this.cssText}};const r=(t,...e)=>{const a=1===t.length?t[0]:e.reduce((e,a,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+t[i+1],t[0]);return new o(a,t,i)},n=a?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const a of t.cssRules)e+=a.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,i))(e)})(t):t,{is:l,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:p,getOwnPropertySymbols:h,getPrototypeOf:u}=Object,v=globalThis,g=v.trustedTypes,m=g?g.emptyScript:"",b=v.reactiveElementPolyfillSupport,f=(t,e)=>t,x={toAttribute(t,e){switch(e){case Boolean:t=t?m:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let a=t;switch(e){case Boolean:a=null!==t;break;case Number:a=null===t?null:Number(t);break;case Object:case Array:try{a=JSON.parse(t)}catch(i){a=null}}return a}},_=(t,e)=>!l(t,e),y={attribute:!0,type:String,converter:x,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),v.litPropertyMetadata??(v.litPropertyMetadata=new WeakMap);let w=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=y){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const a=Symbol(),i=this.getPropertyDescriptor(t,a,e);void 0!==i&&d(this.prototype,t,i)}}static getPropertyDescriptor(t,e,a){const{get:i,set:s}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const o=null==i?void 0:i.call(this);null==s||s.call(this,e),this.requestUpdate(t,o,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(f("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(f("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(f("properties"))){const t=this.properties,e=[...p(t),...h(t)];for(const a of e)this.createProperty(a,t[a])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,a]of e)this.elementProperties.set(t,a)}this._$Eh=new Map;for(const[e,a]of this.elementProperties){const t=this._$Eu(e,a);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const a=new Set(t.flat(1/0).reverse());for(const t of a)e.unshift(n(t))}else void 0!==t&&e.push(n(t));return e}static _$Eu(t,e){const a=e.attribute;return!1===a?void 0:"string"==typeof a?a:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach(t=>t(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const a of e.keys())this.hasOwnProperty(a)&&(t.set(a,this[a]),delete this[a]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{if(a)t.adoptedStyleSheets=i.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const a of i){const i=document.createElement("style"),s=e.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=a.cssText,t.appendChild(i)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)})}attributeChangedCallback(t,e,a){this._$AK(t,a)}_$ET(t,e){var a;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==(null==(a=i.converter)?void 0:a.toAttribute)?i.converter:x).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var a,i;const s=this.constructor,o=s._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=s.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(a=t.converter)?void 0:a.fromAttribute)?t.converter:x;this._$Em=o;const n=r.fromAttribute(e,t.type);this[o]=n??(null==(i=this._$Ej)?void 0:i.get(o))??n,this._$Em=null}}requestUpdate(t,e,a,i=!1,s){var o;if(void 0!==t){const r=this.constructor;if(!1===i&&(s=this[t]),a??(a=r.getPropertyOptions(t)),!((a.hasChanged??_)(s,e)||a.useDefault&&a.reflect&&s===(null==(o=this._$Ej)?void 0:o.get(t))&&!this.hasAttribute(r._$Eu(t,a))))return;this.C(t,e,a)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:a,reflect:i,wrapped:s},o){a&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==s||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||a||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,a]of t){const{wrapped:t}=a,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,a,i)}}let e=!1;const a=this._$AL;try{e=this.shouldUpdate(a),e?(this.willUpdate(a),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(a)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(a)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach(t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[f("elementProperties")]=new Map,w[f("finalized")]=new Map,null==b||b({ReactiveElement:w}),(v.reactiveElementVersions??(v.reactiveElementVersions=[])).push("2.1.2");const k=globalThis,$=t=>t,S=k.trustedTypes,C=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,A="?"+E,O=`<${A}>`,P=document,z=()=>P.createComment(""),L=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,I="[ \t\n\f\r]",N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,F=/>/g,D=RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,M=/"/g,H=/^(?:script|style|textarea|title)$/i,U=(K=1,(t,...e)=>({_$litType$:K,strings:t,values:e})),G=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),V=new WeakMap,J=P.createTreeWalker(P,129);var K;function W(t,e){if(!j(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(e):e}class Y{constructor({strings:t,_$litType$:e},a){let i;this.parts=[];let s=0,o=0;const r=t.length-1,n=this.parts,[l,d]=((t,e)=>{const a=t.length-1,i=[];let s,o=2===e?"<svg>":3===e?"<math>":"",r=N;for(let n=0;n<a;n++){const e=t[n];let a,l,d=-1,c=0;for(;c<e.length&&(r.lastIndex=c,l=r.exec(e),null!==l);)c=r.lastIndex,r===N?"!--"===l[1]?r=R:void 0!==l[1]?r=F:void 0!==l[2]?(H.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=D):void 0!==l[3]&&(r=D):r===D?">"===l[0]?(r=s??N,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?D:'"'===l[3]?M:q):r===M||r===q?r=D:r===R||r===F?r=N:(r=D,s=void 0);const p=r===D&&t[n+1].startsWith("/>")?" ":"";o+=r===N?e+O:d>=0?(i.push(a),e.slice(0,d)+T+e.slice(d)+E+p):e+E+(-2===d?n:p)}return[W(t,o+(t[a]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]})(t,e);if(this.el=Y.createElement(l,a),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=J.nextNode())&&n.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(T)){const e=d[o++],a=i.getAttribute(t).split(E),r=/([.?@])?(.*)/.exec(e);n.push({type:1,index:s,name:r[2],strings:a,ctor:"."===r[1]?et:"?"===r[1]?at:"@"===r[1]?it:tt}),i.removeAttribute(t)}else t.startsWith(E)&&(n.push({type:6,index:s}),i.removeAttribute(t));if(H.test(i.tagName)){const t=i.textContent.split(E),e=t.length-1;if(e>0){i.textContent=S?S.emptyScript:"";for(let a=0;a<e;a++)i.append(t[a],z()),J.nextNode(),n.push({type:2,index:++s});i.append(t[e],z())}}}else if(8===i.nodeType)if(i.data===A)n.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(E,t+1));)n.push({type:7,index:s}),t+=E.length-1}s++}}static createElement(t,e){const a=P.createElement("template");return a.innerHTML=t,a}}function Q(t,e,a=t,i){var s,o;if(e===G)return e;let r=void 0!==i?null==(s=a._$Co)?void 0:s[i]:a._$Cl;const n=L(e)?void 0:e._$litDirective$;return(null==r?void 0:r.constructor)!==n&&(null==(o=null==r?void 0:r._$AO)||o.call(r,!1),void 0===n?r=void 0:(r=new n(t),r._$AT(t,a,i)),void 0!==i?(a._$Co??(a._$Co=[]))[i]=r:a._$Cl=r),void 0!==r&&(e=Q(t,r._$AS(t,e.values),r,i)),e}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:a}=this._$AD,i=((null==t?void 0:t.creationScope)??P).importNode(e,!0);J.currentNode=i;let s=J.nextNode(),o=0,r=0,n=a[0];for(;void 0!==n;){if(o===n.index){let e;2===n.type?e=new Z(s,s.nextSibling,this,t):1===n.type?e=new n.ctor(s,n.name,n.strings,this,t):6===n.type&&(e=new st(s,this,t)),this._$AV.push(e),n=a[++r]}o!==(null==n?void 0:n.index)&&(s=J.nextNode(),o++)}return J.currentNode=P,i}p(t){let e=0;for(const a of this._$AV)void 0!==a&&(void 0!==a.strings?(a._$AI(t,a,e),e+=a.strings.length-2):a._$AI(t[e])),e++}}class Z{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,a,i){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=a,this.options=i,this._$Cv=(null==i?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),L(t)?t===B||null==t||""===t?(this._$AH!==B&&this._$AR(),this._$AH=B):t!==this._$AH&&t!==G&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>j(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==B&&L(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){var e;const{values:a,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Y.createElement(W(i.h,i.h[0]),this.options)),i);if((null==(e=this._$AH)?void 0:e._$AD)===s)this._$AH.p(a);else{const t=new X(s,this),e=t.u(this.options);t.p(a),this.T(e),this._$AH=t}}_$AC(t){let e=V.get(t.strings);return void 0===e&&V.set(t.strings,e=new Y(t)),e}k(t){j(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let a,i=0;for(const s of t)i===e.length?e.push(a=new Z(this.O(z()),this.O(z()),this,this.options)):a=e[i],a._$AI(s),i++;i<e.length&&(this._$AR(a&&a._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var a;for(null==(a=this._$AP)||a.call(this,!1,!0,e);t!==this._$AB;){const e=$(t).nextSibling;$(t).remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,a,i,s){this.type=1,this._$AH=B,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,a.length>2||""!==a[0]||""!==a[1]?(this._$AH=Array(a.length-1).fill(new String),this.strings=a):this._$AH=B}_$AI(t,e=this,a,i){const s=this.strings;let o=!1;if(void 0===s)t=Q(this,t,e,0),o=!L(t)||t!==this._$AH&&t!==G,o&&(this._$AH=t);else{const i=t;let r,n;for(t=s[0],r=0;r<s.length-1;r++)n=Q(this,i[a+r],e,r),n===G&&(n=this._$AH[r]),o||(o=!L(n)||n!==this._$AH[r]),n===B?t=B:t!==B&&(t+=(n??"")+s[r+1]),this._$AH[r]=n}o&&!i&&this.j(t)}j(t){t===B?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===B?void 0:t}}class at extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==B)}}class it extends tt{constructor(t,e,a,i,s){super(t,e,a,i,s),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??B)===G)return;const a=this._$AH,i=t===B&&a!==B||t.capture!==a.capture||t.once!==a.once||t.passive!==a.passive,s=t!==B&&(a===B||i);i&&this.element.removeEventListener(this.name,this,a),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class st{constructor(t,e,a){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=a}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const ot=k.litHtmlPolyfillSupport;null==ot||ot(Y,Z),(k.litHtmlVersions??(k.litHtmlVersions=[])).push("3.3.2");const rt=globalThis;class nt extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,a)=>{const i=(null==a?void 0:a.renderBefore)??e;let s=i._$litPart$;if(void 0===s){const t=(null==a?void 0:a.renderBefore)??null;i._$litPart$=s=new Z(e.insertBefore(z(),t),t,void 0,a??{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return G}}nt._$litElement$=!0,nt.finalized=!0,null==(t=rt.litElementHydrateSupport)||t.call(rt,{LitElement:nt});const lt=rt.litElementPolyfillSupport;null==lt||lt({LitElement:nt}),(rt.litElementVersions??(rt.litElementVersions=[])).push("4.2.2");const dt={dark:{"--tdt-bg":"#1a1a1a","--tdt-bg-secondary":"#242424","--tdt-bg-hover":"#2a2a2a","--tdt-border":"#333","--tdt-text":"#e0e0e0","--tdt-text-muted":"#888","--tdt-accent":"#3b82f6","--tdt-accent-hover":"#2563eb","--tdt-success":"#22c55e","--tdt-warning":"#eab308","--tdt-error":"#ef4444","--tdt-danger":"#ef4444","--tdt-string":"#a5d6ff","--tdt-number":"#79c0ff","--tdt-boolean":"#ff7b72","--tdt-null":"#888","--tdt-key":"#c792ea"},light:{"--tdt-bg":"#ffffff","--tdt-bg-secondary":"#f5f5f5","--tdt-bg-hover":"#ebebeb","--tdt-border":"#e0e0e0","--tdt-text":"#1a1a1a","--tdt-text-muted":"#666","--tdt-accent":"#2563eb","--tdt-accent-hover":"#1d4ed8","--tdt-success":"#16a34a","--tdt-warning":"#ca8a04","--tdt-error":"#dc2626","--tdt-danger":"#dc2626","--tdt-string":"#0969da","--tdt-number":"#0550ae","--tdt-boolean":"#cf222e","--tdt-null":"#666","--tdt-key":"#8250df"}},ct={small:.9,medium:1,large:1.15},pt=r`
1
+ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,__publicField=(t,e,i)=>__defNormalProp(t,"symbol"!=typeof e?e+"":e,i);!function(){"use strict";var t;const e=globalThis,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),a=new WeakMap;let r=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&a.set(e,t))}return t}toString(){return this.cssText}};const n=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new r(i,t,s)},o=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,s))(e)})(t):t,{is:l,defineProperty:c,getOwnPropertyDescriptor:d,getOwnPropertyNames:p,getOwnPropertySymbols:h,getPrototypeOf:u}=Object,g=globalThis,v=g.trustedTypes,m=v?v.emptyScript:"",f=g.reactiveElementPolyfillSupport,b=(t,e)=>t,y={toAttribute(t,e){switch(e){case Boolean:t=t?m:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(s){i=null}}return i}},x=(t,e)=>!l(t,e),_={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),g.litPropertyMetadata??(g.litPropertyMetadata=new WeakMap);let w=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=_){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&c(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:a}=d(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const r=null==s?void 0:s.call(this);null==a||a.call(this,e),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...p(t),...h(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const t=this._$Eu(e,i);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach(t=>t(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,s)=>{if(i)t.adoptedStyleSheets=s.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of s){const s=document.createElement("style"),a=e.litNonce;void 0!==a&&s.setAttribute("nonce",a),s.textContent=i.cssText,t.appendChild(s)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){var i;const s=this.constructor.elementProperties.get(t),a=this.constructor._$Eu(t,s);if(void 0!==a&&!0===s.reflect){const r=(void 0!==(null==(i=s.converter)?void 0:i.toAttribute)?s.converter:y).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(a):this.setAttribute(a,r),this._$Em=null}}_$AK(t,e){var i,s;const a=this.constructor,r=a._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=a.getPropertyOptions(r),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(i=t.converter)?void 0:i.fromAttribute)?t.converter:y;this._$Em=r;const o=n.fromAttribute(e,t.type);this[r]=o??(null==(s=this._$Ej)?void 0:s.get(r))??o,this._$Em=null}}requestUpdate(t,e,i,s=!1,a){var r;if(void 0!==t){const n=this.constructor;if(!1===s&&(a=this[t]),i??(i=n.getPropertyOptions(t)),!((i.hasChanged??x)(a,e)||i.useDefault&&i.reflect&&a===(null==(r=this._$Ej)?void 0:r.get(t))&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:a},r){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==a||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(i)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach(t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[b("elementProperties")]=new Map,w[b("finalized")]=new Map,null==f||f({ReactiveElement:w}),(g.reactiveElementVersions??(g.reactiveElementVersions=[])).push("2.1.2");const k=globalThis,$=t=>t,S=k.trustedTypes,T=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,A="?"+E,O=`<${A}>`,L=document,z=()=>L.createComment(""),j=t=>null===t||"object"!=typeof t&&"function"!=typeof t,P=Array.isArray,F="[ \t\n\f\r]",I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,N=/>/g,D=RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,M=/"/g,H=/^(?:script|style|textarea|title)$/i,U=(K=1,(t,...e)=>({_$litType$:K,strings:t,values:e})),V=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),G=new WeakMap,J=L.createTreeWalker(L,129);var K;function W(t,e){if(!P(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==T?T.createHTML(e):e}class Y{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let a=0,r=0;const n=t.length-1,o=this.parts,[l,c]=((t,e)=>{const i=t.length-1,s=[];let a,r=2===e?"<svg>":3===e?"<math>":"",n=I;for(let o=0;o<i;o++){const e=t[o];let i,l,c=-1,d=0;for(;d<e.length&&(n.lastIndex=d,l=n.exec(e),null!==l);)d=n.lastIndex,n===I?"!--"===l[1]?n=R:void 0!==l[1]?n=N:void 0!==l[2]?(H.test(l[2])&&(a=RegExp("</"+l[2],"g")),n=D):void 0!==l[3]&&(n=D):n===D?">"===l[0]?(n=a??I,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,i=l[1],n=void 0===l[3]?D:'"'===l[3]?M:q):n===M||n===q?n=D:n===R||n===N?n=I:(n=D,a=void 0);const p=n===D&&t[o+1].startsWith("/>")?" ":"";r+=n===I?e+O:c>=0?(s.push(i),e.slice(0,c)+C+e.slice(c)+E+p):e+E+(-2===c?o:p)}return[W(t,r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=Y.createElement(l,i),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=J.nextNode())&&o.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(C)){const e=c[r++],i=s.getAttribute(t).split(E),n=/([.?@])?(.*)/.exec(e);o.push({type:1,index:a,name:n[2],strings:i,ctor:"."===n[1]?et:"?"===n[1]?it:"@"===n[1]?st:tt}),s.removeAttribute(t)}else t.startsWith(E)&&(o.push({type:6,index:a}),s.removeAttribute(t));if(H.test(s.tagName)){const t=s.textContent.split(E),e=t.length-1;if(e>0){s.textContent=S?S.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],z()),J.nextNode(),o.push({type:2,index:++a});s.append(t[e],z())}}}else if(8===s.nodeType)if(s.data===A)o.push({type:2,index:a});else{let t=-1;for(;-1!==(t=s.data.indexOf(E,t+1));)o.push({type:7,index:a}),t+=E.length-1}a++}}static createElement(t,e){const i=L.createElement("template");return i.innerHTML=t,i}}function Q(t,e,i=t,s){var a,r;if(e===V)return e;let n=void 0!==s?null==(a=i._$Co)?void 0:a[s]:i._$Cl;const o=j(e)?void 0:e._$litDirective$;return(null==n?void 0:n.constructor)!==o&&(null==(r=null==n?void 0:n._$AO)||r.call(n,!1),void 0===o?n=void 0:(n=new o(t),n._$AT(t,i,s)),void 0!==s?(i._$Co??(i._$Co=[]))[s]=n:i._$Cl=n),void 0!==n&&(e=Q(t,n._$AS(t,e.values),n,s)),e}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((null==t?void 0:t.creationScope)??L).importNode(e,!0);J.currentNode=s;let a=J.nextNode(),r=0,n=0,o=i[0];for(;void 0!==o;){if(r===o.index){let e;2===o.type?e=new Z(a,a.nextSibling,this,t):1===o.type?e=new o.ctor(a,o.name,o.strings,this,t):6===o.type&&(e=new at(a,this,t)),this._$AV.push(e),o=i[++n]}r!==(null==o?void 0:o.index)&&(a=J.nextNode(),r++)}return J.currentNode=L,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Z{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(null==s?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),j(t)?t===B||null==t||""===t?(this._$AH!==B&&this._$AR(),this._$AH=B):t!==this._$AH&&t!==V&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>P(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==B&&j(this._$AH)?this._$AA.nextSibling.data=t:this.T(L.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:s}=t,a="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Y.createElement(W(s.h,s.h[0]),this.options)),s);if((null==(e=this._$AH)?void 0:e._$AD)===a)this._$AH.p(i);else{const t=new X(a,this),e=t.u(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new Y(t)),e}k(t){P(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const a of t)s===e.length?e.push(i=new Z(this.O(z()),this.O(z()),this,this.options)):i=e[s],i._$AI(a),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null==(i=this._$AP)||i.call(this,!1,!0,e);t!==this._$AB;){const e=$(t).nextSibling;$(t).remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,a){this.type=1,this._$AH=B,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=a,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=B}_$AI(t,e=this,i,s){const a=this.strings;let r=!1;if(void 0===a)t=Q(this,t,e,0),r=!j(t)||t!==this._$AH&&t!==V,r&&(this._$AH=t);else{const s=t;let n,o;for(t=a[0],n=0;n<a.length-1;n++)o=Q(this,s[i+n],e,n),o===V&&(o=this._$AH[n]),r||(r=!j(o)||o!==this._$AH[n]),o===B?t=B:t!==B&&(t+=(o??"")+a[n+1]),this._$AH[n]=o}r&&!s&&this.j(t)}j(t){t===B?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===B?void 0:t}}class it extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==B)}}class st extends tt{constructor(t,e,i,s,a){super(t,e,i,s,a),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??B)===V)return;const i=this._$AH,s=t===B&&i!==B||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==B&&(i===B||s);s&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class at{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const rt=k.litHtmlPolyfillSupport;null==rt||rt(Y,Z),(k.litHtmlVersions??(k.litHtmlVersions=[])).push("3.3.2");const nt=globalThis;class ot extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const s=(null==i?void 0:i.renderBefore)??e;let a=s._$litPart$;if(void 0===a){const t=(null==i?void 0:i.renderBefore)??null;s._$litPart$=a=new Z(e.insertBefore(z(),t),t,void 0,i??{})}return a._$AI(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return V}}ot._$litElement$=!0,ot.finalized=!0,null==(t=nt.litElementHydrateSupport)||t.call(nt,{LitElement:ot});const lt=nt.litElementPolyfillSupport;null==lt||lt({LitElement:ot}),(nt.litElementVersions??(nt.litElementVersions=[])).push("4.2.2");const ct={dark:{"--tdt-bg":"#1a1a1a","--tdt-bg-secondary":"#242424","--tdt-bg-hover":"#2a2a2a","--tdt-border":"#333","--tdt-text":"#e0e0e0","--tdt-text-muted":"#888","--tdt-accent":"#3b82f6","--tdt-accent-hover":"#2563eb","--tdt-success":"#22c55e","--tdt-warning":"#eab308","--tdt-error":"#ef4444","--tdt-danger":"#ef4444","--tdt-string":"#a5d6ff","--tdt-number":"#79c0ff","--tdt-boolean":"#ff7b72","--tdt-null":"#888","--tdt-key":"#c792ea"},light:{"--tdt-bg":"#ffffff","--tdt-bg-secondary":"#f5f5f5","--tdt-bg-hover":"#ebebeb","--tdt-border":"#e0e0e0","--tdt-text":"#1a1a1a","--tdt-text-muted":"#666","--tdt-accent":"#2563eb","--tdt-accent-hover":"#1d4ed8","--tdt-success":"#16a34a","--tdt-warning":"#ca8a04","--tdt-error":"#dc2626","--tdt-danger":"#dc2626","--tdt-string":"#0969da","--tdt-number":"#0550ae","--tdt-boolean":"#cf222e","--tdt-null":"#666","--tdt-key":"#8250df"}},dt={small:.9,medium:1,large:1.15},pt=n`
2
2
  :host {
3
3
  /* Inherit all CSS custom properties from parent */
4
4
  font-family: var(--tdt-font);
@@ -106,7 +106,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
106
106
  outline: none;
107
107
  border-color: var(--tdt-accent);
108
108
  }
109
- `,ht=r`
109
+ `,ht=n`
110
110
  :host {
111
111
  /* Default dark theme - will be overridden by JS */
112
112
  --tdt-bg: #1a1a1a;
@@ -141,35 +141,35 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
141
141
  *, *::before, *::after {
142
142
  box-sizing: border-box;
143
143
  }
144
- `;const ut=new class{constructor(){this.context=null}parse(){const t=document.getElementById("__THEME_DEVTOOLS_CONTEXT__");if(!t)return console.warn("[Theme Devtools] Context element not found"),null;try{return this.context=JSON.parse(t.textContent),this.context}catch(e){return console.error("[Theme Devtools] Failed to parse context:",e),null}}get(t){if(this.context)return t.split(".").reduce((t,e)=>null==t?void 0:t[e],this.context)}getMeta(){var t;return(null==(t=this.context)?void 0:t.meta)||{}}getObjects(){var t;return(null==(t=this.context)?void 0:t.objects)||{}}};function vt(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}const gt=class t{constructor(){this.listeners=new Set,this.currentCart=null,this.cartHistory=[],this.pollInterval=null,this._isRestoring=!1,this._restoreEndTime=0,this._loadPersistedHistory()}startRestore(){this._isRestoring=!0}endRestore(t=null){this._isRestoring=!1,this._restoreEndTime=Date.now()+500,t&&(this.currentCart=t)}isRestoring(){return this._isRestoring||Date.now()<this._restoreEndTime}_loadPersistedHistory(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);e&&(this.cartHistory=JSON.parse(e))}catch(e){console.warn("[Theme Devtools] Failed to load cart history:",e)}}_persistHistory(){try{const e=this.cartHistory.slice(-50);sessionStorage.setItem(t.STORAGE_KEY,JSON.stringify(e))}catch(e){}}cartsEqual(t,e){var a,i,s,o;if(!t||!e)return!1;if(t.item_count!==e.item_count)return!1;if(t.total_price!==e.total_price)return!1;if((t.note||"")!==(e.note||""))return!1;if(JSON.stringify(t.attributes||{})!==JSON.stringify(e.attributes||{}))return!1;const r=t.items||[],n=e.items||[];if(r.length!==n.length)return!1;for(let l=0;l<r.length;l++){const t=r[l],e=n[l];if(t.variant_id!==e.variant_id)return!1;if(t.quantity!==e.quantity)return!1;if(JSON.stringify(t.properties||{})!==JSON.stringify(e.properties||{}))return!1;if((null==(i=null==(a=t.selling_plan_allocation)?void 0:a.selling_plan)?void 0:i.id)!==(null==(o=null==(s=e.selling_plan_allocation)?void 0:s.selling_plan)?void 0:o.id))return!1}return!0}async fetch(){try{const t=await fetch("/cart.js",{headers:{Accept:"application/json"}});return await t.json()}catch(t){return console.error("[Theme Devtools] Cart fetch failed:",t),null}}async update(t){try{const e=await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({updates:t})}),a=await e.json();return this.setCart(a),a}catch(e){return console.error("[Theme Devtools] Cart update failed:",e),null}}async change(t,e){try{const a=await fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({line:t,quantity:e})}),i=await a.json();return this.setCart(i),i}catch(a){return console.error("[Theme Devtools] Cart change failed:",a),null}}async clear(){try{const t=await fetch("/cart/clear.js",{method:"POST",headers:{Accept:"application/json"}}),e=await t.json();return this.setCart(e),e}catch(t){return console.error("[Theme Devtools] Cart clear failed:",t),null}}setCart(t){const e=this.currentCart;if(this.currentCart=t,this.isRestoring())this.notify(t,e);else if(e&&this.cartsEqual(e,t))this.notify(t,e);else{if(e){const a=this.cartHistory[this.cartHistory.length-1];a&&this.cartsEqual(a.snapshot,e)||(this.cartHistory.push({timestamp:Date.now(),diff:this.diffCart(e,t),snapshot:vt(e)}),this.cartHistory.length>50&&this.cartHistory.shift(),this._persistHistory())}this.notify(t,e)}}diffCart(t,e){const a={itemCount:{old:(null==t?void 0:t.item_count)||0,new:(null==e?void 0:e.item_count)||0},totalPrice:{old:(null==t?void 0:t.total_price)||0,new:(null==e?void 0:e.total_price)||0},items:{added:[],removed:[],modified:[]},noteChanged:((null==t?void 0:t.note)||"")!==((null==e?void 0:e.note)||""),attributesChanged:JSON.stringify((null==t?void 0:t.attributes)||{})!==JSON.stringify((null==e?void 0:e.attributes)||{}),discountChanged:JSON.stringify((null==t?void 0:t.discount_codes)||[])!==JSON.stringify((null==e?void 0:e.discount_codes)||[])},i=new Map(((null==t?void 0:t.items)||[]).map(t=>[t.key,t])),s=new Map(((null==e?void 0:e.items)||[]).map(t=>[t.key,t]));return s.forEach((t,e)=>{const s=i.get(e);s?s.quantity!==t.quantity&&a.items.modified.push({item:t,oldQuantity:s.quantity,newQuantity:t.quantity}):a.items.added.push(t)}),i.forEach((t,e)=>{s.has(e)||a.items.removed.push(t)}),a}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(t,e){this.listeners.forEach(a=>{try{a(t,e)}catch(i){console.error("[Theme Devtools] Cart listener error:",i)}})}startPolling(t=2e3){if(this.pollInterval)return;const e=async()=>{const t=await this.fetch();t&&JSON.stringify(t)!==JSON.stringify(this.currentCart)&&this.setCart(t)};e(),this.pollInterval=setInterval(e,t)}stopPolling(){this.pollInterval&&(clearInterval(this.pollInterval),this.pollInterval=null)}interceptAjax(){const t=this,e=window.fetch;window.fetch=async function(a,i){const s=await e.apply(this,arguments);if("string"==typeof a&&a.includes("/cart"))try{const e=s.clone(),a=await e.json();a&&void 0!==a.item_count&&(t.isRestoring()?(t.currentCart=a,t.notify(a,null)):setTimeout(()=>t.setCart(a),0))}catch{}return s};const a=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(e,i){return"string"==typeof i&&i.includes("/cart")&&this.addEventListener("load",function(){try{const e=JSON.parse(this.responseText);e&&void 0!==e.item_count&&(t.isRestoring()?(t.currentCart=e,t.notify(e,null)):setTimeout(()=>t.setCart(e),0))}catch{}}),a.apply(this,arguments)}}};__publicField(gt,"STORAGE_KEY","tdt-cart-history");const mt=new gt;const bt=new class{constructor(){this.overlay=null,this.currentSection=null}init(){this.overlay=document.createElement("div"),this.overlay.className="tdt-section-overlay",Object.assign(this.overlay.style,{position:"fixed",pointerEvents:"none",border:"2px solid #3b82f6",backgroundColor:"rgba(59, 130, 246, 0.1)",zIndex:"2147483646",display:"none",transition:"all 0.2s ease"}),document.body.appendChild(this.overlay)}findSections(){const t=[];Array.from(document.querySelectorAll('[id^="shopify-section-"]')).forEach(e=>{var a;const i=e.id.replace("shopify-section-",""),s=e.dataset.sectionType||(null==(a=e.className.match(/section-(\w+)/))?void 0:a[1])||"unknown",o=Array.from(e.querySelectorAll('[data-block-id], [id*="block"]'));t.push({id:i,type:s,element:e,blockCount:o.length,rect:e.getBoundingClientRect()})});return Array.from(document.querySelectorAll("[data-section-id]")).forEach(e=>{const a=e.dataset.sectionId;if(!t.find(t=>t.id===a)){const i=e.dataset.sectionType||"unknown",s=Array.from(e.querySelectorAll("[data-block-id]"));t.push({id:a,type:i,element:e,blockCount:s.length,rect:e.getBoundingClientRect()})}}),t}highlight(t){const e=this.findSections().find(e=>e.id===t);if(!e||!e.element)return void this.hide();const a=e.element.getBoundingClientRect();Object.assign(this.overlay.style,{display:"block",top:`${a.top}px`,left:`${a.left}px`,width:`${a.width}px`,height:`${a.height}px`}),this.currentSection=t,e.element.scrollIntoView({behavior:"smooth",block:"center"})}hide(){this.overlay&&(this.overlay.style.display="none"),this.currentSection=null}destroy(){this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)}},ft={theme:"dark",fontSize:"medium",defaultTab:"objects",panelHeight:"50",panelPosition:"bottom",persistAcrossSessions:!0,keyboardShortcut:{key:"D",ctrl:!0,shift:!0,alt:!1,meta:!1}},xt=class t{constructor(){this._settings={...ft},this._listeners=new Set,this._load()}getAll(){return{...this._settings}}get(t){return this._settings[t]}set(t,e){const a=this._settings[t];this._settings[t]=e,this._save(),this._notify(t,e,a)}setMultiple(t){const e={};for(const[a,i]of Object.entries(t))this._settings[a]!==i&&(e[a]={old:this._settings[a],new:i},this._settings[a]=i);this._save();for(const[a,{old:i,new:s}]of Object.entries(e))this._notify(a,s,i)}reset(){this._settings={...ft},this._save(),this._notify("*",this._settings,null)}subscribe(t){return this._listeners.add(t),()=>this._listeners.delete(t)}getStorage(){return this._settings.persistAcrossSessions?localStorage:sessionStorage}matchesShortcut(t){const e=this._settings.keyboardShortcut,a=t.key.toUpperCase()===e.key.toUpperCase(),i=t.ctrlKey===e.ctrl,s=t.shiftKey===e.shift,o=t.altKey===e.alt,r=t.metaKey===e.meta;return navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.ctrl&&!e.meta?a&&(i||t.metaKey)&&s&&o:a&&i&&s&&o&&r}formatShortcut(){const t=this._settings.keyboardShortcut,e=navigator.platform.toUpperCase().indexOf("MAC")>=0,a=[];return t.ctrl&&a.push(e?"⌃":"Ctrl"),t.meta&&a.push(e?"⌘":"Win"),t.alt&&a.push(e?"⌥":"Alt"),t.shift&&a.push(e?"⇧":"Shift"),a.push(t.key.toUpperCase()),a.join(e?"":"+")}_load(){try{let e=localStorage.getItem(t.STORAGE_KEY);if(e||(e=sessionStorage.getItem(t.STORAGE_KEY)),e){const t=JSON.parse(e);this._settings={...ft,...t}}}catch(e){console.warn("[Theme Devtools] Failed to load settings:",e)}}_save(){try{const e=JSON.stringify(this._settings);this._settings.persistAcrossSessions?(localStorage.setItem(t.STORAGE_KEY,e),sessionStorage.removeItem(t.STORAGE_KEY)):(sessionStorage.setItem(t.STORAGE_KEY,e),localStorage.removeItem(t.STORAGE_KEY))}catch(e){console.warn("[Theme Devtools] Failed to save settings:",e)}}_notify(t,e,a){this._listeners.forEach(i=>{try{i(t,e,a)}catch(s){console.error("[Theme Devtools] Settings listener error:",s)}})}};__publicField(xt,"STORAGE_KEY","tdt-settings");const _t=new xt;class yt extends nt{constructor(){super(),this.data=null,this.path="",this.expanded=new Set,this.searchQuery="",this.forceExpandAll=!1,this._matchingPaths=new Set,this._lastForceExpandAll=!1}updated(t){(t.has("searchQuery")||t.has("data"))&&this._updateMatchingPaths(),t.has("forceExpandAll")&&(this.forceExpandAll&&!this._lastForceExpandAll?this._expandAllPaths():!this.forceExpandAll&&this._lastForceExpandAll&&(this.expanded=new Set),this._lastForceExpandAll=this.forceExpandAll)}_expandAllPaths(){const t=new Set;this._collectAllPaths(this.data,this.path,t),this.expanded=t}_collectAllPaths(t,e,a){if(null==t)return;if(!this._isExpandable(t))return;let i;a.add(e);try{i=Object.entries(t)}catch{return}for(const[s,o]of i){const t=e?`${e}.${s}`:s;this._collectAllPaths(o,t,a)}}_updateMatchingPaths(){const t=(this.searchQuery||"").toLowerCase().trim();if(!t||!this.data)return this._matchingPaths=new Set,void this._dispatchMatchCount(0);const e=new Set;if(this._findMatches(this.data,this.path,t,e),this._matchingPaths=e,this._dispatchMatchCount(e.size),e.size>0){const t=new Set(this.expanded);for(const a of e){const e=a.split(".");let i="";for(let a=0;a<e.length-1;a++)i=i?`${i}.${e[a]}`:e[a],t.add(i)}this.expanded=t}}_dispatchMatchCount(t){this.dispatchEvent(new CustomEvent("match-count-changed",{detail:{count:t},bubbles:!0,composed:!0}))}_findMatches(t,e,a,i){if(null==t)return;const s=this._getType(t);if("object"!==s&&"array"!==s){return void(String(t).toLowerCase().includes(a)&&i.add(e))}let o;try{o=Object.entries(t)}catch{return}for(const[r,n]of o){const t=e?`${e}.${r}`:r;r.toLowerCase().includes(a)&&i.add(t),this._findMatches(n,t,a,i)}}_isPathVisible(t){if(!this.searchQuery||0===this._matchingPaths.size)return!0;for(const e of this._matchingPaths)if(e===t||e.startsWith(t+"."))return!0;return!1}_highlightText(t,e){if(!e)return t;const a=String(t).toLowerCase(),i=e.toLowerCase(),s=a.indexOf(i);if(-1===s)return t;const o=String(t).slice(0,s),r=String(t).slice(s,s+e.length),n=String(t).slice(s+e.length);return U`${o}<span class="highlight">${r}</span>${n}`}_getType(t){return null===t?"null":void 0===t?"undefined":Array.isArray(t)?"array":typeof t}_isExpandable(t){if(null==t)return!1;const e=this._getType(t);if("object"!==e&&"array"!==e)return!1;try{return Object.keys(t).length>0}catch{return!1}}_getKeys(t){try{return Object.keys(t)}catch{return[]}}_isURL(t){return"string"==typeof t&&(/^(https?:\/\/|\/\/|\/[a-z])/i.test(t)||/\.(jpg|jpeg|png|gif|webp|svg|css|js|json)(\?|$)/i.test(t))}_toggleExpand(t,e){e.stopPropagation();const a=new Set(this.expanded);a.has(t)?a.delete(t):a.add(t),this.expanded=a}async _copyPath(t,e){e.stopPropagation();const a=t.replace(/^objects\./,"").replace(/^meta\./,"");try{await navigator.clipboard.writeText(`{{ ${a} }}`);const t=e.target;t.classList.add("key--copied"),setTimeout(()=>t.classList.remove("key--copied"),1e3)}catch(i){console.error("Failed to copy:",i)}}async _copyValue(t,e){let a;if(e.stopPropagation(),"object"==typeof t&&null!==t)try{a=JSON.stringify(t,null,2)}catch{a=String(t)}else a=String(t);try{await navigator.clipboard.writeText(a);const t=e.target;t.classList.add("copy-value-btn--copied"),t.textContent="✓",setTimeout(()=>{t.classList.remove("copy-value-btn--copied"),t.textContent="copy"},1e3)}catch(i){console.error("Failed to copy value:",i)}}_openURL(t,e){e.stopPropagation();let a=t;t.startsWith("//")?a=window.location.protocol+t:t.startsWith("/")&&(a=window.location.origin+t),window.open(a,"_blank")}_renderValue(t,e){switch(e){case"string":const e=this._isURL(t),a=t.length>80?t.slice(0,80)+"...":t;return e?U`<span class="value value--url" @click=${e=>this._openURL(t,e)} title="Click to open: ${t}">"${a}"</span>`:U`<span class="value value--string">"${a}"</span>`;case"number":return U`<span class="value value--number">${t}</span>`;case"boolean":return U`<span class="value value--boolean">${t}</span>`;case"null":return U`<span class="value value--null">null</span>`;case"undefined":return U`<span class="value value--undefined">undefined</span>`;case"object":case"array":return U`<span class="preview">{}</span>`;default:return U`<span class="value">${String(t)}</span>`}}_renderValueWithHighlight(t,e,a){if(!a)return this._renderValue(t,e);switch(e){case"string":const e=this._isURL(t),i=t.length>80?t.slice(0,80)+"...":t;return e?U`<span class="value value--url" @click=${e=>this._openURL(t,e)} title="Click to open: ${t}">"${this._highlightText(i,a)}"</span>`:U`<span class="value value--string">"${this._highlightText(i,a)}"</span>`;case"number":return U`<span class="value value--number">${this._highlightText(String(t),a)}</span>`;case"boolean":return U`<span class="value value--boolean">${this._highlightText(String(t),a)}</span>`;case"null":return U`<span class="value value--null">null</span>`;case"undefined":return U`<span class="value value--undefined">undefined</span>`;case"object":case"array":return U`<span class="preview">{}</span>`;default:return U`<span class="value">${this._highlightText(String(t),a)}</span>`}}_renderPreview(t,e){let a;try{a=Object.keys(t).length}catch{a=0}if("array"===e){const e=[],i=3;for(let o=0;o<Math.min(a,i);o++){const a=t[o],i=this._getType(a);if("string"===i){const t=a.length>15?a.slice(0,15)+"…":a;e.push(U`<span class="array-preview-item array-preview-item--string">"${t}"</span>`)}else"number"===i?e.push(U`<span class="array-preview-item array-preview-item--number">${a}</span>`):"object"===i||"array"===i?e.push(U`<span class="array-preview-item">{…}</span>`):e.push(U`<span class="array-preview-item">${String(a)}</span>`)}const s=a>i;return U`
145
- <span class="preview">Array(${a})</span>
144
+ `;const ut=new class{constructor(){this.context=null}parse(){const t=document.getElementById("__THEME_DEVTOOLS_CONTEXT__");if(!t)return console.warn("[Theme Devtools] Context element not found"),null;try{return this.context=JSON.parse(t.textContent),this.context}catch(e){return console.error("[Theme Devtools] Failed to parse context:",e),null}}get(t){if(this.context)return t.split(".").reduce((t,e)=>null==t?void 0:t[e],this.context)}getMeta(){var t;return(null==(t=this.context)?void 0:t.meta)||{}}getObjects(){var t;return(null==(t=this.context)?void 0:t.objects)||{}}};function gt(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}const vt=class t{constructor(){this.listeners=new Set,this.currentCart=null,this.cartHistory=[],this.pollInterval=null,this._isRestoring=!1,this._restoreEndTime=0,this._loadPersistedHistory()}startRestore(){this._isRestoring=!0}endRestore(t=null){this._isRestoring=!1,this._restoreEndTime=Date.now()+500,t&&(this.currentCart=t)}isRestoring(){return this._isRestoring||Date.now()<this._restoreEndTime}_loadPersistedHistory(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);e&&(this.cartHistory=JSON.parse(e))}catch(e){console.warn("[Theme Devtools] Failed to load cart history:",e)}}_persistHistory(){try{const e=this.cartHistory.slice(-50);sessionStorage.setItem(t.STORAGE_KEY,JSON.stringify(e))}catch(e){}}cartsEqual(t,e){var i,s,a,r;if(!t||!e)return!1;if(t.item_count!==e.item_count)return!1;if(t.total_price!==e.total_price)return!1;if((t.note||"")!==(e.note||""))return!1;if(JSON.stringify(t.attributes||{})!==JSON.stringify(e.attributes||{}))return!1;const n=t.items||[],o=e.items||[];if(n.length!==o.length)return!1;for(let l=0;l<n.length;l++){const t=n[l],e=o[l];if(t.variant_id!==e.variant_id)return!1;if(t.quantity!==e.quantity)return!1;if(JSON.stringify(t.properties||{})!==JSON.stringify(e.properties||{}))return!1;if((null==(s=null==(i=t.selling_plan_allocation)?void 0:i.selling_plan)?void 0:s.id)!==(null==(r=null==(a=e.selling_plan_allocation)?void 0:a.selling_plan)?void 0:r.id))return!1}return!0}async fetch(){try{const t=await fetch("/cart.js",{headers:{Accept:"application/json"}});return await t.json()}catch(t){return console.error("[Theme Devtools] Cart fetch failed:",t),null}}async update(t){try{const e=await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({updates:t})}),i=await e.json();return this.setCart(i),i}catch(e){return console.error("[Theme Devtools] Cart update failed:",e),null}}async change(t,e){try{const i=await fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({line:t,quantity:e})}),s=await i.json();return this.setCart(s),s}catch(i){return console.error("[Theme Devtools] Cart change failed:",i),null}}async clear(){try{const t=await fetch("/cart/clear.js",{method:"POST",headers:{Accept:"application/json"}}),e=await t.json();return this.setCart(e),e}catch(t){return console.error("[Theme Devtools] Cart clear failed:",t),null}}setCart(t){const e=this.currentCart;if(this.currentCart=t,this.isRestoring())this.notify(t,e);else if(e&&this.cartsEqual(e,t))this.notify(t,e);else{if(e){const i=this.cartHistory[this.cartHistory.length-1];i&&this.cartsEqual(i.snapshot,e)||(this.cartHistory.push({timestamp:Date.now(),diff:this.diffCart(e,t),snapshot:gt(e)}),this.cartHistory.length>50&&this.cartHistory.shift(),this._persistHistory())}this.notify(t,e)}}diffCart(t,e){const i={itemCount:{old:(null==t?void 0:t.item_count)||0,new:(null==e?void 0:e.item_count)||0},totalPrice:{old:(null==t?void 0:t.total_price)||0,new:(null==e?void 0:e.total_price)||0},items:{added:[],removed:[],modified:[]},noteChanged:((null==t?void 0:t.note)||"")!==((null==e?void 0:e.note)||""),attributesChanged:JSON.stringify((null==t?void 0:t.attributes)||{})!==JSON.stringify((null==e?void 0:e.attributes)||{}),discountChanged:JSON.stringify((null==t?void 0:t.discount_codes)||[])!==JSON.stringify((null==e?void 0:e.discount_codes)||[])},s=new Map(((null==t?void 0:t.items)||[]).map(t=>[t.key,t])),a=new Map(((null==e?void 0:e.items)||[]).map(t=>[t.key,t]));return a.forEach((t,e)=>{const a=s.get(e);a?a.quantity!==t.quantity&&i.items.modified.push({item:t,oldQuantity:a.quantity,newQuantity:t.quantity}):i.items.added.push(t)}),s.forEach((t,e)=>{a.has(e)||i.items.removed.push(t)}),i}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(t,e){this.listeners.forEach(i=>{try{i(t,e)}catch(s){console.error("[Theme Devtools] Cart listener error:",s)}})}startPolling(t=2e3){if(this.pollInterval)return;const e=async()=>{const t=await this.fetch();t&&JSON.stringify(t)!==JSON.stringify(this.currentCart)&&this.setCart(t)};e(),this.pollInterval=setInterval(e,t)}stopPolling(){this.pollInterval&&(clearInterval(this.pollInterval),this.pollInterval=null)}interceptAjax(){const t=this,e=window.fetch;window.fetch=async function(i,s){const a=await e.apply(this,arguments);if("string"==typeof i&&i.includes("/cart"))try{const e=a.clone(),i=await e.json();i&&void 0!==i.item_count&&(t.isRestoring()?(t.currentCart=i,t.notify(i,null)):setTimeout(()=>t.setCart(i),0))}catch{}return a};const i=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(e,s){return"string"==typeof s&&s.includes("/cart")&&this.addEventListener("load",function(){try{const e=JSON.parse(this.responseText);e&&void 0!==e.item_count&&(t.isRestoring()?(t.currentCart=e,t.notify(e,null)):setTimeout(()=>t.setCart(e),0))}catch{}}),i.apply(this,arguments)}}};__publicField(vt,"STORAGE_KEY","tdt-cart-history");const mt=new vt;const ft=new class{constructor(){this.currentProduct=null,this.listeners=new Set,this._fetchPromise=null}async fetch(t){if(!t)return null;try{const e=await fetch(`/products/${t}.json`,{headers:{Accept:"application/json"}});if(!e.ok)return console.warn(`[Theme Devtools] Product fetch failed: ${e.status}`),null;return(await e.json()).product||null}catch(e){return console.error("[Theme Devtools] Product fetch failed:",e),null}}async initialize(t){if(!(null==t?void 0:t.handle))return this.currentProduct=t,t;if(this._fetchPromise)return this._fetchPromise;this._fetchPromise=this._doInitialize(t);const e=await this._fetchPromise;return this._fetchPromise=null,e}async _doInitialize(t){const e=await this.fetch(t.handle);return this.currentProduct=e?{...t,variants:e.variants||[],images:e.images||[],options:e.options||t.options,body_html:e.body_html,selected_variant:t.selected_variant,selected_or_first_available_variant:t.selected_or_first_available_variant,metafields_count:t.metafields_count}:t,this.notify(this.currentProduct),this.currentProduct}getVariant(t){var e;return(null==(e=this.currentProduct)?void 0:e.variants)&&this.currentProduct.variants.find(e=>e.id===t)||null}getVariants(){var t;return(null==(t=this.currentProduct)?void 0:t.variants)||[]}getImages(){var t;return(null==(t=this.currentProduct)?void 0:t.images)||[]}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(t){this.listeners.forEach(e=>{try{e(t)}catch(i){console.error("[Theme Devtools] Product listener error:",i)}})}};const bt=new class{constructor(){this.overlay=null,this.currentSection=null}init(){this.overlay=document.createElement("div"),this.overlay.className="tdt-section-overlay",Object.assign(this.overlay.style,{position:"fixed",pointerEvents:"none",border:"2px solid #3b82f6",backgroundColor:"rgba(59, 130, 246, 0.1)",zIndex:"2147483646",display:"none",transition:"all 0.2s ease"}),document.body.appendChild(this.overlay)}findSections(){const t=[];Array.from(document.querySelectorAll('[id^="shopify-section-"]')).forEach(e=>{var i;const s=e.id.replace("shopify-section-",""),a=e.dataset.sectionType||(null==(i=e.className.match(/section-(\w+)/))?void 0:i[1])||"unknown",r=Array.from(e.querySelectorAll('[data-block-id], [id*="block"]'));t.push({id:s,type:a,element:e,blockCount:r.length,rect:e.getBoundingClientRect()})});return Array.from(document.querySelectorAll("[data-section-id]")).forEach(e=>{const i=e.dataset.sectionId;if(!t.find(t=>t.id===i)){const s=e.dataset.sectionType||"unknown",a=Array.from(e.querySelectorAll("[data-block-id]"));t.push({id:i,type:s,element:e,blockCount:a.length,rect:e.getBoundingClientRect()})}}),t}highlight(t){const e=this.findSections().find(e=>e.id===t);if(!e||!e.element)return void this.hide();const i=e.element.getBoundingClientRect();Object.assign(this.overlay.style,{display:"block",top:`${i.top}px`,left:`${i.left}px`,width:`${i.width}px`,height:`${i.height}px`}),this.currentSection=t,e.element.scrollIntoView({behavior:"smooth",block:"center"})}hide(){this.overlay&&(this.overlay.style.display="none"),this.currentSection=null}destroy(){this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)}},yt={theme:"dark",fontSize:"medium",defaultTab:"objects",panelHeight:"50",panelPosition:"bottom",persistAcrossSessions:!0,keyboardShortcut:{key:"D",ctrl:!0,shift:!0,alt:!1,meta:!1}},xt=class t{constructor(){this._settings={...yt},this._listeners=new Set,this._load()}getAll(){return{...this._settings}}get(t){return this._settings[t]}set(t,e){const i=this._settings[t];this._settings[t]=e,this._save(),this._notify(t,e,i)}setMultiple(t){const e={};for(const[i,s]of Object.entries(t))this._settings[i]!==s&&(e[i]={old:this._settings[i],new:s},this._settings[i]=s);this._save();for(const[i,{old:s,new:a}]of Object.entries(e))this._notify(i,a,s)}reset(){this._settings={...yt},this._save(),this._notify("*",this._settings,null)}subscribe(t){return this._listeners.add(t),()=>this._listeners.delete(t)}getStorage(){return this._settings.persistAcrossSessions?localStorage:sessionStorage}matchesShortcut(t){const e=this._settings.keyboardShortcut,i=t.key.toUpperCase()===e.key.toUpperCase(),s=t.ctrlKey===e.ctrl,a=t.shiftKey===e.shift,r=t.altKey===e.alt,n=t.metaKey===e.meta;return navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.ctrl&&!e.meta?i&&(s||t.metaKey)&&a&&r:i&&s&&a&&r&&n}formatShortcut(){const t=this._settings.keyboardShortcut,e=navigator.platform.toUpperCase().indexOf("MAC")>=0,i=[];return t.ctrl&&i.push(e?"⌃":"Ctrl"),t.meta&&i.push(e?"⌘":"Win"),t.alt&&i.push(e?"⌥":"Alt"),t.shift&&i.push(e?"⇧":"Shift"),i.push(t.key.toUpperCase()),i.join(e?"":"+")}_load(){try{let e=localStorage.getItem(t.STORAGE_KEY);if(e||(e=sessionStorage.getItem(t.STORAGE_KEY)),e){const t=JSON.parse(e);this._settings={...yt,...t}}}catch(e){console.warn("[Theme Devtools] Failed to load settings:",e)}}_save(){try{const e=JSON.stringify(this._settings);this._settings.persistAcrossSessions?(localStorage.setItem(t.STORAGE_KEY,e),sessionStorage.removeItem(t.STORAGE_KEY)):(sessionStorage.setItem(t.STORAGE_KEY,e),localStorage.removeItem(t.STORAGE_KEY))}catch(e){console.warn("[Theme Devtools] Failed to save settings:",e)}}_notify(t,e,i){this._listeners.forEach(s=>{try{s(t,e,i)}catch(a){console.error("[Theme Devtools] Settings listener error:",a)}})}};__publicField(xt,"STORAGE_KEY","tdt-settings");const _t=new xt;class wt extends ot{constructor(){super(),this.data=null,this.path="",this.expanded=new Set,this.searchQuery="",this.forceExpandAll=!1,this._matchingPaths=new Set,this._lastForceExpandAll=!1}updated(t){(t.has("searchQuery")||t.has("data"))&&this._updateMatchingPaths(),t.has("forceExpandAll")&&(this.forceExpandAll&&!this._lastForceExpandAll?this._expandAllPaths():!this.forceExpandAll&&this._lastForceExpandAll&&(this.expanded=new Set),this._lastForceExpandAll=this.forceExpandAll)}_expandAllPaths(){const t=new Set;this._collectAllPaths(this.data,this.path,t),this.expanded=t}_collectAllPaths(t,e,i){if(null==t)return;if(!this._isExpandable(t))return;let s;i.add(e);try{s=Object.entries(t)}catch{return}for(const[a,r]of s){const t=e?`${e}.${a}`:a;this._collectAllPaths(r,t,i)}}_updateMatchingPaths(){const t=(this.searchQuery||"").toLowerCase().trim();if(!t||!this.data)return this._matchingPaths=new Set,void this._dispatchMatchCount(0);const e=new Set;if(this._findMatches(this.data,this.path,t,e),this._matchingPaths=e,this._dispatchMatchCount(e.size),e.size>0){const t=new Set(this.expanded);for(const i of e){const e=i.split(".");let s="";for(let i=0;i<e.length-1;i++)s=s?`${s}.${e[i]}`:e[i],t.add(s)}this.expanded=t}}_dispatchMatchCount(t){this.dispatchEvent(new CustomEvent("match-count-changed",{detail:{count:t},bubbles:!0,composed:!0}))}_findMatches(t,e,i,s){if(null==t)return;const a=this._getType(t);if("object"!==a&&"array"!==a){return void(String(t).toLowerCase().includes(i)&&s.add(e))}let r;try{r=Object.entries(t)}catch{return}for(const[n,o]of r){const t=e?`${e}.${n}`:n;n.toLowerCase().includes(i)&&s.add(t),this._findMatches(o,t,i,s)}}_isPathVisible(t){if(!this.searchQuery||0===this._matchingPaths.size)return!0;for(const e of this._matchingPaths)if(e===t||e.startsWith(t+"."))return!0;return!1}_highlightText(t,e){if(!e)return t;const i=String(t).toLowerCase(),s=e.toLowerCase(),a=i.indexOf(s);if(-1===a)return t;const r=String(t).slice(0,a),n=String(t).slice(a,a+e.length),o=String(t).slice(a+e.length);return U`${r}<span class="highlight">${n}</span>${o}`}_getType(t){return null===t?"null":void 0===t?"undefined":Array.isArray(t)?"array":typeof t}_isExpandable(t){if(null==t)return!1;const e=this._getType(t);if("object"!==e&&"array"!==e)return!1;try{return Object.keys(t).length>0}catch{return!1}}_getKeys(t){try{return Object.keys(t)}catch{return[]}}_isURL(t){return"string"==typeof t&&(/^(https?:\/\/|\/\/|\/[a-z])/i.test(t)||/\.(jpg|jpeg|png|gif|webp|svg|css|js|json)(\?|$)/i.test(t))}_toggleExpand(t,e){e.stopPropagation();const i=new Set(this.expanded);i.has(t)?i.delete(t):i.add(t),this.expanded=i}async _copyPath(t,e){e.stopPropagation();const i=t.replace(/^objects\./,"").replace(/^meta\./,"");try{await navigator.clipboard.writeText(`{{ ${i} }}`);const t=e.target;t.classList.add("key--copied"),setTimeout(()=>t.classList.remove("key--copied"),1e3)}catch(s){console.error("Failed to copy:",s)}}async _copyValue(t,e){let i;if(e.stopPropagation(),"object"==typeof t&&null!==t)try{i=JSON.stringify(t,null,2)}catch{i=String(t)}else i=String(t);try{await navigator.clipboard.writeText(i);const t=e.target;t.classList.add("copy-value-btn--copied"),t.textContent="✓",setTimeout(()=>{t.classList.remove("copy-value-btn--copied"),t.textContent="copy"},1e3)}catch(s){console.error("Failed to copy value:",s)}}_openURL(t,e){e.stopPropagation();let i=t;t.startsWith("//")?i=window.location.protocol+t:t.startsWith("/")&&(i=window.location.origin+t),window.open(i,"_blank")}_renderValue(t,e){switch(e){case"string":const e=this._isURL(t),i=t.length>80?t.slice(0,80)+"...":t;return e?U`<span class="value value--url" @click=${e=>this._openURL(t,e)} title="Click to open: ${t}">"${i}"</span>`:U`<span class="value value--string">"${i}"</span>`;case"number":return U`<span class="value value--number">${t}</span>`;case"boolean":return U`<span class="value value--boolean">${t}</span>`;case"null":return U`<span class="value value--null">null</span>`;case"undefined":return U`<span class="value value--undefined">undefined</span>`;case"object":case"array":return U`<span class="preview">{}</span>`;default:return U`<span class="value">${String(t)}</span>`}}_renderValueWithHighlight(t,e,i){if(!i)return this._renderValue(t,e);switch(e){case"string":const e=this._isURL(t),s=t.length>80?t.slice(0,80)+"...":t;return e?U`<span class="value value--url" @click=${e=>this._openURL(t,e)} title="Click to open: ${t}">"${this._highlightText(s,i)}"</span>`:U`<span class="value value--string">"${this._highlightText(s,i)}"</span>`;case"number":return U`<span class="value value--number">${this._highlightText(String(t),i)}</span>`;case"boolean":return U`<span class="value value--boolean">${this._highlightText(String(t),i)}</span>`;case"null":return U`<span class="value value--null">null</span>`;case"undefined":return U`<span class="value value--undefined">undefined</span>`;case"object":case"array":return U`<span class="preview">{}</span>`;default:return U`<span class="value">${this._highlightText(String(t),i)}</span>`}}_renderPreview(t,e){let i;try{i=Object.keys(t).length}catch{i=0}if("array"===e){const e=[],s=3;for(let r=0;r<Math.min(i,s);r++){const i=t[r],s=this._getType(i);if("string"===s){const t=i.length>15?i.slice(0,15)+"…":i;e.push(U`<span class="array-preview-item array-preview-item--string">"${t}"</span>`)}else"number"===s?e.push(U`<span class="array-preview-item array-preview-item--number">${i}</span>`):"object"===s||"array"===s?e.push(U`<span class="array-preview-item">{…}</span>`):e.push(U`<span class="array-preview-item">${String(i)}</span>`)}const a=i>s;return U`
145
+ <span class="preview">Array(${i})</span>
146
146
  ${e.length>0?U`
147
- <span class="preview-keys">[${e.map((t,a)=>U`${t}${a<e.length-1?", ":""}`)}${s?", …":""}]</span>
147
+ <span class="preview-keys">[${e.map((t,i)=>U`${t}${i<e.length-1?", ":""}`)}${a?", …":""}]</span>
148
148
  `:""}
149
- `}const i=this._getKeys(t),s=i.slice(0,4),o=i.length>4;return U`
150
- <span class="preview">{${a} ${1===a?"key":"keys"}}</span>
151
- ${s.length>0?U`
152
- <span class="preview-keys">{${s.join(", ")}${o?", …":""}}</span>
149
+ `}const s=this._getKeys(t),a=s.slice(0,4),r=s.length>4;return U`
150
+ <span class="preview">{${i} ${1===i?"key":"keys"}}</span>
151
+ ${a.length>0?U`
152
+ <span class="preview-keys">{${a.join(", ")}${r?", …":""}}</span>
153
153
  `:""}
154
- `}_renderNode(t,e,a,i=!1,s=!1){const o=this._getType(e),r=this._isExpandable(e),n=this.expanded.has(a),l=this._isPathVisible(a),d=(this.searchQuery||"").trim(),c=["node",i?"node--root":"",r?"node--expandable":"",n?"node--expanded":"",l?"":"node--hidden"].filter(Boolean).join(" "),p=s?`[${t}]`:t,h=d?this._highlightText(p,d):p;let u=0;if(r&&d&&this._matchingPaths.size>0)for(const v of this._matchingPaths)v.startsWith(a+".")&&u++;return U`
154
+ `}_renderNode(t,e,i,s=!1,a=!1){const r=this._getType(e),n=this._isExpandable(e),o=this.expanded.has(i),l=this._isPathVisible(i),c=(this.searchQuery||"").trim(),d=["node",s?"node--root":"",n?"node--expandable":"",o?"node--expanded":"",l?"":"node--hidden"].filter(Boolean).join(" "),p=a?`[${t}]`:t,h=c?this._highlightText(p,c):p;let u=0;if(n&&c&&this._matchingPaths.size>0)for(const g of this._matchingPaths)g.startsWith(i+".")&&u++;return U`
155
155
  <div
156
- class=${c}
157
- @click=${r?t=>this._toggleExpand(a,t):null}
156
+ class=${d}
157
+ @click=${n?t=>this._toggleExpand(i,t):null}
158
158
  >
159
159
  <span class="node-content">
160
- <span class="key" @click=${t=>this._copyPath(a,t)} title="Click to copy Liquid path">${h}</span>
160
+ <span class="key" @click=${t=>this._copyPath(i,t)} title="Click to copy Liquid path">${h}</span>
161
161
  <span class="separator">: </span>
162
- ${r?this._renderPreview(e,o):this._renderValueWithHighlight(e,o,d)}
163
- ${u>0&&!n?U`<span class="match-count">${u} match${u>1?"es":""}</span>`:""}
162
+ ${n?this._renderPreview(e,r):this._renderValueWithHighlight(e,r,c)}
163
+ ${u>0&&!o?U`<span class="match-count">${u} match${u>1?"es":""}</span>`:""}
164
164
  <button class="copy-value-btn" @click=${t=>this._copyValue(e,t)} title="Copy value">copy</button>
165
165
  </span>
166
- ${r&&n?U`
166
+ ${n&&o?U`
167
167
  <div class="children">
168
- ${this._renderObject(e,a)}
168
+ ${this._renderObject(e,i)}
169
169
  </div>
170
170
  `:""}
171
171
  </div>
172
- `}_renderObject(t,e=""){if(null==t)return U`<span class="value value--null">${null===t?"null":"undefined"}</span>`;const a=this._getType(t);let i;try{i=Object.entries(t)}catch{return U`<span class="preview">[Object]</span>`}return 0===i.length?U`<span class="preview">${"array"===a?"[]":"{}"}</span>`:i.map(([t,i])=>{const s=e?`${e}.${t}`:t;return this._renderNode(t,i,s,!e,"array"===a)})}render(){return null===this.data?U`<span class="value value--null">null</span>`:void 0===this.data?U`<span class="value value--undefined">undefined</span>`:U`${this._renderObject(this.data,this.path)}`}}__publicField(yt,"properties",{data:{type:Object},path:{type:String},expanded:{type:Object,state:!0},searchQuery:{type:String},forceExpandAll:{type:Boolean},_matchingPaths:{type:Object,state:!0}}),__publicField(yt,"styles",[pt,r`
172
+ `}_renderObject(t,e=""){if(null==t)return U`<span class="value value--null">${null===t?"null":"undefined"}</span>`;const i=this._getType(t);let s;try{s=Object.entries(t)}catch{return U`<span class="preview">[Object]</span>`}return 0===s.length?U`<span class="preview">${"array"===i?"[]":"{}"}</span>`:s.map(([t,s])=>{const a=e?`${e}.${t}`:t;return this._renderNode(t,s,a,!e,"array"===i)})}render(){return null===this.data?U`<span class="value value--null">null</span>`:void 0===this.data?U`<span class="value value--undefined">undefined</span>`:U`${this._renderObject(this.data,this.path)}`}}__publicField(wt,"properties",{data:{type:Object},path:{type:String},expanded:{type:Object,state:!0},searchQuery:{type:String},forceExpandAll:{type:Boolean},_matchingPaths:{type:Object,state:!0}}),__publicField(wt,"styles",[pt,n`
173
173
  :host {
174
174
  display: block;
175
175
  font-family: var(--tdt-font);
@@ -332,7 +332,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
332
332
  .array-preview-item--number {
333
333
  color: var(--tdt-number);
334
334
  }
335
- `]),customElements.define("tdt-object-inspector",yt);const wt=class t extends nt{constructor(){super(),this.objects={},this.activeObject=null,this.searchQuery="",this.hideNullObjects=!1,this.allExpanded=!1,this.matchCount=0,this._loadPersistedTab()}_loadPersistedTab(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);e&&(this.activeObject=e)}catch(e){}}_persistTab(e){try{sessionStorage.setItem(t.STORAGE_KEY,e)}catch(a){}}updated(t){if(t.has("objects")&&this.objects){const t=Object.keys(this.objects).filter(t=>null!==this.objects[t]);this.activeObject&&void 0!==this.objects[this.activeObject]||t.length>0&&(this.activeObject=t[0])}}_handleSearch(t){this.searchQuery=t.target.value}_clearSearch(){this.searchQuery=""}_selectObject(t){this.activeObject=t,this._persistTab(t),this.allExpanded=!1}_getKeyCount(t){if(null==t)return 0;try{return Array.isArray(t)?t.length:Object.keys(t).length}catch{return 0}}_toggleHideNull(){this.hideNullObjects=!this.hideNullObjects}_toggleExpandAll(){this.allExpanded=!this.allExpanded}async _copyAsJSON(){const t=this.activeObject?this.objects[this.activeObject]:null;if(t)try{const e=JSON.stringify(t,null,2);await navigator.clipboard.writeText(e);const a=this.shadowRoot.querySelector(".copy-json-btn");a&&(a.classList.add("action-btn--copied"),a.textContent="Copied!",setTimeout(()=>{a.classList.remove("action-btn--copied"),a.textContent="Copy JSON"},1500))}catch(e){console.error("Failed to copy:",e)}}_exportAsJSON(){const t=this.activeObject?this.objects[this.activeObject]:null;if(!t)return;const e=JSON.stringify(t,null,2),a=new Blob([e],{type:"application/json"}),i=URL.createObjectURL(a),s=document.createElement("a");s.href=i,s.download=`${this.activeObject}-${(new Date).toISOString().slice(0,10)}.json`,s.click(),URL.revokeObjectURL(i)}_handleMatchCount(t){this.matchCount=t.detail.count}render(){if(!this.objects||0===Object.keys(this.objects).length)return U`<div class="empty-state">No Liquid objects available on this page</div>`;const t=Object.keys(this.objects),e=t.filter(t=>null===this.objects[t]),a=t.filter(t=>null!==this.objects[t]),i=this.hideNullObjects?a:t,s=this.activeObject?this.objects[this.activeObject]:null,o=this._getKeyCount(s);return U`
335
+ `]),customElements.define("tdt-object-inspector",wt);const kt=class t extends ot{constructor(){super(),this.objects={},this.activeObject=null,this.searchQuery="",this.hideNullObjects=!1,this.allExpanded=!1,this.matchCount=0,this._loadPersistedTab()}_loadPersistedTab(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);e&&(this.activeObject=e)}catch(e){}}_persistTab(e){try{sessionStorage.setItem(t.STORAGE_KEY,e)}catch(i){}}updated(t){if(t.has("objects")&&this.objects){const t=Object.keys(this.objects).filter(t=>null!==this.objects[t]);this.activeObject&&void 0!==this.objects[this.activeObject]||t.length>0&&(this.activeObject=t[0])}}_handleSearch(t){this.searchQuery=t.target.value}_clearSearch(){this.searchQuery=""}_selectObject(t){this.activeObject=t,this._persistTab(t),this.allExpanded=!1}_getKeyCount(t){if(null==t)return 0;try{return Array.isArray(t)?t.length:Object.keys(t).length}catch{return 0}}_toggleHideNull(){this.hideNullObjects=!this.hideNullObjects}_toggleExpandAll(){this.allExpanded=!this.allExpanded}async _copyAsJSON(){const t=this.activeObject?this.objects[this.activeObject]:null;if(t)try{const e=JSON.stringify(t,null,2);await navigator.clipboard.writeText(e);const i=this.shadowRoot.querySelector(".copy-json-btn");i&&(i.classList.add("action-btn--copied"),i.textContent="Copied!",setTimeout(()=>{i.classList.remove("action-btn--copied"),i.textContent="Copy JSON"},1500))}catch(e){console.error("Failed to copy:",e)}}_exportAsJSON(){const t=this.activeObject?this.objects[this.activeObject]:null;if(!t)return;const e=JSON.stringify(t,null,2),i=new Blob([e],{type:"application/json"}),s=URL.createObjectURL(i),a=document.createElement("a");a.href=s,a.download=`${this.activeObject}-${(new Date).toISOString().slice(0,10)}.json`,a.click(),URL.revokeObjectURL(s)}_handleMatchCount(t){this.matchCount=t.detail.count}render(){if(!this.objects||0===Object.keys(this.objects).length)return U`<div class="empty-state">No Liquid objects available on this page</div>`;const t=Object.keys(this.objects),e=t.filter(t=>null===this.objects[t]),i=t.filter(t=>null!==this.objects[t]),s=this.hideNullObjects?i:t,a=this.activeObject?this.objects[this.activeObject]:null,r=this._getKeyCount(a);return U`
336
336
  <div class="toolbar">
337
337
  <input
338
338
  type="search"
@@ -359,23 +359,23 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
359
359
  `:""}
360
360
 
361
361
  <div class="object-tabs">
362
- ${i.map(t=>{const e=null===this.objects[t],a=this._getKeyCount(this.objects[t]);return U`
362
+ ${s.map(t=>{const e=null===this.objects[t],i=this._getKeyCount(this.objects[t]);return U`
363
363
  <button
364
364
  class="object-tab ${this.activeObject===t?"object-tab--active":""} ${e?"object-tab--null":""}"
365
365
  @click=${()=>this._selectObject(t)}
366
366
  >
367
367
  ${t}${e?" ∅":""}
368
- ${e?"":U`<span class="object-tab__count">${a}</span>`}
368
+ ${e?"":U`<span class="object-tab__count">${i}</span>`}
369
369
  </button>
370
370
  `})}
371
371
  </div>
372
372
 
373
373
  <div class="object-content">
374
- ${null===s?U`<div class="null-state">${this.activeObject} is null on this page</div>`:U`
374
+ ${null===a?U`<div class="null-state">${this.activeObject} is null on this page</div>`:U`
375
375
  <div class="content-header">
376
376
  <div class="content-title">
377
377
  ${this.activeObject}
378
- <span class="content-stats">${o} ${Array.isArray(s)?"items":"keys"}</span>
378
+ <span class="content-stats">${r} ${Array.isArray(a)?"items":"keys"}</span>
379
379
  </div>
380
380
  <div class="content-actions">
381
381
  <button
@@ -394,7 +394,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
394
394
  </div>
395
395
  </div>
396
396
  <tdt-object-inspector
397
- .data=${s}
397
+ .data=${a}
398
398
  .path=${"objects."+this.activeObject}
399
399
  .searchQuery=${this.searchQuery}
400
400
  .forceExpandAll=${this.allExpanded}
@@ -402,7 +402,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
402
402
  ></tdt-object-inspector>
403
403
  `}
404
404
  </div>
405
- `}};__publicField(wt,"properties",{objects:{type:Object},activeObject:{type:String,state:!0},searchQuery:{type:String,state:!0},hideNullObjects:{type:Boolean,state:!0},allExpanded:{type:Boolean,state:!0},matchCount:{type:Number,state:!0}}),__publicField(wt,"STORAGE_KEY","tdt-objects-active-tab"),__publicField(wt,"styles",[pt,r`
405
+ `}};__publicField(kt,"properties",{objects:{type:Object},activeObject:{type:String,state:!0},searchQuery:{type:String,state:!0},hideNullObjects:{type:Boolean,state:!0},allExpanded:{type:Boolean,state:!0},matchCount:{type:Number,state:!0}}),__publicField(kt,"STORAGE_KEY","tdt-objects-active-tab"),__publicField(kt,"styles",[pt,n`
406
406
  :host {
407
407
  display: block;
408
408
  padding: 12px;
@@ -604,7 +604,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
604
604
  text-transform: uppercase;
605
605
  letter-spacing: 0.5px;
606
606
  }
607
- `]);let kt=wt;customElements.define("tdt-objects-panel",kt);class $t extends nt{constructor(){super(),this.cart=null,this.previousCart=null,this.diff=null,this.showHistory=!1,this.cartHistory=[],this.showAddProduct=!1,this.showAttributes=!1,this.showDiscountInput=!1,this.expandedItems=new Set,this.variantIdInput="",this.quantityInput=1,this.discountInput="",this.editingNote=!1,this.noteInput="",this.editingAttributes=!1,this.attributesInput={},this._toastTimeout=null}updated(t){if(t.has("cart")&&this.cart){const e=t.get("cart");e&&(this.previousCart=e,this.diff=mt.diffCart(e,this.cart)),this.showHistory&&(this.cartHistory=[...mt.cartHistory].reverse())}}async _refresh(){const t=await mt.fetch();t&&mt.setCart(t)}async _clear(){confirm("Clear entire cart?")&&await mt.clear()}async _updateQuantity(t,e){await mt.change(t+1,e)}async _remove(t){await mt.change(t+1,0)}_formatMoney(t){return null==t?"—":`$${(t/100).toFixed(2)}`}_exportCartJSON(){if(!this.cart)return;const t=JSON.stringify(this.cart,null,2),e=new Blob([t],{type:"application/json"}),a=URL.createObjectURL(e),i=document.createElement("a");i.href=a,i.download=`cart-${(new Date).toISOString().slice(0,10)}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}_copyCartPermalink(){if(!this.cart||0===this.cart.items.length)return;const t=this.cart.items.map(t=>`${t.variant_id}:${t.quantity}`).join(","),e=`${window.location.origin}/cart/${t}`;navigator.clipboard.writeText(e),this._showToast("Cart permalink copied!")}_showToast(t){this._toastTimeout&&clearTimeout(this._toastTimeout),this._toastMessage=t,this.requestUpdate(),this._toastTimeout=setTimeout(()=>{this._toastMessage=null,this.requestUpdate()},2e3)}_toggleHistory(){this.showHistory=!this.showHistory,this.showHistory&&(this.cartHistory=[...mt.cartHistory].reverse())}_formatHistoryTime(t){const e=new Date(t),a=new Date-e;return a<6e4?"Just now":a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}async _restoreCart(t){if(!t.snapshot)return;const e=t.snapshot;try{if(mt.startRestore(),await mt.clear(),e.items&&e.items.length>0){const t=e.items.map(t=>{var e,a;const i={id:t.variant_id,quantity:t.quantity};return t.properties&&Object.keys(t.properties).length>0&&(i.properties=t.properties),(null==(a=null==(e=t.selling_plan_allocation)?void 0:e.selling_plan)?void 0:a.id)&&(i.selling_plan=t.selling_plan_allocation.selling_plan.id),i});await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({items:t})})}const t={};e.attributes&&Object.keys(e.attributes).length>0&&(t.attributes=e.attributes),e.note&&(t.note=e.note),Object.keys(t).length>0&&await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(t)});const a=await mt.fetch();mt.endRestore(a),a&&mt.notify(a,null),this._showToast("Cart restored!")}catch(a){mt.endRestore(),console.error("[Theme Devtools] Cart restore failed:",a),this._showToast(`Restore failed: ${a.message}`)}}_getHistoryLabel(t){var e,a,i,s,o,r,n,l,d,c;const p=[];if((null==(a=null==(e=t.items)?void 0:e.added)?void 0:a.length)>0&&t.items.added.forEach(t=>{const e=t.product_title||t.title||"Item";p.push({text:`+ ${e}`,class:"diff__added"})}),(null==(s=null==(i=t.items)?void 0:i.removed)?void 0:s.length)>0&&t.items.removed.forEach(t=>{const e=t.product_title||t.title||"Item";p.push({text:`− ${e}`,class:"diff__removed"})}),(null==(r=null==(o=t.items)?void 0:o.modified)?void 0:r.length)>0&&t.items.modified.forEach(t=>{var e,a;const i=(null==(e=t.item)?void 0:e.product_title)||(null==(a=t.item)?void 0:a.title)||"Item";p.push({text:`${i}: ${t.oldQuantity} → ${t.newQuantity}`,class:"diff__modified"})}),t.noteChanged&&p.push({text:"Note updated",class:""}),t.attributesChanged&&p.push({text:"Attrs updated",class:""}),t.discountChanged&&p.push({text:"Discount changed",class:""}),0===p.length){const e=(null==(n=t.itemCount)?void 0:n.old)??0,a=(null==(l=t.itemCount)?void 0:l.new)??0;a>e?p.push({text:`+${a-e} item(s) added`,class:"diff__added"}):a<e?p.push({text:`−${e-a} item(s) removed`,class:"diff__removed"}):(null==(d=t.totalPrice)?void 0:d.old)!==(null==(c=t.totalPrice)?void 0:c.new)?p.push({text:"Price changed",class:""}):p.push({text:"Cart refreshed",class:""})}return p}_clearHistory(){0!==this.cartHistory.length&&confirm("Clear cart history?")&&(mt.cartHistory=[],sessionStorage.removeItem(mt.constructor.STORAGE_KEY),this.cartHistory=[])}_renderHistoryPanel(){return this.showHistory?U`
607
+ `]);let $t=kt;customElements.define("tdt-objects-panel",$t);class St extends ot{constructor(){super(),this.cart=null,this.previousCart=null,this.diff=null,this.showHistory=!1,this.cartHistory=[],this.showAddProduct=!1,this.showAttributes=!1,this.showDiscountInput=!1,this.expandedItems=new Set,this.variantIdInput="",this.quantityInput=1,this.discountInput="",this.editingNote=!1,this.noteInput="",this.editingAttributes=!1,this.attributesInput={},this._toastTimeout=null}updated(t){if(t.has("cart")&&this.cart){const e=t.get("cart");e&&(this.previousCart=e,this.diff=mt.diffCart(e,this.cart)),this.showHistory&&(this.cartHistory=[...mt.cartHistory].reverse())}}async _refresh(){const t=await mt.fetch();t&&mt.setCart(t)}async _clear(){confirm("Clear entire cart?")&&await mt.clear()}async _updateQuantity(t,e){await mt.change(t+1,e)}async _remove(t){await mt.change(t+1,0)}_formatMoney(t){return null==t?"—":`$${(t/100).toFixed(2)}`}_exportCartJSON(){if(!this.cart)return;const t=JSON.stringify(this.cart,null,2),e=new Blob([t],{type:"application/json"}),i=URL.createObjectURL(e),s=document.createElement("a");s.href=i,s.download=`cart-${(new Date).toISOString().slice(0,10)}.json`,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}_copyCartPermalink(){if(!this.cart||0===this.cart.items.length)return;const t=this.cart.items.map(t=>`${t.variant_id}:${t.quantity}`).join(","),e=`${window.location.origin}/cart/${t}`;navigator.clipboard.writeText(e),this._showToast("Cart permalink copied!")}_showToast(t){this._toastTimeout&&clearTimeout(this._toastTimeout),this._toastMessage=t,this.requestUpdate(),this._toastTimeout=setTimeout(()=>{this._toastMessage=null,this.requestUpdate()},2e3)}_toggleHistory(){this.showHistory=!this.showHistory,this.showHistory&&(this.cartHistory=[...mt.cartHistory].reverse())}_formatHistoryTime(t){const e=new Date(t),i=new Date-e;return i<6e4?"Just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}async _restoreCart(t){if(!t.snapshot)return;const e=t.snapshot;try{if(mt.startRestore(),await mt.clear(),e.items&&e.items.length>0){const t=e.items.map(t=>{var e,i;const s={id:t.variant_id,quantity:t.quantity};return t.properties&&Object.keys(t.properties).length>0&&(s.properties=t.properties),(null==(i=null==(e=t.selling_plan_allocation)?void 0:e.selling_plan)?void 0:i.id)&&(s.selling_plan=t.selling_plan_allocation.selling_plan.id),s});await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({items:t})})}const t={};e.attributes&&Object.keys(e.attributes).length>0&&(t.attributes=e.attributes),e.note&&(t.note=e.note),Object.keys(t).length>0&&await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(t)});const i=await mt.fetch();mt.endRestore(i),i&&mt.notify(i,null),this._showToast("Cart restored!")}catch(i){mt.endRestore(),console.error("[Theme Devtools] Cart restore failed:",i),this._showToast(`Restore failed: ${i.message}`)}}_getHistoryLabel(t){var e,i,s,a,r,n,o,l,c,d;const p=[];if((null==(i=null==(e=t.items)?void 0:e.added)?void 0:i.length)>0&&t.items.added.forEach(t=>{const e=t.product_title||t.title||"Item";p.push({text:`+ ${e}`,class:"diff__added"})}),(null==(a=null==(s=t.items)?void 0:s.removed)?void 0:a.length)>0&&t.items.removed.forEach(t=>{const e=t.product_title||t.title||"Item";p.push({text:`− ${e}`,class:"diff__removed"})}),(null==(n=null==(r=t.items)?void 0:r.modified)?void 0:n.length)>0&&t.items.modified.forEach(t=>{var e,i;const s=(null==(e=t.item)?void 0:e.product_title)||(null==(i=t.item)?void 0:i.title)||"Item";p.push({text:`${s}: ${t.oldQuantity} → ${t.newQuantity}`,class:"diff__modified"})}),t.noteChanged&&p.push({text:"Note updated",class:""}),t.attributesChanged&&p.push({text:"Attrs updated",class:""}),t.discountChanged&&p.push({text:"Discount changed",class:""}),0===p.length){const e=(null==(o=t.itemCount)?void 0:o.old)??0,i=(null==(l=t.itemCount)?void 0:l.new)??0;i>e?p.push({text:`+${i-e} item(s) added`,class:"diff__added"}):i<e?p.push({text:`−${e-i} item(s) removed`,class:"diff__removed"}):(null==(c=t.totalPrice)?void 0:c.old)!==(null==(d=t.totalPrice)?void 0:d.new)?p.push({text:"Price changed",class:""}):p.push({text:"Cart refreshed",class:""})}return p}_clearHistory(){0!==this.cartHistory.length&&confirm("Clear cart history?")&&(mt.cartHistory=[],sessionStorage.removeItem(mt.constructor.STORAGE_KEY),this.cartHistory=[])}_renderHistoryPanel(){return this.showHistory?U`
608
608
  <div class="history-panel">
609
609
  <div class="history-header">
610
610
  <span>Cart History</span>
@@ -666,22 +666,22 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
666
666
  <button class="btn btn--sm btn--mini" @click=${this._applyDiscount}>Apply</button>
667
667
  </div>
668
668
  </div>
669
- `}_renderInlineDiscounts(){var t,e;const a=(null==(t=this.cart)?void 0:t.discount_codes)||[],i=(null==(e=this.cart)?void 0:e.total_discount)||0;return 0===a.length&&0===i?"":U`
669
+ `}_renderInlineDiscounts(){var t,e;const i=(null==(t=this.cart)?void 0:t.discount_codes)||[],s=(null==(e=this.cart)?void 0:e.total_discount)||0;return 0===i.length&&0===s?"":U`
670
670
  <span class="discount-inline">
671
- ${a.map(t=>U`
671
+ ${i.map(t=>U`
672
672
  <span class="discount-badge">${t.code}${t.amount?` -${this._formatMoney(t.amount)}`:""}</span>
673
673
  `)}
674
- ${i>0&&0===a.length?U`
675
- <span class="discount-badge">-${this._formatMoney(i)}</span>
674
+ ${s>0&&0===i.length?U`
675
+ <span class="discount-badge">-${this._formatMoney(s)}</span>
676
676
  `:""}
677
677
  </span>
678
- `}_renderMetaRow(){var t,e;const a=(null==(t=this.cart)?void 0:t.attributes)||{},i=(null==(e=this.cart)?void 0:e.note)||"",s=Object.keys(a).length;return s>0||i||this.showAttributes?U`
678
+ `}_renderMetaRow(){var t,e;const i=(null==(t=this.cart)?void 0:t.attributes)||{},s=(null==(e=this.cart)?void 0:e.note)||"",a=Object.keys(i).length;return a>0||s||this.showAttributes?U`
679
679
  <div class="meta-row">
680
- ${s>0?U`
681
- <span class="meta-item">Attrs: <strong>${s}</strong></span>
680
+ ${a>0?U`
681
+ <span class="meta-item">Attrs: <strong>${a}</strong></span>
682
682
  `:""}
683
- ${i?U`
684
- <span class="meta-item">Note: <strong>${i.length>20?i.slice(0,20)+"...":i}</strong></span>
683
+ ${s?U`
684
+ <span class="meta-item">Note: <strong>${s.length>20?s.slice(0,20)+"...":s}</strong></span>
685
685
  `:""}
686
686
  <button
687
687
  class="meta-toggle ${this.showAttributes?"active":""}"
@@ -690,7 +690,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
690
690
  ${this.showAttributes?"Hide":"Edit"}
691
691
  </button>
692
692
  </div>
693
- `:""}_renderMetaPanel(){var t,e;if(!this.showAttributes)return"";const a=(null==(t=this.cart)?void 0:t.attributes)||{},i=(null==(e=this.cart)?void 0:e.note)||"";return U`
693
+ `:""}_renderMetaPanel(){var t,e;if(!this.showAttributes)return"";const i=(null==(t=this.cart)?void 0:t.attributes)||{},s=(null==(e=this.cart)?void 0:e.note)||"";return U`
694
694
  <div class="meta-panel">
695
695
  <div class="meta-panel-header">
696
696
  <span>Cart Attributes & Note</span>
@@ -705,7 +705,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
705
705
  style="width: 80px;"
706
706
  placeholder="key"
707
707
  .value=${t}
708
- @input=${a=>{const i={...this.attributesInput};delete i[t],i[a.target.value]=e,this.attributesInput=i}}
708
+ @input=${i=>{const s={...this.attributesInput};delete s[t],s[i.target.value]=e,this.attributesInput=s}}
709
709
  >
710
710
  <input
711
711
  class="attr-input"
@@ -722,9 +722,9 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
722
722
  <button class="meta-toggle" @click=${()=>this.editingAttributes=!1}>Cancel</button>
723
723
  </div>
724
724
  `:U`
725
- ${Object.keys(a).length>0?U`
725
+ ${Object.keys(i).length>0?U`
726
726
  <div class="attr-grid" style="grid-template-columns: auto 1fr;">
727
- ${Object.entries(a).map(([t,e])=>U`
727
+ ${Object.entries(i).map(([t,e])=>U`
728
728
  <span class="attr-key">${t}:</span>
729
729
  <span class="attr-value">${e}</span>
730
730
  `)}
@@ -750,12 +750,12 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
750
750
  </div>
751
751
  `:U`
752
752
  <span class="note-text" @click=${this._startEditingNote}>
753
- ${i||"Click to add..."}
753
+ ${s||"Click to add..."}
754
754
  </span>
755
755
  `}
756
756
  </div>
757
757
  </div>
758
- `}_renderItemExpanded(t){var e,a;const i=t.properties||{},s=Object.keys(i).length>0,o=t.selling_plan_allocation;return t.original_line_price&&(t.original_line_price,t.line_price),U`
758
+ `}_renderItemExpanded(t){var e,i;const s=t.properties||{},a=Object.keys(s).length>0,r=t.selling_plan_allocation;return t.original_line_price&&(t.original_line_price,t.line_price),U`
759
759
  <div class="item-expanded">
760
760
  <div class="item-detail-row">
761
761
  <span class="item-detail-label">Variant ID:</span>
@@ -794,14 +794,14 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
794
794
  </div>
795
795
  `:""}
796
796
 
797
- ${o?U`
797
+ ${r?U`
798
798
  <div style="margin-top: 8px;">
799
799
  <span class="selling-plan-badge">
800
- 🔄 ${(null==(e=o.selling_plan)?void 0:e.name)||"Subscription"}
800
+ 🔄 ${(null==(e=r.selling_plan)?void 0:e.name)||"Subscription"}
801
801
  </span>
802
- ${(null==(a=o.price_adjustments)?void 0:a.length)>0?U`
802
+ ${(null==(i=r.price_adjustments)?void 0:i.length)>0?U`
803
803
  <div style="margin-top: 4px; font-size: calc(9px * var(--tdt-scale, 1)); color: var(--tdt-text-muted);">
804
- ${o.price_adjustments.map(t=>U`
804
+ ${r.price_adjustments.map(t=>U`
805
805
  <div>${t.position}: ${this._formatMoney(t.price)}</div>
806
806
  `)}
807
807
  </div>
@@ -809,10 +809,10 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
809
809
  </div>
810
810
  `:""}
811
811
 
812
- ${s?U`
812
+ ${a?U`
813
813
  <div class="item-properties">
814
814
  <div class="item-properties-title">Line Item Properties:</div>
815
- ${Object.entries(i).map(([t,e])=>U`
815
+ ${Object.entries(s).map(([t,e])=>U`
816
816
  <div class="item-detail-row">
817
817
  <span class="item-detail-label">${t}:</span>
818
818
  <span class="item-detail-value">${e}</span>
@@ -878,8 +878,8 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
878
878
  ${this.diff.items.removed.map(t=>U`
879
879
  <span class="diff__removed">− ${t.title}</span>
880
880
  `)}
881
- ${this.diff.items.modified.map(({item:t,oldQuantity:e,newQuantity:a})=>U`
882
- <span class="diff__modified">~ ${t.title}: ${e}→${a}</span>
881
+ ${this.diff.items.modified.map(({item:t,oldQuantity:e,newQuantity:i})=>U`
882
+ <span class="diff__modified">~ ${t.title}: ${e}→${i}</span>
883
883
  `)}
884
884
  </div>
885
885
  `:""}
@@ -897,8 +897,8 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
897
897
  </tr>
898
898
  </thead>
899
899
  <tbody>
900
- ${this.cart.items.map((t,e)=>{var a,i;const s=this.expandedItems.has(t.key),o=t.original_line_price&&t.original_line_price>t.line_price,r=this._getDiscountPercent(t.original_line_price,t.line_price),n=t.properties&&Object.keys(t.properties).length>0,l=!!t.selling_plan_allocation;return U`
901
- <tr class="item-row ${s?"expanded":""}" @click=${()=>this._toggleItemExpand(t.key)}>
900
+ ${this.cart.items.map((t,e)=>{var i,s;const a=this.expandedItems.has(t.key),r=t.original_line_price&&t.original_line_price>t.line_price,n=this._getDiscountPercent(t.original_line_price,t.line_price),o=t.properties&&Object.keys(t.properties).length>0,l=!!t.selling_plan_allocation;return U`
901
+ <tr class="item-row ${a?"expanded":""}" @click=${()=>this._toggleItemExpand(t.key)}>
902
902
  <td class="col-img">
903
903
  ${t.image?U`<img class="item-img" src="${t.image.replace(/(\.[^.]+)$/,"_60x60$1")}" alt="">`:U`<div class="item-img"></div>`}
904
904
  </td>
@@ -907,10 +907,10 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
907
907
  ${t.variant_title?U`<div class="item-variant">${t.variant_title}</div>`:""}
908
908
  ${l?U`
909
909
  <span class="selling-plan-badge" style="margin-top: 2px;">
910
- 🔄 ${(null==(i=null==(a=t.selling_plan_allocation)?void 0:a.selling_plan)?void 0:i.name)||"Subscription"}
910
+ 🔄 ${(null==(s=null==(i=t.selling_plan_allocation)?void 0:i.selling_plan)?void 0:s.name)||"Subscription"}
911
911
  </span>
912
912
  `:""}
913
- ${n?U`
913
+ ${o?U`
914
914
  <div style="font-size: calc(9px * var(--tdt-scale, 1)); color: var(--tdt-text-muted); margin-top: 2px;">
915
915
  ${Object.keys(t.properties).length} properties
916
916
  </div>
@@ -928,19 +928,19 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
928
928
  >
929
929
  </td>
930
930
  <td class="item-price">
931
- ${o?U`
931
+ ${r?U`
932
932
  <span class="compare-price">${this._formatMoney(t.original_line_price)}</span>
933
933
  `:""}
934
934
  ${this._formatMoney(t.line_price)}
935
- ${r>0?U`
936
- <span class="sale-badge">-${r}%</span>
935
+ ${n>0?U`
936
+ <span class="sale-badge">-${n}%</span>
937
937
  `:""}
938
938
  </td>
939
939
  <td>
940
940
  <button class="remove-btn" @click=${t=>{t.stopPropagation(),this._remove(e)}} title="Remove">×</button>
941
941
  </td>
942
942
  </tr>
943
- ${s?U`
943
+ ${a?U`
944
944
  <tr>
945
945
  <td colspan="6" style="padding: 0;">
946
946
  ${this._renderItemExpanded(t)}
@@ -951,7 +951,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
951
951
  </tbody>
952
952
  </table>
953
953
  `}
954
- `}}__publicField($t,"properties",{cart:{type:Object},previousCart:{type:Object,state:!0},diff:{type:Object,state:!0},showHistory:{type:Boolean,state:!0},cartHistory:{type:Array,state:!0},showAddProduct:{type:Boolean,state:!0},showAttributes:{type:Boolean,state:!0},showDiscountInput:{type:Boolean,state:!0},expandedItems:{type:Set,state:!0},variantIdInput:{type:String,state:!0},quantityInput:{type:Number,state:!0},discountInput:{type:String,state:!0},editingNote:{type:Boolean,state:!0},noteInput:{type:String,state:!0},editingAttributes:{type:Boolean,state:!0},attributesInput:{type:Object,state:!0}}),__publicField($t,"styles",[pt,r`
954
+ `}}__publicField(St,"properties",{cart:{type:Object},previousCart:{type:Object,state:!0},diff:{type:Object,state:!0},showHistory:{type:Boolean,state:!0},cartHistory:{type:Array,state:!0},showAddProduct:{type:Boolean,state:!0},showAttributes:{type:Boolean,state:!0},showDiscountInput:{type:Boolean,state:!0},expandedItems:{type:Set,state:!0},variantIdInput:{type:String,state:!0},quantityInput:{type:Number,state:!0},discountInput:{type:String,state:!0},editingNote:{type:Boolean,state:!0},noteInput:{type:String,state:!0},editingAttributes:{type:Boolean,state:!0},attributesInput:{type:Object,state:!0}}),__publicField(St,"styles",[pt,n`
955
955
  :host {
956
956
  display: block;
957
957
  padding: 8px 12px;
@@ -1175,7 +1175,6 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1175
1175
 
1176
1176
  .history-changes span {
1177
1177
  font-size: calc(10px * var(--tdt-scale, 1));
1178
- max-width: 200px;
1179
1178
  overflow: hidden;
1180
1179
  text-overflow: ellipsis;
1181
1180
  white-space: nowrap;
@@ -1585,7 +1584,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1585
1584
  font-size: calc(10px * var(--tdt-scale, 1));
1586
1585
  margin-left: 8px;
1587
1586
  }
1588
- `]),customElements.define("tdt-cart-panel",$t);class St extends nt{constructor(){super(),this.meta={}}_renderSection(t,e){return U`
1587
+ `]),customElements.define("tdt-cart-panel",St);class Tt extends ot{constructor(){super(),this.meta={}}_renderSection(t,e){return U`
1589
1588
  <div class="section">
1590
1589
  <h4 class="section__title">${t}</h4>
1591
1590
  <table class="table">
@@ -1597,9 +1596,9 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1597
1596
  `)}
1598
1597
  </table>
1599
1598
  </div>
1600
- `}render(){var t,e,a,i,s,o,r,n,l,d,c,p,h,u,v,g,m,b,f,x,_,y,w,k,$,S,C;if(!this.meta)return U`<div class="empty-state">No metadata available</div>`;const T=[{title:"Theme",items:[["ID",null==(t=this.meta.theme)?void 0:t.id],["Name",null==(e=this.meta.theme)?void 0:e.name],["Role",null==(a=this.meta.theme)?void 0:a.role]]},{title:"Template",items:[["Name",null==(i=this.meta.template)?void 0:i.name],["Suffix",(null==(s=this.meta.template)?void 0:s.suffix)||"—"],["Directory",(null==(o=this.meta.template)?void 0:o.directory)||"—"]]},{title:"Request",items:[["Page Type",null==(r=this.meta.request)?void 0:r.page_type],["Path",null==(n=this.meta.request)?void 0:n.path],["Host",null==(l=this.meta.request)?void 0:l.host],["Design Mode",(null==(d=this.meta.request)?void 0:d.design_mode)?"Yes":"No"],["Visual Preview",(null==(c=this.meta.request)?void 0:c.visual_preview_mode)?"Yes":"No"]]},{title:"Localization",items:[["Locale",`${(null==(h=null==(p=this.meta.request)?void 0:p.locale)?void 0:h.name)||""} (${(null==(v=null==(u=this.meta.request)?void 0:u.locale)?void 0:v.iso_code)||""})`],["Country",`${(null==(m=null==(g=this.meta.localization)?void 0:g.country)?void 0:m.name)||""} (${(null==(f=null==(b=this.meta.localization)?void 0:b.country)?void 0:f.iso_code)||""})`],["Currency",`${(null==(y=null==(_=null==(x=this.meta.localization)?void 0:x.country)?void 0:_.currency)?void 0:y.symbol)||""} ${(null==($=null==(k=null==(w=this.meta.localization)?void 0:w.country)?void 0:k.currency)?void 0:$.iso_code)||""}`],["Market",(null==(C=null==(S=this.meta.localization)?void 0:S.market)?void 0:C.handle)||"—"]]}];return U`
1601
- ${T.map(t=>this._renderSection(t.title,t.items))}
1602
- `}}__publicField(St,"properties",{meta:{type:Object}}),__publicField(St,"styles",[pt,r`
1599
+ `}render(){var t,e,i,s,a,r,n,o,l,c,d,p,h,u,g,v,m,f,b,y,x,_,w,k,$,S,T;if(!this.meta)return U`<div class="empty-state">No metadata available</div>`;const C=[{title:"Theme",items:[["ID",null==(t=this.meta.theme)?void 0:t.id],["Name",null==(e=this.meta.theme)?void 0:e.name],["Role",null==(i=this.meta.theme)?void 0:i.role]]},{title:"Template",items:[["Name",null==(s=this.meta.template)?void 0:s.name],["Suffix",(null==(a=this.meta.template)?void 0:a.suffix)||"—"],["Directory",(null==(r=this.meta.template)?void 0:r.directory)||"—"]]},{title:"Request",items:[["Page Type",null==(n=this.meta.request)?void 0:n.page_type],["Path",null==(o=this.meta.request)?void 0:o.path],["Host",null==(l=this.meta.request)?void 0:l.host],["Design Mode",(null==(c=this.meta.request)?void 0:c.design_mode)?"Yes":"No"],["Visual Preview",(null==(d=this.meta.request)?void 0:d.visual_preview_mode)?"Yes":"No"]]},{title:"Localization",items:[["Locale",`${(null==(h=null==(p=this.meta.request)?void 0:p.locale)?void 0:h.name)||""} (${(null==(g=null==(u=this.meta.request)?void 0:u.locale)?void 0:g.iso_code)||""})`],["Country",`${(null==(m=null==(v=this.meta.localization)?void 0:v.country)?void 0:m.name)||""} (${(null==(b=null==(f=this.meta.localization)?void 0:f.country)?void 0:b.iso_code)||""})`],["Currency",`${(null==(_=null==(x=null==(y=this.meta.localization)?void 0:y.country)?void 0:x.currency)?void 0:_.symbol)||""} ${(null==($=null==(k=null==(w=this.meta.localization)?void 0:w.country)?void 0:k.currency)?void 0:$.iso_code)||""}`],["Market",(null==(T=null==(S=this.meta.localization)?void 0:S.market)?void 0:T.handle)||"—"]]}];return U`
1600
+ ${C.map(t=>this._renderSection(t.title,t.items))}
1601
+ `}}__publicField(Tt,"properties",{meta:{type:Object}}),__publicField(Tt,"styles",[pt,n`
1603
1602
  :host {
1604
1603
  display: block;
1605
1604
  padding: 12px;
@@ -1641,24 +1640,24 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1641
1640
  color: var(--tdt-text);
1642
1641
  word-break: break-all;
1643
1642
  }
1644
- `]),customElements.define("tdt-info-panel",St);const Ct=class t extends nt{constructor(){super(),this.metafields=null,this.metafieldsSchema=null,this.searchQuery="",this.expandedPaths=new Set,this.copiedPath=null,this.showEmptyFields=!0,this.activeResource=null}_getMergedData(){var t,e,a;const i={},s=this.metafieldsSchema||{},o=this.metafields||{};for(const[r,n]of Object.entries(s))if(Array.isArray(n)&&0!==n.length){i[r]={schema:n,values:o[r]||{},byNamespace:{}};for(const a of n){const s=a.namespace;i[r].byNamespace[s]||(i[r].byNamespace[s]=[]);const n=null==(e=null==(t=o[r])?void 0:t[s])?void 0:e[a.key];i[r].byNamespace[s].push({...a,hasValue:null!=n,actualValue:null==n?void 0:n.value,actualType:null==n?void 0:n.type})}}for(const[r,n]of Object.entries(o))if(n&&"object"==typeof n){i[r]||(i[r]={schema:[],values:n,byNamespace:{}});for(const[t,e]of Object.entries(n))if(e&&"object"==typeof e){i[r].byNamespace[t]||(i[r].byNamespace[t]=[]);for(const[s,o]of Object.entries(e)){(null==(a=i[r].byNamespace[t])?void 0:a.find(t=>t.key===s))||i[r].byNamespace[t].push({key:s,namespace:t,name:s,description:"",type:{name:(null==o?void 0:o.type)||"unknown",category:"UNKNOWN"},hasValue:!0,actualValue:null==o?void 0:o.value,actualType:null==o?void 0:o.type})}}}return i}_getResourceStats(t){let e=0,a=0;for(const i of Object.values(t.byNamespace))e+=i.length,a+=i.filter(t=>t.hasValue).length;return{total:e,filled:a}}_getTypeClass(t){if(!t)return"unknown";const e=t.toLowerCase().replace(/\./g,"_");return e.startsWith("list_")?"list":e.includes("text")?e.includes("multi")||e.includes("rich")?"multi_line_text_field":"single_line_text_field":e.includes("number")||e.includes("integer")||e.includes("decimal")?"number_integer":e.includes("boolean")?"boolean":e.includes("json")?"json":e.includes("date")?"date":e.includes("url")?"url":e.includes("color")?"color":e.includes("file")?"file_reference":e.includes("product")||e.includes("collection")||e.includes("metaobject")?"product_reference":e.includes("rating")?"rating":e.includes("money")?"money":"unknown"}_toggleNamespace(t){const e=new Set(this.expandedPaths);e.has(t)?e.delete(t):e.add(t),this.expandedPaths=e}async _copyLiquidPath(t,e,a,i){null==i||i.stopPropagation();const s=`{{ ${t}.metafields.${e}.${a} }}`;try{await navigator.clipboard.writeText(s),this.copiedPath=`${t}.${e}.${a}`,setTimeout(()=>{this.copiedPath=null},1500)}catch(o){console.error("Failed to copy:",o)}}async _copyValue(t,e){null==e||e.stopPropagation();const a="object"==typeof t?JSON.stringify(t,null,2):String(t);try{await navigator.clipboard.writeText(a)}catch(i){console.error("Failed to copy value:",i)}}_formatValue(t){if(null==t)return U`<span class="value--null">null</span>`;if("object"==typeof t){const e=JSON.stringify(t,null,2);return U`<span class="value--json">${e}</span>`}return"string"==typeof t?U`<span class="value--string">"${t}"</span>`:"number"==typeof t?U`<span class="value--number">${t}</span>`:"boolean"==typeof t?U`<span class="value--boolean">${t}</span>`:U`<span>${String(t)}</span>`}_deepSearchValue(t,e){if(null==t)return!1;if("object"!=typeof t)return String(t).toLowerCase().includes(e);if(Array.isArray(t))return t.some(t=>this._deepSearchValue(t,e));for(const[a,i]of Object.entries(t)){if(a.toLowerCase().includes(e))return!0;if(this._deepSearchValue(i,e))return!0}return!1}_filterData(t){if(!this.searchQuery.trim())return t;const e=this.searchQuery.toLowerCase(),a={};for(const[i,s]of Object.entries(t)){const t={};for(const[a,i]of Object.entries(s.byNamespace)){const s=i.filter(t=>{var i,s;const o=t.key.toLowerCase().includes(e),r=a.toLowerCase().includes(e),n=null==(i=t.name)?void 0:i.toLowerCase().includes(e),l=null==(s=t.description)?void 0:s.toLowerCase().includes(e),d=void 0!==t.actualValue&&null!==t.actualValue&&this._deepSearchValue(t.actualValue,e);return o||r||n||l||d});s.length>0&&(t[a]=s)}Object.keys(t).length>0&&(a[i]={...s,byNamespace:t})}return a}_renderMetafield(t,e){var a,i;const s=`${t}.${e.namespace}.${e.key}`,o=this.copiedPath===s,r=(null==(a=e.type)?void 0:a.name)||e.actualType||"unknown";return this.showEmptyFields||e.hasValue?U`
1643
+ `]),customElements.define("tdt-info-panel",Tt);class Ct extends ot{constructor(){super(),this.metafields=null,this.metafieldsSchema=null,this.searchQuery="",this.expandedPaths=new Set,this.copiedPath=null,this.showEmptyFields=!0,this.activeResource=null}_getMergedData(){var t,e,i;const s={},a=this.metafieldsSchema||{},r=this.metafields||{};for(const[n,o]of Object.entries(a))if(Array.isArray(o)&&0!==o.length){s[n]={schema:o,values:r[n]||{},byNamespace:{}};for(const i of o){const a=i.namespace;s[n].byNamespace[a]||(s[n].byNamespace[a]=[]);const o=null==(e=null==(t=r[n])?void 0:t[a])?void 0:e[i.key];s[n].byNamespace[a].push({...i,hasValue:null!=o,actualValue:null==o?void 0:o.value,actualType:null==o?void 0:o.type})}}for(const[n,o]of Object.entries(r))if(o&&"object"==typeof o){s[n]||(s[n]={schema:[],values:o,byNamespace:{}});for(const[t,e]of Object.entries(o))if(e&&"object"==typeof e){s[n].byNamespace[t]||(s[n].byNamespace[t]=[]);for(const[a,r]of Object.entries(e)){(null==(i=s[n].byNamespace[t])?void 0:i.find(t=>t.key===a))||s[n].byNamespace[t].push({key:a,namespace:t,name:a,description:"",type:{name:(null==r?void 0:r.type)||"unknown",category:"UNKNOWN"},hasValue:!0,actualValue:null==r?void 0:r.value,actualType:null==r?void 0:r.type})}}}return s}_getResourceStats(t){let e=0,i=0;for(const s of Object.values(t.byNamespace))e+=s.length,i+=s.filter(t=>t.hasValue).length;return{total:e,filled:i}}_getTypeClass(t){if(!t)return"unknown";const e=t.toLowerCase().replace(/\./g,"_");return e.startsWith("list_")?"list":e.includes("text")?e.includes("multi")||e.includes("rich")?"multi_line_text_field":"single_line_text_field":e.includes("number")||e.includes("integer")||e.includes("decimal")?"number_integer":e.includes("boolean")?"boolean":e.includes("json")?"json":e.includes("date")?"date":e.includes("url")?"url":e.includes("color")?"color":e.includes("file")?"file_reference":e.includes("product")||e.includes("collection")||e.includes("metaobject")?"product_reference":e.includes("rating")?"rating":e.includes("money")?"money":"unknown"}_toggleNamespace(t){const e=new Set(this.expandedPaths);e.has(t)?e.delete(t):e.add(t),this.expandedPaths=e}async _copyLiquidPath(t,e,i,s){null==s||s.stopPropagation();const a=`{{ ${t}.metafields.${e}.${i} }}`;try{await navigator.clipboard.writeText(a),this.copiedPath=`${t}.${e}.${i}`,setTimeout(()=>{this.copiedPath=null},1500)}catch(r){console.error("Failed to copy:",r)}}async _copyValue(t,e){null==e||e.stopPropagation();const i="object"==typeof t?JSON.stringify(t,null,2):String(t);try{await navigator.clipboard.writeText(i)}catch(s){console.error("Failed to copy value:",s)}}_formatValue(t){if(null==t)return U`<span class="value--null">null</span>`;if("object"==typeof t){const e=JSON.stringify(t,null,2);return U`<span class="value--json">${e}</span>`}return"string"==typeof t?U`<span class="value--string">"${t}"</span>`:"number"==typeof t?U`<span class="value--number">${t}</span>`:"boolean"==typeof t?U`<span class="value--boolean">${t}</span>`:U`<span>${String(t)}</span>`}_deepSearchValue(t,e){if(null==t)return!1;if("object"!=typeof t)return String(t).toLowerCase().includes(e);if(Array.isArray(t))return t.some(t=>this._deepSearchValue(t,e));for(const[i,s]of Object.entries(t)){if(i.toLowerCase().includes(e))return!0;if(this._deepSearchValue(s,e))return!0}return!1}_filterData(t){if(!this.searchQuery.trim())return t;const e=this.searchQuery.toLowerCase(),i={};for(const[s,a]of Object.entries(t)){const t={};for(const[i,s]of Object.entries(a.byNamespace)){const a=s.filter(t=>{var s,a;const r=t.key.toLowerCase().includes(e),n=i.toLowerCase().includes(e),o=null==(s=t.name)?void 0:s.toLowerCase().includes(e),l=null==(a=t.description)?void 0:a.toLowerCase().includes(e),c=void 0!==t.actualValue&&null!==t.actualValue&&this._deepSearchValue(t.actualValue,e);return r||n||o||l||c});a.length>0&&(t[i]=a)}Object.keys(t).length>0&&(i[s]={...a,byNamespace:t})}return i}_renderMetafield(t,e){var i,s;const a=`${t}.${e.namespace}.${e.key}`,r=this.copiedPath===a,n=(null==(i=e.type)?void 0:i.name)||e.actualType||"unknown";return this.showEmptyFields||e.hasValue?U`
1645
1644
  <div class="metafield ${e.hasValue?"":"metafield--empty"}">
1646
1645
  <div class="metafield__header">
1647
1646
  <span
1648
- class="metafield__key ${o?"metafield__key--copied":""}"
1649
- @click=${a=>this._copyLiquidPath(t,e.namespace,e.key,a)}
1647
+ class="metafield__key ${r?"metafield__key--copied":""}"
1648
+ @click=${i=>this._copyLiquidPath(t,e.namespace,e.key,i)}
1650
1649
  title="Click to copy Liquid path"
1651
1650
  >${e.key}</span>
1652
- <span class="metafield__type type--${this._getTypeClass(r)}">${r}</span>
1653
- ${(null==(i=e.type)?void 0:i.category)?U`
1651
+ <span class="metafield__type type--${this._getTypeClass(n)}">${n}</span>
1652
+ ${(null==(s=e.type)?void 0:s.category)?U`
1654
1653
  <span class="metafield__category">${e.type.category}</span>
1655
1654
  `:""}
1656
1655
  <div class="metafield__actions">
1657
1656
  <button
1658
1657
  class="action-btn"
1659
- @click=${a=>this._copyLiquidPath(t,e.namespace,e.key,a)}
1658
+ @click=${i=>this._copyLiquidPath(t,e.namespace,e.key,i)}
1660
1659
  title="Copy Liquid path"
1661
- >${o?"✓":"📋"}</button>
1660
+ >${r?"✓":"📋"}</button>
1662
1661
  ${e.hasValue?U`
1663
1662
  <button
1664
1663
  class="action-btn"
@@ -1678,35 +1677,35 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1678
1677
  ${e.hasValue?this._formatValue(e.actualValue):U`No value set`}
1679
1678
  </div>
1680
1679
  </div>
1681
- `:""}_renderNamespace(t,e,a){const i=`${t}.${e}`,s=this.expandedPaths.has(i),o=a.filter(t=>t.hasValue).length,r=a.length,n=this.showEmptyFields?a:a.filter(t=>t.hasValue);return 0===n.length?"":U`
1680
+ `:""}_renderNamespace(t,e,i){const s=`${t}.${e}`,a=this.expandedPaths.has(s),r=i.filter(t=>t.hasValue).length,n=i.length,o=this.showEmptyFields?i:i.filter(t=>t.hasValue);return 0===o.length?"":U`
1682
1681
  <div class="namespace-group">
1683
- <div class="namespace-header" @click=${()=>this._toggleNamespace(i)}>
1684
- <span class="expand-icon ${s?"expand-icon--open":""}">▶</span>
1682
+ <div class="namespace-header" @click=${()=>this._toggleNamespace(s)}>
1683
+ <span class="expand-icon ${a?"expand-icon--open":""}">▶</span>
1685
1684
  <span class="namespace-name">${e}</span>
1686
1685
  <span class="namespace-stats">
1687
- <span class="namespace-stats__filled">${o} filled</span>
1688
- <span>/ ${r} total</span>
1686
+ <span class="namespace-stats__filled">${r} filled</span>
1687
+ <span>/ ${n} total</span>
1689
1688
  </span>
1690
1689
  </div>
1691
- ${s?U`
1690
+ ${a?U`
1692
1691
  <div class="metafield-list">
1693
- ${n.map(e=>this._renderMetafield(t,e))}
1692
+ ${o.map(e=>this._renderMetafield(t,e))}
1694
1693
  </div>
1695
1694
  `:""}
1696
1695
  </div>
1697
- `}render(){const e=this._getMergedData(),a=this.metafieldsSchema&&Object.keys(this.metafieldsSchema).length>0;if(!(Object.keys(e).length>0))return U`
1696
+ `}render(){const t=this._getMergedData(),e=this.metafieldsSchema&&Object.keys(this.metafieldsSchema).length>0;if(!(Object.keys(t).length>0))return U`
1698
1697
  <div class="empty-state">
1699
1698
  <div class="empty-state__icon">🏷️</div>
1700
1699
  <div class="empty-state__title">No Metafields Found</div>
1701
1700
  <div class="empty-state__hint">
1702
- ${a?"No metafields are defined in your metafields.json schema.":"Paste your metafields.json content into the devtools bridge snippet to see all defined metafields."}
1701
+ ${e?"No metafields are defined in your metafields.json schema.":"Paste your metafields.json content into the devtools bridge snippet to see all defined metafields."}
1703
1702
  </div>
1704
1703
  </div>
1705
- `;const i=this._filterData(e),s=Object.keys(i);this.activeResource&&i[this.activeResource]||(this.activeResource=s[0]);const o=i[this.activeResource],r=o&&Object.keys(o.byNamespace).length>0;let n=0,l=0;for(const t of Object.values(e)){const e=this._getResourceStats(t);n+=e.total,l+=e.filled}return U`
1706
- ${a?U`
1704
+ `;const i=this._filterData(t),s=Object.keys(i);this.activeResource&&i[this.activeResource]||(this.activeResource=s[0]);const a=i[this.activeResource],r=a&&Object.keys(a.byNamespace).length>0;let n=0,o=0;for(const l of Object.values(t)){const t=this._getResourceStats(l);n+=t.total,o+=t.filled}return U`
1705
+ ${e?U`
1707
1706
  <div class="schema-notice">
1708
1707
  <div class="schema-notice__title">📋 Schema Loaded</div>
1709
- Showing all ${n} defined metafields. ${l} have values.
1708
+ Showing all ${n} defined metafields. ${o} have values.
1710
1709
  </div>
1711
1710
  `:""}
1712
1711
 
@@ -1727,20 +1726,20 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1727
1726
  </div>
1728
1727
 
1729
1728
  <div class="resource-tabs">
1730
- ${s.map(e=>{const a=this._getResourceStats(i[e]),s=0===a.total;return U`
1729
+ ${s.map(t=>{const e=this._getResourceStats(i[t]),s=0===e.total;return U`
1731
1730
  <button
1732
- class="resource-tab ${this.activeResource===e?"resource-tab--active":""} ${s?"resource-tab--empty":""}"
1733
- @click=${()=>this.activeResource=e}
1731
+ class="resource-tab ${this.activeResource===t?"resource-tab--active":""} ${s?"resource-tab--empty":""}"
1732
+ @click=${()=>this.activeResource=t}
1734
1733
  >
1735
- ${t.RESOURCE_ICONS[e]||"📋"} ${e}
1736
- <span class="resource-tab__count">${a.total}</span>
1737
- ${a.filled>0?U`<span class="resource-tab__filled">✓${a.filled}</span>`:""}
1734
+ ${t}
1735
+ <span class="resource-tab__count">${e.total}</span>
1736
+ ${e.filled>0?U`<span class="resource-tab__filled">✓${e.filled}</span>`:""}
1738
1737
  </button>
1739
1738
  `})}
1740
1739
  </div>
1741
1740
 
1742
- ${r?Object.entries(o.byNamespace).map(([t,e])=>this._renderNamespace(this.activeResource,t,e)):U`<div class="no-results">No metafields match "${this.searchQuery}"</div>`}
1743
- `}};__publicField(Ct,"properties",{metafields:{type:Object},metafieldsSchema:{type:Object},searchQuery:{type:String,state:!0},expandedPaths:{type:Object,state:!0},copiedPath:{type:String,state:!0},showEmptyFields:{type:Boolean,state:!0},activeResource:{type:String,state:!0}}),__publicField(Ct,"styles",[pt,r`
1741
+ ${r?Object.entries(a.byNamespace).map(([t,e])=>this._renderNamespace(this.activeResource,t,e)):U`<div class="no-results">No metafields match "${this.searchQuery}"</div>`}
1742
+ `}}__publicField(Ct,"properties",{metafields:{type:Object},metafieldsSchema:{type:Object},searchQuery:{type:String,state:!0},expandedPaths:{type:Object,state:!0},copiedPath:{type:String,state:!0},showEmptyFields:{type:Boolean,state:!0},activeResource:{type:String,state:!0}}),__publicField(Ct,"styles",[pt,n`
1744
1743
  :host {
1745
1744
  display: block;
1746
1745
  padding: 8px 12px;
@@ -2114,7 +2113,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2114
2113
  margin-bottom: 4px;
2115
2114
  color: var(--tdt-accent);
2116
2115
  }
2117
- `]),__publicField(Ct,"RESOURCE_ICONS",{shop:"🏪",product:"📦",variant:"🏷️",collection:"📂",customer:"👤",article:"📝",blog:"📰",page:"📄",order:"🧾",company:"🏢",company_location:"📍",location:"📍",market:"🌍"});let Tt=Ct;customElements.define("tdt-metafields-panel",Tt);class Et extends nt{constructor(){super(),this.cookies=[],this.filter="",this.editingCookie=null,this.newCookie=null}connectedCallback(){super.connectedCallback(),this._loadCookies()}_loadCookies(){const t=document.cookie;this.cookies=t?t.split(";").map(t=>{const[e,...a]=t.trim().split("="),i=a.join("=");return{name:e.trim(),value:decodeURIComponent(i||""),rawValue:i}}).filter(t=>t.name):[]}_filterCookies(t){this.filter=t.target.value}_getFilteredCookies(){if(!this.filter)return this.cookies;const t=this.filter.toLowerCase();return this.cookies.filter(e=>e.name.toLowerCase().includes(t)||e.value.toLowerCase().includes(t))}_copyValue(t){navigator.clipboard.writeText(t.value)}_copyName(t){navigator.clipboard.writeText(t.name)}_deleteCookie(t){document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${window.location.hostname}`,this._loadCookies()}_openAddModal(){this.newCookie={name:"",value:"",path:"/",days:7,secure:"https:"===window.location.protocol,sameSite:"Lax"}}_openEditModal(t){this.editingCookie={originalName:t.name,name:t.name,value:t.value,path:"/",days:7,secure:"https:"===window.location.protocol,sameSite:"Lax"}}_closeModal(){this.newCookie=null,this.editingCookie=null}_saveCookie(){const t=this.newCookie||this.editingCookie;if(!t||!t.name)return;this.editingCookie&&this.editingCookie.originalName!==t.name&&this._deleteCookie({name:this.editingCookie.originalName});const e=new Date;e.setTime(e.getTime()+24*t.days*60*60*1e3);let a=`${encodeURIComponent(t.name)}=${encodeURIComponent(t.value)}`;a+=`; expires=${e.toUTCString()}`,a+=`; path=${t.path}`,t.secure&&(a+="; secure"),a+=`; samesite=${t.sameSite}`,document.cookie=a,this._loadCookies(),this._closeModal()}_updateCookieField(t,e){this.newCookie?this.newCookie={...this.newCookie,[t]:e}:this.editingCookie&&(this.editingCookie={...this.editingCookie,[t]:e})}_formatSize(t){const e=new Blob([t]).size;return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}_clearAllCookies(){0!==this.cookies.length&&confirm(`Clear all ${this.cookies.length} cookies? This may log you out.`)&&(this.cookies.forEach(t=>{document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${window.location.hostname}`}),this._loadCookies())}_renderModal(){const t=this.newCookie||this.editingCookie;if(!t)return null;const e=!!this.editingCookie;return U`
2116
+ `]),customElements.define("tdt-metafields-panel",Ct);class Et extends ot{constructor(){super(),this.cookies=[],this.filter="",this.editingCookie=null,this.newCookie=null}connectedCallback(){super.connectedCallback(),this._loadCookies()}_loadCookies(){const t=document.cookie;this.cookies=t?t.split(";").map(t=>{const[e,...i]=t.trim().split("="),s=i.join("=");return{name:e.trim(),value:decodeURIComponent(s||""),rawValue:s}}).filter(t=>t.name):[]}_filterCookies(t){this.filter=t.target.value}_getFilteredCookies(){if(!this.filter)return this.cookies;const t=this.filter.toLowerCase();return this.cookies.filter(e=>e.name.toLowerCase().includes(t)||e.value.toLowerCase().includes(t))}_copyValue(t){navigator.clipboard.writeText(t.value)}_copyName(t){navigator.clipboard.writeText(t.name)}_deleteCookie(t){document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${window.location.hostname}`,this._loadCookies()}_openAddModal(){this.newCookie={name:"",value:"",path:"/",days:7,secure:"https:"===window.location.protocol,sameSite:"Lax"}}_openEditModal(t){this.editingCookie={originalName:t.name,name:t.name,value:t.value,path:"/",days:7,secure:"https:"===window.location.protocol,sameSite:"Lax"}}_closeModal(){this.newCookie=null,this.editingCookie=null}_saveCookie(){const t=this.newCookie||this.editingCookie;if(!t||!t.name)return;this.editingCookie&&this.editingCookie.originalName!==t.name&&this._deleteCookie({name:this.editingCookie.originalName});const e=new Date;e.setTime(e.getTime()+24*t.days*60*60*1e3);let i=`${encodeURIComponent(t.name)}=${encodeURIComponent(t.value)}`;i+=`; expires=${e.toUTCString()}`,i+=`; path=${t.path}`,t.secure&&(i+="; secure"),i+=`; samesite=${t.sameSite}`,document.cookie=i,this._loadCookies(),this._closeModal()}_updateCookieField(t,e){this.newCookie?this.newCookie={...this.newCookie,[t]:e}:this.editingCookie&&(this.editingCookie={...this.editingCookie,[t]:e})}_formatSize(t){const e=new Blob([t]).size;return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}_clearAllCookies(){0!==this.cookies.length&&confirm(`Clear all ${this.cookies.length} cookies? This may log you out.`)&&(this.cookies.forEach(t=>{document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${window.location.hostname}`}),this._loadCookies())}_renderModal(){const t=this.newCookie||this.editingCookie;if(!t)return null;const e=!!this.editingCookie;return U`
2118
2117
  <div class="modal-overlay" @click=${this._closeModal}>
2119
2118
  <div class="modal" @click=${t=>t.stopPropagation()}>
2120
2119
  <div class="modal-title">${e?"Edit Cookie":"Add Cookie"}</div>
@@ -2236,7 +2235,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2236
2235
  </div>
2237
2236
  <div class="cookie-value">${t.value||"(empty)"}</div>
2238
2237
  <div class="cookie-meta">
2239
- <span>📦 ${this._formatSize(t.name+"="+t.value)}</span>
2238
+ <span>${this._formatSize(t.name+"="+t.value)}</span>
2240
2239
  </div>
2241
2240
  </div>
2242
2241
  `)}
@@ -2244,7 +2243,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2244
2243
  `}
2245
2244
 
2246
2245
  ${this._renderModal()}
2247
- `}}__publicField(Et,"properties",{cookies:{type:Array,state:!0},filter:{type:String,state:!0},editingCookie:{type:Object,state:!0},newCookie:{type:Object,state:!0}}),__publicField(Et,"styles",[pt,r`
2246
+ `}}__publicField(Et,"properties",{cookies:{type:Array,state:!0},filter:{type:String,state:!0},editingCookie:{type:Object,state:!0},newCookie:{type:Object,state:!0}}),__publicField(Et,"styles",[pt,n`
2248
2247
  :host {
2249
2248
  display: block;
2250
2249
  padding: 12px;
@@ -2519,7 +2518,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2519
2518
  font-weight: 600;
2520
2519
  color: var(--tdt-text);
2521
2520
  }
2522
- `]),customElements.define("tdt-cookies-panel",Et);class At extends nt{constructor(){super(),__publicField(this,"_handleStorageChange",()=>{this._loadItems()}),this.activeStorage="local",this.items=[],this.filter="",this.editingItem=null,this.newItem=null,this.expandedItems=new Set}connectedCallback(){super.connectedCallback(),this._loadItems(),window.addEventListener("storage",this._handleStorageChange)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("storage",this._handleStorageChange)}_getStorage(){return"local"===this.activeStorage?localStorage:sessionStorage}_loadItems(){const t=this._getStorage(),e=[];for(let a=0;a<t.length;a++){const i=t.key(a),s=t.getItem(i);let o=s,r=!1;try{o=JSON.parse(s),r="object"==typeof o&&null!==o}catch{r=!1}e.push({key:i,value:s,parsedValue:r?o:s,isJson:r,size:new Blob([s]).size})}e.sort((t,e)=>t.key.localeCompare(e.key)),this.items=e}_switchStorage(t){this.activeStorage=t,this.expandedItems=new Set,this._loadItems()}_filterItems(t){this.filter=t.target.value}_getFilteredItems(){if(!this.filter)return this.items;const t=this.filter.toLowerCase();return this.items.filter(e=>e.key.toLowerCase().includes(t)||e.value.toLowerCase().includes(t))}_toggleExpand(t,e){e.stopPropagation();const a=new Set(this.expandedItems);a.has(t)?a.delete(t):a.add(t),this.expandedItems=a}_copyKey(t,e){e.stopPropagation(),navigator.clipboard.writeText(t.key)}_copyValue(t,e){e.stopPropagation(),navigator.clipboard.writeText(t.value)}_deleteItem(t,e){e.stopPropagation(),this._getStorage().removeItem(t.key),this._loadItems()}_clearAll(){confirm(`Clear all ${"local"===this.activeStorage?"localStorage":"sessionStorage"} items?`)&&(this._getStorage().clear(),this._loadItems())}_openAddModal(){this.newItem={key:"",value:""}}_openEditModal(t,e){e.stopPropagation(),this.editingItem={originalKey:t.key,key:t.key,value:t.value}}_closeModal(){this.newItem=null,this.editingItem=null}_saveItem(){const t=this.newItem||this.editingItem;if(!t||!t.key)return;const e=this._getStorage();this.editingItem&&this.editingItem.originalKey!==t.key&&e.removeItem(this.editingItem.originalKey),e.setItem(t.key,t.value),this._loadItems(),this._closeModal()}_updateItemField(t,e){this.newItem?this.newItem={...this.newItem,[t]:e}:this.editingItem&&(this.editingItem={...this.editingItem,[t]:e})}_formatSize(t){return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}_getTotalSize(){return this.items.reduce((t,e)=>t+e.size+e.key.length,0)}_renderModal(){const t=this.newItem||this.editingItem;if(!t)return null;const e=!!this.editingItem;return U`
2521
+ `]),customElements.define("tdt-cookies-panel",Et);class At extends ot{constructor(){super(),__publicField(this,"_handleStorageChange",()=>{this._loadItems()}),this.activeStorage="local",this.items=[],this.filter="",this.editingItem=null,this.newItem=null,this.expandedItems=new Set}connectedCallback(){super.connectedCallback(),this._loadItems(),window.addEventListener("storage",this._handleStorageChange)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("storage",this._handleStorageChange)}_getStorage(){return"local"===this.activeStorage?localStorage:sessionStorage}_loadItems(){const t=this._getStorage(),e=[];for(let i=0;i<t.length;i++){const s=t.key(i),a=t.getItem(s);let r=a,n=!1;try{r=JSON.parse(a),n="object"==typeof r&&null!==r}catch{n=!1}e.push({key:s,value:a,parsedValue:n?r:a,isJson:n,size:new Blob([a]).size})}e.sort((t,e)=>t.key.localeCompare(e.key)),this.items=e}_switchStorage(t){this.activeStorage=t,this.expandedItems=new Set,this._loadItems()}_filterItems(t){this.filter=t.target.value}_getFilteredItems(){if(!this.filter)return this.items;const t=this.filter.toLowerCase();return this.items.filter(e=>e.key.toLowerCase().includes(t)||e.value.toLowerCase().includes(t))}_toggleExpand(t,e){e.stopPropagation();const i=new Set(this.expandedItems);i.has(t)?i.delete(t):i.add(t),this.expandedItems=i}_copyKey(t,e){e.stopPropagation(),navigator.clipboard.writeText(t.key)}_copyValue(t,e){e.stopPropagation(),navigator.clipboard.writeText(t.value)}_deleteItem(t,e){e.stopPropagation(),this._getStorage().removeItem(t.key),this._loadItems()}_clearAll(){confirm(`Clear all ${"local"===this.activeStorage?"localStorage":"sessionStorage"} items?`)&&(this._getStorage().clear(),this._loadItems())}_openAddModal(){this.newItem={key:"",value:""}}_openEditModal(t,e){e.stopPropagation(),this.editingItem={originalKey:t.key,key:t.key,value:t.value}}_closeModal(){this.newItem=null,this.editingItem=null}_saveItem(){const t=this.newItem||this.editingItem;if(!t||!t.key)return;const e=this._getStorage();this.editingItem&&this.editingItem.originalKey!==t.key&&e.removeItem(this.editingItem.originalKey),e.setItem(t.key,t.value),this._loadItems(),this._closeModal()}_updateItemField(t,e){this.newItem?this.newItem={...this.newItem,[t]:e}:this.editingItem&&(this.editingItem={...this.editingItem,[t]:e})}_formatSize(t){return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}_getTotalSize(){return this.items.reduce((t,e)=>t+e.size+e.key.length,0)}_renderModal(){const t=this.newItem||this.editingItem;if(!t)return null;const e=!!this.editingItem;return U`
2523
2522
  <div class="modal-overlay" @click=${this._closeModal}>
2524
2523
  <div class="modal" @click=${t=>t.stopPropagation()}>
2525
2524
  <div class="modal-title">${e?"Edit Item":"Add Item"}</div>
@@ -2557,21 +2556,21 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2557
2556
  .data=${t.parsedValue}
2558
2557
  .path=${`${this.activeStorage}Storage.${t.key}`}
2559
2558
  ></tdt-object-inspector>
2560
- `:U`<div class="item-value">${t.value}</div>`}render(){const t=this._getFilteredItems(),e=localStorage.length,a=sessionStorage.length;return U`
2559
+ `:U`<div class="item-value">${t.value}</div>`}render(){const t=this._getFilteredItems(),e=localStorage.length,i=sessionStorage.length;return U`
2561
2560
  <div class="storage-tabs">
2562
2561
  <button
2563
2562
  class="storage-tab ${"local"===this.activeStorage?"storage-tab--active":""}"
2564
2563
  @click=${()=>this._switchStorage("local")}
2565
2564
  >
2566
- 💾 localStorage
2565
+ localStorage
2567
2566
  <span class="storage-tab__count">${e}</span>
2568
2567
  </button>
2569
2568
  <button
2570
2569
  class="storage-tab ${"session"===this.activeStorage?"storage-tab--active":""}"
2571
2570
  @click=${()=>this._switchStorage("session")}
2572
2571
  >
2573
- ⏱️ sessionStorage
2574
- <span class="storage-tab__count">${a}</span>
2572
+ sessionStorage
2573
+ <span class="storage-tab__count">${i}</span>
2575
2574
  </button>
2576
2575
  </div>
2577
2576
 
@@ -2637,7 +2636,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2637
2636
  `}
2638
2637
 
2639
2638
  ${this._renderModal()}
2640
- `}}__publicField(At,"properties",{activeStorage:{type:String,state:!0},items:{type:Array,state:!0},filter:{type:String,state:!0},editingItem:{type:Object,state:!0},newItem:{type:Object,state:!0},expandedItems:{type:Set,state:!0}}),__publicField(At,"styles",[pt,r`
2639
+ `}}__publicField(At,"properties",{activeStorage:{type:String,state:!0},items:{type:Array,state:!0},filter:{type:String,state:!0},editingItem:{type:Object,state:!0},newItem:{type:Object,state:!0},expandedItems:{type:Set,state:!0}}),__publicField(At,"styles",[pt,n`
2641
2640
  :host {
2642
2641
  display: block;
2643
2642
  padding: 12px;
@@ -2964,7 +2963,11 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2964
2963
  font-weight: 600;
2965
2964
  color: var(--tdt-text);
2966
2965
  }
2967
- `]),customElements.define("tdt-storage-panel",At);const Ot=class t extends nt{constructor(){super(),this.logs=[],this.liquidErrors=[],this.filter="",this.activeFilter="all",this.showThemeOnly=!0,this.expandedLogs=new Set,this.groupedErrors=new Map,this.networkErrors=[],this.groupStack=[],this._originalConsole={},this._originalFetch=null,this._currentGroupId=null,this._loadPersistedLogs()}_loadPersistedLogs(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);if(e){const t=JSON.parse(e);this.logs=(t.logs||[]).map(t=>({...t,timestamp:new Date(t.timestamp),persisted:!0})),this.networkErrors=(t.networkErrors||[]).map(t=>({...t,timestamp:new Date(t.timestamp),persisted:!0})),this.logs.forEach(t=>{if("error"===t.type||"warn"===t.type){const e=this._getGroupKey(t),a=this.groupedErrors.get(e);a?a.count++:this.groupedErrors.set(e,{...t,count:1})}}),this.groupedErrors=new Map(this.groupedErrors)}}catch(e){console.warn("Failed to load persisted logs:",e)}}_persistLogs(){try{const e={logs:this.logs.slice(-500).map(t=>({...t,args:void 0})),networkErrors:this.networkErrors.slice(-100)};sessionStorage.setItem(t.STORAGE_KEY,JSON.stringify(e))}catch(e){}}_getGroupKey(t){let e=t.message||"";return e=e.replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/g,"[timestamp]"),e=e.replace(/\d{2}:\d{2}:\d{2}\.\d{3}/g,"[time]"),e=e.replace(/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/gi,"[uuid]"),e=e.replace(/\/\d+\//g,"/[id]/"),e=e.replace(/=\d+(&|$)/g,"=[num]$1"),`${t.type}:${e.substring(0,200)}`}connectedCallback(){super.connectedCallback(),this._interceptConsole(),this._interceptNetwork(),this._scanForLiquidErrors(),this._captureGlobalErrors()}disconnectedCallback(){super.disconnectedCallback(),this._restoreConsole(),this._restoreNetwork(),window.removeEventListener("error",this._handleGlobalError),window.removeEventListener("unhandledrejection",this._handleUnhandledRejection)}_interceptConsole(){const t=this;["log","info","warn","error","debug"].forEach(e=>{this._originalConsole[e]=console[e],console[e]=function(...a){t._addLog(e,a),t._originalConsole[e].apply(console,a)}}),this._originalConsole.table=console.table,console.table=function(e,a){t._addLog("table",[e],{columns:a,isTable:!0}),t._originalConsole.table.apply(console,[e,a])},this._originalConsole.group=console.group,this._originalConsole.groupCollapsed=console.groupCollapsed,this._originalConsole.groupEnd=console.groupEnd,console.group=function(...e){const a=Date.now()+Math.random();t._startGroup(e.join(" ")||"Group",a,!1),t._originalConsole.group.apply(console,e)},console.groupCollapsed=function(...e){const a=Date.now()+Math.random();t._startGroup(e.join(" ")||"Group",a,!0),t._originalConsole.groupCollapsed.apply(console,e)},console.groupEnd=function(){t._endGroup(),t._originalConsole.groupEnd.apply(console)}}_restoreConsole(){Object.keys(this._originalConsole).forEach(t=>{this._originalConsole[t]&&(console[t]=this._originalConsole[t])})}_startGroup(t,e,a){const i={id:e,type:"group",message:t,timestamp:new Date,isThemeRelated:this._isThemeRelated(t,""),collapsed:a,children:[],parentGroupId:this._currentGroupId};if(this._currentGroupId){const t=this._findGroupById(this._currentGroupId);t&&t.children.push(i)}else this.logs=[...this.logs,i];this.groupStack.push(e),this._currentGroupId=e}_endGroup(){this.groupStack.pop(),this._currentGroupId=this.groupStack.length>0?this.groupStack[this.groupStack.length-1]:null}_findGroupById(t,e=this.logs){for(const a of e){if(a.id===t)return a;if(a.children){const e=this._findGroupById(t,a.children);if(e)return e}}return null}_interceptNetwork(){const t=this;this._originalFetch=window.fetch,window.fetch=async function(e,a){const i="string"==typeof e?e:e.url,s=(null==a?void 0:a.method)||"GET",o=performance.now();try{const r=await t._originalFetch.apply(window,[e,a]),n=performance.now()-o;return r.ok||t._addNetworkError({url:i,method:s,status:r.status,statusText:r.statusText,duration:n,type:"fetch"}),r}catch(r){const e=performance.now()-o;throw t._addNetworkError({url:i,method:s,status:0,statusText:r.message||"Network Error",duration:e,type:"fetch",error:!0}),r}};const e=XMLHttpRequest.prototype.open,a=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(t,a){return this._tdtMethod=t,this._tdtUrl=a,this._tdtStartTime=null,e.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){return this._tdtStartTime=performance.now(),this.addEventListener("loadend",function(){const e=performance.now()-this._tdtStartTime;(this.status>=400||0===this.status)&&t._addNetworkError({url:this._tdtUrl,method:this._tdtMethod,status:this.status,statusText:this.statusText||(0===this.status?"Network Error":""),duration:e,type:"xhr"})}),a.apply(this,arguments)},this._originalXHROpen=e,this._originalXHRSend=a}_restoreNetwork(){this._originalFetch&&(window.fetch=this._originalFetch),this._originalXHROpen&&(XMLHttpRequest.prototype.open=this._originalXHROpen),this._originalXHRSend&&(XMLHttpRequest.prototype.send=this._originalXHRSend)}_addNetworkError(t){const e={id:Date.now()+Math.random(),...t,timestamp:new Date,isThemeRelated:this._isThemeRelated(t.url,"")};this.networkErrors=[...this.networkErrors,e],this._persistLogs()}_captureGlobalErrors(){this._handleGlobalError=t=>{var e;this._addLog("error",[t.message],{stack:null==(e=t.error)?void 0:e.stack,source:`${t.filename}:${t.lineno}:${t.colno}`})},this._handleUnhandledRejection=t=>{var e;this._addLog("error",[`Unhandled Promise Rejection: ${t.reason}`],{stack:null==(e=t.reason)?void 0:e.stack})},window.addEventListener("error",this._handleGlobalError),window.addEventListener("unhandledrejection",this._handleUnhandledRejection)}_addLog(t,e,a={}){const i=e.map(t=>{if("object"==typeof t)try{return JSON.stringify(t,null,2)}catch{return String(t)}return String(t)}).join(" "),s=this._isThemeRelated(i,a.source),o={id:Date.now()+Math.random(),type:t,message:i,args:e,timestamp:new Date,isThemeRelated:s,stack:a.stack,source:a.source,hasObjects:e.some(t=>"object"==typeof t&&null!==t),isTable:a.isTable||!1,tableColumns:a.columns,groupId:this._currentGroupId},r=this._getGroupKey(o),n=this.groupedErrors.get(r);if(!n||"error"!==t&&"warn"!==t)if("error"!==t&&"warn"!==t||(this.groupedErrors.set(r,{...o,count:1}),this.groupedErrors=new Map(this.groupedErrors)),this._currentGroupId){const t=this._findGroupById(this._currentGroupId);t?(t.children.push(o),this.logs=[...this.logs]):this.logs=[...this.logs,o]}else this.logs=[...this.logs,o];else n.count++,n.lastTime=o.timestamp,this.groupedErrors=new Map(this.groupedErrors);this._persistLogs()}_isThemeRelated(e,a=""){const i=(e+" "+a).toLowerCase();return t.THEME_KEYWORDS.some(t=>i.includes(t))}_scanForLiquidErrors(){const t=[],e=new Set,a=(a,i,s=null)=>{const o=a.trim();e.has(o)||(e.add(o),t.push({id:Date.now()+Math.random(),type:"liquid",category:i,message:o,timestamp:new Date,element:s?this._getElementPath(s):null}))},i=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null,!1);for(;i.nextNode();){const t=i.currentNode.textContent;(t.includes("Liquid error")||t.includes("Liquid syntax error"))&&a(t,"comment")}const s=document.body.innerHTML;[/Liquid\s+error\s*\(line\s*\d+\):\s*[^<\n]+/gi,/Liquid\s+error:\s*[^<\n]+/gi,/Liquid\s+syntax\s+error\s*\(line\s*\d+\):\s*[^<\n]+/gi,/Liquid\s+syntax\s+error:\s*[^<\n]+/gi,/Error\s+in\s+schema:\s*[^<\n]+/gi,/Invalid\s+JSON\s+in\s+schema\s+tag/gi,/Error\s+parsing\s+schema:\s*[^<\n]+/gi].forEach(t=>{let e;for(;null!==(e=t.exec(s));)a(e[0],"inline")});const o=/#<(?:Shopify::)?(?:Liquid::)?(\w+)Drop:0x[a-f0-9]+>/gi;let r;for(;null!==(r=o.exec(s));){const t=r[1];a(`Raw ${t} Drop object rendered: ${r[0]} — Use .title, .url, or other property instead of outputting the object directly`,"drop")}const n=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,{acceptNode:t=>{var e;const a=t.parentElement;if(!a)return NodeFilter.FILTER_REJECT;const i=null==(e=a.tagName)?void 0:e.toLowerCase();return"script"===i||"style"===i||"noscript"===i?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;n.nextNode();){const t=n.currentNode.textContent;if(/Liquid\s+(error|syntax error)/i.test(t)){const e=t.match(/Liquid\s+(?:error|syntax error)[^]*/i);e&&a(e[0],"text",n.currentNode.parentElement)}if(/#<\w+Drop:0x/i.test(t)){const e=t.match(/#<(?:Shopify::)?(?:Liquid::)?(\w+)Drop:0x[a-f0-9]+>/i);e&&a(`Raw ${e[1]} Drop object in page: ${e[0]}`,"drop",n.currentNode.parentElement)}/unknown\s+image\s+file/i.test(t)&&a(`Unknown image file error: ${t.substring(0,200)}`,"asset",n.currentNode.parentElement)}document.querySelectorAll("img").forEach(t=>{const e=t.src||t.dataset.src,i=t.alt;i&&/Liquid\s+error|Could\s+not\s+find\s+asset/i.test(i)&&a(`Image error: ${i}`,"asset",t),e&&/Liquid%20error|Could%20not%20find/i.test(e)&&a(`Broken image URL contains error: ${decodeURIComponent(e.substring(0,200))}`,"asset",t)});document.querySelectorAll(".shopify-section, [data-section-type], .template-").forEach(t=>{const e=t.textContent;if(/form\s+'product'\s+needs\s+a\s+product\s+object/i.test(e)&&a("Liquid error: form 'product' needs a product object","form",t),/form\s+'customer_address'\s+requires\s+an\s+address/i.test(e)&&a("Liquid error: form 'customer_address' requires an address","form",t),/invalid\s+form\s+type/i.test(e)){const i=e.match(/invalid\s+form\s+type\s*['"]?(\w+)['"]?/i);a(`Liquid error: invalid form type '${(null==i?void 0:i[1])||"unknown"}'`,"form",t)}}),this._checkDeprecations(),this.liquidErrors=t}_getElementPath(t){var e;if(!t)return null;const a=[];let i=t;for(;i&&i!==document.body&&a.length<5;){let t=(null==(e=i.tagName)?void 0:e.toLowerCase())||"";if(i.id)t+=`#${i.id}`;else if(i.className&&"string"==typeof i.className){const e=i.className.split(" ").filter(t=>t&&!t.startsWith("js-")).slice(0,2);e.length&&(t+=`.${e.join(".")}`)}t&&a.unshift(t),i=i.parentElement}return a.join(" > ")}_checkDeprecations(){document.querySelectorAll("script:not([src])");const e=document.documentElement.innerHTML;t.LIQUID_DEPRECATIONS.forEach(t=>{t.pattern.test(e)&&this._addLog("warn",[`Liquid Deprecation: ${t.message}`],{deprecation:t})})}_filterLogs(t){this.filter=t.target.value}_setFilter(t){this.activeFilter=t}_toggleThemeOnly(){this.showThemeOnly=!this.showThemeOnly}_clearLogs(){this.logs=[],this.networkErrors=[],this.groupedErrors=new Map,this.groupStack=[],this._currentGroupId=null,sessionStorage.removeItem(t.STORAGE_KEY)}_toggleExpand(t){const e=new Set(this.expandedLogs);e.has(t)?e.delete(t):e.add(t),this.expandedLogs=e}_getFilteredLogs(){let t=this.logs.filter(t=>!t.groupId);if(this.showThemeOnly&&(t=t.filter(t=>t.isThemeRelated)),"all"!==this.activeFilter)if("liquid"===this.activeFilter)t=t.filter(t=>t.message.toLowerCase().includes("liquid")||this.liquidErrors.some(e=>e.message===t.message));else{if("network"===this.activeFilter)return[];t="table"===this.activeFilter?t.filter(t=>t.isTable):"group"===this.activeFilter?t.filter(t=>"group"===t.type):t.filter(t=>t.type===this.activeFilter)}if(this.filter){const e=this.filter.toLowerCase();t=t.filter(t=>t.message.toLowerCase().includes(e))}return t}_getFilteredNetworkErrors(){let t=this.networkErrors;if(this.showThemeOnly&&(t=t.filter(t=>t.isThemeRelated)),this.filter){const e=this.filter.toLowerCase();t=t.filter(t=>t.url.toLowerCase().includes(e)||t.statusText.toLowerCase().includes(e))}return t}_getCounts(){const t=this.showThemeOnly?this.logs.filter(t=>t.isThemeRelated):this.logs,e=this.showThemeOnly?this.networkErrors.filter(t=>t.isThemeRelated):this.networkErrors;return{all:t.length+e.length,error:t.filter(t=>"error"===t.type).length,warn:t.filter(t=>"warn"===t.type).length,info:t.filter(t=>"info"===t.type).length,log:t.filter(t=>"log"===t.type||"debug"===t.type).length,liquid:this.liquidErrors.length,network:e.length,table:t.filter(t=>t.isTable).length,group:t.filter(t=>"group"===t.type).length}}_formatTime(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}_renderLogContent(t){if(t.isTable&&t.args&&t.args[0])return U`
2966
+ `]),customElements.define("tdt-storage-panel",At);class Ot{constructor(t,e,i,s,a){this.kind=t,this.input=e,this.begin=i,this.end=s,this.file=a}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[t,e]=[1,1];for(let i=0;i<this.begin;i++)"\n"===this.input[i]?(t++,e=1):e++;return[t,e]}size(){return this.end-this.begin}}class Lt{liquidMethodMissing(t,e){}}const zt=Object.prototype.toString,jt=String.prototype.toLowerCase,Pt=Object.hasOwnProperty;function Ft(t){return"string"==typeof t}function It(t){return"function"==typeof t}function Rt(t){return t&&It(t.then)}function Nt(t){return t&&It(t.next)&&It(t.throw)&&It(t.return)}function Dt(t){return Ft(t=Ht(t))?t:Gt(t)?"":Kt(t)?t.map(t=>Dt(t)).join(""):String(t)}function qt(t){return Kt(t=Ht(t))?t:Ft(t)&&t.length>0?[t]:Xt(e=t)&&Symbol.iterator in e?Array.from(t):Xt(t)?Object.keys(t).map(e=>[e,t[e]]):[];var e}function Mt(t){return Gt(t=Ht(t))?[]:Kt(t)?t:[t]}function Ht(t){return t instanceof Lt&&It(t.valueOf)?t.valueOf():t}function Ut(t){return+Ht(t)||0}function Vt(t){return"number"==typeof t}function Bt(t){return t&&It(t.toLiquid)?Bt(t.toLiquid()):t}function Gt(t){return null==t}function Jt(t){return void 0===t}function Kt(t){return"[object Array]"===zt.call(t)}function Wt(t){return t&&Vt(t.length)}function Yt(t,e){t=t||{};for(const i in t)if(Pt.call(t,i)&&!1===e(t[i],i,t))break;return t}function Qt(t){return t[t.length-1]}function Xt(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}function Zt(t,e,i=1){const s=[];for(let a=t;a<e;a+=i)s.push(a);return s}function te(t,e,i=" "){return ee(t,e,i,(t,e)=>e+t)}function ee(t,e,i,s){let a=e-(t=String(t)).length;for(;a-- >0;)t=s(t,i);return t}function ie(t){return t}function se(t,e){return null==t&&null==e?0:null==t?1:null==e||(t=jt.call(t))<(e=jt.call(e))?-1:t>e?1:0}function ae(t){return function(...e){return t.call(this,...e.map(Ht))}}function re(t){return function(...e){return t.call(this,...e.map(Ut))}}function ne(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function*oe(t){const e=new Set;for(const i of t){const t=JSON.stringify(i);e.has(t)||(e.add(t),yield i)}}const le="__liquidClass__";class ce extends Error{constructor(t,e){super("string"==typeof t?t:t.message),this.context="","string"!=typeof t&&Object.defineProperty(this,"originalError",{value:t,enumerable:!1}),Object.defineProperty(this,"token",{value:e,enumerable:!1}),Object.defineProperty(this,le,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:fe(this.token),enumerable:!1}),this.message=function(t,e){e.file&&(t+=`, file:${e.file}`);const[i,s]=e.getPosition();return t+=`, line:${i}, col:${s}`}(this.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack,this.originalError&&(this.stack+="\nFrom "+this.originalError.stack)}static is(t){return"LiquidError"===(null==t?void 0:t[le])}}class de extends ce{constructor(t,e){super(t,e),this.name="TokenizationError",super.update()}}class pe extends ce{constructor(t,e){super(t,e),this.name="ParseError",this.message=t.message,super.update()}}class he extends ce{constructor(t,e){super(t,e.token),this.name="RenderError",this.message=t.message,super.update()}static is(t){return"RenderError"===t.name}}class ue extends ce{constructor(t){super(t[0],t[0].token),this.errors=t,this.name="LiquidErrors";const e=t.length>1?"s":"";this.message=`${t.length} error${e} found`,super.update()}static is(t){return"LiquidErrors"===t.name}}class ge extends ce{constructor(t,e){super(t,e),this.name="UndefinedVariableError",this.message=t.message,super.update()}}class ve extends Error{constructor(t){super(`undefined variable: ${t}`),this.name="InternalUndefinedVariableError",this.variableName=t}}class me extends Error{constructor(t){super(t),this.name="AssertionError",this.message=t+""}}function fe(t){const[e,i]=t.getPosition(),s=t.input.split("\n"),a=Math.max(e-2,1),r=Math.min(e+3,s.length);return Zt(a,r+1).map(t=>{let a=`${t===e?">> ":" "}${te(String(t),String(r).length)}| `;const n=t===e?"\n"+te("^",i+a.length):"";return a+=s[t-1],a+=n,a}).join("\n")}const be=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0];function ye(t){const e=t.charCodeAt(0);return e>=128?!be[e]:!!(1&be[e])}function xe(t,e){if(!t){const i="function"==typeof e?e():e||`expect ${t} to be true`;throw new me(i)}}function _e(t,e=`unexpected ${JSON.stringify(t)}`){xe(!t,e)}be[160]=be[5760]=be[6158]=be[8192]=be[8193]=be[8194]=be[8195]=be[8196]=be[8197]=be[8198]=be[8199]=be[8200]=be[8201]=be[8202]=be[8232]=be[8233]=be[8239]=be[8287]=be[12288]=4,be[8220]=be[8221]=128;class we extends Lt{equals(t){return!(t instanceof we)&&(Ft(t=Ht(t))||Kt(t)?0===t.length:!!Xt(t)&&0===Object.keys(t).length)}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return""}static is(t){return t instanceof we}}class ke extends we{equals(t){return!1===t||(!!Gt(Ht(t))||(Ft(t)?/^\s*$/.test(t):super.equals(t)))}static is(t){return t instanceof ke}}class $e extends Lt{constructor(t,e,i){super(),this.i=0,this.length=t,this.name=`${i}-${e}`}next(){this.i++}index0(){return this.i}index(){return this.i+1}first(){return 0===this.i}last(){return this.i===this.length-1}rindex(){return this.length-this.i}rindex0(){return this.length-this.i-1}valueOf(){return JSON.stringify(this)}}class Se{constructor(){this.buffer=""}write(t){this.buffer+=Dt(t)}}class Te{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}}class Ce{constructor(){this.buffer=""}write(t){"string"!=typeof(t=Ht(t))&&""===this.buffer?this.buffer=t:this.buffer=Dt(this.buffer)+Dt(t)}}class Ee extends Lt{constructor(t=()=>""){super(),this.superBlockRender=t}*super(){const t=new Se;return yield this.superBlockRender(t),t.buffer}}function Ae(t){return t&&It(t.equals)&&It(t.gt)&&It(t.geq)&&It(t.lt)&&It(t.leq)}const Oe=new class extends Lt{equals(t){return Gt(Ht(t))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}},Le={true:!0,false:!1,nil:Oe,null:Oe,empty:new we,blank:new ke};function ze(t){const e={};for(const[i,s]of Object.entries(t)){let t=e;for(let e=0;e<i.length;e++){const s=i[e];t[s]=t[s]||{},e===i.length-1&&ye(i[e])&&(t[s].needBoundary=!0),t=t[s]}t.data=s,t.end=!0}return e}var je=function(){return je=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var a in e=arguments[i])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},je.apply(this,arguments)};function Pe(t,e,i,s){return new(i||(i=Promise))(function(e,a){function r(t){try{o(s.next(t))}catch(e){a(e)}}function n(t){try{o(s.throw(t))}catch(e){a(e)}}function o(t){var s;t.done?e(t.value):(s=t.value,s instanceof i?s:new i(function(t){t(s)})).then(r,n)}o((s=s.apply(t,[])).next())})}function Fe(t){return Pe(this,0,void 0,function*(){if(!Nt(t))return t;let e,i=!1,s="next";do{const r=t[s](e);i=r.done,e=r.value,s="next";try{Nt(e)&&(e=Fe(e)),Rt(e)&&(e=yield e)}catch(a){s="throw",e=a}}while(!i);return e})}function Ie(t){if(!Nt(t))return t;let e,i=!1,s="next";do{const r=t[s](e);if(i=r.done,e=r.value,s="next",Nt(e))try{e=Ie(e)}catch(a){s="throw",e=a}}while(!i);return e}const Re=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function Ne(t){const e=function(t){const e=t.getFullYear();return!(3&e||!(e%100||e%400==0&&e))}(t)?29:28;return[31,e,31,30,31,30,31,31,30,31,30,31]}function De(t){let e=0;for(let i=0;i<t.getMonth();++i)e+=Ne(t)[i];return e+t.getDate()}function qe(t,e){const i=De(t)+(e-t.getDay()),s=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((i-s)/7)+1)}const Me={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},He=new Set("aAbBceklpP");function Ue(t,e){const i=Math.abs(t.getTimezoneOffset()),s=Math.floor(i/60),a=i%60;return(t.getTimezoneOffset()>0?"-":"+")+te(s,2,"0")+(e.flags[":"]?":":"")+te(a,2,"0")}const Ve={a:t=>t.getShortWeekdayName(),A:t=>t.getLongWeekdayName(),b:t=>t.getShortMonthName(),B:t=>t.getLongMonthName(),c:t=>t.toLocaleString(),C:t=>function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t),d:t=>t.getDate(),e:t=>t.getDate(),H:t=>t.getHours(),I:t=>String(t.getHours()%12||12),j:t=>De(t),k:t=>t.getHours(),l:t=>String(t.getHours()%12||12),L:t=>t.getMilliseconds(),m:t=>t.getMonth()+1,M:t=>t.getMinutes(),N:(t,e)=>{const i=Number(e.width)||9;return function(t,e,i=" "){return ee(t,e,i,(t,e)=>t+e)}(String(t.getMilliseconds()).slice(0,i),i,"0")},p:t=>t.getHours()<12?"AM":"PM",P:t=>t.getHours()<12?"am":"pm",q:t=>function(t){const e=t.getDate();if([11,12,13].includes(e))return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}(t),s:t=>Math.round(t.getTime()/1e3),S:t=>t.getSeconds(),u:t=>t.getDay()||7,U:t=>qe(t,0),w:t=>t.getDay(),W:t=>qe(t,1),x:t=>t.toLocaleDateString(),X:t=>t.toLocaleTimeString(),y:t=>t.getFullYear().toString().slice(2,4),Y:t=>t.getFullYear(),z:Ue,Z:(t,e)=>t.getTimeZoneName()||Ue(t,e),t:()=>"\t",n:()=>"\n","%":()=>"%"};function Be(t,e){let i,s="",a=e;for(;i=Re.exec(a);)s+=a.slice(0,i.index),a=a.slice(i.index+i[0].length),s+=Ge(t,i);return s+a}function Ge(t,e){const[i,s="",a,r,n]=e,o=Ve[n];if(!o)return i;const l={};for(const u of s)l[u]=!0;let c=String(o(t,{flags:l,width:a,modifier:r})),d=He.has(n)?" ":"0",p=a||Me[n]||0;var h;return l["^"]?c=c.toUpperCase():l["#"]&&(h=c,c=[...h].some(t=>t>="a"&&t<="z")?h.toUpperCase():h.toLowerCase()),l._?d=" ":l[0]&&(d="0"),l["-"]&&(p=0),te(c,p,d)}function Je(){return"undefined"!=typeof Intl?Intl.DateTimeFormat:void 0}Ve.h=Ve.b;const Ke=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ye=We.map(t=>t.slice(0,3)),Qe=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Xe=Qe.map(t=>t.slice(0,3));class Ze{constructor(t,e,i){this.locale=e,this.DateTimeFormat=Je(),this.date=new Date(t),this.timezoneFixed=void 0!==i,void 0===i&&(i=this.date.getTimezoneOffset()),this.timezoneOffset=Ft(i)?Ze.getTimezoneOffset(i,this.date):i,this.timezoneName=Ft(i)?i:"";const s=6e4*(this.date.getTimezoneOffset()-this.timezoneOffset),a=this.date.getTime()+s;this.displayDate=new Date(a)}getTime(){return this.displayDate.getTime()}getMilliseconds(){return this.displayDate.getMilliseconds()}getSeconds(){return this.displayDate.getSeconds()}getMinutes(){return this.displayDate.getMinutes()}getHours(){return this.displayDate.getHours()}getDay(){return this.displayDate.getDay()}getDate(){return this.displayDate.getDate()}getMonth(){return this.displayDate.getMonth()}getFullYear(){return this.displayDate.getFullYear()}toLocaleString(t,e){return(null==e?void 0:e.timeZone)?this.date.toLocaleString(t,e):this.displayDate.toLocaleString(t,e)}toLocaleTimeString(t){return this.displayDate.toLocaleTimeString(t)}toLocaleDateString(t){return this.displayDate.toLocaleDateString(t)}getTimezoneOffset(){return this.timezoneOffset}getTimeZoneName(){return this.timezoneFixed?this.timezoneName:this.DateTimeFormat?this.DateTimeFormat().resolvedOptions().timeZone:void 0}getLongMonthName(){var t;return null!==(t=this.format({month:"long"}))&&void 0!==t?t:We[this.getMonth()]}getShortMonthName(){var t;return null!==(t=this.format({month:"short"}))&&void 0!==t?t:Ye[this.getMonth()]}getLongWeekdayName(){var t;return null!==(t=this.format({weekday:"long"}))&&void 0!==t?t:Qe[this.displayDate.getDay()]}getShortWeekdayName(){var t;return null!==(t=this.format({weekday:"short"}))&&void 0!==t?t:Xe[this.displayDate.getDay()]}valid(){return!isNaN(this.getTime())}format(t){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,t).format(this.displayDate)}static createDateFixedToTimezone(t,e){const i=t.match(Ke);if(i&&"Z"===i[1])return new Ze(+new Date(t),e,0);if(i&&i[2]&&i[3]&&i[4]){const[,,s,a,r]=i,n=("+"===s?-1:1)*(60*parseInt(a,10)+parseInt(r,10));return new Ze(+new Date(t),e,n)}return new Ze(t,e)}static getTimezoneOffset(t,e){const i=e.toLocaleString("en-US",{timeZone:t}),s=e.toLocaleString("en-US",{timeZone:"UTC"}),a=new Date(i);return(+new Date(s)-+a)/6e4}}class ti{constructor(t,e){this.base=0,this.message=`${t} limit exceeded`,this.limit=e}use(t){t=+t||0,xe(this.base+t<=this.limit,this.message),this.base+=t}check(t){xe((t=+t||0)<=this.limit,this.message)}}class ei extends Ot{constructor(t,[e,i],s,a,r,n,o,l){super(t,s,a,r,l),this.trimLeft=!1,this.trimRight=!1;const c="-"===s[e],d="-"===s[i-1];let p=c?e+1:e,h=d?i-1:i;for(;p<h&&4&be[s.charCodeAt(p)];)p++;for(;h>p&&4&be[s.charCodeAt(h-1)];)h--;this.contentRange=[p,h],this.trimLeft=c||n,this.trimRight=d||o}get content(){return this.input.slice(this.contentRange[0],this.contentRange[1])}}class ii extends ei{constructor(t,e,i,s,a){const{trimTagLeft:r,trimTagRight:n,tagDelimiterLeft:o,tagDelimiterRight:l}=s,[c,d]=[e+o.length,i-l.length];super(ys.Tag,[c,d],t,e,i,r,n,a),this.tokenizer=new Wi(t,s.operators,a,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal tag syntax, tag name expected"),this.tokenizer.skipBlank(),this.args=this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class si extends ei{constructor(t,e,i,s,a){const{trimOutputLeft:r,trimOutputRight:n,outputDelimiterLeft:o,outputDelimiterRight:l}=s,c=[e+o.length,i-l.length];super(ys.Output,c,t,e,i,r,n,a)}}class ai extends Ot{constructor(t,e,i,s){super(ys.HTML,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.trimLeft=0,this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}}class ri extends Ot{constructor(t,e,i,s){super(ys.Number,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=Number(this.getText())}}class ni extends Ot{constructor(t,e,i,s){super(ys.Word,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=this.getText()}}class oi extends Ot{constructor(t,e,i,s){super(ys.Literal,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.literal=this.getText(),this.content=Le[this.literal]}}const li={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},ci={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class di extends Ot{constructor(t,e,i,s){super(ys.Operator,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.operator=this.getText()}getPrecedence(){const t=this.getText();return t in li?li[t]:1}}class pi extends Ot{constructor(t,e,i,s,a,r){super(ys.PropertyAccess,i,s,a,r),this.variable=t,this.props=e}}class hi extends Ot{constructor(t,e,i,s,a,r){super(ys.Filter,i,s,a,r),this.name=t,this.args=e}}class ui extends Ot{constructor(t,e,i,s,a,r){super(ys.Hash,t,e,i,r),this.input=t,this.begin=e,this.end=i,this.name=s,this.value=a,this.file=r}}const gi=/[\da-fA-F]/,vi=/[0-7]/,mi={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function fi(t){const e=t.charCodeAt(0);return e>=97?e-87:e>=65?e-55:e-48}class bi extends Ot{constructor(t,e,i,s){super(ys.Quoted,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=function(t){let e="";for(let i=1;i<t.length-1;i++)if("\\"===t[i])if(void 0!==mi[t[i+1]])e+=mi[t[++i]];else if("u"===t[i+1]){let s=0,a=i+2;for(;a<=i+5&&gi.test(t[a]);)s=16*s+fi(t[a++]);i=a-1,e+=String.fromCharCode(s)}else if(vi.test(t[i+1])){let s=i+1,a=0;for(;s<=i+3&&vi.test(t[s]);)a=8*a+fi(t[s++]);i=s-1,e+=String.fromCharCode(a)}else e+=t[++i];else e+=t[i];return e}(this.getText())}}class yi extends Ot{constructor(t,e,i,s,a,r){super(ys.Range,t,e,i,r),this.input=t,this.begin=e,this.end=i,this.lhs=s,this.rhs=a,this.file=r}}class xi extends ei{constructor(t,e,i,s,a){super(ys.Tag,[e,i],t,e,i,!1,!1,a),this.tokenizer=new Wi(t,s.operators,a,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal liquid tag syntax"),this.tokenizer.skipBlank()}get args(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class _i extends Ot{constructor(t,e,i,s,a,r){super(ys.FilteredValue,i,s,a,r),this.initial=t,this.filters=e,this.input=i,this.begin=s,this.end=a,this.file=r}}const wi={now:()=>Date.now()};function ki(){return"object"==typeof global&&global.performance||"object"==typeof window&&window.performance||wi}class $i{renderTemplatesToNodeStream(t,e){const i=new Te;return Promise.resolve().then(()=>Fe(this.renderTemplates(t,e,i))).then(()=>i.end(),t=>i.error(t)),i.stream}*renderTemplates(t,e,i){i||(i=e.opts.keepOutputType?new Ce:new Se);const s=[];for(const r of t){e.renderLimit.check(ki().now());try{const t=yield r.render(e,i);if(t&&i.write(t),e.breakCalled||e.continueCalled)break}catch(a){const t=ce.is(a)?a:new he(a,r);if(!e.opts.catchAllErrors)throw t;s.push(t)}}if(s.length)throw new ue(s);return i.buffer}}class Si{constructor(t){this.postfix=[...Ci(t)]}*evaluate(t,e){xe(t,"unable to evaluate: context not defined");const i=[];for(const s of this.postfix)if(Ts(s)){const e=i.pop();let a;if(1===ci[s.operator])a=yield t.opts.operators[s.operator](e,t);else{const r=i.pop();a=yield t.opts.operators[s.operator](r,e,t)}i.push(a)}else i.push(yield Ti(s,t,e));return i[0]}valid(){return!!this.postfix.length}}function*Ti(t,e,i=!1){if(t)return"content"in t?t.content:Ls(t)?yield function*(t,e,i){const s=[];for(const r of t.props)s.push(yield Ti(r,e,!1));try{if(t.variable){const a=yield Ti(t.variable,e,i);return yield e._getFromScope(a,s)}return yield e._get(s)}catch(a){if(i&&"InternalUndefinedVariableError"===a.name)return null;throw new ge(a,t)}}(t,e,i):js(t)?yield function*(t,e){const i=yield Ti(t.lhs,e),s=yield Ti(t.rhs,e);return e.memoryLimit.use(s-i+1),Zt(+i,+s+1)}(t,e):void 0}function*Ci(t){const e=[];for(const i of t)if(Ts(i)){for(;e.length&&e[e.length-1].getPrecedence()>i.getPrecedence();)yield e.pop();e.push(i)}else yield i;for(;e.length;)yield e.pop()}function Ei(t,e){return!Ai(t,e)}function Ai(t,e){return t=Ht(t),e.opts.jsTruthy?!t:!1===t||null==t}const Oi={"==":Li,"!=":(t,e)=>!Li(t,e),">":(t,e)=>Ae(t)?t.gt(e):Ae(e)?e.lt(t):Ht(t)>Ht(e),"<":(t,e)=>Ae(t)?t.lt(e):Ae(e)?e.gt(t):Ht(t)<Ht(e),">=":(t,e)=>Ae(t)?t.geq(e):Ae(e)?e.leq(t):Ht(t)>=Ht(e),"<=":(t,e)=>Ae(t)?t.leq(e):Ae(e)?e.geq(t):Ht(t)<=Ht(e),contains:(t,e)=>Kt(t=Ht(t))?t.some(t=>Li(t,e)):!!It(null==t?void 0:t.indexOf)&&t.indexOf(Ht(e))>-1,not:(t,e)=>Ai(Ht(t),e),and:(t,e,i)=>Ei(Ht(t),i)&&Ei(Ht(e),i),or:(t,e,i)=>Ei(Ht(t),i)||Ei(Ht(e),i)};function Li(t,e){return Ae(t)?t.equals(e):Ae(e)?e.equals(t):(t=Ht(t),e=Ht(e),Kt(t)?Kt(e)&&function(t,e){return t.length===e.length&&!t.some((t,i)=>!Li(t,e[i]))}(t,e):t===e)}class zi{constructor(t,e,i,s){this.key=t,this.value=e,this.next=i,this.prev=s}}class ji{constructor(t,e=0){this.limit=t,this.size=e,this.cache={},this.head=new zi("HEAD",null,null,null),this.tail=new zi("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}write(t,e){if(this.cache[t])this.cache[t].value=e;else{const i=new zi(t,e,this.head.next,this.head);this.head.next.prev=i,this.head.next=i,this.cache[t]=i,this.size++,this.ensureLimit()}}read(t){if(!this.cache[t])return;const{value:e}=this.cache[t];return this.remove(t),this.write(t,e),e}remove(t){const e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--}clear(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}}ensureLimit(){this.size>this.limit&&this.remove(this.tail.prev.key)}}function Pi(t,e){const i=document.createElement("base");i.href=t;const s=document.getElementsByTagName("head")[0];s.insertBefore(i,s.firstChild);const a=document.createElement("a");a.href=e;const r=a.href;return s.removeChild(i),r}var Fi=Object.freeze({__proto__:null,resolve:function(t,e,i){return t.length&&"/"!==Qt(t)&&(t+="/"),Pi(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,(t,e,s)=>{const a=s.split("/").pop();return/\.\w+$/.test(a)?t:e+s+i})},readFile:function(t){return Pe(this,0,void 0,function*(){return new Promise((e,i)=>{const s=new XMLHttpRequest;s.onload=()=>{s.status>=200&&s.status<300?e(s.responseText):i(new Error(s.statusText))},s.onerror=()=>{i(new Error("An error occurred whilst receiving the response."))},s.open("GET",t),s.send()})})},readFileSync:function(t){const e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||e.status>=300)throw new Error(e.statusText);return e.responseText},exists:function(t){return Pe(this,0,void 0,function*(){return!0})},existsSync:function(t){return!0},dirname:function(t){return Pi(t,".")},sep:"/"});function Ii(t,e=0){return JSON.stringify(t,null,e)}var Ri={default:function(t,e,...i){return Kt(t=Ht(t))||Ft(t)?t.length?t:e:(!1!==t||!new Map(i).get("allow_false"))&&(Ai(t,this.context)?e:t)},raw:{raw:!0,handler:ie},jsonify:Ii,to_integer:function(t){return Number(t)},json:Ii,inspect:function(t,e=0){const i=[];return JSON.stringify(t,function(t,e){if("object"!=typeof e||null===e)return e;for(;i.length>0&&i[i.length-1]!==this;)i.pop();return i.includes(e)?"[Circular]":(i.push(e),e)},e)}};const Ni={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},Di={"&amp;":"&","&lt;":"<","&gt;":">","&#34;":'"',"&#39;":"'"};function qi(t){return t=Dt(t),this.context.memoryLimit.use(t.length),t.replace(/&|<|>|"|'/g,t=>Ni[t])}function Mi(t){return t=Dt(t),this.context.memoryLimit.use(t.length),t.replace(/&(amp|lt|gt|#34|#39);/g,t=>Di[t])}var Hi=Object.freeze({__proto__:null,escape:qi,xml_escape:function(t){return qi.call(this,t)},escape_once:function(t){return qi.call(this,Mi.call(this,t))},newline_to_br:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"<br />\n")},strip_html:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),e.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}});class Ui{constructor(t){this.mapping=t,this.sep="/"}exists(t){return Pe(this,0,void 0,function*(){return this.existsSync(t)})}existsSync(t){return!Gt(this.mapping[t])}readFile(t){return Pe(this,0,void 0,function*(){return this.readFileSync(t)})}readFileSync(t){const e=this.mapping[t];if(Gt(e))throw new Error(`ENOENT: ${t}`);return e}dirname(t){const e=t.split(this.sep);return e.pop(),e.join(this.sep)}resolve(t,e,i){if(e+=i,"."===t)return e;const s=t.split(/\/+/);for(const a of e.split(this.sep))"."!==a&&""!==a&&(".."===a?(s.length>1||""!==s[0])&&s.pop():s.push(a));return s.join(this.sep)}}const Vi={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:Fi,dynamicPartials:!0,jsTruthy:!1,dateFormat:"%A, %B %-e, %Y at %-l:%M %P %z",locale:"",trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,ownPropertyOnly:!0,lenientIf:!1,globals:{},keepOutputType:!1,operators:Oi,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function Bi(t){var e,i,s;if(t.hasOwnProperty("root")&&(t.hasOwnProperty("partials")||(t.partials=t.root),t.hasOwnProperty("layouts")||(t.layouts=t.root)),t.hasOwnProperty("cache")){let e;e="number"==typeof t.cache?t.cache>0?new ji(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new ji(1024):void 0,t.cache=e}return(t=Object.assign(Object.assign(Object.assign({},Vi),t.jekyllInclude?{dynamicPartials:!1}:{}),t)).fs.dirname&&t.fs.sep||!t.relativeReference||(console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"),t.relativeReference=!1),t.root=Gi(t.root),t.partials=Gi(t.partials),t.layouts=Gi(t.layouts),t.outputEscape=t.outputEscape&&("escape"===(s=t.outputEscape)?qi:"json"===s?Ri.json:(xe(It(s),"`outputEscape` need to be of type string or function"),s)),t.locale||(t.locale=null!==(i=null===(e=Je())||void 0===e?void 0:e().resolvedOptions().locale)&&void 0!==i?i:"en-US"),t.templates&&(t.fs=new Ui(t.templates),t.relativeReference=!0,t.root=t.partials=t.layouts="."),t}function Gi(t){let e=[];return Kt(t)&&(e=t),Ft(t)&&(e=[t]),e}function Ji(t,e){if(!t||!Cs(t))return;const i=e?4:16;for(;be[t.input.charCodeAt(t.end-1-t.trimRight)]&i;)t.trimRight++}function Ki(t,e){if(!t||!Cs(t))return;const i=e?4:16;for(;be[t.input.charCodeAt(t.begin+t.trimLeft)]&i;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}class Wi{constructor(t,e=Vi.operators,i,s){this.input=t,this.file=i,this.rawBeginAt=-1,this.p=s?s[0]:0,this.N=s?s[1]:t.length,this.opTrie=ze(e),this.literalTrie=ze(Le)}readExpression(){return new Si(this.readExpressionTokens())}*readExpressionTokens(){for(;this.p<this.N;){const t=this.readOperator();if(t){yield t;continue}const e=this.readValue();if(!e)return;yield e}}readOperator(){this.skipBlank();const t=this.matchTrie(this.opTrie);if(-1!==t)return new di(this.input,this.p,this.p=t,this.file)}matchTrie(t){let e,i=t,s=this.p;for(;i[this.input[s]]&&s<this.N;)i=i[this.input[s++]],i.end&&(e=i);return e?e.needBoundary&&ye(this.peek(s-this.p))?-1:s:-1}readFilteredValue(){const t=this.p,e=this.readExpression();this.assert(e.valid(),`invalid value expression: ${this.snapshot()}`);const i=this.readFilters();return new _i(e,i,this.input,t,this.p,this.file)}readFilters(){const t=[];for(;;){const e=this.readFilter();if(!e)return t;t.push(e)}}readFilter(){if(this.skipBlank(),this.end())return null;this.assert("|"===this.read(),'expected "|" before filter');const t=this.readIdentifier();if(!t.size())return this.assert(this.end(),"expected filter name"),null;const e=[];if(this.skipBlank(),":"===this.peek())do{++this.p;const t=this.readFilterArg();t&&e.push(t),this.skipBlank(),this.assert(this.end()||","===this.peek()||"|"===this.peek(),()=>`unexpected character ${this.snapshot()}`)}while(","===this.peek());else if("|"!==this.peek()&&!this.end())throw this.error('expected ":" after filter name');return new hi(t.getText(),e,this.input,t.begin,this.p,this.file)}readFilterArg(){const t=this.readValue();if(!t)return;if(this.skipBlank(),":"!==this.peek())return t;++this.p;const e=this.readValue();return[t.getText(),e]}readTopLevelTokens(t=Vi){const e=[];for(;this.p<this.N;){const i=this.readTopLevelToken(t);e.push(i)}return function(t,e){let i=!1;for(let s=0;s<t.length;s++){const a=t[s];Ss(a)&&(!i&&a.trimLeft&&Ji(t[s-1],e.greedy),Es(a)&&("raw"===a.name?i=!0:"endraw"===a.name&&(i=!1)),!i&&a.trimRight&&Ki(t[s+1],e.greedy))}}(e,t),e}readTopLevelToken(t){const{tagDelimiterLeft:e,outputDelimiterLeft:i}=t;return this.rawBeginAt>-1?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(i)?this.readOutputToken(t):this.readHTMLToken([e,i])}readHTMLToken(t){const e=this.p;for(;this.p<this.N&&!t.some(t=>this.match(t));)++this.p;return new ai(this.input,e,this.p,this.file)}readTagToken(t){const{file:e,input:i}=this,s=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.error(`tag ${this.snapshot(s)} not closed`,s);const a=new ii(i,s,this.p,t,e);return"raw"===a.name&&(this.rawBeginAt=s),a}readToDelimiter(t,e=!1){for(this.skipBlank();this.p<this.N;)if(e&&8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1}readOutputToken(t=Vi){const{file:e,input:i}=this,{outputDelimiterRight:s}=t,a=this.p;if(-1===this.readToDelimiter(s,!0))throw this.error(`output ${this.snapshot(a)} not closed`,a);return new si(i,a,this.p,t,e)}readEndrawOrRawContent(t){const{tagDelimiterLeft:e,tagDelimiterRight:i}=t,s=this.p;let a=this.readTo(e)-e.length;for(;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(i)){const e=this.p;return s===a?(this.rawBeginAt=-1,new ii(this.input,s,e,t,this.file)):(this.p=a,new ai(this.input,s,a,this.file))}if(this.rmatch(e))break;this.p++}else a=this.readTo(e)-e.length;throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`,s)}readLiquidTagTokens(t=Vi){const e=[];for(;this.p<this.N;){const i=this.readLiquidTagToken(t);i&&e.push(i)}return e}readLiquidTagToken(t){if(this.skipBlank(),this.end())return;const e=this.p;this.readToDelimiter("\n");const i=this.p;return new xi(this.input,e,i,t,this.file)}error(t,e=this.p){return new de(t,new ni(this.input,e,this.N,this.file))}assert(t,e,i){if(!t)throw this.error("function"==typeof e?e():e,i)}snapshot(t=this.p){return JSON.stringify((e=this.input.slice(t,this.N),i=32,e.length>i?e.slice(0,i-3)+"...":e));var e,i}readWord(){return this.readIdentifier()}readIdentifier(){this.skipBlank();const t=this.p;for(;!this.end()&&ye(this.peek());)++this.p;return new ni(this.input,t,this.p,this.file)}readNonEmptyIdentifier(){const t=this.readIdentifier();return t.size()?t:void 0}readTagName(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(t){const e=[];for(;;){const i=this.readHash(t);if(!i)return e;e.push(i)}}readHash(t){this.skipBlank(),","===this.peek()&&++this.p;const e=this.p,i=this.readNonEmptyIdentifier();if(!i)return;let s;this.skipBlank();const a=Ft(t)?t:t?"=":":";return this.peek()===a&&(++this.p,s=this.readValue()),new ui(this.input,e,this.p,i,s,this.file)}remaining(){return this.input.slice(this.p,this.N)}advance(t=1){this.p+=t}end(){return this.p>=this.N}read(){return this.input[this.p++]}readTo(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1}readValue(){this.skipBlank();const t=this.p,e=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber(),i=this.readProperties(!e);return i.length?new pi(e,i,this.input,t,this.p):e}readScopeValue(){this.skipBlank();const t=this.p,e=this.readProperties();if(e.length)return new pi(void 0,e,this.input,t,this.p)}readProperties(t=!0){const e=[];for(;;){if("["===this.peek()){this.p++;const t=this.readValue()||new ni(this.input,this.p,this.p,this.file);this.assert(-1!==this.readTo("]"),"[ not closed"),e.push(t);continue}if(t&&!e.length){const t=this.readNonEmptyIdentifier();if(t){e.push(t);continue}}if("."===this.peek()&&"."!==this.peek(1)){this.p++;const t=this.readNonEmptyIdentifier();if(!t)break;e.push(t);continue}break}return e}readNumber(){this.skipBlank();let t=!1,e=!1,i=0;for(64&this.peekType()&&i++;this.p+i<=this.N;)if(32&this.peekType(i))e=!0,i++;else{if("."!==this.peek(i)||"."===this.peek(i+1))break;if(t||!e)return;t=!0,i++}if(e&&!ye(this.peek(i))){const t=new ri(this.input,this.p,this.p+i,this.file);return this.advance(i),t}}readLiteral(){this.skipBlank();const t=this.matchTrie(this.literalTrie);if(-1===t)return;const e=new oi(this.input,this.p,t,this.file);return this.p=t,e}readRange(){this.skipBlank();const t=this.p;if("("!==this.peek())return;++this.p;const e=this.readValueOrThrow();this.skipBlank(),this.assert("."===this.read()&&"."===this.read(),"invalid range syntax");const i=this.readValueOrThrow();return this.skipBlank(),this.assert(")"===this.read(),"invalid range syntax"),new yi(this.input,t,this.p,e,i,this.file)}readValueOrThrow(){const t=this.readValue();return this.assert(t,()=>`unexpected token ${this.snapshot()}, value expected`),t}readQuoted(){this.skipBlank();const t=this.p;if(!(8&this.peekType()))return;++this.p;let e=!1;for(;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new bi(this.input,t,this.p,this.file)}*readFileNameTemplate(t){const{outputDelimiterLeft:e}=t,i=[","," ",e],s=new Set(i);for(;this.p<this.N&&!s.has(this.peek());)yield this.match(e)?this.readOutputToken(t):this.readHTMLToken(i)}match(t){for(let e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0}rmatch(t){for(let e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0}peekType(t=0){return this.p+t>=this.N?0:be[this.input.charCodeAt(this.p+t)]}peek(t=0){return this.p+t>=this.N?"":this.input[this.p+t]}skipBlank(){for(;4&this.peekType();)++this.p}}class Yi{constructor(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}on(t,e){return this.handlers[t]=e,this}trigger(t,e){const i=this.handlers[t];return!!i&&(i.call(this,e),!0)}start(){let t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());){if(this.trigger("token",t))continue;if(Es(t)&&this.trigger(`tag:${t.name}`,t))continue;const e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this}stop(){return this.stopRequested=!0,this}}class Qi{constructor(t){this.token=t}}class Xi extends Qi{constructor(t,e,i){super(t),this.name=t.name,this.liquid=i,this.tokenizer=t.tokenizer}}class Zi{constructor(t,e){this.hash={};const i=t instanceof Wi?t:new Wi(t,{});for(const s of i.readHashes(e))this.hash[s.name.content]=s.value}*render(t){const e={};for(const i of Object.keys(this.hash))e[i]=void 0===this.hash[i]||(yield Ti(this.hash[i],t));return e}}function ts(t){return Kt(t)}class es{constructor(t,e,i){this.token=t,this.name=t.name,this.handler=It(e)?e:It(null==e?void 0:e.handler)?e.handler:ie,this.raw=!It(e)&&!!(null==e?void 0:e.raw),this.args=t.args,this.liquid=i}*render(t,e){const i=[];for(const s of this.args)ts(s)?i.push([s[0],yield Ti(s[1],e)]):i.push(yield Ti(s,e));return yield this.handler.apply({context:e,token:this.token,liquid:this.liquid},[t,...i])}}class is{constructor(t,e){this.filters=[];const i="string"==typeof t?new Wi(t,e.options.operators).readFilteredValue():t;this.initial=i.initial,this.filters=i.filters.map(t=>new es(t,this.getFilter(e,t.name),e))}*value(t,e){e=e||t.opts.lenientIf&&this.filters.length>0&&"default"===this.filters[0].name;let i=yield this.initial.evaluate(t,e);for(const s of this.filters)i=yield s.render(i,t);return i}getFilter(t,e){const i=t.filters[e];return xe(i||!t.options.strictFilters,()=>`undefined filter: ${e}`),i}}class ss extends Qi{constructor(t,e){var i;super(t);const s=new Wi(t.input,e.options.operators,t.file,t.contentRange);this.value=new is(s.readFilteredValue(),e);const a=this.value.filters,r=e.options.outputEscape;if(!(null===(i=a[a.length-1])||void 0===i?void 0:i.raw)&&r){const t=new hi(toString.call(r),[],"",0,0);a.push(new es(t,r,e))}}*render(t,e){const i=yield this.value.value(t,!1);e.write(i)}*arguments(){yield this.value}}class as extends Qi{constructor(t){super(t),this.str=t.getContent()}*render(t,e){e.write(this.str)}}class rs{constructor(t,e){this.segments=t,this.location=e}toString(){return ms(this.segments,!0)}toArray(){return Array.from(function*t(...e){for(const i of e)i instanceof rs?yield Array.from(t(...i.segments)):yield i}(...this.segments))}}class ns{constructor(){this.map=new Map}get(t){const e=ms([t.segments[0]]);return this.map.has(e)||this.map.set(e,[]),this.map.get(e)}has(t){return this.map.has(ms([t.segments[0]]))}push(t){this.get(t).push(t)}asObject(){return Object.fromEntries(this.map)}}const os={partials:!0};function*ls(t,e,i){const s=new ns,a=new ns,r=new ns,n=new ps(new Set),o=new Set;function l(t,e){s.push(t);const i=e.alias(t);if(void 0!==i){const t=i.segments[0];Ft(t)&&!n.has(t)&&a.push(i)}else{const i=t.segments[0];Ft(i)&&!e.has(i)&&a.push(t)}for(const s of t.segments)s instanceof rs&&l(s,e)}function*c(t,s){if(t.arguments)for(const e of t.arguments())for(const t of hs(e))l(t,s);if(t.localScope)for(const e of t.localScope()){s.add(e.content),s.deleteAlias(e.content);const[t,i]=e.getPosition();r.push(new rs([e.content],{row:t,col:i,file:e.file}))}if(t.children)if(t.partialScope){const a=t.partialScope();if(void 0===a){for(const a of yield t.children(e,i))yield c(a,s);return}if(o.has(a.name))return;const r=new Set,n=a.isolated?new ps(r):s.push(r);for(const t of a.scope)if(Ft(t))r.add(t);else{const[e,i]=t;r.add(e);const s=Array.from(hs(i));s.length&&n.setAlias(e,s[0].segments)}for(const s of yield t.children(e,i))yield c(s,n),o.add(a.name);n.pop()}else{t.blockScope&&s.push(new Set(t.blockScope()));for(const a of yield t.children(e,i))yield c(a,s);t.blockScope&&s.pop()}}for(const d of t)yield c(d,n);return{variables:s.asObject(),globals:a.asObject(),locals:r.asObject()}}function cs(t,e={}){return Fe(ls(t,Object.assign(Object.assign({},os),e).partials,!1))}function ds(t,e={}){return Ie(ls(t,Object.assign(Object.assign({},os),e).partials,!0))}class ps{constructor(t){this.stack=[{names:t,aliases:new Map}]}has(t){for(const e of this.stack)if(e.names.has(t))return!0;return!1}push(t){return this.stack.push({names:t,aliases:new Map}),this}pop(){var t;return null===(t=this.stack.pop())||void 0===t?void 0:t.names}add(t){this.stack[0].names.add(t)}alias(t){const e=t.segments[0];if(!Ft(e))return;const i=this.getAlias(e);return void 0!==i?new rs([...i,...t.segments.slice(1)],t.location):void 0}setAlias(t,e){this.stack[this.stack.length-1].aliases.set(t,e)}deleteAlias(t){this.stack[this.stack.length-1].aliases.delete(t)}getAlias(t){for(const e of this.stack){if(e.aliases.has(t))return e.aliases.get(t);if(e.names.has(t))return}}}function*hs(t){Ps(t)?yield*us(t):t instanceof is&&(yield*function*(t){for(const e of t.initial.postfix)Ps(e)&&(yield*us(e));for(const e of t.filters)for(const t of e.args)ts(t)&&t[1]?yield*us(t[1]):Ps(t)&&(yield*us(t))}(t))}function*us(t){js(t)?(yield*us(t.lhs),yield*us(t.rhs)):Ls(t)&&(yield gs(t))}function gs(t){const e=[];let i=t.file;const s=t.props[0];i=i||s.file,As(s)||Os(s)||zs(s)?e.push(s.content):Ls(s)&&e.push(...gs(s).segments);for(const n of t.props.slice(1))i=i||n.file,As(n)||Os(n)||zs(n)?e.push(n.content):Ls(n)&&e.push(gs(n));const[a,r]=t.getPosition();return new rs(e,{row:a,col:r,file:i})}const vs=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function ms(t,e=!1){const i=[],s=t[0];Ft(s)&&(!e||s.match(vs)?i.push(`${s}`):i.push(`['${s}']`));for(const a of t.slice(1))a instanceof rs?i.push(`[${ms(a.segments)}]`):Ft(a)?a.match(vs)?i.push(`.${a}`):i.push(`['${a}']`):i.push(`[${a}]`);return i.join("")}var fs,bs,ys,xs,_s,ws;(bs=fs||(fs={})).Partials="partials",bs.Layouts="layouts",bs.Root="root";class ks{constructor(t){if(this.options=t,t.relativeReference){const e=t.fs.sep;xe(e,"`fs.sep` is required for relative reference");const i=new RegExp(["."+e,".."+e,"./","../"].map(t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|"));this.shouldLoadRelative=t=>i.test(t)}else this.shouldLoadRelative=t=>!1;this.contains=this.options.fs.contains||(()=>!0)}*lookup(t,e,i,s){const{fs:a}=this.options,r=this.options[e];for(const n of this.candidates(t,r,s,e!==fs.Root))if(i?a.existsSync(n):yield a.exists(n))return n;throw this.lookupError(t,r)}*candidates(t,e,i,s){const{fs:a,extname:r}=this.options;if(this.shouldLoadRelative(t)&&i){const n=a.resolve(this.dirname(i),t,r);for(const t of e)if(!s||this.contains(t,n)){yield n;break}}for(const n of e){const e=a.resolve(n,t,r);s&&!this.contains(n,e)||(yield e)}if(void 0!==a.fallback){const e=a.fallback(t);void 0!==e&&(yield e)}}dirname(t){const e=this.options.fs;return xe(e.dirname,"`fs.dirname` is required for relative reference"),e.dirname(t)}lookupError(t,e){const i=new Error("ENOENT");return i.message=`ENOENT: Failed to lookup "${t}" in "${e}"`,i.code="ENOENT",i}}class $s{constructor(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new ks(this.liquid.options),this.parseLimit=new ti("parse length",t.options.parseLimit)}parse(t,e){t=String(t),this.parseLimit.use(t.length);const i=new Wi(t,this.liquid.options.operators,e).readTopLevelTokens(this.liquid.options);return this.parseTokens(i)}parseTokens(t){let e;const i=[],s=[];for(;e=t.shift();)try{i.push(this.parseToken(e,t))}catch(a){if(!this.liquid.options.catchAllErrors)throw a;s.push(a)}if(s.length)throw new ue(s);return i}parseToken(t,e){try{if(Es(t)){const i=this.liquid.tags[t.name];return xe(i,`tag "${t.name}" not found`),new i(t,e,this.liquid,this)}return Fs(t)===ys.Output?new ss(t,this.liquid):new as(t)}catch(i){if(ce.is(i))throw i;throw new pe(i,t)}}parseStream(t){return new Yi(t,(t,e)=>this.parseToken(t,e))}*_parseFileCached(t,e,i=fs.Root,s){const a=this.cache,r=this.loader.shouldLoadRelative(t)?s+","+t:i+":"+t,n=yield a.read(r);if(n)return n;const o=this._parseFile(t,e,i,s),l=e?yield o:Fe(o);a.write(r,l);try{return yield l}catch(c){throw a.remove(r),c}}*_parseFile(t,e,i=fs.Root,s){const a=yield this.loader.lookup(t,i,e,s);return this.parse(e?this.fs.readFileSync(a):yield this.fs.readFile(a),a)}}function Ss(t){return!!(Fs(t)&ys.Delimited)}function Ts(t){return Fs(t)===ys.Operator}function Cs(t){return Fs(t)===ys.HTML}function Es(t){return Fs(t)===ys.Tag}function As(t){return Fs(t)===ys.Quoted}function Os(t){return Fs(t)===ys.Number}function Ls(t){return Fs(t)===ys.PropertyAccess}function zs(t){return Fs(t)===ys.Word}function js(t){return Fs(t)===ys.Range}function Ps(t){return(1667&Fs(t))>0}function Fs(t){return t?t.kind:-1}(xs=ys||(ys={}))[xs.Number=1]="Number",xs[xs.Literal=2]="Literal",xs[xs.Tag=4]="Tag",xs[xs.Output=8]="Output",xs[xs.HTML=16]="HTML",xs[xs.Filter=32]="Filter",xs[xs.Hash=64]="Hash",xs[xs.PropertyAccess=128]="PropertyAccess",xs[xs.Word=256]="Word",xs[xs.Range=512]="Range",xs[xs.Quoted=1024]="Quoted",xs[xs.Operator=2048]="Operator",xs[xs.FilteredValue=4096]="FilteredValue",xs[xs.Delimited=12]="Delimited";class Is{constructor(t={},e=Vi,i={},{memoryLimit:s,renderLimit:a}={}){var r,n,o,l,c;this.scopes=[{}],this.registers={},this.breakCalled=!1,this.continueCalled=!1,this.sync=!!i.sync,this.opts=e,this.globals=null!==(r=i.globals)&&void 0!==r?r:e.globals,this.environments=Xt(t)?t:Object(t),this.strictVariables=null!==(n=i.strictVariables)&&void 0!==n?n:this.opts.strictVariables,this.ownPropertyOnly=null!==(o=i.ownPropertyOnly)&&void 0!==o?o:e.ownPropertyOnly,this.memoryLimit=null!=s?s:new ti("memory alloc",null!==(l=i.memoryLimit)&&void 0!==l?l:e.memoryLimit),this.renderLimit=null!=a?a:new ti("template render",ki().now()+(null!==(c=i.renderLimit)&&void 0!==c?c:e.renderLimit))}getRegister(t){return this.registers[t]=this.registers[t]||{}}setRegister(t,e){return this.registers[t]=e}saveRegister(...t){return t.map(t=>[t,this.getRegister(t)])}restoreRegister(t){return t.forEach(([t,e])=>this.setRegister(t,e))}getAll(){return[this.globals,this.environments,...this.scopes].reduce((t,e)=>je(t,e),{})}get(t){return this.getSync(t)}getSync(t){return Ie(this._get(t))}*_get(t){const e=this.findScope(t[0]);return yield this._getFromScope(e,t)}getFromScope(t,e){return Ie(this._getFromScope(t,e))}*_getFromScope(t,e,i=this.strictVariables){Ft(e)&&(e=e.split("."));for(let s=0;s<e.length;s++)if(t=yield this.readProperty(t,e[s]),i&&Jt(t))throw new ve(e.slice(0,s+1).join("."));return t}push(t){return this.scopes.push(t)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}spawn(t={}){return new Is(t,this.opts,{sync:this.sync,globals:this.globals,strictVariables:this.strictVariables},{renderLimit:this.renderLimit,memoryLimit:this.memoryLimit})}findScope(t){for(let e=this.scopes.length-1;e>=0;e--){const i=this.scopes[e];if(t in i)return i}return t in this.environments?this.environments:this.globals}readProperty(t,e){if(t=Bt(t),e=Ht(e),Gt(t))return t;if(Kt(t)&&e<0)return t[t.length+ +e];const i=function(t,e,i){return!i||Pt.call(t,e)||t instanceof Lt?t[e]:void 0}(t,e,this.ownPropertyOnly);return void 0===i&&t instanceof Lt?t.liquidMethodMissing(e,this):It(i)?i.call(t):"size"===e?function(t){if(Pt.call(t,"size")||void 0!==t.size)return t.size;if(Kt(t)||Ft(t))return t.length;if("object"==typeof t)return Object.keys(t).length}(t):"first"===e?function(t){return Kt(t)?t[0]:t.first}(t):"last"===e?function(t){return Kt(t)?t[t.length-1]:t.last}(t):i}}(ws=_s||(_s={}))[ws.OUTPUT=0]="OUTPUT",ws[ws.STORE=1]="STORE";const Rs=re(Math.abs),Ns=re(Math.max),Ds=re(Math.min),qs=re(Math.ceil),Ms=re((t,e,i=!1)=>i?Math.floor(t/e):t/e),Hs=re(Math.floor),Us=re((t,e)=>t-e),Vs=re((t,e)=>t+e),Bs=re((t,e)=>t%e),Gs=re((t,e)=>t*e);var Js=Object.freeze({__proto__:null,abs:Rs,at_least:Ns,at_most:Ds,ceil:qs,divided_by:Ms,floor:Hs,minus:Us,plus:Vs,modulo:Bs,times:Gs,round:function(t,e=0){t=Ut(t),e=Ut(e);const i=Math.pow(10,e);return Math.round(t*i)/i}});const Ks=/[^\p{M}\p{L}\p{Nd}]+/gu,Ws={raw:/\s+/g,default:Ks,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,ascii:/[^A-Za-z0-9]+/g,latin:Ks,none:null};var Ys=Object.freeze({__proto__:null,url_decode:t=>decodeURIComponent(Dt(t)).replace(/\+/g," "),url_encode:t=>encodeURIComponent(Dt(t)).replace(/%20/g,"+"),cgi_escape:t=>encodeURIComponent(Dt(t)).replace(/%20/g,"+").replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase()),uri_escape:t=>encodeURI(Dt(t)).replace(/%5B/g,"[").replace(/%5D/g,"]"),slugify:function(t,e="default",i=!1){t=Dt(t);const s=Ws[e];return s&&("latin"===e&&(t=function(t){return t.replace(/[àáâãäå]/g,"a").replace(/[æ]/g,"ae").replace(/[ç]/g,"c").replace(/[èéêë]/g,"e").replace(/[ìíîï]/g,"i").replace(/[ð]/g,"d").replace(/[ñ]/g,"n").replace(/[òóôõöø]/g,"o").replace(/[ùúûü]/g,"u").replace(/[ýÿ]/g,"y").replace(/[ß]/g,"ss").replace(/[œ]/g,"oe").replace(/[þ]/g,"th").replace(/[ẞ]/g,"SS").replace(/[Œ]/g,"OE").replace(/[Þ]/g,"TH")}(t)),t=t.replace(s,"-").replace(/^-|-$/g,"")),i?t:t.toLowerCase()}});const Qs=ae(function(t,e){const i=Mt(t),s=Gt(e)?" ":Dt(e),a=i.length*(1+s.length);return this.context.memoryLimit.use(a),i.join(s)}),Xs=ae(t=>Wt(t)?Qt(t):""),Zs=ae(t=>Wt(t)?t[0]:""),ta=ae(function(t){const e=Mt(t);return this.context.memoryLimit.use(e.length),[...e].reverse()});function ea(t,e=[]){const i=Mt(t),s=Mt(e);return this.context.memoryLimit.use(i.length+s.length),i.concat(s)}function ia(t){return this.context.opts.jekyllWhere?e=>{return we.is(t)?Li(e,t):Kt(e)?(i=t,e.some(t=>Li(t,i))):Li(e,t);var i}:void 0===t?t=>Ei(t,this.context):e=>Li(e,t)}function*sa(t,e,i,s){const a=[];e=Mt(e),this.context.memoryLimit.use(e.length);const r=new Wi(Dt(i)).readScopeValue();for(const o of e)a.push(yield Ti(r,this.context.spawn(o)));const n=ia.call(this,s);return e.filter((e,i)=>n(a[i])===t)}function*aa(t,e,i,s){const a=[],r=new is(Dt(s),this.liquid),n=Mt(e);this.context.memoryLimit.use(n.length);for(const o of n){this.context.push({[i]:o});const e=yield r.value(this.context);this.context.pop(),e===t&&a.push(o)}return a}function*ra(t,e,i){const s=new Wi(Dt(e)).readScopeValue(),a=Mt(t),r=ia.call(this,i);for(let n=0;n<a.length;n++){if(r(yield Ti(s,this.context.spawn(a[n]))))return[n,a[n]]}}function*na(t,e,i){const s=new is(Dt(i),this.liquid),a=Mt(t);for(let r=0;r<a.length;r++){this.context.push({[e]:a[r]});const t=yield s.value(this.context);if(this.context.pop(),t)return[r,a[r]]}}var oa=Object.freeze({__proto__:null,join:Qs,last:Xs,first:Zs,reverse:ta,sort:function*(t,e){const i=[],s=Mt(t);this.context.memoryLimit.use(s.length);for(const a of s)i.push([a,e?yield this.context._getFromScope(a,Dt(e).split("."),!1):a]);return i.sort((t,e)=>{const i=t[1],s=e[1];return i<s?-1:i>s?1:0}).map(t=>t[0])},sort_natural:function(t,e){const i=Dt(e),s=void 0===e?se:(t,e)=>se(t[i],e[i]),a=Mt(t);return this.context.memoryLimit.use(a.length),[...a].sort(s)},size:t=>t&&t.length||0,map:function*(t,e){const i=[],s=Mt(t);this.context.memoryLimit.use(s.length);for(const a of s)i.push(yield this.context._getFromScope(a,Dt(e),!1));return i},sum:function*(t,e){let i=0;const s=Mt(t);for(const a of s){const t=Number(e?yield this.context._getFromScope(a,Dt(e),!1):a);i+=Number.isNaN(t)?0:t}return i},compact:function(t){const e=Mt(t);return this.context.memoryLimit.use(e.length),e.filter(t=>!Gt(Ht(t)))},concat:ea,push:function(t,e){return ea.call(this,t,[e])},unshift:function(t,e){const i=Mt(t);this.context.memoryLimit.use(i.length);const s=[...i];return s.unshift(e),s},pop:function(t){const e=[...Mt(t)];return e.pop(),e},shift:function(t){const e=Mt(t);this.context.memoryLimit.use(e.length);const i=[...e];return i.shift(),i},slice:function(t,e,i=1){return Gt(t=Ht(t))?[]:(Kt(t)||(t=Dt(t)),e=e<0?t.length+e:e,this.context.memoryLimit.use(i),t.slice(e,e+i))},where:function*(t,e,i){return yield*sa.call(this,!0,t,e,i)},reject:function*(t,e,i){return yield*sa.call(this,!1,t,e,i)},where_exp:function*(t,e,i){return yield*aa.call(this,!0,t,e,i)},reject_exp:function*(t,e,i){return yield*aa.call(this,!1,t,e,i)},group_by:function*(t,e){const i=new Map;t=qt(t);const s=new Wi(Dt(e)).readScopeValue();this.context.memoryLimit.use(t.length);for(const a of t){const t=yield Ti(s,this.context.spawn(a));i.has(t)||i.set(t,[]),i.get(t).push(a)}return[...i.entries()].map(([t,e])=>({name:t,items:e}))},group_by_exp:function*(t,e,i){const s=new Map,a=new is(Dt(i),this.liquid);t=qt(t),this.context.memoryLimit.use(t.length);for(const r of t){this.context.push({[e]:r});const t=yield a.value(this.context);this.context.pop(),s.has(t)||s.set(t,[]),s.get(t).push(r)}return[...s.entries()].map(([t,e])=>({name:t,items:e}))},has:function*(t,e,i){return!!(yield*ra.call(this,t,e,i))},has_exp:function*(t,e,i){return!!(yield*na.call(this,t,e,i))},find_index:function*(t,e,i){const s=yield*ra.call(this,t,e,i);return s?s[0]:void 0},find_index_exp:function*(t,e,i){const s=yield*na.call(this,t,e,i);return s?s[0]:void 0},find:function*(t,e,i){const s=yield*ra.call(this,t,e,i);return s?s[1]:void 0},find_exp:function*(t,e,i){const s=yield*na.call(this,t,e,i);return s?s[1]:void 0},uniq:function(t){return t=Mt(t),this.context.memoryLimit.use(t.length),[...new Set(t)]},sample:function(t,e=1){if(Gt(t=Ht(t)))return[];Kt(t)||(t=Dt(t)),this.context.memoryLimit.use(e);const i=[...t].sort(()=>Math.random()-.5);return 1===e?i[0]:i.slice(0,e)}});function la(t,e,i){var s,a,r;const n=(null!==(s=null==t?void 0:t.length)&&void 0!==s?s:0)+(null!==(a=null==e?void 0:e.length)&&void 0!==a?a:0)+(null!==(r=null==i?void 0:i.length)&&void 0!==r?r:0);this.context.memoryLimit.use(n);const o=da(t,this.context.opts,i);return o?Be(o,e=Gt(e=Ht(e))?this.context.opts.dateFormat:Dt(e)):t}function ca(t,e,i,s){const a=da(t,this.context.opts);if(!a)return t;if("ordinal"===i){const t=a.getDate();return Be(a,"US"===s?`${e} ${t}%q, %Y`:`${t}%q ${e} %Y`)}return Be(a,`%d ${e} %Y`)}function da(t,e,i){let s;const a=null!=i?i:e.timezoneOffset,r=e.locale;return s="now"===(t=Ht(t))||"today"===t?new Ze(Date.now(),r,a):Vt(t)?new Ze(1e3*t,r,a):Ft(t)?/^\d+$/.test(t)?new Ze(1e3*+t,r,a):e.preserveTimezones&&void 0===i?Ze.createDateFixedToTimezone(t,r):new Ze(t,r,a):new Ze(t,r,a),s.valid()?s:void 0}var pa=Object.freeze({__proto__:null,date:la,date_to_xmlschema:function(t){return la.call(this,t,"%Y-%m-%dT%H:%M:%S%:z")},date_to_rfc822:function(t){return la.call(this,t,"%a, %d %b %Y %H:%M:%S %z")},date_to_string:function(t,e,i){return ca.call(this,t,"%b",e,i)},date_to_long_string:function(t,e,i){return ca.call(this,t,"%B",e,i)}});const ha=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu,ua=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;var ga=Object.freeze({__proto__:null,append:function(t,e){xe(2===arguments.length,"append expect 2 arguments");const i=Dt(t),s=Dt(e);return this.context.memoryLimit.use(i.length+s.length),i+s},prepend:function(t,e){xe(2===arguments.length,"prepend expect 2 arguments");const i=Dt(t),s=Dt(e);return this.context.memoryLimit.use(i.length+s.length),s+i},lstrip:function(t,e){const i=Dt(t);return this.context.memoryLimit.use(i.length),e?(e=ne(Dt(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"")):i.replace(/^\s+/,"")},downcase:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),e.toLowerCase()},upcase:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),Dt(e).toUpperCase()},remove:function(t,e){const i=Dt(t);return this.context.memoryLimit.use(i.length),i.split(Dt(e)).join("")},remove_first:function(t,e){const i=Dt(t);return this.context.memoryLimit.use(i.length),i.replace(Dt(e),"")},remove_last:function(t,e){const i=Dt(t);this.context.memoryLimit.use(i.length);const s=Dt(e),a=i.lastIndexOf(s);return-1===a?i:i.substring(0,a)+i.substring(a+s.length)},rstrip:function(t,e){return t=Dt(t),this.context.memoryLimit.use(t.length),e?(e=ne(Dt(e)),t.replace(new RegExp(`[${e}]+$`,"g"),"")):t.replace(/\s+$/,"")},split:function(t,e){const i=Dt(t);this.context.memoryLimit.use(i.length);const s=i.split(Dt(e));for(;s.length&&""===s[s.length-1];)s.pop();return s},strip:function(t,e){const i=Dt(t);return this.context.memoryLimit.use(i.length),e?(e=ne(Dt(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"").replace(new RegExp(`[${e}]+$`,"g"),"")):i.trim()},strip_newlines:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"")},capitalize:function(t){return t=Dt(t),this.context.memoryLimit.use(t.length),t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,i){const s=Dt(t);return this.context.memoryLimit.use(s.length),s.split(Dt(e)).join(i)},replace_first:function(t,e,i){const s=Dt(t);return this.context.memoryLimit.use(s.length),s.replace(Dt(e),i)},replace_last:function(t,e,i){const s=Dt(t);this.context.memoryLimit.use(s.length);const a=Dt(e),r=s.lastIndexOf(a);if(-1===r)return s;const n=Dt(i);return s.substring(0,r)+n+s.substring(r+a.length)},truncate:function(t,e=50,i="..."){const s=Dt(t);return this.context.memoryLimit.use(s.length),s.length<=e?t:s.substring(0,e-i.length)+i},truncatewords:function(t,e=15,i="..."){const s=Dt(t);this.context.memoryLimit.use(s.length);const a=s.split(/\s+/);e<=0&&(e=1);let r=a.slice(0,e).join(" ");return a.length>=e&&(r+=i),r},normalize_whitespace:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),e.replace(/\s+/g," ")},number_of_words:function(t,e){const i=Dt(t);if(this.context.memoryLimit.use(i.length),!(t=i.trim()))return 0;switch(e){case"cjk":return(t.match(ha)||[]).length+(t.match(ua)||[]).length;case"auto":return ha.test(t)?t.match(ha).length+(t.match(ua)||[]).length:t.split(/\s+/).length;default:return t.split(/\s+/).length}},array_to_sentence_string:function(t,e="and"){switch(this.context.memoryLimit.use(t.length),t.length){case 0:return"";case 1:return t[0];case 2:return`${t[0]} ${e} ${t[1]}`;default:return`${t.slice(0,-1).join(", ")}, ${e} ${t[t.length-1]}`}}});var va=Object.freeze({__proto__:null,base64_encode:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),function(t){return btoa(String.fromCharCode(...(new TextEncoder).encode(t)))}(e)},base64_decode:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),function(t){return(new TextDecoder).decode(Uint8Array.from(atob(t),t=>t.charCodeAt(0)))}(e)}});const ma=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Hi),Js),Ys),oa),pa),ga),va),Ri);const fa=["offset","limit","reversed"];function ba(t,e,i){if(e.options.dynamicPartials){const e=t.readValue();if(t.assert(e,"illegal file path"),"none"===e.getText())return;if(As(e)){return ya(i.parse(e.content))}return e}const s=[...t.readFileNameTemplate(e.options)],a=ya(i.parseTokens(s));return"none"===a?void 0:a}function ya(t){return 1===t.length&&Cs(t[0].token)?t[0].token.getContent():t}function*xa(t,e,i){return"string"==typeof t?t:Array.isArray(t)?i.renderer.renderTemplates(t,e):yield Ti(t,e)}class _a extends $e{constructor(t,e,i,s){super(t,i,s),this.length=t,this.cols=e}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return 0===this.col0()}col_last(){return this.col()===this.cols}}const wa={assign:class extends Xi{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.key=this.identifier.content,this.tokenizer.assert(this.key,"expected variable name"),this.tokenizer.skipBlank(),this.tokenizer.assert("="===this.tokenizer.peek(),'expected "="'),this.tokenizer.advance(),this.value=new is(this.tokenizer.readFilteredValue(),this.liquid)}*render(t){t.bottom()[this.key]=yield this.value.value(t,this.liquid.options.lenientIf)}*arguments(){yield this.value}*localScope(){yield this.identifier}},for:class extends Xi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer.readIdentifier(),r=this.tokenizer.readIdentifier(),n=this.tokenizer.readValue();if(!a.size()||"in"!==r.content||!n)throw new Error(`illegal tag: ${t.getText()}`);let o;this.variable=a.content,this.collection=n,this.hash=new Zi(this.tokenizer,i.options.keyValueSeparator),this.templates=[],this.elseTemplates=[];const l=s.parseStream(e).on("start",()=>o=this.templates).on("tag:else",t=>{_e(t.args),o=this.elseTemplates}).on("tag:endfor",t=>{_e(t.args),l.stop()}).on("template",t=>o.push(t)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});l.start()}*render(t,e){const i=this.liquid.renderer;let s=qt(yield Ti(this.collection,t));if(!s.length)return void(yield i.renderTemplates(this.elseTemplates,t,e));const a="continue-"+this.variable+"-"+this.collection.getText();t.push({continue:t.getRegister(a)});const r=yield this.hash.render(t);t.pop();s=(this.liquid.options.orderedFilterParameters?Object.keys(r).filter(t=>fa.includes(t)):fa.filter(t=>void 0!==r[t])).reduce((t,e)=>{return"offset"===e?(i=t,s=r.offset,i.slice(s)):"limit"===e?function(t,e){return t.slice(0,e)}(t,r.limit):function(t){return[...t].reverse()}(t);var i,s},s),t.setRegister(a,(r.offset||0)+s.length);const n={forloop:new $e(s.length,this.collection.getText(),this.variable)};t.push(n);for(const o of s){if(n[this.variable]=o,t.continueCalled=t.breakCalled=!1,yield i.renderTemplates(this.templates,t,e),t.breakCalled)break;n.forloop.next()}t.continueCalled=t.breakCalled=!1,t.pop()}*children(){const t=this.templates.slice();return this.elseTemplates&&t.push(...this.elseTemplates),t}*arguments(){yield this.collection;for(const t of Object.values(this.hash.hash))Ps(t)&&(yield t)}blockScope(){return[this.variable,"forloop"]}},capture:class extends Xi{constructor(t,e,i,s){for(super(t,e,i),this.templates=[],this.identifier=this.readVariable(),this.variable=this.identifier.content;e.length;){const t=e.shift();if(Es(t)&&"endcapture"===t.name)return;this.templates.push(s.parseToken(t,e))}throw new Error(`tag ${t.getText()} not closed`)}readVariable(){let t=this.tokenizer.readIdentifier();if(t.content)return t;if(t=this.tokenizer.readQuoted(),t)return t;throw this.tokenizer.error("invalid capture name")}*render(t){const e=this.liquid.renderer,i=yield e.renderTemplates(this.templates,t);t.bottom()[this.variable]=i}*children(){return this.templates}*localScope(){yield this.identifier}},case:class extends Xi{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[],this.value=new is(this.tokenizer.readFilteredValue(),this.liquid),this.elseTemplates=[];let a=[],r=0;const n=s.parseStream(e).on("tag:when",t=>{if(r>0)return;a=[];const e=[];for(;!t.tokenizer.end();)e.push(t.tokenizer.readValueOrThrow()),t.tokenizer.skipBlank(),","===t.tokenizer.peek()?t.tokenizer.readTo(","):t.tokenizer.readTo("or");this.branches.push({values:e,templates:a})}).on("tag:else",()=>{r++,a=this.elseTemplates}).on("tag:endcase",()=>n.stop()).on("template",t=>{a===this.elseTemplates&&1!==r||a.push(t)}).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});n.start()}*render(t,e){const i=this.liquid.renderer,s=Ht(yield this.value.value(t,t.opts.lenientIf));let a=!1;for(const r of this.branches)for(const n of r.values){if(Li(s,yield Ti(n,t,t.opts.lenientIf))){yield i.renderTemplates(r.templates,t,e),a=!0;break}}a||(yield i.renderTemplates(this.elseTemplates,t,e))}*arguments(){yield this.value,yield*this.branches.flatMap(t=>t.values)}*children(){const t=this.branches.flatMap(t=>t.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}},comment:class extends Xi{constructor(t,e,i){for(super(t,e,i);e.length;){const t=e.shift();if(Es(t)&&"endcomment"===t.name)return}throw new Error(`tag ${t.getText()} not closed`)}render(){}},include:class extends Xi{constructor(t,e,i,s){super(t,e,i);const{tokenizer:a}=t;this.file=ba(a,this.liquid,s),this.currentFile=t.file;const r=a.p;"with"===a.readIdentifier().content?(a.skipBlank(),":"!==a.peek()?this.withVar=a.readValue():a.p=r):a.p=r,this.hash=new Zi(a,i.options.jekyllInclude||i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s,withVar:a}=this,{renderer:r}=i,n=yield xa(this.file,t,i);xe(n,()=>`illegal file path "${n}"`);const o=t.saveRegister("blocks","blockMode");t.setRegister("blocks",{}),t.setRegister("blockMode",_s.OUTPUT);const l=yield s.render(t);a&&(l[n]=yield Ti(a,t));const c=yield i._parsePartialFile(n,t.sync,this.currentFile);t.push(t.opts.jekyllInclude?{include:l}:l),yield r.renderTemplates(c,t,e),t.pop(),t.restoreRegister(o)}*children(t,e){return t&&Ft(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(Ft(this.file)){let t;return this.liquid.options.jekyllInclude?t=["include"]:(t=Object.keys(this.hash.hash),this.withVar&&t.push([this.file,this.withVar])),{name:this.file,isolated:!1,scope:t}}}*arguments(){yield*Object.values(this.hash.hash).filter(Ps),Ps(this.file)&&(yield this.file),Ps(this.withVar)&&(yield this.withVar)}},render:class extends Xi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer;for(this.file=ba(a,this.liquid,s),this.currentFile=t.file;!a.end();){a.skipBlank();const t=a.p,e=a.readIdentifier();if(("with"===e.content||"for"===e.content)&&(a.skipBlank(),":"!==a.peek())){const t=a.readValue();if(t){const i=a.p;let s;"as"===a.readIdentifier().content?s=a.readIdentifier():a.p=i,this[e.content]={value:t,alias:s&&s.content},a.skipBlank(),","===a.peek()&&a.advance();continue}}a.p=t;break}this.hash=new Zi(a,i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s}=this,a=yield xa(this.file,t,i);xe(a,()=>`illegal file path "${a}"`);const r=t.spawn(),n=r.bottom();if(je(n,yield s.render(t)),this.with){const{value:e,alias:i}=this.with;n[i||a]=yield Ti(e,t)}if(this.for){const{value:s,alias:o}=this.for,l=qt(yield Ti(s,t));n.forloop=new $e(l.length,s.getText(),o);for(const t of l){n[o]=t;const s=yield i._parsePartialFile(a,r.sync,this.currentFile);yield i.renderer.renderTemplates(s,r,e),n.forloop.next()}}else{const t=yield i._parsePartialFile(a,r.sync,this.currentFile);yield i.renderer.renderTemplates(t,r,e)}}*children(t,e){return t&&Ft(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(Ft(this.file)){const t=Object.keys(this.hash.hash);if(this.with){const{value:e,alias:i}=this.with;Ft(i)?t.push([i,e]):Ft(this.file)&&t.push([this.file,e])}if(this.for){const{value:e,alias:i}=this.for;Ft(i)?t.push([i,e]):Ft(this.file)&&t.push([this.file,e])}return{name:this.file,isolated:!0,scope:t}}}*arguments(){for(const t of Object.values(this.hash.hash))Ps(t)&&(yield t);if(this.with){const{value:t}=this.with;Ps(t)&&(yield t)}if(this.for){const{value:t}=this.for;Ps(t)&&(yield t)}}},decrement:class extends Xi{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const i=t.environments;Vt(i[this.variable])||(i[this.variable]=0),e.write(Dt(--i[this.variable]))}*localScope(){yield this.identifier}},increment:class extends Xi{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const i=t.environments;Vt(i[this.variable])||(i[this.variable]=0);const s=i[this.variable];i[this.variable]++,e.write(Dt(s))}*localScope(){yield this.identifier}},cycle:class extends Xi{constructor(t,e,i){super(t,e,i),this.candidates=[];const s=this.tokenizer.readValue();for(this.tokenizer.skipBlank(),s&&(":"===this.tokenizer.peek()?(this.group=s,this.tokenizer.advance()):this.candidates.push(s));!this.tokenizer.end();){const t=this.tokenizer.readValue();t&&this.candidates.push(t),this.tokenizer.readTo(",")}this.tokenizer.assert(this.candidates.length,()=>`empty candidates: "${t.getText()}"`)}*render(t,e){const i=`cycle:${yield Ti(this.group,t)}:`+this.candidates.join(","),s=t.getRegister("cycle");let a=s[i];void 0===a&&(a=s[i]=0);const r=this.candidates[a];return a=(a+1)%this.candidates.length,s[i]=a,yield Ti(r,t)}*arguments(){yield*this.candidates,this.group&&(yield this.group)}},if:class extends Xi{constructor(t,e,i,s){super(t,e,i),this.branches=[];let a=[];s.parseStream(e).on("start",()=>this.branches.push({value:new is(t.tokenizer.readFilteredValue(),this.liquid),templates:a=[]})).on("tag:elsif",t=>{xe(!this.elseTemplates,"unexpected elsif after else"),this.branches.push({value:new is(t.tokenizer.readFilteredValue(),this.liquid),templates:a=[]})}).on("tag:else",t=>{_e(t.args),xe(!this.elseTemplates,"duplicated else"),a=this.elseTemplates=[]}).on("tag:endif",function(t){_e(t.args),this.stop()}).on("template",t=>a.push(t)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)}).start()}*render(t,e){const i=this.liquid.renderer;for(const{value:s,templates:a}of this.branches){if(Ei(yield s.value(t,t.opts.lenientIf),t))return void(yield i.renderTemplates(a,t,e))}yield i.renderTemplates(this.elseTemplates||[],t,e)}*children(){const t=this.branches.flatMap(t=>t.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map(t=>t.value)}},layout:class extends Xi{constructor(t,e,i,s){super(t,e,i),this.file=ba(this.tokenizer,this.liquid,s),this.currentFile=t.file,this.args=new Zi(this.tokenizer,i.options.keyValueSeparator),this.templates=s.parseTokens(e)}*render(t,e){const{liquid:i,args:s,file:a}=this,{renderer:r}=i;if(void 0===a)return t.setRegister("blockMode",_s.OUTPUT),void(yield r.renderTemplates(this.templates,t,e));const n=yield xa(this.file,t,i);xe(n,()=>`illegal file path "${n}"`);const o=yield i._parseLayoutFile(n,t.sync,this.currentFile);t.setRegister("blockMode",_s.STORE);const l=yield r.renderTemplates(this.templates,t),c=t.getRegister("blocks");void 0===c[""]&&(c[""]=(t,e)=>e.write(l)),t.setRegister("blockMode",_s.OUTPUT),t.push(yield s.render(t)),yield r.renderTemplates(o,t,e),t.pop()}*children(t){const e=this.templates.slice();return t&&Ft(this.file)&&e.push(...yield this.liquid._parsePartialFile(this.file,!0,this.currentFile)),e}*arguments(){for(const t of Object.values(this.args.hash))Ps(t)&&(yield t);Ps(this.file)&&(yield this.file)}partialScope(){if(Ft(this.file))return{name:this.file,isolated:!1,scope:Object.keys(this.args.hash)}}},block:class extends Xi{constructor(t,e,i,s){super(t,e,i),this.templates=[];const a=/\w+/.exec(t.args);for(this.block=a?a[0]:"";e.length;){const t=e.shift();if(Es(t)&&"endblock"===t.name)return;const i=s.parseToken(t,e);this.templates.push(i)}throw new Error(`tag ${t.getText()} not closed`)}*render(t,e){const i=this.getBlockRender(t);t.getRegister("blockMode")===_s.STORE?t.getRegister("blocks")[this.block]=i:yield i(new Ee,e)}getBlockRender(t){const{liquid:e,templates:i}=this,s=t.getRegister("blocks")[this.block],a=function*(s,a){t.push({block:s}),yield e.renderer.renderTemplates(i,t,a),t.pop()};return s?(t,e)=>s(new Ee(e=>a(t,e)),e):a}*children(){return this.templates}blockScope(){return["block"]}},raw:class extends Xi{constructor(t,e,i){for(super(t,e,i),this.tokens=[];e.length;){const t=e.shift();if(Es(t)&&"endraw"===t.name)return;this.tokens.push(t)}throw new Error(`tag ${t.getText()} not closed`)}render(){return this.tokens.map(t=>t.getText()).join("")}},tablerow:class extends Xi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer.readIdentifier();this.tokenizer.skipBlank();const r=this.tokenizer.readIdentifier(),n=this.tokenizer.readValue();if("in"!==r.content||!n)throw new Error(`illegal tag: ${t.getText()}`);let o;this.variable=a.content,this.collection=n,this.args=new Zi(this.tokenizer,i.options.keyValueSeparator),this.templates=[];const l=s.parseStream(e).on("start",()=>o=this.templates).on("tag:endtablerow",()=>l.stop()).on("template",t=>o.push(t)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});l.start()}*render(t,e){let i=qt(yield Ti(this.collection,t));const s=yield this.args.render(t),a=s.offset||0,r=void 0===s.limit?i.length:s.limit;i=i.slice(a,a+r);const n=s.cols||i.length,o=this.liquid.renderer,l=new _a(i.length,n,this.collection.getText(),this.variable),c={tablerowloop:l};t.push(c);for(let d=0;d<i.length;d++,l.next())c[this.variable]=i[d],0===l.col0()&&(1!==l.row()&&e.write("</tr>"),e.write(`<tr class="row${l.row()}">`)),e.write(`<td class="col${l.col()}">`),yield o.renderTemplates(this.templates,t,e),e.write("</td>");i.length&&e.write("</tr>"),t.pop()}*children(){return this.templates}*arguments(){yield this.collection;for(const t of Object.values(this.args.hash))Ps(t)&&(yield t)}blockScope(){return[this.variable,"tablerowloop"]}},unless:class extends Xi{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[];let a=[],r=0;s.parseStream(e).on("start",()=>this.branches.push({value:new is(t.tokenizer.readFilteredValue(),this.liquid),test:Ai,templates:a=[]})).on("tag:elsif",t=>{r>0?a=[]:this.branches.push({value:new is(t.tokenizer.readFilteredValue(),this.liquid),test:Ei,templates:a=[]})}).on("tag:else",()=>{r++,a=this.elseTemplates}).on("tag:endunless",function(){this.stop()}).on("template",t=>{a===this.elseTemplates&&1!==r||a.push(t)}).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)}).start()}*render(t,e){const i=this.liquid.renderer;for(const{value:s,test:a,templates:r}of this.branches){if(a(yield s.value(t,t.opts.lenientIf),t))return void(yield i.renderTemplates(r,t,e))}yield i.renderTemplates(this.elseTemplates,t,e)}*children(){const t=this.branches.flatMap(t=>t.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map(t=>t.value)}},break:class extends Xi{render(t,e){t.breakCalled=!0}},continue:class extends Xi{render(t,e){t.continueCalled=!0}},echo:class extends Xi{constructor(t,e,i){super(t,e,i),this.tokenizer.skipBlank(),this.tokenizer.end()||(this.value=new is(this.tokenizer.readFilteredValue(),this.liquid))}*render(t,e){if(!this.value)return;const i=yield this.value.value(t,!1);e.write(i)}*arguments(){this.value&&(yield this.value)}},liquid:class extends Xi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer.readLiquidTagTokens(this.liquid.options);this.templates=s.parseTokens(a)}*render(t,e){yield this.liquid.renderer.renderTemplates(this.templates,t,e)}*children(){return this.templates}},"#":class extends Xi{constructor(t,e,i){if(super(t,e,i),-1!==t.args.search(/\n\s*[^#\s]/g))throw new Error("every line of an inline comment must start with a '#' character")}render(){}}};class ka{constructor(t={}){this.renderer=new $i,this.filters={},this.tags={},this.options=Bi(t),this.parser=new $s(this),Yt(wa,(t,e)=>this.registerTag(e,t)),Yt(ma,(t,e)=>this.registerFilter(e,t))}parse(t,e){return new $s(this).parse(t,e)}_render(t,e,i){const s=e instanceof Is?e:new Is(e,this.options,i);return this.renderer.renderTemplates(t,s)}render(t,e,i){return Pe(this,0,void 0,function*(){return Fe(this._render(t,e,Object.assign(Object.assign({},i),{sync:!1})))})}renderSync(t,e,i){return Ie(this._render(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderToNodeStream(t,e,i={}){const s=new Is(e,this.options,i);return this.renderer.renderTemplatesToNodeStream(t,s)}_parseAndRender(t,e,i){const s=this.parse(t);return this._render(s,e,i)}parseAndRender(t,e,i){return Pe(this,0,void 0,function*(){return Fe(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!1})))})}parseAndRenderSync(t,e,i){return Ie(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!0})))}_parsePartialFile(t,e,i){return new $s(this).parseFile(t,e,fs.Partials,i)}_parseLayoutFile(t,e,i){return new $s(this).parseFile(t,e,fs.Layouts,i)}_parseFile(t,e,i,s){return new $s(this).parseFile(t,e,i,s)}parseFile(t,e){return Pe(this,0,void 0,function*(){return Fe(new $s(this).parseFile(t,!1,e))})}parseFileSync(t,e){return Ie(new $s(this).parseFile(t,!0,e))}*_renderFile(t,e,i){const s=yield this._parseFile(t,i.sync,i.lookupType);return yield this._render(s,e,i)}renderFile(t,e,i){return Pe(this,0,void 0,function*(){return Fe(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!1})))})}renderFileSync(t,e,i){return Ie(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderFileToNodeStream(t,e,i){return Pe(this,0,void 0,function*(){const s=yield this.parseFile(t);return this.renderToNodeStream(s,e,i)})}_evalValue(t,e){const i=new is(t,this),s=e instanceof Is?e:new Is(e,this.options);return i.value(s)}evalValue(t,e){return Pe(this,0,void 0,function*(){return Fe(this._evalValue(t,e))})}evalValueSync(t,e){return Ie(this._evalValue(t,e))}registerFilter(t,e){this.filters[t]=e}registerTag(t,e){var i;this.tags[t]=It(e)?e:(i=e,class extends Xi{constructor(t,e,s){super(t,e,s),It(i.parse)&&i.parse.call(this,t,e)}*render(t,e){const s=yield new Zi(this.token.args,t.opts.keyValueSeparator).render(t);return yield i.render.call(this,t,e,s)}})}plugin(t){return t.call(this,ka)}express(){const t=this;let e=!0;return function(i,s,a){if(e){e=!1;const i=Gi(this.root);t.options.root.unshift(...i),t.options.layouts.unshift(...i),t.options.partials.unshift(...i)}t.renderFile(i,s).then(t=>a(null,t),a)}}analyze(t,e={}){return Pe(this,0,void 0,function*(){return cs(t,e)})}analyzeSync(t,e={}){return ds(t,e)}parseAndAnalyze(t,e,i={}){return Pe(this,0,void 0,function*(){return cs(this.parse(t,e),i)})}parseAndAnalyzeSync(t,e,i={}){return ds(this.parse(t,e),i)}variables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Object.keys(i.variables)})}variablesSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Object.keys(i.variables)}fullVariables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.variables).flatMap(t=>t.map(t=>String(t)))))})}fullVariablesSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.variables).flatMap(t=>t.map(t=>String(t)))))}variableSegments(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Array.from(oe(Object.values(i.variables).flatMap(t=>t.map(t=>t.toArray()))))})}variableSegmentsSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Array.from(oe(Object.values(i.variables).flatMap(t=>t.map(t=>t.toArray()))))}globalVariables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Object.keys(i.globals)})}globalVariablesSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Object.keys(i.globals)}globalFullVariables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.globals).flatMap(t=>t.map(t=>String(t)))))})}globalFullVariablesSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.globals).flatMap(t=>t.map(t=>String(t)))))}globalVariableSegments(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Array.from(oe(Object.values(i.globals).flatMap(t=>t.map(t=>t.toArray()))))})}globalVariableSegmentsSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Array.from(oe(Object.values(i.globals).flatMap(t=>t.map(t=>t.toArray()))))}}const $a=new class{constructor(){this.context=null,this.flattenedContext=null,this.history=[],this.maxHistory=50,this.engine=new ka({strictFilters:!1,strictVariables:!1,lenientIf:!0}),this._registerShopifyFilters()}_registerShopifyFilters(){this.engine.registerFilter("money",t=>"$"+(Number(t)/100).toFixed(2)),this.engine.registerFilter("money_without_currency",t=>(Number(t)/100).toFixed(2)),this.engine.registerFilter("money_with_currency",t=>{var e,i,s;const a=Number(t)/100,r=(null==(s=null==(i=null==(e=this.context)?void 0:e.objects)?void 0:i.shop)?void 0:s.currency)||"USD";return"$"+a.toFixed(2)+" "+r}),this.engine.registerFilter("type_of",t=>null==t?"nil":Array.isArray(t)?"array":typeof t),this.engine.registerFilter("json_pretty",t=>JSON.stringify(t,null,2)),this.engine.registerFilter("asset_url",t=>`/assets/${t}`),this.engine.registerFilter("img_url",(t,e="medium")=>"string"==typeof t?t:(null==t?void 0:t.src)||""),this.engine.registerFilter("handle",t=>String(t).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")),this.engine.registerFilter("handleize",t=>String(t).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")),this.engine.registerFilter("pluralize",(t,e,i)=>1===t?e:i||e+"s"),this.engine.registerFilter("within",(t,e)=>e&&e.url?`${e.url}${t}`:t),this.engine.registerFilter("link_to",(t,e,i="")=>`<a href="${e}" title="${i}">${t}</a>`),this.engine.registerFilter("link_to_tag",(t,e=null)=>`<a href="/collections/all/${t}">${t}</a>`),this.engine.registerFilter("link_to_vendor",t=>`<a href="/collections/vendors?q=${encodeURIComponent(t)}">${t}</a>`),this.engine.registerFilter("link_to_type",t=>`<a href="/collections/types?q=${encodeURIComponent(t)}">${t}</a>`),this.engine.registerFilter("highlight",(t,e)=>{if(!e)return t;const i=new RegExp(`(${e})`,"gi");return String(t).replace(i,"<strong>$1</strong>")}),this.engine.registerFilter("metafield_value",t=>t&&"object"==typeof t&&"value"in t?t.value:t)}setContext(t){this.context=t,this.flattenedContext=null}_buildLiquidContext(){var t,e,i,s;if(!this.context)return{};const a=mt.currentCart,r=ft.currentProduct,n={...this.context.objects||{},...a?{cart:a}:{},...r?{product:r}:{},template:null==(t=this.context.meta)?void 0:t.template,request:null==(e=this.context.meta)?void 0:e.request,theme:null==(i=this.context.meta)?void 0:i.theme,localization:null==(s=this.context.meta)?void 0:s.localization,settings:this.context.settings};if(this.context.metafields)for(const[o,l]of Object.entries(this.context.metafields))if(n[o]){const t={};for(const[e,i]of Object.entries(l)){t[e]={};for(const[s,a]of Object.entries(i))t[e][s]=(null==a?void 0:a.value)??a}n[o]={...n[o],metafields:t}}return n}async evaluate(t){if(!t||!t.trim())return{success:!1,error:"Empty expression",expression:t};const e=t.trim(),i=this._buildLiquidContext();try{if(/^[\w.\[\]0-9]+$/.test(e)&&!e.includes("{%")&&!e.includes("{{")&&!e.includes("|")){const t=this._resolvePath(e,i);return this.addToHistory(e),{success:!0,value:t,expression:e}}let t=e;e.includes("{%")||e.includes("{{")||(t=`{{ ${e} }}`);const s=await this.engine.parseAndRender(t,i);this.addToHistory(e);return{success:!0,value:this._parseResult(s.trim()),expression:e}}catch(s){return{success:!1,error:s.message,expression:e}}}_resolvePath(t,e){if(!e)return;const i=t.replace(/\[(\d+)\]/g,".$1").split(".").filter(t=>""!==t);let s=e;for(const a of i){if(null==s)return;s=s[a]}return s}_parseResult(t){if(""===t)return"";if(""===t||"nil"===t||"null"===t)return null;if("true"===t)return!0;if("false"===t)return!1;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}"))try{return JSON.parse(t)}catch{}return t}getCompletions(t){if(!this.context)return[];let e=t.replace(/^\{\{\s*/,"").replace(/\s*\}\}$/,"").trim();const i=e.match(/\{%\s*(\w+)?\s*$/);if(i)return this._getTagCompletions(i[1]||"");const s=e.lastIndexOf("|");if(-1!==s){const t=e.slice(s+1).trim();if(""===t||/^\w*$/.test(t))return this._getFilterCompletions(t)}const a=e.match(/^(.+\[\d+\])\.(\w*)$/);if(a){const t=a[1],e=a[2];return this._getDynamicCompletions(t,e)}const r=this._getAllPaths(),n=e.toLowerCase();return r.filter(t=>t.path.toLowerCase().startsWith(n)).slice(0,20).map(t=>({value:t.path,type:t.type,preview:t.preview}))}_getDynamicCompletions(t,e){const i=this._buildLiquidContext(),s=this._resolvePath(t,i);if(null==s||"object"!=typeof s)return[];const a=[],r=e.toLowerCase();for(const[n,o]of Object.entries(s))if(n.toLowerCase().startsWith(r)){const e=`${t}.${n}`;let i="property",s=o;Array.isArray(o)?(i="array",s=`[${o.length} items]`):"object"==typeof o&&null!==o?(i="object",s=`{${Object.keys(o).length} keys}`):"string"==typeof o?(i="string",s=o.length>50?o.substring(0,50)+"...":o):"number"==typeof o?i="number":"boolean"==typeof o&&(i="boolean"),a.push({value:e,type:i,preview:s})}return a.slice(0,20)}_getTagCompletions(t){const e=t.toLowerCase();return[{value:"if",type:"tag",preview:"Conditional"},{value:"elsif",type:"tag",preview:"Else if"},{value:"else",type:"tag",preview:"Else"},{value:"endif",type:"tag",preview:"End if"},{value:"unless",type:"tag",preview:"Negative conditional"},{value:"endunless",type:"tag",preview:"End unless"},{value:"case",type:"tag",preview:"Switch statement"},{value:"when",type:"tag",preview:"Case option"},{value:"endcase",type:"tag",preview:"End case"},{value:"for",type:"tag",preview:"Loop"},{value:"endfor",type:"tag",preview:"End loop"},{value:"break",type:"tag",preview:"Exit loop"},{value:"continue",type:"tag",preview:"Skip iteration"},{value:"assign",type:"tag",preview:"Assign variable"},{value:"capture",type:"tag",preview:"Capture output"},{value:"endcapture",type:"tag",preview:"End capture"},{value:"increment",type:"tag",preview:"Increment counter"},{value:"decrement",type:"tag",preview:"Decrement counter"},{value:"comment",type:"tag",preview:"Comment block"},{value:"endcomment",type:"tag",preview:"End comment"},{value:"raw",type:"tag",preview:"Raw output"},{value:"endraw",type:"tag",preview:"End raw"},{value:"render",type:"tag",preview:"Render snippet"},{value:"section",type:"tag",preview:"Render section"},{value:"form",type:"tag",preview:"Form tag"},{value:"endform",type:"tag",preview:"End form"},{value:"paginate",type:"tag",preview:"Pagination"},{value:"endpaginate",type:"tag",preview:"End pagination"}].filter(t=>t.value.startsWith(e)).slice(0,15)}_getFilterCompletions(t){const e=t.toLowerCase();return[{value:"append",preview:"Append string"},{value:"prepend",preview:"Prepend string"},{value:"capitalize",preview:"Capitalize first letter"},{value:"downcase",preview:"Convert to lowercase"},{value:"upcase",preview:"Convert to uppercase"},{value:"strip",preview:"Trim whitespace"},{value:"lstrip",preview:"Trim left whitespace"},{value:"rstrip",preview:"Trim right whitespace"},{value:"strip_html",preview:"Remove HTML tags"},{value:"strip_newlines",preview:"Remove newlines"},{value:"newline_to_br",preview:"Convert newlines to <br>"},{value:"replace",preview:"Replace substring"},{value:"replace_first",preview:"Replace first occurrence"},{value:"remove",preview:"Remove substring"},{value:"remove_first",preview:"Remove first occurrence"},{value:"truncate",preview:"Truncate to length"},{value:"truncatewords",preview:"Truncate to word count"},{value:"split",preview:"Split into array"},{value:"slice",preview:"Extract substring"},{value:"escape",preview:"HTML escape"},{value:"escape_once",preview:"HTML escape once"},{value:"url_encode",preview:"URL encode"},{value:"url_decode",preview:"URL decode"},{value:"base64_encode",preview:"Base64 encode"},{value:"base64_decode",preview:"Base64 decode"},{value:"handle",preview:"Convert to handle"},{value:"handleize",preview:"Convert to handle"},{value:"abs",preview:"Absolute value"},{value:"ceil",preview:"Round up"},{value:"floor",preview:"Round down"},{value:"round",preview:"Round to precision"},{value:"plus",preview:"Add number"},{value:"minus",preview:"Subtract number"},{value:"times",preview:"Multiply"},{value:"divided_by",preview:"Divide"},{value:"modulo",preview:"Remainder"},{value:"at_least",preview:"Minimum value"},{value:"at_most",preview:"Maximum value"},{value:"join",preview:"Join array"},{value:"first",preview:"Get first element"},{value:"last",preview:"Get last element"},{value:"size",preview:"Get length"},{value:"reverse",preview:"Reverse array"},{value:"sort",preview:"Sort array"},{value:"sort_natural",preview:"Natural sort"},{value:"uniq",preview:"Remove duplicates"},{value:"map",preview:"Extract property"},{value:"where",preview:"Filter array"},{value:"compact",preview:"Remove nil values"},{value:"concat",preview:"Concatenate arrays"},{value:"date",preview:"Format date"},{value:"default",preview:"Default if nil"},{value:"json",preview:"Convert to JSON"},{value:"json_pretty",preview:"Pretty JSON"},{value:"type_of",preview:"Get type"},{value:"money",preview:"Format as money"},{value:"money_with_currency",preview:"Money with currency"},{value:"money_without_currency",preview:"Money without currency"},{value:"asset_url",preview:"Asset URL"},{value:"img_url",preview:"Image URL"},{value:"link_to",preview:"Create link"},{value:"pluralize",preview:"Pluralize word"},{value:"highlight",preview:"Highlight text"},{value:"metafield_value",preview:"Get metafield value"}].filter(t=>t.value.startsWith(e)).slice(0,15).map(t=>({...t,type:"filter"}))}_getAllPaths(){var t,e,i,s,a,r,n,o;if(!this.flattenedContext){const a=[];if(null==(t=this.context)?void 0:t.objects)for(const[t,e]of Object.entries(this.context.objects))null!=e&&"cart"!==t&&"product"!==t&&this._addPaths(a,t,e,3);if((null==(e=this.context)?void 0:e.meta)&&(this._addPaths(a,"template",this.context.meta.template,2),this._addPaths(a,"request",this.context.meta.request,2),this._addPaths(a,"theme",this.context.meta.theme,2)),null==(i=this.context)?void 0:i.metafields)for(const[t,e]of Object.entries(this.context.metafields))if(e&&(null==(s=this.context.objects)?void 0:s[t]))for(const[i,s]of Object.entries(e))for(const[e,r]of Object.entries(s))a.push({path:`${t}.metafields.${i}.${e}`,type:(null==r?void 0:r.type)||"metafield",preview:null==r?void 0:r.value});this.flattenedContext=a}const l=[...this.flattenedContext],c=mt.currentCart;c?this._addPaths(l,"cart",c,3):(null==(r=null==(a=this.context)?void 0:a.objects)?void 0:r.cart)&&this._addPaths(l,"cart",this.context.objects.cart,3);const d=ft.currentProduct;return d?this._addPaths(l,"product",d,3):(null==(o=null==(n=this.context)?void 0:n.objects)?void 0:o.product)&&this._addPaths(l,"product",this.context.objects.product,3),l}_addPaths(t,e,i,s,a=0){if(a>=s||null==i)return;const r=Array.isArray(i)?"array":typeof i;if(t.push({path:e,type:r,preview:this._getPreview(i)}),"object"!=typeof i||Array.isArray(i))Array.isArray(i)&&i.length>0&&this._addPaths(t,`${e}[0]`,i[0],s,a+1);else for(const[n,o]of Object.entries(i))n.startsWith("_")||this._addPaths(t,`${e}.${n}`,o,s,a+1)}_getPreview(t){return null==t?"null":"string"==typeof t?t.length>50?t.slice(0,50)+"...":t:"number"==typeof t||"boolean"==typeof t?t:Array.isArray(t)?`Array(${t.length})`:"object"==typeof t?`Object(${Object.keys(t).length})`:String(t)}addToHistory(t){this.history[this.history.length-1]!==t&&(this.history.push(t),this.history.length>this.maxHistory&&(this.history=this.history.slice(-this.maxHistory)))}getHistory(){return[...this.history]}clearHistory(){this.history=[]}},Sa=class t extends ot{constructor(){super(),this.logs=[],this.liquidErrors=[],this.filter="",this.activeFilter="all",this.showThemeOnly=!0,this.expandedLogs=new Set,this.groupedErrors=new Map,this.networkErrors=[],this.groupStack=[],this._originalConsole={},this._originalFetch=null,this._currentGroupId=null,this.inputValue="",this.inputHistory=[],this.historyIndex=-1,this.suggestions=[],this.selectedSuggestion=-1,this.showSuggestions=!1,this.showFilterDropdown=!1,this.context=null,this._loadPersistedLogs()}_loadPersistedLogs(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);if(e){const t=JSON.parse(e);this.logs=(t.logs||[]).map(t=>({...t,timestamp:new Date(t.timestamp),persisted:!0})),this.networkErrors=(t.networkErrors||[]).map(t=>({...t,timestamp:new Date(t.timestamp),persisted:!0})),this.logs.forEach(t=>{if("error"===t.type||"warn"===t.type){const e=this._getGroupKey(t),i=this.groupedErrors.get(e);i?i.count++:this.groupedErrors.set(e,{...t,count:1})}}),this.groupedErrors=new Map(this.groupedErrors)}}catch(e){console.warn("Failed to load persisted logs:",e)}}_persistLogs(){try{const e={logs:this.logs.slice(-500).map(t=>({...t,args:void 0})),networkErrors:this.networkErrors.slice(-100)};sessionStorage.setItem(t.STORAGE_KEY,JSON.stringify(e))}catch(e){}}_getGroupKey(t){let e=t.message||"";return e=e.replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/g,"[timestamp]"),e=e.replace(/\d{2}:\d{2}:\d{2}\.\d{3}/g,"[time]"),e=e.replace(/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/gi,"[uuid]"),e=e.replace(/\/\d+\//g,"/[id]/"),e=e.replace(/=\d+(&|$)/g,"=[num]$1"),`${t.type}:${e.substring(0,200)}`}connectedCallback(){super.connectedCallback(),this._interceptConsole(),this._interceptNetwork(),this._scanForLiquidErrors(),this._captureGlobalErrors()}disconnectedCallback(){super.disconnectedCallback(),this._restoreConsole(),this._restoreNetwork(),window.removeEventListener("error",this._handleGlobalError),window.removeEventListener("unhandledrejection",this._handleUnhandledRejection)}updated(t){super.updated(t),t.has("context")&&this.context&&$a.setContext(this.context)}willUpdate(t){t.has("context")&&this.context&&!$a.context&&$a.setContext(this.context)}_interceptConsole(){const t=this;["log","info","warn","error","debug"].forEach(e=>{this._originalConsole[e]=console[e],console[e]=function(...i){t._addLog(e,i),t._originalConsole[e].apply(console,i)}}),this._originalConsole.table=console.table,console.table=function(e,i){t._addLog("table",[e],{columns:i,isTable:!0}),t._originalConsole.table.apply(console,[e,i])},this._originalConsole.group=console.group,this._originalConsole.groupCollapsed=console.groupCollapsed,this._originalConsole.groupEnd=console.groupEnd,console.group=function(...e){const i=Date.now()+Math.random();t._startGroup(e.join(" ")||"Group",i,!1),t._originalConsole.group.apply(console,e)},console.groupCollapsed=function(...e){const i=Date.now()+Math.random();t._startGroup(e.join(" ")||"Group",i,!0),t._originalConsole.groupCollapsed.apply(console,e)},console.groupEnd=function(){t._endGroup(),t._originalConsole.groupEnd.apply(console)}}_restoreConsole(){Object.keys(this._originalConsole).forEach(t=>{this._originalConsole[t]&&(console[t]=this._originalConsole[t])})}_startGroup(t,e,i){const s={id:e,type:"group",message:t,timestamp:new Date,isThemeRelated:this._isThemeRelated(t,""),collapsed:i,children:[],parentGroupId:this._currentGroupId};if(this._currentGroupId){const t=this._findGroupById(this._currentGroupId);t&&t.children.push(s)}else this.logs=[...this.logs,s];this.groupStack.push(e),this._currentGroupId=e}_endGroup(){this.groupStack.pop(),this._currentGroupId=this.groupStack.length>0?this.groupStack[this.groupStack.length-1]:null}_findGroupById(t,e=this.logs){for(const i of e){if(i.id===t)return i;if(i.children){const e=this._findGroupById(t,i.children);if(e)return e}}return null}_interceptNetwork(){const t=this;this._originalFetch=window.fetch,window.fetch=async function(e,i){const s="string"==typeof e?e:e.url,a=(null==i?void 0:i.method)||"GET",r=performance.now();try{const n=await t._originalFetch.apply(window,[e,i]),o=performance.now()-r;return n.ok||t._addNetworkError({url:s,method:a,status:n.status,statusText:n.statusText,duration:o,type:"fetch"}),n}catch(n){const e=performance.now()-r;throw t._addNetworkError({url:s,method:a,status:0,statusText:n.message||"Network Error",duration:e,type:"fetch",error:!0}),n}};const e=XMLHttpRequest.prototype.open,i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(t,i){return this._tdtMethod=t,this._tdtUrl=i,this._tdtStartTime=null,e.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){return this._tdtStartTime=performance.now(),this.addEventListener("loadend",function(){const e=performance.now()-this._tdtStartTime;(this.status>=400||0===this.status)&&t._addNetworkError({url:this._tdtUrl,method:this._tdtMethod,status:this.status,statusText:this.statusText||(0===this.status?"Network Error":""),duration:e,type:"xhr"})}),i.apply(this,arguments)},this._originalXHROpen=e,this._originalXHRSend=i}_restoreNetwork(){this._originalFetch&&(window.fetch=this._originalFetch),this._originalXHROpen&&(XMLHttpRequest.prototype.open=this._originalXHROpen),this._originalXHRSend&&(XMLHttpRequest.prototype.send=this._originalXHRSend)}_addNetworkError(t){const e={id:Date.now()+Math.random(),...t,timestamp:new Date,isThemeRelated:this._isThemeRelated(t.url,"")};this.networkErrors=[...this.networkErrors,e],this._persistLogs()}_captureGlobalErrors(){this._handleGlobalError=t=>{var e;this._addLog("error",[t.message],{stack:null==(e=t.error)?void 0:e.stack,source:`${t.filename}:${t.lineno}:${t.colno}`})},this._handleUnhandledRejection=t=>{var e;this._addLog("error",[`Unhandled Promise Rejection: ${t.reason}`],{stack:null==(e=t.reason)?void 0:e.stack})},window.addEventListener("error",this._handleGlobalError),window.addEventListener("unhandledrejection",this._handleUnhandledRejection)}_addLog(t,e,i={}){const s=e.map(t=>{if("object"==typeof t)try{return JSON.stringify(t,null,2)}catch{return String(t)}return String(t)}).join(" "),a=this._isThemeRelated(s,i.source),r={id:Date.now()+Math.random(),type:t,message:s,args:e,timestamp:new Date,isThemeRelated:a,stack:i.stack,source:i.source,hasObjects:e.some(t=>"object"==typeof t&&null!==t),isTable:i.isTable||!1,tableColumns:i.columns,groupId:this._currentGroupId},n=this._getGroupKey(r),o=this.groupedErrors.get(n);if(!o||"error"!==t&&"warn"!==t)if("error"!==t&&"warn"!==t||(this.groupedErrors.set(n,{...r,count:1}),this.groupedErrors=new Map(this.groupedErrors)),this._currentGroupId){const t=this._findGroupById(this._currentGroupId);t?(t.children.push(r),this.logs=[...this.logs]):this.logs=[...this.logs,r]}else this.logs=[...this.logs,r];else o.count++,o.lastTime=r.timestamp,this.groupedErrors=new Map(this.groupedErrors);this._persistLogs()}_isThemeRelated(e,i=""){const s=(e+" "+i).toLowerCase();return t.THEME_KEYWORDS.some(t=>s.includes(t))}_scanForLiquidErrors(){const t=[],e=new Set,i=(i,s,a=null)=>{const r=i.trim();e.has(r)||(e.add(r),t.push({id:Date.now()+Math.random(),type:"liquid",category:s,message:r,timestamp:new Date,element:a?this._getElementPath(a):null}))},s=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null,!1);for(;s.nextNode();){const t=s.currentNode.textContent;(t.includes("Liquid error")||t.includes("Liquid syntax error"))&&i(t,"comment")}const a=document.body.innerHTML;[/Liquid\s+error\s*\(line\s*\d+\):\s*[^<\n]+/gi,/Liquid\s+error:\s*[^<\n]+/gi,/Liquid\s+syntax\s+error\s*\(line\s*\d+\):\s*[^<\n]+/gi,/Liquid\s+syntax\s+error:\s*[^<\n]+/gi,/Error\s+in\s+schema:\s*[^<\n]+/gi,/Invalid\s+JSON\s+in\s+schema\s+tag/gi,/Error\s+parsing\s+schema:\s*[^<\n]+/gi].forEach(t=>{let e;for(;null!==(e=t.exec(a));)i(e[0],"inline")});const r=/#<(?:Shopify::)?(?:Liquid::)?(\w+)Drop:0x[a-f0-9]+>/gi;let n;for(;null!==(n=r.exec(a));){const t=n[1];i(`Raw ${t} Drop object rendered: ${n[0]} — Use .title, .url, or other property instead of outputting the object directly`,"drop")}const o=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,{acceptNode:t=>{var e;const i=t.parentElement;if(!i)return NodeFilter.FILTER_REJECT;const s=null==(e=i.tagName)?void 0:e.toLowerCase();return"script"===s||"style"===s||"noscript"===s?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;o.nextNode();){const t=o.currentNode.textContent;if(/Liquid\s+(error|syntax error)/i.test(t)){const e=t.match(/Liquid\s+(?:error|syntax error)[^]*/i);e&&i(e[0],"text",o.currentNode.parentElement)}if(/#<\w+Drop:0x/i.test(t)){const e=t.match(/#<(?:Shopify::)?(?:Liquid::)?(\w+)Drop:0x[a-f0-9]+>/i);e&&i(`Raw ${e[1]} Drop object in page: ${e[0]}`,"drop",o.currentNode.parentElement)}/unknown\s+image\s+file/i.test(t)&&i(`Unknown image file error: ${t.substring(0,200)}`,"asset",o.currentNode.parentElement)}document.querySelectorAll("img").forEach(t=>{const e=t.src||t.dataset.src,s=t.alt;s&&/Liquid\s+error|Could\s+not\s+find\s+asset/i.test(s)&&i(`Image error: ${s}`,"asset",t),e&&/Liquid%20error|Could%20not%20find/i.test(e)&&i(`Broken image URL contains error: ${decodeURIComponent(e.substring(0,200))}`,"asset",t)});document.querySelectorAll(".shopify-section, [data-section-type], .template-").forEach(t=>{const e=t.textContent;if(/form\s+'product'\s+needs\s+a\s+product\s+object/i.test(e)&&i("Liquid error: form 'product' needs a product object","form",t),/form\s+'customer_address'\s+requires\s+an\s+address/i.test(e)&&i("Liquid error: form 'customer_address' requires an address","form",t),/invalid\s+form\s+type/i.test(e)){const s=e.match(/invalid\s+form\s+type\s*['"]?(\w+)['"]?/i);i(`Liquid error: invalid form type '${(null==s?void 0:s[1])||"unknown"}'`,"form",t)}}),this._checkDeprecations(),this.liquidErrors=t}_getElementPath(t){var e;if(!t)return null;const i=[];let s=t;for(;s&&s!==document.body&&i.length<5;){let t=(null==(e=s.tagName)?void 0:e.toLowerCase())||"";if(s.id)t+=`#${s.id}`;else if(s.className&&"string"==typeof s.className){const e=s.className.split(" ").filter(t=>t&&!t.startsWith("js-")).slice(0,2);e.length&&(t+=`.${e.join(".")}`)}t&&i.unshift(t),s=s.parentElement}return i.join(" > ")}_checkDeprecations(){document.querySelectorAll("script:not([src])");const e=document.documentElement.innerHTML;t.LIQUID_DEPRECATIONS.forEach(t=>{t.pattern.test(e)&&this._addLog("warn",[`Liquid Deprecation: ${t.message}`],{deprecation:t})})}_filterLogs(t){this.filter=t.target.value}_setFilter(t){this.activeFilter=t,this.showFilterDropdown=!1}_toggleFilterDropdown(){this.showFilterDropdown=!this.showFilterDropdown}_closeFilterDropdown(){this.showFilterDropdown=!1}_getFilterLabel(t){return{all:"📋 All",error:"❌ Errors",warn:"⚠️ Warnings",info:"ℹ️ Info",log:"📝 Logs",liquid:"💧 Liquid",network:"🌐 Network"}[t]||"📋 All"}_toggleThemeOnly(){this.showThemeOnly=!this.showThemeOnly}_clearLogs(){this.logs=[],this.networkErrors=[],this.groupedErrors=new Map,this.groupStack=[],this._currentGroupId=null,sessionStorage.removeItem(t.STORAGE_KEY)}_handleInputKeydown(t){switch(t.key){case"Enter":if(t.shiftKey)return;t.preventDefault(),this.showSuggestions&&this.selectedSuggestion>=0?this._selectSuggestion(this.selectedSuggestion):this._evaluateExpression();break;case"ArrowUp":this.showSuggestions&&this.suggestions.length>0?(t.preventDefault(),this.selectedSuggestion=this.selectedSuggestion<=0?this.suggestions.length-1:this.selectedSuggestion-1,this._scrollSuggestionIntoView()):this.inputValue.includes("\n")&&!this._isAtFirstLine(t.target)||(t.preventDefault(),this._navigateHistory(-1));break;case"ArrowDown":this.showSuggestions&&this.suggestions.length>0?(t.preventDefault(),this.selectedSuggestion=this.selectedSuggestion>=this.suggestions.length-1?0:this.selectedSuggestion+1,this._scrollSuggestionIntoView()):this.inputValue.includes("\n")&&!this._isAtLastLine(t.target)||(t.preventDefault(),this._navigateHistory(1));break;case"Tab":if(this.showSuggestions&&this.suggestions.length>0){t.preventDefault();const e=this.selectedSuggestion>=0?this.selectedSuggestion:0;this._selectSuggestion(e)}break;case"Escape":this.showSuggestions&&(t.preventDefault(),this.showSuggestions=!1,this.selectedSuggestion=-1)}}_isAtFirstLine(t){const e=t.selectionStart;return!t.value.substring(0,e).includes("\n")}_isAtLastLine(t){const e=t.selectionStart;return!t.value.substring(e).includes("\n")}_scrollSuggestionIntoView(){this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(".autocomplete-dropdown"),e=this.shadowRoot.querySelector(".autocomplete-item--selected");t&&e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})})}_handleInput(t){this.inputValue=t.target.value,this.historyIndex=-1,this._updateSuggestions(),this._autoGrowTextarea(t.target)}_autoGrowTextarea(t){t.style.height="auto",t.style.height=Math.min(t.scrollHeight,150)+"px"}_updateSuggestions(){if(!this.inputValue.trim())return this.suggestions=[],this.showSuggestions=!1,void(this.selectedSuggestion=-1);this.suggestions=$a.getCompletions(this.inputValue),this.showSuggestions=this.suggestions.length>0,this.selectedSuggestion=-1}_selectSuggestion(t){const e=this.suggestions[t];if(!e)return;const i=this.inputValue.lastIndexOf("|");-1!==i&&"filter"===e.type?this.inputValue=this.inputValue.slice(0,i+1)+" "+e.value:this.inputValue=e.value,this.showSuggestions=!1,this.selectedSuggestion=-1,this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(".console-input");t&&(t.focus(),t.setSelectionRange(t.value.length,t.value.length),this._autoGrowTextarea(t))})}_navigateHistory(t){const e=$a.getHistory();0!==e.length&&(-1===t?this.historyIndex<e.length-1&&(this.historyIndex++,this.inputValue=e[e.length-1-this.historyIndex]):this.historyIndex>0?(this.historyIndex--,this.inputValue=e[e.length-1-this.historyIndex]):0===this.historyIndex&&(this.historyIndex=-1,this.inputValue=""),this.showSuggestions=!1)}async _evaluateExpression(){if(!this.inputValue.trim())return;const t=this.inputValue;this.inputValue="",this.historyIndex=-1,this.showSuggestions=!1;const e=await $a.evaluate(t),i={id:Date.now()+Math.random(),type:"eval",expression:e.expression,message:e.expression,result:e.success?e.value:null,error:e.success?null:e.error,success:e.success,timestamp:new Date,isThemeRelated:!0};this.logs=[...this.logs,i],this._persistLogs(),this.inputHistory=$a.getHistory(),this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(".console-content");t&&(t.scrollTop=t.scrollHeight)})}_renderEvalResult(t){if(!t.success)return U`<span class="eval-result eval-result--error">${t.error}</span>`;const e=t.result;return void 0===e?U`<span class="eval-result eval-result--undefined">undefined</span>`:null===e?U`<span class="eval-result eval-result--null">null</span>`:"string"==typeof e?U`<span class="eval-result eval-result--string">"${e}"</span>`:"number"==typeof e?U`<span class="eval-result eval-result--number">${e}</span>`:"boolean"==typeof e?U`<span class="eval-result eval-result--boolean">${e}</span>`:"object"==typeof e?U`
2967
+ <div class="eval-result">
2968
+ <tdt-object-inspector .data=${e} .path=${"result"}></tdt-object-inspector>
2969
+ </div>
2970
+ `:U`<span class="eval-result">${String(e)}</span>`}_toggleExpand(t){const e=new Set(this.expandedLogs);e.has(t)?e.delete(t):e.add(t),this.expandedLogs=e}_getFilteredLogs(){let t=this.logs.filter(t=>!t.groupId);if(this.showThemeOnly&&(t=t.filter(t=>t.isThemeRelated)),"all"!==this.activeFilter)if("liquid"===this.activeFilter)t=t.filter(t=>t.message.toLowerCase().includes("liquid")||this.liquidErrors.some(e=>e.message===t.message));else{if("network"===this.activeFilter)return[];t="table"===this.activeFilter?t.filter(t=>t.isTable):"group"===this.activeFilter?t.filter(t=>"group"===t.type):t.filter(t=>t.type===this.activeFilter)}if(this.filter){const e=this.filter.toLowerCase();t=t.filter(t=>t.message.toLowerCase().includes(e))}return t}_getFilteredNetworkErrors(){let t=this.networkErrors;if(this.showThemeOnly&&(t=t.filter(t=>t.isThemeRelated)),this.filter){const e=this.filter.toLowerCase();t=t.filter(t=>t.url.toLowerCase().includes(e)||t.statusText.toLowerCase().includes(e))}return t}_getCounts(){const t=this.showThemeOnly?this.logs.filter(t=>t.isThemeRelated):this.logs,e=this.showThemeOnly?this.networkErrors.filter(t=>t.isThemeRelated):this.networkErrors;return{all:t.length+e.length,error:t.filter(t=>"error"===t.type).length,warn:t.filter(t=>"warn"===t.type).length,info:t.filter(t=>"info"===t.type).length,log:t.filter(t=>"log"===t.type||"debug"===t.type).length,liquid:this.liquidErrors.length,network:e.length,table:t.filter(t=>t.isTable).length,group:t.filter(t=>"group"===t.type).length}}_formatTime(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}_renderLogContent(t){if(t.isTable&&t.args&&t.args[0])return U`
2968
2971
  <div class="log-content">
2969
2972
  ${this._renderTable(t.args[0],t.tableColumns)}
2970
2973
  </div>
@@ -2981,17 +2984,17 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2981
2984
  ${t.stack?U`<pre class="log-stack">${t.stack}</pre>`:""}
2982
2985
  ${t.source?U`<div class="log-source">Source: ${t.source}</div>`:""}
2983
2986
  </div>
2984
- `:null}_renderTable(t,e){if(!t)return null;let a=Array.isArray(t)?t:Object.entries(t).map(([t,e])=>({"(index)":t,...e}));if(0===a.length)return U`<span class="preview">Empty table</span>`;let i=new Set;a.forEach(t=>{"object"==typeof t&&null!==t&&Object.keys(t).forEach(t=>i.add(t))});let s=e?e.filter(t=>i.has(t)):Array.from(i);return s.includes("(index)")||(s=["(index)",...s]),U`
2987
+ `:null}_renderTable(t,e){if(!t)return null;let i=Array.isArray(t)?t:Object.entries(t).map(([t,e])=>({"(index)":t,...e}));if(0===i.length)return U`<span class="preview">Empty table</span>`;let s=new Set;i.forEach(t=>{"object"==typeof t&&null!==t&&Object.keys(t).forEach(t=>s.add(t))});let a=e?e.filter(t=>s.has(t)):Array.from(s);return a.includes("(index)")||(a=["(index)",...a]),U`
2985
2988
  <table class="log-table">
2986
2989
  <thead>
2987
2990
  <tr>
2988
- ${s.map(t=>U`<th>${t}</th>`)}
2991
+ ${a.map(t=>U`<th>${t}</th>`)}
2989
2992
  </tr>
2990
2993
  </thead>
2991
2994
  <tbody>
2992
- ${a.map((t,e)=>U`
2995
+ ${i.map((t,e)=>U`
2993
2996
  <tr>
2994
- ${s.map(a=>{if("(index)"===a)return U`<td>${t["(index)"]??e}</td>`;const i=t&&"object"==typeof t?t[a]:t;return U`<td>${this._formatTableValue(i)}</td>`})}
2997
+ ${a.map(i=>{if("(index)"===i)return U`<td>${t["(index)"]??e}</td>`;const s=t&&"object"==typeof t?t[i]:t;return U`<td>${this._formatTableValue(s)}</td>`})}
2995
2998
  </tr>
2996
2999
  `)}
2997
3000
  </tbody>
@@ -3030,7 +3033,20 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3030
3033
  </div>
3031
3034
  `})}
3032
3035
  </div>
3033
- `}_renderLogItem(t){var e;const a=this._getGroupKey(t),i=this.groupedErrors.get(a),s=(null==i?void 0:i.count)||1,o=this.expandedLogs.has(t.id),r=t.hasObjects||t.stack||t.source||t.isTable||"group"===t.type;return"group"===t.type?U`
3036
+ `}_renderLogItem(t){var e;const i=this._getGroupKey(t),s=this.groupedErrors.get(i),a=(null==s?void 0:s.count)||1,r=this.expandedLogs.has(t.id),n=t.hasObjects||t.stack||t.source||t.isTable||"group"===t.type;return"eval"===t.type?U`
3037
+ <div class="log-item log-item--eval">
3038
+ <div class="log-header">
3039
+ <span class="log-type log-type--eval">EVAL</span>
3040
+ <span class="log-message">
3041
+ <span class="eval-expression">${t.expression}</span>
3042
+ </span>
3043
+ <span class="log-time">${this._formatTime(t.timestamp)}</span>
3044
+ </div>
3045
+ <div class="log-content">
3046
+ ${this._renderEvalResult(t)}
3047
+ </div>
3048
+ </div>
3049
+ `:"group"===t.type?U`
3034
3050
  <div class="log-item log-item--group">
3035
3051
  <div class="log-header" @click=${()=>this._toggleExpand(t.id)}>
3036
3052
  <span class="log-type log-type--group">GROUP</span>
@@ -3038,25 +3054,25 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3038
3054
  ${(null==(e=t.children)?void 0:e.length)?U`<span class="log-count">${t.children.length} items</span>`:""}
3039
3055
  <span class="log-time">${this._formatTime(t.timestamp)}</span>
3040
3056
  </div>
3041
- ${o||!t.collapsed?this._renderGroupChildren(t.children):""}
3057
+ ${r||!t.collapsed?this._renderGroupChildren(t.children):""}
3042
3058
  </div>
3043
3059
  `:U`
3044
3060
  <div class="log-item log-item--${t.type}${t.isTable?" log-item--table":""}">
3045
- <div class="log-header" @click=${()=>r&&this._toggleExpand(t.id)}>
3061
+ <div class="log-header" @click=${()=>n&&this._toggleExpand(t.id)}>
3046
3062
  <span class="log-type log-type--${t.isTable?"info":t.type}">${t.isTable?"TABLE":t.type}</span>
3047
3063
  <span class="log-message">${t.message}</span>
3048
- ${s>1?U`<span class="log-count">${s}</span>`:""}
3064
+ ${a>1?U`<span class="log-count">${a}</span>`:""}
3049
3065
  ${t.persisted?U`<span class="persist-indicator">from previous page</span>`:""}
3050
3066
  <span class="log-time">${this._formatTime(t.timestamp)}</span>
3051
3067
  </div>
3052
- ${o?this._renderLogContent(t):""}
3068
+ ${r?this._renderLogContent(t):""}
3053
3069
  </div>
3054
3070
  `}_renderLiquidErrors(){if(0===this.liquidErrors.length)return null;return U`
3055
3071
  <div class="liquid-section">
3056
3072
  <div class="section-title">Liquid Errors Found on Page (${this.liquidErrors.length})</div>
3057
- ${this.liquidErrors.map(t=>{const e=this.expandedLogs.has(t.id),a=t.element||"drop"===t.category;return U`
3073
+ ${this.liquidErrors.map(t=>{const e=this.expandedLogs.has(t.id),i=t.element||"drop"===t.category;return U`
3058
3074
  <div class="log-item ${(t=>{switch(t){case"drop":return"log-item--drop";case"asset":return"log-item--asset";case"schema":return"log-item--schema";default:return"log-item--liquid"}})(t.category)}">
3059
- <div class="log-header" @click=${()=>a&&this._toggleExpand(t.id)}>
3075
+ <div class="log-header" @click=${()=>i&&this._toggleExpand(t.id)}>
3060
3076
  <span class="log-type ${(t=>{switch(t){case"drop":return"log-type--drop";case"asset":return"log-type--asset";case"schema":return"log-type--schema";default:return"log-type--liquid"}})(t.category)}">${(t=>{switch(t){case"drop":return"DROP";case"asset":return"ASSET";case"schema":return"SCHEMA";case"form":return"FORM";default:return"LIQUID"}})(t.category)}</span>
3061
3077
  <span class="log-message">${t.message}</span>
3062
3078
  ${t.category&&"inline"!==t.category?U`
@@ -3069,28 +3085,28 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3069
3085
  ${t.element?U`
3070
3086
  <div class="element-path">Found in: ${t.element}</div>
3071
3087
  `:""}
3072
- ${(t=>{var e;if("drop"===t.category){const a=t.message.match(/Raw\s+(\w+)\s+Drop/i),i=(null==(e=null==a?void 0:a[1])?void 0:e.toLowerCase())||"object";return U`
3088
+ ${(t=>{var e;if("drop"===t.category){const i=t.message.match(/Raw\s+(\w+)\s+Drop/i),s=(null==(e=null==i?void 0:i[1])?void 0:e.toLowerCase())||"object";return U`
3073
3089
  <div class="liquid-hint">
3074
- Instead of <code>{{ ${i} }}</code>, use a specific property like
3075
- <code>{{ ${i}.title }}</code>, <code>{{ ${i}.url }}</code>, or
3076
- <code>{{ ${i}.handle }}</code>
3090
+ Instead of <code>{{ ${s} }}</code>, use a specific property like
3091
+ <code>{{ ${s}.title }}</code>, <code>{{ ${s}.url }}</code>, or
3092
+ <code>{{ ${s}.handle }}</code>
3077
3093
  </div>
3078
- `}if(t.message.includes("Could not find snippet")){const e=t.message.match(/Could not find snippet '([^']+)'/i),a=(null==e?void 0:e[1])||"snippet-name";return U`
3094
+ `}if(t.message.includes("Could not find snippet")){const e=t.message.match(/Could not find snippet '([^']+)'/i),i=(null==e?void 0:e[1])||"snippet-name";return U`
3079
3095
  <div class="liquid-hint">
3080
- Create the missing snippet file: <code>snippets/${a}.liquid</code>
3096
+ Create the missing snippet file: <code>snippets/${i}.liquid</code>
3081
3097
  </div>
3082
- `}if(t.message.includes("Could not find asset")){const e=t.message.match(/Could not find asset '([^']+)'/i),a=(null==e?void 0:e[1])||"asset-name";return U`
3098
+ `}if(t.message.includes("Could not find asset")){const e=t.message.match(/Could not find asset '([^']+)'/i),i=(null==e?void 0:e[1])||"asset-name";return U`
3083
3099
  <div class="liquid-hint">
3084
- Upload the missing asset to: <code>assets/${a}</code>
3100
+ Upload the missing asset to: <code>assets/${i}</code>
3085
3101
  </div>
3086
- `}if(t.message.includes("Unknown filter")){const e=t.message.match(/Unknown filter '([^']+)'/i),a=(null==e?void 0:e[1])||"filter";return U`
3102
+ `}if(t.message.includes("Unknown filter")){const e=t.message.match(/Unknown filter '([^']+)'/i),i=(null==e?void 0:e[1])||"filter";return U`
3087
3103
  <div class="liquid-hint">
3088
- The filter <code>${a}</code> doesn't exist in Shopify Liquid. Check the
3104
+ The filter <code>${i}</code> doesn't exist in Shopify Liquid. Check the
3089
3105
  <a href="https://shopify.dev/docs/api/liquid/filters" target="_blank" style="color: var(--tdt-accent)">Liquid filters reference</a>.
3090
3106
  </div>
3091
- `}if(t.message.includes("Unknown tag")){const e=t.message.match(/Unknown tag '([^']+)'/i),a=(null==e?void 0:e[1])||"tag";return U`
3107
+ `}if(t.message.includes("Unknown tag")){const e=t.message.match(/Unknown tag '([^']+)'/i),i=(null==e?void 0:e[1])||"tag";return U`
3092
3108
  <div class="liquid-hint">
3093
- The tag <code>${a}</code> doesn't exist in Shopify Liquid. Check the
3109
+ The tag <code>${i}</code> doesn't exist in Shopify Liquid. Check the
3094
3110
  <a href="https://shopify.dev/docs/api/liquid/tags" target="_blank" style="color: var(--tdt-accent)">Liquid tags reference</a>.
3095
3111
  </div>
3096
3112
  `}return t.message.includes("divided by 0")?U`
@@ -3104,167 +3120,308 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3104
3120
  `})}
3105
3121
  </div>
3106
3122
  `}render(){const t=this._getFilteredLogs(),e=this._getCounts();return U`
3107
- <div class="toolbar">
3108
- <input
3109
- type="search"
3110
- class="search"
3111
- placeholder="Filter logs..."
3112
- .value=${this.filter}
3113
- @input=${this._filterLogs}
3114
- >
3115
- <button
3116
- class="toggle-btn ${this.showThemeOnly?"toggle-btn--active":""}"
3117
- @click=${this._toggleThemeOnly}
3118
- title="Show only theme-related logs"
3119
- >
3120
- 🎯 Theme Only
3121
- </button>
3122
- <button class="btn-clear" @click=${this._clearLogs}>
3123
- 🗑️ Clear
3124
- </button>
3125
- </div>
3123
+ <div class="console-container">
3124
+ <div class="console-content">
3125
+ <div class="toolbar">
3126
+ <div class="filter-dropdown">
3127
+ <button
3128
+ class="filter-dropdown-trigger ${"all"!==this.activeFilter?"filter-dropdown-trigger--active":""}"
3129
+ @click=${this._toggleFilterDropdown}
3130
+ >
3131
+ ${this._getFilterLabel(this.activeFilter)}
3132
+ ${e.all>0?U`<span class="filter-dropdown-trigger__count">${e.all}</span>`:""}
3133
+ <span class="filter-dropdown-trigger__icon ${this.showFilterDropdown?"filter-dropdown-trigger__icon--open":""}">▼</span>
3134
+ </button>
3135
+ ${this.showFilterDropdown?U`
3136
+ <div class="filter-dropdown-menu" @mouseleave=${this._closeFilterDropdown}>
3137
+ <button
3138
+ class="filter-dropdown-item ${"all"===this.activeFilter?"filter-dropdown-item--active":""}"
3139
+ @click=${()=>this._setFilter("all")}
3140
+ >
3141
+ <span class="filter-dropdown-item__icon">📋</span>
3142
+ <span class="filter-dropdown-item__label">All</span>
3143
+ <span class="filter-dropdown-item__count">${e.all}</span>
3144
+ </button>
3145
+ <button
3146
+ class="filter-dropdown-item filter-dropdown-item--error ${"error"===this.activeFilter?"filter-dropdown-item--active":""}"
3147
+ @click=${()=>this._setFilter("error")}
3148
+ >
3149
+ <span class="filter-dropdown-item__icon">❌</span>
3150
+ <span class="filter-dropdown-item__label">Errors</span>
3151
+ <span class="filter-dropdown-item__count">${e.error}</span>
3152
+ </button>
3153
+ <button
3154
+ class="filter-dropdown-item filter-dropdown-item--warn ${"warn"===this.activeFilter?"filter-dropdown-item--active":""}"
3155
+ @click=${()=>this._setFilter("warn")}
3156
+ >
3157
+ <span class="filter-dropdown-item__icon">⚠️</span>
3158
+ <span class="filter-dropdown-item__label">Warnings</span>
3159
+ <span class="filter-dropdown-item__count">${e.warn}</span>
3160
+ </button>
3161
+ <button
3162
+ class="filter-dropdown-item ${"info"===this.activeFilter?"filter-dropdown-item--active":""}"
3163
+ @click=${()=>this._setFilter("info")}
3164
+ >
3165
+ <span class="filter-dropdown-item__icon">ℹ️</span>
3166
+ <span class="filter-dropdown-item__label">Info</span>
3167
+ <span class="filter-dropdown-item__count">${e.info}</span>
3168
+ </button>
3169
+ <button
3170
+ class="filter-dropdown-item ${"log"===this.activeFilter?"filter-dropdown-item--active":""}"
3171
+ @click=${()=>this._setFilter("log")}
3172
+ >
3173
+ <span class="filter-dropdown-item__icon">📝</span>
3174
+ <span class="filter-dropdown-item__label">Logs</span>
3175
+ <span class="filter-dropdown-item__count">${e.log}</span>
3176
+ </button>
3177
+ ${e.liquid>0?U`
3178
+ <button
3179
+ class="filter-dropdown-item ${"liquid"===this.activeFilter?"filter-dropdown-item--active":""}"
3180
+ @click=${()=>this._setFilter("liquid")}
3181
+ >
3182
+ <span class="filter-dropdown-item__icon">💧</span>
3183
+ <span class="filter-dropdown-item__label">Liquid</span>
3184
+ <span class="filter-dropdown-item__count">${e.liquid}</span>
3185
+ </button>
3186
+ `:""}
3187
+ ${e.network>0?U`
3188
+ <button
3189
+ class="filter-dropdown-item filter-dropdown-item--error ${"network"===this.activeFilter?"filter-dropdown-item--active":""}"
3190
+ @click=${()=>this._setFilter("network")}
3191
+ >
3192
+ <span class="filter-dropdown-item__icon">🌐</span>
3193
+ <span class="filter-dropdown-item__label">Network</span>
3194
+ <span class="filter-dropdown-item__count">${e.network}</span>
3195
+ </button>
3196
+ `:""}
3197
+ </div>
3198
+ `:""}
3199
+ </div>
3200
+ <input
3201
+ type="search"
3202
+ class="search"
3203
+ placeholder="Filter logs..."
3204
+ .value=${this.filter}
3205
+ @input=${this._filterLogs}
3206
+ >
3207
+ <button
3208
+ class="toggle-btn ${this.showThemeOnly?"toggle-btn--active":""}"
3209
+ @click=${this._toggleThemeOnly}
3210
+ title="Show only theme-related logs"
3211
+ >
3212
+ Theme Only
3213
+ </button>
3214
+ <button class="btn-clear" @click=${this._clearLogs}>
3215
+ Clear
3216
+ </button>
3217
+ </div>
3126
3218
 
3127
- <div class="filter-tabs">
3128
- <button
3129
- class="filter-tab ${"all"===this.activeFilter?"filter-tab--active":""}"
3130
- @click=${()=>this._setFilter("all")}
3131
- >
3132
- All <span class="filter-tab__count">${e.all}</span>
3133
- </button>
3134
- <button
3135
- class="filter-tab filter-tab--error ${"error"===this.activeFilter?"filter-tab--active":""}"
3136
- @click=${()=>this._setFilter("error")}
3137
- >
3138
- ❌ Errors <span class="filter-tab__count">${e.error}</span>
3139
- </button>
3140
- <button
3141
- class="filter-tab filter-tab--warn ${"warn"===this.activeFilter?"filter-tab--active":""}"
3142
- @click=${()=>this._setFilter("warn")}
3143
- >
3144
- ⚠️ Warnings <span class="filter-tab__count">${e.warn}</span>
3145
- </button>
3146
- <button
3147
- class="filter-tab ${"info"===this.activeFilter?"filter-tab--active":""}"
3148
- @click=${()=>this._setFilter("info")}
3149
- >
3150
- ℹ️ Info <span class="filter-tab__count">${e.info}</span>
3151
- </button>
3152
- <button
3153
- class="filter-tab ${"log"===this.activeFilter?"filter-tab--active":""}"
3154
- @click=${()=>this._setFilter("log")}
3155
- >
3156
- 📝 Logs <span class="filter-tab__count">${e.log}</span>
3157
- </button>
3158
- ${e.liquid>0?U`
3159
- <button
3160
- class="filter-tab ${"liquid"===this.activeFilter?"filter-tab--active":""}"
3161
- @click=${()=>this._setFilter("liquid")}
3162
- >
3163
- 💧 Liquid <span class="filter-tab__count">${e.liquid}</span>
3164
- </button>
3165
- `:""}
3166
- ${e.network>0?U`
3167
- <button
3168
- class="filter-tab filter-tab--error ${"network"===this.activeFilter?"filter-tab--active":""}"
3169
- @click=${()=>this._setFilter("network")}
3170
- >
3171
- 🌐 Network <span class="filter-tab__count">${e.network}</span>
3172
- </button>
3173
- `:""}
3174
- </div>
3219
+ ${"all"===this.activeFilter||"liquid"===this.activeFilter?this._renderLiquidErrors():""}
3175
3220
 
3176
- ${"all"===this.activeFilter||"liquid"===this.activeFilter?this._renderLiquidErrors():""}
3221
+ ${"all"===this.activeFilter||"network"===this.activeFilter?this._renderNetworkErrors():""}
3177
3222
 
3178
- ${"all"===this.activeFilter||"network"===this.activeFilter?this._renderNetworkErrors():""}
3223
+ ${"network"===this.activeFilter?"":0===t.length?U`
3224
+ <div class="empty-state">
3225
+ <div class="empty-state__icon">📋</div>
3226
+ <div>No ${this.showThemeOnly?"theme-related ":""}logs captured yet</div>
3227
+ </div>
3228
+ `:U`
3229
+ <div class="log-list">
3230
+ ${t.map(t=>this._renderLogItem(t))}
3231
+ </div>
3232
+ `}
3233
+ </div>
3179
3234
 
3180
- ${"network"===this.activeFilter?"":0===t.length?U`
3181
- <div class="empty-state">
3182
- <div class="empty-state__icon">📋</div>
3183
- <div>No ${this.showThemeOnly?"theme-related ":""}logs captured yet</div>
3184
- </div>
3185
- `:U`
3186
- <div class="log-list">
3187
- ${t.slice().reverse().map(t=>this._renderLogItem(t))}
3188
- </div>
3189
- `}
3190
- `}};__publicField(Ot,"properties",{logs:{type:Array,state:!0},liquidErrors:{type:Array,state:!0},filter:{type:String,state:!0},activeFilter:{type:String,state:!0},showThemeOnly:{type:Boolean,state:!0},expandedLogs:{type:Set,state:!0},groupedErrors:{type:Map,state:!0},networkErrors:{type:Array,state:!0},groupStack:{type:Array,state:!0}}),__publicField(Ot,"STORAGE_KEY","tdt-console-logs"),__publicField(Ot,"styles",[pt,r`
3235
+ <div class="console-input-container">
3236
+ ${this.showSuggestions&&this.suggestions.length>0?U`
3237
+ <div class="autocomplete-dropdown">
3238
+ ${this.suggestions.map((t,e)=>U`
3239
+ <div
3240
+ class="autocomplete-item ${e===this.selectedSuggestion?"autocomplete-item--selected":""}"
3241
+ @click=${()=>this._selectSuggestion(e)}
3242
+ @mouseenter=${()=>this.selectedSuggestion=e}
3243
+ >
3244
+ <span class="autocomplete-path">${t.value}</span>
3245
+ <span class="autocomplete-type ${"filter"===t.type?"autocomplete-type--filter":""}">${t.type}</span>
3246
+ ${t.preview?U`
3247
+ <span class="autocomplete-preview">${"object"==typeof t.preview?JSON.stringify(t.preview):t.preview}</span>
3248
+ `:""}
3249
+ </div>
3250
+ `)}
3251
+ </div>
3252
+ `:""}
3253
+ ${this.inputValue.includes("\n")?U`
3254
+ <span class="console-input-hint">Shift+Enter for newline</span>
3255
+ `:""}
3256
+ <span class="console-prompt">></span>
3257
+ <textarea
3258
+ class="console-input"
3259
+ placeholder="Type expression... (e.g., product.title | upcase)"
3260
+ .value=${this.inputValue}
3261
+ @input=${this._handleInput}
3262
+ @keydown=${this._handleInputKeydown}
3263
+ @blur=${()=>setTimeout(()=>this.showSuggestions=!1,200)}
3264
+ @focus=${()=>this._updateSuggestions()}
3265
+ rows="1"
3266
+ ></textarea>
3267
+ </div>
3268
+ </div>
3269
+ `}};__publicField(Sa,"properties",{logs:{type:Array,state:!0},liquidErrors:{type:Array,state:!0},filter:{type:String,state:!0},activeFilter:{type:String,state:!0},showThemeOnly:{type:Boolean,state:!0},expandedLogs:{type:Set,state:!0},groupedErrors:{type:Map,state:!0},networkErrors:{type:Array,state:!0},groupStack:{type:Array,state:!0},inputValue:{type:String,state:!0},inputHistory:{type:Array,state:!0},historyIndex:{type:Number,state:!0},suggestions:{type:Array,state:!0},selectedSuggestion:{type:Number,state:!0},showSuggestions:{type:Boolean,state:!0},showFilterDropdown:{type:Boolean,state:!0},context:{type:Object}}),__publicField(Sa,"STORAGE_KEY","tdt-console-logs"),__publicField(Sa,"styles",[pt,n`
3191
3270
  :host {
3192
3271
  display: block;
3193
3272
  padding: 12px;
3194
3273
  height: 100%;
3195
- overflow: auto;
3274
+ overflow: hidden;
3196
3275
  }
3197
3276
 
3198
3277
  .toolbar {
3199
3278
  display: flex;
3279
+ align-items: center;
3200
3280
  gap: 8px;
3201
- margin-bottom: 12px;
3202
- flex-wrap: wrap;
3281
+ position: sticky;
3282
+ top: 0;
3283
+ background: var(--tdt-bg);
3284
+ z-index: 10;
3285
+ margin: 0;
3286
+ padding: 0 0 12px 0;
3203
3287
  }
3204
3288
 
3205
3289
  .search {
3206
3290
  flex: 1;
3207
- min-width: 150px;
3291
+ min-width: 120px;
3208
3292
  }
3209
3293
 
3210
- .filter-tabs {
3211
- display: flex;
3212
- flex-wrap: wrap;
3213
- gap: 6px;
3214
- margin-bottom: 12px;
3294
+ /* Filter Dropdown */
3295
+ .filter-dropdown {
3296
+ position: relative;
3215
3297
  }
3216
3298
 
3217
- .filter-tab {
3299
+ .filter-dropdown-trigger {
3300
+ display: flex;
3301
+ align-items: center;
3302
+ gap: 6px;
3218
3303
  background: var(--tdt-bg-secondary);
3219
3304
  border: 1px solid var(--tdt-border);
3220
3305
  border-radius: var(--tdt-radius);
3221
3306
  padding: 4px 10px;
3222
- color: var(--tdt-text-muted);
3307
+ color: var(--tdt-text);
3223
3308
  font-family: var(--tdt-font);
3224
3309
  font-size: calc(11px * var(--tdt-scale, 1));
3225
3310
  cursor: pointer;
3226
3311
  transition: all 0.15s ease;
3312
+ min-width: 150px;
3313
+ }
3314
+
3315
+ .filter-dropdown-trigger:hover {
3316
+ background: var(--tdt-bg-hover);
3317
+ }
3318
+
3319
+ .filter-dropdown-trigger--active {
3320
+ border-color: var(--tdt-accent);
3321
+ }
3322
+
3323
+ .filter-dropdown-trigger__icon {
3324
+ margin-left: auto;
3325
+ font-size: calc(10px * var(--tdt-scale, 1));
3326
+ transition: transform 0.15s ease;
3327
+ }
3328
+
3329
+ .filter-dropdown-trigger__icon--open {
3330
+ transform: rotate(180deg);
3331
+ }
3332
+
3333
+ .filter-dropdown-trigger__count {
3334
+ font-size: calc(10px * var(--tdt-scale, 1));
3335
+ background: var(--tdt-accent);
3336
+ color: white;
3337
+ padding: 1px 6px;
3338
+ border-radius: 8px;
3339
+ font-weight: 600;
3340
+ }
3341
+
3342
+ .filter-dropdown-menu {
3343
+ position: absolute;
3344
+ top: 100%;
3345
+ left: 0;
3346
+ margin-top: 4px;
3347
+ min-width: 180px;
3348
+ background: var(--tdt-bg);
3349
+ border: 1px solid var(--tdt-border);
3350
+ border-radius: var(--tdt-radius);
3351
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
3352
+ z-index: 100;
3353
+ overflow: hidden;
3354
+ }
3355
+
3356
+ .filter-dropdown-item {
3227
3357
  display: flex;
3228
3358
  align-items: center;
3229
- gap: 6px;
3359
+ gap: 8px;
3360
+ padding: 8px 12px;
3361
+ cursor: pointer;
3362
+ font-size: calc(11px * var(--tdt-scale, 1));
3363
+ color: var(--tdt-text);
3364
+ border: none;
3365
+ background: none;
3366
+ width: 100%;
3367
+ text-align: left;
3368
+ transition: background 0.1s ease;
3230
3369
  }
3231
3370
 
3232
- .filter-tab:hover {
3371
+ .filter-dropdown-item:hover {
3233
3372
  background: var(--tdt-bg-hover);
3234
- color: var(--tdt-text);
3235
3373
  }
3236
3374
 
3237
- .filter-tab--active {
3375
+ .filter-dropdown-item--active {
3238
3376
  background: var(--tdt-accent);
3239
- border-color: var(--tdt-accent);
3240
3377
  color: white;
3241
3378
  }
3242
3379
 
3243
- .filter-tab--error {
3244
- border-color: var(--tdt-error);
3380
+ .filter-dropdown-item--active:hover {
3381
+ background: var(--tdt-accent);
3382
+ }
3383
+
3384
+ .filter-dropdown-item__icon {
3385
+ width: 16px;
3386
+ text-align: center;
3387
+ flex-shrink: 0;
3388
+ }
3389
+
3390
+ .filter-dropdown-item__label {
3391
+ flex: 1;
3392
+ }
3393
+
3394
+ .filter-dropdown-item__count {
3395
+ font-size: calc(10px * var(--tdt-scale, 1));
3396
+ opacity: 0.7;
3397
+ background: rgba(255, 255, 255, 0.15);
3398
+ padding: 1px 6px;
3399
+ border-radius: 8px;
3400
+ }
3401
+
3402
+ .filter-dropdown-item--active .filter-dropdown-item__count {
3403
+ background: rgba(255, 255, 255, 0.25);
3404
+ opacity: 1;
3245
3405
  }
3246
3406
 
3247
- .filter-tab--error.filter-tab--active {
3407
+ .filter-dropdown-item--error {
3408
+ color: var(--tdt-error);
3409
+ }
3410
+
3411
+ .filter-dropdown-item--error.filter-dropdown-item--active {
3248
3412
  background: var(--tdt-error);
3413
+ color: white;
3249
3414
  }
3250
3415
 
3251
- .filter-tab--warn {
3252
- border-color: var(--tdt-warning);
3416
+ .filter-dropdown-item--warn {
3417
+ color: var(--tdt-warning);
3253
3418
  }
3254
3419
 
3255
- .filter-tab--warn.filter-tab--active {
3420
+ .filter-dropdown-item--warn.filter-dropdown-item--active {
3256
3421
  background: var(--tdt-warning);
3257
3422
  color: var(--tdt-bg);
3258
3423
  }
3259
3424
 
3260
- .filter-tab__count {
3261
- font-size: calc(10px * var(--tdt-scale, 1));
3262
- opacity: 0.8;
3263
- background: color-mix(in srgb, var(--tdt-text) 15%, transparent);
3264
- padding: 1px 5px;
3265
- border-radius: 8px;
3266
- }
3267
-
3268
3425
  .toggle-btn {
3269
3426
  background: var(--tdt-bg-secondary);
3270
3427
  border: 1px solid var(--tdt-border);
@@ -3395,8 +3552,6 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3395
3552
  flex: 1;
3396
3553
  font-family: var(--tdt-font-mono);
3397
3554
  color: var(--tdt-text);
3398
- word-break: break-word;
3399
- white-space: pre-wrap;
3400
3555
  }
3401
3556
 
3402
3557
  .log-count {
@@ -3690,37 +3845,230 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3690
3845
  border-radius: 2px;
3691
3846
  color: var(--tdt-success);
3692
3847
  }
3693
- `]),__publicField(Ot,"THEME_KEYWORDS",["shopify","theme","liquid","cart","product","collection","variant","checkout","customer","section","block","snippet","asset","cdn.shopify","myshopify","storefront"]),__publicField(Ot,"LIQUID_DEPRECATIONS",[{pattern:/\{\%\s*include\s+/i,tag:"{% include %}",message:"The include tag is deprecated",replacement:"{% render %}"},{pattern:/\|\s*date_to_xmlschema/i,tag:"| date_to_xmlschema",message:"date_to_xmlschema is deprecated",replacement:'| date: "%Y-%m-%dT%H:%M:%S%z"'},{pattern:/\|\s*json_string/i,tag:"| json_string",message:"json_string is deprecated",replacement:"| json"},{pattern:/\.all\.size/i,tag:".all.size",message:"Using .all.size is deprecated",replacement:"Use .size directly or specific count properties"},{pattern:/product\.collections\[0\]/i,tag:"product.collections[0]",message:"Accessing collections by index is unreliable",replacement:"Use collection object directly"}]);let Pt=Ot;customElements.define("tdt-console-panel",Pt);const zt=class t extends nt{constructor(){super(),this.meta={},this.translations=[],this.missingTranslations=[],this.availableLocales=[],this.availableCountries=[],this.filter="",this.activeTab="overview",this._selectedLocale=null,this._selectedCountry=null}connectedCallback(){super.connectedCallback(),this._scanTranslations(),this._loadAvailableLocales()}updated(t){var e,a,i,s;t.has("meta")&&this.meta&&(this._selectedLocale=null==(a=null==(e=this.meta.request)?void 0:e.locale)?void 0:a.iso_code,this._selectedCountry=null==(s=null==(i=this.meta.localization)?void 0:i.country)?void 0:s.iso_code)}_loadAvailableLocales(){var t,e,a;const i=document.querySelector("[data-locale-selector]")||document.querySelector('form[action*="/localization"]');if(i){const t=i.querySelectorAll("option[value], [data-locale]");this.availableLocales=Array.from(t).map(t=>{var e;return{code:t.value||t.dataset.locale,name:(null==(e=t.textContent)?void 0:e.trim())||t.value}})}const s=document.querySelector("[data-country-selector]")||document.querySelector('select[name="country_code"]');if(s){const t=s.querySelectorAll("option[value]");this.availableCountries=Array.from(t).map(t=>{var e;return{code:t.value,name:(null==(e=t.textContent)?void 0:e.trim())||t.value}})}if(0===this.availableLocales.length){const i=null==(a=null==(e=null==(t=window.__THEME_DEVTOOLS_CONTEXT__)?void 0:t.objects)?void 0:e.shop)?void 0:a.enabled_locales;i&&(this.availableLocales=i.map(t=>({code:t,name:new Intl.DisplayNames(["en"],{type:"language"}).of(t)||t})))}}_scanTranslations(){var t;const e=[],a=[],i=document.body.innerHTML,s=new Set;[/\{\{\s*['"]([^'"]+)['"]\s*\|\s*t\s*\}\}/g,/\{\{\s*['"]([^'"]+)['"]\s*\|\s*t:\s*[^}]+\}\}/g,/data-translation-key=["']([^"']+)["']/g].forEach(t=>{let e;for(;null!==(e=t.exec(i));)s.has(e[1])||s.add(e[1])});const o=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,!1);for(;o.nextNode();){const e=o.currentNode.textContent.trim();if(e.startsWith("translation missing:")||e.includes("Translation missing")||e.match(/^[a-z_]+\.[a-z_]+(\.[a-z_]+)*$/i)){const i=e.match(/translation missing:\s*([^\s]+)/i)||e.match(/^([a-z_]+\.[a-z_]+(?:\.[a-z_]+)*)$/i);i&&a.push({key:i[1],context:(null==(t=o.currentNode.parentElement)?void 0:t.tagName)||"unknown",element:o.currentNode.parentElement})}}document.querySelectorAll("[data-t], [data-translate]").forEach(t=>{var i;const s=t.dataset.t||t.dataset.translate,o=null==(i=t.textContent)?void 0:i.trim();s&&(e.push({key:s,value:o||"(empty)",element:t.tagName,isMissing:!o||o.includes("translation missing")}),o&&!o.includes("translation missing")||a.push({key:s,context:t.tagName,element:t}))}),s.forEach(t=>{e.some(e=>e.key===t)||e.push({key:t,value:"(rendered)",element:"Liquid",isMissing:!1})}),this.translations=e,this.missingTranslations=a}_getFlag(e,a="country"){if("language"===a){const a=e.split("-")[0].toLowerCase();return t.LANGUAGE_FLAGS[a]||"🌐"}return t.COUNTRY_FLAGS[null==e?void 0:e.toUpperCase()]||"🏳️"}_setTab(t){this.activeTab=t}_filterTranslations(t){this.filter=t.target.value}_getFilteredTranslations(){const t="missing"===this.activeTab?this.missingTranslations:this.translations;if(!this.filter)return t;const e=this.filter.toLowerCase();return t.filter(t=>t.key.toLowerCase().includes(e)||t.value&&t.value.toLowerCase().includes(e))}_copyKey(t){const e=`{{ '${t}' | t }}`;navigator.clipboard.writeText(e)}_selectLocale(t){this._selectedLocale=t,this.requestUpdate()}_selectCountry(t){this._selectedCountry=t,this.requestUpdate()}_buildLocaleUrl(){var t,e,a,i,s;const o=new URL(window.location.href),r=o.pathname.split("/").filter(Boolean);null==(e=null==(t=this.meta.request)?void 0:t.locale)||e.iso_code;const n=this._selectedLocale;this._selectedCountry,(null==(a=r[0])?void 0:a.match(/^[a-z]{2}(-[a-z]{2})?$/i))&&r.shift();let l="";return n&&n!==(null==(s=null==(i=this.meta.request)?void 0:i.locale)?void 0:s.primary_locale)&&(l=`/${n}`),l+="/"+r.join("/"),o.pathname=l||"/",o.toString()}_goToLocale(){const t=this._buildLocaleUrl();window.location.href=t}_copyLocaleUrl(){const t=this._buildLocaleUrl();navigator.clipboard.writeText(t)}_renderMarketInfo(){var t,e,a,i,s,o,r,n,l,d,c,p,h,u;const{localization:v,request:g}=this.meta;return U`
3848
+
3849
+ /* Console Input Styles */
3850
+ .console-container {
3851
+ display: flex;
3852
+ flex-direction: column;
3853
+ height: 100%;
3854
+ }
3855
+
3856
+ .console-content {
3857
+ flex: 1;
3858
+ overflow: auto;
3859
+ padding-bottom: 8px;
3860
+ }
3861
+
3862
+ .console-input-container {
3863
+ position: relative;
3864
+ display: flex;
3865
+ align-items: flex-start;
3866
+ gap: 8px;
3867
+ padding: 8px 0;
3868
+ border-top: 1px solid var(--tdt-border);
3869
+ background: var(--tdt-bg);
3870
+ margin-top: auto;
3871
+ }
3872
+
3873
+ .console-prompt {
3874
+ color: var(--tdt-accent);
3875
+ font-family: var(--tdt-font-mono);
3876
+ font-size: calc(14px * var(--tdt-scale, 1));
3877
+ font-weight: 600;
3878
+ flex-shrink: 0;
3879
+ user-select: none;
3880
+ padding-top: 4px;
3881
+ }
3882
+
3883
+ .console-input {
3884
+ flex: 1;
3885
+ background: transparent;
3886
+ border: none;
3887
+ outline: none;
3888
+ color: var(--tdt-text);
3889
+ font-family: var(--tdt-font-mono);
3890
+ font-size: calc(12px * var(--tdt-scale, 1));
3891
+ padding: 4px 0;
3892
+ resize: none;
3893
+ min-height: 20px;
3894
+ max-height: 150px;
3895
+ overflow-y: auto;
3896
+ line-height: 1.4;
3897
+ }
3898
+
3899
+ .console-input::placeholder {
3900
+ color: var(--tdt-text-muted);
3901
+ opacity: 0.6;
3902
+ }
3903
+
3904
+ .console-input-hint {
3905
+ position: absolute;
3906
+ right: 0;
3907
+ bottom: 100%;
3908
+ font-size: calc(10px * var(--tdt-scale, 1));
3909
+ color: var(--tdt-text-muted);
3910
+ opacity: 0.6;
3911
+ padding: 2px 4px;
3912
+ }
3913
+
3914
+ .autocomplete-dropdown {
3915
+ position: absolute;
3916
+ bottom: 100%;
3917
+ left: 20px;
3918
+ right: 0;
3919
+ max-height: 200px;
3920
+ overflow-y: auto;
3921
+ background: var(--tdt-bg);
3922
+ border: 1px solid var(--tdt-border);
3923
+ border-radius: var(--tdt-radius);
3924
+ box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
3925
+ z-index: 100;
3926
+ margin-bottom: 4px;
3927
+ }
3928
+
3929
+ .autocomplete-item {
3930
+ display: flex;
3931
+ align-items: center;
3932
+ gap: 8px;
3933
+ padding: 8px 12px;
3934
+ cursor: pointer;
3935
+ font-family: var(--tdt-font-mono);
3936
+ font-size: calc(11px * var(--tdt-scale, 1));
3937
+ border-bottom: 1px solid var(--tdt-border);
3938
+ }
3939
+
3940
+ .autocomplete-item:last-child {
3941
+ border-bottom: none;
3942
+ }
3943
+
3944
+ .autocomplete-item:hover:not(.autocomplete-item--selected) {
3945
+ background: var(--tdt-bg-hover);
3946
+ }
3947
+
3948
+ .autocomplete-item--selected {
3949
+ background: var(--tdt-accent);
3950
+ }
3951
+
3952
+ .autocomplete-item--selected .autocomplete-path {
3953
+ color: white;
3954
+ font-weight: 500;
3955
+ }
3956
+
3957
+ .autocomplete-item--selected .autocomplete-type {
3958
+ background: rgba(0, 0, 0, 0.2);
3959
+ color: white;
3960
+ border-color: transparent;
3961
+ }
3962
+
3963
+ .autocomplete-item--selected .autocomplete-preview {
3964
+ color: rgba(255, 255, 255, 0.8);
3965
+ }
3966
+
3967
+ .autocomplete-path {
3968
+ flex: 1;
3969
+ color: var(--tdt-text);
3970
+ }
3971
+
3972
+ .autocomplete-type {
3973
+ font-size: calc(9px * var(--tdt-scale, 1));
3974
+ padding: 2px 6px;
3975
+ border-radius: 3px;
3976
+ background: var(--tdt-bg-hover);
3977
+ color: var(--tdt-text-muted);
3978
+ text-transform: uppercase;
3979
+ font-weight: 600;
3980
+ border: 1px solid var(--tdt-border);
3981
+ flex-shrink: 0;
3982
+ }
3983
+
3984
+ .autocomplete-type--filter {
3985
+ background: var(--tdt-accent);
3986
+ border-color: var(--tdt-accent);
3987
+ color: white;
3988
+ }
3989
+
3990
+ .autocomplete-preview {
3991
+ color: var(--tdt-text-muted);
3992
+ font-size: calc(10px * var(--tdt-scale, 1));
3993
+ max-width: 150px;
3994
+ overflow: hidden;
3995
+ text-overflow: ellipsis;
3996
+ white-space: nowrap;
3997
+ }
3998
+
3999
+ /* Eval log styles */
4000
+ .log-item--eval {
4001
+ border-left: 3px solid var(--tdt-accent);
4002
+ background: rgba(59, 130, 246, 0.05);
4003
+ }
4004
+
4005
+ .log-type--eval {
4006
+ background: var(--tdt-accent);
4007
+ color: white;
4008
+ }
4009
+
4010
+ .eval-expression {
4011
+ color: var(--tdt-text-muted);
4012
+ font-family: var(--tdt-font-mono);
4013
+ margin-bottom: 4px;
4014
+ }
4015
+
4016
+ .eval-result {
4017
+ color: var(--tdt-text);
4018
+ font-family: var(--tdt-font-mono);
4019
+ }
4020
+
4021
+ .eval-result--error {
4022
+ color: var(--tdt-error);
4023
+ }
4024
+
4025
+ .eval-result--undefined {
4026
+ color: var(--tdt-text-muted);
4027
+ font-style: italic;
4028
+ }
4029
+
4030
+ .eval-result--string {
4031
+ color: #22c55e;
4032
+ }
4033
+
4034
+ .eval-result--number {
4035
+ color: #3b82f6;
4036
+ }
4037
+
4038
+ .eval-result--boolean {
4039
+ color: #a855f7;
4040
+ }
4041
+
4042
+ .eval-result--null {
4043
+ color: var(--tdt-text-muted);
4044
+ }
4045
+ `]),__publicField(Sa,"THEME_KEYWORDS",["shopify","theme","liquid","cart","product","collection","variant","checkout","customer","section","block","snippet","asset","cdn.shopify","myshopify","storefront"]),__publicField(Sa,"LIQUID_DEPRECATIONS",[{pattern:/\{\%\s*include\s+/i,tag:"{% include %}",message:"The include tag is deprecated",replacement:"{% render %}"},{pattern:/\|\s*date_to_xmlschema/i,tag:"| date_to_xmlschema",message:"date_to_xmlschema is deprecated",replacement:'| date: "%Y-%m-%dT%H:%M:%S%z"'},{pattern:/\|\s*json_string/i,tag:"| json_string",message:"json_string is deprecated",replacement:"| json"},{pattern:/\.all\.size/i,tag:".all.size",message:"Using .all.size is deprecated",replacement:"Use .size directly or specific count properties"},{pattern:/product\.collections\[0\]/i,tag:"product.collections[0]",message:"Accessing collections by index is unreliable",replacement:"Use collection object directly"}]);let Ta=Sa;customElements.define("tdt-console-panel",Ta);const Ca=class t extends ot{constructor(){super(),this.meta={},this.translations=[],this.missingTranslations=[],this.availableLocales=[],this.availableCountries=[],this.filter="",this.activeTab="overview",this._selectedLocale=null,this._selectedCountry=null}connectedCallback(){super.connectedCallback(),this._scanTranslations(),this._loadAvailableLocales()}updated(t){var e,i,s,a;t.has("meta")&&this.meta&&(this._selectedLocale=null==(i=null==(e=this.meta.request)?void 0:e.locale)?void 0:i.iso_code,this._selectedCountry=null==(a=null==(s=this.meta.localization)?void 0:s.country)?void 0:a.iso_code)}_loadAvailableLocales(){var t,e,i;const s=document.querySelector("[data-locale-selector]")||document.querySelector('form[action*="/localization"]');if(s){const t=s.querySelectorAll("option[value], [data-locale]");this.availableLocales=Array.from(t).map(t=>{var e;return{code:t.value||t.dataset.locale,name:(null==(e=t.textContent)?void 0:e.trim())||t.value}})}const a=document.querySelector("[data-country-selector]")||document.querySelector('select[name="country_code"]');if(a){const t=a.querySelectorAll("option[value]");this.availableCountries=Array.from(t).map(t=>{var e;return{code:t.value,name:(null==(e=t.textContent)?void 0:e.trim())||t.value}})}if(0===this.availableLocales.length){const s=null==(i=null==(e=null==(t=window.__THEME_DEVTOOLS_CONTEXT__)?void 0:t.objects)?void 0:e.shop)?void 0:i.enabled_locales;s&&(this.availableLocales=s.map(t=>({code:t,name:new Intl.DisplayNames(["en"],{type:"language"}).of(t)||t})))}}_scanTranslations(){var t;const e=[],i=[],s=document.body.innerHTML,a=new Set;[/\{\{\s*['"]([^'"]+)['"]\s*\|\s*t\s*\}\}/g,/\{\{\s*['"]([^'"]+)['"]\s*\|\s*t:\s*[^}]+\}\}/g,/data-translation-key=["']([^"']+)["']/g].forEach(t=>{let e;for(;null!==(e=t.exec(s));)a.has(e[1])||a.add(e[1])});const r=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,!1);for(;r.nextNode();){const e=r.currentNode.textContent.trim();if(e.startsWith("translation missing:")||e.includes("Translation missing")||e.match(/^[a-z_]+\.[a-z_]+(\.[a-z_]+)*$/i)){const s=e.match(/translation missing:\s*([^\s]+)/i)||e.match(/^([a-z_]+\.[a-z_]+(?:\.[a-z_]+)*)$/i);s&&i.push({key:s[1],context:(null==(t=r.currentNode.parentElement)?void 0:t.tagName)||"unknown",element:r.currentNode.parentElement})}}document.querySelectorAll("[data-t], [data-translate]").forEach(t=>{var s;const a=t.dataset.t||t.dataset.translate,r=null==(s=t.textContent)?void 0:s.trim();a&&(e.push({key:a,value:r||"(empty)",element:t.tagName,isMissing:!r||r.includes("translation missing")}),r&&!r.includes("translation missing")||i.push({key:a,context:t.tagName,element:t}))}),a.forEach(t=>{e.some(e=>e.key===t)||e.push({key:t,value:"(rendered)",element:"Liquid",isMissing:!1})}),this.translations=e,this.missingTranslations=i}_getFlag(e,i="country"){if("language"===i){const i=e.split("-")[0].toLowerCase();return t.LANGUAGE_FLAGS[i]||"🌐"}return t.COUNTRY_FLAGS[null==e?void 0:e.toUpperCase()]||"🏳️"}_setTab(t){this.activeTab=t}_filterTranslations(t){this.filter=t.target.value}_getFilteredTranslations(){const t="missing"===this.activeTab?this.missingTranslations:this.translations;if(!this.filter)return t;const e=this.filter.toLowerCase();return t.filter(t=>t.key.toLowerCase().includes(e)||t.value&&t.value.toLowerCase().includes(e))}_copyKey(t){const e=`{{ '${t}' | t }}`;navigator.clipboard.writeText(e)}_selectLocale(t){this._selectedLocale=t,this.requestUpdate()}_selectCountry(t){this._selectedCountry=t,this.requestUpdate()}_buildLocaleUrl(){var t,e,i,s,a;const r=new URL(window.location.href),n=r.pathname.split("/").filter(Boolean);null==(e=null==(t=this.meta.request)?void 0:t.locale)||e.iso_code;const o=this._selectedLocale;this._selectedCountry,(null==(i=n[0])?void 0:i.match(/^[a-z]{2}(-[a-z]{2})?$/i))&&n.shift();let l="";return o&&o!==(null==(a=null==(s=this.meta.request)?void 0:s.locale)?void 0:a.primary_locale)&&(l=`/${o}`),l+="/"+n.join("/"),r.pathname=l||"/",r.toString()}_goToLocale(){const t=this._buildLocaleUrl();window.location.href=t}_copyLocaleUrl(){const t=this._buildLocaleUrl();navigator.clipboard.writeText(t)}_renderMarketInfo(){var t,e,i,s,a,r,n,o,l,c,d,p;const{localization:h,request:u}=this.meta;return U`
3694
4046
  <div class="market-info">
3695
4047
  <div class="info-card">
3696
- <div class="info-card__icon">${this._getFlag(null==(t=null==v?void 0:v.country)?void 0:t.iso_code)}</div>
3697
4048
  <div class="info-card__label">Country</div>
3698
- <div class="info-card__value">${(null==(e=null==v?void 0:v.country)?void 0:e.name)||"—"}</div>
3699
- <div class="info-card__subvalue">${(null==(a=null==v?void 0:v.country)?void 0:a.iso_code)||""}</div>
4049
+ <div class="info-card__value">${(null==(t=null==h?void 0:h.country)?void 0:t.name)||"—"}</div>
4050
+ <div class="info-card__subvalue">${(null==(e=null==h?void 0:h.country)?void 0:e.iso_code)||""}</div>
3700
4051
  </div>
3701
4052
 
3702
4053
  <div class="info-card">
3703
- <div class="info-card__icon">${this._getFlag(null==(i=null==g?void 0:g.locale)?void 0:i.iso_code,"language")}</div>
3704
4054
  <div class="info-card__label">Language</div>
3705
- <div class="info-card__value">${(null==(s=null==g?void 0:g.locale)?void 0:s.name)||(null==(o=null==v?void 0:v.language)?void 0:o.name)||"—"}</div>
3706
- <div class="info-card__subvalue">${(null==(r=null==g?void 0:g.locale)?void 0:r.iso_code)||""} ${(null==(n=null==g?void 0:g.locale)?void 0:n.primary)?"(Primary)":""}</div>
4055
+ <div class="info-card__value">${(null==(i=null==u?void 0:u.locale)?void 0:i.name)||(null==(s=null==h?void 0:h.language)?void 0:s.name)||"—"}</div>
4056
+ <div class="info-card__subvalue">${(null==(a=null==u?void 0:u.locale)?void 0:a.iso_code)||""} ${(null==(r=null==u?void 0:u.locale)?void 0:r.primary)?"(Primary)":""}</div>
3707
4057
  </div>
3708
4058
 
3709
4059
  <div class="info-card">
3710
- <div class="info-card__icon">💰</div>
3711
4060
  <div class="info-card__label">Currency</div>
3712
- <div class="info-card__value">${(null==(d=null==(l=null==v?void 0:v.country)?void 0:l.currency)?void 0:d.iso_code)||"—"}</div>
3713
- <div class="info-card__subvalue">${(null==(p=null==(c=null==v?void 0:v.country)?void 0:c.currency)?void 0:p.symbol)||""}</div>
4061
+ <div class="info-card__value">${(null==(o=null==(n=null==h?void 0:h.country)?void 0:n.currency)?void 0:o.iso_code)||"—"}</div>
4062
+ <div class="info-card__subvalue">${(null==(c=null==(l=null==h?void 0:h.country)?void 0:l.currency)?void 0:c.symbol)||""}</div>
3714
4063
  </div>
3715
4064
 
3716
4065
  <div class="info-card">
3717
- <div class="info-card__icon">🏪</div>
3718
4066
  <div class="info-card__label">Market</div>
3719
- <div class="info-card__value">${(null==(h=null==v?void 0:v.market)?void 0:h.handle)||"—"}</div>
3720
- <div class="info-card__subvalue">ID: ${(null==(u=null==v?void 0:v.market)?void 0:u.id)||"—"}</div>
4067
+ <div class="info-card__value">${(null==(d=null==h?void 0:h.market)?void 0:d.handle)||"—"}</div>
4068
+ <div class="info-card__subvalue">ID: ${(null==(p=null==h?void 0:h.market)?void 0:p.id)||"—"}</div>
3721
4069
  </div>
3722
4070
  </div>
3723
- `}_renderLocaleSwitcher(){var t,e,a,i;const s=null==(e=null==(t=this.meta.request)?void 0:t.locale)?void 0:e.iso_code;return null==(i=null==(a=this.meta.localization)?void 0:a.country)||i.iso_code,U`
4071
+ `}_renderLocaleSwitcher(){var t,e,i,s;const a=null==(e=null==(t=this.meta.request)?void 0:t.locale)?void 0:e.iso_code;return null==(s=null==(i=this.meta.localization)?void 0:i.country)||s.iso_code,U`
3724
4072
  <div class="section">
3725
4073
  <div class="section-title">Quick Locale Switch</div>
3726
4074
 
@@ -3750,7 +4098,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3750
4098
  </div>
3751
4099
  `}
3752
4100
 
3753
- ${this._selectedLocale&&this._selectedLocale!==s?U`
4101
+ ${this._selectedLocale&&this._selectedLocale!==a?U`
3754
4102
  <div class="url-helper">
3755
4103
  <div class="url-helper__label">Preview URL for ${this._selectedLocale.toUpperCase()}</div>
3756
4104
  <div class="url-helper__url">
@@ -3831,7 +4179,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3831
4179
  <div class="section-title">Translation Keys on Page</div>
3832
4180
  ${this._renderTranslations()}
3833
4181
  </div>
3834
- `}};__publicField(zt,"properties",{meta:{type:Object},translations:{type:Array,state:!0},missingTranslations:{type:Array,state:!0},availableLocales:{type:Array,state:!0},availableCountries:{type:Array,state:!0},filter:{type:String,state:!0},activeTab:{type:String,state:!0}}),__publicField(zt,"styles",[pt,r`
4182
+ `}};__publicField(Ca,"properties",{meta:{type:Object},translations:{type:Array,state:!0},missingTranslations:{type:Array,state:!0},availableLocales:{type:Array,state:!0},availableCountries:{type:Array,state:!0},filter:{type:String,state:!0},activeTab:{type:String,state:!0}}),__publicField(Ca,"styles",[pt,n`
3835
4183
  :host {
3836
4184
  display: block;
3837
4185
  padding: 12px;
@@ -4198,15 +4546,15 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4198
4546
  .stat-value--warning {
4199
4547
  color: var(--tdt-warning);
4200
4548
  }
4201
- `]),__publicField(zt,"COUNTRY_FLAGS",{US:"🇺🇸",CA:"🇨🇦",GB:"🇬🇧",AU:"🇦🇺",DE:"🇩🇪",FR:"🇫🇷",ES:"🇪🇸",IT:"🇮🇹",JP:"🇯🇵",CN:"🇨🇳",BR:"🇧🇷",MX:"🇲🇽",NL:"🇳🇱",SE:"🇸🇪",NO:"🇳🇴",DK:"🇩🇰",FI:"🇫🇮",PL:"🇵🇱",AT:"🇦🇹",CH:"🇨🇭",BE:"🇧🇪",IE:"🇮🇪",NZ:"🇳🇿",SG:"🇸🇬",HK:"🇭🇰",KR:"🇰🇷",IN:"🇮🇳",AE:"🇦🇪",SA:"🇸🇦",ZA:"🇿🇦",PT:"🇵🇹",CZ:"🇨🇿",RO:"🇷🇴",HU:"🇭🇺",IL:"🇮🇱"}),__publicField(zt,"LANGUAGE_FLAGS",{en:"🇬🇧",es:"🇪🇸",fr:"🇫🇷",de:"🇩🇪",it:"🇮🇹",pt:"🇵🇹",nl:"🇳🇱",pl:"🇵🇱",ja:"🇯🇵",zh:"🇨🇳",ko:"🇰🇷",ar:"🇸🇦",ru:"🇷🇺",sv:"🇸🇪",da:"🇩🇰",fi:"🇫🇮",no:"🇳🇴",cs:"🇨🇿",hu:"🇭🇺",ro:"🇷🇴"});let Lt=zt;customElements.define("tdt-localization-panel",Lt);const jt=class t extends nt{constructor(){super(),this.events=[],this.dataLayerSnapshots=[],this.filter="",this.activeFilter="all",this.expandedEvents=new Set,this.isPaused=!1,this._detectedProviders=new Set}connectedCallback(){super.connectedCallback(),this._loadPersistedEvents(),this._detectProviders(),this._interceptDataLayer(),this._interceptGtag(),this._interceptGaUniversal(),this._interceptFbPixel(),this._interceptTikTok(),this._interceptPinterest(),this._interceptSnapchat(),this._interceptKlaviyo(),this._interceptShopifyAnalytics(),this._interceptWebPixels(),this._interceptCustomEvents()}disconnectedCallback(){super.disconnectedCallback(),this._restoreInterceptors()}_loadPersistedEvents(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);if(e){const t=JSON.parse(e);this.events=t.map(t=>({...t,timestamp:new Date(t.timestamp),isLive:!1}))}}catch(e){console.warn("[TDT] Failed to load persisted events:",e)}}_persistEvents(){try{const e=this.events.slice(-500).map(t=>({...t,timestamp:t.timestamp.toISOString()}));sessionStorage.setItem(t.STORAGE_KEY,JSON.stringify(e))}catch(e){console.warn("[TDT] Failed to persist events:",e)}}_detectProviders(){var t;window.dataLayer&&this._detectedProviders.add("datalayer"),window.gtag&&this._detectedProviders.add("ga4"),window.ga&&this._detectedProviders.add("ga"),window.fbq&&this._detectedProviders.add("fbpixel"),window.ttq&&this._detectedProviders.add("tiktok"),window.pintrk&&this._detectedProviders.add("pinterest"),window.snaptr&&this._detectedProviders.add("snapchat"),window._learnq&&this._detectedProviders.add("klaviyo"),(null==(t=window.Shopify)?void 0:t.analytics)&&this._detectedProviders.add("shopify")}_interceptDataLayer(){window.dataLayer||(window.dataLayer=[]);const t=window.dataLayer.push.bind(window.dataLayer),e=this;window.dataLayer.push=function(...a){return a.forEach(t=>{!e.isPaused&&t&&"object"==typeof t&&e._addEvent("datalayer",t.event||"push",t)}),t(...a)},this._originalDataLayerPush=t,window.dataLayer.forEach(t=>{t&&"object"==typeof t&&this._addEvent("datalayer",t.event||"push",t,!1)})}_interceptGtag(){if(!window.gtag)return;const t=window.gtag,e=this;window.gtag=function(a,...i){if(!e.isPaused)if("event"===a){const[t,a]=i;e._addEvent("ga4",t,a||{}),e._detectedProviders.add("ga4")}else"config"===a&&e._addEvent("ga4","config",{measurementId:i[0],...i[1]});return t.call(this,a,...i)},this._originalGtag=t}_interceptGaUniversal(){if(!window.ga)return;const t=window.ga,e=this;window.ga=function(a,...i){if(!e.isPaused)if("send"===a){const[t,...a]=i;if("event"===t){const[t,i,s,o]=a;e._addEvent("ga",i||"event",{category:t,action:i,label:s,value:o})}else"pageview"===t&&e._addEvent("ga","pageview",{page:a[0]});e._detectedProviders.add("ga")}else"function"==typeof a||"create"===a&&e._addEvent("ga","create",{trackingId:i[0],...i[1]});return t.call(this,a,...i)},this._originalGa=t}_interceptFbPixel(){if(!window.fbq)return;const t=window.fbq,e=this;window.fbq=function(a,...i){if(!e.isPaused)if("track"===a||"trackCustom"===a){const[t,a]=i;e._addEvent("fbpixel",t,a||{}),e._detectedProviders.add("fbpixel")}else"init"===a&&e._addEvent("fbpixel","init",{pixelId:i[0]});return t.call(this,a,...i)},this._originalFbq=t}_interceptTikTok(){if(!window.ttq)return;const t=window.ttq,e=this;if(t.track){const a=t.track.bind(t);t.track=function(t,i){return e.isPaused||(e._addEvent("tiktok",t,i||{}),e._detectedProviders.add("tiktok")),a(t,i)},this._originalTtqTrack=a}if(t.page){const a=t.page.bind(t);t.page=function(){return e.isPaused||(e._addEvent("tiktok","PageView",{}),e._detectedProviders.add("tiktok")),a()},this._originalTtqPage=a}}_interceptPinterest(){if(!window.pintrk)return;const t=window.pintrk,e=this;window.pintrk=function(a,...i){if(!e.isPaused)if("track"===a){const[t,a]=i;e._addEvent("pinterest",t,a||{}),e._detectedProviders.add("pinterest")}else"load"===a&&e._addEvent("pinterest","load",{tagId:i[0]});return t.call(this,a,...i)},this._originalPintrk=t}_interceptSnapchat(){if(!window.snaptr)return;const t=window.snaptr,e=this;window.snaptr=function(a,...i){if(!e.isPaused)if("track"===a){const[t,a]=i;e._addEvent("snapchat",t,a||{}),e._detectedProviders.add("snapchat")}else"init"===a&&e._addEvent("snapchat","init",{pixelId:i[0]});return t.call(this,a,...i)},this._originalSnaptr=t}_interceptKlaviyo(){if(!window._learnq)return;const t=window._learnq,e=this;if(Array.isArray(t)){const a=t.push.bind(t);t.push=function(t){if(!e.isPaused&&Array.isArray(t)){const[a,...i]=t;if("track"===a){const[t,a]=i;e._addEvent("klaviyo",t,a||{}),e._detectedProviders.add("klaviyo")}else"identify"===a&&e._addEvent("klaviyo","identify",i[0]||{})}return a(t)},this._originalLearnqPush=a}}_interceptShopifyAnalytics(){var t;if(!(null==(t=window.Shopify)?void 0:t.analytics))return;const e=window.Shopify.analytics,a=this;if(e.publish){const t=e.publish.bind(e);e.publish=function(e,i){return a.isPaused||(a._addEvent("shopify",e,i||{}),a._detectedProviders.add("shopify")),t(e,i)},this._originalShopifyPublish=t}}_interceptWebPixels(){var t,e;if(!(null==(e=null==(t=window.Shopify)?void 0:t.analytics)?void 0:e.subscribe))return;const a=window.Shopify.analytics,i=this,s=a.subscribe.bind(a);a.subscribe=function(t,e){return s(t,a=>(i.isPaused||(i._addEvent("webpixel",t,a||{}),i._detectedProviders.add("webpixel")),e(a)))},this._originalWebPixelSubscribe=s}_interceptCustomEvents(){const t=this;this._customEventHandler=e=>{!t.isPaused&&e.detail&&t._addEvent("custom",e.type,e.detail)},["analytics","tracking","gtm","conversion"].forEach(t=>{document.addEventListener(t,this._customEventHandler)})}_restoreInterceptors(){this._originalDataLayerPush&&window.dataLayer&&(window.dataLayer.push=this._originalDataLayerPush),this._originalGtag&&(window.gtag=this._originalGtag),this._originalFbq&&(window.fbq=this._originalFbq),["analytics","tracking","gtm","conversion"].forEach(t=>{document.removeEventListener(t,this._customEventHandler)})}_getEventKey(t,e,a){return`${t}:${e}:${JSON.stringify(a,Object.keys(a||{}).sort())}`}_addEvent(e,a,i,s=!0){const o=t.CONVERSION_EVENTS.some(t=>a.toLowerCase().includes(t.toLowerCase())),r=this._getEventKey(e,a,i),n=this.events.find(t=>Date.now()-t.timestamp.getTime()<500&&this._getEventKey(t.provider,t.eventName,t.data)===r);if(n)return n.count=(n.count||1)+1,this.events=[...this.events],void this._persistEvents();const l={id:Date.now()+Math.random(),provider:e,eventName:a,data:i,timestamp:new Date,isConversion:o,isLive:s,count:1};this.events=s?[...this.events,l]:[l,...this.events],s&&this._persistEvents()}_togglePause(){this.isPaused=!this.isPaused}_clearEvents(){this.events=[],sessionStorage.removeItem(t.STORAGE_KEY)}_exportEvents(){const t=this._getFilteredEvents().map(t=>({provider:t.provider,eventName:t.eventName,data:t.data,timestamp:t.timestamp.toISOString(),isConversion:t.isConversion,count:t.count||1})),e=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),a=URL.createObjectURL(e),i=document.createElement("a");i.href=a,i.download=`analytics-events-${(new Date).toISOString().slice(0,10)}.json`,i.click(),URL.revokeObjectURL(a)}async _copyEvent(t,e){e.stopPropagation();const a={provider:t.provider,eventName:t.eventName,data:t.data,timestamp:t.timestamp.toISOString(),isConversion:t.isConversion};try{await navigator.clipboard.writeText(JSON.stringify(a,null,2));const t=e.target;t.classList.add("btn-copy--copied"),t.textContent="Copied!",setTimeout(()=>{t.classList.remove("btn-copy--copied"),t.textContent="Copy"},1500)}catch(i){console.error("[TDT] Failed to copy event:",i)}}_filterEvents(t){this.filter=t.target.value}_setFilter(t){this.activeFilter=t}_toggleExpand(t){const e=new Set(this.expandedEvents);e.has(t)?e.delete(t):e.add(t),this.expandedEvents=e}_getFilteredEvents(){let t=this.events;if("all"!==this.activeFilter&&(t="conversion"===this.activeFilter?t.filter(t=>t.isConversion):t.filter(t=>t.provider===this.activeFilter)),this.filter){const e=this.filter.toLowerCase();t=t.filter(t=>t.eventName.toLowerCase().includes(e)||JSON.stringify(t.data).toLowerCase().includes(e))}return t}_getCounts(){const e={all:this.events.length,conversion:this.events.filter(t=>t.isConversion).length},a=Object.keys(t.PROVIDERS);for(const t of a)e[t]=this.events.filter(e=>e.provider===t).length;return e}_formatTime(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}_getEventSummary(t){var e,a;const{data:i}=t,s=[];return i.currency&&s.push({label:"Currency",value:i.currency}),void 0!==i.value&&s.push({label:"Value",value:i.value}),i.transaction_id&&s.push({label:"Order",value:i.transaction_id}),(null==(e=i.items)?void 0:e.length)&&s.push({label:"Items",value:i.items.length}),i.item_id&&s.push({label:"Item ID",value:i.item_id}),i.item_name&&s.push({label:"Item",value:i.item_name}),i.content_name&&s.push({label:"Content",value:i.content_name}),(null==(a=i.content_ids)?void 0:a.length)&&s.push({label:"IDs",value:i.content_ids.length}),s}_renderProviderBadges(){const e=["ga4","ga","fbpixel","tiktok","pinterest","snapchat","klaviyo","shopify","webpixel","datalayer"].filter(t=>this._detectedProviders.has(t));return 0===e.length?U`<span style="color: var(--tdt-text-muted); font-size: calc(10px * var(--tdt-scale, 1));">None detected</span>`:U`
4549
+ `]),__publicField(Ca,"COUNTRY_FLAGS",{US:"🇺🇸",CA:"🇨🇦",GB:"🇬🇧",AU:"🇦🇺",DE:"🇩🇪",FR:"🇫🇷",ES:"🇪🇸",IT:"🇮🇹",JP:"🇯🇵",CN:"🇨🇳",BR:"🇧🇷",MX:"🇲🇽",NL:"🇳🇱",SE:"🇸🇪",NO:"🇳🇴",DK:"🇩🇰",FI:"🇫🇮",PL:"🇵🇱",AT:"🇦🇹",CH:"🇨🇭",BE:"🇧🇪",IE:"🇮🇪",NZ:"🇳🇿",SG:"🇸🇬",HK:"🇭🇰",KR:"🇰🇷",IN:"🇮🇳",AE:"🇦🇪",SA:"🇸🇦",ZA:"🇿🇦",PT:"🇵🇹",CZ:"🇨🇿",RO:"🇷🇴",HU:"🇭🇺",IL:"🇮🇱"}),__publicField(Ca,"LANGUAGE_FLAGS",{en:"🇬🇧",es:"🇪🇸",fr:"🇫🇷",de:"🇩🇪",it:"🇮🇹",pt:"🇵🇹",nl:"🇳🇱",pl:"🇵🇱",ja:"🇯🇵",zh:"🇨🇳",ko:"🇰🇷",ar:"🇸🇦",ru:"🇷🇺",sv:"🇸🇪",da:"🇩🇰",fi:"🇫🇮",no:"🇳🇴",cs:"🇨🇿",hu:"🇭🇺",ro:"🇷🇴"});let Ea=Ca;customElements.define("tdt-localization-panel",Ea);const Aa=class t extends ot{constructor(){super(),this.events=[],this.dataLayerSnapshots=[],this.filter="",this.activeFilter="all",this.expandedEvents=new Set,this.isPaused=!1,this._detectedProviders=new Set}connectedCallback(){super.connectedCallback(),this._loadPersistedEvents(),this._detectProviders(),this._interceptDataLayer(),this._interceptGtag(),this._interceptGaUniversal(),this._interceptFbPixel(),this._interceptTikTok(),this._interceptPinterest(),this._interceptSnapchat(),this._interceptKlaviyo(),this._interceptShopifyAnalytics(),this._interceptWebPixels(),this._interceptCustomEvents()}disconnectedCallback(){super.disconnectedCallback(),this._restoreInterceptors()}_loadPersistedEvents(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);if(e){const t=JSON.parse(e);this.events=t.map(t=>({...t,timestamp:new Date(t.timestamp),isLive:!1}))}}catch(e){console.warn("[TDT] Failed to load persisted events:",e)}}_persistEvents(){try{const e=this.events.slice(-500).map(t=>({...t,timestamp:t.timestamp.toISOString()}));sessionStorage.setItem(t.STORAGE_KEY,JSON.stringify(e))}catch(e){console.warn("[TDT] Failed to persist events:",e)}}_detectProviders(){var t;window.dataLayer&&this._detectedProviders.add("datalayer"),window.gtag&&this._detectedProviders.add("ga4"),window.ga&&this._detectedProviders.add("ga"),window.fbq&&this._detectedProviders.add("fbpixel"),window.ttq&&this._detectedProviders.add("tiktok"),window.pintrk&&this._detectedProviders.add("pinterest"),window.snaptr&&this._detectedProviders.add("snapchat"),window._learnq&&this._detectedProviders.add("klaviyo"),(null==(t=window.Shopify)?void 0:t.analytics)&&this._detectedProviders.add("shopify")}_interceptDataLayer(){window.dataLayer||(window.dataLayer=[]);const t=window.dataLayer.push.bind(window.dataLayer),e=this;window.dataLayer.push=function(...i){return i.forEach(t=>{!e.isPaused&&t&&"object"==typeof t&&e._addEvent("datalayer",t.event||"push",t)}),t(...i)},this._originalDataLayerPush=t,window.dataLayer.forEach(t=>{t&&"object"==typeof t&&this._addEvent("datalayer",t.event||"push",t,!1)})}_interceptGtag(){if(!window.gtag)return;const t=window.gtag,e=this;window.gtag=function(i,...s){if(!e.isPaused)if("event"===i){const[t,i]=s;e._addEvent("ga4",t,i||{}),e._detectedProviders.add("ga4")}else"config"===i&&e._addEvent("ga4","config",{measurementId:s[0],...s[1]});return t.call(this,i,...s)},this._originalGtag=t}_interceptGaUniversal(){if(!window.ga)return;const t=window.ga,e=this;window.ga=function(i,...s){if(!e.isPaused)if("send"===i){const[t,...i]=s;if("event"===t){const[t,s,a,r]=i;e._addEvent("ga",s||"event",{category:t,action:s,label:a,value:r})}else"pageview"===t&&e._addEvent("ga","pageview",{page:i[0]});e._detectedProviders.add("ga")}else"function"==typeof i||"create"===i&&e._addEvent("ga","create",{trackingId:s[0],...s[1]});return t.call(this,i,...s)},this._originalGa=t}_interceptFbPixel(){if(!window.fbq)return;const t=window.fbq,e=this;window.fbq=function(i,...s){if(!e.isPaused)if("track"===i||"trackCustom"===i){const[t,i]=s;e._addEvent("fbpixel",t,i||{}),e._detectedProviders.add("fbpixel")}else"init"===i&&e._addEvent("fbpixel","init",{pixelId:s[0]});return t.call(this,i,...s)},this._originalFbq=t}_interceptTikTok(){if(!window.ttq)return;const t=window.ttq,e=this;if(t.track){const i=t.track.bind(t);t.track=function(t,s){return e.isPaused||(e._addEvent("tiktok",t,s||{}),e._detectedProviders.add("tiktok")),i(t,s)},this._originalTtqTrack=i}if(t.page){const i=t.page.bind(t);t.page=function(){return e.isPaused||(e._addEvent("tiktok","PageView",{}),e._detectedProviders.add("tiktok")),i()},this._originalTtqPage=i}}_interceptPinterest(){if(!window.pintrk)return;const t=window.pintrk,e=this;window.pintrk=function(i,...s){if(!e.isPaused)if("track"===i){const[t,i]=s;e._addEvent("pinterest",t,i||{}),e._detectedProviders.add("pinterest")}else"load"===i&&e._addEvent("pinterest","load",{tagId:s[0]});return t.call(this,i,...s)},this._originalPintrk=t}_interceptSnapchat(){if(!window.snaptr)return;const t=window.snaptr,e=this;window.snaptr=function(i,...s){if(!e.isPaused)if("track"===i){const[t,i]=s;e._addEvent("snapchat",t,i||{}),e._detectedProviders.add("snapchat")}else"init"===i&&e._addEvent("snapchat","init",{pixelId:s[0]});return t.call(this,i,...s)},this._originalSnaptr=t}_interceptKlaviyo(){if(!window._learnq)return;const t=window._learnq,e=this;if(Array.isArray(t)){const i=t.push.bind(t);t.push=function(t){if(!e.isPaused&&Array.isArray(t)){const[i,...s]=t;if("track"===i){const[t,i]=s;e._addEvent("klaviyo",t,i||{}),e._detectedProviders.add("klaviyo")}else"identify"===i&&e._addEvent("klaviyo","identify",s[0]||{})}return i(t)},this._originalLearnqPush=i}}_interceptShopifyAnalytics(){var t;if(!(null==(t=window.Shopify)?void 0:t.analytics))return;const e=window.Shopify.analytics,i=this;if(e.publish){const t=e.publish.bind(e);e.publish=function(e,s){return i.isPaused||(i._addEvent("shopify",e,s||{}),i._detectedProviders.add("shopify")),t(e,s)},this._originalShopifyPublish=t}}_interceptWebPixels(){var t,e;if(!(null==(e=null==(t=window.Shopify)?void 0:t.analytics)?void 0:e.subscribe))return;const i=window.Shopify.analytics,s=this,a=i.subscribe.bind(i);i.subscribe=function(t,e){return a(t,i=>(s.isPaused||(s._addEvent("webpixel",t,i||{}),s._detectedProviders.add("webpixel")),e(i)))},this._originalWebPixelSubscribe=a}_interceptCustomEvents(){const t=this;this._customEventHandler=e=>{!t.isPaused&&e.detail&&t._addEvent("custom",e.type,e.detail)},["analytics","tracking","gtm","conversion"].forEach(t=>{document.addEventListener(t,this._customEventHandler)})}_restoreInterceptors(){this._originalDataLayerPush&&window.dataLayer&&(window.dataLayer.push=this._originalDataLayerPush),this._originalGtag&&(window.gtag=this._originalGtag),this._originalFbq&&(window.fbq=this._originalFbq),["analytics","tracking","gtm","conversion"].forEach(t=>{document.removeEventListener(t,this._customEventHandler)})}_getEventKey(t,e,i){return`${t}:${e}:${JSON.stringify(i,Object.keys(i||{}).sort())}`}_addEvent(e,i,s,a=!0){const r=t.CONVERSION_EVENTS.some(t=>i.toLowerCase().includes(t.toLowerCase())),n=this._getEventKey(e,i,s),o=this.events.find(t=>Date.now()-t.timestamp.getTime()<500&&this._getEventKey(t.provider,t.eventName,t.data)===n);if(o)return o.count=(o.count||1)+1,this.events=[...this.events],void this._persistEvents();const l={id:Date.now()+Math.random(),provider:e,eventName:i,data:s,timestamp:new Date,isConversion:r,isLive:a,count:1};this.events=a?[...this.events,l]:[l,...this.events],a&&this._persistEvents()}_togglePause(){this.isPaused=!this.isPaused}_clearEvents(){this.events=[],sessionStorage.removeItem(t.STORAGE_KEY)}_exportEvents(){const t=this._getFilteredEvents().map(t=>({provider:t.provider,eventName:t.eventName,data:t.data,timestamp:t.timestamp.toISOString(),isConversion:t.isConversion,count:t.count||1})),e=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),i=URL.createObjectURL(e),s=document.createElement("a");s.href=i,s.download=`analytics-events-${(new Date).toISOString().slice(0,10)}.json`,s.click(),URL.revokeObjectURL(i)}async _copyEvent(t,e){e.stopPropagation();const i={provider:t.provider,eventName:t.eventName,data:t.data,timestamp:t.timestamp.toISOString(),isConversion:t.isConversion};try{await navigator.clipboard.writeText(JSON.stringify(i,null,2));const t=e.target;t.classList.add("btn-copy--copied"),t.textContent="Copied!",setTimeout(()=>{t.classList.remove("btn-copy--copied"),t.textContent="Copy"},1500)}catch(s){console.error("[TDT] Failed to copy event:",s)}}_filterEvents(t){this.filter=t.target.value}_setFilter(t){this.activeFilter=t}_toggleExpand(t){const e=new Set(this.expandedEvents);e.has(t)?e.delete(t):e.add(t),this.expandedEvents=e}_getFilteredEvents(){let t=this.events;if("all"!==this.activeFilter&&(t="conversion"===this.activeFilter?t.filter(t=>t.isConversion):t.filter(t=>t.provider===this.activeFilter)),this.filter){const e=this.filter.toLowerCase();t=t.filter(t=>t.eventName.toLowerCase().includes(e)||JSON.stringify(t.data).toLowerCase().includes(e))}return t}_getCounts(){const e={all:this.events.length,conversion:this.events.filter(t=>t.isConversion).length},i=Object.keys(t.PROVIDERS);for(const t of i)e[t]=this.events.filter(e=>e.provider===t).length;return e}_formatTime(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}_getEventSummary(t){var e,i;const{data:s}=t,a=[];return s.currency&&a.push({label:"Currency",value:s.currency}),void 0!==s.value&&a.push({label:"Value",value:s.value}),s.transaction_id&&a.push({label:"Order",value:s.transaction_id}),(null==(e=s.items)?void 0:e.length)&&a.push({label:"Items",value:s.items.length}),s.item_id&&a.push({label:"Item ID",value:s.item_id}),s.item_name&&a.push({label:"Item",value:s.item_name}),s.content_name&&a.push({label:"Content",value:s.content_name}),(null==(i=s.content_ids)?void 0:i.length)&&a.push({label:"IDs",value:s.content_ids.length}),a}_renderProviderBadges(){const e=["ga4","ga","fbpixel","tiktok","pinterest","snapchat","klaviyo","shopify","webpixel","datalayer"].filter(t=>this._detectedProviders.has(t));return 0===e.length?U`<span style="color: var(--tdt-text-muted); font-size: calc(10px * var(--tdt-scale, 1));">None detected</span>`:U`
4202
4550
  <div class="detected-providers">
4203
- ${e.map(e=>{const a=t.PROVIDERS[e];return U`
4551
+ ${e.map(e=>{const i=t.PROVIDERS[e];return U`
4204
4552
  <span class="provider-badge provider-badge--active">
4205
- ${a.icon} ${a.name}
4553
+ ${i.name}
4206
4554
  </span>
4207
4555
  `})}
4208
4556
  </div>
4209
- `}render(){const e=this._getFilteredEvents(),a=this._getCounts();return U`
4557
+ `}render(){const e=this._getFilteredEvents(),i=this._getCounts();return U`
4210
4558
  <div class="stats">
4211
4559
  <div class="stat">
4212
4560
  <span class="stat-label">Events</span>
@@ -4214,7 +4562,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4214
4562
  </div>
4215
4563
  <div class="stat">
4216
4564
  <span class="stat-label">Conversions</span>
4217
- <span class="stat-value stat-value--success">${a.conversion}</span>
4565
+ <span class="stat-value stat-value--success">${i.conversion}</span>
4218
4566
  </div>
4219
4567
  <div class="stat">
4220
4568
  <span class="stat-label">Detected</span>
@@ -4249,20 +4597,20 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4249
4597
  class="filter-tab ${"all"===this.activeFilter?"filter-tab--active":""}"
4250
4598
  @click=${()=>this._setFilter("all")}
4251
4599
  >
4252
- All <span class="filter-tab__count">${a.all}</span>
4600
+ All <span class="filter-tab__count">${i.all}</span>
4253
4601
  </button>
4254
4602
  <button
4255
4603
  class="filter-tab filter-tab--conversion ${"conversion"===this.activeFilter?"filter-tab--active":""}"
4256
4604
  @click=${()=>this._setFilter("conversion")}
4257
4605
  >
4258
- 💰 Conversions <span class="filter-tab__count">${a.conversion}</span>
4606
+ Conversions <span class="filter-tab__count">${i.conversion}</span>
4259
4607
  </button>
4260
- ${Object.entries(t.PROVIDERS).map(([t,e])=>a[t]>0?U`
4608
+ ${Object.entries(t.PROVIDERS).map(([t,e])=>i[t]>0?U`
4261
4609
  <button
4262
4610
  class="filter-tab ${this.activeFilter===t?"filter-tab--active":""}"
4263
4611
  @click=${()=>this._setFilter(t)}
4264
4612
  >
4265
- ${e.icon} ${e.name} <span class="filter-tab__count">${a[t]}</span>
4613
+ ${e.name} <span class="filter-tab__count">${i[t]}</span>
4266
4614
  </button>
4267
4615
  `:"")}
4268
4616
  </div>
@@ -4277,11 +4625,11 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4277
4625
  </div>
4278
4626
  `:U`
4279
4627
  <div class="event-list">
4280
- ${e.slice().reverse().map(e=>{const a=this.expandedEvents.has(e.id),i=this._getEventSummary(e),s=t.PROVIDERS[e.provider];return U`
4628
+ ${e.slice().reverse().map(e=>{const i=this.expandedEvents.has(e.id),s=this._getEventSummary(e),a=t.PROVIDERS[e.provider];return U`
4281
4629
  <div class="event-item event-item--${e.provider} ${e.isConversion?"event-item--conversion":""}">
4282
4630
  <div class="event-header" @click=${()=>this._toggleExpand(e.id)}>
4283
4631
  <span class="event-provider event-provider--${e.provider}">
4284
- ${null==s?void 0:s.icon} ${null==s?void 0:s.name}
4632
+ ${null==a?void 0:a.name}
4285
4633
  </span>
4286
4634
  <span class="event-name ${e.isConversion?"event-name--conversion":""}">
4287
4635
  ${e.eventName}
@@ -4291,11 +4639,11 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4291
4639
  <button class="btn-copy" @click=${t=>this._copyEvent(e,t)}>Copy</button>
4292
4640
  <span class="event-time">${this._formatTime(e.timestamp)}</span>
4293
4641
  </div>
4294
- ${a?U`
4642
+ ${i?U`
4295
4643
  <div class="event-content">
4296
- ${i.length>0?U`
4644
+ ${s.length>0?U`
4297
4645
  <div class="event-summary">
4298
- ${i.map(t=>U`
4646
+ ${s.map(t=>U`
4299
4647
  <span class="event-summary__item">
4300
4648
  <span class="event-summary__label">${t.label}:</span>
4301
4649
  <span class="event-summary__value">${t.value}</span>
@@ -4313,7 +4661,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4313
4661
  `})}
4314
4662
  </div>
4315
4663
  `}
4316
- `}};__publicField(jt,"properties",{events:{type:Array,state:!0},dataLayerSnapshots:{type:Array,state:!0},filter:{type:String,state:!0},activeFilter:{type:String,state:!0},expandedEvents:{type:Set,state:!0},isPaused:{type:Boolean,state:!0}}),__publicField(jt,"styles",[pt,r`
4664
+ `}};__publicField(Aa,"properties",{events:{type:Array,state:!0},dataLayerSnapshots:{type:Array,state:!0},filter:{type:String,state:!0},activeFilter:{type:String,state:!0},expandedEvents:{type:Set,state:!0},isPaused:{type:Boolean,state:!0}}),__publicField(Aa,"styles",[pt,n`
4317
4665
  :host {
4318
4666
  display: block;
4319
4667
  padding: 12px;
@@ -4748,15 +5096,15 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4748
5096
  background: rgba(92, 106, 196, 0.2);
4749
5097
  color: #5c6ac4;
4750
5098
  }
4751
- `]),__publicField(jt,"CONVERSION_EVENTS",["purchase","add_to_cart","begin_checkout","add_payment_info","add_shipping_info","view_item","view_item_list","select_item","remove_from_cart","view_cart","sign_up","login","search","Purchase","AddToCart","InitiateCheckout","AddPaymentInfo","ViewContent","Lead","CompleteRegistration","Subscribe"]),__publicField(jt,"PROVIDERS",{ga4:{name:"GA4",icon:"📊",color:"#4285f4"},ga:{name:"GA Universal",icon:"📈",color:"#e37400"},fbpixel:{name:"FB Pixel",icon:"📘",color:"#1877f2"},tiktok:{name:"TikTok",icon:"🎵",color:"#000000"},pinterest:{name:"Pinterest",icon:"📌",color:"#e60023"},snapchat:{name:"Snapchat",icon:"👻",color:"#fffc00"},klaviyo:{name:"Klaviyo",icon:"📧",color:"#2d2d2d"},shopify:{name:"Shopify",icon:"🛍️",color:"#96bf48"},webpixel:{name:"Web Pixel",icon:"🔷",color:"#5c6ac4"},datalayer:{name:"DataLayer",icon:"📦",color:"#f9ab00"},custom:{name:"Custom",icon:"⚡",color:"#9382ff"}}),__publicField(jt,"STORAGE_KEY","tdt-analytics-events");let It=jt;customElements.define("tdt-analytics-panel",It);const Nt=class t extends nt{constructor(){super(),this.metaTags=[],this.jsonLdData=[],this.openGraph={},this.twitterCard={},this.images=[],this.issues=[],this.activeTab="overview",this.headings=[],this.links={internal:[],external:[],nofollow:[]},this.contentStats={},this.copiedField=null,this._expandedSchemas=new Set,this._previewType="google"}connectedCallback(){super.connectedCallback(),this._scanPage()}_scanPage(){this._scanMetaTags(),this._scanOpenGraph(),this._scanTwitterCard(),this._scanJsonLd(),this._scanImages(),this._scanHeadings(),this._scanLinks(),this._analyzeContent(),this._generateIssues()}_scanMetaTags(){var e;const a=[];t.REQUIRED_META.forEach(t=>{const e=document.querySelector(t.selector);let i="";e&&(i=t.attr?e.getAttribute(t.attr):e.textContent);const s=(null==i?void 0:i.length)||0;let o="success",r="";i?t.maxLength&&s>t.maxLength?(o="warning",r=`Too long (${s}/${t.maxLength} chars)`):t.minLength&&s<t.minLength&&(o="warning",r=`Too short (${s}/${t.minLength} min chars)`):(o="error",r="Missing - this tag is required"),a.push({name:t.name,value:i||null,length:s,maxLength:t.maxLength,minLength:t.minLength,status:o,hint:r})});const i=document.querySelector('link[rel="canonical"]');a.push({name:"canonical",value:(null==i?void 0:i.href)||null,status:i?"success":"warning",hint:i?"":"Recommended for SEO"});const s=document.querySelector('meta[name="robots"]');a.push({name:"robots",value:(null==s?void 0:s.content)||null,status:"success",hint:(null==(e=null==s?void 0:s.content)?void 0:e.includes("noindex"))?"⚠️ Page is set to noindex":""}),this.metaTags=a}_scanOpenGraph(){const e={};t.OG_TAGS.forEach(t=>{const a=document.querySelector(`meta[property="${t.name}"]`);e[t.name]={value:(null==a?void 0:a.content)||null,required:t.required}}),this.openGraph=e}_scanTwitterCard(){const e={};t.TWITTER_TAGS.forEach(t=>{const a=document.querySelector(`meta[name="${t.name}"]`);e[t.name]={value:(null==a?void 0:a.content)||null,required:t.required}}),this.twitterCard=e}_scanJsonLd(){const t=document.querySelectorAll('script[type="application/ld+json"]'),e=[];t.forEach((t,a)=>{try{const i=JSON.parse(t.textContent);(Array.isArray(i)?i:[i]).forEach(t=>{e.push({id:`schema-${a}-${e.length}`,type:t["@type"]||"Unknown",data:t,isValid:!0})})}catch(i){e.push({id:`schema-${a}`,type:"Invalid JSON",data:{error:i.message,raw:t.textContent.substring(0,200)},isValid:!1})}}),this.jsonLdData=e}_scanImages(){const t=document.querySelectorAll("img"),e=[];t.forEach((t,a)=>{const i=t.getAttribute("alt"),s=t.src||t.dataset.src;s&&!s.startsWith("data:")&&e.push({id:a,src:s,alt:i,hasAlt:null!==i&&""!==i,width:t.naturalWidth||t.width,height:t.naturalHeight||t.height,loading:t.loading,isLazy:"lazy"===t.loading||t.dataset.src})}),this.images=e}_scanHeadings(){const t=[];document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((e,a)=>{var i;const s=parseInt(e.tagName[1]),o=(null==(i=e.textContent)?void 0:i.trim())||"";(null!==e.offsetParent||e.closest('[style*="display: none"]'))&&t.push({id:a,level:s,tag:e.tagName.toLowerCase(),text:o.substring(0,200),isEmpty:!o})}),this.headings=t}_scanLinks(){const t=document.querySelectorAll("a[href]"),e=[],a=[],i=[],s=window.location.hostname;t.forEach((t,o)=>{var r;const n=t.href,l=(null==(r=t.textContent)?void 0:r.trim().substring(0,100))||"",d=t.getAttribute("rel")||"",c=d.includes("nofollow");try{const t=new URL(n),r=t.hostname===s||t.hostname.endsWith("."+s),p={id:o,href:n,text:l,rel:d,isNofollow:c};c&&i.push(p),r?e.push(p):t.protocol.startsWith("http")&&a.push(p)}catch{}}),this.links={internal:e,external:a,nofollow:i}}_analyzeContent(){const t=document.body.innerText||"",e=t.split(/\s+/).filter(t=>t.length>0).length,a=Math.ceil(e/200),i=t.split(/[.!?]+/).filter(t=>t.trim().length>0).length,s=document.querySelectorAll("p").length;this.contentStats={wordCount:e,readingTime:a,sentences:i,paragraphs:s,charCount:t.length}}_generateIssues(){var t,e;const a=[],i=this.metaTags.find(t=>"title"===t.name);(null==i?void 0:i.value)?i.length>60&&a.push({type:"warning",title:"Title too long",description:`Title is ${i.length} characters (recommended: 60 max)`}):a.push({type:"error",title:"Missing page title",description:"Every page should have a unique title tag"});const s=this.metaTags.find(t=>"description"===t.name);(null==s?void 0:s.value)?s.length>160&&a.push({type:"warning",title:"Description too long",description:`Description is ${s.length} characters (recommended: 160 max)`}):a.push({type:"error",title:"Missing meta description",description:"Add a meta description for better SEO"}),(null==(t=this.openGraph["og:image"])?void 0:t.value)||a.push({type:"warning",title:"Missing og:image",description:"Add an Open Graph image for social sharing"}),(null==(e=this.openGraph["og:title"])?void 0:e.value)||a.push({type:"warning",title:"Missing og:title",description:"Add an Open Graph title for social sharing"});const o=this.images.filter(t=>!t.hasAlt);o.length>0&&a.push({type:"warning",title:`${o.length} image${o.length>1?"s":""} missing alt text`,description:"Alt text improves accessibility and SEO"});this.jsonLdData.filter(t=>!t.isValid).length>0&&a.push({type:"error",title:"Invalid JSON-LD schema",description:"Fix JSON syntax errors in structured data"});const r=this.metaTags.find(t=>"canonical"===t.name);(null==r?void 0:r.value)||a.push({type:"warning",title:"Missing canonical URL",description:"Add a canonical link to prevent duplicate content issues"});const n=this.headings.filter(t=>1===t.level).length;0===n?a.push({type:"error",title:"Missing H1 heading",description:"Every page should have exactly one H1 tag"}):n>1&&a.push({type:"warning",title:"Multiple H1 headings",description:`Found ${n} H1 tags. Recommended: 1`});const l=this.headings.map(t=>t.level);for(let d=1;d<l.length;d++)if(l[d]>l[d-1]+1){a.push({type:"warning",title:"Skipped heading level",description:`H${l[d-1]} followed by H${l[d]}. Don't skip levels.`});break}this.issues=a}async _copyValue(t,e){if(t)try{await navigator.clipboard.writeText(t),this.copiedField=e,setTimeout(()=>{this.copiedField=null},1500)}catch(a){console.error("Failed to copy:",a)}}_exportReport(){var t,e,a,i;const s=null==(t=this.metaTags.find(t=>"title"===t.name))?void 0:t.value,o=null==(e=this.metaTags.find(t=>"description"===t.name))?void 0:e.value,r={exportedAt:(new Date).toISOString(),url:window.location.href,score:this._getScore(),meta:{title:{value:s,length:(null==s?void 0:s.length)||0,maxLength:60},description:{value:o,length:(null==o?void 0:o.length)||0,maxLength:160},canonical:null==(a=this.metaTags.find(t=>"canonical"===t.name))?void 0:a.value,robots:null==(i=this.metaTags.find(t=>"robots"===t.name))?void 0:i.value},openGraph:Object.fromEntries(Object.entries(this.openGraph).map(([t,e])=>[t,e.value])),twitterCard:Object.fromEntries(Object.entries(this.twitterCard).map(([t,e])=>[t,e.value])),headings:{structure:this.headings.map(t=>({tag:t.tag,text:t.text})),h1Count:this.headings.filter(t=>1===t.level).length,totalHeadings:this.headings.length},links:{internalCount:this.links.internal.length,externalCount:this.links.external.length,nofollowCount:this.links.nofollow.length,internal:this.links.internal.slice(0,50).map(t=>({href:t.href,text:t.text})),external:this.links.external.slice(0,50).map(t=>({href:t.href,text:t.text}))},content:this.contentStats,images:{total:this.images.length,missingAlt:this.images.filter(t=>!t.hasAlt).length,withAlt:this.images.filter(t=>t.hasAlt).length},schema:this.jsonLdData.map(t=>({type:t.type,isValid:t.isValid,data:t.data})),issues:this.issues},n=new Blob([JSON.stringify(r,null,2)],{type:"application/json"}),l=URL.createObjectURL(n),d=document.createElement("a");d.href=l,d.download=`seo-report-${(new Date).toISOString().slice(0,10)}.json`,d.click(),URL.revokeObjectURL(l)}_getScore(){let t=10;return this.issues.forEach(e=>{"error"===e.type?t-=2:"warning"===e.type&&(t-=1)}),Math.max(0,t)}_getScoreClass(t){return t>=8?"good":t>=5?"warning":"error"}_setTab(t){this.activeTab=t}_setPreviewType(t){this._previewType=t,this.requestUpdate()}_toggleSchema(t){const e=new Set(this._expandedSchemas);e.has(t)?e.delete(t):e.add(t),this._expandedSchemas=e,this.requestUpdate()}_openRichResultsTest(){const t=`https://search.google.com/test/rich-results?url=${encodeURIComponent(window.location.href)}`;window.open(t,"_blank")}_renderOverview(){var t,e;const a=this._getScore(),i=this._getScoreClass(a),s=this.issues.filter(t=>"error"===t.type).length,o=this.issues.filter(t=>"warning"===t.type).length,r=(null==(t=this.metaTags.find(t=>"title"===t.name))?void 0:t.value)||"",n=(null==(e=this.metaTags.find(t=>"description"===t.name))?void 0:e.value)||"";return U`
5099
+ `]),__publicField(Aa,"CONVERSION_EVENTS",["purchase","add_to_cart","begin_checkout","add_payment_info","add_shipping_info","view_item","view_item_list","select_item","remove_from_cart","view_cart","sign_up","login","search","Purchase","AddToCart","InitiateCheckout","AddPaymentInfo","ViewContent","Lead","CompleteRegistration","Subscribe"]),__publicField(Aa,"PROVIDERS",{ga4:{name:"GA4",color:"#4285f4"},ga:{name:"GA Universal",color:"#e37400"},fbpixel:{name:"FB Pixel",color:"#1877f2"},tiktok:{name:"TikTok",color:"#000000"},pinterest:{name:"Pinterest",color:"#e60023"},snapchat:{name:"Snapchat",color:"#fffc00"},klaviyo:{name:"Klaviyo",color:"#2d2d2d"},shopify:{name:"Shopify",color:"#96bf48"},webpixel:{name:"Web Pixel",color:"#5c6ac4"},datalayer:{name:"DataLayer",color:"#f9ab00"},custom:{name:"Custom",color:"#9382ff"}}),__publicField(Aa,"STORAGE_KEY","tdt-analytics-events");let Oa=Aa;customElements.define("tdt-analytics-panel",Oa);const La=class t extends ot{constructor(){super(),this.metaTags=[],this.jsonLdData=[],this.openGraph={},this.twitterCard={},this.images=[],this.issues=[],this.activeTab="overview",this.headings=[],this.links={internal:[],external:[],nofollow:[]},this.contentStats={},this.copiedField=null,this._expandedSchemas=new Set,this._previewType="google"}connectedCallback(){super.connectedCallback(),this._scanPage()}_scanPage(){this._scanMetaTags(),this._scanOpenGraph(),this._scanTwitterCard(),this._scanJsonLd(),this._scanImages(),this._scanHeadings(),this._scanLinks(),this._analyzeContent(),this._generateIssues()}_scanMetaTags(){var e;const i=[];t.REQUIRED_META.forEach(t=>{const e=document.querySelector(t.selector);let s="";e&&(s=t.attr?e.getAttribute(t.attr):e.textContent);const a=(null==s?void 0:s.length)||0;let r="success",n="";s?t.maxLength&&a>t.maxLength?(r="warning",n=`Too long (${a}/${t.maxLength} chars)`):t.minLength&&a<t.minLength&&(r="warning",n=`Too short (${a}/${t.minLength} min chars)`):(r="error",n="Missing - this tag is required"),i.push({name:t.name,value:s||null,length:a,maxLength:t.maxLength,minLength:t.minLength,status:r,hint:n})});const s=document.querySelector('link[rel="canonical"]');i.push({name:"canonical",value:(null==s?void 0:s.href)||null,status:s?"success":"warning",hint:s?"":"Recommended for SEO"});const a=document.querySelector('meta[name="robots"]');i.push({name:"robots",value:(null==a?void 0:a.content)||null,status:"success",hint:(null==(e=null==a?void 0:a.content)?void 0:e.includes("noindex"))?"⚠️ Page is set to noindex":""}),this.metaTags=i}_scanOpenGraph(){const e={};t.OG_TAGS.forEach(t=>{const i=document.querySelector(`meta[property="${t.name}"]`);e[t.name]={value:(null==i?void 0:i.content)||null,required:t.required}}),this.openGraph=e}_scanTwitterCard(){const e={};t.TWITTER_TAGS.forEach(t=>{const i=document.querySelector(`meta[name="${t.name}"]`);e[t.name]={value:(null==i?void 0:i.content)||null,required:t.required}}),this.twitterCard=e}_scanJsonLd(){const t=document.querySelectorAll('script[type="application/ld+json"]'),e=[];t.forEach((t,i)=>{try{const s=JSON.parse(t.textContent);(Array.isArray(s)?s:[s]).forEach(t=>{e.push({id:`schema-${i}-${e.length}`,type:t["@type"]||"Unknown",data:t,isValid:!0})})}catch(s){e.push({id:`schema-${i}`,type:"Invalid JSON",data:{error:s.message,raw:t.textContent.substring(0,200)},isValid:!1})}}),this.jsonLdData=e}_scanImages(){const t=document.querySelectorAll("img"),e=[];t.forEach((t,i)=>{const s=t.getAttribute("alt"),a=t.src||t.dataset.src;a&&!a.startsWith("data:")&&e.push({id:i,src:a,alt:s,hasAlt:null!==s&&""!==s,width:t.naturalWidth||t.width,height:t.naturalHeight||t.height,loading:t.loading,isLazy:"lazy"===t.loading||t.dataset.src})}),this.images=e}_scanHeadings(){const t=[];document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((e,i)=>{var s;const a=parseInt(e.tagName[1]),r=(null==(s=e.textContent)?void 0:s.trim())||"";(null!==e.offsetParent||e.closest('[style*="display: none"]'))&&t.push({id:i,level:a,tag:e.tagName.toLowerCase(),text:r.substring(0,200),isEmpty:!r})}),this.headings=t}_scanLinks(){const t=document.querySelectorAll("a[href]"),e=[],i=[],s=[],a=window.location.hostname;t.forEach((t,r)=>{var n;const o=t.href,l=(null==(n=t.textContent)?void 0:n.trim().substring(0,100))||"",c=t.getAttribute("rel")||"",d=c.includes("nofollow");try{const t=new URL(o),n=t.hostname===a||t.hostname.endsWith("."+a),p={id:r,href:o,text:l,rel:c,isNofollow:d};d&&s.push(p),n?e.push(p):t.protocol.startsWith("http")&&i.push(p)}catch{}}),this.links={internal:e,external:i,nofollow:s}}_analyzeContent(){const t=document.body.innerText||"",e=t.split(/\s+/).filter(t=>t.length>0).length,i=Math.ceil(e/200),s=t.split(/[.!?]+/).filter(t=>t.trim().length>0).length,a=document.querySelectorAll("p").length;this.contentStats={wordCount:e,readingTime:i,sentences:s,paragraphs:a,charCount:t.length}}_generateIssues(){var t,e;const i=[],s=this.metaTags.find(t=>"title"===t.name);(null==s?void 0:s.value)?s.length>60&&i.push({type:"warning",title:"Title too long",description:`Title is ${s.length} characters (recommended: 60 max)`}):i.push({type:"error",title:"Missing page title",description:"Every page should have a unique title tag"});const a=this.metaTags.find(t=>"description"===t.name);(null==a?void 0:a.value)?a.length>160&&i.push({type:"warning",title:"Description too long",description:`Description is ${a.length} characters (recommended: 160 max)`}):i.push({type:"error",title:"Missing meta description",description:"Add a meta description for better SEO"}),(null==(t=this.openGraph["og:image"])?void 0:t.value)||i.push({type:"warning",title:"Missing og:image",description:"Add an Open Graph image for social sharing"}),(null==(e=this.openGraph["og:title"])?void 0:e.value)||i.push({type:"warning",title:"Missing og:title",description:"Add an Open Graph title for social sharing"});const r=this.images.filter(t=>!t.hasAlt);r.length>0&&i.push({type:"warning",title:`${r.length} image${r.length>1?"s":""} missing alt text`,description:"Alt text improves accessibility and SEO"});this.jsonLdData.filter(t=>!t.isValid).length>0&&i.push({type:"error",title:"Invalid JSON-LD schema",description:"Fix JSON syntax errors in structured data"});const n=this.metaTags.find(t=>"canonical"===t.name);(null==n?void 0:n.value)||i.push({type:"warning",title:"Missing canonical URL",description:"Add a canonical link to prevent duplicate content issues"});const o=this.headings.filter(t=>1===t.level).length;0===o?i.push({type:"error",title:"Missing H1 heading",description:"Every page should have exactly one H1 tag"}):o>1&&i.push({type:"warning",title:"Multiple H1 headings",description:`Found ${o} H1 tags. Recommended: 1`});const l=this.headings.map(t=>t.level);for(let c=1;c<l.length;c++)if(l[c]>l[c-1]+1){i.push({type:"warning",title:"Skipped heading level",description:`H${l[c-1]} followed by H${l[c]}. Don't skip levels.`});break}this.issues=i}async _copyValue(t,e){if(t)try{await navigator.clipboard.writeText(t),this.copiedField=e,setTimeout(()=>{this.copiedField=null},1500)}catch(i){console.error("Failed to copy:",i)}}_exportReport(){var t,e,i,s;const a=null==(t=this.metaTags.find(t=>"title"===t.name))?void 0:t.value,r=null==(e=this.metaTags.find(t=>"description"===t.name))?void 0:e.value,n={exportedAt:(new Date).toISOString(),url:window.location.href,score:this._getScore(),meta:{title:{value:a,length:(null==a?void 0:a.length)||0,maxLength:60},description:{value:r,length:(null==r?void 0:r.length)||0,maxLength:160},canonical:null==(i=this.metaTags.find(t=>"canonical"===t.name))?void 0:i.value,robots:null==(s=this.metaTags.find(t=>"robots"===t.name))?void 0:s.value},openGraph:Object.fromEntries(Object.entries(this.openGraph).map(([t,e])=>[t,e.value])),twitterCard:Object.fromEntries(Object.entries(this.twitterCard).map(([t,e])=>[t,e.value])),headings:{structure:this.headings.map(t=>({tag:t.tag,text:t.text})),h1Count:this.headings.filter(t=>1===t.level).length,totalHeadings:this.headings.length},links:{internalCount:this.links.internal.length,externalCount:this.links.external.length,nofollowCount:this.links.nofollow.length,internal:this.links.internal.slice(0,50).map(t=>({href:t.href,text:t.text})),external:this.links.external.slice(0,50).map(t=>({href:t.href,text:t.text}))},content:this.contentStats,images:{total:this.images.length,missingAlt:this.images.filter(t=>!t.hasAlt).length,withAlt:this.images.filter(t=>t.hasAlt).length},schema:this.jsonLdData.map(t=>({type:t.type,isValid:t.isValid,data:t.data})),issues:this.issues},o=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),l=URL.createObjectURL(o),c=document.createElement("a");c.href=l,c.download=`seo-report-${(new Date).toISOString().slice(0,10)}.json`,c.click(),URL.revokeObjectURL(l)}_getScore(){let t=10;return this.issues.forEach(e=>{"error"===e.type?t-=2:"warning"===e.type&&(t-=1)}),Math.max(0,t)}_getScoreClass(t){return t>=8?"good":t>=5?"warning":"error"}_setTab(t){this.activeTab=t}_setPreviewType(t){this._previewType=t,this.requestUpdate()}_toggleSchema(t){const e=new Set(this._expandedSchemas);e.has(t)?e.delete(t):e.add(t),this._expandedSchemas=e,this.requestUpdate()}_openRichResultsTest(){const t=`https://search.google.com/test/rich-results?url=${encodeURIComponent(window.location.href)}`;window.open(t,"_blank")}_renderOverview(){var t,e;const i=this._getScore(),s=this._getScoreClass(i),a=this.issues.filter(t=>"error"===t.type).length,r=this.issues.filter(t=>"warning"===t.type).length,n=(null==(t=this.metaTags.find(t=>"title"===t.name))?void 0:t.value)||"",o=(null==(e=this.metaTags.find(t=>"description"===t.name))?void 0:e.value)||"";return U`
4752
5100
  <div class="score-card">
4753
- <div class="score score--${i}">${a}/10</div>
5101
+ <div class="score score--${s}">${i}/10</div>
4754
5102
  <div class="score-details">
4755
5103
  <div class="score-title">SEO Score</div>
4756
5104
  <div class="score-summary">
4757
- ${s>0?`${s} error${s>1?"s":""}, `:""}
4758
- ${o>0?`${o} warning${o>1?"s":""}`:""}
4759
- ${0===s&&0===o?"✓ All checks passed":""}
5105
+ ${a>0?`${a} error${a>1?"s":""}, `:""}
5106
+ ${r>0?`${r} warning${r>1?"s":""}`:""}
5107
+ ${0===a&&0===r?"✓ All checks passed":""}
4760
5108
  </div>
4761
5109
  </div>
4762
5110
  </div>
@@ -4772,14 +5120,14 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4772
5120
  <div class="serp-preview__breadcrumb">${window.location.pathname}</div>
4773
5121
  </div>
4774
5122
  </div>
4775
- <div class="serp-preview__title">${r||"No title set"}</div>
4776
- <div class="serp-preview__description">${n||"No description set"}</div>
5123
+ <div class="serp-preview__title">${n||"No title set"}</div>
5124
+ <div class="serp-preview__description">${o||"No description set"}</div>
4777
5125
  <div class="serp-preview__char-count">
4778
- <span class="${r.length>60?"char-count--warning":""}">
4779
- Title: ${r.length}/60
5126
+ <span class="${n.length>60?"char-count--warning":""}">
5127
+ Title: ${n.length}/60
4780
5128
  </span>
4781
- <span class="${n.length>160?"char-count--warning":""}">
4782
- Description: ${n.length}/160
5129
+ <span class="${o.length>160?"char-count--warning":""}">
5130
+ Description: ${o.length}/160
4783
5131
  </span>
4784
5132
  </div>
4785
5133
  </div>
@@ -4833,36 +5181,36 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4833
5181
  `)}
4834
5182
  </div>
4835
5183
  </div>
4836
- `}_renderSocialPreview(){var t,e,a,i,s,o,r,n,l;const d=null==(t=this.openGraph["og:image"])?void 0:t.value,c=(null==(e=this.openGraph["og:title"])?void 0:e.value)||(null==(a=this.metaTags.find(t=>"title"===t.name))?void 0:a.value),p=(null==(i=this.openGraph["og:description"])?void 0:i.value)||(null==(s=this.metaTags.find(t=>"description"===t.name))?void 0:s.value),h=(null==(o=this.openGraph["og:site_name"])?void 0:o.value)||window.location.hostname,u=(null==(r=this.twitterCard["twitter:image"])?void 0:r.value)||d,v=(null==(n=this.twitterCard["twitter:title"])?void 0:n.value)||c,g=(null==(l=this.twitterCard["twitter:description"])?void 0:l.value)||p;return U`
5184
+ `}_renderSocialPreview(){var t,e,i,s,a,r,n,o,l;const c=null==(t=this.openGraph["og:image"])?void 0:t.value,d=(null==(e=this.openGraph["og:title"])?void 0:e.value)||(null==(i=this.metaTags.find(t=>"title"===t.name))?void 0:i.value),p=(null==(s=this.openGraph["og:description"])?void 0:s.value)||(null==(a=this.metaTags.find(t=>"description"===t.name))?void 0:a.value),h=(null==(r=this.openGraph["og:site_name"])?void 0:r.value)||window.location.hostname,u=(null==(n=this.twitterCard["twitter:image"])?void 0:n.value)||c,g=(null==(o=this.twitterCard["twitter:title"])?void 0:o.value)||d,v=(null==(l=this.twitterCard["twitter:description"])?void 0:l.value)||p;return U`
4837
5185
  <div class="preview-tabs">
4838
5186
  <button
4839
5187
  class="preview-tab ${"facebook"===this._previewType?"preview-tab--active":""}"
4840
5188
  @click=${()=>this._setPreviewType("facebook")}
4841
5189
  >
4842
- 📘 Facebook
5190
+ Facebook
4843
5191
  </button>
4844
5192
  <button
4845
5193
  class="preview-tab ${"twitter"===this._previewType?"preview-tab--active":""}"
4846
5194
  @click=${()=>this._setPreviewType("twitter")}
4847
5195
  >
4848
- 🐦 Twitter
5196
+ Twitter
4849
5197
  </button>
4850
5198
  <button
4851
5199
  class="preview-tab ${"linkedin"===this._previewType?"preview-tab--active":""}"
4852
5200
  @click=${()=>this._setPreviewType("linkedin")}
4853
5201
  >
4854
- 💼 LinkedIn
5202
+ LinkedIn
4855
5203
  </button>
4856
5204
  </div>
4857
5205
 
4858
5206
  ${"facebook"===this._previewType||"linkedin"===this._previewType?U`
4859
5207
  <div class="og-preview">
4860
5208
  <div class="og-preview__image">
4861
- ${d?U`<img src="${d}" alt="OG Image" @error=${t=>t.target.style.display="none"}>`:"No image set"}
5209
+ ${c?U`<img src="${c}" alt="OG Image" @error=${t=>t.target.style.display="none"}>`:"No image set"}
4862
5210
  </div>
4863
5211
  <div class="og-preview__content">
4864
5212
  <div class="og-preview__site">${h}</div>
4865
- <div class="og-preview__title">${c||"No title set"}</div>
5213
+ <div class="og-preview__title">${d||"No title set"}</div>
4866
5214
  <div class="og-preview__description">${p||"No description set"}</div>
4867
5215
  </div>
4868
5216
  </div>
@@ -4872,8 +5220,8 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4872
5220
  ${u?U`<img src="${u}" alt="Twitter Image" @error=${t=>t.target.style.display="none"}>`:"No image set"}
4873
5221
  </div>
4874
5222
  <div class="twitter-preview__content">
4875
- <div class="twitter-preview__title">${v||"No title set"}</div>
4876
- <div class="twitter-preview__description">${g||"No description set"}</div>
5223
+ <div class="twitter-preview__title">${g||"No title set"}</div>
5224
+ <div class="twitter-preview__description">${v||"No description set"}</div>
4877
5225
  <div class="twitter-preview__domain">🔗 ${window.location.hostname}</div>
4878
5226
  </div>
4879
5227
  </div>
@@ -4929,7 +5277,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4929
5277
  `)}
4930
5278
  </div>
4931
5279
  </div>
4932
- `}_renderHeadings(){const t=this.headings.filter(t=>1===t.level).length,e=1!==t,a=this.headings.map(t=>t.level);let i=!1;for(let s=1;s<a.length;s++)if(a[s]>a[s-1]+1){i=!0;break}return U`
5280
+ `}_renderHeadings(){const t=this.headings.filter(t=>1===t.level).length,e=1!==t,i=this.headings.map(t=>t.level);let s=!1;for(let a=1;a<i.length;a++)if(i[a]>i[a-1]+1){s=!0;break}return U`
4933
5281
  <div class="content-stats">
4934
5282
  <div class="content-stat ${1!==t?"link-stat--warning":""}">
4935
5283
  <div class="content-stat__value">${t}</div>
@@ -4949,7 +5297,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4949
5297
  </div>
4950
5298
  </div>
4951
5299
 
4952
- ${e||i?U`
5300
+ ${e||s?U`
4953
5301
  <div class="section">
4954
5302
  <div class="section-title">Issues</div>
4955
5303
  <div class="issue-list">
@@ -4971,7 +5319,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4971
5319
  </div>
4972
5320
  </div>
4973
5321
  `:""}
4974
- ${i?U`
5322
+ ${s?U`
4975
5323
  <div class="issue-item issue-item--warning">
4976
5324
  <span class="issue-icon">⚠️</span>
4977
5325
  <div class="issue-content">
@@ -4989,9 +5337,9 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4989
5337
  ${0===this.headings.length?U`
4990
5338
  <div class="empty-state">No headings found on this page</div>
4991
5339
  `:U`
4992
- ${this.headings.map((e,a)=>{const i=a>0?this.headings[a-1].level:0,s=e.level>i+1&&i>0,o=1===e.level&&t>1;return U`
5340
+ ${this.headings.map((e,i)=>{const s=i>0?this.headings[i-1].level:0,a=e.level>s+1&&s>0,r=1===e.level&&t>1;return U`
4993
5341
  <div
4994
- class="heading-item ${s?"heading-item--warning":""} ${o?"heading-item--warning":""}"
5342
+ class="heading-item ${a?"heading-item--warning":""} ${r?"heading-item--warning":""}"
4995
5343
  style="--indent: ${16*(e.level-1)}px"
4996
5344
  >
4997
5345
  <span class="heading-tag heading-tag--${e.tag}" style="margin-left: ${16*(e.level-1)}px">
@@ -5073,7 +5421,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
5073
5421
  `:""}
5074
5422
  `}
5075
5423
  </div>
5076
- `}_renderContent(){var t,e,a;return U`
5424
+ `}_renderContent(){var t,e,i;return U`
5077
5425
  <div class="content-stats">
5078
5426
  <div class="content-stat">
5079
5427
  <div class="content-stat__value">${(null==(t=this.contentStats.wordCount)?void 0:t.toLocaleString())||0}</div>
@@ -5116,7 +5464,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
5116
5464
  <span class="meta-name">Character Count</span>
5117
5465
  </div>
5118
5466
  <div class="meta-value">
5119
- ${(null==(a=this.contentStats.charCount)?void 0:a.toLocaleString())||0} characters
5467
+ ${(null==(i=this.contentStats.charCount)?void 0:i.toLocaleString())||0} characters
5120
5468
  </div>
5121
5469
  </div>
5122
5470
 
@@ -5214,51 +5562,51 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
5214
5562
  ${e.length>20?U`<div style="text-align: center; color: var(--tdt-text-muted); margin-top: 12px;">... and ${e.length-20} more</div>`:""}
5215
5563
  `}
5216
5564
  </div>
5217
- `}render(){const t=this.issues.length,e=this.images.filter(t=>!t.hasAlt).length,a=1!==this.headings.filter(t=>1===t.level).length;return U`
5565
+ `}render(){const t=this.issues.length,e=this.images.filter(t=>!t.hasAlt).length,i=1!==this.headings.filter(t=>1===t.level).length;return U`
5218
5566
  <div class="toolbar">
5219
5567
  <div class="tabs">
5220
5568
  <button
5221
5569
  class="tab ${"overview"===this.activeTab?"tab--active":""} ${t>0?"tab--warning":""}"
5222
5570
  @click=${()=>this._setTab("overview")}
5223
5571
  >
5224
- 📊 Overview
5572
+ Overview
5225
5573
  ${t>0?U`<span class="tab__count">${t}</span>`:""}
5226
5574
  </button>
5227
5575
  <button
5228
5576
  class="tab ${"social"===this.activeTab?"tab--active":""}"
5229
5577
  @click=${()=>this._setTab("social")}
5230
5578
  >
5231
- 📱 Social
5579
+ Social
5232
5580
  </button>
5233
5581
  <button
5234
- class="tab ${"headings"===this.activeTab?"tab--active":""} ${a?"tab--warning":""}"
5582
+ class="tab ${"headings"===this.activeTab?"tab--active":""} ${i?"tab--warning":""}"
5235
5583
  @click=${()=>this._setTab("headings")}
5236
5584
  >
5237
- 📝 Headings
5585
+ Headings
5238
5586
  </button>
5239
5587
  <button
5240
5588
  class="tab ${"links"===this.activeTab?"tab--active":""}"
5241
5589
  @click=${()=>this._setTab("links")}
5242
5590
  >
5243
- 🔗 Links
5591
+ Links
5244
5592
  </button>
5245
5593
  <button
5246
5594
  class="tab ${"content"===this.activeTab?"tab--active":""}"
5247
5595
  @click=${()=>this._setTab("content")}
5248
5596
  >
5249
- 📄 Content
5597
+ Content
5250
5598
  </button>
5251
5599
  <button
5252
5600
  class="tab ${"schema"===this.activeTab?"tab--active":""}"
5253
5601
  @click=${()=>this._setTab("schema")}
5254
5602
  >
5255
- 📋 Schema <span class="tab__count">${this.jsonLdData.length}</span>
5603
+ Schema <span class="tab__count">${this.jsonLdData.length}</span>
5256
5604
  </button>
5257
5605
  <button
5258
5606
  class="tab ${"images"===this.activeTab?"tab--active":""} ${e>0?"tab--warning":""}"
5259
5607
  @click=${()=>this._setTab("images")}
5260
5608
  >
5261
- 🖼️ Images
5609
+ Images
5262
5610
  ${e>0?U`<span class="tab__count">${e}</span>`:""}
5263
5611
  </button>
5264
5612
  </div>
@@ -5274,7 +5622,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
5274
5622
  ${"content"===this.activeTab?this._renderContent():""}
5275
5623
  ${"schema"===this.activeTab?this._renderSchema():""}
5276
5624
  ${"images"===this.activeTab?this._renderImages():""}
5277
- `}};__publicField(Nt,"properties",{metaTags:{type:Array,state:!0},jsonLdData:{type:Array,state:!0},openGraph:{type:Object,state:!0},twitterCard:{type:Object,state:!0},images:{type:Array,state:!0},issues:{type:Array,state:!0},activeTab:{type:String,state:!0},headings:{type:Array,state:!0},links:{type:Object,state:!0},contentStats:{type:Object,state:!0},copiedField:{type:String,state:!0}}),__publicField(Nt,"styles",[pt,r`
5625
+ `}};__publicField(La,"properties",{metaTags:{type:Array,state:!0},jsonLdData:{type:Array,state:!0},openGraph:{type:Object,state:!0},twitterCard:{type:Object,state:!0},images:{type:Array,state:!0},issues:{type:Array,state:!0},activeTab:{type:String,state:!0},headings:{type:Array,state:!0},links:{type:Object,state:!0},contentStats:{type:Object,state:!0},copiedField:{type:String,state:!0}}),__publicField(La,"styles",[pt,n`
5278
5626
  :host {
5279
5627
  display: block;
5280
5628
  padding: 12px;
@@ -6159,13 +6507,13 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
6159
6507
  border-color: var(--tdt-accent);
6160
6508
  color: white;
6161
6509
  }
6162
- `]),__publicField(Nt,"REQUIRED_META",[{name:"title",selector:"title",maxLength:60,minLength:30},{name:"description",selector:'meta[name="description"]',attr:"content",maxLength:160,minLength:70},{name:"viewport",selector:'meta[name="viewport"]',attr:"content"},{name:"charset",selector:"meta[charset]",attr:"charset"}]),__publicField(Nt,"OG_TAGS",[{name:"og:title",required:!0},{name:"og:description",required:!0},{name:"og:image",required:!0},{name:"og:url",required:!0},{name:"og:type",required:!1},{name:"og:site_name",required:!1}]),__publicField(Nt,"TWITTER_TAGS",[{name:"twitter:card",required:!0},{name:"twitter:title",required:!1},{name:"twitter:description",required:!1},{name:"twitter:image",required:!1}]);let Rt=Nt;customElements.define("tdt-seo-panel",Rt);const Ft=class t extends nt{constructor(){super(),this.appBlocks=[],this.scripts=[],this.appEmbeds=[],this.pixelScripts=[],this.activeTab="all",this.searchTerm="",this._expandedItems=new Set}connectedCallback(){super.connectedCallback(),this._scanPage()}_scanPage(){this._scanAppBlocks(),this._scanScripts(),this._scanAppEmbeds(),this._categorizeScripts()}_scanAppBlocks(){const t=[];document.querySelectorAll('[data-shopify-editor-block], [data-block-type*="shopify://apps"], .shopify-app-block').forEach((e,a)=>{var i;const s=e.getAttribute("data-block-type")||"",o=e.getAttribute("data-block-id")||e.id||`block-${a}`,r=(null==(i=e.closest("[data-section-id]"))?void 0:i.getAttribute("data-section-id"))||"unknown";let n="Unknown App";const l=s.match(/shopify:\/\/apps\/([^/]+)/);l&&(n=l[1].replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())),t.push({id:o,type:"app-block",name:n,blockType:s,sectionId:r,element:e,tagName:e.tagName.toLowerCase(),classes:Array.from(e.classList).slice(0,5).join(", ")})});document.querySelectorAll('[id*="shopify-block"], [class*="shopify-app"]').forEach((e,a)=>{t.find(t=>t.element===e)||t.push({id:e.id||`theme-block-${a}`,type:"theme-block",name:"Theme App Block",element:e,tagName:e.tagName.toLowerCase(),classes:Array.from(e.classList).slice(0,5).join(", ")})}),this.appBlocks=t}_scanScripts(){const t=[];document.querySelectorAll("script").forEach((e,a)=>{var i;const s=e.src||"",o=e.type||"text/javascript",r=e.async,n=e.defer,l=!s,d=l?null==(i=e.textContent)?void 0:i.substring(0,500):"";if(l&&!(null==d?void 0:d.trim()))return;const c=this._identifyVendor(s||d),p=this._isPixelScript(s,d),h=this._isShopifyCoreScript(s),u=this._extractVersion(s,d);h&&!p||t.push({id:`script-${a}`,src:s,type:o,isAsync:r,isDefer:n,isInline:l,content:d,vendor:c,isPixel:p,version:u,element:e,size:l?new Blob([d]).size:null})}),this.scripts=t}_scanAppEmbeds(){const t=[];document.querySelectorAll("[data-app-embed], [data-shopify-app-embed], .shopify-app-embed").forEach((e,a)=>{const i=e.getAttribute("data-app-embed")||e.getAttribute("data-shopify-app-embed")||"";t.push({id:`embed-${a}`,type:"embed",appId:i,element:e,tagName:e.tagName.toLowerCase(),position:this._getPosition(e)})});document.querySelectorAll('[style*="position: fixed"], [style*="position:fixed"]').forEach((e,a)=>{if(e.closest("theme-devtools"))return;const i=this._identifyVendorFromElement(e);if(i){t.find(t=>t.element===e)||t.push({id:`widget-${a}`,type:"widget",name:i.name,vendor:i.key,element:e,tagName:e.tagName.toLowerCase(),position:this._getPosition(e)})}}),this.appEmbeds=t}_categorizeScripts(){this.pixelScripts=this.scripts.filter(t=>t.isPixel)}_extractVersion(t,e=""){const a=[/[?&/]v(\d+\.\d+(?:\.\d+)?)/i,/version[=:](\d+\.\d+(?:\.\d+)?)/i,/@(\d+\.\d+(?:\.\d+)?)/,/\/(\d+\.\d+\.\d+)\//,/[-.](\d+\.\d+\.\d+)\.(?:min\.)?js/i,/_v(\d+\.\d+(?:\.\d+)?)/i];for(const i of a){const e=t.match(i);if(e)return e[1]}if(e){const t=[/version['":\s]+['"]?(\d+\.\d+(?:\.\d+)?)/i,/VERSION\s*[=:]\s*['"](\d+\.\d+(?:\.\d+)?)/i,/\bv(\d+\.\d+\.\d+)\b/,/shopify-(\d+\.\d+\.\d+)/i];for(const a of t){const t=e.match(a);if(t)return t[1]}}return null}_identifyVendor(e){const a=e.toLowerCase();for(const[i,s]of Object.entries(t.KNOWN_APPS))if(s.patterns.some(t=>a.includes(t)))return{key:i,...s};return null}_identifyVendorFromElement(e){var a,i,s;const o=(null==(a=e.className)?void 0:a.toLowerCase())||"",r=(null==(i=e.id)?void 0:i.toLowerCase())||"",n=(null==(s=e.innerHTML)?void 0:s.substring(0,1e3).toLowerCase())||"";for(const[l,d]of Object.entries(t.KNOWN_APPS))if(d.patterns.some(t=>o.includes(t)||r.includes(t)||n.includes(t)))return{key:l,...d};return null}_isPixelScript(t,e){const a=(t+e).toLowerCase();return["fbevents","facebook","pixel","gtag","gtm.js","googletagmanager","google-analytics","analytics.tiktok","tiktok","pintrk","pinterest","snapchat","sc-static","monorail","trekkie"].some(t=>a.includes(t))}_isShopifyCoreScript(t){return["cdn.shopify.com/shopifycloud","cdn.shopify.com/s/files","/assets/"].some(e=>t.includes(e))}_getPosition(t){t.getBoundingClientRect();const e=window.getComputedStyle(t);return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,position:e.position}}_toggleExpand(t){this._expandedItems.has(t)?this._expandedItems.delete(t):this._expandedItems.add(t),this.requestUpdate()}_highlightElement(t){if(!t)return;t.scrollIntoView({behavior:"smooth",block:"center"});const e=t.style.outline,a=t.style.transition;t.style.transition="outline 0.2s ease",t.style.outline="3px solid #3b82f6",setTimeout(()=>{t.style.outline=e,t.style.transition=a},2e3)}_copyToClipboard(t){navigator.clipboard.writeText(t).then(()=>{this._showFeedback("Copied!")})}_showFeedback(t){const e=new CustomEvent("show-feedback",{detail:{message:t},bubbles:!0,composed:!0});this.dispatchEvent(e)}_setActiveTab(t){this.activeTab=t}_handleSearch(t){this.searchTerm=t.target.value}_getFilteredItems(){const t=this.searchTerm.toLowerCase();let e=[];return"all"!==this.activeTab&&"blocks"!==this.activeTab||(e=[...e,...this.appBlocks.map(t=>({...t,category:"block"}))]),"all"!==this.activeTab&&"scripts"!==this.activeTab||(e=[...e,...this.scripts.filter(t=>!t.isPixel).map(t=>({...t,category:"script"}))]),"all"!==this.activeTab&&"pixels"!==this.activeTab||(e=[...e,...this.pixelScripts.map(t=>({...t,category:"pixel"}))]),"all"!==this.activeTab&&"embeds"!==this.activeTab||(e=[...e,...this.appEmbeds.map(t=>({...t,category:"embed"}))]),t&&(e=e.filter(e=>this._matchesSearch(e,t))),e}_matchesSearch(t,e){var a;if((t.name||(null==(a=t.vendor)?void 0:a.name)||"").toLowerCase().includes(e))return!0;if((t.src||"").toLowerCase().includes(e))return!0;if((t.blockType||"").toLowerCase().includes(e))return!0;if((t.appId||"").toLowerCase().includes(e))return!0;if((t.content||"").toLowerCase().includes(e))return!0;if((t.classes||"").toLowerCase().includes(e))return!0;return!!(t.version||"").toLowerCase().includes(e)}_getVendorIcon(t){return t?U`<span class="vendor-icon vendor-icon--${t.key}">${t.icon}</span>`:U`<span class="vendor-icon vendor-icon--unknown">?</span>`}_renderItem(t){const e=this._expandedItems.has(t.id),a=t.vendor,i=t.name||(null==a?void 0:a.name)||this._extractNameFromSrc(t.src)||"Unknown";return U`
6510
+ `]),__publicField(La,"REQUIRED_META",[{name:"title",selector:"title",maxLength:60,minLength:30},{name:"description",selector:'meta[name="description"]',attr:"content",maxLength:160,minLength:70},{name:"viewport",selector:'meta[name="viewport"]',attr:"content"},{name:"charset",selector:"meta[charset]",attr:"charset"}]),__publicField(La,"OG_TAGS",[{name:"og:title",required:!0},{name:"og:description",required:!0},{name:"og:image",required:!0},{name:"og:url",required:!0},{name:"og:type",required:!1},{name:"og:site_name",required:!1}]),__publicField(La,"TWITTER_TAGS",[{name:"twitter:card",required:!0},{name:"twitter:title",required:!1},{name:"twitter:description",required:!1},{name:"twitter:image",required:!1}]);let za=La;customElements.define("tdt-seo-panel",za);const ja=class t extends ot{constructor(){super(),this.appBlocks=[],this.scripts=[],this.appEmbeds=[],this.pixelScripts=[],this.activeTab="all",this.searchTerm="",this._expandedItems=new Set}connectedCallback(){super.connectedCallback(),this._scanPage()}_scanPage(){this._scanAppBlocks(),this._scanScripts(),this._scanAppEmbeds(),this._categorizeScripts()}_scanAppBlocks(){const t=[];document.querySelectorAll('[data-shopify-editor-block], [data-block-type*="shopify://apps"], .shopify-app-block').forEach((e,i)=>{var s;const a=e.getAttribute("data-block-type")||"",r=e.getAttribute("data-block-id")||e.id||`block-${i}`,n=(null==(s=e.closest("[data-section-id]"))?void 0:s.getAttribute("data-section-id"))||"unknown";let o="Unknown App";const l=a.match(/shopify:\/\/apps\/([^/]+)/);l&&(o=l[1].replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())),t.push({id:r,type:"app-block",name:o,blockType:a,sectionId:n,element:e,tagName:e.tagName.toLowerCase(),classes:Array.from(e.classList).slice(0,5).join(", ")})});document.querySelectorAll('[id*="shopify-block"], [class*="shopify-app"]').forEach((e,i)=>{t.find(t=>t.element===e)||t.push({id:e.id||`theme-block-${i}`,type:"theme-block",name:"Theme App Block",element:e,tagName:e.tagName.toLowerCase(),classes:Array.from(e.classList).slice(0,5).join(", ")})}),this.appBlocks=t}_scanScripts(){const t=[];document.querySelectorAll("script").forEach((e,i)=>{var s;const a=e.src||"",r=e.type||"text/javascript",n=e.async,o=e.defer,l=!a,c=l?null==(s=e.textContent)?void 0:s.substring(0,500):"";if(l&&!(null==c?void 0:c.trim()))return;const d=this._identifyVendor(a||c),p=this._isPixelScript(a,c),h=this._isShopifyCoreScript(a),u=this._extractVersion(a,c);h&&!p||t.push({id:`script-${i}`,src:a,type:r,isAsync:n,isDefer:o,isInline:l,content:c,vendor:d,isPixel:p,version:u,element:e,size:l?new Blob([c]).size:null})}),this.scripts=t}_scanAppEmbeds(){const t=[];document.querySelectorAll("[data-app-embed], [data-shopify-app-embed], .shopify-app-embed").forEach((e,i)=>{const s=e.getAttribute("data-app-embed")||e.getAttribute("data-shopify-app-embed")||"";t.push({id:`embed-${i}`,type:"embed",appId:s,element:e,tagName:e.tagName.toLowerCase(),position:this._getPosition(e)})});document.querySelectorAll('[style*="position: fixed"], [style*="position:fixed"]').forEach((e,i)=>{if(e.closest("theme-devtools"))return;const s=this._identifyVendorFromElement(e);if(s){t.find(t=>t.element===e)||t.push({id:`widget-${i}`,type:"widget",name:s.name,vendor:s.key,element:e,tagName:e.tagName.toLowerCase(),position:this._getPosition(e)})}}),this.appEmbeds=t}_categorizeScripts(){this.pixelScripts=this.scripts.filter(t=>t.isPixel)}_extractVersion(t,e=""){const i=[/[?&/]v(\d+\.\d+(?:\.\d+)?)/i,/version[=:](\d+\.\d+(?:\.\d+)?)/i,/@(\d+\.\d+(?:\.\d+)?)/,/\/(\d+\.\d+\.\d+)\//,/[-.](\d+\.\d+\.\d+)\.(?:min\.)?js/i,/_v(\d+\.\d+(?:\.\d+)?)/i];for(const s of i){const e=t.match(s);if(e)return e[1]}if(e){const t=[/version['":\s]+['"]?(\d+\.\d+(?:\.\d+)?)/i,/VERSION\s*[=:]\s*['"](\d+\.\d+(?:\.\d+)?)/i,/\bv(\d+\.\d+\.\d+)\b/,/shopify-(\d+\.\d+\.\d+)/i];for(const i of t){const t=e.match(i);if(t)return t[1]}}return null}_identifyVendor(e){const i=e.toLowerCase();for(const[s,a]of Object.entries(t.KNOWN_APPS))if(a.patterns.some(t=>i.includes(t)))return{key:s,...a};return null}_identifyVendorFromElement(e){var i,s,a;const r=(null==(i=e.className)?void 0:i.toLowerCase())||"",n=(null==(s=e.id)?void 0:s.toLowerCase())||"",o=(null==(a=e.innerHTML)?void 0:a.substring(0,1e3).toLowerCase())||"";for(const[l,c]of Object.entries(t.KNOWN_APPS))if(c.patterns.some(t=>r.includes(t)||n.includes(t)||o.includes(t)))return{key:l,...c};return null}_isPixelScript(t,e){const i=(t+e).toLowerCase();return["fbevents","facebook","pixel","gtag","gtm.js","googletagmanager","google-analytics","analytics.tiktok","tiktok","pintrk","pinterest","snapchat","sc-static","monorail","trekkie"].some(t=>i.includes(t))}_isShopifyCoreScript(t){return["cdn.shopify.com/shopifycloud","cdn.shopify.com/s/files","/assets/"].some(e=>t.includes(e))}_getPosition(t){t.getBoundingClientRect();const e=window.getComputedStyle(t);return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,position:e.position}}_toggleExpand(t){this._expandedItems.has(t)?this._expandedItems.delete(t):this._expandedItems.add(t),this.requestUpdate()}_highlightElement(t){if(!t)return;t.scrollIntoView({behavior:"smooth",block:"center"});const e=t.style.outline,i=t.style.transition;t.style.transition="outline 0.2s ease",t.style.outline="3px solid #3b82f6",setTimeout(()=>{t.style.outline=e,t.style.transition=i},2e3)}_copyToClipboard(t){navigator.clipboard.writeText(t).then(()=>{this._showFeedback("Copied!")})}_showFeedback(t){const e=new CustomEvent("show-feedback",{detail:{message:t},bubbles:!0,composed:!0});this.dispatchEvent(e)}_setActiveTab(t){this.activeTab=t}_handleSearch(t){this.searchTerm=t.target.value}_getFilteredItems(){const t=this.searchTerm.toLowerCase();let e=[];return"all"!==this.activeTab&&"blocks"!==this.activeTab||(e=[...e,...this.appBlocks.map(t=>({...t,category:"block"}))]),"all"!==this.activeTab&&"scripts"!==this.activeTab||(e=[...e,...this.scripts.filter(t=>!t.isPixel).map(t=>({...t,category:"script"}))]),"all"!==this.activeTab&&"pixels"!==this.activeTab||(e=[...e,...this.pixelScripts.map(t=>({...t,category:"pixel"}))]),"all"!==this.activeTab&&"embeds"!==this.activeTab||(e=[...e,...this.appEmbeds.map(t=>({...t,category:"embed"}))]),t&&(e=e.filter(e=>this._matchesSearch(e,t))),e}_matchesSearch(t,e){var i;if((t.name||(null==(i=t.vendor)?void 0:i.name)||"").toLowerCase().includes(e))return!0;if((t.src||"").toLowerCase().includes(e))return!0;if((t.blockType||"").toLowerCase().includes(e))return!0;if((t.appId||"").toLowerCase().includes(e))return!0;if((t.content||"").toLowerCase().includes(e))return!0;if((t.classes||"").toLowerCase().includes(e))return!0;return!!(t.version||"").toLowerCase().includes(e)}_getVendorIcon(t){return t?U`<span class="vendor-icon vendor-icon--${t.key}">${t.icon}</span>`:U`<span class="vendor-icon vendor-icon--unknown">?</span>`}_renderItem(t){const e=this._expandedItems.has(t.id),i=t.vendor,s=t.name||(null==i?void 0:i.name)||this._extractNameFromSrc(t.src)||"Unknown";return U`
6163
6511
  <div class="item item--${"pixel"===t.category?"warning":"embed"===t.category?"success":"info"}">
6164
6512
  <div class="item__header" @click=${()=>this._toggleExpand(t.id)}>
6165
6513
  <div class="item__main">
6166
- ${a?this._getVendorIcon(a):U`<span class="item__icon">${this._getCategoryIcon(t.category)}</span>`}
6514
+ ${i?this._getVendorIcon(i):U`<span class="item__icon">${this._getCategoryIcon(t.category)}</span>`}
6167
6515
  <div class="item__info">
6168
- <div class="item__name">${i}</div>
6516
+ <div class="item__name">${s}</div>
6169
6517
  <div class="item__meta">
6170
6518
  ${t.src?this._truncateSrc(t.src):t.tagName||t.type}
6171
6519
  </div>
@@ -6255,62 +6603,58 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
6255
6603
  <button class="highlight-btn" @click=${()=>this._highlightElement(t.element)}>
6256
6604
  Highlight in Page
6257
6605
  </button>
6258
- `:""}_getCategoryIcon(t){switch(t){case"block":return"🧩";case"script":return"📜";case"pixel":return"📊";case"embed":return"🔌";default:return"❓"}}_extractNameFromSrc(t){if(!t)return null;try{const e=new URL(t).hostname,a=e.replace("www.","").split(".");return a.length>=2?a[a.length-2].charAt(0).toUpperCase()+a[a.length-2].slice(1):e}catch{const e=t.match(/\/([^/]+)\.(js|min\.js)(\?|$)/);return e?e[1]:null}}_truncateSrc(t){if(!t)return"";if(t.length<=60)return t;try{return new URL(t).hostname+"/..."+t.slice(-20)}catch{return t.substring(0,30)+"..."+t.slice(-20)}}_formatSize(t){return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}_refresh(){this._expandedItems.clear(),this._scanPage()}_exportApps(){const t=this._getFilteredItems(),e={exportedAt:(new Date).toISOString(),url:window.location.href,summary:{totalScripts:this.scripts.length,totalPixels:this.pixelScripts.length,totalBlocks:this.appBlocks.length,totalEmbeds:this.appEmbeds.length},items:t.map(t=>{var e,a;const i={category:t.category,name:t.name||(null==(e=t.vendor)?void 0:e.name)||this._extractNameFromSrc(t.src)||"Unknown",vendor:(null==(a=t.vendor)?void 0:a.name)||null};return"block"===t.category?{...i,blockType:t.blockType,sectionId:t.sectionId,tagName:t.tagName,classes:t.classes}:"script"===t.category||"pixel"===t.category?{...i,src:t.src||null,isInline:t.isInline,isAsync:t.isAsync,isDefer:t.isDefer,version:t.version||null,size:t.size,type:t.type}:"embed"===t.category?{...i,appId:t.appId,type:t.type,tagName:t.tagName,position:t.position}:i})},a=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),i=URL.createObjectURL(a),s=document.createElement("a");s.href=i,s.download=`apps-export-${(new Date).toISOString().slice(0,10)}.json`,s.click(),URL.revokeObjectURL(i),this._showFeedback("Exported!")}render(){const t=this._getFilteredItems(),e=this.scripts.length,a=this.pixelScripts.length,i=this.appBlocks.length,s=this.appEmbeds.length;return U`
6606
+ `:""}_getCategoryIcon(t){switch(t){case"block":return"🧩";case"script":return"📜";case"pixel":return"📊";case"embed":return"🔌";default:return"❓"}}_extractNameFromSrc(t){if(!t)return null;try{const e=new URL(t).hostname,i=e.replace("www.","").split(".");return i.length>=2?i[i.length-2].charAt(0).toUpperCase()+i[i.length-2].slice(1):e}catch{const e=t.match(/\/([^/]+)\.(js|min\.js)(\?|$)/);return e?e[1]:null}}_truncateSrc(t){if(!t)return"";if(t.length<=60)return t;try{return new URL(t).hostname+"/..."+t.slice(-20)}catch{return t.substring(0,30)+"..."+t.slice(-20)}}_formatSize(t){return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}_refresh(){this._expandedItems.clear(),this._scanPage()}_exportApps(){const t=this._getFilteredItems(),e={exportedAt:(new Date).toISOString(),url:window.location.href,summary:{totalScripts:this.scripts.length,totalPixels:this.pixelScripts.length,totalBlocks:this.appBlocks.length,totalEmbeds:this.appEmbeds.length},items:t.map(t=>{var e,i;const s={category:t.category,name:t.name||(null==(e=t.vendor)?void 0:e.name)||this._extractNameFromSrc(t.src)||"Unknown",vendor:(null==(i=t.vendor)?void 0:i.name)||null};return"block"===t.category?{...s,blockType:t.blockType,sectionId:t.sectionId,tagName:t.tagName,classes:t.classes}:"script"===t.category||"pixel"===t.category?{...s,src:t.src||null,isInline:t.isInline,isAsync:t.isAsync,isDefer:t.isDefer,version:t.version||null,size:t.size,type:t.type}:"embed"===t.category?{...s,appId:t.appId,type:t.type,tagName:t.tagName,position:t.position}:s})},i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),s=URL.createObjectURL(i),a=document.createElement("a");a.href=s,a.download=`apps-export-${(new Date).toISOString().slice(0,10)}.json`,a.click(),URL.revokeObjectURL(s),this._showFeedback("Exported!")}render(){const t=this._getFilteredItems(),e=this.scripts.length,i=this.pixelScripts.length,s=this.appBlocks.length,a=this.appEmbeds.length;return U`
6259
6607
  <div class="tabs">
6260
6608
  <button
6261
6609
  class="tab ${"all"===this.activeTab?"tab--active":""}"
6262
6610
  @click=${()=>this._setActiveTab("all")}
6263
6611
  >
6264
- 📦 All <span class="tab__count">${e+i+s}</span>
6612
+ All <span class="tab__count">${e+s+a}</span>
6265
6613
  </button>
6266
6614
  <button
6267
6615
  class="tab ${"blocks"===this.activeTab?"tab--active":""}"
6268
6616
  @click=${()=>this._setActiveTab("blocks")}
6269
6617
  >
6270
- 🧩 App Blocks <span class="tab__count">${i}</span>
6618
+ App Blocks <span class="tab__count">${s}</span>
6271
6619
  </button>
6272
6620
  <button
6273
6621
  class="tab ${"scripts"===this.activeTab?"tab--active":""}"
6274
6622
  @click=${()=>this._setActiveTab("scripts")}
6275
6623
  >
6276
- 📜 Scripts <span class="tab__count">${e-a}</span>
6624
+ Scripts <span class="tab__count">${e-i}</span>
6277
6625
  </button>
6278
6626
  <button
6279
6627
  class="tab ${"pixels"===this.activeTab?"tab--active":""}"
6280
6628
  @click=${()=>this._setActiveTab("pixels")}
6281
6629
  >
6282
- 📊 Pixels <span class="tab__count">${a}</span>
6630
+ Pixels <span class="tab__count">${i}</span>
6283
6631
  </button>
6284
6632
  <button
6285
6633
  class="tab ${"embeds"===this.activeTab?"tab--active":""}"
6286
6634
  @click=${()=>this._setActiveTab("embeds")}
6287
6635
  >
6288
- 🔌 Embeds <span class="tab__count">${s}</span>
6636
+ Embeds <span class="tab__count">${a}</span>
6289
6637
  </button>
6290
6638
  </div>
6291
6639
 
6292
6640
  <div class="stats-bar">
6293
6641
  <div class="stat">
6294
- <span class="stat__icon">📜</span>
6295
6642
  <span class="stat__value">${e}</span>
6296
6643
  <span>scripts</span>
6297
6644
  </div>
6298
6645
  <div class="stat">
6299
- <span class="stat__icon">📊</span>
6300
- <span class="stat__value">${a}</span>
6646
+ <span class="stat__value">${i}</span>
6301
6647
  <span>pixels</span>
6302
6648
  </div>
6303
6649
  <div class="stat">
6304
- <span class="stat__icon">🧩</span>
6305
- <span class="stat__value">${i}</span>
6650
+ <span class="stat__value">${s}</span>
6306
6651
  <span>blocks</span>
6307
6652
  </div>
6308
6653
  <div class="stat">
6309
- <span class="stat__icon">🔌</span>
6310
- <span class="stat__value">${s}</span>
6654
+ <span class="stat__value">${a}</span>
6311
6655
  <span>embeds</span>
6312
6656
  </div>
6313
- <button class="btn btn--sm" @click=${()=>this._refresh()}>🔄 Refresh</button>
6657
+ <button class="btn btn--sm" @click=${()=>this._refresh()}>Refresh</button>
6314
6658
  <button class="btn-export" @click=${()=>this._exportApps()}>📥 Export</button>
6315
6659
  </div>
6316
6660
 
@@ -6334,7 +6678,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
6334
6678
  ${t.map(t=>this._renderItem(t))}
6335
6679
  </div>
6336
6680
  `}
6337
- `}};__publicField(Ft,"properties",{appBlocks:{type:Array,state:!0},scripts:{type:Array,state:!0},appEmbeds:{type:Array,state:!0},pixelScripts:{type:Array,state:!0},activeTab:{type:String,state:!0},searchTerm:{type:String,state:!0}}),__publicField(Ft,"styles",[pt,r`
6681
+ `}};__publicField(ja,"properties",{appBlocks:{type:Array,state:!0},scripts:{type:Array,state:!0},appEmbeds:{type:Array,state:!0},pixelScripts:{type:Array,state:!0},activeTab:{type:String,state:!0},searchTerm:{type:String,state:!0}}),__publicField(ja,"styles",[pt,n`
6338
6682
  :host {
6339
6683
  display: block;
6340
6684
  padding: 12px;
@@ -6736,11 +7080,10 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
6736
7080
  .vendor-icon--pinterest { background: #e60023; color: white; }
6737
7081
  .vendor-icon--hotjar { background: #fd3a5c; color: white; }
6738
7082
  .vendor-icon--unknown { background: var(--tdt-bg-secondary); color: var(--tdt-text-muted); }
6739
- `]),__publicField(Ft,"KNOWN_APPS",{klaviyo:{name:"Klaviyo",icon:"K",patterns:["klaviyo","klviyo"]},judgeme:{name:"Judge.me",icon:"J",patterns:["judge.me","judgeme"]},yotpo:{name:"Yotpo",icon:"Y",patterns:["yotpo"]},loox:{name:"Loox",icon:"L",patterns:["loox"]},stamped:{name:"Stamped",icon:"S",patterns:["stamped"]},okendo:{name:"Okendo",icon:"O",patterns:["okendo"]},"reviews-io":{name:"Reviews.io",icon:"R",patterns:["reviews.io","reviewsio"]},trustpilot:{name:"Trustpilot",icon:"T",patterns:["trustpilot"]},bazaarvoice:{name:"Bazaarvoice",icon:"B",patterns:["bazaarvoice","bvapi"]},recharge:{name:"ReCharge",icon:"R",patterns:["recharge","rechargepayments"]},bold:{name:"Bold",icon:"B",patterns:["boldapps","boldcommerce"]},afterpay:{name:"Afterpay",icon:"A",patterns:["afterpay","portal.afterpay"]},klarna:{name:"Klarna",icon:"K",patterns:["klarna"]},affirm:{name:"Affirm",icon:"A",patterns:["affirm"]},sezzle:{name:"Sezzle",icon:"S",patterns:["sezzle"]},clearpay:{name:"Clearpay",icon:"C",patterns:["clearpay"]},zip:{name:"Zip",icon:"Z",patterns:["quadpay","zip.co"]},paypal:{name:"PayPal",icon:"P",patterns:["paypal","paypalobjects"]},stripe:{name:"Stripe",icon:"S",patterns:["stripe.com","js.stripe"]},privy:{name:"Privy",icon:"P",patterns:["privy"]},omnisend:{name:"Omnisend",icon:"O",patterns:["omnisend"]},mailchimp:{name:"Mailchimp",icon:"M",patterns:["mailchimp","chimpstatic"]},drip:{name:"Drip",icon:"D",patterns:["getdrip","drip.com"]},attentive:{name:"Attentive",icon:"A",patterns:["attentive","attn.tv"]},postscript:{name:"Postscript",icon:"P",patterns:["postscript"]},sendlane:{name:"Sendlane",icon:"S",patterns:["sendlane"]},retention:{name:"Retention.com",icon:"R",patterns:["retention.com"]},smile:{name:"Smile.io",icon:"S",patterns:["smile.io","smileio"]},loyaltylion:{name:"LoyaltyLion",icon:"L",patterns:["loyaltylion"]},"yotpo-loyalty":{name:"Yotpo Loyalty",icon:"Y",patterns:["yotpo-loyalty","swell.is"]},"rise-ai":{name:"Rise.ai",icon:"R",patterns:["rise.ai","riseai"]},gorgias:{name:"Gorgias",icon:"G",patterns:["gorgias"]},zendesk:{name:"Zendesk",icon:"Z",patterns:["zendesk","zopim"]},tidio:{name:"Tidio",icon:"T",patterns:["tidio"]},intercom:{name:"Intercom",icon:"I",patterns:["intercom"]},freshdesk:{name:"Freshdesk",icon:"F",patterns:["freshdesk","freshchat"]},livechat:{name:"LiveChat",icon:"L",patterns:["livechat","livechatinc"]},crisp:{name:"Crisp",icon:"C",patterns:["crisp.chat"]},drift:{name:"Drift",icon:"D",patterns:["drift.com","driftt"]},reamaze:{name:"Reamaze",icon:"R",patterns:["reamaze"]},hotjar:{name:"Hotjar",icon:"H",patterns:["hotjar"]},facebook:{name:"Meta Pixel",icon:"M",patterns:["facebook","fbevents","connect.facebook"]},google:{name:"Google",icon:"G",patterns:["googletagmanager","google-analytics","gtag","gtm.js"]},tiktok:{name:"TikTok",icon:"T",patterns:["tiktok","analytics.tiktok"]},pinterest:{name:"Pinterest",icon:"P",patterns:["pintrk","pinterest"]},snapchat:{name:"Snapchat",icon:"S",patterns:["snapchat","sc-static"]},shopify:{name:"Shopify",icon:"S",patterns:["shopify","cdn.shopify","monorail-edge"]},segment:{name:"Segment",icon:"S",patterns:["segment.com","segment.io"]},heap:{name:"Heap",icon:"H",patterns:["heap-analytics","heapanalytics"]},mixpanel:{name:"Mixpanel",icon:"M",patterns:["mixpanel"]},fullstory:{name:"FullStory",icon:"F",patterns:["fullstory"]},"lucky-orange":{name:"Lucky Orange",icon:"L",patterns:["luckyorange"]},clarity:{name:"Microsoft Clarity",icon:"C",patterns:["clarity.ms"]},reddit:{name:"Reddit Pixel",icon:"R",patterns:["redditmedia","reddit.com/pixel"]},twitter:{name:"Twitter Pixel",icon:"T",patterns:["static.ads-twitter","analytics.twitter"]},criteo:{name:"Criteo",icon:"C",patterns:["criteo"]},taboola:{name:"Taboola",icon:"T",patterns:["taboola"]},pagefly:{name:"PageFly",icon:"P",patterns:["pagefly"]},shogun:{name:"Shogun",icon:"S",patterns:["getshogun","shogun"]},gempage:{name:"GemPages",icon:"G",patterns:["gempages"]},zipify:{name:"Zipify",icon:"Z",patterns:["zipify"]},rebuy:{name:"Rebuy",icon:"R",patterns:["rebuyengine","rebuy"]},"recom-ai":{name:"Recom.ai",icon:"R",patterns:["recom.ai"]},"frequently-bought":{name:"Frequently Bought",icon:"F",patterns:["frequently-bought","also-bought"]},honeycomb:{name:"Honeycomb",icon:"H",patterns:["honeycomb-upsell"]},"candy-rack":{name:"Candy Rack",icon:"C",patterns:["candy-rack","candyrack"]},reconvert:{name:"ReConvert",icon:"R",patterns:["reconvert"]},shipstation:{name:"ShipStation",icon:"S",patterns:["shipstation"]},shippo:{name:"Shippo",icon:"S",patterns:["goshippo"]},easyship:{name:"Easyship",icon:"E",patterns:["easyship"]},aftership:{name:"AfterShip",icon:"A",patterns:["aftership"]},route:{name:"Route",icon:"R",patterns:["route.com","routeapp"]},justuno:{name:"Justuno",icon:"J",patterns:["justuno"]},optinmonster:{name:"OptinMonster",icon:"O",patterns:["optinmonster"]},wisepops:{name:"Wisepops",icon:"W",patterns:["wisepops"]},wheelio:{name:"Wheelio",icon:"W",patterns:["wheelio"]},"spin-a-sale":{name:"Spin-a-Sale",icon:"S",patterns:["spin-a-sale","spinasale"]},fomo:{name:"Fomo",icon:"F",patterns:["fomo.com","usefomo"]},nudgify:{name:"Nudgify",icon:"N",patterns:["nudgify"]},proof:{name:"Proof",icon:"P",patterns:["useproof"]},fera:{name:"Fera",icon:"F",patterns:["fera.ai"]},searchspring:{name:"Searchspring",icon:"S",patterns:["searchspring"]},algolia:{name:"Algolia",icon:"A",patterns:["algolia"]},"boost-commerce":{name:"Boost Commerce",icon:"B",patterns:["boost-commerce","boostcommerce"]},klevu:{name:"Klevu",icon:"K",patterns:["klevu"]},elfsight:{name:"Elfsight",icon:"E",patterns:["elfsight","static.elfsight"]},instafeed:{name:"Instafeed",icon:"I",patterns:["instafeed"]},beeketing:{name:"Beeketing",icon:"B",patterns:["beeketing"]},vitals:{name:"Vitals",icon:"V",patterns:["vitals.co","vitalsapp"]},hextom:{name:"Hextom",icon:"H",patterns:["hextom"]},"cart-upsell":{name:"Cart Upsell",icon:"C",patterns:["incart-upsell"]}});let Dt=Ft;customElements.define("tdt-apps-panel",Dt);const qt=class t extends nt{constructor(){super(),this.settings=_t.getAll(),this.isRecordingShortcut=!1,this.tempShortcut=null,this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=_t.subscribe(()=>{this.settings=_t.getAll()})}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribe&&this._unsubscribe(),this._stopRecordingShortcut()}_handleThemeChange(t){_t.set("theme",t),this._dispatchSettingsChanged()}_handleFontSizeChange(t){_t.set("fontSize",t),this._dispatchSettingsChanged()}_handlePersistenceChange(){const t=!this.settings.persistAcrossSessions;_t.set("persistAcrossSessions",t)}_handleDefaultTabChange(t){_t.set("defaultTab",t),this._dispatchSettingsChanged()}_handlePanelHeightChange(t){_t.set("panelHeight",t),this._dispatchSettingsChanged()}_handlePanelPositionChange(t){_t.set("panelPosition",t),this._dispatchSettingsChanged()}_startRecordingShortcut(){this.isRecordingShortcut=!0,this.tempShortcut=null,this._recordingHandler=t=>{t.preventDefault(),t.stopPropagation(),["Control","Shift","Alt","Meta"].includes(t.key)||(this.tempShortcut={key:t.key.toUpperCase(),ctrl:t.ctrlKey,shift:t.shiftKey,alt:t.altKey,meta:t.metaKey},_t.set("keyboardShortcut",this.tempShortcut),this._stopRecordingShortcut(),this._dispatchSettingsChanged())},document.addEventListener("keydown",this._recordingHandler,{capture:!0})}_stopRecordingShortcut(){this.isRecordingShortcut=!1,this._recordingHandler&&(document.removeEventListener("keydown",this._recordingHandler,{capture:!0}),this._recordingHandler=null)}_cancelRecordingShortcut(){this.tempShortcut=null,this._stopRecordingShortcut()}_resetShortcut(){_t.set("keyboardShortcut",ft.keyboardShortcut),this._dispatchSettingsChanged()}_resetAllSettings(){confirm("Reset all settings to defaults? This cannot be undone.")&&(_t.reset(),this._dispatchSettingsChanged())}_dispatchSettingsChanged(){this.dispatchEvent(new CustomEvent("settings-changed",{bubbles:!0,composed:!0}))}_formatShortcutKey(t){const e=navigator.platform.toUpperCase().indexOf("MAC")>=0,a=[];return t.ctrl&&a.push(e?"⌃":"Ctrl"),t.meta&&a.push(e?"⌘":"Win"),t.alt&&a.push(e?"⌥":"Alt"),t.shift&&a.push(e?"⇧":"Shift"),{modifiers:a,key:t.key}}render(){const{modifiers:e,key:a}=this._formatShortcutKey(this.settings.keyboardShortcut);return U`
7083
+ `]),__publicField(ja,"KNOWN_APPS",{klaviyo:{name:"Klaviyo",icon:"K",patterns:["klaviyo","klviyo"]},judgeme:{name:"Judge.me",icon:"J",patterns:["judge.me","judgeme"]},yotpo:{name:"Yotpo",icon:"Y",patterns:["yotpo"]},loox:{name:"Loox",icon:"L",patterns:["loox"]},stamped:{name:"Stamped",icon:"S",patterns:["stamped"]},okendo:{name:"Okendo",icon:"O",patterns:["okendo"]},"reviews-io":{name:"Reviews.io",icon:"R",patterns:["reviews.io","reviewsio"]},trustpilot:{name:"Trustpilot",icon:"T",patterns:["trustpilot"]},bazaarvoice:{name:"Bazaarvoice",icon:"B",patterns:["bazaarvoice","bvapi"]},recharge:{name:"ReCharge",icon:"R",patterns:["recharge","rechargepayments"]},bold:{name:"Bold",icon:"B",patterns:["boldapps","boldcommerce"]},afterpay:{name:"Afterpay",icon:"A",patterns:["afterpay","portal.afterpay"]},klarna:{name:"Klarna",icon:"K",patterns:["klarna"]},affirm:{name:"Affirm",icon:"A",patterns:["affirm"]},sezzle:{name:"Sezzle",icon:"S",patterns:["sezzle"]},clearpay:{name:"Clearpay",icon:"C",patterns:["clearpay"]},zip:{name:"Zip",icon:"Z",patterns:["quadpay","zip.co"]},paypal:{name:"PayPal",icon:"P",patterns:["paypal","paypalobjects"]},stripe:{name:"Stripe",icon:"S",patterns:["stripe.com","js.stripe"]},privy:{name:"Privy",icon:"P",patterns:["privy"]},omnisend:{name:"Omnisend",icon:"O",patterns:["omnisend"]},mailchimp:{name:"Mailchimp",icon:"M",patterns:["mailchimp","chimpstatic"]},drip:{name:"Drip",icon:"D",patterns:["getdrip","drip.com"]},attentive:{name:"Attentive",icon:"A",patterns:["attentive","attn.tv"]},postscript:{name:"Postscript",icon:"P",patterns:["postscript"]},sendlane:{name:"Sendlane",icon:"S",patterns:["sendlane"]},retention:{name:"Retention.com",icon:"R",patterns:["retention.com"]},smile:{name:"Smile.io",icon:"S",patterns:["smile.io","smileio"]},loyaltylion:{name:"LoyaltyLion",icon:"L",patterns:["loyaltylion"]},"yotpo-loyalty":{name:"Yotpo Loyalty",icon:"Y",patterns:["yotpo-loyalty","swell.is"]},"rise-ai":{name:"Rise.ai",icon:"R",patterns:["rise.ai","riseai"]},gorgias:{name:"Gorgias",icon:"G",patterns:["gorgias"]},zendesk:{name:"Zendesk",icon:"Z",patterns:["zendesk","zopim"]},tidio:{name:"Tidio",icon:"T",patterns:["tidio"]},intercom:{name:"Intercom",icon:"I",patterns:["intercom"]},freshdesk:{name:"Freshdesk",icon:"F",patterns:["freshdesk","freshchat"]},livechat:{name:"LiveChat",icon:"L",patterns:["livechat","livechatinc"]},crisp:{name:"Crisp",icon:"C",patterns:["crisp.chat"]},drift:{name:"Drift",icon:"D",patterns:["drift.com","driftt"]},reamaze:{name:"Reamaze",icon:"R",patterns:["reamaze"]},hotjar:{name:"Hotjar",icon:"H",patterns:["hotjar"]},facebook:{name:"Meta Pixel",icon:"M",patterns:["facebook","fbevents","connect.facebook"]},google:{name:"Google",icon:"G",patterns:["googletagmanager","google-analytics","gtag","gtm.js"]},tiktok:{name:"TikTok",icon:"T",patterns:["tiktok","analytics.tiktok"]},pinterest:{name:"Pinterest",icon:"P",patterns:["pintrk","pinterest"]},snapchat:{name:"Snapchat",icon:"S",patterns:["snapchat","sc-static"]},shopify:{name:"Shopify",icon:"S",patterns:["shopify","cdn.shopify","monorail-edge"]},segment:{name:"Segment",icon:"S",patterns:["segment.com","segment.io"]},heap:{name:"Heap",icon:"H",patterns:["heap-analytics","heapanalytics"]},mixpanel:{name:"Mixpanel",icon:"M",patterns:["mixpanel"]},fullstory:{name:"FullStory",icon:"F",patterns:["fullstory"]},"lucky-orange":{name:"Lucky Orange",icon:"L",patterns:["luckyorange"]},clarity:{name:"Microsoft Clarity",icon:"C",patterns:["clarity.ms"]},reddit:{name:"Reddit Pixel",icon:"R",patterns:["redditmedia","reddit.com/pixel"]},twitter:{name:"Twitter Pixel",icon:"T",patterns:["static.ads-twitter","analytics.twitter"]},criteo:{name:"Criteo",icon:"C",patterns:["criteo"]},taboola:{name:"Taboola",icon:"T",patterns:["taboola"]},pagefly:{name:"PageFly",icon:"P",patterns:["pagefly"]},shogun:{name:"Shogun",icon:"S",patterns:["getshogun","shogun"]},gempage:{name:"GemPages",icon:"G",patterns:["gempages"]},zipify:{name:"Zipify",icon:"Z",patterns:["zipify"]},rebuy:{name:"Rebuy",icon:"R",patterns:["rebuyengine","rebuy"]},"recom-ai":{name:"Recom.ai",icon:"R",patterns:["recom.ai"]},"frequently-bought":{name:"Frequently Bought",icon:"F",patterns:["frequently-bought","also-bought"]},honeycomb:{name:"Honeycomb",icon:"H",patterns:["honeycomb-upsell"]},"candy-rack":{name:"Candy Rack",icon:"C",patterns:["candy-rack","candyrack"]},reconvert:{name:"ReConvert",icon:"R",patterns:["reconvert"]},shipstation:{name:"ShipStation",icon:"S",patterns:["shipstation"]},shippo:{name:"Shippo",icon:"S",patterns:["goshippo"]},easyship:{name:"Easyship",icon:"E",patterns:["easyship"]},aftership:{name:"AfterShip",icon:"A",patterns:["aftership"]},route:{name:"Route",icon:"R",patterns:["route.com","routeapp"]},justuno:{name:"Justuno",icon:"J",patterns:["justuno"]},optinmonster:{name:"OptinMonster",icon:"O",patterns:["optinmonster"]},wisepops:{name:"Wisepops",icon:"W",patterns:["wisepops"]},wheelio:{name:"Wheelio",icon:"W",patterns:["wheelio"]},"spin-a-sale":{name:"Spin-a-Sale",icon:"S",patterns:["spin-a-sale","spinasale"]},fomo:{name:"Fomo",icon:"F",patterns:["fomo.com","usefomo"]},nudgify:{name:"Nudgify",icon:"N",patterns:["nudgify"]},proof:{name:"Proof",icon:"P",patterns:["useproof"]},fera:{name:"Fera",icon:"F",patterns:["fera.ai"]},searchspring:{name:"Searchspring",icon:"S",patterns:["searchspring"]},algolia:{name:"Algolia",icon:"A",patterns:["algolia"]},"boost-commerce":{name:"Boost Commerce",icon:"B",patterns:["boost-commerce","boostcommerce"]},klevu:{name:"Klevu",icon:"K",patterns:["klevu"]},elfsight:{name:"Elfsight",icon:"E",patterns:["elfsight","static.elfsight"]},instafeed:{name:"Instafeed",icon:"I",patterns:["instafeed"]},beeketing:{name:"Beeketing",icon:"B",patterns:["beeketing"]},vitals:{name:"Vitals",icon:"V",patterns:["vitals.co","vitalsapp"]},hextom:{name:"Hextom",icon:"H",patterns:["hextom"]},"cart-upsell":{name:"Cart Upsell",icon:"C",patterns:["incart-upsell"]}});let Pa=ja;customElements.define("tdt-apps-panel",Pa);const Fa=class t extends ot{constructor(){super(),this.settings=_t.getAll(),this.isRecordingShortcut=!1,this.tempShortcut=null,this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=_t.subscribe(()=>{this.settings=_t.getAll()})}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribe&&this._unsubscribe(),this._stopRecordingShortcut()}_handleThemeChange(t){_t.set("theme",t),this._dispatchSettingsChanged()}_handleFontSizeChange(t){_t.set("fontSize",t),this._dispatchSettingsChanged()}_handlePersistenceChange(){const t=!this.settings.persistAcrossSessions;_t.set("persistAcrossSessions",t)}_handleDefaultTabChange(t){_t.set("defaultTab",t),this._dispatchSettingsChanged()}_handlePanelHeightChange(t){_t.set("panelHeight",t),this._dispatchSettingsChanged()}_handlePanelPositionChange(t){_t.set("panelPosition",t),this._dispatchSettingsChanged()}_startRecordingShortcut(){this.isRecordingShortcut=!0,this.tempShortcut=null,this._recordingHandler=t=>{t.preventDefault(),t.stopPropagation(),["Control","Shift","Alt","Meta"].includes(t.key)||(this.tempShortcut={key:t.key.toUpperCase(),ctrl:t.ctrlKey,shift:t.shiftKey,alt:t.altKey,meta:t.metaKey},_t.set("keyboardShortcut",this.tempShortcut),this._stopRecordingShortcut(),this._dispatchSettingsChanged())},document.addEventListener("keydown",this._recordingHandler,{capture:!0})}_stopRecordingShortcut(){this.isRecordingShortcut=!1,this._recordingHandler&&(document.removeEventListener("keydown",this._recordingHandler,{capture:!0}),this._recordingHandler=null)}_cancelRecordingShortcut(){this.tempShortcut=null,this._stopRecordingShortcut()}_resetShortcut(){_t.set("keyboardShortcut",yt.keyboardShortcut),this._dispatchSettingsChanged()}_resetAllSettings(){confirm("Reset all settings to defaults? This cannot be undone.")&&(_t.reset(),this._dispatchSettingsChanged())}_dispatchSettingsChanged(){this.dispatchEvent(new CustomEvent("settings-changed",{bubbles:!0,composed:!0}))}_formatShortcutKey(t){const e=navigator.platform.toUpperCase().indexOf("MAC")>=0,i=[];return t.ctrl&&i.push(e?"⌃":"Ctrl"),t.meta&&i.push(e?"⌘":"Win"),t.alt&&i.push(e?"⌥":"Alt"),t.shift&&i.push(e?"⇧":"Shift"),{modifiers:i,key:t.key}}render(){const{modifiers:e,key:i}=this._formatShortcutKey(this.settings.keyboardShortcut);return U`
6740
7084
  <div class="settings-container">
6741
7085
  <div class="section">
6742
7086
  <div class="section-title">
6743
- <span class="section-title__icon">🎨</span>
6744
7087
  Appearance
6745
7088
  </div>
6746
7089
 
@@ -6826,7 +7169,6 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
6826
7169
 
6827
7170
  <div class="section">
6828
7171
  <div class="section-title">
6829
- <span class="section-title__icon">📐</span>
6830
7172
  Panel
6831
7173
  </div>
6832
7174
 
@@ -6865,6 +7207,10 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
6865
7207
  class="height-option ${"60"===this.settings.panelHeight?"height-option--active":""}"
6866
7208
  @click=${()=>this._handlePanelHeightChange("60")}
6867
7209
  >60%</span>
7210
+ <span
7211
+ class="height-option ${"70"===this.settings.panelHeight?"height-option--active":""}"
7212
+ @click=${()=>this._handlePanelHeightChange("70")}
7213
+ >70%</span>
6868
7214
  </div>
6869
7215
  </div>
6870
7216
  <div class="setting-control">
@@ -6876,6 +7222,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
6876
7222
  <option value="40">40% (Compact)</option>
6877
7223
  <option value="50">50% (Default)</option>
6878
7224
  <option value="60">60% (Tall)</option>
7225
+ <option value="70">70% (Taller)</option>
6879
7226
  </select>
6880
7227
  </div>
6881
7228
  </div>
@@ -6920,7 +7267,6 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
6920
7267
 
6921
7268
  <div class="section">
6922
7269
  <div class="section-title">
6923
- <span class="section-title__icon">💾</span>
6924
7270
  Storage
6925
7271
  </div>
6926
7272
 
@@ -6944,7 +7290,6 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
6944
7290
 
6945
7291
  <div class="section">
6946
7292
  <div class="section-title">
6947
- <span class="section-title__icon">⌨️</span>
6948
7293
  Keyboard Shortcut
6949
7294
  </div>
6950
7295
 
@@ -6963,7 +7308,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
6963
7308
  <span class="key key--recording">...</span>
6964
7309
  `:U`
6965
7310
  ${e.map(t=>U`<span class="key">${t}</span>`)}
6966
- <span class="key">${a}</span>
7311
+ <span class="key">${i}</span>
6967
7312
  `}
6968
7313
  </div>
6969
7314
  ${this.isRecordingShortcut?U`
@@ -6993,7 +7338,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
6993
7338
  </button>
6994
7339
  </div>
6995
7340
  </div>
6996
- `}};__publicField(qt,"properties",{settings:{type:Object,state:!0},isRecordingShortcut:{type:Boolean,state:!0},tempShortcut:{type:Object,state:!0}}),__publicField(qt,"AVAILABLE_TABS",[{id:"objects",label:"Objects"},{id:"metafields",label:"Metafields"},{id:"cart",label:"Cart"},{id:"locale",label:"Locale"},{id:"analytics",label:"Analytics"},{id:"seo",label:"SEO"},{id:"apps",label:"Apps"},{id:"console",label:"Console"},{id:"cookies",label:"Cookies"},{id:"storage",label:"Storage"},{id:"info",label:"Info"}]),__publicField(qt,"styles",[pt,r`
7341
+ `}};__publicField(Fa,"properties",{settings:{type:Object,state:!0},isRecordingShortcut:{type:Boolean,state:!0},tempShortcut:{type:Object,state:!0}}),__publicField(Fa,"AVAILABLE_TABS",[{id:"objects",label:"Objects"},{id:"metafields",label:"Metafields"},{id:"cart",label:"Cart"},{id:"locale",label:"Locale"},{id:"analytics",label:"Analytics"},{id:"seo",label:"SEO"},{id:"apps",label:"Apps"},{id:"console",label:"Console"},{id:"cookies",label:"Cookies"},{id:"storage",label:"Storage"},{id:"info",label:"Info"}]),__publicField(Fa,"styles",[pt,n`
6997
7342
  :host {
6998
7343
  display: block;
6999
7344
  padding: 16px;
@@ -7021,10 +7366,6 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
7021
7366
  gap: 8px;
7022
7367
  }
7023
7368
 
7024
- .section-title__icon {
7025
- font-size: calc(14px * var(--tdt-scale, 1));
7026
- }
7027
-
7028
7369
  .setting-row {
7029
7370
  display: flex;
7030
7371
  align-items: flex-start;
@@ -7408,10 +7749,10 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
7408
7749
  border-color: var(--tdt-accent);
7409
7750
  color: var(--tdt-accent);
7410
7751
  }
7411
- `]);let Mt=qt;customElements.define("tdt-preferences-panel",Mt);const Ht=class t extends nt{constructor(){super(),this.isCollapsed=!1,this.activeTab=_t.get("defaultTab")||"objects",this.context=null,this.cart=null,this._unsubscribeCart=null,this._unsubscribeSettings=null,this.tabOrder=null,this.draggedTab=null,this.dragOverTab=null,this.showAdminDropdown=!1,this.panelPosition=_t.get("panelPosition")||"bottom",this.panelHeight=_t.get("panelHeight")||"50",this.isDraggingPanel=!1,this._loadFloatingPosition()}_loadFloatingPosition(){try{const t=localStorage.getItem("tdt-floating-position");if(t){const{x:e,y:a,width:i,height:s}=JSON.parse(t);this.floatingX=e,this.floatingY=a,this.floatingWidth=i||700,this.floatingHeight=s||null}else this.floatingX=window.innerWidth-720,this.floatingY=window.innerHeight-400,this.floatingWidth=700,this.floatingHeight=null}catch{this.floatingX=window.innerWidth-720,this.floatingY=window.innerHeight-400,this.floatingWidth=700,this.floatingHeight=null}}_saveFloatingPosition(){try{localStorage.setItem("tdt-floating-position",JSON.stringify({x:this.floatingX,y:this.floatingY,width:this.floatingWidth,height:this.floatingHeight}))}catch{}}_setupResizeObserver(){this._resizeObserver||(this._resizeObserver=new ResizeObserver(t=>{if("floating"===this.panelPosition&&!this.isCollapsed)for(const e of t){const{width:t,height:a}=e.contentRect;(Math.abs(t-(this.floatingWidth||700))>5||Math.abs(a-(this.floatingHeight||300))>5)&&(this.floatingWidth=t,this.floatingHeight=a,this._saveFloatingPosition())}}))}_observeResize(){var t;if("floating"!==this.panelPosition)return;this._setupResizeObserver();const e=null==(t=this.shadowRoot)?void 0:t.querySelector(".dock");e&&this._resizeObserver&&this._resizeObserver.observe(e)}_disconnectResizeObserver(){this._resizeObserver&&this._resizeObserver.disconnect()}connectedCallback(){super.connectedCallback(),this._init(),this._bindKeyboard(),this._restoreState(),this._applySettings(),this._subscribeToSettings(),this._listenForSystemTheme()}updated(t){super.updated(t),t.has("panelPosition")&&"floating"===this.panelPosition&&this._observeResize(),"floating"!==this.panelPosition||this._resizeObserver||this._observeResize()}disconnectedCallback(){var t;super.disconnectedCallback(),this._unsubscribeCart&&this._unsubscribeCart(),this._unsubscribeSettings&&this._unsubscribeSettings(),this._mediaQueryListener&&(null==(t=this._systemThemeQuery)||t.removeEventListener("change",this._mediaQueryListener)),this._disconnectResizeObserver(),mt.stopPolling(),bt.destroy(),document.removeEventListener("keydown",this._handleKeydown)}_init(){this.context=ut.parse(),this.context?(mt.interceptAjax(),mt.startPolling(3e3),mt.fetch().then(t=>{t&&mt.setCart(t)}),this._unsubscribeCart=mt.subscribe(t=>{this.cart=t}),bt.init()):console.warn("[Theme Devtools] No context available")}_bindKeyboard(){this._handleKeydown=t=>{_t.matchesShortcut(t)&&(t.preventDefault(),this._toggleCollapse())},document.addEventListener("keydown",this._handleKeydown)}_subscribeToSettings(){this._unsubscribeSettings=_t.subscribe((t,e)=>{"theme"!==t&&"fontSize"!==t&&"*"!==t||this._applySettings(),"panelPosition"!==t&&"*"!==t||(this.panelPosition=_t.get("panelPosition")||"bottom"),"panelHeight"!==t&&"*"!==t||(this.panelHeight=_t.get("panelHeight")||"50",this._applyPanelHeight())})}_listenForSystemTheme(){this._systemThemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this._mediaQueryListener=()=>{"system"===_t.get("theme")&&this._applySettings()},this._systemThemeQuery.addEventListener("change",this._mediaQueryListener)}_applySettings(){const t=_t.getAll();let e=t.theme;"system"===e&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");const a=dt[e]||dt.dark,i=ct[t.fontSize]||ct.medium;for(const[s,o]of Object.entries(a))this.style.setProperty(s,o);this.style.setProperty("--tdt-scale",i),this._applyPanelHeight()}_applyPanelHeight(){const t=this.panelHeight||"50";this.style.setProperty("--tdt-panel-height",`${t}vh`)}_restoreState(){"true"===localStorage.getItem("theme-devtools-collapsed")&&(this.isCollapsed=!0);const e=localStorage.getItem("theme-devtools-active-tab"),a=t.DEFAULT_TABS.map(t=>t.id);e&&a.includes(e)&&(this.activeTab=e);const i=localStorage.getItem("theme-devtools-tab-order");if(i)try{const e=JSON.parse(i),a=t.DEFAULT_TABS.map(t=>t.id),s=e.filter(t=>a.includes(t)),o=a.filter(t=>!s.includes(t));this.tabOrder=[...s,...o]}catch{this.tabOrder=t.DEFAULT_TABS.map(t=>t.id)}else this.tabOrder=t.DEFAULT_TABS.map(t=>t.id)}_getOrderedTabs(){return this.tabOrder?this.tabOrder.map(e=>t.DEFAULT_TABS.find(t=>t.id===e)).filter(Boolean):t.DEFAULT_TABS}_handleDragStart(t,e){this.draggedTab=t,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t)}_handleDragOver(t,e){e.preventDefault(),e.dataTransfer.dropEffect="move",t!==this.draggedTab&&(this.dragOverTab=t)}_handleDragLeave(){this.dragOverTab=null}_handleDrop(t,e){if(e.preventDefault(),!this.draggedTab||this.draggedTab===t)return void this._resetDragState();const a=[...this.tabOrder],i=a.indexOf(this.draggedTab),s=a.indexOf(t);a.splice(i,1),a.splice(s,0,this.draggedTab),this.tabOrder=a,localStorage.setItem("theme-devtools-tab-order",JSON.stringify(a)),this._resetDragState()}_handleDragEnd(){this._resetDragState()}_resetDragState(){this.draggedTab=null,this.dragOverTab=null}_resetTabOrder(){this.tabOrder=t.DEFAULT_TABS.map(t=>t.id),localStorage.removeItem("theme-devtools-tab-order")}_handlePanelDragStart(t){if("floating"!==this.panelPosition)return;if(t.target.closest(".dock__btn"))return;t.preventDefault();const e=this.shadowRoot.querySelector(".dock").getBoundingClientRect();this._dragOffsetX=t.clientX-e.left,this._dragOffsetY=t.clientY-e.top,this._dragStartX=t.clientX,this._dragStartY=t.clientY,this._didDrag=!1,this._handlePanelDragMove=this._handlePanelDragMove.bind(this),this._handlePanelDragEnd=this._handlePanelDragEnd.bind(this),document.addEventListener("mousemove",this._handlePanelDragMove),document.addEventListener("mouseup",this._handlePanelDragEnd)}_handlePanelDragMove(t){const e=Math.abs(t.clientX-this._dragStartX),a=Math.abs(t.clientY-this._dragStartY);if((e>5||a>5)&&(this._didDrag=!0,this.isDraggingPanel=!0),!this.isDraggingPanel)return;let i=t.clientX-this._dragOffsetX,s=t.clientY-this._dragOffsetY;const o=this.shadowRoot.querySelector(".dock").getBoundingClientRect();i=Math.max(0,Math.min(i,window.innerWidth-o.width)),s=Math.max(0,Math.min(s,window.innerHeight-o.height)),this.floatingX=i,this.floatingY=s}_handlePanelDragEnd(){document.removeEventListener("mousemove",this._handlePanelDragMove),document.removeEventListener("mouseup",this._handlePanelDragEnd),this._didDrag&&this._saveFloatingPosition(),this.isDraggingPanel=!1,this._didDrag=!1}_handleFloatingHandleClick(t){if(this._didDrag)return t.preventDefault(),void t.stopPropagation();this._toggleCollapse()}async _clearCart(){try{await fetch("/cart/clear.js",{method:"POST"}),this.cart={items:[],item_count:0,total_price:0},this._showActionFeedback("Cart cleared")}catch(t){console.error("Failed to clear cart:",t)}}_forceRefresh(){location.reload(!0)}_toggleDesignMode(){const t=new URL(window.location.href);t.searchParams.has("design_mode")?t.searchParams.delete("design_mode"):t.searchParams.set("design_mode","true"),window.location.href=t.toString()}async _copyPageJSON(){try{const t=JSON.stringify(this.context,null,2);await navigator.clipboard.writeText(t),this._showActionFeedback("JSON copied")}catch(t){console.error("Failed to copy:",t)}}_getShopURL(){return window.location.origin}_getAdminBaseUrl(){return`${this._getShopURL()}/admin`}_toggleAdminDropdown(t){if(null==t||t.stopPropagation(),this.showAdminDropdown=!this.showAdminDropdown,this.showAdminDropdown){const t=()=>{this.showAdminDropdown=!1,document.removeEventListener("click",t)};setTimeout(()=>document.addEventListener("click",t),0)}}_openAdminPage(t){window.open(`${this._getAdminBaseUrl()}${t}`,"_blank"),this.showAdminDropdown=!1}_openThemeEditor(){var t;const{meta:e}=this.context||{},a=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!a)return void window.open(this._getAdminBaseUrl()+"/themes","_blank");const i=window.location.pathname+window.location.search,s=`${this._getAdminBaseUrl()}/themes/${a}/editor?previewPath=${encodeURIComponent(i)}`;window.open(s,"_blank")}_openResourceInAdmin(){var t,e,a,i,s,o;const{meta:r,objects:n}=this.context||{},l=null==(t=null==r?void 0:r.request)?void 0:t.page_type;"product"===l&&(null==(e=null==n?void 0:n.product)?void 0:e.id)?this._openAdminPage(`/products/${n.product.id}`):"collection"===l&&(null==(a=null==n?void 0:n.collection)?void 0:a.id)?this._openAdminPage(`/collections/${n.collection.id}`):"article"===l&&(null==(i=null==n?void 0:n.article)?void 0:i.id)?this._openAdminPage(`/articles/${n.article.id}`):"page"===l&&(null==(s=null==n?void 0:n.page)?void 0:s.id)?this._openAdminPage(`/pages/${n.page.id}`):"blog"===l&&(null==(o=null==n?void 0:n.blog)?void 0:o.id)&&this._openAdminPage(`/blogs/${n.blog.id}`)}_getResourceLabel(){var t,e,a;return{product:"Product",collection:"Collection",article:"Article",page:"Page",blog:"Blog"}[null==(a=null==(e=null==(t=this.context)?void 0:t.meta)?void 0:e.request)?void 0:a.page_type]||null}_clearLocalStorage(){confirm("Clear all localStorage? This may log you out or reset preferences.")&&(localStorage.clear(),this._showActionFeedback("Storage cleared"))}_clearSessionStorage(){sessionStorage.clear(),this._showActionFeedback("Session cleared")}_clearAllCookies(){const t=document.cookie.split(";");0===t.length||1===t.length&&!t[0].trim()?this._showActionFeedback("No cookies to clear"):confirm(`Clear all ${t.filter(t=>t.trim()).length} cookies? This may log you out.`)&&(t.forEach(t=>{const e=t.split("=")[0].trim();e&&(document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`,document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${window.location.hostname}`)}),this._showActionFeedback("Cookies cleared"))}_showActionFeedback(t){const e=document.createElement("div");e.textContent=t,e.style.cssText="\n position: fixed;\n bottom: calc(60vh + 10px);\n left: 50%;\n transform: translateX(-50%);\n background: var(--tdt-success, #22c55e);\n color: white;\n padding: 8px 16px;\n border-radius: 4px;\n font-size: calc(12px * var(--tdt-scale, 1));\n font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;\n z-index: 2147483647;\n animation: fadeOut 2s forwards;\n ";const a=document.createElement("style");a.textContent="\n @keyframes fadeOut {\n 0%, 70% { opacity: 1; }\n 100% { opacity: 0; }\n }\n ",e.appendChild(a),document.body.appendChild(e),setTimeout(()=>e.remove(),2e3)}_toggleCollapse(){this.isCollapsed=!this.isCollapsed,localStorage.setItem("theme-devtools-collapsed",this.isCollapsed)}_setTab(t){this.activeTab=t,localStorage.setItem("theme-devtools-active-tab",t)}_close(){this.remove()}_formatMoney(t){return null==t?"—":`$${(t/100).toFixed(2)}`}render(){var t,e,a,i,s,o,r;if(!this.context)return U``;const{meta:n,objects:l,metafields:d,settings:c,sectionSettings:p,metafieldsSchema:h}=this.context,u={...l,cart:this.cart||l.cart},v=this._getOrderedTabs(),g=`dock--${this.panelPosition||"bottom"}`,m=this.isCollapsed?"▲":"▼";let b="";if("floating"===this.panelPosition){const t=[`left: ${this.floatingX}px`,`top: ${this.floatingY}px`];this.floatingWidth&&t.push(`width: ${this.floatingWidth}px`),this.floatingHeight&&t.push(`height: ${this.floatingHeight}px`),b=t.join("; ")+";"}return U`
7752
+ `]);let Ia=Fa;customElements.define("tdt-preferences-panel",Ia);const Ra=class t extends ot{constructor(){super(),this.isCollapsed=!1,this.activeTab=_t.get("defaultTab")||"objects",this.context=null,this.cart=null,this.product=null,this._unsubscribeCart=null,this._unsubscribeProduct=null,this._unsubscribeSettings=null,this.tabOrder=null,this.draggedTab=null,this.dragOverTab=null,this.showAdminDropdown=!1,this.panelPosition=_t.get("panelPosition")||"bottom",this.panelHeight=_t.get("panelHeight")||"50",this.isDraggingPanel=!1,this._loadFloatingPosition()}_loadFloatingPosition(){try{const t=localStorage.getItem("tdt-floating-position");if(t){const{x:e,y:i,width:s,height:a}=JSON.parse(t);this.floatingX=e,this.floatingY=i,this.floatingWidth=s||700,this.floatingHeight=a||null}else this.floatingX=window.innerWidth-720,this.floatingY=window.innerHeight-400,this.floatingWidth=700,this.floatingHeight=null}catch{this.floatingX=window.innerWidth-720,this.floatingY=window.innerHeight-400,this.floatingWidth=700,this.floatingHeight=null}}_saveFloatingPosition(){try{localStorage.setItem("tdt-floating-position",JSON.stringify({x:this.floatingX,y:this.floatingY,width:this.floatingWidth,height:this.floatingHeight}))}catch{}}_setupResizeObserver(){this._resizeObserver||(this._resizeObserver=new ResizeObserver(t=>{if("floating"===this.panelPosition&&!this.isCollapsed)for(const e of t){const{width:t,height:i}=e.contentRect;(Math.abs(t-(this.floatingWidth||700))>5||Math.abs(i-(this.floatingHeight||300))>5)&&(this.floatingWidth=t,this.floatingHeight=i,this._saveFloatingPosition())}}))}_observeResize(){var t;if("floating"!==this.panelPosition)return;this._setupResizeObserver();const e=null==(t=this.shadowRoot)?void 0:t.querySelector(".dock");e&&this._resizeObserver&&this._resizeObserver.observe(e)}_disconnectResizeObserver(){this._resizeObserver&&this._resizeObserver.disconnect()}connectedCallback(){super.connectedCallback(),this._init(),this._bindKeyboard(),this._restoreState(),this._applySettings(),this._subscribeToSettings(),this._listenForSystemTheme()}updated(t){super.updated(t),t.has("panelPosition")&&"floating"===this.panelPosition&&this._observeResize(),"floating"!==this.panelPosition||this._resizeObserver||this._observeResize()}disconnectedCallback(){var t;super.disconnectedCallback(),this._unsubscribeCart&&this._unsubscribeCart(),this._unsubscribeProduct&&this._unsubscribeProduct(),this._unsubscribeSettings&&this._unsubscribeSettings(),this._mediaQueryListener&&(null==(t=this._systemThemeQuery)||t.removeEventListener("change",this._mediaQueryListener)),this._disconnectResizeObserver(),mt.stopPolling(),bt.destroy(),document.removeEventListener("keydown",this._handleKeydown)}_init(){var t;this.context=ut.parse(),this.context?(mt.interceptAjax(),mt.startPolling(3e3),mt.fetch().then(t=>{t&&mt.setCart(t)}),this._unsubscribeCart=mt.subscribe(t=>{this.cart=t}),(null==(t=this.context.objects)?void 0:t.product)&&(this._unsubscribeProduct=ft.subscribe(t=>{this.product=t}),ft.initialize(this.context.objects.product)),bt.init()):console.warn("[Theme Devtools] No context available")}_bindKeyboard(){this._handleKeydown=t=>{_t.matchesShortcut(t)&&(t.preventDefault(),this._toggleCollapse())},document.addEventListener("keydown",this._handleKeydown)}_subscribeToSettings(){this._unsubscribeSettings=_t.subscribe((t,e)=>{"theme"!==t&&"fontSize"!==t&&"*"!==t||this._applySettings(),"panelPosition"!==t&&"*"!==t||(this.panelPosition=_t.get("panelPosition")||"bottom"),"panelHeight"!==t&&"*"!==t||(this.panelHeight=_t.get("panelHeight")||"50",this._applyPanelHeight())})}_listenForSystemTheme(){this._systemThemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this._mediaQueryListener=()=>{"system"===_t.get("theme")&&this._applySettings()},this._systemThemeQuery.addEventListener("change",this._mediaQueryListener)}_applySettings(){const t=_t.getAll();let e=t.theme;"system"===e&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");const i=ct[e]||ct.dark,s=dt[t.fontSize]||dt.medium;for(const[a,r]of Object.entries(i))this.style.setProperty(a,r);this.style.setProperty("--tdt-scale",s),this._applyPanelHeight()}_applyPanelHeight(){const t=this.panelHeight||"50";this.style.setProperty("--tdt-panel-height",`${t}vh`)}_restoreState(){"true"===localStorage.getItem("theme-devtools-collapsed")&&(this.isCollapsed=!0);const e=localStorage.getItem("theme-devtools-active-tab"),i=t.DEFAULT_TABS.map(t=>t.id);e&&i.includes(e)&&(this.activeTab=e);const s=localStorage.getItem("theme-devtools-tab-order");if(s)try{const e=JSON.parse(s),i=t.DEFAULT_TABS.map(t=>t.id),a=e.filter(t=>i.includes(t)),r=i.filter(t=>!a.includes(t));this.tabOrder=[...a,...r]}catch{this.tabOrder=t.DEFAULT_TABS.map(t=>t.id)}else this.tabOrder=t.DEFAULT_TABS.map(t=>t.id)}_getOrderedTabs(){return this.tabOrder?this.tabOrder.map(e=>t.DEFAULT_TABS.find(t=>t.id===e)).filter(Boolean):t.DEFAULT_TABS}_handleDragStart(t,e){this.draggedTab=t,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t)}_handleDragOver(t,e){e.preventDefault(),e.dataTransfer.dropEffect="move",t!==this.draggedTab&&(this.dragOverTab=t)}_handleDragLeave(){this.dragOverTab=null}_handleDrop(t,e){if(e.preventDefault(),!this.draggedTab||this.draggedTab===t)return void this._resetDragState();const i=[...this.tabOrder],s=i.indexOf(this.draggedTab),a=i.indexOf(t);i.splice(s,1),i.splice(a,0,this.draggedTab),this.tabOrder=i,localStorage.setItem("theme-devtools-tab-order",JSON.stringify(i)),this._resetDragState()}_handleDragEnd(){this._resetDragState()}_resetDragState(){this.draggedTab=null,this.dragOverTab=null}_resetTabOrder(){this.tabOrder=t.DEFAULT_TABS.map(t=>t.id),localStorage.removeItem("theme-devtools-tab-order")}_handlePanelDragStart(t){if("floating"!==this.panelPosition)return;if(t.target.closest(".dock__btn"))return;t.preventDefault();const e=this.shadowRoot.querySelector(".dock").getBoundingClientRect();this._dragOffsetX=t.clientX-e.left,this._dragOffsetY=t.clientY-e.top,this._dragStartX=t.clientX,this._dragStartY=t.clientY,this._didDrag=!1,this._handlePanelDragMove=this._handlePanelDragMove.bind(this),this._handlePanelDragEnd=this._handlePanelDragEnd.bind(this),document.addEventListener("mousemove",this._handlePanelDragMove),document.addEventListener("mouseup",this._handlePanelDragEnd)}_handlePanelDragMove(t){const e=Math.abs(t.clientX-this._dragStartX),i=Math.abs(t.clientY-this._dragStartY);if((e>5||i>5)&&(this._didDrag=!0,this.isDraggingPanel=!0),!this.isDraggingPanel)return;let s=t.clientX-this._dragOffsetX,a=t.clientY-this._dragOffsetY;const r=this.shadowRoot.querySelector(".dock").getBoundingClientRect();s=Math.max(0,Math.min(s,window.innerWidth-r.width)),a=Math.max(0,Math.min(a,window.innerHeight-r.height)),this.floatingX=s,this.floatingY=a}_handlePanelDragEnd(){document.removeEventListener("mousemove",this._handlePanelDragMove),document.removeEventListener("mouseup",this._handlePanelDragEnd),this._didDrag&&this._saveFloatingPosition(),this.isDraggingPanel=!1,this._didDrag=!1}_handleFloatingHandleClick(t){if(this._didDrag)return t.preventDefault(),void t.stopPropagation();this._toggleCollapse()}async _clearCart(){try{await fetch("/cart/clear.js",{method:"POST"}),this.cart={items:[],item_count:0,total_price:0},this._showActionFeedback("Cart cleared")}catch(t){console.error("Failed to clear cart:",t)}}_forceRefresh(){location.reload(!0)}_toggleDesignMode(){const t=new URL(window.location.href);t.searchParams.has("design_mode")?t.searchParams.delete("design_mode"):t.searchParams.set("design_mode","true"),window.location.href=t.toString()}_getShopURL(){return window.location.origin}_getAdminBaseUrl(){return`${this._getShopURL()}/admin`}_toggleAdminDropdown(t){if(null==t||t.stopPropagation(),this.showAdminDropdown=!this.showAdminDropdown,this.showAdminDropdown){const t=()=>{this.showAdminDropdown=!1,document.removeEventListener("click",t)};setTimeout(()=>document.addEventListener("click",t),0)}}_openAdminPage(t){window.open(`${this._getAdminBaseUrl()}${t}`,"_blank"),this.showAdminDropdown=!1}_openThemeEditor(){var t;const{meta:e}=this.context||{},i=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!i)return void window.open(this._getAdminBaseUrl()+"/themes","_blank");const s=window.location.pathname+window.location.search,a=`${this._getAdminBaseUrl()}/themes/${i}/editor?previewPath=${encodeURIComponent(s)}`;window.open(a,"_blank")}_getThemeEditorUrl(){var t;const{meta:e}=this.context||{},i=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!i)return`${this._getAdminBaseUrl()}/themes`;const s=window.location.pathname+window.location.search;return`${this._getAdminBaseUrl()}/themes/${i}/editor?previewPath=${encodeURIComponent(s)}`}async _copyThemeEditorUrl(){try{const t=this._getThemeEditorUrl();await navigator.clipboard.writeText(t),this._showActionFeedback("Editor URL copied")}catch(t){console.error("Failed to copy:",t)}}_getPreviewThemeUrl(){var t;const{meta:e}=this.context||{},i=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!i)return window.location.href;const s=new URL(window.location.href);return s.searchParams.set("preview_theme_id",i),s.toString()}async _copyPreviewThemeUrl(){try{const t=this._getPreviewThemeUrl();await navigator.clipboard.writeText(t),this._showActionFeedback("Preview URL copied")}catch(t){console.error("Failed to copy:",t)}}_openResourceInAdmin(){var t,e,i,s,a,r;const{meta:n,objects:o}=this.context||{},l=null==(t=null==n?void 0:n.request)?void 0:t.page_type;"product"===l&&(null==(e=null==o?void 0:o.product)?void 0:e.id)?this._openAdminPage(`/products/${o.product.id}`):"collection"===l&&(null==(i=null==o?void 0:o.collection)?void 0:i.id)?this._openAdminPage(`/collections/${o.collection.id}`):"article"===l&&(null==(s=null==o?void 0:o.article)?void 0:s.id)?this._openAdminPage(`/articles/${o.article.id}`):"page"===l&&(null==(a=null==o?void 0:o.page)?void 0:a.id)?this._openAdminPage(`/pages/${o.page.id}`):"blog"===l&&(null==(r=null==o?void 0:o.blog)?void 0:r.id)&&this._openAdminPage(`/blogs/${o.blog.id}`)}_getResourceLabel(){var t,e,i;return{product:"Product",collection:"Collection",article:"Article",page:"Page",blog:"Blog"}[null==(i=null==(e=null==(t=this.context)?void 0:t.meta)?void 0:e.request)?void 0:i.page_type]||null}_clearLocalStorage(){confirm("Clear all localStorage? This may log you out or reset preferences.")&&(localStorage.clear(),this._showActionFeedback("Storage cleared"))}_clearSessionStorage(){sessionStorage.clear(),this._showActionFeedback("Session cleared")}_clearAllCookies(){const t=document.cookie.split(";");0===t.length||1===t.length&&!t[0].trim()?this._showActionFeedback("No cookies to clear"):confirm(`Clear all ${t.filter(t=>t.trim()).length} cookies? This may log you out.`)&&(t.forEach(t=>{const e=t.split("=")[0].trim();e&&(document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`,document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${window.location.hostname}`)}),this._showActionFeedback("Cookies cleared"))}_showActionFeedback(t){const e=document.createElement("div");e.textContent=t,e.style.cssText="\n position: fixed;\n bottom: calc(60vh + 10px);\n left: 50%;\n transform: translateX(-50%);\n background: var(--tdt-success, #22c55e);\n color: white;\n padding: 8px 16px;\n border-radius: 4px;\n font-size: calc(12px * var(--tdt-scale, 1));\n font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;\n z-index: 2147483647;\n animation: fadeOut 2s forwards;\n ";const i=document.createElement("style");i.textContent="\n @keyframes fadeOut {\n 0%, 70% { opacity: 1; }\n 100% { opacity: 0; }\n }\n ",e.appendChild(i),document.body.appendChild(e),setTimeout(()=>e.remove(),2e3)}_toggleCollapse(){this.isCollapsed=!this.isCollapsed,localStorage.setItem("theme-devtools-collapsed",this.isCollapsed)}_setTab(t){this.activeTab=t,localStorage.setItem("theme-devtools-active-tab",t)}_close(){this.remove()}_formatMoney(t){return null==t?"—":`$${(t/100).toFixed(2)}`}render(){var t,e,i,s,a,r,n;if(!this.context)return U``;const{meta:o,objects:l,metafields:c,settings:d,sectionSettings:p,metafieldsSchema:h}=this.context,u={...l,cart:this.cart||l.cart,product:this.product||l.product},g=this._getOrderedTabs(),v=`dock--${this.panelPosition||"bottom"}`,m=this.isCollapsed?"▲":"▼";let f="";if("floating"===this.panelPosition){const t=[`left: ${this.floatingX}px`,`top: ${this.floatingY}px`];this.floatingWidth&&t.push(`width: ${this.floatingWidth}px`),this.floatingHeight&&t.push(`height: ${this.floatingHeight}px`),f=t.join("; ")+";"}return U`
7412
7753
  <div
7413
- class="dock ${g} ${this.isCollapsed?"dock--collapsed":""} ${this.isDraggingPanel?"dock--dragging":""}"
7414
- style="${b}"
7754
+ class="dock ${v} ${this.isCollapsed?"dock--collapsed":""} ${this.isDraggingPanel?"dock--dragging":""}"
7755
+ style="${f}"
7415
7756
  >
7416
7757
  <div
7417
7758
  class="dock__handle"
@@ -7420,7 +7761,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
7420
7761
  >
7421
7762
  <div class="dock__title">
7422
7763
  Theme Devtools
7423
- ${(null==(t=n.theme)?void 0:t.name)?U`<span class="dock__theme-name">${n.theme.name}</span>`:""}
7764
+ ${(null==(t=o.theme)?void 0:t.name)?U`<span class="dock__theme-name">${o.theme.name}</span>`:""}
7424
7765
  </div>
7425
7766
  <div class="dock__controls">
7426
7767
  <button class="dock__btn" @click=${t=>{t.stopPropagation(),this._toggleCollapse()}}>
@@ -7432,83 +7773,87 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
7432
7773
 
7433
7774
  <div class="header">
7434
7775
  <div class="header__info">
7435
- <span class="badge badge--${(null==(e=n.theme)?void 0:e.role)||"unknown"}">
7436
- ${(null==(a=n.theme)?void 0:a.role)||"Unknown"}
7776
+ <span class="badge badge--${(null==(e=o.theme)?void 0:e.role)||"unknown"}">
7777
+ ${(null==(i=o.theme)?void 0:i.role)||"Unknown"}
7437
7778
  </span>
7438
7779
  <span class="header__template">
7439
- ${(null==(i=n.template)?void 0:i.name)||"Unknown"}${(null==(s=n.template)?void 0:s.suffix)?`.${n.template.suffix}`:""}
7780
+ ${(null==(s=o.template)?void 0:s.name)||"Unknown"}${(null==(a=o.template)?void 0:a.suffix)?`.${o.template.suffix}`:""}
7440
7781
  </span>
7441
- <span class="header__page-type">${(null==(o=n.request)?void 0:o.page_type)||"—"}</span>
7442
- ${(null==(r=n.request)?void 0:r.design_mode)?U`<span class="badge badge--design">Design Mode</span>`:""}
7782
+ <span class="header__page-type">${(null==(r=o.request)?void 0:r.page_type)||"—"}</span>
7783
+ ${(null==(n=o.request)?void 0:n.design_mode)?U`<span class="badge badge--design">Design Mode</span>`:""}
7443
7784
  </div>
7444
7785
 
7445
7786
  <div class="header__actions">
7446
7787
  <button class="action-btn action-btn--danger" @click=${this._clearCart} title="Clear shopping cart">
7447
- <span class="action-btn__icon">🗑️</span> Clear Cart
7788
+ Clear Cart
7448
7789
  </button>
7449
7790
 
7450
7791
  <button class="action-btn" @click=${this._forceRefresh} title="Hard refresh page">
7451
- <span class="action-btn__icon">🔄</span> Refresh
7792
+ Refresh
7452
7793
  </button>
7453
7794
 
7454
7795
  <div class="actions-divider"></div>
7455
7796
 
7456
- <button class="action-btn" @click=${this._copyPageJSON} title="Copy full page context as JSON">
7457
- <span class="action-btn__icon">📋</span> Copy JSON
7458
- </button>
7459
-
7460
- <button class="action-btn" @click=${this._openThemeEditor} title="Open current page in theme editor">
7461
- <span class="action-btn__icon">🎨</span> Editor
7462
- </button>
7463
-
7464
7797
  <div class="action-dropdown">
7465
7798
  <button class="action-btn" @click=${this._toggleAdminDropdown} title="Open Shopify admin pages">
7466
- <span class="action-btn__icon">⚙️</span> Admin ▾
7799
+ Admin ▾
7467
7800
  </button>
7468
7801
  ${this.showAdminDropdown?U`
7469
7802
  <div class="action-dropdown__menu" @click=${t=>t.stopPropagation()}>
7470
7803
  ${this._getResourceLabel()?U`
7471
7804
  <button class="action-dropdown__item action-dropdown__item--highlight" @click=${this._openResourceInAdmin}>
7472
- 📄 Open ${this._getResourceLabel()} in Admin
7805
+ Open ${this._getResourceLabel()} in Admin
7473
7806
  </button>
7474
7807
  <div class="action-dropdown__divider"></div>
7475
7808
  `:""}
7476
7809
  <button class="action-dropdown__item" @click=${()=>this._openAdminPage("/products?selectedView=all")}>
7477
- 📦 Products
7810
+ Products
7478
7811
  </button>
7479
7812
  <button class="action-dropdown__item" @click=${()=>this._openAdminPage("/collections?selectedView=all")}>
7480
- 📁 Collections
7813
+ Collections
7481
7814
  </button>
7482
7815
  <button class="action-dropdown__item" @click=${()=>this._openAdminPage("/orders")}>
7483
- 🛒 Orders
7816
+ Orders
7484
7817
  </button>
7485
7818
  <button class="action-dropdown__item" @click=${()=>this._openAdminPage("/discounts")}>
7486
- 🏷️ Discounts
7819
+ Discounts
7487
7820
  </button>
7488
7821
  <button class="action-dropdown__item" @click=${()=>this._openAdminPage("/content/metaobjects")}>
7489
- 🗃️ Metaobjects
7822
+ Metaobjects
7490
7823
  </button>
7491
7824
  <div class="action-dropdown__divider"></div>
7492
7825
  <button class="action-dropdown__item" @click=${()=>this._openAdminPage("/customers")}>
7493
- 👥 Customers
7826
+ Customers
7494
7827
  </button>
7495
7828
  <button class="action-dropdown__item" @click=${()=>this._openAdminPage("/settings")}>
7496
- ⚙️ Settings
7829
+ Settings
7497
7830
  </button>
7498
7831
  </div>
7499
7832
  `:""}
7500
7833
  </div>
7501
7834
 
7835
+ <button class="action-btn" @click=${this._openThemeEditor} title="Open current page in theme editor">
7836
+ Editor
7837
+ </button>
7838
+
7839
+ <button class="action-btn" @click=${this._copyThemeEditorUrl} title="Copy theme editor URL">
7840
+ Copy Editor URL
7841
+ </button>
7842
+
7843
+ <button class="action-btn" @click=${this._copyPreviewThemeUrl} title="Copy preview theme URL">
7844
+ Copy Preview URL
7845
+ </button>
7846
+
7502
7847
  <div class="actions-divider"></div>
7503
7848
 
7504
7849
  <button class="action-btn action-btn--danger" @click=${this._clearAllCookies} title="Clear all cookies">
7505
- <span class="action-btn__icon">🍪</span> Clear Cookies
7850
+ Clear Cookies
7506
7851
  </button>
7507
7852
  </div>
7508
7853
  </div>
7509
7854
 
7510
7855
  <div class="tabs">
7511
- ${v.map(t=>U`
7856
+ ${g.map(t=>U`
7512
7857
  <button
7513
7858
  class="tab ${this.activeTab===t.id?"tab--active":""} ${this.draggedTab===t.id?"tab--dragging":""} ${this.dragOverTab===t.id?"tab--drag-over":""}"
7514
7859
  draggable="true"
@@ -7519,7 +7864,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
7519
7864
  @drop=${e=>this._handleDrop(t.id,e)}
7520
7865
  @dragend=${()=>this._handleDragEnd()}
7521
7866
  >
7522
- ${t.icon} ${t.label}
7867
+ ${t.label}
7523
7868
  </button>
7524
7869
  `)}
7525
7870
  </div>
@@ -7532,14 +7877,14 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
7532
7877
 
7533
7878
  <tdt-metafields-panel
7534
7879
  class="panel ${"metafields"===this.activeTab?"panel--active":""}"
7535
- .metafields=${d}
7880
+ .metafields=${c}
7536
7881
  .metafieldsSchema=${h}
7537
7882
  ></tdt-metafields-panel>
7538
7883
 
7539
7884
  <!-- Settings and Sections panels hidden for now
7540
7885
  <tdt-settings-panel
7541
7886
  class="panel ${"settings"===this.activeTab?"panel--active":""}"
7542
- .settings=${c}
7887
+ .settings=${d}
7543
7888
  .sectionSettings=${p}
7544
7889
  ></tdt-settings-panel>
7545
7890
 
@@ -7555,7 +7900,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
7555
7900
 
7556
7901
  <tdt-localization-panel
7557
7902
  class="panel ${"locale"===this.activeTab?"panel--active":""}"
7558
- .meta=${n}
7903
+ .meta=${o}
7559
7904
  ></tdt-localization-panel>
7560
7905
 
7561
7906
  <tdt-analytics-panel
@@ -7570,8 +7915,9 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
7570
7915
  class="panel ${"apps"===this.activeTab?"panel--active":""}"
7571
7916
  ></tdt-apps-panel>
7572
7917
 
7573
- <tdt-console-panel
7918
+ <tdt-console-panel
7574
7919
  class="panel ${"console"===this.activeTab?"panel--active":""}"
7920
+ .context=${this.context}
7575
7921
  ></tdt-console-panel>
7576
7922
 
7577
7923
  <tdt-cookies-panel
@@ -7584,7 +7930,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
7584
7930
 
7585
7931
  <tdt-info-panel
7586
7932
  class="panel ${"info"===this.activeTab?"panel--active":""}"
7587
- .meta=${n}
7933
+ .meta=${o}
7588
7934
  ></tdt-info-panel>
7589
7935
 
7590
7936
  <tdt-preferences-panel
@@ -7593,7 +7939,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
7593
7939
  ></tdt-preferences-panel>
7594
7940
  </div>
7595
7941
  </div>
7596
- `}};__publicField(Ht,"properties",{isCollapsed:{type:Boolean,state:!0},activeTab:{type:String,state:!0},context:{type:Object,state:!0},cart:{type:Object,state:!0},tabOrder:{type:Array,state:!0},draggedTab:{type:String,state:!0},dragOverTab:{type:String,state:!0},showAdminDropdown:{type:Boolean,state:!0},panelPosition:{type:String,state:!0},panelHeight:{type:String,state:!0},floatingX:{type:Number,state:!0},floatingY:{type:Number,state:!0},isDraggingPanel:{type:Boolean,state:!0}}),__publicField(Ht,"DEFAULT_TABS",[{id:"objects",label:"Objects",icon:"📦"},{id:"metafields",label:"Metafields",icon:"🏷️"},{id:"cart",label:"Cart",icon:"🛒"},{id:"locale",label:"Locale",icon:"🌐"},{id:"analytics",label:"Analytics",icon:"📊"},{id:"seo",label:"SEO",icon:"🔍"},{id:"apps",label:"Apps",icon:"🔌"},{id:"console",label:"Console",icon:"📋"},{id:"cookies",label:"Cookies",icon:"🍪"},{id:"storage",label:"Storage",icon:"💾"},{id:"info",label:"Info",icon:"ℹ️"},{id:"preferences",label:"Preferences",icon:"⚙️"}]),__publicField(Ht,"styles",[ht,r`
7942
+ `}};__publicField(Ra,"properties",{isCollapsed:{type:Boolean,state:!0},activeTab:{type:String,state:!0},context:{type:Object,state:!0},cart:{type:Object,state:!0},product:{type:Object,state:!0},tabOrder:{type:Array,state:!0},draggedTab:{type:String,state:!0},dragOverTab:{type:String,state:!0},showAdminDropdown:{type:Boolean,state:!0},panelPosition:{type:String,state:!0},panelHeight:{type:String,state:!0},floatingX:{type:Number,state:!0},floatingY:{type:Number,state:!0},isDraggingPanel:{type:Boolean,state:!0}}),__publicField(Ra,"DEFAULT_TABS",[{id:"objects",label:"Objects"},{id:"metafields",label:"Metafields"},{id:"cart",label:"Cart"},{id:"locale",label:"Locale"},{id:"analytics",label:"Analytics"},{id:"seo",label:"SEO"},{id:"apps",label:"Apps"},{id:"console",label:"Console"},{id:"cookies",label:"Cookies"},{id:"storage",label:"Storage"},{id:"info",label:"Info"},{id:"preferences",label:"Preferences"}]),__publicField(Ra,"styles",[ht,n`
7597
7943
  .dock {
7598
7944
  position: fixed;
7599
7945
  background: var(--tdt-bg);
@@ -7900,4 +8246,4 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
7900
8246
  .panel--active {
7901
8247
  display: block;
7902
8248
  }
7903
- `]);let Ut=Ht;customElements.define("theme-devtools",Ut);function Gt(){const t=document.getElementById("__THEME_DEVTOOLS_ROOT__");if(!t)return void console.warn("[Theme Devtools] Root element not found");const e=document.createElement("theme-devtools");t.appendChild(e),window.__THEME_DEVTOOLS__=e}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Gt):Gt()}();
8249
+ `]);let Na=Ra;customElements.define("theme-devtools",Na);function Da(){const t=document.getElementById("__THEME_DEVTOOLS_ROOT__");if(!t)return void console.warn("[Theme Devtools] Root element not found");const e=document.createElement("theme-devtools");t.appendChild(e),window.__THEME_DEVTOOLS__=e}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Da):Da()}();