builder-settings-types 0.0.149 → 0.0.150

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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let R=(c=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(c|=0));for(;c--;)t+=$[e[c]&63];return t};function S(c){if(c===null||typeof c!="object")return c;if(c instanceof Date)return new Date(c.getTime());if(Array.isArray(c)){const i=[];for(let s=0;s<c.length;s++)i[s]=S(c[s]);return i}const t={};for(const i in c)Object.prototype.hasOwnProperty.call(c,i)&&(t[i]=S(c[i]));const e=Object.getPrototypeOf(c);return e!==Object.prototype&&Object.setPrototypeOf(t,e),t}function j(c){switch(c){case"number":return 0;case"text":return"";case"select":return null;case"color":return"#000000";case"date":return new Date().toISOString().split("T")[0];case"button":return"";default:return""}}class m{constructor(t={}){this.props=t,this.id=t.id||R(),this.value=this.props.default,this.desktop=this.props.default,this.title=t.title||""}destroy(){throw new Error("Method not implemented.")}setOnChange(t){return this.onChange=t,this}setValue(t){this.value=t,this.inputEl&&(this.inputEl.value=String(t)),this.onChange&&this.onChange(t),this.props.detectChange&&this.props.detectChange(t)}clone(){const t=this.constructor,e=S(this.props),i=new t(e);return i.value=S(this.value),i}createInput(t){t={...this.props.inputProps,...t};const e=document.createElement("div");if(e.className=t.wrapperClassName||"",t.title||t.icon){const a=document.createElement("div");if(a.className="icon-container",t.icon){const o=this.createIcon(t.icon,t.iconClassName);a.appendChild(o)}if(t.title){const o=this.createLabel(t.title,t.labelClassName);a.appendChild(o)}e.appendChild(a)}const i=document.createElement("div");i.className=t.wrapperClassName||"";const s=document.createElement("input");this.inputEl=s,s.value=String(t.value||j(t.inputType)),s.type=t.inputType,s.placeholder=t.placeholder||"",s.className=t.inputClassName||"";const n=a=>{const o=a.target;let l=o.value;switch(t.inputType){case"number":l=Number(o.value);break;case"color":l=o.value;break;case"date":l=o.value;break;case"select":l=o.value;break;case"text":l=o.value;break;case"button":l=o.value;break;default:l=o.value}this.value=l,this.onChange&&this.onChange(this.value),this.props.detectChange&&this.props.detectChange(this.value)};return s.addEventListener("input",n),s.addEventListener("change",n),t.inputCustomizer&&t.inputCustomizer(s),i.appendChild(s),e.appendChild(i),e}createLabel(t,e){const i=document.createElement("span");return i.textContent=t,i.className="input-label "+(e||""),i}createIcon(t,e){const i=document.createElement("span");return i.className="input-icon "+(e||""),i.innerHTML=t,i}}function T(c,t){for(const e in c)if(c.hasOwnProperty(e)){const i=c[e];t(e,i)}}const x=class x{constructor(t){this.elementRef=null,this.isHidden=!1,this.custom=!1,this.initialValues={},this.changeTimeout=null,this.isHandlingChange=!1,this.changeHandlers=new Set,this.blurTimeout=null,this.lastValues={},this.lastChangeTime=0,this.CHANGE_DEBOUNCE=100,this.handleBlur=()=>{},this.pendingBlurHandler=null,this.hasFocus=!1,this.focusTrackingEnabled=!1,this.handleFocus=()=>{},this.blurDebounceTime=100,this.lastBlurTime=0,this.isProcessingBlur=!1,this.isInteracting=!1,this.interactionStartTime=0,this.modifiedSettings=new Set,this.activeSettingId=null,this.hasValueChanged=!1,this.handleInteractionStart=e=>{this.isInteracting||(this.isInteracting=!0,this.interactionStartTime=Date.now(),this.modifiedSettings.clear(),console.log(`[${this.title}] Setting interaction started`))},this.handleChange=e=>{if(e.target instanceof HTMLElement){this.hasValueChanged=!0;const i=e.target.closest("[data-setting-id]");if(i){const s=i.getAttribute("data-setting-id");typeof s=="string"&&(this.activeSettingId=s)}}},typeof t.id=="string"&&t.id.trim()!==""?this.id=t.id.trim():this.id=R(),typeof t.title=="string"?this.title=t.title:(this.title="Untitled Setting Group",console.warn(`SettingGroup constructor: Invalid title provided, defaulting to '${this.title}'.`,t)),this.settings=t.settings,typeof t.description=="string"?this.description=t.description:t.description===null||t.description===void 0?this.description=void 0:(this.description=String(t.description),console.warn("SettingGroup constructor: Invalid description type, coercing to string.",t)),this.icon=t.icon,this.isCollapsed=t.collapsed??!1,this.isMain=t.main??!1,this.custom=t.custom??!1,this.hideCondition=t.hideCondition,this.onBlur=t.onBlur,this.blurDebounceTime=t.blurDebounceTime??100,Object.assign(this,t.settings),this.initialValues=this.getValues()}static hide(){this.hiddenElements.forEach(t=>{t&&(t.style.display="none")})}static show(){this.hiddenElements.forEach(t=>{t&&(t.style.display="")})}setOnChange(t){this.onChange=t;const e=()=>{this.isHandlingChange||(this.isHandlingChange=!0,this.changeTimeout&&clearTimeout(this.changeTimeout),this.changeTimeout=setTimeout(()=>{const i=this.getValues(),s=this.calculateChanges(this.initialValues,i);Object.keys(s).length>0&&(this.hasValueChanged=!0,this.lastChangeTime=Date.now(),this.initialValues=i,t(i),this.updateVisibility()),this.isHandlingChange=!1},50))};return this.changeHandlers.clear(),T(this.settings,(i,s)=>{var n;if(s instanceof x)s.setOnChange(a=>{this.hasValueChanged=!0;const o=this.getValues();this.initialValues=o,t(o)}),this.changeHandlers.add(()=>t(this.getValues()));else if(s instanceof m){const a=()=>{this.hasValueChanged=!0,e()};this.changeHandlers.add(a),s.setOnChange(a)}else{const a=()=>{this.hasValueChanged=!0,e()};this.changeHandlers.add(a),(n=s.setOnChange)==null||n.call(s,a)}}),this}setOnBlur(t,e){return this.onBlur=t,this.pendingBlurHandler=t,this.focusTrackingEnabled=!0,e!==void 0&&(this.blurDebounceTime=e),this.handleBlur=i=>{if(!this.hasValueChanged&&!i)return;let n=null;if((i==null?void 0:i.target)instanceof HTMLElement){const a=i.target.closest("[data-setting-id]");if(a){const o=a.getAttribute("data-setting-id");typeof o=="string"&&(n=o)}}this.blurTimeout&&clearTimeout(this.blurTimeout),this.blurTimeout=setTimeout(()=>{try{this.saveChangesImmediately();const a=this.getValues();(this.activeSettingId===null&&n!==null||n===null&&this.activeSettingId!==null||this.activeSettingId!==n||this.hasValueChanged)&&this.onBlur&&(this.onBlur(a||{}),this.hasValueChanged=!1),this.activeSettingId=n}catch(a){console.error("Error in blur handler:",a),this.hasValueChanged=!1,this.activeSettingId=null}},this.blurDebounceTime)},this.elementRef&&this.setupFocusHandlers(),this}hasFocusWithin(){if(!this.elementRef)return!1;const t=document.activeElement;return this.elementRef.contains(t)||this.hasFocus}setupFocusHandlers(){if(!this.elementRef||!this.focusTrackingEnabled)return;this.elementRef.removeEventListener("focusout",this.handleBlur),this.elementRef.removeEventListener("change",this.handleChange),this.elementRef.removeEventListener("input",this.handleChange),this.elementRef.addEventListener("focusout",this.handleBlur),this.elementRef.addEventListener("change",this.handleChange),this.elementRef.addEventListener("input",this.handleChange);const t=this.elementRef.closest("form");t&&(t.removeEventListener("submit",this.handleBlur),t.addEventListener("submit",this.handleBlur)),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.elementRef&&document.activeElement&&this.elementRef.contains(document.activeElement)&&this.handleBlur()})}cleanup(){if(this.changeTimeout&&(clearTimeout(this.changeTimeout),this.changeTimeout=null),this.blurTimeout&&(clearTimeout(this.blurTimeout),this.blurTimeout=null),this.elementRef){this.elementRef.removeEventListener("focusout",this.handleBlur),this.elementRef.removeEventListener("change",this.handleChange),this.elementRef.removeEventListener("input",this.handleChange);const t=this.elementRef.closest("form");t&&t.removeEventListener("submit",this.handleBlur)}document.removeEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.elementRef&&document.activeElement&&this.elementRef.contains(document.activeElement)&&this.handleBlur()}),T(this.settings,(t,e)=>{typeof e.cleanup=="function"&&e.cleanup()}),this.changeHandlers.clear(),this.activeSettingId=null,this.hasValueChanged=!1}clone(){const t={};T(this.settings,(n,a)=>{typeof a.clone=="function"?t[n]=a.clone():(console.warn(`Setting with key '${n}' does not have a clone method. Copying reference.`),t[n]=a)});const e={title:this.title,settings:t,description:this.description,icon:this.icon,collapsed:this.isCollapsed,main:this.isMain,custom:this.custom,hideCondition:this.hideCondition},i=this.constructor,s=new i(e);return s.initialValues=this.getValues(),s}calculateChanges(t,e){const i={};return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const a=t[n],o=e[n];JSON.stringify(a)!==JSON.stringify(o)&&(i[n]={from:a,to:o})}),i}hide(){this.elementRef&&(this.elementRef.style.display="none",this.isHidden=!0)}show(){this.elementRef&&(this.elementRef.style.display="",this.isHidden=!1)}getValues(t){try{if(t===void 0){const e={};for(const i in this.settings)if(this.settings.hasOwnProperty(i)){const s=this.settings[i];if(!s)continue;s instanceof x?e[i]=s.getValues():typeof s.value<"u"&&(e[i]=s.value)}return e}else{const e=this.settings[t];return e?(this.isInteracting&&typeof t=="string"&&this.modifiedSettings.add(t),e instanceof x?e.getValues():typeof e.value<"u"?e.value:void 0):void 0}}catch(e){return console.error("Error in getValues:",e),{}}}draw(){const t=document.createElement("div");t.className="setting-group",t.id=`setting-group-${this.id}`,x.hiddenElements.add(t),this.hideCondition&&this.hideCondition()&&(t.style.display="none"),this.isMain&&t.classList.add("main-group");const e=document.createElement("div");e.className="setting-group-title",this.isCollapsed&&e.classList.add("collapsed-view"),e.setAttribute("role","button"),e.setAttribute("aria-expanded",(!this.isCollapsed).toString()),e.setAttribute("tabindex","0");const i=document.createElement("div");if(i.className="title-section",this.icon){const r=document.createElement("span");r.className="group-icon",r.innerHTML=this.icon,i.appendChild(r)}this.custom&&t.classList.add("custom_class");const s=document.createElement("h3");s.textContent=this.title,i.appendChild(s);const n=document.createElement("div");if(n.className="actions-section",this.description&&this.isCollapsed){const r=document.createElement("span");r.className="info-marker",r.innerHTML=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let R=(c=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(c|=0));for(;c--;)t+=_[e[c]&63];return t};function S(c){if(c===null||typeof c!="object")return c;if(c instanceof Date)return new Date(c.getTime());if(Array.isArray(c)){const i=[];for(let s=0;s<c.length;s++)i[s]=S(c[s]);return i}const t={};for(const i in c)Object.prototype.hasOwnProperty.call(c,i)&&(t[i]=S(c[i]));const e=Object.getPrototypeOf(c);return e!==Object.prototype&&Object.setPrototypeOf(t,e),t}function j(c){switch(c){case"number":return 0;case"text":return"";case"select":return null;case"color":return"#000000";case"date":return new Date().toISOString().split("T")[0];case"button":return"";default:return""}}class m{constructor(t={}){this.props=t,this.id=t.id||R(),this.value=this.props.default,this.desktop=this.props.default,this.title=t.title||""}destroy(){throw new Error("Method not implemented.")}setOnChange(t){return this.onChange=t,this}setValue(t){this.value=t,this.inputEl&&(this.inputEl.value=String(t)),this.onChange&&this.onChange(t),this.props.detectChange&&this.props.detectChange(t)}clone(){const t=this.constructor,e=S(this.props),i=new t(e);return i.value=S(this.value),i}createInput(t){t={...this.props.inputProps,...t};const e=document.createElement("div");if(e.className=t.wrapperClassName||"",t.title||t.icon){const a=document.createElement("div");if(a.className="icon-container",t.icon){const o=this.createIcon(t.icon,t.iconClassName);a.appendChild(o)}if(t.title){const o=this.createLabel(t.title,t.labelClassName);a.appendChild(o)}e.appendChild(a)}const i=document.createElement("div");i.className=t.wrapperClassName||"";const s=document.createElement("input");this.inputEl=s,s.value=String(t.value||j(t.inputType)),s.type=t.inputType,s.placeholder=t.placeholder||"",s.className=t.inputClassName||"";const n=a=>{const o=a.target;let l=o.value;switch(t.inputType){case"number":l=Number(o.value);break;case"color":l=o.value;break;case"date":l=o.value;break;case"select":l=o.value;break;case"text":l=o.value;break;case"button":l=o.value;break;default:l=o.value}this.value=l,this.onChange&&this.onChange(this.value),this.props.detectChange&&this.props.detectChange(this.value)};return s.addEventListener("input",n),s.addEventListener("change",n),t.inputCustomizer&&t.inputCustomizer(s),i.appendChild(s),e.appendChild(i),e}createLabel(t,e){const i=document.createElement("span");return i.textContent=t,i.className="input-label "+(e||""),i}createIcon(t,e){const i=document.createElement("span");return i.className="input-icon "+(e||""),i.innerHTML=t,i}}function T(c,t){for(const e in c)if(c.hasOwnProperty(e)){const i=c[e];t(e,i)}}const x=class x{constructor(t){this.elementRef=null,this.isHidden=!1,this.custom=!1,this.initialValues={},this.changeTimeout=null,this.isHandlingChange=!1,this.changeHandlers=new Set,this.blurTimeout=null,this.lastValues={},this.lastChangeTime=0,this.CHANGE_DEBOUNCE=100,this.handleBlur=()=>{},this.pendingBlurHandler=null,this.hasFocus=!1,this.focusTrackingEnabled=!1,this.handleFocus=()=>{},this.blurDebounceTime=100,this.lastBlurTime=0,this.isProcessingBlur=!1,this.isInteracting=!1,this.interactionStartTime=0,this.modifiedSettings=new Set,this.activeSettingId=null,this.hasValueChanged=!1,this.handleInteractionStart=e=>{this.isInteracting||(this.isInteracting=!0,this.interactionStartTime=Date.now(),this.modifiedSettings.clear(),console.log(`[${this.title}] Setting interaction started`))},this.handleChange=e=>{if(e.target instanceof HTMLElement){this.hasValueChanged=!0;const i=e.target.closest("[data-setting-id]");if(i){const s=i.getAttribute("data-setting-id");typeof s=="string"&&(this.activeSettingId=s)}}},typeof t.id=="string"&&t.id.trim()!==""?this.id=t.id.trim():this.id=R(),typeof t.title=="string"?this.title=t.title:(this.title="Untitled Setting Group",console.warn(`SettingGroup constructor: Invalid title provided, defaulting to '${this.title}'.`,t)),this.settings=t.settings,typeof t.description=="string"?this.description=t.description:t.description===null||t.description===void 0?this.description=void 0:(this.description=String(t.description),console.warn("SettingGroup constructor: Invalid description type, coercing to string.",t)),this.icon=t.icon,this.isCollapsed=t.collapsed??!1,this.isMain=t.main??!1,this.custom=t.custom??!1,this.hideCondition=t.hideCondition,this.onBlur=t.onBlur,this.blurDebounceTime=t.blurDebounceTime??100,Object.assign(this,t.settings),this.initialValues=this.getValues()}static hide(){this.hiddenElements.forEach(t=>{t&&(t.style.display="none")})}static show(){this.hiddenElements.forEach(t=>{t&&(t.style.display="")})}setOnChange(t){this.onChange=t;const e=()=>{this.isHandlingChange||(this.isHandlingChange=!0,this.changeTimeout&&clearTimeout(this.changeTimeout),this.changeTimeout=setTimeout(()=>{const i=this.getValues(),s=this.calculateChanges(this.initialValues,i);Object.keys(s).length>0&&(this.hasValueChanged=!0,this.lastChangeTime=Date.now(),this.initialValues=i,t(i),this.updateVisibility()),this.isHandlingChange=!1},50))};return this.changeHandlers.clear(),T(this.settings,(i,s)=>{var n;if(s instanceof x)s.setOnChange(a=>{this.hasValueChanged=!0;const o=this.getValues();this.initialValues=o,t(o)}),this.changeHandlers.add(()=>t(this.getValues()));else if(s instanceof m){const a=()=>{this.hasValueChanged=!0,e()};this.changeHandlers.add(a),s.setOnChange(a)}else{const a=()=>{this.hasValueChanged=!0,e()};this.changeHandlers.add(a),(n=s.setOnChange)==null||n.call(s,a)}}),this}setOnBlur(t,e){return this.onBlur=t,this.pendingBlurHandler=t,this.focusTrackingEnabled=!0,e!==void 0&&(this.blurDebounceTime=e),this.handleBlur=i=>{if(!this.hasValueChanged&&!i)return;let n=null;if((i==null?void 0:i.target)instanceof HTMLElement){const a=i.target.closest("[data-setting-id]");if(a){const o=a.getAttribute("data-setting-id");typeof o=="string"&&(n=o)}}this.blurTimeout&&clearTimeout(this.blurTimeout),this.blurTimeout=setTimeout(()=>{try{this.saveChangesImmediately();const a=this.getValues();(this.activeSettingId===null&&n!==null||n===null&&this.activeSettingId!==null||this.activeSettingId!==n||this.hasValueChanged)&&this.onBlur&&(this.onBlur(a||{}),this.hasValueChanged=!1),this.activeSettingId=n}catch(a){console.error("Error in blur handler:",a),this.hasValueChanged=!1,this.activeSettingId=null}},this.blurDebounceTime)},this.elementRef&&this.setupFocusHandlers(),this}hasFocusWithin(){if(!this.elementRef)return!1;const t=document.activeElement;return this.elementRef.contains(t)||this.hasFocus}setupFocusHandlers(){if(!this.elementRef||!this.focusTrackingEnabled)return;this.elementRef.removeEventListener("focusout",this.handleBlur),this.elementRef.removeEventListener("change",this.handleChange),this.elementRef.removeEventListener("input",this.handleChange),this.elementRef.addEventListener("focusout",this.handleBlur),this.elementRef.addEventListener("change",this.handleChange),this.elementRef.addEventListener("input",this.handleChange);const t=this.elementRef.closest("form");t&&(t.removeEventListener("submit",this.handleBlur),t.addEventListener("submit",this.handleBlur)),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.elementRef&&document.activeElement&&this.elementRef.contains(document.activeElement)&&this.handleBlur()})}cleanup(){if(this.changeTimeout&&(clearTimeout(this.changeTimeout),this.changeTimeout=null),this.blurTimeout&&(clearTimeout(this.blurTimeout),this.blurTimeout=null),this.elementRef){this.elementRef.removeEventListener("focusout",this.handleBlur),this.elementRef.removeEventListener("change",this.handleChange),this.elementRef.removeEventListener("input",this.handleChange);const t=this.elementRef.closest("form");t&&t.removeEventListener("submit",this.handleBlur)}document.removeEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.elementRef&&document.activeElement&&this.elementRef.contains(document.activeElement)&&this.handleBlur()}),T(this.settings,(t,e)=>{typeof e.cleanup=="function"&&e.cleanup()}),this.changeHandlers.clear(),this.activeSettingId=null,this.hasValueChanged=!1}clone(){const t={};T(this.settings,(n,a)=>{typeof a.clone=="function"?t[n]=a.clone():(console.warn(`Setting with key '${n}' does not have a clone method. Copying reference.`),t[n]=a)});const e={title:this.title,settings:t,description:this.description,icon:this.icon,collapsed:this.isCollapsed,main:this.isMain,custom:this.custom,hideCondition:this.hideCondition},i=this.constructor,s=new i(e);return s.initialValues=this.getValues(),s}calculateChanges(t,e){const i={};return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const a=t[n],o=e[n];JSON.stringify(a)!==JSON.stringify(o)&&(i[n]={from:a,to:o})}),i}hide(){this.elementRef&&(this.elementRef.style.display="none",this.isHidden=!0)}show(){this.elementRef&&(this.elementRef.style.display="",this.isHidden=!1)}getValues(t){try{if(t===void 0){const e={};for(const i in this.settings)if(this.settings.hasOwnProperty(i)){const s=this.settings[i];if(!s)continue;s instanceof x?e[i]=s.getValues():typeof s.value<"u"&&(e[i]=s.value)}return e}else{const e=this.settings[t];return e?(this.isInteracting&&typeof t=="string"&&this.modifiedSettings.add(t),e instanceof x?e.getValues():typeof e.value<"u"?e.value:void 0):void 0}}catch(e){return console.error("Error in getValues:",e),{}}}draw(){const t=document.createElement("div");t.className="setting-group",t.id=`setting-group-${this.id}`,x.hiddenElements.add(t),this.hideCondition&&this.hideCondition()&&(t.style.display="none"),this.isMain&&t.classList.add("main-group");const e=document.createElement("div");e.className="setting-group-title",this.isCollapsed&&e.classList.add("collapsed-view"),e.setAttribute("role","button"),e.setAttribute("aria-expanded",(!this.isCollapsed).toString()),e.setAttribute("tabindex","0");const i=document.createElement("div");if(i.className="title-section",this.icon){const r=document.createElement("span");r.className="group-icon",r.innerHTML=this.icon,i.appendChild(r)}this.custom&&t.classList.add("custom_class");const s=document.createElement("h3");s.textContent=this.title,i.appendChild(s);const n=document.createElement("div");if(n.className="actions-section",this.description&&this.isCollapsed){const r=document.createElement("span");r.className="info-marker",r.innerHTML=`
2
2
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path d="M8 5.33333V8M8 10.6667H8.00667M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z"
4
4
  stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
@@ -7,16 +7,16 @@
7
7
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
8
8
  <path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
9
9
  </svg>
10
- `,this.isCollapsed&&a.classList.add("rotated"),n.appendChild(a);const o=document.createElement("div");if(o.className="setting-group-content",this.isCollapsed&&(o.classList.add("collapsed"),e.classList.add("collapsed-view"),a.classList.add("rotated"),t.classList.add("collapsed")),this.isMain&&o.classList.add("main-content"),this.description&&!this.isCollapsed){const r=document.createElement("div");r.className="setting-group-description",r.textContent=this.description,o.appendChild(r)}const l=()=>{this.isCollapsed=!this.isCollapsed,o.classList.toggle("collapsed"),e.classList.toggle("collapsed-view"),a.classList.toggle("rotated"),t.classList.toggle("collapsed",this.isCollapsed),e.setAttribute("aria-expanded",(!this.isCollapsed).toString());const r=o.querySelector(".setting-group-description"),u=n.querySelector(".info-marker");if(this.description)if(this.isCollapsed){if(r&&r.remove(),!u){const d=document.createElement("span");d.className="info-marker",d.innerHTML=`
10
+ `,this.isCollapsed&&a.classList.add("rotated"),n.appendChild(a);const o=document.createElement("div");if(o.className="setting-group-content",this.isCollapsed&&(o.classList.add("collapsed"),e.classList.add("collapsed-view"),a.classList.add("rotated"),t.classList.add("collapsed")),this.isMain&&o.classList.add("main-content"),this.description&&!this.isCollapsed){const r=document.createElement("div");r.className="setting-group-description",r.textContent=this.description,o.appendChild(r)}const l=()=>{this.isCollapsed=!this.isCollapsed,o.classList.toggle("collapsed"),e.classList.toggle("collapsed-view"),a.classList.toggle("rotated"),t.classList.toggle("collapsed",this.isCollapsed),e.setAttribute("aria-expanded",(!this.isCollapsed).toString());const r=o.querySelector(".setting-group-description"),p=n.querySelector(".info-marker");if(this.description)if(this.isCollapsed){if(r&&r.remove(),!p){const d=document.createElement("span");d.className="info-marker",d.innerHTML=`
11
11
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
12
12
  <path d="M8 5.33333V8M8 10.6667H8.00667M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z"
13
13
  stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
14
14
  </svg>
15
- `,d.title=this.description,n.insertBefore(d,a)}}else{if(!r){const d=document.createElement("div");d.className="setting-group-description",d.textContent=this.description,o.insertBefore(d,o.firstChild)}u&&u.remove()}};if(e.onclick=l,e.onkeydown=r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),l())},Object.keys(this.settings).length>0){for(const r in this.settings)if(this.settings.hasOwnProperty(r)){const u=this.settings[r];o.appendChild(u.draw())}}else{const r=document.createElement("div");r.className="setting-group-empty",r.textContent="No settings in this group",o.appendChild(r)}return e.appendChild(i),e.appendChild(n),t.appendChild(e),t.appendChild(o),this.elementRef=t,this.pendingBlurHandler&&(this.setupFocusHandlers(),this.pendingBlurHandler=null),t}collapse(){if(!this.elementRef||this.isCollapsed)return;const t=this.elementRef.querySelector(".setting-group-content"),e=this.elementRef.querySelector(".setting-group-arrow"),i=this.elementRef.querySelector(".setting-group-title");t&&e&&i&&(this.isCollapsed=!0,t.classList.add("collapsed"),e.classList.add("rotated"),i.setAttribute("aria-expanded","false"))}expand(){if(!this.elementRef||!this.isCollapsed)return;const t=this.elementRef.querySelector(".setting-group-content"),e=this.elementRef.querySelector(".setting-group-arrow"),i=this.elementRef.querySelector(".setting-group-title");t&&e&&i&&(this.isCollapsed=!1,t.classList.remove("collapsed"),e.classList.remove("rotated"),i.setAttribute("aria-expanded","true"))}updateVisibility(){this.elementRef&&this.hideCondition&&(this.elementRef.style.display=this.hideCondition()?"none":"")}toggle(){this.isHidden?this.show():this.hide()}saveChangesImmediately(){if(!this.onChange)return;this.changeTimeout&&(clearTimeout(this.changeTimeout),this.changeTimeout=null);const t=this.getValues(),e=this.calculateChanges(this.initialValues,t);Object.keys(e).length>0&&(this.initialValues=t,this.onChange(t),this.updateVisibility())}};x.hiddenElements=new Set;let f=x;class M extends m{constructor(t={}){super(t),this.inputType="text",t.onChange&&this.setOnChange(t.onChange)}draw(){const t=e=>{this.props.maxLength!==void 0&&(e.maxLength=this.props.maxLength),this.props.className&&e.classList.add(this.props.className)};return this.createInput({value:this.value,inputType:this.inputType,title:this.props.title,placeholder:this.props.placeholder,icon:this.props.icon,inputClassName:"string-setting-input "+(this.props.inputClassName||""),wrapperClassName:"string-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:t})}}const B="<svg xmlns='http://www.w3.org/2000/svg' width='18' height='19' viewBox='0 0 18 19' fill='none'><path d='M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z' stroke='#667085' stroke-linecap='round' stroke-linejoin='round'/></svg>";class H extends M{constructor(t){super({...t,icon:t.icon||B,title:t.title||"Color"}),this.inputType="color",this.detectChange=t.detectChange}hexToRgb(t){t=t.replace("#","");const e=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,4),16),s=parseInt(t.substring(4,6),16);return`${e}, ${i}, ${s}`}rgbToHex(t){const[e,i,s]=t.split(",").map(a=>parseInt(a.trim()));if(isNaN(e)||isNaN(i)||isNaN(s))return"#000000";const n=a=>{const o=a.toString(16);return o.length===1?"0"+o:o};return`#${n(e)}${n(i)}${n(s)}`}draw(){const t=document.createElement("div");t.className="color-setting-wrapper";const e=document.createElement("div");e.className="icon-container";const i=this.createIcon(this.props.icon||B),s=this.createLabel(this.title||"Color");e.appendChild(i),e.appendChild(s);const n=document.createElement("div");n.className="color-input-wrapper";const a=d=>{const g=d.value.split(",").map(I=>parseInt(I.trim()));if(g.length!==3||g.some(isNaN))return d.style.border="1px solid red",!1;const[p,C,v]=g,y=p>=0&&p<=255&&C>=0&&C<=255&&v>=0&&v<=255;return d.style.border=y?"":"1px solid red",y},o=document.createElement("div");o.className="color-preview",o.style.backgroundColor=this.value?`rgb(${this.value})`:"";const l=this.createInput({value:this.value,inputType:"text",inputClassName:"color-text-input"}),h=l.querySelector("input");h.readOnly=!0;const r=this.createInput({value:this.value?this.rgbToHex(this.value):"",inputType:this.inputType,inputClassName:"color-picker"}),u=r.querySelector("input");return h.oninput=d=>{var p;let g=d.target.value.trim();a(h)&&(this.value=g,(p=this.onChange)==null||p.call(this,g),u.value=this.rgbToHex(g),o.style.backgroundColor=`rgb(${g})`)},u.oninput=d=>{var C,v;const g=d.target.value,p=this.hexToRgb(g);this.value=p,(C=this.onChange)==null||C.call(this,p),(v=this.detectChange)==null||v.call(this,p),h.value=p,o.style.backgroundColor=`rgb(${p})`},u.onchange=d=>{var C,v;const g=d.target.value,p=this.hexToRgb(g);this.value=p,(C=this.onChange)==null||C.call(this,p),(v=this.detectChange)==null||v.call(this,p),h.value=p,o.style.backgroundColor=`rgb(${p})`},n.appendChild(o),n.appendChild(r),n.appendChild(l),t.appendChild(e),t.appendChild(n),this.value&&(h.value=this.value,u.value=this.rgbToHex(this.value),o.style.backgroundColor=`rgb(${this.value})`),t}}class b extends m{constructor(t){super(t),this.inputType="number",this.inputElement=null,this.mobileValue=t.mobile,this.validateProps(),this.value=this.validateValue(this.value)}draw(){const t=s=>{this.props.minValue!==void 0&&(s.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(s.max=String(this.props.maxValue)),this.props.className&&s.classList.add(this.props.className),s.addEventListener("input",()=>{const n=this.props.minValue??Number.MIN_SAFE_INTEGER,a=this.props.maxValue??Number.MAX_SAFE_INTEGER;let o=Number(s.value);o<n&&(o=n),o>a&&(o=a),String(o)!==s.value&&(s.value=String(o)),this.setValue(o)}),s.addEventListener("blur",()=>{var a,o;const n=this.validateValue(Number(s.value));n!==Number(s.value)&&(s.value=String(n),this.setValue(n)),(o=(a=this.props).onBlur)==null||o.call(a)})},e=this.createInput({value:this.value,inputType:this.inputType,title:this.props.title,icon:this.props.icon,inputClassName:"number-setting-input "+(this.props.inputClassName||""),wrapperClassName:"number-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:t});if(this.inputElement=e.querySelector("input.number-setting-input"),!this.props.suffix||this.props.suffix==="none")return e;e.classList.add("suffix-wrapper"),this.inputElement&&(this.inputElement.style.paddingRight="35px");const i=document.createElement("span");return i.className="suffix-label",i.textContent=this.props.suffix,e.appendChild(i),e}setValue(t){const e=this.validateValue(t);super.setValue(e),this.inputElement&&this.inputElement.value!==String(e)&&(this.inputElement.value=String(e??""))}validateValue(t){(t==null||isNaN(t))&&(t=this.props.default??0);const e=this.props.minValue??Number.MIN_SAFE_INTEGER,i=this.props.maxValue??Number.MAX_SAFE_INTEGER;let s=Number(t);return s<e&&(s=e),s>i&&(s=i),s}getMobileValue(){return this.mobileValue}setMobileValue(t){this.mobileValue=t}validateProps(){this.props.minValue!==void 0&&(this.props.default??0)<this.props.minValue&&console.warn(`Default value ${this.props.default} is less than minValue ${this.props.minValue}`),this.props.maxValue!==void 0&&(this.props.default??0)>this.props.maxValue&&console.warn(`Default value ${this.props.default} is greater than maxValue ${this.props.maxValue}`)}}const W=`
15
+ `,d.title=this.description,n.insertBefore(d,a)}}else{if(!r){const d=document.createElement("div");d.className="setting-group-description",d.textContent=this.description,o.insertBefore(d,o.firstChild)}p&&p.remove()}};if(e.onclick=l,e.onkeydown=r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),l())},Object.keys(this.settings).length>0){for(const r in this.settings)if(this.settings.hasOwnProperty(r)){const p=this.settings[r];o.appendChild(p.draw())}}else{const r=document.createElement("div");r.className="setting-group-empty",r.textContent="No settings in this group",o.appendChild(r)}return e.appendChild(i),e.appendChild(n),t.appendChild(e),t.appendChild(o),this.elementRef=t,this.pendingBlurHandler&&(this.setupFocusHandlers(),this.pendingBlurHandler=null),t}collapse(){if(!this.elementRef||this.isCollapsed)return;const t=this.elementRef.querySelector(".setting-group-content"),e=this.elementRef.querySelector(".setting-group-arrow"),i=this.elementRef.querySelector(".setting-group-title");t&&e&&i&&(this.isCollapsed=!0,t.classList.add("collapsed"),e.classList.add("rotated"),i.setAttribute("aria-expanded","false"))}expand(){if(!this.elementRef||!this.isCollapsed)return;const t=this.elementRef.querySelector(".setting-group-content"),e=this.elementRef.querySelector(".setting-group-arrow"),i=this.elementRef.querySelector(".setting-group-title");t&&e&&i&&(this.isCollapsed=!1,t.classList.remove("collapsed"),e.classList.remove("rotated"),i.setAttribute("aria-expanded","true"))}updateVisibility(){this.elementRef&&this.hideCondition&&(this.elementRef.style.display=this.hideCondition()?"none":"")}toggle(){this.isHidden?this.show():this.hide()}saveChangesImmediately(){if(!this.onChange)return;this.changeTimeout&&(clearTimeout(this.changeTimeout),this.changeTimeout=null);const t=this.getValues(),e=this.calculateChanges(this.initialValues,t);Object.keys(e).length>0&&(this.initialValues=t,this.onChange(t),this.updateVisibility())}};x.hiddenElements=new Set;let f=x;class M extends m{constructor(t={}){super(t),this.inputType="text",t.onChange&&this.setOnChange(t.onChange)}draw(){const t=e=>{this.props.maxLength!==void 0&&(e.maxLength=this.props.maxLength),this.props.className&&e.classList.add(this.props.className)};return this.createInput({value:this.value,inputType:this.inputType,title:this.props.title,placeholder:this.props.placeholder,icon:this.props.icon,inputClassName:"string-setting-input "+(this.props.inputClassName||""),wrapperClassName:"string-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:t})}}const B="<svg xmlns='http://www.w3.org/2000/svg' width='18' height='19' viewBox='0 0 18 19' fill='none'><path d='M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z' stroke='#667085' stroke-linecap='round' stroke-linejoin='round'/></svg>";class H extends M{constructor(t){super({...t,icon:t.icon||B,title:t.title||"Color"}),this.inputType="color",this.detectChange=t.detectChange}hexToRgb(t){t=t.replace("#","");const e=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,4),16),s=parseInt(t.substring(4,6),16);return`${e}, ${i}, ${s}`}rgbToHex(t){const[e,i,s]=t.split(",").map(a=>parseInt(a.trim()));if(isNaN(e)||isNaN(i)||isNaN(s))return"#000000";const n=a=>{const o=a.toString(16);return o.length===1?"0"+o:o};return`#${n(e)}${n(i)}${n(s)}`}draw(){const t=document.createElement("div");t.className="color-setting-wrapper";const e=document.createElement("div");e.className="icon-container";const i=this.createIcon(this.props.icon||B),s=this.createLabel(this.title||"Color");e.appendChild(i),e.appendChild(s);const n=document.createElement("div");n.className="color-input-wrapper";const a=d=>{const u=d.value.split(",").map(I=>parseInt(I.trim()));if(u.length!==3||u.some(isNaN))return d.style.border="1px solid red",!1;const[g,C,v]=u,L=g>=0&&g<=255&&C>=0&&C<=255&&v>=0&&v<=255;return d.style.border=L?"":"1px solid red",L},o=document.createElement("div");o.className="color-preview",o.style.backgroundColor=typeof this.value=="string"&&this.value?`rgb(${this.value})`:"";const l=this.createInput({value:typeof this.value=="string"?this.value:"",inputType:"text",inputClassName:"color-text-input"}),h=l.querySelector("input");h.readOnly=!0;const r=this.createInput({value:typeof this.value=="string"?this.rgbToHex(this.value):"#000000",inputType:this.inputType,inputClassName:"color-picker"}),p=r.querySelector("input");if(h.oninput=d=>{var g;let u=d.target.value.trim();a(h)&&(this.value=u,(g=this.onChange)==null||g.call(this,u),p.value=this.rgbToHex(u),o.style.backgroundColor=`rgb(${u})`)},p.oninput=d=>{var C,v;const u=d.target.value,g=this.hexToRgb(u);this.value=g,(C=this.onChange)==null||C.call(this,g),(v=this.detectChange)==null||v.call(this,g),h.value=g,o.style.backgroundColor=`rgb(${g})`},p.onchange=d=>{var C,v;const u=d.target.value,g=this.hexToRgb(u);this.value=g,(C=this.onChange)==null||C.call(this,g),(v=this.detectChange)==null||v.call(this,g),h.value=g,o.style.backgroundColor=`rgb(${g})`},n.appendChild(o),n.appendChild(r),n.appendChild(l),t.appendChild(e),t.appendChild(n),typeof this.value=="string"&&this.value.includes(","))h.value=this.value,p.value=this.rgbToHex(this.value),o.style.backgroundColor=`rgb(${this.value})`;else{let d="",u="#000000";typeof this.value=="string"?(d=this.value,u=this.rgbToHex(this.value)):this.value!==void 0?(console.warn(`ColorSetting: Initial value "${this.value}" (type: ${typeof this.value}) is not a string. Displaying default color.`),d="0,0,0",u=this.rgbToHex(d)):(d="",u="#000000"),h.value=d,p.value=u,o.style.backgroundColor=d?`rgb(${d})`:""}return t}}class b extends m{constructor(t){super(t),this.inputType="number",this.inputElement=null,this.mobileValue=t.mobile,this.validateProps(),this.value=this.validateValue(this.value)}draw(){const t=s=>{this.props.minValue!==void 0&&(s.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(s.max=String(this.props.maxValue)),this.props.className&&s.classList.add(this.props.className),s.addEventListener("input",()=>{const n=this.props.minValue??Number.MIN_SAFE_INTEGER,a=this.props.maxValue??Number.MAX_SAFE_INTEGER;let o=Number(s.value);o<n&&(o=n),o>a&&(o=a),String(o)!==s.value&&(s.value=String(o)),this.setValue(o)}),s.addEventListener("blur",()=>{var a,o;const n=this.validateValue(Number(s.value));n!==Number(s.value)&&(s.value=String(n),this.setValue(n)),(o=(a=this.props).onBlur)==null||o.call(a)})},e=this.createInput({value:this.value,inputType:this.inputType,title:this.props.title,icon:this.props.icon,inputClassName:"number-setting-input "+(this.props.inputClassName||""),wrapperClassName:"number-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:t});if(this.inputElement=e.querySelector("input.number-setting-input"),!this.props.suffix||this.props.suffix==="none")return e;e.classList.add("suffix-wrapper"),this.inputElement&&(this.inputElement.style.paddingRight="35px");const i=document.createElement("span");return i.className="suffix-label",i.textContent=this.props.suffix,e.appendChild(i),e}setValue(t){const e=this.validateValue(t);super.setValue(e),this.inputElement&&this.inputElement.value!==String(e)&&(this.inputElement.value=String(e??""))}validateValue(t){(t==null||isNaN(t))&&(t=this.props.default??0);const e=this.props.minValue??Number.MIN_SAFE_INTEGER,i=this.props.maxValue??Number.MAX_SAFE_INTEGER;let s=Number(t);return s<e&&(s=e),s>i&&(s=i),s}getMobileValue(){return this.mobileValue}setMobileValue(t){this.mobileValue=t}validateProps(){this.props.minValue!==void 0&&(this.props.default??0)<this.props.minValue&&console.warn(`Default value ${this.props.default} is less than minValue ${this.props.minValue}`),this.props.maxValue!==void 0&&(this.props.default??0)>this.props.maxValue&&console.warn(`Default value ${this.props.default} is greater than maxValue ${this.props.maxValue}`)}}const W=`
16
16
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
17
17
  <path d="M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
18
18
  <path d="M9 1V17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1Z" fill="#667085" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
19
- </svg>`;class L extends b{constructor(t={}){const e={title:"Opacity",suffix:"%",minValue:0,maxValue:100,step:1,default:t.default??100,icon:W,...t};super(e),this.inputType="number",this.mobileValue=t.mobile}getMobileValue(){return this.mobileValue}}const G=`
19
+ </svg>`;class y extends b{constructor(t={}){const e={title:"Opacity",suffix:"%",minValue:0,maxValue:100,step:1,default:t.default??100,icon:W,...t};super(e),this.inputType="number",this.mobileValue=t.mobile}getMobileValue(){return this.mobileValue}}const G=`
20
20
  <svg xmlns="http://www.w3.org/2000/svg" class="svg-select" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down">
21
21
  <polyline points="6 9 12 15 18 9"></polyline>
22
22
  </svg>
@@ -64,7 +64,7 @@
64
64
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
65
65
  <path d="M8 3V2.6C8 2.03995 8 1.75992 7.89101 1.54601C7.79513 1.35785 7.64215 1.20487 7.45399 1.10899C7.24008 1 6.96005 1 6.4 1H5.6C5.03995 1 4.75992 1 4.54601 1.10899C4.35785 1.20487 4.20487 1.35785 4.10899 1.54601C4 1.75992 4 2.03995 4 2.6V3M5 5.75V8.25M7 5.75V8.25M1.5 3H10.5M9.5 3V8.6C9.5 9.44008 9.5 9.86012 9.33651 10.181C9.1927 10.4632 8.96323 10.6927 8.68099 10.8365C8.36012 11 7.94008 11 7.1 11H4.9C4.05992 11 3.63988 11 3.31901 10.8365C3.03677 10.6927 2.8073 10.4632 2.66349 10.181C2.5 9.86012 2.5 9.44008 2.5 8.6V3" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
66
66
  </svg>
67
- `;class _ extends m{constructor(t={}){super(t),this.inputType="button",this.previewWrapper=null,this.previewEl=null,this.emptyStateEl=null,this.props.delete===void 0&&(this.props.delete=!0),!this.value&&t.defaultUrl&&t.defaultUrl!==""&&(this.value=t.defaultUrl)}updatePreviewState(t=null){if(!this.previewWrapper||!this.previewEl)return;const e=this.previewWrapper.parentElement,i=e==null?void 0:e.querySelector(".upload-button"),s=e==null?void 0:e.querySelector(".preview-placeholder");t&&t!==""?(this.previewWrapper.classList.add("has-image"),this.previewEl.src=t,this.previewWrapper.style.display="block",this.previewEl.style.display="block",s&&s instanceof HTMLElement&&(s.style.display="none"),e&&e.classList.remove("no-image"),i&&(i.innerHTML=`
67
+ `;class $ extends m{constructor(t={}){super(t),this.inputType="button",this.previewWrapper=null,this.previewEl=null,this.emptyStateEl=null,this.props.delete===void 0&&(this.props.delete=!0),!this.value&&t.defaultUrl&&t.defaultUrl!==""&&(this.value=t.defaultUrl)}updatePreviewState(t=null){if(!this.previewWrapper||!this.previewEl)return;const e=this.previewWrapper.parentElement,i=e==null?void 0:e.querySelector(".upload-button"),s=e==null?void 0:e.querySelector(".preview-placeholder");t&&t!==""?(this.previewWrapper.classList.add("has-image"),this.previewEl.src=t,this.previewWrapper.style.display="block",this.previewEl.style.display="block",s&&s instanceof HTMLElement&&(s.style.display="none"),e&&e.classList.remove("no-image"),i&&(i.innerHTML=`
68
68
  <span class="upload-icon">${O}</span>
69
69
  <span class="upload-label">Replace</span>
70
70
  `)):(this.previewWrapper.classList.remove("has-image"),this.previewEl.src="",this.previewEl.style.display="none",this.previewWrapper.style.display="none",s&&s instanceof HTMLElement&&(s.style.display="block"),e&&e.classList.add("no-image"),i&&(i.innerHTML=`
@@ -73,7 +73,7 @@
73
73
  `))}draw(){const t=document.createElement("div");t.className="upload-setting-wrapper",t.setAttribute("data-setting-id",this.id),t.addEventListener("focusout",l=>{var h;l.relatedTarget&&t.contains(l.relatedTarget)||(h=this.onBlur)==null||h.call(this)},!0);const e=!!(this.props.title||this.props.icon);if(e||t.classList.add("no-label"),e){const l=document.createElement("div");if(l.className="icon-title-container",this.props.icon){const h=this.createIcon(this.props.icon);l.appendChild(h)}if(this.props.title){const h=this.createLabel(this.props.title);l.appendChild(h)}t.appendChild(l)}const i=document.createElement("div");i.className="preview-button-container";const s=this.value&&this.value!=="";s||i.classList.add("no-image");const n=document.createElement("div");if(n.className="preview-placeholder",n.innerHTML=z,this.previewWrapper=document.createElement("div"),this.previewWrapper.className="preview-wrapper",this.previewEl=document.createElement("img"),this.previewEl.className="upload-preview",this.props.delete){const l=document.createElement("button");l.className="delete-button",l.type="button",l.title="Delete image",l.innerHTML=P,this.previewWrapper.appendChild(l),l.onclick=h=>{var r;h.stopPropagation(),this.value="",o.value="",this.updatePreviewState(null),(r=this.onChange)==null||r.call(this,"")}}this.previewWrapper.appendChild(this.previewEl);const a=document.createElement("button");a.className="upload-button",a.innerHTML=`
74
74
  <span class="upload-icon">${O}</span>
75
75
  <span class="upload-label">Upload</span>
76
- `;const o=document.createElement("input");return o.type="file",o.accept="image/*",o.style.display="none",i.appendChild(n),i.appendChild(this.previewWrapper),i.appendChild(a),t.appendChild(i),t.appendChild(o),s?this.updatePreviewState(this.value):this.updatePreviewState(null),a.onclick=()=>{o.click()},o.onchange=async()=>{var h,r,u,d;const l=(h=o.files)==null?void 0:h[0];if(l)try{a.classList.add("loading"),a.disabled=!0;const g=new FormData,p=this.props.formFieldName||"file";g.append(p,l,l.name);const C=this.props.uploadUrl;if(!C)throw new Error("No uploadUrl provided to UploadSetting.");const v=this.props.requestMethod||"POST",y={...this.props.requestHeaders||{}},k=await(await fetch(C,{method:v,body:g,headers:y})).json();console.log("Upload response:",k);let w;if(this.props.parseResponse)w=this.props.parseResponse(k);else if(w=(r=k==null?void 0:k.data)==null?void 0:r.url,!w)throw new Error("No URL found in response. Provide a parseResponse if needed.");console.log("Final URL:",w),this.value=w,this.updatePreviewState(w),(u=this.onChange)==null||u.call(this,w),(d=this.onBlur)==null||d.call(this)}catch(g){console.error("Error uploading file:",g)}finally{a.classList.remove("loading"),a.disabled=!1,o.value=""}else o.value=""},t}}class Z extends b{constructor(t={}){const e={title:t.title||"Height",suffix:"px",minValue:t.minValue??0,maxValue:t.maxValue,icon:t.icon||J,...t};super(e),this.inputType="number",this.mobileValue=t.mobile}getMobileValue(){return this.mobileValue}}const J=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
76
+ `;const o=document.createElement("input");return o.type="file",o.accept="image/*",o.style.display="none",i.appendChild(n),i.appendChild(this.previewWrapper),i.appendChild(a),t.appendChild(i),t.appendChild(o),s?this.updatePreviewState(this.value):this.updatePreviewState(null),a.onclick=()=>{o.click()},o.onchange=async()=>{var h,r,p,d;const l=(h=o.files)==null?void 0:h[0];if(l)try{a.classList.add("loading"),a.disabled=!0;const u=new FormData,g=this.props.formFieldName||"file";u.append(g,l,l.name);const C=this.props.uploadUrl;if(!C)throw new Error("No uploadUrl provided to UploadSetting.");const v=this.props.requestMethod||"POST",L={...this.props.requestHeaders||{}},k=await(await fetch(C,{method:v,body:u,headers:L})).json();console.log("Upload response:",k);let w;if(this.props.parseResponse)w=this.props.parseResponse(k);else if(w=(r=k==null?void 0:k.data)==null?void 0:r.url,!w)throw new Error("No URL found in response. Provide a parseResponse if needed.");console.log("Final URL:",w),this.value=w,this.updatePreviewState(w),(p=this.onChange)==null||p.call(this,w),(d=this.onBlur)==null||d.call(this)}catch(u){console.error("Error uploading file:",u)}finally{a.classList.remove("loading"),a.disabled=!1,o.value=""}else o.value=""},t}}class Z extends b{constructor(t={}){const e={title:t.title||"Height",suffix:"px",minValue:t.minValue??0,maxValue:t.maxValue,icon:t.icon||J,...t};super(e),this.inputType="number",this.mobileValue=t.mobile}getMobileValue(){return this.mobileValue}}const J=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
77
77
  <path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
78
78
  </svg>`;class X extends b{constructor(t={}){const e={title:t.title||"Width",suffix:"px",minValue:t.minValue??0,maxValue:t.maxValue,icon:t.icon||Q,...t};super(e),this.inputType="number",this.mobileValue=t.mobile}getMobileValue(){return this.mobileValue}}const Q=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
79
79
  <path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
@@ -81,7 +81,7 @@
81
81
  <svg xmlns="http://www.w3.org/2000/svg" class="svg-select-api" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down">
82
82
  <polyline points="6 9 12 15 18 9"></polyline>
83
83
  </svg>
84
- `;class K extends m{constructor(t={}){if(super(t),this.inputType="select",this._options=[],this.isOpen=!1,this.selectedOptionIndex=null,this.optionsListEl=null,this.svgContainer=null,this.buttonEl=null,this.isLoading=!1,this.container=null,this.hasInitializedOptions=!1,this.selectedOptionIndex=null,t.default!==void 0&&(this.value=t.default),this.initializeOptions(t),!t.getOptionsAsync&&this.value!==void 0){const e=this._options.findIndex(i=>JSON.stringify(i.value)===JSON.stringify(this.value));e!==-1&&(this.selectedOptionIndex=e)}t.onChange&&this.setOnChange(t.onChange),t.detectChange&&(this.detectChangeCallback=t.detectChange)}initializeOptions(t){this.hasInitializedOptions&&!t.getOptionsAsync||(this._options=[],t.options&&(this._options=[...t.options]),t.getOptions&&this._options.push(...t.getOptions()),t.getOptionsAsync?this.isLoading=!0:this.hasInitializedOptions=!0)}createOption(t,e){const i=document.createElement("li");i.classList.add("select-api-option"),i.textContent=t.name,i.dataset.index=String(e);const s=document.createElement("input");return s.type="radio",s.classList.add("select-api-radio"),s.name="select-api-radio-group",i.appendChild(s),this.selectedOptionIndex===e&&(s.checked=!0),i}draw(){const t=document.createElement("div");t.classList.add("select-api-container"),this.container=t;const e=document.createElement("div");if(e.classList.add("select-api-button"),this.props.title){e.classList.add("has-label");const n=document.createElement("div");n.className="select-label",n.textContent=this.props.title,e.appendChild(n);const a=document.createElement("span");if(a.className="select-value",this.isLoading)a.textContent=this.props.loadingText||"Loading options...";else{const o=this.selectedOptionIndex!==null&&this._options&&this.selectedOptionIndex>=0&&this.selectedOptionIndex<this._options.length?this._options[this.selectedOptionIndex]:null,l=o&&typeof o.name=="string"?o.name:"Select an option";a.textContent=l}e.appendChild(a)}else{const n=document.createElement("span");if(this.isLoading)n.textContent=this.props.loadingText||"Loading options...";else{const a=this.selectedOptionIndex!==null&&this._options&&this.selectedOptionIndex>=0&&this.selectedOptionIndex<this._options.length?this._options[this.selectedOptionIndex]:null,o=a&&typeof a.name=="string"?a.name:"Select an option";n.textContent=o}e.appendChild(n)}e.onclick=()=>{var n,a;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(a=this.svgContainer)==null||a.classList.toggle("open",this.isOpen))},t.appendChild(e),this.buttonEl=e;const i=document.createElement("ul");i.classList.add("select-api-options"),this._options.forEach((n,a)=>{const o=this.createOption(n,a);o.onclick=l=>this.selectApiOption(l,a,e),i.appendChild(o)}),t.appendChild(i);const s=document.createElement("div");return s.classList.add("svg-container"),s.innerHTML=Y,t.appendChild(s),s.onclick=()=>{var n,a;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(a=this.svgContainer)==null||a.classList.toggle("open",this.isOpen))},this.optionsListEl=i,this.svgContainer=s,this.props.getOptionsAsync&&!this.hasInitializedOptions?(this.isLoading=!0,this.updateButtonText(),this.props.getOptionsAsync().then(n=>{const a=new Set(this._options.map(l=>JSON.stringify(l.value))),o=n.filter(l=>!a.has(JSON.stringify(l.value)));if(this._options.push(...o),this.isLoading=!1,this.hasInitializedOptions=!0,this.value!==void 0){const l=this._options.findIndex(h=>JSON.stringify(h.value)===JSON.stringify(this.value));this.selectedOptionIndex=l!==-1?l:null}else this.selectedOptionIndex=null;this.updateOptionsList(),this.updateButtonText()}).catch(n=>{console.error("Failed to fetch async options:",n),this.isLoading=!1,this.updateButtonText(this.props.errorText||"Error: Could not load options",!0)})):this.props.getOptionsAsync&&this._options.length<=1&&(this.isLoading=!0,this.updateButtonText(),this.props.getOptionsAsync().then(n=>{const a=new Set(this._options.map(l=>JSON.stringify(l.value))),o=n.filter(l=>!a.has(JSON.stringify(l.value)));if(this._options.push(...o),this.isLoading=!1,this.value!==void 0){const l=this._options.findIndex(h=>JSON.stringify(h.value)===JSON.stringify(this.value));this.selectedOptionIndex=l!==-1?l:null}else this.selectedOptionIndex=null;this.updateOptionsList(),this.updateButtonText()}).catch(n=>{console.error("Failed to fetch async options:",n),this.isLoading=!1,this.updateButtonText(this.props.errorText||"Error: Could not load options",!0)})),t}selectApiOption(t,e,i){var l,h,r,u;const s=t.target,n=s.querySelector(".select-api-radio")||((l=s.closest(".select-api-option"))==null?void 0:l.querySelector(".select-api-radio"));n&&(n.checked=!0),this.selectedOptionIndex=e;const a=this._options[e].value;this.value=a;const o=i.querySelector(".select-value");if(o)o.textContent=this._options[e].name;else{const d=i.firstChild;d&&d.tagName==="SPAN"&&(d.textContent=this._options[e].name)}this.isOpen=!1,(h=this.optionsListEl)==null||h.classList.remove("open"),(r=this.svgContainer)==null||r.classList.remove("open"),(u=this.onChange)==null||u.call(this,a),this.detectChangeCallback&&this.detectChangeCallback(a)}updateOptionsList(){!this.optionsListEl||!this.buttonEl||(this.optionsListEl.innerHTML="",this._options.forEach((t,e)=>{var s;const i=this.createOption(t,e);i.onclick=n=>{this.buttonEl&&this.selectApiOption(n,e,this.buttonEl)},(s=this.optionsListEl)==null||s.appendChild(i)}))}updateButtonText(t,e=!1){if(!this.buttonEl)return;const i=this.buttonEl.querySelector(".select-value")||this.buttonEl.firstChild;if(i)if(e)i.textContent=t||"Error",this.buttonEl.classList.add("error"),this.buttonEl.setAttribute("disabled","true"),this.optionsListEl&&this.optionsListEl.classList.remove("open"),this.svgContainer&&(this.svgContainer.style.display="none");else if(this.isLoading)i.textContent=this.props.loadingText||"Loading options...",this.buttonEl.classList.remove("error"),this.buttonEl.removeAttribute("disabled"),this.svgContainer&&(this.svgContainer.style.display="");else{const s=this.selectedOptionIndex!==null&&this._options&&this.selectedOptionIndex>=0&&this.selectedOptionIndex<this._options.length?this._options[this.selectedOptionIndex]:null,n=s&&typeof s.name=="string"?s.name:"Select an option";i.textContent=t||n,this.buttonEl.classList.remove("error"),this.buttonEl.removeAttribute("disabled"),this.svgContainer&&(this.svgContainer.style.display="")}}setDetectChange(t){this.detectChangeCallback=t}setValue(t){this.value=t,this.selectedOptionIndex=this._options.findIndex(e=>JSON.stringify(e.value)===JSON.stringify(t)),this.updateButtonText()}}class tt extends m{constructor(t){var e,i;super(t),this.inputType="text",this.value=t.default??((i=(e=t.options)==null?void 0:e[0])==null?void 0:i.value)??"",this.detectChangeCallback=t.detectChange}draw(){var a,o;const t=document.createElement("div");t.className="toggle-setting-container",this.props.icon&&t.classList.add("toggle-with-icon");const e=document.createElement("div");if(e.className="toggle-label",this.props.icon){const l=document.createElement("span");l.className="toggle-icon",l.innerHTML=this.props.icon,e.appendChild(l)}if(this.props.title){const l=document.createElement("span");l.textContent=this.props.title,e.appendChild(l)}t.appendChild(e);const i=document.createElement("label");i.className="toggle-switch";const s=document.createElement("input");s.type="checkbox",s.checked=((o=(a=this.props.options)==null?void 0:a.find(l=>l.value===this.value))==null?void 0:o.status)??!1,s.addEventListener("change",()=>{var h,r;const l=((r=(h=this.props.options)==null?void 0:h.find(u=>u.status===s.checked))==null?void 0:r.value)??"";this.value=l,this.onChange&&this.onChange(this.value),this.detectChangeCallback&&this.detectChangeCallback(this.value)});const n=document.createElement("span");if(n.className="toggle-slider",this.props.activeColor||this.props.inactiveColor){const l=document.createElement("style"),h=this.props.activeColor||"#4CAF50",r=this.props.inactiveColor||"#ccc";l.textContent=`
84
+ `;class K extends m{constructor(t={}){if(super(t),this.inputType="select",this._options=[],this.isOpen=!1,this.selectedOptionIndex=null,this.optionsListEl=null,this.svgContainer=null,this.buttonEl=null,this.isLoading=!1,this.container=null,this.hasInitializedOptions=!1,this.selectedOptionIndex=null,t.default!==void 0&&(this.value=t.default),this.initializeOptions(t),!t.getOptionsAsync&&this.value!==void 0){const e=this._options.findIndex(i=>JSON.stringify(i.value)===JSON.stringify(this.value));e!==-1&&(this.selectedOptionIndex=e)}t.onChange&&this.setOnChange(t.onChange),t.detectChange&&(this.detectChangeCallback=t.detectChange)}initializeOptions(t){this.hasInitializedOptions&&!t.getOptionsAsync||(this._options=[],t.options&&(this._options=[...t.options]),t.getOptions&&this._options.push(...t.getOptions()),t.getOptionsAsync?this.isLoading=!0:this.hasInitializedOptions=!0)}createOption(t,e){const i=document.createElement("li");i.classList.add("select-api-option"),i.textContent=t.name,i.dataset.index=String(e);const s=document.createElement("input");return s.type="radio",s.classList.add("select-api-radio"),s.name="select-api-radio-group",i.appendChild(s),this.selectedOptionIndex===e&&(s.checked=!0),i}draw(){const t=document.createElement("div");t.classList.add("select-api-container"),this.container=t;const e=document.createElement("div");if(e.classList.add("select-api-button"),this.props.title){e.classList.add("has-label");const n=document.createElement("div");n.className="select-label",n.textContent=this.props.title,e.appendChild(n);const a=document.createElement("span");if(a.className="select-value",this.isLoading)a.textContent=this.props.loadingText||"Loading options...";else{const o=this.selectedOptionIndex!==null&&this._options&&this.selectedOptionIndex>=0&&this.selectedOptionIndex<this._options.length?this._options[this.selectedOptionIndex]:null,l=o&&typeof o.name=="string"?o.name:"Select an option";a.textContent=l}e.appendChild(a)}else{const n=document.createElement("span");if(this.isLoading)n.textContent=this.props.loadingText||"Loading options...";else{const a=this.selectedOptionIndex!==null&&this._options&&this.selectedOptionIndex>=0&&this.selectedOptionIndex<this._options.length?this._options[this.selectedOptionIndex]:null,o=a&&typeof a.name=="string"?a.name:"Select an option";n.textContent=o}e.appendChild(n)}e.onclick=()=>{var n,a;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(a=this.svgContainer)==null||a.classList.toggle("open",this.isOpen))},t.appendChild(e),this.buttonEl=e;const i=document.createElement("ul");i.classList.add("select-api-options"),this._options.forEach((n,a)=>{const o=this.createOption(n,a);o.onclick=l=>this.selectApiOption(l,a,e),i.appendChild(o)}),t.appendChild(i);const s=document.createElement("div");return s.classList.add("svg-container"),s.innerHTML=Y,t.appendChild(s),s.onclick=()=>{var n,a;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(a=this.svgContainer)==null||a.classList.toggle("open",this.isOpen))},this.optionsListEl=i,this.svgContainer=s,this.props.getOptionsAsync&&!this.hasInitializedOptions?(this.isLoading=!0,this.updateButtonText(),this.props.getOptionsAsync().then(n=>{const a=new Set(this._options.map(l=>JSON.stringify(l.value))),o=n.filter(l=>!a.has(JSON.stringify(l.value)));if(this._options.push(...o),this.isLoading=!1,this.hasInitializedOptions=!0,this.value!==void 0){const l=this._options.findIndex(h=>JSON.stringify(h.value)===JSON.stringify(this.value));this.selectedOptionIndex=l!==-1?l:null}else this.selectedOptionIndex=null;this.updateOptionsList(),this.updateButtonText()}).catch(n=>{console.error("Failed to fetch async options:",n),this.isLoading=!1,this.updateButtonText(this.props.errorText||"Error: Could not load options",!0)})):this.props.getOptionsAsync&&this._options.length<=1&&(this.isLoading=!0,this.updateButtonText(),this.props.getOptionsAsync().then(n=>{const a=new Set(this._options.map(l=>JSON.stringify(l.value))),o=n.filter(l=>!a.has(JSON.stringify(l.value)));if(this._options.push(...o),this.isLoading=!1,this.value!==void 0){const l=this._options.findIndex(h=>JSON.stringify(h.value)===JSON.stringify(this.value));this.selectedOptionIndex=l!==-1?l:null}else this.selectedOptionIndex=null;this.updateOptionsList(),this.updateButtonText()}).catch(n=>{console.error("Failed to fetch async options:",n),this.isLoading=!1,this.updateButtonText(this.props.errorText||"Error: Could not load options",!0)})),t}selectApiOption(t,e,i){var l,h,r,p;const s=t.target,n=s.querySelector(".select-api-radio")||((l=s.closest(".select-api-option"))==null?void 0:l.querySelector(".select-api-radio"));n&&(n.checked=!0),this.selectedOptionIndex=e;const a=this._options[e].value;this.value=a;const o=i.querySelector(".select-value");if(o)o.textContent=this._options[e].name;else{const d=i.firstChild;d&&d.tagName==="SPAN"&&(d.textContent=this._options[e].name)}this.isOpen=!1,(h=this.optionsListEl)==null||h.classList.remove("open"),(r=this.svgContainer)==null||r.classList.remove("open"),(p=this.onChange)==null||p.call(this,a),this.detectChangeCallback&&this.detectChangeCallback(a)}updateOptionsList(){!this.optionsListEl||!this.buttonEl||(this.optionsListEl.innerHTML="",this._options.forEach((t,e)=>{var s;const i=this.createOption(t,e);i.onclick=n=>{this.buttonEl&&this.selectApiOption(n,e,this.buttonEl)},(s=this.optionsListEl)==null||s.appendChild(i)}))}updateButtonText(t,e=!1){if(!this.buttonEl)return;const i=this.buttonEl.querySelector(".select-value")||this.buttonEl.firstChild;if(i)if(e)i.textContent=t||"Error",this.buttonEl.classList.add("error"),this.buttonEl.setAttribute("disabled","true"),this.optionsListEl&&this.optionsListEl.classList.remove("open"),this.svgContainer&&(this.svgContainer.style.display="none");else if(this.isLoading)i.textContent=this.props.loadingText||"Loading options...",this.buttonEl.classList.remove("error"),this.buttonEl.removeAttribute("disabled"),this.svgContainer&&(this.svgContainer.style.display="");else{const s=this.selectedOptionIndex!==null&&this._options&&this.selectedOptionIndex>=0&&this.selectedOptionIndex<this._options.length?this._options[this.selectedOptionIndex]:null,n=s&&typeof s.name=="string"?s.name:"Select an option";i.textContent=t||n,this.buttonEl.classList.remove("error"),this.buttonEl.removeAttribute("disabled"),this.svgContainer&&(this.svgContainer.style.display="")}}setDetectChange(t){this.detectChangeCallback=t}setValue(t){this.value=t,this.selectedOptionIndex=this._options.findIndex(e=>JSON.stringify(e.value)===JSON.stringify(t)),this.updateButtonText()}}class tt extends m{constructor(t){var e,i;super(t),this.inputType="text",this.value=t.default??((i=(e=t.options)==null?void 0:e[0])==null?void 0:i.value)??"",this.detectChangeCallback=t.detectChange}draw(){var a,o;const t=document.createElement("div");t.className="toggle-setting-container",this.props.icon&&t.classList.add("toggle-with-icon");const e=document.createElement("div");if(e.className="toggle-label",this.props.icon){const l=document.createElement("span");l.className="toggle-icon",l.innerHTML=this.props.icon,e.appendChild(l)}if(this.props.title){const l=document.createElement("span");l.textContent=this.props.title,e.appendChild(l)}t.appendChild(e);const i=document.createElement("label");i.className="toggle-switch";const s=document.createElement("input");s.type="checkbox",s.checked=((o=(a=this.props.options)==null?void 0:a.find(l=>l.value===this.value))==null?void 0:o.status)??!1,s.addEventListener("change",()=>{var h,r;const l=((r=(h=this.props.options)==null?void 0:h.find(p=>p.status===s.checked))==null?void 0:r.value)??"";this.value=l,this.onChange&&this.onChange(this.value),this.detectChangeCallback&&this.detectChangeCallback(this.value)});const n=document.createElement("span");if(n.className="toggle-slider",this.props.activeColor||this.props.inactiveColor){const l=document.createElement("style"),h=this.props.activeColor||"#4CAF50",r=this.props.inactiveColor||"#ccc";l.textContent=`
85
85
  .toggle-switch input:checked + .toggle-slider {
86
86
  background-color: ${h};
87
87
  }
@@ -90,7 +90,7 @@
90
90
  }
91
91
  `,document.head.appendChild(l)}return i.appendChild(s),i.appendChild(n),t.appendChild(i),t}setDetectChange(t){this.detectChangeCallback=t}}const et=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
92
92
  <path d="M13.3334 5.99996H2.66675M13.3334 9.99996H2.66675M5.33341 12.6666V3.33329M10.6667 12.6666V3.33329" stroke="#667085" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
93
- </svg>`;class it extends m{constructor(t={}){t.rowGap=t.rowGap??!0,t.columnGap=t.columnGap??!0,t.title=t.title??"Gap",t.icon=t.icon??et,t.suffix=t.suffix??"px",t.minValue=t.minValue??0,super(t),this.inputType="number",this.inputValues={},this.mobileValue=t.mobile,this.value=this.validateValue(t.default??0),t.rowGap&&(this.inputValues.row=this.value),t.columnGap&&(this.inputValues.column=this.value)}draw(){const t=document.createElement("div");t.className=`setting-container ${this.props.className||""}`,t.id=this.id;const e=document.createElement("div");e.className="setting-label-input-wrapper";const i=document.createElement("label");i.className="setting-label",i.setAttribute("for",this.id+"-input");const s=document.createElement("span");if(s.textContent=this.props.title??"Gap",i.appendChild(s),this.props.icon){const o=document.createElement("span");o.className="setting-icon",o.innerHTML=this.props.icon,i.insertBefore(o,s)}const n=document.createElement("div");n.className=`setting-input-wrapper ${this.props.wrapperClassName||""}`,n.classList.add("gap-setting-wrapper");const a=document.createElement("div");return a.className="gap-inputs-container",this.props.rowGap&&a.appendChild(this.createGapInput("row","Row")),this.props.columnGap&&a.appendChild(this.createGapInput("column","Col")),n.appendChild(a),e.appendChild(i),e.appendChild(n),t.appendChild(e),t}createGapInput(t,e){const i=document.createElement("div");i.className="gap-input-wrapper";const s=document.createElement("input");if(s.type="number",s.className=`gap-input gap-${t}-input ${this.props.inputClassName||""}`,s.id=`${this.id}-${t}-input`,s.min=String(this.props.minValue??0),this.props.maxValue!==void 0&&(s.max=String(this.props.maxValue)),s.step=String(this.props.step??1),s.value=String(this.inputValues[t]??this.value),s.title=e,s.addEventListener("input",n=>{const a=n.target;let o=parseFloat(a.value);o=this.validateValue(o),String(o)!==a.value&&(a.value=String(o)),this.inputValues[t]=o,this.setValue(o)}),s.addEventListener("blur",n=>{var l,h;const a=n.target;let o=parseFloat(a.value);o=this.validateValue(o),String(o)!==a.value&&(a.value=String(o),this.inputValues[t]=o,this.setValue(o)),(h=(l=this.props).onBlur)==null||h.call(l)}),i.appendChild(s),this.props.suffix&&this.props.suffix!=="none"){const n=document.createElement("span");n.className="gap-suffix",n.textContent=this.props.suffix,i.appendChild(n),s.style.paddingRight="30px"}return i}validateValue(t){(t==null||isNaN(t))&&(t=this.props.default??0);const e=this.props.minValue??Number.MIN_SAFE_INTEGER,i=this.props.maxValue??Number.MAX_SAFE_INTEGER;let s=Number(t);return s<e&&(s=e),s>i&&(s=i),s}getMobileValue(){return this.mobileValue}}class E extends f{constructor(t){var o;if(!t.tabs)throw new Error("Tabs array is required for TabsSettings");const e=t.tabs,i=t.activeTabId||((o=e[0])==null?void 0:o.id)||"",s=e.find(l=>l.id===i),n=s?s.settings:{},a={title:t.title||"",settings:n,collapsed:t.collapsed,main:t.main,description:t.description,icon:t.icon,custom:t.custom,hideCondition:t.hideCondition,onBlur:t.onBlur};super(a),this.tabs=[],this.activeTabId="",this.tabsContainer=null,this.previousTabId="",this.container=null,this.tabValues={},this.internalChangeTimeout=null,this.isHandlingInternalChange=!1,this.INTERNAL_CHANGE_DEBOUNCE=50,this.tabs=e,this.activeTabId=i,this.previousTabId=i,this.onStateChangeCallback=t.onStateChange,this.detectChangeCallback=t.detectChange,this.initializeTabValues(),this.connectChildChangeHandlers()}updateSettingsFromTab(t){const e=this.tabs.find(i=>i.id===t);e&&(this.settings=e.settings,this.tabValues[t]=this.getTabValues(e),this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId},Object.values(e.settings).forEach(i=>{i instanceof E&&(i._parentTabsSettings=this)}),this.connectChildChangeHandlers())}connectChildChangeHandlers(){if(!this.settings)return;const t=()=>{Promise.resolve().then(()=>{if(this.activeTabId){const e=this.tabs.find(i=>i.id===this.activeTabId);e&&(this.tabValues[this.activeTabId]=this.getTabValues(e))}this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId},this.triggerDebouncedChange()})};Object.values(this.settings).forEach(e=>{e instanceof f?e.setOnChange(()=>{t()}):e instanceof m&&e.setOnChange(()=>{t()})}),this.tabs.forEach(e=>{Object.entries(e.settings).forEach(([i,s])=>{(s instanceof f||s instanceof m)&&(s instanceof E?(s._parentTabsSettings=this,s.setOnChange(n=>{Promise.resolve().then(()=>{this.tabValues[e.id]=this.getTabValues(e),this.triggerDebouncedChange()})})):s instanceof f?s.setOnChange(()=>{Promise.resolve().then(()=>{this.tabValues[e.id]=this.getTabValues(e),this.triggerDebouncedChange()})}):s instanceof m&&s.setOnChange(()=>{Promise.resolve().then(()=>{this.tabValues[e.id]=this.getTabValues(e),this.triggerDebouncedChange()})}))})})}draw(){const t=super.draw();this.container=t,t.classList.add("tabs-settings-container");const e=document.createElement("div");e.classList.add("tabs-header"),this.main&&e.classList.add("main-header"),this.tabsContainer=e,this.tabs.forEach(s=>{const n=document.createElement("button");n.classList.add("tab-button"),s.id===this.activeTabId&&n.classList.add("active"),n.textContent=s.label,n.onclick=()=>this.handleTabClick(s.id),e.appendChild(n)});const i=t.querySelector(".setting-group-content");return i&&t.insertBefore(e,i),t}handleTabClick(t){var o,l;if(t===this.activeTabId)return;const e=this.tabs.find(h=>h.id===this.activeTabId);e&&(this.tabValues[this.activeTabId]=this.getTabValues(e)),this.previousTabId=this.activeTabId,this.activeTabId=t;const i=(o=this.tabsContainer)==null?void 0:o.querySelectorAll(".tab-button");i==null||i.forEach(h=>{if(h instanceof HTMLElement){const r=this.tabs.find(u=>u.label===h.textContent);h.classList.toggle("active",(r==null?void 0:r.id)===t)}}),this.updateSettingsFromTab(t);const s=(l=this.container)==null?void 0:l.querySelector(".setting-group-content");if(s){s.innerHTML="";const h=this.settings;Object.values(h).forEach(r=>{s.appendChild(r.draw())})}const n=this.getValues();this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId},this.connectChildChangeHandlers(),this.onStateChangeCallback&&this.onStateChangeCallback(t,n),this.detectChangeCallback&&this.detectChangeCallback(t,n),this.onChange&&this.onChange(n);const a=this.findParentTabsSettings();a&&a.onChange&&a.onChange(a.getValues())}findParentTabsSettings(){return this._parentTabsSettings||null}setOnStateChange(t){return this.onStateChangeCallback=t,this}setDetectChange(t){return this.detectChangeCallback=t,this}getActiveTabId(){return this.activeTabId}getValues(){return this.updateTabValues(),{tabs:this.tabValues,activeTabId:this.activeTabId}}updateTabValues(){!this.tabs||this.tabs.length===0||this.tabs.forEach(t=>{this.tabValues[t.id]=this.getTabValues(t)})}propagateChanges(){const t=this.findParentTabsSettings();t&&(t.updateTabValues(),t.triggerDebouncedChange())}triggerDebouncedChange(){this.isHandlingInternalChange||(this.isHandlingInternalChange=!0,this.internalChangeTimeout&&clearTimeout(this.internalChangeTimeout),this.internalChangeTimeout=setTimeout(()=>{this.onChange&&this.onChange(this.getValues()),this.isHandlingInternalChange=!1,this.internalChangeTimeout=null;const t=this.findParentTabsSettings();t&&t.triggerDebouncedChange()},this.INTERNAL_CHANGE_DEBOUNCE))}updateInitialValues(){!this.tabs||this.tabs.length===0||(this.updateTabValues(),this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId},this.tabs.forEach(t=>{Object.values(t.settings).forEach(e=>{e instanceof E&&e.updateInitialValues()})}))}setOnChange(t){return this.onChange=t,this.connectChildChangeHandlers(),this.updateTabValues(),this}initializeTabValues(){!this.tabs||this.tabs.length===0||(this.tabs.forEach(t=>{this.tabValues[t.id]=this.getTabValues(t)}),this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId})}getTabValues(t){const e={};return Object.entries(t.settings).forEach(([i,s])=>{s instanceof E||s instanceof f?e[i]=s.getValues():(s instanceof m,e[i]=s.value)}),e}clone(){const t=this.tabs.map(i=>{const s={};return Object.entries(i.settings).forEach(([n,a])=>{typeof a.clone=="function"?s[n]=a.clone():(console.warn(`Setting with key '${n}' in tab '${i.id}' does not have a clone method. Copying reference.`),s[n]=a)}),{...i,settings:s}}),e={title:this.title,tabs:t,activeTabId:this.activeTabId,collapsed:this.isCollapsed,main:this.isMain,description:this.description,icon:this.icon,custom:this.custom,hideCondition:this.hideCondition,settings:{}};return new E(e)}setValue(t){if(t&&typeof t=="object"){let e=!1;if(t.activeTabId&&t.activeTabId!==this.activeTabId&&(this.previousTabId=this.activeTabId,this.activeTabId=t.activeTabId,e=!0),t.tabs&&typeof t.tabs=="object"&&Object.entries(t.tabs).forEach(([i,s])=>{const n=this.tabs.find(a=>a.id===i);n&&s&&typeof s=="object"&&Object.entries(s).forEach(([a,o])=>{n.settings[a]&&typeof n.settings[a].setValue=="function"&&n.settings[a].setValue(o)})}),this.updateTabValues(),this.triggerDebouncedChange(),this.container){if(this.updateSettingsFromTab(this.activeTabId),this.tabsContainer){const s=this.tabsContainer.querySelectorAll(".tab-button");s==null||s.forEach(n=>{if(n instanceof HTMLElement){const a=this.tabs.find(o=>o.label===n.textContent);n.classList.toggle("active",(a==null?void 0:a.id)===this.activeTabId)}})}const i=this.container.querySelector(".setting-group-content");if(i){i.innerHTML="";const s=this.settings;Object.values(s).forEach(n=>{i.appendChild(n.draw())})}e&&this.onStateChangeCallback&&this.onStateChangeCallback(this.activeTabId,this.getValues())}this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId}}}updateTabSetting(t,e,i){const s=this.tabs.find(a=>a.id===t);if(!s||!s.settings[e])return;const n=s.settings[e];typeof n.setValue=="function"&&(n.setValue(i),this.tabValues[t]=this.getTabValues(s),t!==this.activeTabId&&this.onChange&&this.onChange(this.getValues()))}getTabsConfiguration(){return this.tabs}}const st=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
93
+ </svg>`;class it extends m{constructor(t={}){t.rowGap=t.rowGap??!0,t.columnGap=t.columnGap??!0,t.title=t.title??"Gap",t.icon=t.icon??et,t.suffix=t.suffix??"px",t.minValue=t.minValue??0,super(t),this.inputType="number",this.inputValues={},this.mobileValue=t.mobile,this.value=this.validateValue(t.default??0),t.rowGap&&(this.inputValues.row=this.value),t.columnGap&&(this.inputValues.column=this.value)}draw(){const t=document.createElement("div");t.className=`setting-container ${this.props.className||""}`,t.id=this.id;const e=document.createElement("div");e.className="setting-label-input-wrapper";const i=document.createElement("label");i.className="setting-label",i.setAttribute("for",this.id+"-input");const s=document.createElement("span");if(s.textContent=this.props.title??"Gap",i.appendChild(s),this.props.icon){const o=document.createElement("span");o.className="setting-icon",o.innerHTML=this.props.icon,i.insertBefore(o,s)}const n=document.createElement("div");n.className=`setting-input-wrapper ${this.props.wrapperClassName||""}`,n.classList.add("gap-setting-wrapper");const a=document.createElement("div");return a.className="gap-inputs-container",this.props.rowGap&&a.appendChild(this.createGapInput("row","Row")),this.props.columnGap&&a.appendChild(this.createGapInput("column","Col")),n.appendChild(a),e.appendChild(i),e.appendChild(n),t.appendChild(e),t}createGapInput(t,e){const i=document.createElement("div");i.className="gap-input-wrapper";const s=document.createElement("input");if(s.type="number",s.className=`gap-input gap-${t}-input ${this.props.inputClassName||""}`,s.id=`${this.id}-${t}-input`,s.min=String(this.props.minValue??0),this.props.maxValue!==void 0&&(s.max=String(this.props.maxValue)),s.step=String(this.props.step??1),s.value=String(this.inputValues[t]??this.value),s.title=e,s.addEventListener("input",n=>{const a=n.target;let o=parseFloat(a.value);o=this.validateValue(o),String(o)!==a.value&&(a.value=String(o)),this.inputValues[t]=o,this.setValue(o)}),s.addEventListener("blur",n=>{var l,h;const a=n.target;let o=parseFloat(a.value);o=this.validateValue(o),String(o)!==a.value&&(a.value=String(o),this.inputValues[t]=o,this.setValue(o)),(h=(l=this.props).onBlur)==null||h.call(l)}),i.appendChild(s),this.props.suffix&&this.props.suffix!=="none"){const n=document.createElement("span");n.className="gap-suffix",n.textContent=this.props.suffix,i.appendChild(n),s.style.paddingRight="30px"}return i}validateValue(t){(t==null||isNaN(t))&&(t=this.props.default??0);const e=this.props.minValue??Number.MIN_SAFE_INTEGER,i=this.props.maxValue??Number.MAX_SAFE_INTEGER;let s=Number(t);return s<e&&(s=e),s>i&&(s=i),s}getMobileValue(){return this.mobileValue}}class E extends f{constructor(t){var o;if(!t.tabs)throw new Error("Tabs array is required for TabsSettings");const e=t.tabs,i=t.activeTabId||((o=e[0])==null?void 0:o.id)||"",s=e.find(l=>l.id===i),n=s?s.settings:{},a={title:t.title||"",settings:n,collapsed:t.collapsed,main:t.main,description:t.description,icon:t.icon,custom:t.custom,hideCondition:t.hideCondition,onBlur:t.onBlur};super(a),this.tabs=[],this.activeTabId="",this.tabsContainer=null,this.previousTabId="",this.container=null,this.tabValues={},this.internalChangeTimeout=null,this.isHandlingInternalChange=!1,this.INTERNAL_CHANGE_DEBOUNCE=50,this.tabs=e,this.activeTabId=i,this.previousTabId=i,this.onStateChangeCallback=t.onStateChange,this.detectChangeCallback=t.detectChange,this.initializeTabValues(),this.connectChildChangeHandlers()}updateSettingsFromTab(t){const e=this.tabs.find(i=>i.id===t);e&&(this.settings=e.settings,this.tabValues[t]=this.getTabValues(e),this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId},Object.values(e.settings).forEach(i=>{i instanceof E&&(i._parentTabsSettings=this)}),this.connectChildChangeHandlers())}connectChildChangeHandlers(){if(!this.settings)return;const t=()=>{Promise.resolve().then(()=>{if(this.activeTabId){const e=this.tabs.find(i=>i.id===this.activeTabId);e&&(this.tabValues[this.activeTabId]=this.getTabValues(e))}this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId},this.triggerDebouncedChange()})};Object.values(this.settings).forEach(e=>{e instanceof f?e.setOnChange(()=>{t()}):e instanceof m&&e.setOnChange(()=>{t()})}),this.tabs.forEach(e=>{Object.entries(e.settings).forEach(([i,s])=>{(s instanceof f||s instanceof m)&&(s instanceof E?(s._parentTabsSettings=this,s.setOnChange(n=>{Promise.resolve().then(()=>{this.tabValues[e.id]=this.getTabValues(e),this.triggerDebouncedChange()})})):s instanceof f?s.setOnChange(()=>{Promise.resolve().then(()=>{this.tabValues[e.id]=this.getTabValues(e),this.triggerDebouncedChange()})}):s instanceof m&&s.setOnChange(()=>{Promise.resolve().then(()=>{this.tabValues[e.id]=this.getTabValues(e),this.triggerDebouncedChange()})}))})})}draw(){const t=super.draw();this.container=t,t.classList.add("tabs-settings-container");const e=document.createElement("div");e.classList.add("tabs-header"),this.main&&e.classList.add("main-header"),this.tabsContainer=e,this.tabs.forEach(s=>{const n=document.createElement("button");n.classList.add("tab-button"),s.id===this.activeTabId&&n.classList.add("active"),n.textContent=s.label,n.onclick=()=>this.handleTabClick(s.id),e.appendChild(n)});const i=t.querySelector(".setting-group-content");return i&&t.insertBefore(e,i),t}handleTabClick(t){var o,l;if(t===this.activeTabId)return;const e=this.tabs.find(h=>h.id===this.activeTabId);e&&(this.tabValues[this.activeTabId]=this.getTabValues(e)),this.previousTabId=this.activeTabId,this.activeTabId=t;const i=(o=this.tabsContainer)==null?void 0:o.querySelectorAll(".tab-button");i==null||i.forEach(h=>{if(h instanceof HTMLElement){const r=this.tabs.find(p=>p.label===h.textContent);h.classList.toggle("active",(r==null?void 0:r.id)===t)}}),this.updateSettingsFromTab(t);const s=(l=this.container)==null?void 0:l.querySelector(".setting-group-content");if(s){s.innerHTML="";const h=this.settings;Object.values(h).forEach(r=>{s.appendChild(r.draw())})}const n=this.getValues();this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId},this.connectChildChangeHandlers(),this.onStateChangeCallback&&this.onStateChangeCallback(t,n),this.detectChangeCallback&&this.detectChangeCallback(t,n),this.onChange&&this.onChange(n);const a=this.findParentTabsSettings();a&&a.onChange&&a.onChange(a.getValues())}findParentTabsSettings(){return this._parentTabsSettings||null}setOnStateChange(t){return this.onStateChangeCallback=t,this}setDetectChange(t){return this.detectChangeCallback=t,this}getActiveTabId(){return this.activeTabId}getValues(){return this.updateTabValues(),{tabs:this.tabValues,activeTabId:this.activeTabId}}updateTabValues(){!this.tabs||this.tabs.length===0||this.tabs.forEach(t=>{this.tabValues[t.id]=this.getTabValues(t)})}propagateChanges(){const t=this.findParentTabsSettings();t&&(t.updateTabValues(),t.triggerDebouncedChange())}triggerDebouncedChange(){this.isHandlingInternalChange||(this.isHandlingInternalChange=!0,this.internalChangeTimeout&&clearTimeout(this.internalChangeTimeout),this.internalChangeTimeout=setTimeout(()=>{this.onChange&&this.onChange(this.getValues()),this.isHandlingInternalChange=!1,this.internalChangeTimeout=null;const t=this.findParentTabsSettings();t&&t.triggerDebouncedChange()},this.INTERNAL_CHANGE_DEBOUNCE))}updateInitialValues(){!this.tabs||this.tabs.length===0||(this.updateTabValues(),this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId},this.tabs.forEach(t=>{Object.values(t.settings).forEach(e=>{e instanceof E&&e.updateInitialValues()})}))}setOnChange(t){return this.onChange=t,this.connectChildChangeHandlers(),this.updateTabValues(),this}initializeTabValues(){!this.tabs||this.tabs.length===0||(this.tabs.forEach(t=>{this.tabValues[t.id]=this.getTabValues(t)}),this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId})}getTabValues(t){const e={};return Object.entries(t.settings).forEach(([i,s])=>{s instanceof E||s instanceof f?e[i]=s.getValues():(s instanceof m,e[i]=s.value)}),e}clone(){const t=this.tabs.map(i=>{const s={};return Object.entries(i.settings).forEach(([n,a])=>{typeof a.clone=="function"?s[n]=a.clone():(console.warn(`Setting with key '${n}' in tab '${i.id}' does not have a clone method. Copying reference.`),s[n]=a)}),{...i,settings:s}}),e={title:this.title,tabs:t,activeTabId:this.activeTabId,collapsed:this.isCollapsed,main:this.isMain,description:this.description,icon:this.icon,custom:this.custom,hideCondition:this.hideCondition,settings:{}};return new E(e)}setValue(t){if(t&&typeof t=="object"){let e=!1;if(t.activeTabId&&t.activeTabId!==this.activeTabId&&(this.previousTabId=this.activeTabId,this.activeTabId=t.activeTabId,e=!0),t.tabs&&typeof t.tabs=="object"&&Object.entries(t.tabs).forEach(([i,s])=>{const n=this.tabs.find(a=>a.id===i);n&&s&&typeof s=="object"&&Object.entries(s).forEach(([a,o])=>{n.settings[a]&&typeof n.settings[a].setValue=="function"&&n.settings[a].setValue(o)})}),this.updateTabValues(),this.triggerDebouncedChange(),this.container){if(this.updateSettingsFromTab(this.activeTabId),this.tabsContainer){const s=this.tabsContainer.querySelectorAll(".tab-button");s==null||s.forEach(n=>{if(n instanceof HTMLElement){const a=this.tabs.find(o=>o.label===n.textContent);n.classList.toggle("active",(a==null?void 0:a.id)===this.activeTabId)}})}const i=this.container.querySelector(".setting-group-content");if(i){i.innerHTML="";const s=this.settings;Object.values(s).forEach(n=>{i.appendChild(n.draw())})}e&&this.onStateChangeCallback&&this.onStateChangeCallback(this.activeTabId,this.getValues())}this.initialValues={tabs:this.tabValues,activeTabId:this.activeTabId}}}updateTabSetting(t,e,i){const s=this.tabs.find(a=>a.id===t);if(!s||!s.settings[e])return;const n=s.settings[e];typeof n.setValue=="function"&&(n.setValue(i),this.tabValues[t]=this.getTabValues(s),t!==this.activeTabId&&this.onChange&&this.onChange(this.getValues()))}getTabsConfiguration(){return this.tabs}}const st=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
94
94
  <path d="M2.25 11.75H15.75M5.85 2.75H12.15C13.4101 2.75 14.0402 2.75 14.5215 2.99524C14.9448 3.21095 15.289 3.55516 15.5048 3.97852C15.75 4.45982 15.75 5.08988 15.75 6.35V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V6.35C2.25 5.08988 2.25 4.45982 2.49524 3.97852C2.71095 3.55516 3.05516 3.21095 3.47852 2.99524C3.95982 2.75 4.58988 2.75 5.85 2.75Z" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
95
95
  </svg>`;class nt extends b{constructor(t={}){super({...t,minValue:t.minValue??0,maxValue:t.maxValue??1e3,icon:t.icon||st,title:t.title||"Margin Bottom",default:t.default??20,wrapperClassName:"margin-bottom-wrapper "+(t.wrapperClassName||"")}),this.inputType="number"}}const at=`
96
96
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
@@ -100,7 +100,7 @@
100
100
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
101
101
  <path d="M6 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V6.5M6 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V12.5M15.75 6.5V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H12M15.75 12.5V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H12" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
102
102
  </svg>
103
- `;class lt extends f{constructor(t){super({title:"Border",collapsed:t==null?void 0:t.collapsed,hideCondition:t==null?void 0:t.hideCondition,settings:{size:new b({title:"Size",icon:ot,default:(t==null?void 0:t.size)??0,suffix:"px"}),color:new H({default:(t==null?void 0:t.color)??"0, 0, 30"}),opacity:new L({default:(t==null?void 0:t.opacity)??100,minValue:0,maxValue:100}),radius:new b({title:"Radius",icon:at,default:(t==null?void 0:t.radius)??12,suffix:"px"})}})}getCssCode(){const t=this.settings.color.value??"#000000",e=this.settings.opacity.value??100,i=this.settings.radius.value??0,s=this.settings.size.value??0;return`
103
+ `;class lt extends f{constructor(t){super({title:"Border",collapsed:t==null?void 0:t.collapsed,hideCondition:t==null?void 0:t.hideCondition,settings:{size:new b({title:"Size",icon:ot,default:(t==null?void 0:t.size)??0,suffix:"px"}),color:new H({default:(t==null?void 0:t.color)??"0, 0, 30"}),opacity:new y({default:(t==null?void 0:t.opacity)??100,minValue:0,maxValue:100}),radius:new b({title:"Radius",icon:at,default:(t==null?void 0:t.radius)??12,suffix:"px"})}})}getCssCode(){const t=this.settings.color.value??"#000000",e=this.settings.opacity.value??100,i=this.settings.radius.value??0,s=this.settings.size.value??0;return`
104
104
  border-color: ${t};
105
105
  border-width: ${s}px;
106
106
  border-radius: ${i}px;
@@ -117,7 +117,7 @@
117
117
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
118
118
  <path d="M6 5.75H12M9 5.75V13.25M5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
119
119
  </svg>
120
- `;class dt extends f{constructor(t={}){super({title:t.title||"Typography",collapsed:t.collapsed,hideCondition:t.hideCondition,settings:{color:new H({default:t.colorDefault??"0, 0, 30"}),opacity:new L({default:t.colorOpacityDefault??100}),fontFamily:new N({title:"Font",icon:rt,default:t.fontFamilyDefault??"Satoshi",options:t.fontFamilyOptions??[{name:"Satoshi",value:"Satoshi"},{name:"Arial",value:"Arial"},{name:"Roboto",value:"Roboto"}],getOptions:t.fontFamilyGetOptions,getOptionsAsync:t.fontFamilyGetOptionsAsync}),fontWeight:new N({title:"Weight",icon:ht,default:t.fontWeightDefault??"400",options:t.fontWeightOptions??[{name:"Regular",value:"400"},{name:"Medium",value:"500"},{name:"Bold",value:"600"}],getOptions:t.fontWeightGetOptions,getOptionsAsync:t.fontWeightGetOptionsAsync}),fontSize:new b({title:"Size",icon:ct,default:t.fontSizeDefault??12,suffix:"px",mobile:t.fontSizeMobileDefault}),align:new A({title:"Align",default:t.alignDefault??"center"})}})}getCssCode(){const t=this.settings.color.value??"#000000",e=this.settings.opacity.value??100,i=this.settings.fontFamily.value??"Satoshi",s=this.settings.fontWeight.value??"bold",n=this.settings.fontSize.value??12,a=this.settings.align.value??"left";return`
120
+ `;class dt extends f{constructor(t={}){super({title:t.title||"Typography",collapsed:t.collapsed,hideCondition:t.hideCondition,settings:{color:new H({default:t.colorDefault??"0, 0, 30"}),opacity:new y({default:t.colorOpacityDefault??100}),fontFamily:new N({title:"Font",icon:rt,default:t.fontFamilyDefault??"Satoshi",options:t.fontFamilyOptions??[{name:"Satoshi",value:"Satoshi"},{name:"Arial",value:"Arial"},{name:"Roboto",value:"Roboto"}],getOptions:t.fontFamilyGetOptions,getOptionsAsync:t.fontFamilyGetOptionsAsync}),fontWeight:new N({title:"Weight",icon:ht,default:t.fontWeightDefault??"400",options:t.fontWeightOptions??[{name:"Regular",value:"400"},{name:"Medium",value:"500"},{name:"Bold",value:"600"}],getOptions:t.fontWeightGetOptions,getOptionsAsync:t.fontWeightGetOptionsAsync}),fontSize:new b({title:"Size",icon:ct,default:t.fontSizeDefault??12,suffix:"px",mobile:t.fontSizeMobileDefault}),align:new A({title:"Align",default:t.alignDefault??"center"})}})}getCssCode(){const t=this.settings.color.value??"#000000",e=this.settings.opacity.value??100,i=this.settings.fontFamily.value??"Satoshi",s=this.settings.fontWeight.value??"bold",n=this.settings.fontSize.value??12,a=this.settings.align.value??"left";return`
121
121
  color: ${t};
122
122
  opacity: ${e/100};
123
123
  font-family: ${i};
@@ -158,7 +158,7 @@
158
158
  </svg>
159
159
  </span>
160
160
  <span class="add-label">Add Tab</span>
161
- `,i.onclick=()=>{this.addTab(),this.rerender()},e.appendChild(i),t.appendChild(e),t}rerender(){if(!this._el)return;const t=this._el.querySelector(".setting-group-content");t&&(t.innerHTML="",Object.keys(this.settings).forEach(e=>{const i=this.settings[e];t.appendChild(i.draw())}))}}class bt extends f{constructor(t){super({title:"Background Image",collapsed:t==null?void 0:t.collapsed,hideCondition:t==null?void 0:t.hideCondition,settings:{backgroundImage:new _({...t==null?void 0:t.uploadProps,default:(t==null?void 0:t.backgroundImage)??""}),opacity:new L({default:(t==null?void 0:t.opacity)??100}),backgroundColor:new H({default:(t==null?void 0:t.backgroundColor)??"0, 0, 30"}),opacityBG:new L({default:(t==null?void 0:t.opacityBG)??100})}})}draw(){const t=super.draw(),e=t.querySelector(".setting-group-content");if(!e)return t;const i=Array.from(e.children),[s,n,a,o]=i;e.innerHTML="",e.appendChild(s),e.appendChild(n);const l=document.createElement("div");return l.className="bgset-or-label",l.textContent="OR",e.appendChild(l),e.appendChild(a),e.appendChild(o),t}getCssCode(){const t=this.settings.backgroundImage.value||"",e=this.settings.opacity.value??100,i=this.settings.backgroundColor.value||"0, 0, 30",s=this.settings.opacityBG.value??100;return t?`
161
+ `,i.onclick=()=>{this.addTab(),this.rerender()},e.appendChild(i),t.appendChild(e),t}rerender(){if(!this._el)return;const t=this._el.querySelector(".setting-group-content");t&&(t.innerHTML="",Object.keys(this.settings).forEach(e=>{const i=this.settings[e];t.appendChild(i.draw())}))}}class bt extends f{constructor(t){super({title:"Background Image",collapsed:t==null?void 0:t.collapsed,hideCondition:t==null?void 0:t.hideCondition,settings:{backgroundImage:new $({...t==null?void 0:t.uploadProps,default:(t==null?void 0:t.backgroundImage)??""}),opacity:new y({default:(t==null?void 0:t.opacity)??100}),backgroundColor:new H({default:(t==null?void 0:t.backgroundColor)??"0, 0, 30"}),opacityBG:new y({default:(t==null?void 0:t.opacityBG)??100})}})}draw(){const t=super.draw(),e=t.querySelector(".setting-group-content");if(!e)return t;const i=Array.from(e.children),[s,n,a,o]=i;e.innerHTML="",e.appendChild(s),e.appendChild(n);const l=document.createElement("div");return l.className="bgset-or-label",l.textContent="OR",e.appendChild(l),e.appendChild(a),e.appendChild(o),t}getCssCode(){const t=this.settings.backgroundImage.value||"",e=this.settings.opacity.value??100,i=this.settings.backgroundColor.value||"0, 0, 30",s=this.settings.opacityBG.value??100;return t?`
162
162
  background-image: url("${t}");
163
163
  background-size: cover;
164
164
  background-position: center;
@@ -166,4 +166,4 @@
166
166
  `:`
167
167
  background-color: ${i};
168
168
  opacity: ${s/100};
169
- `}}exports.AlignSetting=A;exports.BackgroundSettingSet=bt;exports.BorderSettingSet=lt;exports.ButtonSetting=D;exports.ColorSetting=H;exports.DimensionSetting=F;exports.GapSetting=it;exports.HeaderTypographySettingSet=dt;exports.HeightSetting=Z;exports.MarginBottomSetting=nt;exports.MarginSettingGroup=ut;exports.NumberSetting=b;exports.OpacitySetting=L;exports.SelectApiSettings=K;exports.SelectSetting=N;exports.Setting=m;exports.SettingGroup=f;exports.StringSetting=M;exports.TabsContainerGroup=vt;exports.TabsSettings=E;exports.Toggle=tt;exports.UploadSetting=_;exports.WidthSetting=X;exports.iterateSettings=T;
169
+ `}}exports.AlignSetting=A;exports.BackgroundSettingSet=bt;exports.BorderSettingSet=lt;exports.ButtonSetting=D;exports.ColorSetting=H;exports.DimensionSetting=F;exports.GapSetting=it;exports.HeaderTypographySettingSet=dt;exports.HeightSetting=Z;exports.MarginBottomSetting=nt;exports.MarginSettingGroup=ut;exports.NumberSetting=b;exports.OpacitySetting=y;exports.SelectApiSettings=K;exports.SelectSetting=N;exports.Setting=m;exports.SettingGroup=f;exports.StringSetting=M;exports.TabsContainerGroup=vt;exports.TabsSettings=E;exports.Toggle=tt;exports.UploadSetting=$;exports.WidthSetting=X;exports.iterateSettings=T;
@@ -5,7 +5,7 @@ let R = (c = 21) => {
5
5
  t += A[e[c] & 63];
6
6
  return t;
7
7
  };
8
- function y(c) {
8
+ function V(c) {
9
9
  if (c === null || typeof c != "object")
10
10
  return c;
11
11
  if (c instanceof Date)
@@ -13,16 +13,16 @@ function y(c) {
13
13
  if (Array.isArray(c)) {
14
14
  const i = [];
15
15
  for (let s = 0; s < c.length; s++)
16
- i[s] = y(c[s]);
16
+ i[s] = V(c[s]);
17
17
  return i;
18
18
  }
19
19
  const t = {};
20
20
  for (const i in c)
21
- Object.prototype.hasOwnProperty.call(c, i) && (t[i] = y(c[i]));
21
+ Object.prototype.hasOwnProperty.call(c, i) && (t[i] = V(c[i]));
22
22
  const e = Object.getPrototypeOf(c);
23
23
  return e !== Object.prototype && Object.setPrototypeOf(t, e), t;
24
24
  }
25
- function _(c) {
25
+ function $(c) {
26
26
  switch (c) {
27
27
  case "number":
28
28
  return 0;
@@ -55,8 +55,8 @@ class m {
55
55
  }
56
56
  // Basic clone method
57
57
  clone() {
58
- const t = this.constructor, e = y(this.props), i = new t(e);
59
- return i.value = y(this.value), i;
58
+ const t = this.constructor, e = V(this.props), i = new t(e);
59
+ return i.value = V(this.value), i;
60
60
  }
61
61
  createInput(t) {
62
62
  t = { ...this.props.inputProps, ...t };
@@ -76,7 +76,7 @@ class m {
76
76
  const i = document.createElement("div");
77
77
  i.className = t.wrapperClassName || "";
78
78
  const s = document.createElement("input");
79
- this.inputEl = s, s.value = String(t.value || _(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "";
79
+ this.inputEl = s, s.value = String(t.value || $(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "";
80
80
  const n = (a) => {
81
81
  const o = a.target;
82
82
  let l = o.value;
@@ -324,10 +324,10 @@ const E = class E {
324
324
  );
325
325
  const h = o.querySelector(
326
326
  ".setting-group-description"
327
- ), u = n.querySelector(".info-marker");
327
+ ), p = n.querySelector(".info-marker");
328
328
  if (this.description)
329
329
  if (this.isCollapsed) {
330
- if (h && h.remove(), !u) {
330
+ if (h && h.remove(), !p) {
331
331
  const d = document.createElement("span");
332
332
  d.className = "info-marker", d.innerHTML = `
333
333
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -344,7 +344,7 @@ const E = class E {
344
344
  o.firstChild
345
345
  );
346
346
  }
347
- u && u.remove();
347
+ p && p.remove();
348
348
  }
349
349
  };
350
350
  if (e.onclick = l, e.onkeydown = (h) => {
@@ -352,8 +352,8 @@ const E = class E {
352
352
  }, Object.keys(this.settings).length > 0) {
353
353
  for (const h in this.settings)
354
354
  if (this.settings.hasOwnProperty(h)) {
355
- const u = this.settings[h];
356
- o.appendChild(u.draw());
355
+ const p = this.settings[h];
356
+ o.appendChild(p.draw());
357
357
  }
358
358
  } else {
359
359
  const h = document.createElement("div");
@@ -448,37 +448,43 @@ class O extends H {
448
448
  const n = document.createElement("div");
449
449
  n.className = "color-input-wrapper";
450
450
  const a = (d) => {
451
- const g = d.value.split(",").map((N) => parseInt(N.trim()));
452
- if (g.length !== 3 || g.some(isNaN))
451
+ const u = d.value.split(",").map((N) => parseInt(N.trim()));
452
+ if (u.length !== 3 || u.some(isNaN))
453
453
  return d.style.border = "1px solid red", !1;
454
- const [p, C, v] = g, L = p >= 0 && p <= 255 && C >= 0 && C <= 255 && v >= 0 && v <= 255;
455
- return d.style.border = L ? "" : "1px solid red", L;
454
+ const [g, C, v] = u, y = g >= 0 && g <= 255 && C >= 0 && C <= 255 && v >= 0 && v <= 255;
455
+ return d.style.border = y ? "" : "1px solid red", y;
456
456
  }, o = document.createElement("div");
457
- o.className = "color-preview", o.style.backgroundColor = this.value ? `rgb(${this.value})` : "";
457
+ o.className = "color-preview", o.style.backgroundColor = typeof this.value == "string" && this.value ? `rgb(${this.value})` : "";
458
458
  const l = this.createInput({
459
- value: this.value,
459
+ value: typeof this.value == "string" ? this.value : "",
460
460
  inputType: "text",
461
461
  inputClassName: "color-text-input"
462
462
  }), r = l.querySelector("input");
463
463
  r.readOnly = !0;
464
464
  const h = this.createInput({
465
- value: this.value ? this.rgbToHex(this.value) : "",
465
+ value: typeof this.value == "string" ? this.rgbToHex(this.value) : "#000000",
466
466
  inputType: this.inputType,
467
467
  inputClassName: "color-picker"
468
- }), u = h.querySelector("input");
469
- return r.oninput = (d) => {
470
- var p;
471
- let g = d.target.value.trim();
472
- a(r) && (this.value = g, (p = this.onChange) == null || p.call(this, g), u.value = this.rgbToHex(g), o.style.backgroundColor = `rgb(${g})`);
473
- }, u.oninput = (d) => {
468
+ }), p = h.querySelector("input");
469
+ if (r.oninput = (d) => {
470
+ var g;
471
+ let u = d.target.value.trim();
472
+ a(r) && (this.value = u, (g = this.onChange) == null || g.call(this, u), p.value = this.rgbToHex(u), o.style.backgroundColor = `rgb(${u})`);
473
+ }, p.oninput = (d) => {
474
474
  var C, v;
475
- const g = d.target.value, p = this.hexToRgb(g);
476
- this.value = p, (C = this.onChange) == null || C.call(this, p), (v = this.detectChange) == null || v.call(this, p), r.value = p, o.style.backgroundColor = `rgb(${p})`;
477
- }, u.onchange = (d) => {
475
+ const u = d.target.value, g = this.hexToRgb(u);
476
+ this.value = g, (C = this.onChange) == null || C.call(this, g), (v = this.detectChange) == null || v.call(this, g), r.value = g, o.style.backgroundColor = `rgb(${g})`;
477
+ }, p.onchange = (d) => {
478
478
  var C, v;
479
- const g = d.target.value, p = this.hexToRgb(g);
480
- this.value = p, (C = this.onChange) == null || C.call(this, p), (v = this.detectChange) == null || v.call(this, p), r.value = p, o.style.backgroundColor = `rgb(${p})`;
481
- }, n.appendChild(o), n.appendChild(h), n.appendChild(l), t.appendChild(e), t.appendChild(n), this.value && (r.value = this.value, u.value = this.rgbToHex(this.value), o.style.backgroundColor = `rgb(${this.value})`), t;
479
+ const u = d.target.value, g = this.hexToRgb(u);
480
+ this.value = g, (C = this.onChange) == null || C.call(this, g), (v = this.detectChange) == null || v.call(this, g), r.value = g, o.style.backgroundColor = `rgb(${g})`;
481
+ }, n.appendChild(o), n.appendChild(h), n.appendChild(l), t.appendChild(e), t.appendChild(n), typeof this.value == "string" && this.value.includes(","))
482
+ r.value = this.value, p.value = this.rgbToHex(this.value), o.style.backgroundColor = `rgb(${this.value})`;
483
+ else {
484
+ let d = "", u = "#000000";
485
+ typeof this.value == "string" ? (d = this.value, u = this.rgbToHex(this.value)) : this.value !== void 0 ? (console.warn(`ColorSetting: Initial value "${this.value}" (type: ${typeof this.value}) is not a string. Displaying default color.`), d = "0,0,0", u = this.rgbToHex(d)) : (d = "", u = "#000000"), r.value = d, p.value = u, o.style.backgroundColor = d ? `rgb(${d})` : "";
486
+ }
487
+ return t;
482
488
  }
483
489
  }
484
490
  class b extends m {
@@ -531,7 +537,7 @@ class b extends m {
531
537
  this.props.minValue !== void 0 && (this.props.default ?? 0) < this.props.minValue && console.warn(`Default value ${this.props.default} is less than minValue ${this.props.minValue}`), this.props.maxValue !== void 0 && (this.props.default ?? 0) > this.props.maxValue && console.warn(`Default value ${this.props.default} is greater than maxValue ${this.props.maxValue}`);
532
538
  }
533
539
  }
534
- const $ = `
540
+ const _ = `
535
541
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
536
542
  <path d="M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
537
543
  <path d="M9 1V17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1Z" fill="#667085" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -545,7 +551,7 @@ class T extends b {
545
551
  maxValue: 100,
546
552
  step: 1,
547
553
  default: t.default ?? 100,
548
- icon: $,
554
+ icon: _,
549
555
  ...t
550
556
  };
551
557
  super(e), this.inputType = "number", this.mobileValue = t.mobile;
@@ -895,20 +901,20 @@ class U extends m {
895
901
  return o.type = "file", o.accept = "image/*", o.style.display = "none", i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(a), t.appendChild(i), t.appendChild(o), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), a.onclick = () => {
896
902
  o.click();
897
903
  }, o.onchange = async () => {
898
- var r, h, u, d;
904
+ var r, h, p, d;
899
905
  const l = (r = o.files) == null ? void 0 : r[0];
900
906
  if (l)
901
907
  try {
902
908
  a.classList.add("loading"), a.disabled = !0;
903
- const g = new FormData(), p = this.props.formFieldName || "file";
904
- g.append(p, l, l.name);
909
+ const u = new FormData(), g = this.props.formFieldName || "file";
910
+ u.append(g, l, l.name);
905
911
  const C = this.props.uploadUrl;
906
912
  if (!C)
907
913
  throw new Error("No uploadUrl provided to UploadSetting.");
908
- const v = this.props.requestMethod || "POST", L = { ...this.props.requestHeaders || {} }, k = await (await fetch(C, {
914
+ const v = this.props.requestMethod || "POST", y = { ...this.props.requestHeaders || {} }, k = await (await fetch(C, {
909
915
  method: v,
910
- body: g,
911
- headers: L
916
+ body: u,
917
+ headers: y
912
918
  })).json();
913
919
  console.log("Upload response:", k);
914
920
  let w;
@@ -918,9 +924,9 @@ class U extends m {
918
924
  throw new Error(
919
925
  "No URL found in response. Provide a parseResponse if needed."
920
926
  );
921
- console.log("Final URL:", w), this.value = w, this.updatePreviewState(w), (u = this.onChange) == null || u.call(this, w), (d = this.onBlur) == null || d.call(this);
922
- } catch (g) {
923
- console.error("Error uploading file:", g);
927
+ console.log("Final URL:", w), this.value = w, this.updatePreviewState(w), (p = this.onChange) == null || p.call(this, w), (d = this.onBlur) == null || d.call(this);
928
+ } catch (u) {
929
+ console.error("Error uploading file:", u);
924
930
  } finally {
925
931
  a.classList.remove("loading"), a.disabled = !1, o.value = "";
926
932
  }
@@ -1061,7 +1067,7 @@ class dt extends m {
1061
1067
  })), t;
1062
1068
  }
1063
1069
  selectApiOption(t, e, i) {
1064
- var l, r, h, u;
1070
+ var l, r, h, p;
1065
1071
  const s = t.target, n = s.querySelector(".select-api-radio") || ((l = s.closest(".select-api-option")) == null ? void 0 : l.querySelector(".select-api-radio"));
1066
1072
  n && (n.checked = !0), this.selectedOptionIndex = e;
1067
1073
  const a = this._options[e].value;
@@ -1073,7 +1079,7 @@ class dt extends m {
1073
1079
  const d = i.firstChild;
1074
1080
  d && d.tagName === "SPAN" && (d.textContent = this._options[e].name);
1075
1081
  }
1076
- this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (h = this.svgContainer) == null || h.classList.remove("open"), (u = this.onChange) == null || u.call(this, a), this.detectChangeCallback && this.detectChangeCallback(a);
1082
+ this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (h = this.svgContainer) == null || h.classList.remove("open"), (p = this.onChange) == null || p.call(this, a), this.detectChangeCallback && this.detectChangeCallback(a);
1077
1083
  }
1078
1084
  updateOptionsList() {
1079
1085
  !this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
@@ -1130,7 +1136,7 @@ class ut extends m {
1130
1136
  const s = document.createElement("input");
1131
1137
  s.type = "checkbox", s.checked = ((o = (a = this.props.options) == null ? void 0 : a.find((l) => l.value === this.value)) == null ? void 0 : o.status) ?? !1, s.addEventListener("change", () => {
1132
1138
  var r, h;
1133
- const l = ((h = (r = this.props.options) == null ? void 0 : r.find((u) => u.status === s.checked)) == null ? void 0 : h.value) ?? "";
1139
+ const l = ((h = (r = this.props.options) == null ? void 0 : r.find((p) => p.status === s.checked)) == null ? void 0 : h.value) ?? "";
1134
1140
  this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
1135
1141
  });
1136
1142
  const n = document.createElement("span");
@@ -1294,7 +1300,7 @@ class x extends f {
1294
1300
  const i = (o = this.tabsContainer) == null ? void 0 : o.querySelectorAll(".tab-button");
1295
1301
  i == null || i.forEach((r) => {
1296
1302
  if (r instanceof HTMLElement) {
1297
- const h = this.tabs.find((u) => u.label === r.textContent);
1303
+ const h = this.tabs.find((p) => p.label === r.textContent);
1298
1304
  r.classList.toggle("active", (h == null ? void 0 : h.id) === t);
1299
1305
  }
1300
1306
  }), this.updateSettingsFromTab(t);
@@ -1619,7 +1625,7 @@ class ft extends f {
1619
1625
  `;
1620
1626
  }
1621
1627
  }
1622
- class V extends m {
1628
+ class L extends m {
1623
1629
  constructor(t) {
1624
1630
  super({
1625
1631
  ...t,
@@ -1672,25 +1678,25 @@ class Ct extends f {
1672
1678
  collapsed: t == null ? void 0 : t.collapsed,
1673
1679
  hideCondition: t == null ? void 0 : t.hideCondition,
1674
1680
  settings: {
1675
- marginTop: new V({
1681
+ marginTop: new L({
1676
1682
  title: "Top",
1677
1683
  icon: it,
1678
1684
  suffix: "px",
1679
1685
  default: (t == null ? void 0 : t.marginTop) ?? "auto"
1680
1686
  }),
1681
- marginRight: new V({
1687
+ marginRight: new L({
1682
1688
  title: "Right",
1683
1689
  icon: st,
1684
1690
  suffix: "px",
1685
1691
  default: (t == null ? void 0 : t.marginRight) ?? 0
1686
1692
  }),
1687
- marginBottom: new V({
1693
+ marginBottom: new L({
1688
1694
  title: "Bottom",
1689
1695
  icon: nt,
1690
1696
  suffix: "px",
1691
1697
  default: (t == null ? void 0 : t.marginBottom) ?? 0
1692
1698
  }),
1693
- marginLeft: new V({
1699
+ marginLeft: new L({
1694
1700
  title: "Left",
1695
1701
  icon: at,
1696
1702
  suffix: "px",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "builder-settings-types",
3
3
  "description": "builder settings",
4
- "version": "0.0.149",
4
+ "version": "0.0.150",
5
5
  "type": "module",
6
6
  "main": "dist/builder-settings-types.cjs.js",
7
7
  "module": "dist/builder-settings-types.es.js",